airport-one-widgets 0.2.36 → 0.2.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -647,4 +647,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
647
647
|
}`;function hN(){var e=SM,t=CM,n=Q.cssPrefix,r=Q.replacementClass,i=mN;if(n!==e||r!==t){var a=RegExp(`\\.${e}\\-`,`g`),o=RegExp(`\\--${e}\\-`,`g`),s=RegExp(`\\.${t}`,`g`);i=i.replace(a,`.${n}-`).replace(o,`--${n}-`).replace(s,`.${r}`)}return i}var gN=!1;function _N(){Q.autoAddCss&&!gN&&(rN(hN()),gN=!0)}var vN={mixout:function(){return{dom:{css:hN,insertCss:_N}}},hooks:function(){return{beforeDOMElementCreation:function(){_N()},beforeI2svg:function(){_N()}}}},yN=ej||{};yN[bM]||(yN[bM]={}),yN[bM].styles||(yN[bM].styles={}),yN[bM].hooks||(yN[bM].hooks={}),yN[bM].shims||(yN[bM].shims=[]);var bN=yN[bM],xN=[],SN=function(){tj.removeEventListener(`DOMContentLoaded`,SN),CN=1,xN.map(function(e){return e()})},CN=!1;ij&&(CN=(tj.documentElement.doScroll?/^loaded|^c/:/^loaded|^i|^c/).test(tj.readyState),CN||tj.addEventListener(`DOMContentLoaded`,SN));function wN(e){ij&&(CN?setTimeout(e,0):xN.push(e))}function TN(e){var t=e.tag,n=e.attributes,r=n===void 0?{}:n,i=e.children,a=i===void 0?[]:i;return typeof e==`string`?cN(e):`<${t} ${lN(r)}>${a.map(TN).join(``)}</${t}>`}function EN(e,t,n){if(e&&e[t]&&e[t][n])return{prefix:t,iconName:n,icon:e[t][n]}}var DN=function(e,t){return function(n,r,i,a){return e.call(t,n,r,i,a)}},ON=function(e,t,n,r){var i=Object.keys(e),a=i.length,o=r===void 0?t:DN(t,r),s,c,l;for(n===void 0?(s=1,l=e[i[0]]):(s=0,l=n);s<a;s++)c=i[s],l=o(l,e[c],c,e);return l};function kN(e){return HA(e).length===1?e.codePointAt(0).toString(16):null}function AN(e){return Object.keys(e).reduce(function(t,n){var r=e[n];return r.icon?t[r.iconName]=r.icon:t[n]=r,t},{})}function jN(e,t){var n=(arguments.length>2&&arguments[2]!==void 0?arguments[2]:{}).skipHooks,r=n===void 0?!1:n,i=AN(t);typeof bN.hooks.addPack==`function`&&!r?bN.hooks.addPack(e,AN(t)):bN.styles[e]=Z(Z({},bN.styles[e]||{}),i),e===`fas`&&jN(`fa`,t)}var MN=bN.styles,NN=bN.shims,PN=Object.keys(BM),FN=PN.reduce(function(e,t){return e[t]=Object.keys(BM[t]),e},{}),IN=null,LN={},RN={},zN={},BN={},VN={};function HN(e){return~qM.indexOf(e)}function UN(e,t){var n=t.split(`-`),r=n[0],i=n.slice(1).join(`-`);return r===e&&i!==``&&!HN(i)?i:null}var WN=function(){var e=function(e){return ON(MN,function(t,n,r){return t[r]=ON(n,e,{}),t},{})};LN=e(function(e,t,n){return t[3]&&(e[t[3]]=n),t[2]&&t[2].filter(function(e){return typeof e==`number`}).forEach(function(t){e[t.toString(16)]=n}),e}),RN=e(function(e,t,n){return e[n]=n,t[2]&&t[2].filter(function(e){return typeof e==`string`}).forEach(function(t){e[t]=n}),e}),VN=e(function(e,t,n){var r=t[2];return e[n]=n,r.forEach(function(t){e[t]=n}),e});var t=`far`in MN||Q.autoFetchSvg,n=ON(NN,function(e,n){var r=n[0],i=n[1],a=n[2];return i===`far`&&!t&&(i=`fas`),typeof r==`string`&&(e.names[r]={prefix:i,iconName:a}),typeof r==`number`&&(e.unicodes[r.toString(16)]={prefix:i,iconName:a}),e},{names:{},unicodes:{}});zN=n.names,BN=n.unicodes,IN=$N(Q.styleDefault,{family:Q.familyDefault})};eN(function(e){IN=$N(e.styleDefault,{family:Q.familyDefault})}),WN();function GN(e,t){return(LN[e]||{})[t]}function KN(e,t){return(RN[e]||{})[t]}function qN(e,t){return(VN[e]||{})[t]}function JN(e){return zN[e]||{prefix:null,iconName:null}}function YN(e){var t=BN[e],n=GN(`fas`,e);return t||(n?{prefix:`fas`,iconName:n}:null)||{prefix:null,iconName:null}}function XN(){return IN}var ZN=function(){return{prefix:null,iconName:null,rest:[]}};function QN(e){var t=fj,n=PN.reduce(function(e,t){return e[t]=`${Q.cssPrefix}-${t}`,e},{});return Xj.forEach(function(r){(e.includes(n[r])||e.some(function(e){return FN[r].includes(e)}))&&(t=r)}),t}function $N(e){var t=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}).family,n=t===void 0?fj:t,r=IM[n][e];if(n===pj&&!e)return`fad`;var i=RM[n][e]||RM[n][r],a=e in bN.styles?e:null;return i||a||null}function eP(e){var t=[],n=null;return e.forEach(function(e){var r=UN(Q.cssPrefix,e);r?n=r:e&&t.push(e)}),{iconName:n,rest:t}}function tP(e){return e.sort().filter(function(e,t,n){return n.indexOf(e)===t})}var nP=mM.concat(tM);function rP(e){var t=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}).skipLookups,n=t===void 0?!1:t,r=null,i=tP(e.filter(function(e){return nP.includes(e)})),a=tP(e.filter(function(e){return!nP.includes(e)})),o=VA(i.filter(function(e){return r=e,!dj.includes(e)}),1)[0],s=o===void 0?null:o,c=QN(i),l=Z(Z({},eP(a)),{},{prefix:$N(s,{family:c})});return Z(Z(Z({},l),sP({values:e,family:c,styles:MN,config:Q,canonical:l,givenPrefix:r})),iP(n,r,l))}function iP(e,t,n){var r=n.prefix,i=n.iconName;if(e||!r||!i)return{prefix:r,iconName:i};var a=t===`fa`?JN(i):{},o=qN(r,i);return i=a.iconName||o||i,r=a.prefix||r,r===`far`&&!MN.far&&MN.fas&&!Q.autoFetchSvg&&(r=`fas`),{prefix:r,iconName:i}}var aP=Xj.filter(function(e){return e!==fj||e!==pj}),oP=Object.keys(pM).filter(function(e){return e!==fj}).map(function(e){return Object.keys(pM[e])}).flat();function sP(e){var t=e.values,n=e.family,r=e.canonical,i=e.givenPrefix,a=i===void 0?``:i,o=e.styles,s=o===void 0?{}:o,c=e.config,l=c===void 0?{}:c,u=n===pj,d=t.includes(`fa-duotone`)||t.includes(`fad`),f=l.familyDefault===`duotone`,p=r.prefix===`fad`||r.prefix===`fa-duotone`;return!u&&(d||f||p)&&(r.prefix=`fad`),(t.includes(`fa-brands`)||t.includes(`fab`))&&(r.prefix=`fab`),!r.prefix&&aP.includes(n)&&(Object.keys(s).find(function(e){return oP.includes(e)})||l.autoFetchSvg)&&(r.prefix=$j.get(n).defaultShortPrefixId,r.iconName=qN(r.prefix,r.iconName)||r.iconName),(r.prefix===`fa`||a===`fa`)&&(r.prefix=XN()||`fas`),r}var cP=function(){function e(){jA(this,e),this.definitions={}}return NA(e,[{key:`add`,value:function(){for(var e=this,t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=n.reduce(this._pullDefinitions,{});Object.keys(i).forEach(function(t){e.definitions[t]=Z(Z({},e.definitions[t]||{}),i[t]),jN(t,i[t]);var n=BM[fj][t];n&&jN(n,i[t]),WN()})}},{key:`reset`,value:function(){this.definitions={}}},{key:`_pullDefinitions`,value:function(e,t){var n=t.prefix&&t.iconName&&t.icon?{0:t}:t;return Object.keys(n).map(function(t){var r=n[t],i=r.prefix,a=r.iconName,o=r.icon,s=o[2];e[i]||(e[i]={}),s.length>0&&s.forEach(function(t){typeof t==`string`&&(e[i][t]=o)}),e[i][a]=o}),e}}])}(),lP=[],uP={},dP={},fP=Object.keys(dP);function pP(e,t){var n=t.mixoutsTo;return lP=e,uP={},Object.keys(dP).forEach(function(e){fP.indexOf(e)===-1&&delete dP[e]}),lP.forEach(function(e){var t=e.mixout?e.mixout():{};if(Object.keys(t).forEach(function(e){typeof t[e]==`function`&&(n[e]=t[e]),GA(t[e])===`object`&&Object.keys(t[e]).forEach(function(r){n[e]||(n[e]={}),n[e][r]=t[e][r]})}),e.hooks){var r=e.hooks();Object.keys(r).forEach(function(e){uP[e]||(uP[e]=[]),uP[e].push(r[e])})}e.provides&&e.provides(dP)}),n}function mP(e,t){for(var n=arguments.length,r=Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return(uP[e]||[]).forEach(function(e){t=e.apply(null,[t].concat(r))}),t}function hP(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];(uP[e]||[]).forEach(function(e){e.apply(null,n)})}function gP(){var e=arguments[0],t=Array.prototype.slice.call(arguments,1);return dP[e]?dP[e].apply(null,t):void 0}function _P(e){e.prefix===`fa`&&(e.prefix=`fas`);var t=e.iconName,n=e.prefix||XN();if(t)return t=qN(n,t)||t,EN(vP.definitions,n,t)||EN(bN.styles,n,t)}var vP=new cP,yP={noAuto:function(){Q.autoReplaceSvg=!1,Q.observeMutations=!1,hP(`noAuto`)},config:Q,dom:{i2svg:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return ij?(hP(`beforeI2svg`,e),gP(`pseudoElements2svg`,e),gP(`i2svg`,e)):Promise.reject(Error(`Operation requires a DOM of some kind.`))},watch:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.autoReplaceSvgRoot;Q.autoReplaceSvg===!1&&(Q.autoReplaceSvg=!0),Q.observeMutations=!0,wN(function(){bP({autoReplaceSvgRoot:t}),hP(`watch`,e)})}},parse:{icon:function(e){if(e===null)return null;if(GA(e)===`object`&&e.prefix&&e.iconName)return{prefix:e.prefix,iconName:qN(e.prefix,e.iconName)||e.iconName};if(Array.isArray(e)&&e.length===2){var t=e[1].indexOf(`fa-`)===0?e[1].slice(3):e[1],n=$N(e[0]);return{prefix:n,iconName:qN(n,t)||t}}if(typeof e==`string`&&(e.indexOf(`${Q.cssPrefix}-`)>-1||e.match(HM))){var r=rP(e.split(` `),{skipLookups:!0});return{prefix:r.prefix||XN(),iconName:qN(r.prefix,r.iconName)||r.iconName}}if(typeof e==`string`){var i=XN();return{prefix:i,iconName:qN(i,e)||e}}}},library:vP,findIconDefinition:_P,toHtml:TN},bP=function(){var e=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}).autoReplaceSvgRoot,t=e===void 0?tj:e;(Object.keys(bN.styles).length>0||Q.autoFetchSvg)&&ij&&Q.autoReplaceSvg&&yP.dom.i2svg({node:t})};function xP(e,t){return Object.defineProperty(e,`abstract`,{get:t}),Object.defineProperty(e,`html`,{get:function(){return e.abstract.map(function(e){return TN(e)})}}),Object.defineProperty(e,`node`,{get:function(){if(ij){var t=tj.createElement(`div`);return t.innerHTML=e.html,t.children}}}),e}function SP(e){var t=e.children,n=e.main,r=e.mask,i=e.attributes,a=e.styles,o=e.transform;if(dN(o)&&n.found&&!r.found){var s={x:n.width/n.height/2,y:.5};i.style=uN(Z(Z({},a),{},{"transform-origin":`${s.x+o.x/16}em ${s.y+o.y/16}em`}))}return[{tag:`svg`,attributes:i,children:t}]}function CP(e){var t=e.prefix,n=e.iconName,r=e.children,i=e.attributes,a=e.symbol,o=a===!0?`${t}-${Q.cssPrefix}-${n}`:a;return[{tag:`svg`,attributes:{style:`display: none;`},children:[{tag:`symbol`,attributes:Z(Z({},i),{},{id:o}),children:r}]}]}function wP(e){return[`aria-label`,`aria-labelledby`,`title`,`role`].some(function(t){return t in e})}function TP(e){var t=e.icons,n=t.main,r=t.mask,i=e.prefix,a=e.iconName,o=e.transform,s=e.symbol,c=e.maskId,l=e.extra,u=e.watchable,d=u===void 0?!1:u,f=r.found?r:n,p=f.width,m=f.height,h=[Q.replacementClass,a?`${Q.cssPrefix}-${a}`:``].filter(function(e){return l.classes.indexOf(e)===-1}).filter(function(e){return e!==``||!!e}).concat(l.classes).join(` `),g={children:[],attributes:Z(Z({},l.attributes),{},{"data-prefix":i,"data-icon":a,class:h,role:l.attributes.role||`img`,viewBox:`0 0 ${p} ${m}`})};!wP(l.attributes)&&!l.attributes[`aria-hidden`]&&(g.attributes[`aria-hidden`]=`true`),d&&(g.attributes[wM]=``);var _=Z(Z({},g),{},{prefix:i,iconName:a,main:n,mask:r,maskId:c,transform:o,symbol:s,styles:Z({},l.styles)}),v=r.found&&n.found?gP(`generateAbstractMask`,_)||{children:[],attributes:{}}:gP(`generateAbstractIcon`,_)||{children:[],attributes:{}},y=v.children,b=v.attributes;return _.children=y,_.attributes=b,s?CP(_):SP(_)}function EP(e){var t=e.content,n=e.width,r=e.height,i=e.transform,a=e.extra,o=e.watchable,s=o===void 0?!1:o,c=Z(Z({},a.attributes),{},{class:a.classes.join(` `)});s&&(c[wM]=``);var l=Z({},a.styles);dN(i)&&(l.transform=pN({transform:i,startCentered:!0,width:n,height:r}),l[`-webkit-transform`]=l.transform);var u=uN(l);u.length>0&&(c.style=u);var d=[];return d.push({tag:`span`,attributes:c,children:[t]}),d}function DP(e){var t=e.content,n=e.extra,r=Z(Z({},n.attributes),{},{class:n.classes.join(` `)}),i=uN(n.styles);i.length>0&&(r.style=i);var a=[];return a.push({tag:`span`,attributes:r,children:[t]}),a}var OP=bN.styles;function kP(e){var t=e[0],n=e[1],r=VA(e.slice(4),1)[0],i=null;return i=Array.isArray(r)?{tag:`g`,attributes:{class:`${Q.cssPrefix}-${KM.GROUP}`},children:[{tag:`path`,attributes:{class:`${Q.cssPrefix}-${KM.SECONDARY}`,fill:`currentColor`,d:r[0]}},{tag:`path`,attributes:{class:`${Q.cssPrefix}-${KM.PRIMARY}`,fill:`currentColor`,d:r[1]}}]}:{tag:`path`,attributes:{fill:`currentColor`,d:r}},{found:!0,width:t,height:n,icon:i}}var AP={found:!1,width:512,height:512};function jP(e,t){!NM&&!Q.showMissingIcons&&e&&console.error(`Icon with name "${e}" and prefix "${t}" is missing.`)}function MP(e,t){var n=t;return t===`fa`&&Q.styleDefault!==null&&(t=XN()),new Promise(function(r,i){if(n===`fa`){var a=JN(e)||{};e=a.iconName||e,t=a.prefix||t}if(e&&t&&OP[t]&&OP[t][e]){var o=OP[t][e];return r(kP(o))}jP(e,t),r(Z(Z({},AP),{},{icon:Q.showMissingIcons&&e&&gP(`missingIconAbstract`)||{}}))})}var NP=function(){},PP=Q.measurePerformance&&rj&&rj.mark&&rj.measure?rj:{mark:NP,measure:NP},FP=`FA "7.2.0"`,IP=function(e){return PP.mark(`${FP} ${e} begins`),function(){return LP(e)}},LP=function(e){PP.mark(`${FP} ${e} ends`),PP.measure(`${FP} ${e}`,`${FP} ${e} begins`,`${FP} ${e} ends`)},RP={begin:IP,end:LP},zP=function(){};function BP(e){return typeof(e.getAttribute?e.getAttribute(wM):null)==`string`}function VP(e){var t=e.getAttribute?e.getAttribute(DM):null,n=e.getAttribute?e.getAttribute(OM):null;return t&&n}function HP(e){return e&&e.classList&&e.classList.contains&&e.classList.contains(Q.replacementClass)}function UP(){return Q.autoReplaceSvg===!0?JP.replace:JP[Q.autoReplaceSvg]||JP.replace}function WP(e){return tj.createElementNS(`http://www.w3.org/2000/svg`,e)}function GP(e){return tj.createElement(e)}function KP(e){var t=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}).ceFn,n=t===void 0?e.tag===`svg`?WP:GP:t;if(typeof e==`string`)return tj.createTextNode(e);var r=n(e.tag);return Object.keys(e.attributes||[]).forEach(function(t){r.setAttribute(t,e.attributes[t])}),(e.children||[]).forEach(function(e){r.appendChild(KP(e,{ceFn:n}))}),r}function qP(e){var t=` ${e.outerHTML} `;return t=`${t}Font Awesome fontawesome.com `,t}var JP={replace:function(e){var t=e[0];if(t.parentNode)if(e[1].forEach(function(e){t.parentNode.insertBefore(KP(e),t)}),t.getAttribute(wM)===null&&Q.keepOriginalSource){var n=tj.createComment(qP(t));t.parentNode.replaceChild(n,t)}else t.remove()},nest:function(e){var t=e[0],n=e[1];if(~sN(t).indexOf(Q.replacementClass))return JP.replace(e);var r=RegExp(`${Q.cssPrefix}-.*`);if(delete n[0].attributes.id,n[0].attributes.class){var i=n[0].attributes.class.split(` `).reduce(function(e,t){return t===Q.replacementClass||t.match(r)?e.toSvg.push(t):e.toNode.push(t),e},{toNode:[],toSvg:[]});n[0].attributes.class=i.toSvg.join(` `),i.toNode.length===0?t.removeAttribute(`class`):t.setAttribute(`class`,i.toNode.join(` `))}var a=n.map(function(e){return TN(e)}).join(`
|
|
648
648
|
`);t.setAttribute(wM,``),t.innerHTML=a}};function YP(e){e()}function XP(e,t){var n=typeof t==`function`?t:zP;if(e.length===0)n();else{var r=YP;Q.mutateApproach===AM&&(r=ej.requestAnimationFrame||YP),r(function(){var t=UP(),r=RP.begin(`mutate`);e.map(t),r(),n()})}}var ZP=!1;function QP(){ZP=!0}function $P(){ZP=!1}var eF=null;function tF(e){if(nj&&Q.observeMutations){var t=e.treeCallback,n=t===void 0?zP:t,r=e.nodeCallback,i=r===void 0?zP:r,a=e.pseudoElementsCallback,o=a===void 0?zP:a,s=e.observeMutationsRoot,c=s===void 0?tj:s;eF=new nj(function(e){if(!ZP){var t=XN();oN(e).forEach(function(e){if(e.type===`childList`&&e.addedNodes.length>0&&!BP(e.addedNodes[0])&&(Q.searchPseudoElements&&o(e.target),n(e.target)),e.type===`attributes`&&e.target.parentNode&&Q.searchPseudoElements&&o([e.target],!0),e.type===`attributes`&&BP(e.target)&&~GM.indexOf(e.attributeName))if(e.attributeName===`class`&&VP(e.target)){var r=rP(sN(e.target)),a=r.prefix,s=r.iconName;e.target.setAttribute(DM,a||t),s&&e.target.setAttribute(OM,s)}else HP(e.target)&&i(e.target)})}}),ij&&eF.observe(c,{childList:!0,attributes:!0,characterData:!0,subtree:!0})}}function nF(){eF&&eF.disconnect()}function rF(e){var t=e.getAttribute(`style`),n=[];return t&&(n=t.split(`;`).reduce(function(e,t){var n=t.split(`:`),r=n[0],i=n.slice(1);return r&&i.length>0&&(e[r]=i.join(`:`).trim()),e},{})),n}function iF(e){var t=e.getAttribute(`data-prefix`),n=e.getAttribute(`data-icon`),r=e.innerText===void 0?``:e.innerText.trim(),i=rP(sN(e));return i.prefix||=XN(),t&&n&&(i.prefix=t,i.iconName=n),i.iconName&&i.prefix?i:(i.prefix&&r.length>0&&(i.iconName=KN(i.prefix,e.innerText)||GN(i.prefix,kN(e.innerText))),!i.iconName&&Q.autoFetchSvg&&e.firstChild&&e.firstChild.nodeType===Node.TEXT_NODE&&(i.iconName=e.firstChild.data),i)}function aF(e){return oN(e.attributes).reduce(function(e,t){return e.name!==`class`&&e.name!==`style`&&(e[t.name]=t.value),e},{})}function oF(){return{iconName:null,prefix:null,transform:nN,symbol:!1,mask:{iconName:null,prefix:null,rest:[]},maskId:null,extra:{classes:[],styles:{},attributes:{}}}}function sF(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{styleParser:!0},n=iF(e),r=n.iconName,i=n.prefix,a=n.rest,o=aF(e),s=mP(`parseNodeAttributes`,{},e);return Z({iconName:r,prefix:i,transform:nN,mask:{iconName:null,prefix:null,rest:[]},maskId:null,symbol:!1,extra:{classes:a,styles:t.styleParser?rF(e):[],attributes:o}},s)}var cF=bN.styles;function lF(e){var t=Q.autoReplaceSvg===`nest`?sF(e,{styleParser:!1}):sF(e);return~t.extra.classes.indexOf(UM)?gP(`generateLayersText`,e,t):gP(`generateSvgReplacementMutation`,e,t)}function uF(){return[].concat(HA(tM),HA(mM))}function dF(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(!ij)return Promise.resolve();var n=tj.documentElement.classList,r=function(e){return n.add(`${kM}-${e}`)},i=function(e){return n.remove(`${kM}-${e}`)},a=Q.autoFetchSvg?uF():dj.concat(Object.keys(cF));a.includes(`fa`)||a.push(`fa`);var o=[`.${UM}:not([${wM}])`].concat(a.map(function(e){return`.${e}:not([${wM}])`})).join(`, `);if(o.length===0)return Promise.resolve();var s=[];try{s=oN(e.querySelectorAll(o))}catch{}if(s.length>0)r(`pending`),i(`complete`);else return Promise.resolve();var c=RP.begin(`onTree`),l=s.reduce(function(e,t){try{var n=lF(t);n&&e.push(n)}catch(e){NM||e.name===`MissingIcon`&&console.error(e)}return e},[]);return new Promise(function(e,n){Promise.all(l).then(function(n){XP(n,function(){r(`active`),r(`complete`),i(`pending`),typeof t==`function`&&t(),c(),e()})}).catch(function(e){c(),n(e)})})}function fF(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;lF(e).then(function(e){e&&XP([e],t)})}function pF(e){return function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=(t||{}).icon?t:_P(t||{}),i=n.mask;return i&&=(i||{}).icon?i:_P(i||{}),e(r,Z(Z({},n),{},{mask:i}))}}var mF=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.transform,r=n===void 0?nN:n,i=t.symbol,a=i===void 0?!1:i,o=t.mask,s=o===void 0?null:o,c=t.maskId,l=c===void 0?null:c,u=t.classes,d=u===void 0?[]:u,f=t.attributes,p=f===void 0?{}:f,m=t.styles,h=m===void 0?{}:m;if(e){var g=e.prefix,_=e.iconName,v=e.icon;return xP(Z({type:`icon`},e),function(){return hP(`beforeDOMElementCreation`,{iconDefinition:e,params:t}),TP({icons:{main:kP(v),mask:s?kP(s.icon):{found:!1,width:null,height:null,icon:{}}},prefix:g,iconName:_,transform:Z(Z({},nN),r),symbol:a,maskId:l,extra:{attributes:p,styles:h,classes:d}})})}},hF={mixout:function(){return{icon:pF(mF)}},hooks:function(){return{mutationObserverCallbacks:function(e){return e.treeCallback=dF,e.nodeCallback=fF,e}}},provides:function(e){e.i2svg=function(e){var t=e.node,n=t===void 0?tj:t,r=e.callback;return dF(n,r===void 0?function(){}:r)},e.generateSvgReplacementMutation=function(e,t){var n=t.iconName,r=t.prefix,i=t.transform,a=t.symbol,o=t.mask,s=t.maskId,c=t.extra;return new Promise(function(t,l){Promise.all([MP(n,r),o.iconName?MP(o.iconName,o.prefix):Promise.resolve({found:!1,width:512,height:512,icon:{}})]).then(function(o){var l=VA(o,2),u=l[0],d=l[1];t([e,TP({icons:{main:u,mask:d},prefix:r,iconName:n,transform:i,symbol:a,maskId:s,extra:c,watchable:!0})])}).catch(l)})},e.generateAbstractIcon=function(e){var t=e.children,n=e.attributes,r=e.main,i=e.transform,a=e.styles,o=uN(a);o.length>0&&(n.style=o);var s;return dN(i)&&(s=gP(`generateAbstractTransformGrouping`,{main:r,transform:i,containerWidth:r.width,iconWidth:r.width})),t.push(s||r.icon),{children:t,attributes:n}}}},gF={mixout:function(){return{layer:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.classes,r=n===void 0?[]:n;return xP({type:`layer`},function(){hP(`beforeDOMElementCreation`,{assembler:e,params:t});var n=[];return e(function(e){Array.isArray(e)?e.map(function(e){n=n.concat(e.abstract)}):n=n.concat(e.abstract)}),[{tag:`span`,attributes:{class:[`${Q.cssPrefix}-layers`].concat(HA(r)).join(` `)},children:n}]})}}}},_F={mixout:function(){return{counter:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.title,r=n===void 0?null:n,i=t.classes,a=i===void 0?[]:i,o=t.attributes,s=o===void 0?{}:o,c=t.styles,l=c===void 0?{}:c;return xP({type:`counter`,content:e},function(){return hP(`beforeDOMElementCreation`,{content:e,params:t}),DP({content:e.toString(),title:r,extra:{attributes:s,styles:l,classes:[`${Q.cssPrefix}-layers-counter`].concat(HA(a))}})})}}}},vF={mixout:function(){return{text:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.transform,r=n===void 0?nN:n,i=t.classes,a=i===void 0?[]:i,o=t.attributes,s=o===void 0?{}:o,c=t.styles,l=c===void 0?{}:c;return xP({type:`text`,content:e},function(){return hP(`beforeDOMElementCreation`,{content:e,params:t}),EP({content:e,transform:Z(Z({},nN),r),extra:{attributes:s,styles:l,classes:[`${Q.cssPrefix}-layers-text`].concat(HA(a))}})})}}},provides:function(e){e.generateLayersText=function(e,t){var n=t.transform,r=t.extra,i=null,a=null;if(aj){var o=parseInt(getComputedStyle(e).fontSize,10),s=e.getBoundingClientRect();i=s.width/o,a=s.height/o}return Promise.resolve([e,EP({content:e.innerHTML,width:i,height:a,transform:n,extra:r,watchable:!0})])}}},yF=RegExp(`"`,`ug`),bF=[1105920,1112319],xF=Z(Z(Z(Z({},{FontAwesome:{normal:`fas`,400:`fas`}}),Qj),yM),aM),SF=Object.keys(xF).reduce(function(e,t){return e[t.toLowerCase()]=xF[t],e},{}),CF=Object.keys(SF).reduce(function(e,t){var n=SF[t];return e[t]=n[900]||HA(Object.entries(n))[0][1],e},{});function wF(e){return kN(HA(e.replace(yF,``))[0]||``)}function TF(e){var t=e.getPropertyValue(`font-feature-settings`).includes(`ss01`),n=e.getPropertyValue(`content`).replace(yF,``),r=n.codePointAt(0),i=r>=bF[0]&&r<=bF[1],a=n.length===2?n[0]===n[1]:!1;return i||a||t}function EF(e,t){var n=e.replace(/^['"]|['"]$/g,``).toLowerCase(),r=parseInt(t),i=isNaN(r)?`normal`:r;return(SF[n]||{})[i]||CF[n]}function DF(e,t){var n=`${EM}${t.replace(`:`,`-`)}`;return new Promise(function(r,i){if(e.getAttribute(n)!==null)return r();var a=oN(e.children).filter(function(e){return e.getAttribute(TM)===t})[0],o=ej.getComputedStyle(e,t),s=o.getPropertyValue(`font-family`),c=s.match(WM),l=o.getPropertyValue(`font-weight`),u=o.getPropertyValue(`content`);if(a&&!c)return e.removeChild(a),r();if(c&&u!==`none`&&u!==``){var d=o.getPropertyValue(`content`),f=EF(s,l),p=wF(d),m=c[0].startsWith(`FontAwesome`),h=TF(o),g=GN(f,p),_=g;if(m){var v=YN(p);v.iconName&&v.prefix&&(g=v.iconName,f=v.prefix)}if(g&&!h&&(!a||a.getAttribute(DM)!==f||a.getAttribute(OM)!==_)){e.setAttribute(n,_),a&&e.removeChild(a);var y=oF(),b=y.extra;b.attributes[TM]=t,MP(g,f).then(function(i){var a=TP(Z(Z({},y),{},{icons:{main:i,mask:ZN()},prefix:f,iconName:_,extra:b,watchable:!0})),o=tj.createElementNS(`http://www.w3.org/2000/svg`,`svg`);t===`::before`?e.insertBefore(o,e.firstChild):e.appendChild(o),o.outerHTML=a.map(function(e){return TN(e)}).join(`
|
|
649
649
|
`),e.removeAttribute(n),r()}).catch(i)}else r()}else r()})}function OF(e){return Promise.all([DF(e,`::before`),DF(e,`::after`)])}function kF(e){return e.parentNode!==document.head&&!~jM.indexOf(e.tagName.toUpperCase())&&!e.getAttribute(TM)&&(!e.parentNode||e.parentNode.tagName!==`svg`)}var AF=function(e){return!!e&&MM.some(function(t){return e.includes(t)})},jF=function(e){if(!e)return[];var t=new Set,n=e.split(/,(?![^()]*\))/).map(function(e){return e.trim()});n=n.flatMap(function(e){return e.includes(`(`)?e:e.split(`,`).map(function(e){return e.trim()})});var r=PA(n),i;try{for(r.s();!(i=r.n()).done;){var a=i.value;if(AF(a)){var o=MM.reduce(function(e,t){return e.replace(t,``)},a);o!==``&&o!==`*`&&t.add(o)}}}catch(e){r.e(e)}finally{r.f()}return t};function MF(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(ij){var n;if(t)n=e;else if(Q.searchPseudoElementsFullScan)n=e.querySelectorAll(`*`);else{var r=new Set,i=PA(document.styleSheets),a;try{for(i.s();!(a=i.n()).done;){var o=a.value;try{var s=PA(o.cssRules),c;try{for(s.s();!(c=s.n()).done;){var l=c.value,u=PA(jF(l.selectorText)),d;try{for(u.s();!(d=u.n()).done;){var f=d.value;r.add(f)}}catch(e){u.e(e)}finally{u.f()}}}catch(e){s.e(e)}finally{s.f()}}catch(e){Q.searchPseudoElementsWarnings&&console.warn(`Font Awesome: cannot parse stylesheet: ${o.href} (${e.message})
|
|
650
|
-
If it declares any Font Awesome CSS pseudo-elements, they will not be rendered as SVG icons. Add crossorigin="anonymous" to the <link>, enable searchPseudoElementsFullScan for slower but more thorough DOM parsing, or suppress this warning by setting searchPseudoElementsWarnings to false.`)}}}catch(e){i.e(e)}finally{i.f()}if(!r.size)return;var p=Array.from(r).join(`, `);try{n=e.querySelectorAll(p)}catch{}}return new Promise(function(e,t){var r=oN(n).filter(kF).map(OF),i=RP.begin(`searchPseudoElements`);QP(),Promise.all(r).then(function(){i(),$P(),e()}).catch(function(){i(),$P(),t()})})}}var NF={hooks:function(){return{mutationObserverCallbacks:function(e){return e.pseudoElementsCallback=MF,e}}},provides:function(e){e.pseudoElements2svg=function(e){var t=e.node,n=t===void 0?tj:t;Q.searchPseudoElements&&MF(n)}}},PF=!1,FF={mixout:function(){return{dom:{unwatch:function(){QP(),PF=!0}}}},hooks:function(){return{bootstrap:function(){tF(mP(`mutationObserverCallbacks`,{}))},noAuto:function(){nF()},watch:function(e){var t=e.observeMutationsRoot;PF?$P():tF(mP(`mutationObserverCallbacks`,{observeMutationsRoot:t}))}}}},IF=function(e){return e.toLowerCase().split(` `).reduce(function(e,t){var n=t.toLowerCase().split(`-`),r=n[0],i=n.slice(1).join(`-`);if(r&&i===`h`)return e.flipX=!0,e;if(r&&i===`v`)return e.flipY=!0,e;if(i=parseFloat(i),isNaN(i))return e;switch(r){case`grow`:e.size+=i;break;case`shrink`:e.size-=i;break;case`left`:e.x-=i;break;case`right`:e.x+=i;break;case`up`:e.y-=i;break;case`down`:e.y+=i;break;case`rotate`:e.rotate+=i;break}return e},{size:16,x:0,y:0,flipX:!1,flipY:!1,rotate:0})},LF={mixout:function(){return{parse:{transform:function(e){return IF(e)}}}},hooks:function(){return{parseNodeAttributes:function(e,t){var n=t.getAttribute(`data-fa-transform`);return n&&(e.transform=IF(n)),e}}},provides:function(e){e.generateAbstractTransformGrouping=function(e){var t=e.main,n=e.transform,r=e.containerWidth,i=e.iconWidth,a={outer:{transform:`translate(${r/2} 256)`},inner:{transform:`${`translate(${n.x*32}, ${n.y*32}) `} ${`scale(${n.size/16*(n.flipX?-1:1)}, ${n.size/16*(n.flipY?-1:1)}) `} ${`rotate(${n.rotate} 0 0)`}`},path:{transform:`translate(${i/2*-1} -256)`}};return{tag:`g`,attributes:Z({},a.outer),children:[{tag:`g`,attributes:Z({},a.inner),children:[{tag:t.icon.tag,children:t.icon.children,attributes:Z(Z({},t.icon.attributes),a.path)}]}]}}}},RF={x:0,y:0,width:`100%`,height:`100%`};function zF(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return e.attributes&&(e.attributes.fill||t)&&(e.attributes.fill=`black`),e}function BF(e){return e.tag===`g`?e.children:[e]}pP([vN,hF,gF,_F,vF,NF,FF,LF,{hooks:function(){return{parseNodeAttributes:function(e,t){var n=t.getAttribute(`data-fa-mask`),r=n?rP(n.split(` `).map(function(e){return e.trim()})):ZN();return r.prefix||=XN(),e.mask=r,e.maskId=t.getAttribute(`data-fa-mask-id`),e}}},provides:function(e){e.generateAbstractMask=function(e){var t=e.children,n=e.attributes,r=e.main,i=e.mask,a=e.maskId,o=e.transform,s=r.width,c=r.icon,l=i.width,u=i.icon,d=fN({transform:o,containerWidth:l,iconWidth:s}),f={tag:`rect`,attributes:Z(Z({},RF),{},{fill:`white`})},p=c.children?{children:c.children.map(zF)}:{},m={tag:`g`,attributes:Z({},d.inner),children:[zF(Z({tag:c.tag,attributes:Z(Z({},c.attributes),d.path)},p))]},h={tag:`g`,attributes:Z({},d.outer),children:[m]},g=`mask-${a||aN()}`,_=`clip-${a||aN()}`,v={tag:`mask`,attributes:Z(Z({},RF),{},{id:g,maskUnits:`userSpaceOnUse`,maskContentUnits:`userSpaceOnUse`}),children:[f,h]},y={tag:`defs`,children:[{tag:`clipPath`,attributes:{id:_},children:BF(u)},v]};return t.push(y,{tag:`rect`,attributes:Z({fill:`currentColor`,"clip-path":`url(#${_})`,mask:`url(#${g})`},RF)}),{children:t,attributes:n}}}},{provides:function(e){var t=!1;ej.matchMedia&&(t=ej.matchMedia(`(prefers-reduced-motion: reduce)`).matches),e.missingIconAbstract=function(){var e=[],n={fill:`currentColor`},r={attributeType:`XML`,repeatCount:`indefinite`,dur:`2s`};e.push({tag:`path`,attributes:Z(Z({},n),{},{d:`M156.5,447.7l-12.6,29.5c-18.7-9.5-35.9-21.2-51.5-34.9l22.7-22.7C127.6,430.5,141.5,440,156.5,447.7z M40.6,272H8.5 c1.4,21.2,5.4,41.7,11.7,61.1L50,321.2C45.1,305.5,41.8,289,40.6,272z M40.6,240c1.4-18.8,5.2-37,11.1-54.1l-29.5-12.6 C14.7,194.3,10,216.7,8.5,240H40.6z M64.3,156.5c7.8-14.9,17.2-28.8,28.1-41.5L69.7,92.3c-13.7,15.6-25.5,32.8-34.9,51.5 L64.3,156.5z M397,419.6c-13.9,12-29.4,22.3-46.1,30.4l11.9,29.8c20.7-9.9,39.8-22.6,56.9-37.6L397,419.6z M115,92.4 c13.9-12,29.4-22.3,46.1-30.4l-11.9-29.8c-20.7,9.9-39.8,22.6-56.8,37.6L115,92.4z M447.7,355.5c-7.8,14.9-17.2,28.8-28.1,41.5 l22.7,22.7c13.7-15.6,25.5-32.9,34.9-51.5L447.7,355.5z M471.4,272c-1.4,18.8-5.2,37-11.1,54.1l29.5,12.6 c7.5-21.1,12.2-43.5,13.6-66.8H471.4z M321.2,462c-15.7,5-32.2,8.2-49.2,9.4v32.1c21.2-1.4,41.7-5.4,61.1-11.7L321.2,462z M240,471.4c-18.8-1.4-37-5.2-54.1-11.1l-12.6,29.5c21.1,7.5,43.5,12.2,66.8,13.6V471.4z M462,190.8c5,15.7,8.2,32.2,9.4,49.2h32.1 c-1.4-21.2-5.4-41.7-11.7-61.1L462,190.8z M92.4,397c-12-13.9-22.3-29.4-30.4-46.1l-29.8,11.9c9.9,20.7,22.6,39.8,37.6,56.9 L92.4,397z M272,40.6c18.8,1.4,36.9,5.2,54.1,11.1l12.6-29.5C317.7,14.7,295.3,10,272,8.5V40.6z M190.8,50 c15.7-5,32.2-8.2,49.2-9.4V8.5c-21.2,1.4-41.7,5.4-61.1,11.7L190.8,50z M442.3,92.3L419.6,115c12,13.9,22.3,29.4,30.5,46.1 l29.8-11.9C470,128.5,457.3,109.4,442.3,92.3z M397,92.4l22.7-22.7c-15.6-13.7-32.8-25.5-51.5-34.9l-12.6,29.5 C370.4,72.1,384.4,81.5,397,92.4z`})});var i=Z(Z({},r),{},{attributeName:`opacity`}),a={tag:`circle`,attributes:Z(Z({},n),{},{cx:`256`,cy:`364`,r:`28`}),children:[]};return t||a.children.push({tag:`animate`,attributes:Z(Z({},r),{},{attributeName:`r`,values:`28;14;28;28;14;28;`})},{tag:`animate`,attributes:Z(Z({},i),{},{values:`1;0;1;1;0;1;`})}),e.push(a),e.push({tag:`path`,attributes:Z(Z({},n),{},{opacity:`1`,d:`M263.7,312h-16c-6.6,0-12-5.4-12-12c0-71,77.4-63.9,77.4-107.8c0-20-17.8-40.2-57.4-40.2c-29.1,0-44.3,9.6-59.2,28.7 c-3.9,5-11.1,6-16.2,2.4l-13.1-9.2c-5.6-3.9-6.9-11.8-2.6-17.2c21.2-27.2,46.4-44.7,91.2-44.7c52.3,0,97.4,29.8,97.4,80.2 c0,67.6-77.4,63.5-77.4,107.8C275.7,306.6,270.3,312,263.7,312z`}),children:t?[]:[{tag:`animate`,attributes:Z(Z({},i),{},{values:`1;0;0;0;0;1;`})}]}),t||e.push({tag:`path`,attributes:Z(Z({},n),{},{opacity:`0`,d:`M232.5,134.5l7,168c0.3,6.4,5.6,11.5,12,11.5h9c6.4,0,11.7-5.1,12-11.5l7-168c0.3-6.8-5.2-12.5-12-12.5h-23 C237.7,122,232.2,127.7,232.5,134.5z`}),children:[{tag:`animate`,attributes:Z(Z({},i),{},{values:`0;0;1;1;0;0;`})}]}),{tag:`g`,attributes:{class:`missing`},children:e}}}},{hooks:function(){return{parseNodeAttributes:function(e,t){var n=t.getAttribute(`data-fa-symbol`);return e.symbol=n===null?!1:n===``?!0:n,e}}}}],{mixoutsTo:yP}),yP.noAuto;var VF=yP.config;yP.library,yP.dom;var HF=yP.parse;yP.findIconDefinition,yP.toHtml;var UF=yP.icon;yP.layer,yP.text,yP.counter;function WF(e){return e-=0,e===e}function GF(e){return WF(e)?e:(e=e.replace(/[_-]+(.)?/g,(e,t)=>t?t.toUpperCase():``),e.charAt(0).toLowerCase()+e.slice(1))}var KF=(e,t)=>K.createElement(`stop`,{key:`${t}-${e.offset}`,offset:e.offset,stopColor:e.color,...e.opacity!==void 0&&{stopOpacity:e.opacity}});function qF(e){return e.charAt(0).toUpperCase()+e.slice(1)}var JF=new Map,YF=1e3;function XF(e){if(JF.has(e))return JF.get(e);let t={},n=0,r=e.length;for(;n<r;){let i=e.indexOf(`;`,n),a=i===-1?r:i,o=e.slice(n,a).trim();if(o){let e=o.indexOf(`:`);if(e>0){let n=o.slice(0,e).trim(),r=o.slice(e+1).trim();if(n&&r){let e=GF(n);t[e.startsWith(`webkit`)?qF(e):e]=r}}}n=a+1}if(JF.size===YF){let e=JF.keys().next().value;e&&JF.delete(e)}return JF.set(e,t),t}function ZF(e,t,n={}){if(typeof t==`string`)return t;let r=(t.children||[]).map(t=>{let r=t;return(`fill`in n||n.gradientFill)&&t.tag===`path`&&`fill`in t.attributes&&(r={...t,attributes:{...t.attributes,fill:void 0}}),ZF(e,r)}),i=t.attributes||{},a={};for(let[e,t]of Object.entries(i))switch(!0){case e===`class`:a.className=t;break;case e===`style`:a.style=XF(String(t));break;case e.startsWith(`aria-`):case e.startsWith(`data-`):a[e.toLowerCase()]=t;break;default:a[GF(e)]=t}let{style:o,role:s,"aria-label":c,gradientFill:l,...u}=n;if(o&&(a.style=a.style?{...a.style,...o}:o),s&&(a.role=s),c&&(a[`aria-label`]=c,a[`aria-hidden`]=`false`),l){a.fill=`url(#${l.id})`;let{type:t,stops:n=[],...i}=l;r.unshift(e(t===`linear`?`linearGradient`:`radialGradient`,{...i,id:l.id},n.map(KF)))}return e(t.tag,{...a,...u},...r)}var QF=ZF.bind(null,K.createElement),$F=(e,t)=>{let n=(0,K.useId)();return e||(t?n:void 0)},eI=class{constructor(e=`react-fontawesome`){this.enabled=!1;let t=!1;try{t=!1}catch{}this.scope=e,this.enabled=t}log(...e){this.enabled&&console.log(`[${this.scope}]`,...e)}warn(...e){this.enabled&&console.warn(`[${this.scope}]`,...e)}error(...e){this.enabled&&console.error(`[${this.scope}]`,...e)}};({env:{NODE_ENV:`production`}}).env?.FA_VERSION;var tI=`searchPseudoElementsFullScan`in VF&&typeof VF.searchPseudoElementsFullScan==`boolean`?`7.0.0`:`6.0.0`,nI=Number.parseInt(tI)>=7,rI=()=>nI,iI=`fa`,aI={beat:`fa-beat`,fade:`fa-fade`,beatFade:`fa-beat-fade`,bounce:`fa-bounce`,shake:`fa-shake`,spin:`fa-spin`,spinPulse:`fa-spin-pulse`,spinReverse:`fa-spin-reverse`,pulse:`fa-pulse`},oI={left:`fa-pull-left`,right:`fa-pull-right`},sI={90:`fa-rotate-90`,180:`fa-rotate-180`,270:`fa-rotate-270`},cI={"2xs":`fa-2xs`,xs:`fa-xs`,sm:`fa-sm`,lg:`fa-lg`,xl:`fa-xl`,"2xl":`fa-2xl`,"1x":`fa-1x`,"2x":`fa-2x`,"3x":`fa-3x`,"4x":`fa-4x`,"5x":`fa-5x`,"6x":`fa-6x`,"7x":`fa-7x`,"8x":`fa-8x`,"9x":`fa-9x`,"10x":`fa-10x`},lI={border:`fa-border`,fixedWidth:`fa-fw`,flip:`fa-flip`,flipHorizontal:`fa-flip-horizontal`,flipVertical:`fa-flip-vertical`,inverse:`fa-inverse`,rotateBy:`fa-rotate-by`,swapOpacity:`fa-swap-opacity`,widthAuto:`fa-width-auto`},uI={default:`fa-layers`};function dI(e){let t=VF.cssPrefix||VF.familyPrefix||iI;return t===iI?e:e.replace(new RegExp(String.raw`(?<=^|\s)${iI}-`,`g`),`${t}-`)}function fI(e){let{beat:t,fade:n,beatFade:r,bounce:i,shake:a,spin:o,spinPulse:s,spinReverse:c,pulse:l,fixedWidth:u,inverse:d,border:f,flip:p,size:m,rotation:h,pull:g,swapOpacity:_,rotateBy:v,widthAuto:y,className:b}=e,x=[];return b&&x.push(...b.split(` `)),t&&x.push(aI.beat),n&&x.push(aI.fade),r&&x.push(aI.beatFade),i&&x.push(aI.bounce),a&&x.push(aI.shake),o&&x.push(aI.spin),c&&x.push(aI.spinReverse),s&&x.push(aI.spinPulse),l&&x.push(aI.pulse),u&&x.push(lI.fixedWidth),d&&x.push(lI.inverse),f&&x.push(lI.border),p===!0&&x.push(lI.flip),(p===`horizontal`||p===`both`)&&x.push(lI.flipHorizontal),(p===`vertical`||p===`both`)&&x.push(lI.flipVertical),m!=null&&x.push(cI[m]),h!=null&&h!==0&&x.push(sI[h]),g!=null&&x.push(oI[g]),_&&x.push(lI.swapOpacity),rI()?(v&&x.push(lI.rotateBy),y&&x.push(lI.widthAuto),(VF.cssPrefix||VF.familyPrefix||iI)===iI?x:x.map(dI)):x}var pI=e=>typeof e==`object`&&`icon`in e&&!!e.icon;function mI(e){if(e)return pI(e)?e:HF.icon(e)}function hI(e){return Object.keys(e)}var gI=new eI(`FontAwesomeIcon`),_I={border:!1,className:``,mask:void 0,maskId:void 0,fixedWidth:!1,inverse:!1,flip:!1,icon:void 0,listItem:!1,pull:void 0,pulse:!1,rotation:void 0,rotateBy:!1,size:void 0,spin:!1,spinPulse:!1,spinReverse:!1,beat:!1,fade:!1,beatFade:!1,bounce:!1,shake:!1,symbol:!1,title:``,titleId:void 0,transform:void 0,swapOpacity:!1,widthAuto:!1},vI=new Set(Object.keys(_I)),yI=K.forwardRef((e,t)=>{let n={..._I,...e},{icon:r,mask:i,symbol:a,title:o,titleId:s,maskId:c,transform:l}=n,u=$F(c,!!i),d=$F(s,!!o),f=mI(r);if(!f)return gI.error(`Icon lookup is undefined`,r),null;let p=fI(n),m=typeof l==`string`?HF.transform(l):l,h=mI(i),g=UF(f,{...p.length>0&&{classes:p},...m&&{transform:m},...h&&{mask:h},symbol:a,title:o,titleId:d,maskId:u});if(!g)return gI.error(`Could not find icon`,f),null;let{abstract:_}=g,v={ref:t};for(let e of hI(n))vI.has(e)||(v[e]=n[e]);return QF(_[0],v)});yI.displayName=`FontAwesomeIcon`,`${uI.default}${lI.fixedWidth}`;function bI({message:e,className:t,buttonRef:n}){let r=(0,K.useId)(),[i,a]=(0,K.useState)(!1);return(0,q.jsxs)(`span`,{className:(0,J.default)(`aone:relative aone:inline-flex`,t),onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),children:[(0,q.jsx)(`button`,{type:`button`,ref:n,className:`aone:inline-flex aone:items-center aone:justify-center aone:h-4 aone:w-4 aone:cursor-pointer aone:rounded-sm aone:text-red-500 aone:focus:outline-none aone:focus:ring-2 aone:focus:ring-red-500 aone:focus:ring-offset-1`,"data-testid":`error-icon`,"aria-label":`Validation error: ${e}`,"aria-expanded":i,"aria-controls":r,"aria-describedby":i?r:void 0,onFocus:()=>a(!0),onBlur:()=>a(!1),onClick:()=>a(e=>!e),children:(0,q.jsx)(yI,{icon:EA,"aria-hidden":`true`,className:`aone:h-4 aone:w-4`})}),i&&(0,q.jsx)(`div`,{id:r,role:`tooltip`,className:`aone:absolute aone:z-20 aone:top-full aone:left-1/2 aone:-translate-x-1/2 aone:mt-2 aone:bg-red-600 aone:text-white aone:text-xs aone:rounded aone:px-2 aone:py-1 aone:whitespace-nowrap`,children:e})]})}var xI=e=>{let t=e.match(/\d+/g)??[];if(t.length===0)return null;let n=parseInt(t[0].slice(0,2),10);if(Number.isNaN(n)||n<1||n>12)return null;let r=t[1]?.slice(0,2),i=Number(r??`1`);(Number.isNaN(i)||i<1||i>31)&&(i=1);let a=new Date().getFullYear(),o=t[2],s=a;if(o){let e=parseInt(o,10);s=o.length<=2?2e3+e:e}let c=new Date(s,n-1,i);return xm(c)?hm(c):null},SI=/^\d{2}\/\d{2}\/\d{2}$/,CI=e=>e.toLocaleDateString(`en-US`,{year:`2-digit`,month:`2-digit`,day:`2-digit`}),wI=(e,t=``)=>{let n=e.length<t.length,r=e.replace(/\D/g,``).slice(0,8);if(!n&&e.endsWith(`/`)){let t=e.slice(0,-1).split(`/`);if(t.length===1){let e=t[0];if(e&&e.length===1)return`0${e}/`}if(t.length===2){let e=t[0],n=t[1];if(n&&n.length===1)return`${(e??``).padStart(2,`0`)}/${`0${n}`}/`}}if(r.length===1&&t===``&&!n&&parseInt(r,10)>=3)return`0${r}/`;if(e.indexOf(`/`)===1&&r.length>=1){let e=r.slice(0,1).padStart(2,`0`),t=r.slice(1);switch(t.length){case 0:return n?e:`${e}/`;case 1:return`${e}/${t}`;case 2:return n?`${e}/${t}`:`${e}/${t}/`;default:return`${e}/${t.slice(0,2)}/${t.slice(2).slice(-2).padStart(2,`0`)}`}}switch(r.length){case 0:return``;case 1:return r;case 2:return n?e:`${r}/`;case 3:{let e=r.slice(0,2),i=r.slice(2);return!n&&t.replace(/\D/g,``).length===2&&/^\d{2}\/$/.test(t)&&parseInt(i,10)>=4?`${e}/0${i}/`:`${e}/${i}`}case 4:{let e=r.slice(0,2),t=r.slice(2,4);return n?`${e}/${t}`:`${e}/${t}/`}default:return`${r.slice(0,2)}/${r.slice(2,4)}/${r.slice(4).slice(-2)}`}},TI=e=>{let t=e.trim();if(t===``)return``;let n=(t.match(/\d+/g)??[]).slice(0,3);if(n.length===0)return``;let r=n[0].slice(-2).padStart(2,`0`);if(n.length===1)return r;let i=n[1].slice(-2).padStart(2,`0`);return n.length===2?`${r}/${i}`:`${r}/${i}/${n[2].slice(-2).padStart(2,`0`)}`},EI=e=>{if(!SI.test(e))return null;let t=wg(e,`MM/dd/yy`,new Date);return xm(t)&&CI(hm(t))===e?hm(t):null};function DI({origin:e,destination:t,onChange:n,onMonthViewChange:r,oneWay:i,className:a,primaryColor:o,secondaryColor:s,startDateLabel:c=`Start Date`,endDateLabel:l=`End Date`,flightCalendar:u,flightCalendarStatus:d,onlyDirects:f,initialStartDate:p,initialEndDate:m,referenceDates:h,minDate:g,showButtons:_=!0}){let v=(0,K.useRef)(null),[y,b]=(0,K.useState)(null);(0,K.useLayoutEffect)(()=>{if(!v.current)return;let e=v.current.getRootNode();if(!(e instanceof ShadowRoot))return;let t=document.createElement(`div`);return e.appendChild(t),queueMicrotask(()=>b(t)),()=>{t.parentNode&&t.parentNode.removeChild(t)}},[]);let[x,S]=(0,K.useState)(``),[C,w]=(0,K.useState)(``),[T,E]=(0,K.useState)(null),[D,O]=(0,K.useState)(null),[k,A]=(0,K.useState)(p||null),[j,M]=(0,K.useState)(m||null),[N,P]=(0,K.useState)(!1),[ee,F]=(0,K.useState)(p||null),[te,ne]=(0,K.useState)(!1),[re,ie]=(0,K.useState)(!1),[ae]=(0,K.useState)(()=>p||new Date),oe=(0,K.useRef)(n),se=(0,K.useRef)(null),ce=(0,K.useRef)(null),le=(0,K.useRef)(null),ue=(0,K.useRef)(0),de=(0,K.useRef)(null),fe=(0,K.useRef)(null),pe=()=>Date.now()<ue.current,me=()=>{pe()||P(!0)},he=()=>{ue.current=Date.now()+250,P(!1)},ge=e=>{if(e){me();return}he()};(0,K.useEffect)(()=>{oe.current=n},[n]),(0,K.useEffect)(()=>{i&&queueMicrotask(()=>{M(null),w(``),O(null)})},[i]),(0,K.useEffect)(()=>{queueMicrotask(()=>{!k&&p&&A(p),!j&&m&&M(m)})},[p,m,k,j]);let I=hm(new Date),_e=om(I,6),L=e=>{S(e);let t=EI(e);return e===``||!e?(E(null),A(null),!0):t?hh(t,I)?(E(`Date cannot be in the past`),A(null),!1):mh(t,_e)?(E(`Date must be within 6 months`),A(null),!1):g&&hh(t,g)?(E(`Date must be no earlier than `+g.toLocaleDateString()),A(null),!1):(E(null),A(t),F(t),j&&hh(j,t)&&(M(null),w(``)),!0):(E(`Enter a date in MM/DD/YY format`),A(null),!1)},ve=e=>{if(i)return!0;w(e);let t=EI(e);return e===``||!e?(O(null),M(null),!0):t?hh(t,I)?(O(`Date cannot be in the past`),M(null),!1):mh(t,_e)?(O(`Date must be within 6 months`),M(null),!1):k?hh(t,k)?(O(`Return date must be after departure`),M(null),!1):g&&hh(t,g)?(O(`Date must be no earlier than `+g.toLocaleDateString()),M(null),!1):(O(null),M(t),F(t),!0):(O(`Enter departure date first`),M(null),!1):(O(`Enter a date in MM/DD/YY format`),M(null),!1)},ye=()=>L(x),be=()=>ve(C),xe=e=>{let t=e.getTime()<(k?.getTime()||0);k?!j&&t?A(e):j?k&&j&&(ym(e,k)&&ym(e,j)?(A(e),M(null)):hh(e,j)&&hh(e,am(k,3))?A(e):M(e)):i?A(e):M(e):A(e)},Se=()=>{A(null),M(null),S(``),w(``),E(null),O(null),F(null),oe.current(null,null)};(0,K.useEffect)(()=>{oe.current(k,j)},[k,j]),(0,K.useEffect)(()=>{queueMicrotask(()=>{k?(S(CI(k)),E(null)):T||S(``)})},[k]),(0,K.useEffect)(()=>{queueMicrotask(()=>{j?(w(CI(j)),O(null)):D||w(``)})},[j]);let Ce={};o&&(Ce[`--color-primary`]=o),s&&(Ce[`--color-secondary`]=s);let we=pA(),Te=(0,K.useId)(),Ee=`${Te}-description`,De=(0,q.jsxs)(`div`,{ref:le,onClick:me,className:(0,J.default)(`aone:relative aone:h-full aone:flex aone:flex-col aone:gap-4 aone:px-3 aone:py-2 aone:rounded-lg aone:bg-white aone:cursor-pointer`,`aone:@2xl:flex-row aone:@2xl:items-center`,{"aone:border-2 aone:border-primary":N,"aone:border-2 aone:border-gray-200":!N}),children:[(0,q.jsxs)(`fieldset`,{className:`aone:border-0 aone:p-0 aone:m-0 aone:@2xl:flex-1 aone:@2xl:pr-3`,children:[(0,q.jsx)(`legend`,{className:`aone:sr-only`,children:`Date range selection`}),(0,q.jsxs)(`div`,{className:`aone:flex aone:grow aone:items-center`,children:[(0,q.jsx)(`span`,{children:(0,q.jsx)(mA,{})}),(0,q.jsxs)(`div`,{className:`aone:relative aone:flex-grow`,children:[(0,q.jsx)(`input`,{type:`text`,name:`start-date`,value:x,"aria-label":c,"aria-invalid":T?`true`:void 0,placeholder:te?`mm/dd/yy`:c,autoComplete:`off`,className:(0,J.default)(`aone:ml-2 aone:all-initial aone:focus:outline-none aone:disabled:bg-white aone:text-black aone:text-base aone:w-full aone:pr-1`,{"aone:text-red-500 ":!!T}),onChange:e=>{let t=wI(e.target.value,x);S(t),E(null),F(xI(t)),oe.current(null,j)},onFocus:()=>{ne(!0),me()},onBlur:e=>{let t=TI(e.target.value);S(t);let n=L(t);ne(!1),!n&&de.current===`forward`&&requestAnimationFrame(()=>se.current?.focus()),de.current=null},onKeyDown:e=>{e.key===`Tab`&&(de.current=e.shiftKey?`backward`:`forward`),e.key===`Enter`&&(e.preventDefault(),ye(),e.target.blur())}}),T&&(0,q.jsx)(`span`,{className:`aone:absolute aone:right-2 aone:top-1/2 aone:-translate-y-1/2`,children:(0,q.jsx)(bI,{message:T,buttonRef:se})})]})]})]}),!i&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`div`,{className:`aone:absolute aone:left-2 aone:right-2 aone:top-1/2 aone:@2xl:top-2 aone:@2xl:bottom-2 aone:@2xl:left-1/2 aone:rounded-lg aone:h-[2px] aone:@2xl:h-[initial] aone:@2xl:w-[2px] aone:bg-gray-200`}),(0,q.jsxs)(`fieldset`,{className:`aone:border-0 aone:p-0 aone:m-0 aone:@2xl:flex-1 aone:@2xl:pl-3`,children:[(0,q.jsx)(`legend`,{className:`aone:sr-only`,children:`Return date selection`}),(0,q.jsxs)(`div`,{className:`aone:flex aone:grow aone:items-center`,children:[(0,q.jsx)(`span`,{className:`aone:@2xl:hidden`,children:(0,q.jsx)(mA,{})}),(0,q.jsxs)(`div`,{className:`aone:relative aone:flex-grow`,children:[(0,q.jsx)(`input`,{type:`text`,name:`end-date`,value:C,"aria-label":l,"aria-invalid":D?`true`:void 0,placeholder:re?`mm/dd/yy`:l,autoComplete:`off`,className:(0,J.default)(`aone:ml-2 aone:focus:outline-none aone:disabled:bg-white aone:text-black aone:text-base aone:w-full aone:pr-7`,{"aone:text-red-500":!!D}),onChange:e=>{let t=wI(e.target.value,C);w(t),O(null),F(xI(t)),oe.current(k,null)},onFocus:()=>{ie(!0),me()},onBlur:e=>{let t=TI(e.target.value);w(t);let n=ve(t);ie(!1),!n&&fe.current===`forward`&&requestAnimationFrame(()=>ce.current?.focus()),fe.current=null},onKeyDown:e=>{e.key===`Tab`&&(fe.current=e.shiftKey?`backward`:`forward`),e.key===`Enter`&&(e.preventDefault(),be(),e.target.blur())}}),D&&(0,q.jsx)(`span`,{className:`aone:absolute aone:right-2 aone:top-1/2 aone:-translate-y-1/2`,children:(0,q.jsx)(bI,{message:D,buttonRef:ce})})]})]})]})]})]});return(0,q.jsxs)(`div`,{id:`A1-DateRangePicker`,ref:v,className:a,style:Ce,role:`group`,"aria-label":`Date range picker`,"aria-describedby":Ee,children:[we?(0,q.jsxs)(oA,{open:N,onOpenChange:ge,children:[De,(0,q.jsxs)(aA,{className:`ao-dialog--calendar-light`,open:N,onOpenChange:ge,"aria-labelledby":Te,"aria-describedby":void 0,children:[(0,q.jsx)(sA,{id:Te,className:`aone:sr-only`,children:`Filter Options`}),(0,q.jsx)(bA,{origin:e,destination:t,initialDate:ae,startDate:k,endDate:j,previewDate:ee,onChange:xe,onMonthViewChange:r,flightCalendar:u,flightCalendarStatus:d,onlyDirects:f,referenceDates:h,minDate:g},ae.toISOString()),_&&(0,q.jsxs)(`div`,{className:`aone:mt-3 aone:flex aone:justify-between aone:items-center aone:pt-0 aone:pb-1 aone:md:pb-2 aone:px-1`,children:[(0,q.jsx)(`button`,{type:`button`,className:`aone:bg-slate-400 aone:text-white aone:text-[14px] aone:rounded-lg aone:px-4 aone:py-1 aone:ring-slate-500`,onClick:Se,"data-testid":`date-range-picker-reset-button`,children:`Reset`}),(0,q.jsx)(`button`,{type:`button`,className:`aone:bg-primary aone:text-white aone:text-[14px] aone:rounded-lg aone:px-4 aone:py-1 aone:ring-primary`,onClick:he,"data-testid":`date-range-picker-done-button`,children:`Done`})]})]})]}):(0,q.jsxs)(cA,{open:N,onOpenChange:ge,children:[(0,q.jsx)(dA,{asChild:!0,children:De}),(0,q.jsxs)(uA,{side:`bottom`,align:`center`,sticky:`always`,avoidCollisions:!1,onOpenAutoFocus:e=>e.preventDefault(),onInteractOutside:e=>{let t=e.target;t&&le.current?.contains(t)&&e.preventDefault()},sideOffset:4,portalContainer:y,role:`dialog`,"aria-label":`Calendar for date selection`,"aria-describedby":`calendar-instructions`,className:`aone:w-max aone:max-w-[100vw] aone:p-0 aone:bg-white aone:border aone:border-gray-300 aone:rounded-xl aone:shadow-lg aone:md:mt-2 aone:pb-2`,children:[(0,q.jsx)(`div`,{id:`calendar-instructions`,className:`aone:sr-only`,children:`Use arrow keys to navigate dates. Press Enter or Space to select a date. Press Escape to close the calendar.`}),(0,q.jsx)(bA,{origin:e,destination:t,initialDate:ae,startDate:k,endDate:j,previewDate:ee,onChange:xe,onMonthViewChange:r,flightCalendar:u,flightCalendarStatus:d,onlyDirects:f,referenceDates:h,minDate:g},ae.toISOString()),_&&(0,q.jsxs)(`div`,{className:`aone:mt-3 aone:md:mt-0 aone:flex aone:justify-between aone:items-center aone:pt-0 aone:pb-1 aone:md:pb-2 aone:px-5`,children:[(0,q.jsx)(`button`,{type:`button`,className:`aone:bg-slate-400 aone:text-white aone:text-[14px] aone:rounded-lg aone:px-4 aone:py-1 aone:ring-slate-500`,onClick:Se,"data-testid":`date-range-picker-popover-reset-button`,children:`Reset`}),(0,q.jsx)(`button`,{type:`button`,className:`aone:bg-primary aone:text-white aone:text-[14px] aone:rounded-lg aone:px-4 aone:py-1 aone:ring-primary`,onClick:he,"data-testid":`date-range-picker-popover-done-button`,children:`Done`})]})]})]}),(0,q.jsx)(`div`,{id:Ee,className:`aone:sr-only`,children:i?`Departure date input. Enter a date manually or open the calendar to pick one.`:`Departure and return date inputs. Enter dates manually or open the calendar to pick a date range.`})]})}function OI(e){if(e===`00:00`)return`Midnight`;if(e===`12:00`)return`Noon`;let[t=`00`,n=`00`]=e.split(`:`),r=parseInt(t,10),i=r<12?`am`:`pm`;return r===0&&(r=12),r>12&&(r-=12),`${r}:${n.padStart(2,`0`)} ${i}`}var kI=Array.from({length:48},(e,t)=>{let n=Math.floor(t/2),r=t%2==0?`00`:`30`;return`${n.toString().padStart(2,`0`)}:${r}`}),AI=({value:e,onChange:t,label:n,header:r=`Select pick-up time`,portalContainer:i})=>{let[a,o]=(0,K.useState)(!1);return(0,q.jsxs)(cA,{open:a,onOpenChange:o,children:[(0,q.jsx)(lA,{asChild:!0,children:(0,q.jsxs)(`button`,{type:`button`,className:`aone:w-full aone:h-full aone:text-base aone:px-4 aone:py-2 aone:bg-white aone:dark:bg-gray-800 aone:rounded-md aone:text-left aone:shadow-sm aone:flex aone:items-center aone:justify-between aone:cursor-pointer aone:border-2 aone:border-gray-200 aone:dark:border-gray-600 aone:text-foreground`,"data-testid":`time-picker-trigger`,children:[(0,q.jsx)(`span`,{children:e?OI(e):n||`Select time`}),(0,q.jsx)(`div`,{className:`aone:pointer-events-none aone:flex aone:items-center`,children:(0,q.jsx)(yI,{icon:a?SA:TA,className:`aone:h-4 aone:w-4 aone:text-muted-foreground`})})]})}),(0,q.jsxs)(uA,{className:`aone:p-0 aone:w-64 aone:shadow-lg aone:rounded-xl`,portalContainer:i,children:[(0,q.jsx)(`div`,{className:`aone:border-b aone:px-4 aone:py-3 aone:font-semibold aone:text-base aone:text-foreground`,children:r}),(0,q.jsx)(`div`,{className:`aone:max-h-72 aone:overflow-y-auto aone:p-2`,style:{WebkitOverflowScrolling:`touch`,overscrollBehavior:`contain`,touchAction:`pan-y`},onTouchStart:e=>e.stopPropagation(),onTouchMove:e=>e.stopPropagation(),children:(0,q.jsx)(`div`,{className:`aone:grid aone:grid-cols-2 aone:gap-2`,children:kI.map(n=>(0,q.jsx)(`button`,{type:`button`,className:`py-2 px-2 rounded-md text-sm w-full text-left transition ${e===n?`bg-primary text-primary-foreground hover:bg-primary/90`:`bg-background text-foreground border border-transparent hover:bg-muted`}`,onClick:()=>{t(n),o(!1)},"data-testid":`time-picker-option-${n.replace(`:`,`-`)}`,children:OI(n)},n))})})]})]})};function jI({label:e,dateValue:t,timeValue:n,onDateChange:r,onTimeChange:i,origin:a,destination:o,className:s,referenceDates:c,minDate:l,shadowRoot:u}){let d=(0,K.useRef)(null),[f,p]=(0,K.useState)(null);return(0,K.useLayoutEffect)(()=>{if(!u||!d.current)return;let e=document.createElement(`div`);return u.appendChild(e),queueMicrotask(()=>p(e)),()=>{e.parentNode&&e.parentNode.removeChild(e)}},[u]),(0,q.jsxs)(`div`,{ref:d,className:`w-full md:w-auto md:flex-1 md:min-w-[325px] ${s||``}`,children:[(0,q.jsx)(`label`,{className:`aone:block aone:text-sm aone:font-medium aone:text-gray-700 aone:dark:text-gray-300`,children:e}),(0,q.jsxs)(`div`,{className:`aone:mt-1 aone:flex aone:bg-white aone:dark:bg-gray-800 aone:rounded-lg`,children:[(0,q.jsx)(`div`,{className:`aone:grow`,children:(0,q.jsx)(DI,{className:`aone:grow`,origin:a,destination:o,startDateLabel:e,endDateLabel:``,initialStartDate:t?new Date(t):null,initialEndDate:null,onChange:r,onMonthViewChange:()=>{},oneWay:!0,referenceDates:c,minDate:l,showButtons:!0,shadowRoot:u})}),(0,q.jsx)(`div`,{className:`aone:min-w-[150px] `,children:(0,q.jsx)(AI,{value:n,onChange:i,portalContainer:f})})]})]})}function MI(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function NI(){return NI=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},NI.apply(null,arguments)}var PI=s(((e,t)=>{t.exports=`SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED`})),FI=s(((e,t)=>{var n=PI();function r(){}function i(){}i.resetWarningCache=r,t.exports=function(){function e(e,t,r,i,a,o){if(o!==n){var s=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name=`Invariant Violation`,s}}e.isRequired=e;function t(){return e}var a={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:r};return a.PropTypes=a,a}})),II=s(((e,t)=>{t.exports=FI()()})),LI=s((e=>{})),RI=s(((e,t)=>{t.exports=LI()})),$=u(II(),1);RI();var zI=e=>typeof e==`object`&&!!e&&e.nodeType===1,BI=(e,t)=>(!t||e!==`hidden`)&&e!==`visible`&&e!==`clip`,VI=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){let n=getComputedStyle(e,null);return BI(n.overflowY,t)||BI(n.overflowX,t)||(e=>{let t=(e=>{if(!e.ownerDocument||!e.ownerDocument.defaultView)return null;try{return e.ownerDocument.defaultView.frameElement}catch{return null}})(e);return!!t&&(t.clientHeight<e.scrollHeight||t.clientWidth<e.scrollWidth)})(e)}return!1},HI=(e,t,n,r,i,a,o,s)=>a<e&&o>t||a>e&&o<t?0:a<=e&&s<=n||o>=t&&s>=n?a-e-r:o>t&&s<n||a<e&&s>n?o-t+i:0,UI=e=>e.parentElement??(e.getRootNode().host||null),WI=(e,t)=>{if(typeof document>`u`)return[];let{scrollMode:n,block:r,inline:i,boundary:a,skipOverflowHiddenElements:o}=t,s=typeof a==`function`?a:e=>e!==a;if(!zI(e))throw TypeError(`Invalid target`);let c=document.scrollingElement||document.documentElement,l=[],u=e;for(;zI(u)&&s(u);){if(u=UI(u),u===c){l.push(u);break}u!=null&&u===document.body&&VI(u)&&!VI(document.documentElement)||u!=null&&VI(u,o)&&l.push(u)}let d=window.visualViewport?.width??innerWidth,f=window.visualViewport?.height??innerHeight,{scrollX:p,scrollY:m}=window,{height:h,width:g,top:_,right:v,bottom:y,left:b}=e.getBoundingClientRect(),{top:x,right:S,bottom:C,left:w}=(e=>{let t=window.getComputedStyle(e);return{top:parseFloat(t.scrollMarginTop)||0,right:parseFloat(t.scrollMarginRight)||0,bottom:parseFloat(t.scrollMarginBottom)||0,left:parseFloat(t.scrollMarginLeft)||0}})(e),T=r===`start`||r===`nearest`?_-x:r===`end`?y+C:_+h/2-x+C,E=i===`center`?b+g/2-w+S:i===`end`?v+S:b-w,D=[];for(let e=0;e<l.length;e++){let t=l[e],{height:a,width:o,top:s,right:u,bottom:x,left:S}=t.getBoundingClientRect();if(n===`if-needed`&&_>=0&&b>=0&&y<=f&&v<=d&&(t===c&&!VI(t)||_>=s&&y<=x&&b>=S&&v<=u))return D;let C=getComputedStyle(t),w=parseInt(C.borderLeftWidth,10),O=parseInt(C.borderTopWidth,10),k=parseInt(C.borderRightWidth,10),A=parseInt(C.borderBottomWidth,10),j=0,M=0,N=`offsetWidth`in t?t.offsetWidth-t.clientWidth-w-k:0,P=`offsetHeight`in t?t.offsetHeight-t.clientHeight-O-A:0,ee=`offsetWidth`in t?t.offsetWidth===0?0:o/t.offsetWidth:0,F=`offsetHeight`in t?t.offsetHeight===0?0:a/t.offsetHeight:0;if(c===t)j=r===`start`?T:r===`end`?T-f:r===`nearest`?HI(m,m+f,f,O,A,m+T,m+T+h,h):T-f/2,M=i===`start`?E:i===`center`?E-d/2:i===`end`?E-d:HI(p,p+d,d,w,k,p+E,p+E+g,g),j=Math.max(0,j+m),M=Math.max(0,M+p);else{j=r===`start`?T-s-O:r===`end`?T-x+A+P:r===`nearest`?HI(s,x,a,O,A+P,T,T+h,h):T-(s+a/2)+P/2,M=i===`start`?E-S-w:i===`center`?E-(S+o/2)+N/2:i===`end`?E-u+k+N:HI(S,u,o,w,k+N,E,E+g,g);let{scrollLeft:e,scrollTop:n}=t;j=F===0?0:Math.max(0,Math.min(n+j/F,t.scrollHeight-a/F+P)),M=ee===0?0:Math.max(0,Math.min(e+M/ee,t.scrollWidth-o/ee+N)),T+=n-j,E+=e-M}D.push({el:t,top:j,left:M})}return D},GI=0;function KI(){return String(GI++)}function qI(e){var t=K.useRef(e);return t.current=e,t}function JI(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){t.forEach(function(t){typeof t==`function`?t(e):t&&(t.current=e)})}}function YI(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){for(var n=arguments.length,r=Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return t.some(function(t){return t&&t.apply(void 0,[e].concat(r)),e.preventDownshiftDefault||e.hasOwnProperty(`nativeEvent`)&&e.nativeEvent.preventDownshiftDefault})}}function XI(e,t){var n;function r(){n&&clearTimeout(n)}function i(){for(var i=arguments.length,a=Array(i),o=0;o<i;o++)a[o]=arguments[o];r(),n=setTimeout(function(){n=null,e.apply(void 0,a)},t)}return i.cancel=r,i}var ZI=XI(function(e){QI(e).textContent=``},500);function QI(e){var t=e.getElementById(`a11y-status-message`);return t||(t=e.createElement(`div`),t.setAttribute(`id`,`a11y-status-message`),t.setAttribute(`role`,`status`),t.setAttribute(`aria-live`,`polite`),t.setAttribute(`aria-relevant`,`additions text`),Object.assign(t.style,{border:`0`,clip:`rect(0 0 0 0)`,height:`1px`,margin:`-1px`,overflow:`hidden`,padding:`0`,position:`absolute`,width:`1px`}),e.body.appendChild(t),t)}function $I(e,t){if(!(!e||!t)){var n=QI(t);n.textContent=e,ZI(t)}}function eL(e){var t=e?.getElementById(`a11y-status-message`);t&&t.remove()}function tL(){}var nL=tL;function rL(e,t){return t?Object.keys(e).reduce(function(e,n){return t[n]!==void 0&&(e[n]=t[n]),e},NI({},e)):e}function iL(e,t){e&&WI(e,{boundary:t,block:`nearest`,scrollMode:`if-needed`}).forEach(function(e){var t=e.el,n=e.top,r=e.left;t.scrollTop=n,t.scrollLeft=r})}function aL(e,t,n){return e===t||t instanceof n.Node&&e.contains&&e.contains(t)}function oL(e,t){var n;function r(){n&&clearTimeout(n)}function i(){for(var i=arguments.length,a=Array(i),o=0;o<i;o++)a[o]=arguments[o];r(),n=setTimeout(function(){n=null,e.apply(void 0,a)},t)}return i.cancel=r,i}function sL(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){for(var n=arguments.length,r=Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return t.some(function(t){return t&&t.apply(void 0,[e].concat(r)),e.preventDownshiftDefault||e.hasOwnProperty(`nativeEvent`)&&e.nativeEvent.preventDownshiftDefault})}}function cL(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){t.forEach(function(t){typeof t==`function`?t(e):t&&(t.current=e)})}}function lL(e,t){return e[t]!==void 0}function uL(e){var t=e.key,n=e.keyCode;return n>=37&&n<=40&&t.indexOf(`Arrow`)!==0?`Arrow`+t:t}function dL(e,t,n,r,i){i===void 0&&(i=!1);var a=n.length;if(a===0)return-1;var o=a-1;(typeof e!=`number`||e<0||e>o)&&(e=t>0?-1:o+1);var s=e+t;s<0?s=i?o:0:s>o&&(s=i?0:o);var c=fL(s,t<0,n,r,i);return c===-1?e>=a?-1:e:c}function fL(e,t,n,r,i){i===void 0&&(i=!1);var a=n.length;if(t){for(var o=e;o>=0;o--)if(!r(n[o],o))return o}else for(var s=e;s<a;s++)if(!r(n[s],s))return s;return i?fL(t?a-1:0,t,n,r):-1}function pL(e,t,n,r){return r===void 0&&(r=!0),n&&t.some(function(t){return t&&(aL(t,e,n)||r&&aL(t,n.document.activeElement,n))})}function mL(e){return``+e.slice(0,1).toUpperCase()+e.slice(1)}function hL(e,t,n,r){for(var i=e.type,a={},o=Object.keys(n),s=0,c=o;s<c.length;s++){var l=c[s];gL(l,e,t,n,r),r[l]!==n[l]&&(a[l]=r[l])}t.onStateChange&&Object.keys(a).length&&t.onStateChange(NI({type:i},a))}function gL(e,t,n,r,i){if(i[e]!==r[e]){var a=n[`on`+mL(e)+`Change`];if(typeof a==`function`){var o=t.type;a(NI({type:o},i))}}}function _L(e,t,n,r){var i=K.useRef(null),a=K.useRef(void 0),o=qI(t),s=K.useCallback(function(t,n){a.current=n,t=rL(t,o.current);var r=e(t,o.current,n),i=o.current.stateReducer(t,NI({},n,{changes:r}));return NI({},t,i)},[o,e]),c=K.useReducer(s,t,n),l=c[0],u=c[1],d=a.current;return K.useEffect(function(){var e=rL(i.current??{},o.current);d&&i.current&&!r(e,l)&&hL(d,o.current,e,l),i.current=l},[l,d,r,o]),[l,u]}function vL(e,t,n,r){var i=_L(e,t,n,r),a=i[0],o=i[1];return[rL(a,t),o]}function yL(e,t,n,r){if(e!==void 0&&t!==void 0)return[e,t];if(e!==void 0){if(n.indexOf(e)<0)throw Error(r);return[e,n.indexOf(e)]}if(t!==void 0){var i=n[t];if(i===void 0)throw Error(r);return[i,t]}throw Error(r)}function bL(){var e=K.useRef(!0);return K.useEffect(function(){return e.current=!1,function(){e.current=!0}},[]),e.current}function xL(e,t){return t.changes}var SL={environment:$.default.shape({addEventListener:$.default.func.isRequired,removeEventListener:$.default.func.isRequired,document:$.default.shape({createElement:$.default.func.isRequired,getElementById:$.default.func.isRequired,activeElement:$.default.any.isRequired,body:$.default.any.isRequired}).isRequired,Node:$.default.func.isRequired}),itemToKey:$.default.func,stateReducer:$.default.func};function CL(e,t,n){var r=e[`default`+mL(t)];return r===void 0?n[t]:r}function wL(e,t,n){var r=e[t];if(r!==void 0)return r;var i=e[`initial`+mL(t)];return i===void 0?CL(e,t,n):i}var TL=XI(function(e,t){$I(e,t)},200);function EL(e,t,n,r){var i=r?.document,a=bL();K.useEffect(function(){!e||a||!i||TL(e(t),i)},n),K.useEffect(function(){return function(){TL.cancel(),eL(i)}},[i])}var DL=NI({},SL,{getA11yStatusMessage:$.default.func,highlightedIndex:$.default.number,defaultHighlightedIndex:$.default.number,initialHighlightedIndex:$.default.number,isOpen:$.default.bool,defaultIsOpen:$.default.bool,initialIsOpen:$.default.bool,selectedItem:$.default.any,initialSelectedItem:$.default.any,defaultSelectedItem:$.default.any,id:$.default.string,labelId:$.default.string,menuId:$.default.string,getItemId:$.default.func,toggleButtonId:$.default.string,onSelectedItemChange:$.default.func,onHighlightedIndexChange:$.default.func,onStateChange:$.default.func,onIsOpenChange:$.default.func,scrollIntoView:$.default.func}),OL={itemToString:function(e){return e?String(e):``},itemToKey:function(e){return e},stateReducer:xL,scrollIntoView:iL,environment:typeof window>`u`?void 0:window},kL={highlightedIndex:-1,isOpen:!1,selectedItem:null,inputValue:``},AL=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0?K.useLayoutEffect:K.useEffect;function jL(e){return/^\S{1}$/.test(e)}function ML(e){var t=wL(e,`selectedItem`,kL),n=wL(e,`isOpen`,kL),r=VL(e),i=wL(e,`inputValue`,kL);return{highlightedIndex:r<0&&t&&n?e.items.findIndex(function(n){return e.itemToKey(n)===e.itemToKey(t)}):r,isOpen:n,selectedItem:t,inputValue:i}}function NL(e,t,n){var r=e.items,i=e.initialHighlightedIndex,a=e.defaultHighlightedIndex,o=e.isItemDisabled,s=e.itemToKey,c=t.selectedItem,l=t.highlightedIndex;return r.length===0?-1:i!==void 0&&l===i&&!o(r[i],i)?i:a!==void 0&&!o(r[a],a)?a:c?r.findIndex(function(e){return s(c)===s(e)}):n<0&&!o(r[r.length-1],r.length-1)?r.length-1:n>0&&!o(r[0],0)?0:-1}function PL(e,t,n){var r=K.useRef({isMouseDown:!1,isTouchMove:!1,isTouchEnd:!1}),i=K.useCallback(function(){return n.map(function(e){return e.current})},[n]);return K.useEffect(function(){if(!e)return tL;function n(){r.current.isTouchEnd=!1,r.current.isMouseDown=!0}function a(n){r.current.isMouseDown=!1,pL(n.target,i(),e)||t()}function o(){r.current.isTouchEnd=!1,r.current.isTouchMove=!1}function s(){r.current.isTouchMove=!0}function c(n){r.current.isTouchEnd=!0,!r.current.isTouchMove&&!pL(n.target,i(),e,!1)&&t()}return e.addEventListener(`mousedown`,n),e.addEventListener(`mouseup`,a),e.addEventListener(`touchstart`,o),e.addEventListener(`touchmove`,s),e.addEventListener(`touchend`,c),function(){e.removeEventListener(`mousedown`,n),e.removeEventListener(`mouseup`,a),e.removeEventListener(`touchstart`,o),e.removeEventListener(`touchmove`,s),e.removeEventListener(`touchend`,c)}},[e,i,t]),r.current}var FL=function(){return tL};function IL(e){var t=e.highlightedIndex,n=e.isOpen,r=e.itemRefs,i=e.getItemNodeFromIndex,a=e.menuElement,o=e.scrollIntoView,s=K.useRef(!0);return AL(function(){t<0||!n||!Object.keys(r.current).length||(s.current===!1?s.current=!0:o(i(t),a))},[t]),s}var LL=tL;function RL(e,t,n){return n===void 0&&(n=!0),NI({isOpen:!1,highlightedIndex:-1},e.items?.length&&t>=0&&NI({selectedItem:e.items[t],isOpen:CL(e,`isOpen`,kL),highlightedIndex:CL(e,`highlightedIndex`,kL)},n&&{inputValue:e.itemToString(e.items[t])}))}function zL(e,t){return e.isOpen===t.isOpen&&e.inputValue===t.inputValue&&e.highlightedIndex===t.highlightedIndex&&e.selectedItem===t.selectedItem}function BL(e){var t=CL(e,`highlightedIndex`,kL);return t>-1&&e.isItemDisabled(e.items[t],t)?-1:t}function VL(e){var t=wL(e,`highlightedIndex`,kL);return t>-1&&e.isItemDisabled(e.items[t],t)?-1:t}function HL(e,t,n,r){var i=n.type,a;switch(i){case r.ItemMouseMove:a={highlightedIndex:n.disabled?-1:n.index};break;case r.MenuMouseLeave:a={highlightedIndex:-1};break;case r.ToggleButtonClick:case r.FunctionToggleMenu:a={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:NL(t,e,0)};break;case r.FunctionOpenMenu:a={isOpen:!0,highlightedIndex:NL(t,e,0)};break;case r.FunctionCloseMenu:a={isOpen:!1};break;case r.FunctionSetHighlightedIndex:a={highlightedIndex:t.isItemDisabled(t.items[n.highlightedIndex],n.highlightedIndex)?-1:n.highlightedIndex};break;case r.FunctionSetInputValue:a={inputValue:n.inputValue};break;case r.FunctionReset:a={highlightedIndex:BL(t),isOpen:CL(t,`isOpen`,kL),selectedItem:CL(t,`selectedItem`,kL),inputValue:CL(t,`inputValue`,kL)};break;default:throw Error(`Reducer called without proper action type.`)}return NI({},e,a)}var UL=NI({},DL,{items:$.default.array.isRequired,isItemDisabled:$.default.func}),WL=NI({},OL,{isItemDisabled:function(){return!1}});function GL(e){for(var t=e.keysSoFar,n=e.highlightedIndex,r=e.items,i=e.itemToString,a=e.isItemDisabled,o=t.toLowerCase(),s=0;s<r.length;s++){var c=(s+n+ +(t.length<2))%r.length,l=r[c];if(l!==void 0&&i(l).toLowerCase().startsWith(o)&&!a(l,c))return c}return n}var KL=0,qL=1,JL=2,YL=3,XL=4,ZL=5,QL=6,$L=7,eR=8,tR=9,nR=10,rR=11,iR=12,aR=13,oR=14,sR=15,cR=16,lR=17,uR=18,dR=19,fR=20,pR=21,mR=Object.freeze({__proto__:null,FunctionCloseMenu:lR,FunctionOpenMenu:cR,FunctionReset:pR,FunctionSelectItem:dR,FunctionSetHighlightedIndex:uR,FunctionSetInputValue:fR,FunctionToggleMenu:sR,ItemClick:oR,ItemMouseMove:aR,MenuMouseLeave:iR,ToggleButtonBlur:rR,ToggleButtonClick:KL,ToggleButtonKeyDownArrowDown:qL,ToggleButtonKeyDownArrowUp:JL,ToggleButtonKeyDownCharacter:YL,ToggleButtonKeyDownEnd:QL,ToggleButtonKeyDownEnter:$L,ToggleButtonKeyDownEscape:XL,ToggleButtonKeyDownHome:ZL,ToggleButtonKeyDownPageDown:nR,ToggleButtonKeyDownPageUp:tR,ToggleButtonKeyDownSpaceButton:eR});function hR(e,t,n){var r=n.type,i=n.altKey,a;switch(r){case oR:a={isOpen:CL(t,`isOpen`,kL),highlightedIndex:BL(t),selectedItem:t.items[n.index]};break;case YL:var o=n.key,s=``+e.inputValue+o;a={inputValue:s,highlightedIndex:GL({keysSoFar:s,highlightedIndex:!e.isOpen&&e.selectedItem?t.items.findIndex(function(n){return t.itemToKey(n)===t.itemToKey(e.selectedItem)}):e.highlightedIndex,items:t.items,itemToString:t.itemToString,isItemDisabled:t.isItemDisabled}),isOpen:!0};break;case qL:a={highlightedIndex:e.isOpen?dL(e.highlightedIndex,1,t.items,t.isItemDisabled):i&&e.selectedItem==null?-1:NL(t,e,1),isOpen:!0};break;case JL:a=e.isOpen&&i?RL(t,e.highlightedIndex,!1):{highlightedIndex:e.isOpen?dL(e.highlightedIndex,-1,t.items,t.isItemDisabled):NL(t,e,-1),isOpen:!0};break;case $L:case eR:a=RL(t,e.highlightedIndex,!1);break;case ZL:a={highlightedIndex:fL(0,!1,t.items,t.isItemDisabled),isOpen:!0};break;case QL:a={highlightedIndex:fL(t.items.length-1,!0,t.items,t.isItemDisabled),isOpen:!0};break;case tR:a={highlightedIndex:dL(e.highlightedIndex,-10,t.items,t.isItemDisabled)};break;case nR:a={highlightedIndex:dL(e.highlightedIndex,10,t.items,t.isItemDisabled)};break;case XL:a={isOpen:!1,highlightedIndex:-1};break;case rR:a=NI({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&t.items?.length&&{selectedItem:t.items[e.highlightedIndex]});break;case dR:a={selectedItem:n.selectedItem};break;default:return HL(e,t,n,mR)}return NI({},e,a)}var gR=NI({},K).useId,_R=typeof gR==`function`?vR:yR;function vR(e){var t=e.id,n=e.labelId,r=e.menuId,i=e.getItemId,a=e.toggleButtonId,o=e.inputId,s=`downshift-`+gR();return t||=s,K.useMemo(function(){return{labelId:n??t+`-label`,menuId:r??t+`-menu`,getItemId:i??function(e){return t+`-item-`+e},toggleButtonId:a??t+`-toggle-button`,inputId:o??t+`-input`}},[i,t,o,n,r,a])}function yR(e){var t=e.id,n=e.labelId,r=e.menuId,i=e.getItemId,a=e.toggleButtonId,o=e.inputId,s=K.useRef(t??`downshift-`+KI()).current;return K.useMemo(function(){return{labelId:n??s+`-label`,menuId:r??s+`-menu`,getItemId:i??function(e){return s+`-item-`+e},toggleButtonId:a??s+`-toggle-button`,inputId:o??s+`-input`}},[i,o,n,r,a,s])}var bR=[`onClick`],xR=[`onMouseLeave`,`refKey`,`ref`],SR=[`onBlur`,`onClick`,`onPress`,`onKeyDown`,`refKey`,`ref`],CR=[`item`,`index`,`onMouseMove`,`onClick`,`onMouseDown`,`onPress`,`refKey`,`disabled`,`ref`];wR.stateChangeTypes=mR;function wR(e){e===void 0&&(e={}),nL(e,wR,UL);var t=NI({},WL,e),n=t.scrollIntoView,r=t.environment,i=t.getA11yStatusMessage,a=vL(hR,t,ML,zL),o=a[0],s=a[1],c=o.isOpen,l=o.highlightedIndex,u=o.selectedItem,d=o.inputValue,f=(0,K.useRef)(null),p=(0,K.useRef)(null),m=(0,K.useRef)({}),h=(0,K.useRef)(null),g=_R(t),_=qI({state:o,props:t}),v=(0,K.useCallback)(function(e){return m.current[g.getItemId(e)]},[g]);EL(i,o,[c,l,u,d],r);var y=IL({menuElement:p.current,highlightedIndex:l,isOpen:c,itemRefs:m,scrollIntoView:n,getItemNodeFromIndex:v});(0,K.useEffect)(function(){return h.current=oL(function(e){e({type:fR,inputValue:``})},500),function(){h.current.cancel()}},[]),(0,K.useEffect)(function(){d&&h.current(s)},[s,d]),LL({props:t,state:o}),(0,K.useEffect)(function(){wL(t,`isOpen`,kL)&&f.current&&f.current.focus()},[]);var b=PL(r,(0,K.useCallback)(function(){_.current.state.isOpen&&s({type:rR})},[s,_]),(0,K.useMemo)(function(){return[p,f]},[])),x=FL(`getMenuProps`,`getToggleButtonProps`);(0,K.useEffect)(function(){c||(m.current={})},[c]);var S=(0,K.useMemo)(function(){return{ArrowDown:function(e){e.preventDefault(),s({type:qL,altKey:e.altKey})},ArrowUp:function(e){e.preventDefault(),s({type:JL,altKey:e.altKey})},Home:function(e){e.preventDefault(),s({type:ZL})},End:function(e){e.preventDefault(),s({type:QL})},Escape:function(){_.current.state.isOpen&&s({type:XL})},Enter:function(e){e.preventDefault(),s({type:_.current.state.isOpen?$L:KL})},PageUp:function(e){_.current.state.isOpen&&(e.preventDefault(),s({type:tR}))},PageDown:function(e){_.current.state.isOpen&&(e.preventDefault(),s({type:nR}))}," ":function(e){e.preventDefault();var t=_.current.state;if(!t.isOpen){s({type:KL});return}t.inputValue?s({type:YL,key:` `}):s({type:eR})}}},[s,_]),C=(0,K.useCallback)(function(){s({type:sR})},[s]),w=(0,K.useCallback)(function(){s({type:lR})},[s]),T=(0,K.useCallback)(function(){s({type:cR})},[s]),E=(0,K.useCallback)(function(e){s({type:uR,highlightedIndex:e})},[s]),D=(0,K.useCallback)(function(e){s({type:dR,selectedItem:e})},[s]),O=(0,K.useCallback)(function(){s({type:pR})},[s]),k=(0,K.useCallback)(function(e){s({type:fR,inputValue:e})},[s]),A=(0,K.useCallback)(function(e){var t=e===void 0?{}:e,n=t.onClick,r=MI(t,bR);return NI({id:g.labelId,htmlFor:g.toggleButtonId,onClick:sL(n,function(){var e;(e=f.current)==null||e.focus()})},r)},[g]),j=(0,K.useCallback)(function(e,t){var n,r=e===void 0?{}:e,i=r.onMouseLeave,a=r.refKey,o=a===void 0?`ref`:a,c=r.ref,l=MI(r,xR),u=(t===void 0?{}:t).suppressRefError;return x(`getMenuProps`,u===void 0?!1:u,o,p),NI((n={},n[o]=cL(c,function(e){p.current=e}),n.id=g.menuId,n.role=`listbox`,n[`aria-labelledby`]=l&&l[`aria-label`]?void 0:``+g.labelId,n.onMouseLeave=sL(i,function(){s({type:iR})}),n),l)},[s,x,g]);return{getToggleButtonProps:(0,K.useCallback)(function(e,t){var n,r=e===void 0?{}:e,i=r.onBlur,a=r.onClick;r.onPress;var o=r.onKeyDown,c=r.refKey,l=c===void 0?`ref`:c,u=r.ref,d=MI(r,SR),p=(t===void 0?{}:t).suppressRefError,m=p===void 0?!1:p,h=_.current.state,v=function(){s({type:KL})},y=function(){h.isOpen&&!b.isMouseDown&&s({type:rR})},C=function(e){var t=uL(e);t&&S[t]?S[t](e):jL(t)&&s({type:YL,key:t})},w=NI((n={},n[l]=cL(u,function(e){f.current=e}),n[`aria-activedescendant`]=h.isOpen&&h.highlightedIndex>-1?g.getItemId(h.highlightedIndex):``,n[`aria-controls`]=g.menuId,n[`aria-expanded`]=_.current.state.isOpen,n[`aria-haspopup`]=`listbox`,n[`aria-labelledby`]=d&&d[`aria-label`]?void 0:``+g.labelId,n.id=g.toggleButtonId,n.role=`combobox`,n.tabIndex=0,n.onBlur=sL(i,y),n),d);return d.disabled||(w.onClick=sL(a,v),w.onKeyDown=sL(o,C)),x(`getToggleButtonProps`,m,l,f),w},[s,g,_,b,x,S]),getLabelProps:A,getMenuProps:j,getItemProps:(0,K.useCallback)(function(e){var t,n=e===void 0?{}:e,r=n.item,i=n.index,a=n.onMouseMove,o=n.onClick,c=n.onMouseDown;n.onPress;var l=n.refKey,u=l===void 0?`ref`:l,d=n.disabled,f=n.ref,p=MI(n,CR);d!==void 0&&console.warn(`Passing "disabled" as an argument to getItemProps is not supported anymore. Please use the isItemDisabled prop from useSelect.`);var h=_.current,v=h.state,x=h.props,S=yL(r,i,x.items,`Pass either item or index to getItemProps!`),C=S[0],w=S[1],T=x.isItemDisabled(C,w),E=function(){b.isTouchEnd||w===v.highlightedIndex||(y.current=!1,s({type:aR,index:w,disabled:T}))},D=function(){s({type:oR,index:w})},O=function(e){return e.preventDefault()},k=NI((t={},t[u]=cL(f,function(e){e&&(m.current[g.getItemId(w)]=e)}),t[`aria-disabled`]=T,t[`aria-selected`]=C===v.selectedItem,t.id=g.getItemId(w),t.role=`option`,t),p);return T||(k.onClick=sL(o,D)),k.onMouseMove=sL(a,E),k.onMouseDown=sL(c,O),k},[_,g,b,y,s]),toggleMenu:C,openMenu:T,closeMenu:w,setHighlightedIndex:E,selectItem:D,reset:O,setInputValue:k,highlightedIndex:l,isOpen:c,selectedItem:u,inputValue:d}}var TR=0,ER=1,DR=2,OR=3,kR=4,AR=5,jR=6,MR=7,NR=8,PR=9,FR=10,IR=11,LR=12,RR=13,zR=14,BR=15,VR=16,HR=17,UR=18,WR=19,GR=20,KR=21,qR=22,JR=Object.freeze({__proto__:null,ControlledPropUpdatedSelectedItem:qR,FunctionCloseMenu:HR,FunctionOpenMenu:VR,FunctionReset:KR,FunctionSelectItem:WR,FunctionSetHighlightedIndex:UR,FunctionSetInputValue:GR,FunctionToggleMenu:BR,InputBlur:PR,InputChange:NR,InputClick:FR,InputKeyDownArrowDown:TR,InputKeyDownArrowUp:ER,InputKeyDownEnd:kR,InputKeyDownEnter:MR,InputKeyDownEscape:DR,InputKeyDownHome:OR,InputKeyDownPageDown:jR,InputKeyDownPageUp:AR,ItemClick:RR,ItemMouseMove:LR,MenuMouseLeave:IR,ToggleButtonClick:zR});function YR(e){var t=ML(e),n=t.selectedItem,r=t.inputValue;return r===``&&n&&e.defaultInputValue===void 0&&e.initialInputValue===void 0&&e.inputValue===void 0&&(r=e.itemToString(n)),NI({},t,{inputValue:r})}var XR=NI({},DL,{items:$.default.array.isRequired,isItemDisabled:$.default.func,inputValue:$.default.string,defaultInputValue:$.default.string,initialInputValue:$.default.string,inputId:$.default.string,onInputValueChange:$.default.func});function ZR(e,t,n,r){var i=(0,K.useRef)(),a=_L(e,t,n,r),o=a[0],s=a[1],c=bL();return(0,K.useEffect)(function(){lL(t,`selectedItem`)&&(c||t.itemToKey(t.selectedItem)!==t.itemToKey(i.current)&&s({type:qR,inputValue:t.itemToString(t.selectedItem)}),i.current=o.selectedItem===i.current?t.selectedItem:o.selectedItem)},[o.selectedItem,t.selectedItem]),[rL(o,t),s]}var QR=NI({},OL,{isItemDisabled:function(){return!1}});function $R(e,t,n){var r=n.type,i=n.altKey,a;switch(r){case RR:a={isOpen:CL(t,`isOpen`,kL),highlightedIndex:BL(t),selectedItem:t.items[n.index],inputValue:t.itemToString(t.items[n.index])};break;case TR:a=e.isOpen?{highlightedIndex:dL(e.highlightedIndex,1,t.items,t.isItemDisabled,!0)}:{highlightedIndex:i&&e.selectedItem==null?-1:NL(t,e,1),isOpen:t.items.length>=0};break;case ER:a=e.isOpen?i?RL(t,e.highlightedIndex):{highlightedIndex:dL(e.highlightedIndex,-1,t.items,t.isItemDisabled,!0)}:{highlightedIndex:NL(t,e,-1),isOpen:t.items.length>=0};break;case MR:a=RL(t,e.highlightedIndex);break;case DR:a=NI({isOpen:!1,highlightedIndex:-1},!e.isOpen&&{selectedItem:null,inputValue:``});break;case AR:a={highlightedIndex:dL(e.highlightedIndex,-10,t.items,t.isItemDisabled,!0)};break;case jR:a={highlightedIndex:dL(e.highlightedIndex,10,t.items,t.isItemDisabled,!0)};break;case OR:a={highlightedIndex:fL(0,!1,t.items,t.isItemDisabled)};break;case kR:a={highlightedIndex:fL(t.items.length-1,!0,t.items,t.isItemDisabled)};break;case PR:a=NI({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&t.items?.length&&n.selectItem&&{selectedItem:t.items[e.highlightedIndex],inputValue:t.itemToString(t.items[e.highlightedIndex])});break;case NR:a={isOpen:!0,highlightedIndex:BL(t),inputValue:n.inputValue};break;case FR:a={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:NL(t,e,0)};break;case WR:a={selectedItem:n.selectedItem,inputValue:t.itemToString(n.selectedItem)};break;case qR:a={inputValue:n.inputValue};break;default:return HL(e,t,n,JR)}return NI({},e,a)}var ez=[`onMouseLeave`,`refKey`,`ref`],tz=[`item`,`index`,`refKey`,`ref`,`onMouseMove`,`onMouseDown`,`onClick`,`onPress`,`disabled`],nz=[`onClick`,`onPress`,`refKey`,`ref`],rz=[`onKeyDown`,`onChange`,`onInput`,`onBlur`,`onChangeText`,`onClick`,`refKey`,`ref`];iz.stateChangeTypes=JR;function iz(e){e===void 0&&(e={}),nL(e,iz,XR);var t=NI({},QR,e),n=t.items,r=t.scrollIntoView,i=t.environment,a=t.getA11yStatusMessage,o=ZR($R,t,YR,zL),s=o[0],c=o[1],l=s.isOpen,u=s.highlightedIndex,d=s.selectedItem,f=s.inputValue,p=(0,K.useRef)(null),m=(0,K.useRef)({}),h=(0,K.useRef)(null),g=(0,K.useRef)(null),_=bL(),v=_R(t),y=(0,K.useRef)(),b=qI({state:s,props:t}),x=(0,K.useCallback)(function(e){return m.current[v.getItemId(e)]},[v]);EL(a,s,[l,u,d,f],i);var S=IL({menuElement:p.current,highlightedIndex:u,isOpen:l,itemRefs:m,scrollIntoView:r,getItemNodeFromIndex:x});LL({props:t,state:s}),(0,K.useEffect)(function(){wL(t,`isOpen`,kL)&&h.current&&h.current.focus()},[]),(0,K.useEffect)(function(){_||(y.current=n.length)});var C=PL(i,(0,K.useCallback)(function(){b.current.state.isOpen&&c({type:PR})},[c,b]),(0,K.useMemo)(function(){return[p,g,h]},[])),w=FL(`getInputProps`,`getMenuProps`);(0,K.useEffect)(function(){l||(m.current={})},[l]),(0,K.useEffect)(function(){var e;!l||!(i!=null&&i.document)||!(h!=null&&(e=h.current)!=null&&e.focus)||i.document.activeElement!==h.current&&h.current.focus()},[l,i]);var T=(0,K.useMemo)(function(){return{ArrowDown:function(e){e.preventDefault(),c({type:TR,altKey:e.altKey})},ArrowUp:function(e){e.preventDefault(),c({type:ER,altKey:e.altKey})},Home:function(e){b.current.state.isOpen&&(e.preventDefault(),c({type:OR}))},End:function(e){b.current.state.isOpen&&(e.preventDefault(),c({type:kR}))},Escape:function(e){var t=b.current.state;(t.isOpen||t.inputValue||t.selectedItem||t.highlightedIndex>-1)&&(e.preventDefault(),c({type:DR}))},Enter:function(e){!b.current.state.isOpen||e.which===229||(e.preventDefault(),c({type:MR}))},PageUp:function(e){b.current.state.isOpen&&(e.preventDefault(),c({type:AR}))},PageDown:function(e){b.current.state.isOpen&&(e.preventDefault(),c({type:jR}))}}},[c,b]),E=(0,K.useCallback)(function(e){return NI({id:v.labelId,htmlFor:v.inputId},e)},[v]),D=(0,K.useCallback)(function(e,t){var n,r=e===void 0?{}:e,i=r.onMouseLeave,a=r.refKey,o=a===void 0?`ref`:a,s=r.ref,l=MI(r,ez),u=(t===void 0?{}:t).suppressRefError;return w(`getMenuProps`,u===void 0?!1:u,o,p),NI((n={},n[o]=cL(s,function(e){p.current=e}),n.id=v.menuId,n.role=`listbox`,n[`aria-labelledby`]=l&&l[`aria-label`]?void 0:``+v.labelId,n.onMouseLeave=sL(i,function(){c({type:IR})}),n),l)},[c,w,v]),O=(0,K.useCallback)(function(e){var t,n,r=e===void 0?{}:e,i=r.item,a=r.index,o=r.refKey,s=o===void 0?`ref`:o,l=r.ref,u=r.onMouseMove,d=r.onMouseDown,f=r.onClick;r.onPress;var p=r.disabled,h=MI(r,tz);p!==void 0&&console.warn(`Passing "disabled" as an argument to getItemProps is not supported anymore. Please use the isItemDisabled prop from useCombobox.`);var g=b.current,_=g.props,y=g.state,x=yL(i,a,_.items,`Pass either item or index to getItemProps!`),w=x[0],T=x[1],E=_.isItemDisabled(w,T),D=`onClick`,O=f;return NI((t={},t[s]=cL(l,function(e){e&&(m.current[v.getItemId(T)]=e)}),t[`aria-disabled`]=E,t[`aria-selected`]=T===y.highlightedIndex,t.id=v.getItemId(T),t.role=`option`,t),!E&&(n={},n[D]=sL(O,function(){c({type:RR,index:T})}),n),{onMouseMove:sL(u,function(){C.isTouchEnd||T===y.highlightedIndex||(S.current=!1,c({type:LR,index:T,disabled:E}))}),onMouseDown:sL(d,function(e){return e.preventDefault()})},h)},[c,v,b,C,S]),k=(0,K.useCallback)(function(e){var t,n=e===void 0?{}:e,r=n.onClick;n.onPress;var i=n.refKey,a=i===void 0?`ref`:i,o=n.ref,s=MI(n,nz),l=b.current.state;return NI((t={},t[a]=cL(o,function(e){g.current=e}),t[`aria-controls`]=v.menuId,t[`aria-expanded`]=l.isOpen,t.id=v.toggleButtonId,t.tabIndex=-1,t),!s.disabled&&NI({},{onClick:sL(r,function(){c({type:zR})})}),s)},[c,b,v]),A=(0,K.useCallback)(function(e,t){var n,r=e===void 0?{}:e,a=r.onKeyDown,o=r.onChange,s=r.onInput,l=r.onBlur;r.onChangeText;var u=r.onClick,d=r.refKey,f=d===void 0?`ref`:d,p=r.ref,m=MI(r,rz),g=(t===void 0?{}:t).suppressRefError;w(`getInputProps`,g===void 0?!1:g,f,h);var _=b.current.state,y=function(e){var t=uL(e);t&&T[t]&&T[t](e)},x=function(e){c({type:NR,inputValue:e.target.value})},S=function(e){i!=null&&i.document&&_.isOpen&&!C.isMouseDown&&c({type:PR,selectItem:!(e.relatedTarget===null&&i.document.activeElement!==i.document.body)})},E=function(){c({type:FR})},D=`onChange`,O={};if(!m.disabled){var k;O=(k={},k[D]=sL(o,s,x),k.onKeyDown=sL(a,y),k.onBlur=sL(l,S),k.onClick=sL(u,E),k)}return NI((n={},n[f]=cL(p,function(e){h.current=e}),n[`aria-activedescendant`]=_.isOpen&&_.highlightedIndex>-1?v.getItemId(_.highlightedIndex):``,n[`aria-autocomplete`]=`list`,n[`aria-controls`]=v.menuId,n[`aria-expanded`]=_.isOpen,n[`aria-labelledby`]=m&&m[`aria-label`]?void 0:v.labelId,n.autoComplete=`off`,n.id=v.inputId,n.role=`combobox`,n.value=_.inputValue,n),O,m)},[c,v,i,T,b,C,w]),j=(0,K.useCallback)(function(){c({type:BR})},[c]),M=(0,K.useCallback)(function(){c({type:HR})},[c]),N=(0,K.useCallback)(function(){c({type:VR})},[c]),P=(0,K.useCallback)(function(e){c({type:UR,highlightedIndex:e})},[c]),ee=(0,K.useCallback)(function(e){c({type:WR,selectedItem:e})},[c]);return{getItemProps:O,getLabelProps:E,getMenuProps:D,getInputProps:A,getToggleButtonProps:k,toggleMenu:j,openMenu:N,closeMenu:M,setHighlightedIndex:P,setInputValue:(0,K.useCallback)(function(e){c({type:GR,inputValue:e})},[c]),selectItem:ee,reset:(0,K.useCallback)(function(){c({type:KR})},[c]),highlightedIndex:u,isOpen:l,selectedItem:d,inputValue:f}}var az={activeIndex:-1,selectedItems:[]};function oz(e,t){return wL(e,t,az)}function sz(e,t){return CL(e,t,az)}function cz(e){return{activeIndex:oz(e,`activeIndex`),selectedItems:oz(e,`selectedItems`)}}function lz(e){if(e.shiftKey||e.metaKey||e.ctrlKey||e.altKey)return!1;var t=e.target;return!(t instanceof HTMLInputElement&&t.value!==``&&(t.selectionStart!==0||t.selectionEnd!==0))}function uz(e,t){return e.selectedItems===t.selectedItems&&e.activeIndex===t.activeIndex}DL.stateReducer,DL.itemToKey,DL.environment,$.default.array,$.default.array,$.default.array,$.default.func,$.default.number,$.default.number,$.default.number,$.default.func,$.default.func,$.default.string,$.default.string;var dz={itemToKey:OL.itemToKey,stateReducer:OL.stateReducer,environment:OL.environment,keyNavigationNext:`ArrowRight`,keyNavigationPrevious:`ArrowLeft`},fz=tL,pz=0,mz=1,hz=2,gz=3,_z=4,vz=5,yz=6,bz=7,xz=8,Sz=9,Cz=10,wz=11,Tz=12,Ez=Object.freeze({__proto__:null,DropdownClick:bz,DropdownKeyDownBackspace:yz,DropdownKeyDownNavigationPrevious:vz,FunctionAddSelectedItem:xz,FunctionRemoveSelectedItem:Sz,FunctionReset:Tz,FunctionSetActiveIndex:wz,FunctionSetSelectedItems:Cz,SelectedItemClick:pz,SelectedItemKeyDownBackspace:hz,SelectedItemKeyDownDelete:mz,SelectedItemKeyDownNavigationNext:gz,SelectedItemKeyDownNavigationPrevious:_z});function Dz(e,t,n){var r=n.type,i=n.index,a=n.selectedItem,o=e.activeIndex,s=e.selectedItems,c;switch(r){case pz:c={activeIndex:i};break;case _z:c={activeIndex:o-1<0?0:o-1};break;case gz:c={activeIndex:o+1>=s.length?-1:o+1};break;case hz:case mz:if(o<0)break;var l=o;s.length===1?l=-1:o===s.length-1&&(l=s.length-2),c=NI({selectedItems:[].concat(s.slice(0,o),s.slice(o+1))},{activeIndex:l});break;case vz:c={activeIndex:s.length-1};break;case yz:c={selectedItems:s.slice(0,s.length-1)};break;case xz:c={selectedItems:[].concat(s,[a])};break;case bz:c={activeIndex:-1};break;case Sz:var u=o,d=s.findIndex(function(e){return t.itemToKey(e)===t.itemToKey(a)});if(d<0)break;s.length===1?u=-1:d===s.length-1&&(u=s.length-2),c={selectedItems:[].concat(s.slice(0,d),s.slice(d+1)),activeIndex:u};break;case Cz:c={selectedItems:n.selectedItems};break;case wz:c={activeIndex:n.activeIndex};break;case Tz:c={activeIndex:sz(t,`activeIndex`),selectedItems:sz(t,`selectedItems`)};break;default:throw Error(`Reducer called without proper action type.`)}return NI({},e,c)}var Oz=[`refKey`,`ref`,`onClick`,`onKeyDown`,`selectedItem`,`index`],kz=[`refKey`,`ref`,`onKeyDown`,`onClick`,`preventKeyAction`];Az.stateChangeTypes=Ez;function Az(e){e===void 0&&(e={}),fz(e,Az);var t=NI({},dz,e),n=t.getA11yStatusMessage,r=t.environment,i=t.keyNavigationNext,a=t.keyNavigationPrevious,o=vL(Dz,t,cz,uz),s=o[0],c=o[1],l=s.activeIndex,u=s.selectedItems,d=bL(),f=(0,K.useRef)(null),p=(0,K.useRef)();p.current=[];var m=qI({state:s,props:t});EL(n,s,[l,u],r),(0,K.useEffect)(function(){d||(l===-1&&f.current?f.current.focus():p.current[l]&&p.current[l].focus())},[l]),LL({props:t,state:s});var h=FL(`getDropdownProps`),g=(0,K.useMemo)(function(){var e;return e={},e[a]=function(){c({type:_z})},e[i]=function(){c({type:gz})},e.Delete=function(){c({type:mz})},e.Backspace=function(){c({type:hz})},e},[c,i,a]),_=(0,K.useMemo)(function(){var e;return e={},e[a]=function(e){lz(e)&&c({type:vz})},e.Backspace=function(e){lz(e)&&c({type:yz})},e},[c,a]);return{getSelectedItemProps:(0,K.useCallback)(function(e){var t,n=e===void 0?{}:e,r=n.refKey,i=r===void 0?`ref`:r,a=n.ref,o=n.onClick,s=n.onKeyDown,l=n.selectedItem,u=n.index,d=MI(n,Oz),f=m.current.state,h=yL(l,u,f.selectedItems,`Pass either item or index to getSelectedItemProps!`)[1],_=h>-1&&h===f.activeIndex;return NI((t={},t[i]=cL(a,function(e){e&&p.current.push(e)}),t.tabIndex=_?0:-1,t.onClick=sL(o,function(){c({type:pz,index:h})}),t.onKeyDown=sL(s,function(e){var t=uL(e);t&&g[t]&&g[t](e)}),t),d)},[c,m,g]),getDropdownProps:(0,K.useCallback)(function(e,t){var n,r=e===void 0?{}:e,i=r.refKey,a=i===void 0?`ref`:i,o=r.ref,s=r.onKeyDown,l=r.onClick,u=r.preventKeyAction,d=u===void 0?!1:u,p=MI(r,kz),m=(t===void 0?{}:t).suppressRefError;return h(`getDropdownProps`,m===void 0?!1:m,a,f),NI((n={},n[a]=cL(o,function(e){e&&(f.current=e)}),n),!d&&{onKeyDown:sL(s,function(e){var t=uL(e);t&&_[t]&&_[t](e)}),onClick:sL(l,function(){c({type:bz})})},p)},[c,_,h]),addSelectedItem:(0,K.useCallback)(function(e){c({type:xz,selectedItem:e})},[c]),removeSelectedItem:(0,K.useCallback)(function(e){c({type:Sz,selectedItem:e})},[c]),setSelectedItems:(0,K.useCallback)(function(e){c({type:Cz,selectedItems:e})},[c]),setActiveIndex:(0,K.useCallback)(function(e){c({type:wz,activeIndex:e})},[c]),reset:(0,K.useCallback)(function(){c({type:Tz})},[c]),selectedItems:u,activeIndex:l}}var jz=0,Mz=1,Nz=2,Pz=3,Fz=4,Iz=5,Lz=6,Rz=Object.freeze({__proto__:null,FunctionAddItem:Lz,TagClick:jz,TagGroupKeyDownArrowLeft:Mz,TagGroupKeyDownArrowRight:Nz,TagGroupKeyDownBackspace:Fz,TagGroupKeyDownDelete:Pz,TagRemoveClick:Iz});function zz(e,t,n){var r=n.type,i;switch(r){case jz:i={activeIndex:n.index};break;case Mz:i={activeIndex:e.activeIndex===0?e.items.length-1:e.activeIndex-1};break;case Nz:i={activeIndex:e.activeIndex===e.items.length-1?0:e.activeIndex+1};break;case Fz:case Pz:var a=[].concat(e.items.slice(0,e.activeIndex),e.items.slice(e.activeIndex+1)),o=a.length===0?-1:a.length===e.activeIndex?e.activeIndex-1:e.activeIndex;i={items:[].concat(e.items.slice(0,e.activeIndex),e.items.slice(e.activeIndex+1)),activeIndex:o};break;case Iz:var s=[].concat(e.items.slice(0,n.index),e.items.slice(n.index+1));i={items:s,activeIndex:s.length===0?-1:s.length===n.index?n.index-1:n.index};break;case Lz:var c=[];c=n.index===void 0?[].concat(e.items,[n.item]):[].concat(e.items.slice(0,n.index),[n.item],e.items.slice(n.index));var l=e.activeIndex===-1?c.length-1:e.activeIndex;i={items:c,activeIndex:l};break;default:throw Error(`Invalid useTagGroup reducer action.`)}return NI({},e,i)}var Bz=NI({},K).useId,Vz=typeof Bz==`function`?Hz:Uz;function Hz(e){var t=e.id,n=e.tagGroupId,r=e.getTagId,i=`downshift-`+Bz();return t||=i,K.useMemo(function(){return{tagGroupId:n??t+`-tag-group`,getTagId:r??function(e){return t+`-tag-`+e}}},[r,t,n])}function Uz(e){var t=e.id,n=e.getTagId,r=e.tagGroupId,i=K.useRef(t??`downshift-`+KI()).current;return K.useMemo(function(){return{tagGroupId:r??i+`-tag-group`,getTagId:n??function(e){return i+`-tag-`+e}}},[n,i,r])}function Wz(e){var t=e.items??e.initialItems??[];return{activeIndex:e.activeIndex??e.initialActiveIndex??(t.length===0?-1:0),items:t}}function Gz(e,t){return e.activeIndex===t.activeIndex&&e.items===t.items}var Kz=`tag-group-a11y-description`;function qz(e,t){K.useEffect(function(){if(e){var n=e.createElement(`div`);return n.setAttribute(`id`,Kz),n.style.display=`none`,n.textContent=t,e.body.appendChild(n),function(){n.remove()}}},[t,e])}function Jz(e){return NI({stateReducer:function(e,t){return t.changes},environment:typeof window>`u`?void 0:window,removeElementDescription:`Press Delete or Backspace to remove tag.`},e)}function Yz(e,t,n){var r=K.useRef({}),i=K.useRef(e),a=K.useRef(t);return K.useEffect(function(){if(e!==-1&&i.current!==-1&&e!==i.current||a.current===t+1){var o;(o=r.current[n(e)])==null||o.focus()}i.current=e,a.current=t},[e,n,t]),r}var Xz={isItemDisabled:$.default.func},Zz=[`onKeyDown`],Qz=[`index`,`refKey`,`ref`,`onClick`],$z=[`index`,`onClick`],eB=function(e){e===void 0&&(e={}),nL(e,eB,Xz);var t=Jz(e),n=vL(zz,t,Wz,Gz),r=n[0],i=n[1],a=r.activeIndex,o=r.items,s=qI({state:r,props:t}),c=Vz({getTagId:t.getTagId,id:t.id,tagGroupId:t.tagGroupId});qz(t.environment?.document,t.removeElementDescription);var l=Yz(a,o.length,c.getTagId),u=(0,K.useCallback)(function(e){var t=e??{},n=t.onKeyDown,r=MI(t,Zz);return NI({id:c.tagGroupId,"aria-live":`polite`,"aria-atomic":`false`,"aria-relevant":`additions`,role:`listbox`,onKeyDown:YI(n,function(e){switch(e.key){case`ArrowLeft`:i({type:Mz});break;case`ArrowRight`:i({type:Nz});break;case`Delete`:i({type:Pz});break;case`Backspace`:i({type:Fz});break}})},r)},[i,c.tagGroupId]),d=(0,K.useCallback)(function(e){var t,n=e.index,r=e.refKey,a=r===void 0?`ref`:r,o=e.ref,u=e.onClick,d=MI(e,Qz);if(!Number.isInteger(n)||n<0)throw Error(`Pass correct item index to getTagProps!`);var f=s.current.state,p=function(){i({type:jz,index:n})},m=c.getTagId(n);return NI((t={"aria-describedby":Kz},t[a]=JI(o,function(e){e&&(l.current[m]=e)}),t[`aria-labelledby`]=m,t.role=`option`,t.id=m,t.onClick=YI(u,p),t.tabIndex=f.activeIndex===n?0:-1,t),d)},[i,c,s,l]),f=(0,K.useCallback)(function(e){var t=e.index,n=e.onClick,r=MI(e,$z);if(!Number.isInteger(t)||t<0)throw Error(`Pass correct item index to getTagRemoveProps!`);var a=function(e){e.stopPropagation(),i({type:Iz,index:t})},o=c.getTagId(t),s=o+`-remove`;return NI({id:s,tabIndex:-1,"aria-labelledby":s+` `+o,onClick:YI(n,a)},r)},[c,i]);return{activeIndex:a,addItem:(0,K.useCallback)(function(e,t){i({type:Lz,item:e,index:t})},[i]),getTagGroupProps:u,getTagProps:d,getTagRemoveProps:f,items:o}};eB.stateChangeTypes=Rz;function tB({items:e,selectedItems:t,onInputChange:n,onSelectedItemsChange:r,fieldLabel:i,placeholder:a,icon:o,disabled:s,shadowRoot:c,dataTestId:l}){let[u,d]=(0,K.useState)(``),f=(0,K.useRef)(null),p=(0,K.useId)(),m=(0,K.useId)(),h=(0,K.useId)(),g=(0,K.useId)(),_=(0,K.useId)(),v=(0,K.useMemo)(()=>e.filter(e=>e.type===`airport`||e.type===`place`).reduce((e,t)=>{if(t.type===`airport`){let n=t,r=u.toLowerCase();if(n.iata_code.toLowerCase()===r||n.iata_display_list?.some(e=>e.toLowerCase()===r))return t.sectionIndex>=0?[...e,t]:[{...t,sectionIndex:-1},...e]}return[...e,t]},[]).reduce((e,t)=>t.type===`airport`?{items:[...e.items,t],airportCount:e.airportCount+1}:t.type===`place`?e.airportCount<20?{...e,items:[...e.items,t]}:e:e.airportCount<=20?{...e,items:[...e.items,t]}:e,{items:[],airportCount:0}).items,[u,e]);function y(e){return e.kayak?.stateCode&&e.kayak?.countryCode?`${e.name}, ${e.kayak.stateCode}, ${e.kayak.countryCode}`:e.kayak?.countryCode&&!e.kayak?.stateCode?`${e.name}, ${e.kayak.countryCode}`:e.formatted_address}function b(e){return e.state_code?`${e.city}, ${e.state_code}, ${e.country_code}`:e.location_display?e.location_display:`${e.city}, ${e.country_code}`}function x(e){return e.iata_display_list&&e.iata_display_list.length>0?e.iata_display_list.join(`, `):e.iata_code}function S(e){if(e.type===`airport`){let n=e;return t?.length>1?x(n):n.country_code===`US`?`${n.city} (${x(n)})`:`${n.city}, ${n.country_code} (${x(n)})`}if(e.type===`place`){let t=e;return t.formatted_address?.length<20?t.formatted_address:t.name}return``}let C=typeof Proxy==`function`&&!Object.isSealed(new Proxy({},{}));function w(e){let t=e.ownerDocument,n={document:t,addEventListener:t.addEventListener.bind(e),removeEventListener:t.removeEventListener.bind(e),Node:window.Node,Element:window.Element,HTMLElement:window.HTMLElement,SVGElement:window.SVGElement};return C?new Proxy(n,{get(e,t){return e[t]}}):n}let{getSelectedItemProps:T,getDropdownProps:E,removeSelectedItem:D}=Az({selectedItems:t,onStateChange({selectedItems:e,type:t}){t===Az.stateChangeTypes.FunctionRemoveSelectedItem&&r(e)}}),{isOpen:O,getMenuProps:k,getInputProps:A,getItemProps:j,highlightedIndex:M,setHighlightedIndex:N}=iz({environment:c?w(c):void 0,items:v,isItemDisabled(e){return!!e?.disabled},itemToKey(e){return e?.key??``},itemToString(e){return e?e.type===`airport`?S(e):e.name??``:``},defaultHighlightedIndex:0,selectedItem:null,inputValue:u,stateReducer(e,t){let{changes:n,type:r}=t;switch(r){case iz.stateChangeTypes.InputKeyDownEnter:case iz.stateChangeTypes.ItemClick:return n;case iz.stateChangeTypes.InputKeyDownArrowDown:case iz.stateChangeTypes.InputKeyDownArrowUp:return n;case iz.stateChangeTypes.InputBlur:return n;case iz.stateChangeTypes.FunctionCloseMenu:return{...n,isOpen:!0};case iz.stateChangeTypes.InputKeyDownEscape:return n;case iz.stateChangeTypes.ItemMouseMove:return e;default:return n}},onStateChange({inputValue:e,type:t,selectedItem:n}){switch(t){case iz.stateChangeTypes.InputKeyDownEnter:case iz.stateChangeTypes.ItemClick:n&&(r([n]),d(``));break;case iz.stateChangeTypes.MenuMouseLeave:case iz.stateChangeTypes.ItemMouseMove:break;case iz.stateChangeTypes.InputKeyDownArrowDown:case iz.stateChangeTypes.InputKeyDownArrowUp:break;case iz.stateChangeTypes.InputBlur:break;case iz.stateChangeTypes.ControlledPropUpdatedSelectedItem:break;default:break}}}),P=(0,K.useMemo)(()=>{if(s)return`Field is locked.`;if(O&&v.length>0){let e=v.length;return`Suggestion list open, ${e} ${e===1?`option`:`options`}.`}return O&&v.length===0?u.trim()?`Suggestion list open, no matching options.`:`Suggestion list open, no options yet.`:`Suggestion list closed.`},[s,O,v.length,u]),ee=(0,K.useMemo)(()=>`Type to search airports and places. When the list is open, use arrow keys to move through suggestions and Enter to choose. Tab to selected locations above to remove them, or press Backspace in this field when it is empty.`,[]),F=i?`${i}, search airports and places`:`Search airports and places`,te=i?`${i} suggestions`:`Search results`,ne=t.length===0?`No airport or place selected.`:(()=>{let e=t.map(e=>S(e));return`Selected ${t.length===1?`location`:`${t.length} locations`}: ${e.join(`, `)}.`})(),re=[h,g,_].join(` `);(0,K.useEffect)(()=>{s&&queueMicrotask(()=>d(``))},[s]);let ie=!!s;function ae(){let e=A({...E(),id:m,role:`combobox`,"aria-autocomplete":`list`,"aria-expanded":O,"aria-controls":O?p:void 0,"aria-activedescendant":O&&M!=null&&M>-1?`${p}-${M}`:void 0,"aria-label":F,onChange:e=>{let t=e.currentTarget.value;d(t),n(t)},onKeyDown:e=>{if(e.key===`Backspace`&&!u&&t.length>0&&!s){let e=t[t.length-1];D(e)}}});return(0,q.jsx)(`input`,{className:(0,J.default)(`aone:outline-none aone:disabled:bg-transparent aone:text-base aone:placeholder:text-gray-500`,{"aone:min-w-[120px] aone:max-w-[200px]":t.length>0,"aone:w-full":t.length===0}),placeholder:!ie&&t.length===0?a:``,...e,"aria-describedby":re,disabled:ie})}return(0,q.jsxs)(`div`,{className:`aone:w-full aone:h-full aone:relative aone:z-10`,"data-testid":l,role:`group`,"aria-disabled":s?!0:void 0,children:[(0,q.jsxs)(`div`,{className:(0,J.default)({"aone:bg-white aone:rounded-lg aone:gap-2 aone:items-center aone:py-2 aone:px-3 aone:h-[44px] aone:box-border aone:w-full aone:overflow-hidden":!0,"aone:grid":!0,"aone:grid-cols-[24px_1fr]":t.length===0,"aone:grid-cols-[24px_auto_1fr]":t.length===1,"aone:grid-cols-[24px_auto_auto_1fr]":t.length===2,"aone:grid-cols-[24px_auto_auto_auto_1fr]":t.length===3,"aone:border-2 aone:border-gray-200 aone:focus-within:border-primary":!0,"aone:opacity-60 aone:cursor-not-allowed":!!s}),children:[o,t.map((e,n)=>(0,q.jsxs)(`span`,{...T({selectedItem:e,index:n}),"aria-label":`Selected location: ${S(e)}. Item ${n+1} of ${t.length}.`,className:(0,J.default)({"aone:bg-gray-200 aone:rounded aone:px-1 aone:focus:bg-gray-400 aone:whitespace-nowrap aone:text-ellipsis aone:shrink-0":!0,"aone:text-sm":t.length>0,"aone:flex aone:items-center":!0}),children:[(0,q.jsx)(`span`,{className:`aone:overflow-hidden aone:grow aone:font-medium`,children:S(e)}),!e.disabled&&(0,q.jsx)(`button`,{type:`button`,disabled:!!s||!!e.disabled,className:(0,J.default)(`aone:ml-2 aone:text-base aone:leading-[20px] aone:rounded aone:px-1 aone:transition-colors`,{"aone:hover:bg-gray-300 aone:focus-visible:outline-none aone:focus-visible:ring-2 aone:focus-visible:ring-offset-2 aone:focus-visible:ring-gray-400":!s&&!e.disabled,"aone:cursor-not-allowed aone:opacity-60":!!s}),"data-testid":`autocomplete-remove-item-button`,"aria-label":`Remove ${S(e)}`,onClick:t=>{t.stopPropagation(),!s&&D(e)},children:`×`})]},n)),(0,q.jsx)(`span`,{id:h,className:`aone:sr-only`,children:ne}),(0,q.jsx)(`span`,{id:g,className:`aone:sr-only`,children:P}),(0,q.jsx)(`span`,{id:_,className:`aone:sr-only`,children:ee}),ae()]}),O&&v.length>0&&(0,q.jsx)(`div`,{className:`aone:absolute aone:w-inherit aone:bg-white aone:mt-2 aone:rounded-lg aone:overflow-hidden aone:shadow-md aone:p-0 aone:z-10`,children:(0,q.jsx)(`ul`,{ref:f,...k(),id:p,role:`listbox`,"aria-multiselectable":`true`,"aria-label":te,tabIndex:-1,className:`aone:overflow-y-auto aone:overflow-x-hidden aone:focus:outline-none aone:focus:ring-2 aone:focus:ring-blue-500 aone:focus:ring-offset-2`,children:v.map((e,n)=>{if(e.type===`airport`){let r=e,i=(r.distance||0)*.621371,a=M===n,o=e.sectionIndex>-1&&!r.kayak_shimmed,s=!!t.find(t=>t.key===e.key),c=n+1;return(0,q.jsxs)(`li`,{...j({item:e,index:n,onMouseEnter:()=>N(n)}),id:`${p}-${n}`,role:`option`,tabIndex:-1,"aria-selected":s,"aria-label":`Option ${c} - ${r.name}, ${b(r)}, ${x(r)}${o?`, ${i.toFixed(+(i<1))} miles away`:``}, ${s?`selected`:`not selected`}`,className:(0,J.default)({"aone:hover:bg-blue-100":!0,"aone:bg-blue-100":a,"aone:font-bold":a,"aone:shadow-sm aone:py-2 aone:px-2 aone:cursor-pointer":!0,"aone:pl-5 aone:border-l-4 aone:border-gray-500":e.sectionIndex>-1,"aone:grid aone:grid-cols-[26px_1fr_30px] aone:gap-1 aone:justify-start aone:items-center":!0,"aone:focus:outline-none aone:focus:ring-2 aone:focus:ring-blue-500 aone:focus:ring-offset-2":!0}),children:[(0,q.jsx)(yI,{className:`aone:w-6 aone:h-6 aone:-rotate-45`,icon:wA}),(0,q.jsxs)(`div`,{className:`aone:flex aone:flex-col aone:grow aone:gap-1 aone:overflow-hidden`,children:[(0,q.jsxs)(`div`,{className:`aone:gap-2 aone:flex aone:items-center aone:w-full`,children:[(0,q.jsx)(`span`,{className:`aone:flex-1 aone:min-w-0 aone:font-medium aone:text-base aone:whitespace-nowrap aone:overflow-hidden aone:text-ellipsis`,children:r.name}),(0,q.jsx)(`span`,{className:`aone:text-sm aone:uppercase aone:shrink-0 aone:text-gray-500`,children:x(r)})]}),(0,q.jsxs)(`span`,{className:`aone:text-sm aone:text-gray-500`,children:[b(r),o&&(0,q.jsxs)(q.Fragment,{children:[`\xA0•\xA0`,i.toFixed(+(i<1)),`mi`]})]})]}),(0,q.jsx)(`div`,{className:`aone:flex aone:justify-end aone:pl-1`,"aria-hidden":`true`,children:(0,q.jsx)(`span`,{className:(0,J.default)(`aone:h-4 aone:w-4 aone:shrink-0 aone:rounded-sm aone:border`,{"aone:border-gray-400 aone:bg-white":!s,"aone:border-primary aone:bg-primary":s})})})]},`${e.key}-${n}`)}if(e.type===`place`){let r=e,i=M===n,a=Kg(r.kayak?.apicode),o=y(r),s=!!t.find(t=>t.key===e.key);return(0,q.jsxs)(`li`,{...j({item:e,index:n,onMouseEnter:()=>N(n)}),id:`${p}-${n}`,role:`option`,tabIndex:-1,"aria-selected":s,"aria-label":`${a?`${r.name}, ${a}, ${o}`:`${r.name}, ${o}`}, ${s?`selected`:`not selected`}`,className:(0,J.default)({"aone:hover:bg-blue-100":!0,"aone:bg-blue-100":i,"aone:font-bold":i,"aone:shadow-sm aone:py-2 aone:px-2 aone:cursor-pointer":!0,"aone:grid aone:grid-cols-[26px_1fr_30px] aone:gap-1 aone:justify-start aone:items-center":!0,"aone:focus:outline-none aone:focus:ring-2 aone:focus:ring-blue-500 aone:focus:ring-offset-2":!0}),children:[(0,q.jsx)(yI,{className:`aone:w-6 aone:h-6`,icon:DA}),(0,q.jsxs)(`div`,{className:`aone:flex aone:flex-col aone:grow aone:gap-1 aone:overflow-hidden`,children:[(0,q.jsxs)(`div`,{className:`aone:gap-2 aone:flex aone:items-end aone:w-full`,children:[(0,q.jsx)(`span`,{className:`aone:flex-1 aone:min-w-0 aone:font-medium aone:text-base aone:whitespace-nowrap aone:overflow-hidden aone:text-ellipsis`,children:r.name}),a&&(0,q.jsx)(`span`,{className:`aone:text-sm aone:uppercase aone:shrink-0 aone:text-gray-500`,children:a})]}),(0,q.jsx)(`span`,{className:`aone:text-sm aone:shrink-0 aone:text-gray-500`,children:o})]}),(0,q.jsx)(`div`,{className:`aone:flex aone:justify-end aone:pl-1`,"aria-hidden":`true`,children:(0,q.jsx)(`span`,{className:(0,J.default)(`aone:h-4 aone:w-4 aone:shrink-0 aone:rounded-sm aone:border`,{"aone:border-gray-400 aone:bg-white":!s,"aone:border-primary aone:bg-primary":s})})})]},`${e.key}-${n}`)}})})})]})}function nB({hideByDefault:e=!0}){return(0,q.jsx)(`div`,{className:(0,J.default)({"aone:pb-0.5 aone:flex-col aone:items-center aone:@2xl:items-end aone:@2xl:w-[175px]":!0,"aone:hidden aone:@2xl:flex":e,flex:!e}),children:(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`p`,{className:`aone:text-center aone:text-[12px] aone:text-black aone:dark:text-white`,children:`Powered by`}),(0,q.jsx)(`div`,{className:`aone:flex aone:justify-center aone:max-w-[95px]`,children:(0,q.jsx)(`img`,{src:`https://content.r9cdn.net/res/images/horizon/common/promo/powered-kayak-logo.png?v=5845dc09c6b1c19380844fe6157a3b640856624b&cluster=4`,alt:`Kayak`,width:95,height:21})})]})})}var rB=s(((e,t)=>{function n(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}t.exports=n})),iB=s(((e,t)=>{t.exports=typeof global==`object`&&global&&global.Object===Object&&global})),aB=s(((e,t)=>{var n=iB(),r=typeof self==`object`&&self&&self.Object===Object&&self;t.exports=n||r||Function(`return this`)()})),oB=s(((e,t)=>{var n=aB();t.exports=function(){return n.Date.now()}})),sB=s(((e,t)=>{var n=/\s/;function r(e){for(var t=e.length;t--&&n.test(e.charAt(t)););return t}t.exports=r})),cB=s(((e,t)=>{var n=sB(),r=/^\s+/;function i(e){return e&&e.slice(0,n(e)+1).replace(r,``)}t.exports=i})),lB=s(((e,t)=>{t.exports=aB().Symbol})),uB=s(((e,t)=>{var n=lB(),r=Object.prototype,i=r.hasOwnProperty,a=r.toString,o=n?n.toStringTag:void 0;function s(e){var t=i.call(e,o),n=e[o];try{e[o]=void 0;var r=!0}catch{}var s=a.call(e);return r&&(t?e[o]=n:delete e[o]),s}t.exports=s})),dB=s(((e,t)=>{var n=Object.prototype.toString;function r(e){return n.call(e)}t.exports=r})),fB=s(((e,t)=>{var n=lB(),r=uB(),i=dB(),a=`[object Null]`,o=`[object Undefined]`,s=n?n.toStringTag:void 0;function c(e){return e==null?e===void 0?o:a:s&&s in Object(e)?r(e):i(e)}t.exports=c})),pB=s(((e,t)=>{function n(e){return typeof e==`object`&&!!e}t.exports=n})),mB=s(((e,t)=>{var n=fB(),r=pB(),i=`[object Symbol]`;function a(e){return typeof e==`symbol`||r(e)&&n(e)==i}t.exports=a})),hB=s(((e,t)=>{var n=cB(),r=rB(),i=mB(),a=NaN,o=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,c=/^0o[0-7]+$/i,l=parseInt;function u(e){if(typeof e==`number`)return e;if(i(e))return a;if(r(e)){var t=typeof e.valueOf==`function`?e.valueOf():e;e=r(t)?t+``:t}if(typeof e!=`string`)return e===0?e:+e;e=n(e);var u=s.test(e);return u||c.test(e)?l(e.slice(2),u?2:8):o.test(e)?a:+e}t.exports=u})),gB=u(s(((e,t)=>{var n=rB(),r=oB(),i=hB(),a=`Expected a function`,o=Math.max,s=Math.min;function c(e,t,c){var l,u,d,f,p,m,h=0,g=!1,_=!1,v=!0;if(typeof e!=`function`)throw TypeError(a);t=i(t)||0,n(c)&&(g=!!c.leading,_=`maxWait`in c,d=_?o(i(c.maxWait)||0,t):d,v=`trailing`in c?!!c.trailing:v);function y(t){var n=l,r=u;return l=u=void 0,h=t,f=e.apply(r,n),f}function b(e){return h=e,p=setTimeout(C,t),g?y(e):f}function x(e){var n=e-m,r=e-h,i=t-n;return _?s(i,d-r):i}function S(e){var n=e-m,r=e-h;return m===void 0||n>=t||n<0||_&&r>=d}function C(){var e=r();if(S(e))return w(e);p=setTimeout(C,x(e))}function w(e){return p=void 0,v&&l?y(e):(l=u=void 0,f)}function T(){p!==void 0&&clearTimeout(p),h=0,l=m=u=p=void 0}function E(){return p===void 0?f:w(r())}function D(){var e=r(),n=S(e);if(l=arguments,u=this,m=e,n){if(p===void 0)return b(m);if(_)return clearTimeout(p),p=setTimeout(C,t),y(m)}return p===void 0&&(p=setTimeout(C,t)),f}return D.cancel=T,D.flush=E,D}t.exports=c}))(),1);async function _B({departureAirport:e,apiDomain:t,sessionId:n,clickId:r}){let i=new URLSearchParams({departureAirportIATA:e}).toString(),a={};n&&(a[jb]=n),r&&(a[Mb]=r);let o=await fetch(`${t}/api/iata-auto-complete?${i}`,{headers:a});if(!o.ok)throw console.error(`Unable to fetch airport suggestions`,{departureAirport:e,apiDomain:t,status:o.status,statusText:o.statusText}),Error(`Unable to fetch airport suggestions`);let s=await o.json();return Ag.parse(s)}async function vB(e,t,n,r,i){if(!t)return[];let a=await _B({query:e,departureAirport:t,apiDomain:n,sessionId:r,clickId:i});return a.success?a.data.map(e=>({itemType:G.AIRPORT,iata_code:e.airportIATA,city:e.city,state:e.state,country:e.country,stops:e.stops||0,airlineCodes:e.airlineCodes||[],name:e.city+` (`+e.airportIATA+`)`,type:`airport`,lat:0,lng:0,country_code:e.country||``,geometry:{location:{lat:0,lng:0}},formatted_address:``,cid:e.airportIATA,types:[`airport`],nearbyAirports:[{name:e.airportIATA+` (`+e.city+`)`,iata_code:e.airportIATA,city:e.city,country_code:e.country,stops:e.stops||0,airlineCodes:e.airlineCodes||[],routeStart:e.routeStart,lat:0,lng:0}]})).map(e=>{let t={...e,airlineCodes:e.airlineCodes?.map(e=>e===`DWI`?`DW`:e)};return t.nearbyAirports=e.nearbyAirports.map(e=>({...e,airlineCodes:e.airlineCodes?.map(e=>e===`DWI`?`DW`:e)})),t}).sort((e,t)=>!e.city||!t.city?0:e.city.localeCompare(t.city)):[]}async function yB({query:e,departureAirport:t,marketingCarrierCodeIATA:n,apiDomain:r,sessionId:i,clickId:a}){let o=new URLSearchParams({query:e,departureAirportIATA:t,marketingCarrierCodeIATA:n}).toString(),s={};i&&(s[jb]=i),a&&(s[Mb]=a);let c=await fetch(`${r}/api/iata-directs?${o}`,{headers:s});if(!c.ok)throw console.error(`Unable to fetch airport suggestions`,{departureAirport:t,apiDomain:r,status:c.status,statusText:c.statusText}),Error(`Unable to fetch airport suggestions`);let l=await c.json();return Gp.parse(l)}async function bB(e,t,n,r,i,a){if(!t)return[];let o=await yB({query:e,departureAirport:t,marketingCarrierCodeIATA:n,apiDomain:r,sessionId:i,clickId:a});return o.success?o.data.map(e=>({itemType:G.AIRPORT,iata_code:e.airportIATA,city:e.city,lat:0,lng:0,country_code:e.country,name:e.airportIATA+` (`+e.city+`)`,geometry:{location:{lat:0,lng:0}},formatted_address:``,cid:e.airportIATA,types:[`airport`],nearbyAirports:[{name:e.airportIATA+` (`+e.city+`)`,iata_code:e.airportIATA,city:e.city,country_code:e.country,lat:0,lng:0}]})):[]}function xB(e){return Math.PI/180*e}function SB(e){return e*.621371}function CB(e,t,n,r){let i=xB(n-e),a=xB(r-t),o=Math.sin(i/2)*Math.sin(i/2)+Math.cos(xB(e))*Math.cos(xB(n))*Math.sin(a/2)*Math.sin(a/2);return 6371*(2*Math.atan2(Math.sqrt(o),Math.sqrt(1-o)))}function wB(e,t){if(!Array.isArray(e.types)||!e.types.includes(`place`)||e.itemType!==G.METRO)return!1;let n=Gg(e.kayak?.apicode);if(n.length>0&&n.includes(t.id.toUpperCase()))return!0;let r=e.kayak?.ctid;if(r!==void 0&&r===t.ctid)return!0;let i=e.kayak?.metroId?.toUpperCase(),a=t.cityCode?.toUpperCase();return!!(t.sub===!0&&i&&a===i)}function TB(e){let t=new Set;for(let n=0;n<e.length;n++){let r=e[n];if(!r||!Array.isArray(r.types)||!r.types.includes(`airport`))continue;let i=r.kayakAirport;if(!i)continue;let a=e.findIndex(e=>wB(e,i));if(a<0)continue;let o=e[a],s=r.nearbyAirports[0];if(s){if(!o.nearbyAirports.some(e=>e.iata_code.toUpperCase()===s.iata_code.toUpperCase())){let{lat:e,lng:t}=o.geometry.location;s.distance=SB(CB(e,t,s.lat,s.lng)),o.nearbyAirports.push(s)}t.add(n)}}return e.filter((e,n)=>!t.has(n))}function EB(e){if(!Array.isArray(e.types)||!e.types.includes(`place`))return;let t=e.kayak?.apicode;if(!t?.trim())return;let n=Gg(t);if(n.length===0)return;let r=n.length>1,{lat:i,lng:a}=e.geometry.location,o=e.name,s=e.kayak?.stateCode,c=e.kayak?.countryCode;if(!c)return;let l=e.kayak?.metroId??``,u=t=>e.nearbyAirports.find(e=>e.iata_code.toUpperCase()===t.toUpperCase()),d=[],f=new Set,p=l.toUpperCase();for(let t of n){let n=t.toUpperCase(),l=u(t);if(n===p){l?(d.push(l),f.add(t)):r&&(d.push({iata_code:t,city:o,lat:i,lng:a,country_code:c,name:`${o} (${t})`,state_code:s,location_display:s?void 0:e.formatted_address,kayak_shimmed:!0}),f.add(t));continue}l?(d.push(l),f.add(t)):r&&(d.push({iata_code:t,city:o,lat:i,lng:a,country_code:c,name:`${o} (${t})`,state_code:s,location_display:s?void 0:e.formatted_address,kayak_shimmed:!0}),f.add(t))}for(let t of e.nearbyAirports){let e=t.iata_code.toUpperCase();f.has(e)||d.push(t)}let m=d.filter(e=>e.kayak_shimmed),h=d.filter(e=>!e.kayak_shimmed);h.sort((e,t)=>{let n=e.distance??1/0,r=t.distance??1/0;return n===r?e.iata_code.localeCompare(t.iata_code):n-r}),e.nearbyAirports=[...m,...h]}async function DB({query:e,searchType:t}){let n=await fetch(`https://www.kayak.com/mv/marvel?f=j&s=${t}&v=v1&where=${e}&lc=en&lc_cc=US`);if(!n.ok)throw Error(`Unable to get kayak suggestions`);return await n.json()}async function OB(e,t=qg.Hotels){if(!e?.length||e.length<3)return[];let n=TB((await DB({query:e,searchType:t})).reduce((e,t)=>{if(t.isMetroOnly){let n=t.rc?.trim();e.push({nearbyAirports:[],itemType:G.METRO,iata_code:t.displayType.type===`country`?void 0:t.id,formatted_address:t.cityname,geometry:{location:{lat:t.lat,lng:t.lng}},name:t.cityonly,cid:t.cid,kayak:{ctid:t.ctid,apicode:t.apicode,stateCode:n||void 0,countryCode:t.cc,metroId:t.id,metroAirportName:t.airportname},types:[`place`]})}else if(t.displayType.type===`country`)e.push({nearbyAirports:[],itemType:G.AIRPORT,formatted_address:t.displayname,geometry:{location:{lat:t.lat,lng:t.lng}},name:t.displayname,cid:t.cid,types:[`place`]});else if(t.displayType.type===`state`)e.push({nearbyAirports:[],itemType:G.AIRPORT,formatted_address:t.displayname,geometry:{location:{lat:t.lat,lng:t.lng}},name:t.displayname,cid:t.cid,types:[`place`]});else if(t.displayType.type===`airport`){let n=e.findIndex(e=>wB(e,t)),r=t.rc?.trim(),i={iata_code:t.id,city:t.cityonly,lat:t.lat,lng:t.lng,country_code:t.cc,name:t.displayname,state_code:r||void 0,location_display:r?void 0:t.cityname};if(n>-1){let{lat:r,lng:a}=e[n].geometry.location;i.distance=SB(CB(r,a,t.lat,t.lng)),e[n].nearbyAirports.push(i)}else e.push({nearbyAirports:[i],itemType:G.AIRPORT,formatted_address:t.cityname,geometry:{location:{lat:t.lat,lng:t.lng}},name:t.name,rid:t.rid,kayakAirport:{id:t.id,ctid:t.ctid,sub:t.sub,cityCode:t.cityCode},types:[`airport`]})}return e},[]));for(let e of n)EB(e);return n}function kB({key:e,apiDomain:t,airportIATA:n,providersArr:r,airlinesArr:i,debounceTime:a=500,autocompleteType:o=`kayak`}){let{sessionId:s}=Eb(),{clickId:c}=Pv(),[l,u]=(0,K.useState)(``),d=(0,K.useMemo)(()=>(0,gB.default)(u,a),[a]),{data:f,status:p}=yb({queryKey:[e,n,r,i,l,o,s].flat(),queryFn:()=>o===Xg.schedule_data&&n?.length&&n?.length===3?vB(l,n,t,s,c):n?.length&&n?.length===3&&(r?.length||0)>0&&(i?.length||0)>0&&r?.every(e=>e===`G4`)&&i?.every(e=>e===`G4`)?bB(l,n,i[0],t,s,c):OB(l),enabled:!!s});return{data:f,status:p,setQuery:d}}function AB(){return(0,q.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:2,stroke:`currentColor`,"aria-hidden":`true`,className:`aone:w-6 aone:h-6`,children:(0,q.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z`})})}function jB({value:e,onChange:t}){return(0,q.jsxs)(`div`,{className:`aone:flex aone:flex-col aone:gap-2`,children:[(0,q.jsx)(`label`,{className:`aone:text-sm aone:font-medium aone:text-gray-700 aone:dark:text-gray-300`,children:`Pick-up / Drop-off location`}),(0,q.jsxs)(`div`,{className:`aone:flex aone:items-center aone:gap-3`,children:[(0,q.jsx)(`span`,{className:`aone:text-sm aone:font-medium aone:text-gray-700 aone:dark:text-gray-300`,children:`Same`}),(0,q.jsx)(`button`,{type:`button`,onClick:()=>t(e===`same-location`?`different-location`:`same-location`),className:`aone:relative aone:inline-flex aone:h-6 aone:w-11 aone:shrink-0 aone:cursor-pointer aone:items-center aone:rounded-full aone:border-2 aone:border-transparent aone:transition-colors aone:focus-visible:outline-none aone:focus-visible:ring-2 aone:focus-visible:ring-blue-500 aone:focus-visible:ring-offset-2 ${e===`different-location`?`aone:bg-blue-600 aone:dark:bg-blue-500`:`aone:bg-gray-200 aone:dark:bg-gray-600`}`,"aria-label":`Toggle to ${e===`same-location`?`different location`:`same location`}`,children:(0,q.jsx)(`span`,{className:`aone:pointer-events-none aone:block aone:h-5 aone:w-5 aone:rounded-full aone:bg-white aone:shadow-lg aone:ring-0 aone:transition-transform ${e===`different-location`?`aone:translate-x-5`:`aone:translate-x-0`}`})}),(0,q.jsx)(`span`,{className:`aone:text-sm aone:font-medium aone:text-gray-700 aone:dark:text-gray-300`,children:`Different`})]})]})}function MB({shadowRoot:e,origin:t,theme:n}){let{apiDomain:r}=kb(),[i,a]=(0,K.useState)(`same-location`),[o,s]=(0,K.useState)(t.toUpperCase()),[c,l]=(0,K.useState)(t.toUpperCase()),[u,d]=(0,K.useState)(``),[f,p]=(0,K.useState)(`12:00`),[m,h]=(0,K.useState)(``),[g,_]=(0,K.useState)(`12:00`),v=(0,K.useMemo)(()=>u&&f?`${u}T${f}`:``,[u,f]),y=(0,K.useMemo)(()=>m&&g?`${m}T${g}`:``,[m,g]),b=i===`same-location`?o:c,{data:x,status:S,setQuery:C}=kB({key:`carfare-from-suggest`,apiDomain:r,airportIATA:b}),{data:w,status:T,setQuery:E}=kB({key:`carfare-to-suggest`,apiDomain:r,airportIATA:o}),[D,O]=(0,K.useState)([]),[k,A]=(0,K.useState)([]),[j,M]=(0,K.useState)(!1);(0,K.useEffect)(()=>{t&&t.length===3&&!j&&C(t)},[t,C,j]),(0,K.useEffect)(()=>{if(x&&x.length>0&&!D.length&&!j){let e=x.filter(e=>e.nearbyAirports?.length).flatMap(e=>e.nearbyAirports).find(e=>e.iata_code?.toUpperCase()===t.toUpperCase());if(e){let t={...e,sectionIndex:0,type:`airport`,key:e.iata_code},n=e.iata_code??``;queueMicrotask(()=>{O([t]),s(n),M(!0)})}}},[x,t,D.length,j]);let N=(0,K.useMemo)(()=>x?x.filter(e=>e.nearbyAirports?.length).map(e=>{let t=e.types.includes(`airport`);return[{...e,sectionIndex:0,type:t?`airport-place`:`place`,key:e.formatted_address},...e.nearbyAirports.map((e,n)=>({...e,sectionIndex:t?-1:n,type:`airport`,key:`${e.iata_code}`}))]}).flat().filter((e,t,n)=>{if(e.type===`place`){let e=n.at(t+1);if(!e||e.type!==`airport`)return!1}return!0}):[],[x]),P=(0,K.useMemo)(()=>w?w.filter(e=>e.nearbyAirports?.length).map(e=>{let t=e.types.includes(`airport`);return[{...e,sectionIndex:0,type:t?`airport-place`:`place`,key:e.formatted_address},...e.nearbyAirports.map((e,n)=>({...e,sectionIndex:t?-1:n,type:`airport`,key:`${e.iata_code}`}))]}).flat().filter((e,t,n)=>{if(e.type===`place`){let e=n.at(t+1);if(!e||e.type!==`airport`)return!1}return!0}):[],[w]),ee=(0,K.useCallback)(()=>{let e=/^[A-Za-z]{3}$/,t=e.test(o),n=e.test(b);if(!t||!n||!v||!y)return;let r=new URLSearchParams({fromAirport:o.toUpperCase(),toAirport:b.toUpperCase(),tripOption:i,fromDateTime:v,toDateTime:y}),a=`https://flymyairport.com/from/${o.toUpperCase()}/cars?${r.toString()}`,s=document.createElement(`a`);s.href=a,s.target=`_blank`,s.rel=`noopener noreferrer`,s.click(),s.remove()},[o,b,i,v,y]),F=(0,K.useMemo)(()=>{let e=/^[A-Za-z]{3}$/;if(!e.test(o)||!e.test(b)||!v||!y)return!1;try{let e=new Date(v),t=new Date(y),n=new Date;return n.setHours(0,0,0,0),e.getTime()<=t.getTime()&&e.getTime()>=n.getTime()}catch{return!1}},[o,b,v,y]);return(0,q.jsxs)(`div`,{className:`aone:flex aone:flex-col aone:gap-3`,part:`carfare-search-container`,"data-mode":n,children:[(0,q.jsxs)(`div`,{className:`aone:flex aone:items-center aone:justify-between aone:gap-2`,children:[(0,q.jsx)(jB,{value:i,onChange:a}),(0,q.jsx)(`div`,{className:`aone:ml-2`,children:(0,q.jsx)(nB,{hideByDefault:!1})})]}),(0,q.jsxs)(`div`,{className:`aone:flex aone:flex-col aone:md:flex-row aone:md:flex-wrap aone:gap-2 aone:md:gap-4 aone:md:items-end`,children:[(0,q.jsxs)(`div`,{className:`aone:w-full aone:md:w-auto aone:md:flex-1 aone:md:min-w-[200px] aone:h-[72px]`,children:[(0,q.jsx)(`label`,{className:`aone:block aone:text-sm aone:font-medium aone:text-gray-700 aone:dark:text-gray-300`,children:`Pick-up Location`}),(0,q.jsx)(`div`,{className:`aone:mt-1 aone:md:mt-2`,children:(0,q.jsx)(tB,{shadowRoot:e,dataTestId:`carfare-from-airport`,icon:S===`pending`?(0,q.jsx)(qv,{}):(0,q.jsx)(AB,{}),placeholder:`From?`,items:N,selectedItems:D,onInputChange:C,onSelectedItemsChange:e=>{if(!e||e.length===0){O([]),s(``);return}let t=e[0];t.type===`airport`&&(O(e),s(t.iata_code??``))}})})]}),i===`different-location`&&(0,q.jsxs)(`div`,{className:`aone:w-full aone:md:w-auto aone:md:flex-1 aone:md:min-w-[200px]`,children:[(0,q.jsx)(`label`,{className:`aone:block aone:text-sm aone:font-medium aone:text-gray-700 aone:dark:text-gray-300`,children:`Drop-off Location`}),(0,q.jsx)(`div`,{className:`aone:mt-1 aone:md:mt-2`,children:(0,q.jsx)(tB,{shadowRoot:e,dataTestId:`carfare-to-airport`,icon:T===`pending`?(0,q.jsx)(qv,{}):(0,q.jsx)(AB,{}),placeholder:`To?`,items:P,selectedItems:k,onInputChange:E,onSelectedItemsChange:e=>{if(!e||e.length===0){A([]),l(``);return}let t=e[0];t.type===`airport`&&(A(e),l(t.iata_code??``))}})})]}),(0,q.jsx)(jI,{label:`Pick-up Date`,dateValue:u,timeValue:f,onDateChange:e=>{let t=e?e.toISOString().split(`T`)[0]??``:``;d(t),t&&h(e=>{if(e)return e;let n=new Date(t);return n.setDate(n.getDate()+1),n.toISOString().split(`T`)[0]??``})},onTimeChange:e=>p(e),origin:o,destination:b,minDate:new Date,shadowRoot:e}),(0,q.jsx)(jI,{label:`Drop-off Date`,dateValue:m,timeValue:g,onDateChange:e=>{h(e?e.toISOString().split(`T`)[0]??``:``)},onTimeChange:e=>_(e),origin:o,destination:b,minDate:u?new Date(u):new Date,shadowRoot:e,referenceDates:(()=>{let e=[];if(u){let t=u.split(`-`);if(t.length===3){let n=t[0],r=t[1],i=t[2],a=parseInt(n,10),o=parseInt(r,10),s=parseInt(i,10);!Number.isNaN(a)&&!Number.isNaN(o)&&!Number.isNaN(s)&&e.push({date:new Date(a,o-1,s,12,0,0),label:`Pick-up`})}}if(m){let t=m.split(`-`);if(t.length===3){let n=t[0],r=t[1],i=t[2],a=parseInt(n,10),o=parseInt(r,10),s=parseInt(i,10);!Number.isNaN(a)&&!Number.isNaN(o)&&!Number.isNaN(s)&&e.push({date:new Date(a,o-1,s,12,0,0),label:`Drop-off`})}}return e.length?e:void 0})()}),(0,q.jsx)(`button`,{type:`button`,disabled:!F,onClick:ee,"aria-label":`Search for car rentals`,className:`aone:w-full aone:md:w-auto aone:px-6 aone:py-2 aone:bg-green-500 aone:dark:bg-green-600 aone:text-white aone:rounded-lg aone:focus:outline-none aone:focus:ring-2 aone:focus:ring-green-700 aone:focus:ring-offset-2 aone:h-[44px] aone:text-base aone:font-medium aone:enabled:hover:bg-green-700 aone:enabled:active:bg-green-700 aone:disabled:bg-gray-400 aone:dark:disabled:bg-gray-600 aone:disabled:text-white/70 aone:disabled:cursor-not-allowed`,children:(0,q.jsxs)(`div`,{className:`aone:flex aone:items-center aone:justify-center aone:gap-2`,children:[(0,q.jsx)(AB,{}),(0,q.jsx)(`span`,{children:`Search`})]})})]})]})}var NB=new tb;function PB({children:e,props:t}){return(0,q.jsx)(ib,{client:NB,children:(0,q.jsx)(Ob,{apiDomain:t.apiDomain,consentAnalytics:t.consentAnalytics,consentAdvertising:t.consentAdvertising,consentFunctional:t.consentFunctional,children:e})})}function FB(e){return!e.origin||e.origin.length!==3?(console.error(`Origin is not a valid IATA code, not rendering widget.`),null):(0,q.jsxs)(PB,{props:e,children:[(0,q.jsx)(`style`,{children:Ab}),e.userStyleBlock?(0,q.jsx)(`style`,{children:e.userStyleBlock}):null,(0,q.jsx)(xb,{componentName:`carfare search`,children:(0,q.jsx)(K.Suspense,{fallback:(0,q.jsx)(qv,{}),children:(0,q.jsx)(MB,{shadowRoot:e.shadowRoot,origin:e.origin,theme:e.theme})})})]})}var IB=[`origin`,`primary-color`,`secondary-color`,`consent-analytics`,`consent-advertising`,`consent-functional`,`theme`,o_,`id`],LB=class extends HTMLElement{_shadowRoot;_mountPoint;_reactRoot;_renderInProgress=!1;_renderQueued=!1;_renderScheduled=!1;_mountTelemetrySent=!1;_lastPublicConfigTelemetryKey=null;static get observedAttributes(){return Array.from(IB)}attributeChangedCallback(e,t,n){t!==n&&this.isConnected&&this._scheduleRender()}connectedCallback(){this.style.position=`relative`,this.style.zIndex=`10`,this.style.lineHeight=`1.5`,this.style.display=`flex`,this.style.flexDirection=`column`,this._scheduleRender()}disconnectedCallback(){this._reactRoot&&=(this._reactRoot.unmount(),void 0),this._mountTelemetrySent=!1,this._lastPublicConfigTelemetryKey=null}_scheduleRender(){this._renderScheduled||(this._renderScheduled=!0,queueMicrotask(()=>{this._renderScheduled=!1,this.isConnected&&this._renderAsync()}))}async _renderAsync(){if(this._renderInProgress){this._renderQueued=!0;return}this._renderInProgress=!0;try{let e=A_(this),t=I_(),n=null,r=!1,i={attempted:!1,durationMs:0},a;if(e&&t){let t=await L_(e);i=t.metrics;let o=t.config;o?.widgetType&&o.widgetType!==`carfare-search`&&(console.warn(`[airport-one-widgets] Widget instance type does not match carfare-search:`,o.widgetType),a=`widget_type_mismatch`,o=null),n=o,r=!n,i.attempted&&n===null&&a===void 0&&i.failureKind&&(a=i.failureKind)}if(!this.isConnected)return;let o=U_(n),s=window[zp],c=Rx(this,`https://flymyairport.vercel.app`,s,o),l=!i.attempted&&(!t||!e)?t?`no_instance_id`:`no_api_base`:void 0;if(c.consentAnalytics){let r=i.attempted?`attempt:${t}|${e}|${n===null?`fail`:`ok`}|${a??``}`:`skip:${l??`none`}`;r!==this._lastPublicConfigTelemetryKey&&(this._lastPublicConfigTelemetryKey=r,Wv(!0,{widget_runtime:`carfare-search`,attempted:i.attempted,duration_ms:i.durationMs,ok:i.attempted?n!==null:!1,error_kind:i.attempted&&n===null?a:void 0,skip_reason:l}))}r&&console.warn(`${M_}: carfare-search — managed instance config not applied; using host attributes and window defaults.`),this._paintCarfare(c),c.consentAnalytics&&!this._mountTelemetrySent&&(this._mountTelemetrySent=!0,Gv(!0,{widget_runtime:`carfare-search`,public_config_unavailable:r}))}finally{this._renderInProgress=!1,this._renderQueued&&(this._renderQueued=!1,queueMicrotask(()=>{this.isConnected&&this._renderAsync()}))}}_paintCarfare(e){let t=this._shadowRoot??=this.attachShadow({mode:`closed`}),n=this._mountPoint??=document.createElement(`span`);n.parentNode!==t&&t.appendChild(n);let r={...e,shadowRoot:t},i=r.primaryColor??`210 100% 50%`,a=r.secondaryColor??`210 100% 50%`,o=r.primaryColor!=null&&m_.test(r.primaryColor),s=r.secondaryColor!=null&&m_.test(r.secondaryColor);n.style.setProperty(`--primary`,o?__(i):i),n.style.setProperty(`--secondary`,s?__(a):a),r.theme===`dark`?this.setAttribute(`data-mode`,`dark`):this.removeAttribute(`data-mode`),(this._reactRoot??=T_.createRoot(n)).render((0,q.jsx)(FB,{...r}))}};customElements.get(`fma-carfare-search`)||customElements.define(`fma-carfare-search`,LB);function RB(e){return e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase()}function zB(e){return Array.from(new Set([e,e.toLowerCase(),RB(e)]))}function BB(e,t){if(e===void 0)return t;let n=e.trim().toLowerCase();return t?n!==`false`:n===`true`}function VB(e){let t=e.trim();return/^(?:\d+\.?\d*|\.\d+)$/.test(t)?`${t.endsWith(`.`)?t.slice(0,-1):t}px`:t}function HB({className:e,regMarkClassName:t}){return(0,q.jsxs)(`span`,{className:e,children:[`Fly`,(0,q.jsx)(`strong`,{children:`MyAirport`}),(0,q.jsx)(`sup`,{"aria-hidden":`true`,className:t||`aone:text-[0.5em] aone:ml-0.5 aone:leading-none`,children:`®`}),(0,q.jsx)(`span`,{className:`aone:sr-only`,children:` Registered`})]})}function UB(e,t=500){let[n,r]=(0,K.useState)(e),i=(0,K.useRef)(e);return(0,K.useEffect)(()=>{if(i.current===e)return;let n=e,a=setTimeout(()=>{i.current!==n&&(i.current=n,r(n))},t);return()=>clearTimeout(a)},[e,t]),n}async function WB(e,t,n,r){let i=`${e}/api/calendar-v2`,a={"Content-Type":`application/json`};n&&(a[jb]=n),r&&(a[Mb]=r);let o=await fetch(i,{method:`POST`,headers:a,body:JSON.stringify(t)});if(!o.ok)throw Error(`Unable to get flight calendar`);let s=await o.json();return Up.parse(s)}function GB({apiDomain:e,params:t,debounceTime:n=500}){let{sessionId:r}=Eb(),{clickId:i}=Pv(),a=UB(t,n),o=typeof a.origin==`string`&&a.origin.trim().length>0,s=typeof a.destination==`string`&&a.destination.trim().length>0,c=!!a.startDate&&o&&s,l=a.startDate?uh(a.startDate,`yyyy-MM-dd`):null,u=a.endDate?uh(a.endDate,`yyyy-MM-dd`):null,{data:d,status:f}=yb({queryKey:[`flight-calendar`,a.origin,a.destination,a.departureLocationType??G.AIRPORT,a.arrivalLocationType??G.AIRPORT,l,u,a.includePriceInsights?`price-insights-v2`:`no-price-insights`,r],enabled:c&&!!r,queryFn:()=>{let t=uh(a.startDate,`yyyy-MM-dd`),n=a.endDate?uh(a.endDate,`yyyy-MM-dd`):void 0,o=Hp.safeParse({departureAirport:a.origin.split(`,`)[0]??``,arrivalAirport:a.destination.split(`,`)[0]??``,startDate:t,endDate:n,includePriceInsights:a.includePriceInsights??!1,departureLocationType:a.departureLocationType??G.AIRPORT,arrivalLocationType:a.arrivalLocationType??G.AIRPORT});if(!o.success)throw Error(`Invalid flight-calendar parameters`);return WB(e,o.data,r,i)},refetchOnWindowFocus:!1,refetchOnMount:!1,staleTime:1e3*60*1});return{data:d,status:f}}function KB(){return(0,q.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,className:`aone:w-6 aone:h-6`,children:(0,q.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M7.5 21L3 16.5m0 0L7.5 12M3 16.5h13.5m0-13.5L21 7.5m0 0L16.5 12M21 7.5H7.5`})})}var qB=s(((e,t)=>{function n(){this.__data__=[],this.size=0}t.exports=n})),JB=s(((e,t)=>{function n(e,t){return e===t||e!==e&&t!==t}t.exports=n})),YB=s(((e,t)=>{var n=JB();function r(e,t){for(var r=e.length;r--;)if(n(e[r][0],t))return r;return-1}t.exports=r})),XB=s(((e,t)=>{var n=YB(),r=Array.prototype.splice;function i(e){var t=this.__data__,i=n(t,e);return i<0?!1:(i==t.length-1?t.pop():r.call(t,i,1),--this.size,!0)}t.exports=i})),ZB=s(((e,t)=>{var n=YB();function r(e){var t=this.__data__,r=n(t,e);return r<0?void 0:t[r][1]}t.exports=r})),QB=s(((e,t)=>{var n=YB();function r(e){return n(this.__data__,e)>-1}t.exports=r})),$B=s(((e,t)=>{var n=YB();function r(e,t){var r=this.__data__,i=n(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this}t.exports=r})),eV=s(((e,t)=>{var n=qB(),r=XB(),i=ZB(),a=QB(),o=$B();function s(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=n,s.prototype.delete=r,s.prototype.get=i,s.prototype.has=a,s.prototype.set=o,t.exports=s})),tV=s(((e,t)=>{var n=eV();function r(){this.__data__=new n,this.size=0}t.exports=r})),nV=s(((e,t)=>{function n(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}t.exports=n})),rV=s(((e,t)=>{function n(e){return this.__data__.get(e)}t.exports=n})),iV=s(((e,t)=>{function n(e){return this.__data__.has(e)}t.exports=n})),aV=s(((e,t)=>{var n=fB(),r=rB(),i=`[object AsyncFunction]`,a=`[object Function]`,o=`[object GeneratorFunction]`,s=`[object Proxy]`;function c(e){if(!r(e))return!1;var t=n(e);return t==a||t==o||t==i||t==s}t.exports=c})),oV=s(((e,t)=>{t.exports=aB()[`__core-js_shared__`]})),sV=s(((e,t)=>{var n=oV(),r=function(){var e=/[^.]+$/.exec(n&&n.keys&&n.keys.IE_PROTO||``);return e?`Symbol(src)_1.`+e:``}();function i(e){return!!r&&r in e}t.exports=i})),cV=s(((e,t)=>{var n=Function.prototype.toString;function r(e){if(e!=null){try{return n.call(e)}catch{}try{return e+``}catch{}}return``}t.exports=r})),lV=s(((e,t)=>{var n=aV(),r=sV(),i=rB(),a=cV(),o=/[\\^$.*+?()[\]{}|]/g,s=/^\[object .+?Constructor\]$/,c=Function.prototype,l=Object.prototype,u=c.toString,d=l.hasOwnProperty,f=RegExp(`^`+u.call(d).replace(o,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`);function p(e){return!i(e)||r(e)?!1:(n(e)?f:s).test(a(e))}t.exports=p})),uV=s(((e,t)=>{function n(e,t){return e?.[t]}t.exports=n})),dV=s(((e,t)=>{var n=lV(),r=uV();function i(e,t){var i=r(e,t);return n(i)?i:void 0}t.exports=i})),fV=s(((e,t)=>{t.exports=dV()(aB(),`Map`)})),pV=s(((e,t)=>{t.exports=dV()(Object,`create`)})),mV=s(((e,t)=>{var n=pV();function r(){this.__data__=n?n(null):{},this.size=0}t.exports=r})),hV=s(((e,t)=>{function n(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=+!!t,t}t.exports=n})),gV=s(((e,t)=>{var n=pV(),r=`__lodash_hash_undefined__`,i=Object.prototype.hasOwnProperty;function a(e){var t=this.__data__;if(n){var a=t[e];return a===r?void 0:a}return i.call(t,e)?t[e]:void 0}t.exports=a})),_V=s(((e,t)=>{var n=pV(),r=Object.prototype.hasOwnProperty;function i(e){var t=this.__data__;return n?t[e]!==void 0:r.call(t,e)}t.exports=i})),vV=s(((e,t)=>{var n=pV(),r=`__lodash_hash_undefined__`;function i(e,t){var i=this.__data__;return this.size+=+!this.has(e),i[e]=n&&t===void 0?r:t,this}t.exports=i})),yV=s(((e,t)=>{var n=mV(),r=hV(),i=gV(),a=_V(),o=vV();function s(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=n,s.prototype.delete=r,s.prototype.get=i,s.prototype.has=a,s.prototype.set=o,t.exports=s})),bV=s(((e,t)=>{var n=yV(),r=eV(),i=fV();function a(){this.size=0,this.__data__={hash:new n,map:new(i||r),string:new n}}t.exports=a})),xV=s(((e,t)=>{function n(e){var t=typeof e;return t==`string`||t==`number`||t==`symbol`||t==`boolean`?e!==`__proto__`:e===null}t.exports=n})),SV=s(((e,t)=>{var n=xV();function r(e,t){var r=e.__data__;return n(t)?r[typeof t==`string`?`string`:`hash`]:r.map}t.exports=r})),CV=s(((e,t)=>{var n=SV();function r(e){var t=n(this,e).delete(e);return this.size-=+!!t,t}t.exports=r})),wV=s(((e,t)=>{var n=SV();function r(e){return n(this,e).get(e)}t.exports=r})),TV=s(((e,t)=>{var n=SV();function r(e){return n(this,e).has(e)}t.exports=r})),EV=s(((e,t)=>{var n=SV();function r(e,t){var r=n(this,e),i=r.size;return r.set(e,t),this.size+=r.size==i?0:1,this}t.exports=r})),DV=s(((e,t)=>{var n=bV(),r=CV(),i=wV(),a=TV(),o=EV();function s(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=n,s.prototype.delete=r,s.prototype.get=i,s.prototype.has=a,s.prototype.set=o,t.exports=s})),OV=s(((e,t)=>{var n=eV(),r=fV(),i=DV(),a=200;function o(e,t){var o=this.__data__;if(o instanceof n){var s=o.__data__;if(!r||s.length<a-1)return s.push([e,t]),this.size=++o.size,this;o=this.__data__=new i(s)}return o.set(e,t),this.size=o.size,this}t.exports=o})),kV=s(((e,t)=>{var n=eV(),r=tV(),i=nV(),a=rV(),o=iV(),s=OV();function c(e){var t=this.__data__=new n(e);this.size=t.size}c.prototype.clear=r,c.prototype.delete=i,c.prototype.get=a,c.prototype.has=o,c.prototype.set=s,t.exports=c})),AV=s(((e,t)=>{var n=`__lodash_hash_undefined__`;function r(e){return this.__data__.set(e,n),this}t.exports=r})),jV=s(((e,t)=>{function n(e){return this.__data__.has(e)}t.exports=n})),MV=s(((e,t)=>{var n=DV(),r=AV(),i=jV();function a(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new n;++t<r;)this.add(e[t])}a.prototype.add=a.prototype.push=r,a.prototype.has=i,t.exports=a})),NV=s(((e,t)=>{function n(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}t.exports=n})),PV=s(((e,t)=>{function n(e,t){return e.has(t)}t.exports=n})),FV=s(((e,t)=>{var n=MV(),r=NV(),i=PV(),a=1,o=2;function s(e,t,s,c,l,u){var d=s&a,f=e.length,p=t.length;if(f!=p&&!(d&&p>f))return!1;var m=u.get(e),h=u.get(t);if(m&&h)return m==t&&h==e;var g=-1,_=!0,v=s&o?new n:void 0;for(u.set(e,t),u.set(t,e);++g<f;){var y=e[g],b=t[g];if(c)var x=d?c(b,y,g,t,e,u):c(y,b,g,e,t,u);if(x!==void 0){if(x)continue;_=!1;break}if(v){if(!r(t,function(e,t){if(!i(v,t)&&(y===e||l(y,e,s,c,u)))return v.push(t)})){_=!1;break}}else if(!(y===b||l(y,b,s,c,u))){_=!1;break}}return u.delete(e),u.delete(t),_}t.exports=s})),IV=s(((e,t)=>{t.exports=aB().Uint8Array})),LV=s(((e,t)=>{function n(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}t.exports=n})),RV=s(((e,t)=>{function n(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}t.exports=n})),zV=s(((e,t)=>{var n=lB(),r=IV(),i=JB(),a=FV(),o=LV(),s=RV(),c=1,l=2,u=`[object Boolean]`,d=`[object Date]`,f=`[object Error]`,p=`[object Map]`,m=`[object Number]`,h=`[object RegExp]`,g=`[object Set]`,_=`[object String]`,v=`[object Symbol]`,y=`[object ArrayBuffer]`,b=`[object DataView]`,x=n?n.prototype:void 0,S=x?x.valueOf:void 0;function C(e,t,n,x,C,w,T){switch(n){case b:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case y:return!(e.byteLength!=t.byteLength||!w(new r(e),new r(t)));case u:case d:case m:return i(+e,+t);case f:return e.name==t.name&&e.message==t.message;case h:case _:return e==t+``;case p:var E=o;case g:var D=x&c;if(E||=s,e.size!=t.size&&!D)return!1;var O=T.get(e);if(O)return O==t;x|=l,T.set(e,t);var k=a(E(e),E(t),x,C,w,T);return T.delete(e),k;case v:if(S)return S.call(e)==S.call(t)}return!1}t.exports=C})),BV=s(((e,t)=>{function n(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}t.exports=n})),VV=s(((e,t)=>{t.exports=Array.isArray})),HV=s(((e,t)=>{var n=BV(),r=VV();function i(e,t,i){var a=t(e);return r(e)?a:n(a,i(e))}t.exports=i})),UV=s(((e,t)=>{function n(e,t){for(var n=-1,r=e==null?0:e.length,i=0,a=[];++n<r;){var o=e[n];t(o,n,e)&&(a[i++]=o)}return a}t.exports=n})),WV=s(((e,t)=>{function n(){return[]}t.exports=n})),GV=s(((e,t)=>{var n=UV(),r=WV(),i=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols;t.exports=a?function(e){return e==null?[]:(e=Object(e),n(a(e),function(t){return i.call(e,t)}))}:r})),KV=s(((e,t)=>{function n(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}t.exports=n})),qV=s(((e,t)=>{var n=fB(),r=pB(),i=`[object Arguments]`;function a(e){return r(e)&&n(e)==i}t.exports=a})),JV=s(((e,t)=>{var n=qV(),r=pB(),i=Object.prototype,a=i.hasOwnProperty,o=i.propertyIsEnumerable;t.exports=n(function(){return arguments}())?n:function(e){return r(e)&&a.call(e,`callee`)&&!o.call(e,`callee`)}})),YV=s(((e,t)=>{function n(){return!1}t.exports=n})),XV=s(((e,t)=>{var n=aB(),r=YV(),i=typeof e==`object`&&e&&!e.nodeType&&e,a=i&&typeof t==`object`&&t&&!t.nodeType&&t,o=a&&a.exports===i?n.Buffer:void 0;t.exports=(o?o.isBuffer:void 0)||r})),ZV=s(((e,t)=>{var n=9007199254740991,r=/^(?:0|[1-9]\d*)$/;function i(e,t){var i=typeof e;return t??=n,!!t&&(i==`number`||i!=`symbol`&&r.test(e))&&e>-1&&e%1==0&&e<t}t.exports=i})),QV=s(((e,t)=>{var n=9007199254740991;function r(e){return typeof e==`number`&&e>-1&&e%1==0&&e<=n}t.exports=r})),$V=s(((e,t)=>{var n=fB(),r=QV(),i=pB(),a=`[object Arguments]`,o=`[object Array]`,s=`[object Boolean]`,c=`[object Date]`,l=`[object Error]`,u=`[object Function]`,d=`[object Map]`,f=`[object Number]`,p=`[object Object]`,m=`[object RegExp]`,h=`[object Set]`,g=`[object String]`,_=`[object WeakMap]`,v=`[object ArrayBuffer]`,y=`[object DataView]`,b=`[object Float32Array]`,x=`[object Float64Array]`,S=`[object Int8Array]`,C=`[object Int16Array]`,w=`[object Int32Array]`,T=`[object Uint8Array]`,E=`[object Uint8ClampedArray]`,D=`[object Uint16Array]`,O=`[object Uint32Array]`,k={};k[b]=k[x]=k[S]=k[C]=k[w]=k[T]=k[E]=k[D]=k[O]=!0,k[a]=k[o]=k[v]=k[s]=k[y]=k[c]=k[l]=k[u]=k[d]=k[f]=k[p]=k[m]=k[h]=k[g]=k[_]=!1;function A(e){return i(e)&&r(e.length)&&!!k[n(e)]}t.exports=A})),eH=s(((e,t)=>{function n(e){return function(t){return e(t)}}t.exports=n})),tH=s(((e,t)=>{var n=iB(),r=typeof e==`object`&&e&&!e.nodeType&&e,i=r&&typeof t==`object`&&t&&!t.nodeType&&t,a=i&&i.exports===r&&n.process;t.exports=function(){try{return i&&i.require&&i.require(`util`).types||a&&a.binding&&a.binding(`util`)}catch{}}()})),nH=s(((e,t)=>{var n=$V(),r=eH(),i=tH(),a=i&&i.isTypedArray;t.exports=a?r(a):n})),rH=s(((e,t)=>{var n=KV(),r=JV(),i=VV(),a=XV(),o=ZV(),s=nH(),c=Object.prototype.hasOwnProperty;function l(e,t){var l=i(e),u=!l&&r(e),d=!l&&!u&&a(e),f=!l&&!u&&!d&&s(e),p=l||u||d||f,m=p?n(e.length,String):[],h=m.length;for(var g in e)(t||c.call(e,g))&&!(p&&(g==`length`||d&&(g==`offset`||g==`parent`)||f&&(g==`buffer`||g==`byteLength`||g==`byteOffset`)||o(g,h)))&&m.push(g);return m}t.exports=l})),iH=s(((e,t)=>{var n=Object.prototype;function r(e){var t=e&&e.constructor;return e===(typeof t==`function`&&t.prototype||n)}t.exports=r})),aH=s(((e,t)=>{function n(e,t){return function(n){return e(t(n))}}t.exports=n})),oH=s(((e,t)=>{t.exports=aH()(Object.keys,Object)})),sH=s(((e,t)=>{var n=iH(),r=oH(),i=Object.prototype.hasOwnProperty;function a(e){if(!n(e))return r(e);var t=[];for(var a in Object(e))i.call(e,a)&&a!=`constructor`&&t.push(a);return t}t.exports=a})),cH=s(((e,t)=>{var n=aV(),r=QV();function i(e){return e!=null&&r(e.length)&&!n(e)}t.exports=i})),lH=s(((e,t)=>{var n=rH(),r=sH(),i=cH();function a(e){return i(e)?n(e):r(e)}t.exports=a})),uH=s(((e,t)=>{var n=HV(),r=GV(),i=lH();function a(e){return n(e,i,r)}t.exports=a})),dH=s(((e,t)=>{var n=uH(),r=1,i=Object.prototype.hasOwnProperty;function a(e,t,a,o,s,c){var l=a&r,u=n(e),d=u.length;if(d!=n(t).length&&!l)return!1;for(var f=d;f--;){var p=u[f];if(!(l?p in t:i.call(t,p)))return!1}var m=c.get(e),h=c.get(t);if(m&&h)return m==t&&h==e;var g=!0;c.set(e,t),c.set(t,e);for(var _=l;++f<d;){p=u[f];var v=e[p],y=t[p];if(o)var b=l?o(y,v,p,t,e,c):o(v,y,p,e,t,c);if(!(b===void 0?v===y||s(v,y,a,o,c):b)){g=!1;break}_||=p==`constructor`}if(g&&!_){var x=e.constructor,S=t.constructor;x!=S&&`constructor`in e&&`constructor`in t&&!(typeof x==`function`&&x instanceof x&&typeof S==`function`&&S instanceof S)&&(g=!1)}return c.delete(e),c.delete(t),g}t.exports=a})),fH=s(((e,t)=>{t.exports=dV()(aB(),`DataView`)})),pH=s(((e,t)=>{t.exports=dV()(aB(),`Promise`)})),mH=s(((e,t)=>{t.exports=dV()(aB(),`Set`)})),hH=s(((e,t)=>{t.exports=dV()(aB(),`WeakMap`)})),gH=s(((e,t)=>{var n=fH(),r=fV(),i=pH(),a=mH(),o=hH(),s=fB(),c=cV(),l=`[object Map]`,u=`[object Object]`,d=`[object Promise]`,f=`[object Set]`,p=`[object WeakMap]`,m=`[object DataView]`,h=c(n),g=c(r),_=c(i),v=c(a),y=c(o),b=s;(n&&b(new n(new ArrayBuffer(1)))!=m||r&&b(new r)!=l||i&&b(i.resolve())!=d||a&&b(new a)!=f||o&&b(new o)!=p)&&(b=function(e){var t=s(e),n=t==u?e.constructor:void 0,r=n?c(n):``;if(r)switch(r){case h:return m;case g:return l;case _:return d;case v:return f;case y:return p}return t}),t.exports=b})),_H=s(((e,t)=>{var n=kV(),r=FV(),i=zV(),a=dH(),o=gH(),s=VV(),c=XV(),l=nH(),u=1,d=`[object Arguments]`,f=`[object Array]`,p=`[object Object]`,m=Object.prototype.hasOwnProperty;function h(e,t,h,g,_,v){var y=s(e),b=s(t),x=y?f:o(e),S=b?f:o(t);x=x==d?p:x,S=S==d?p:S;var C=x==p,w=S==p,T=x==S;if(T&&c(e)){if(!c(t))return!1;y=!0,C=!1}if(T&&!C)return v||=new n,y||l(e)?r(e,t,h,g,_,v):i(e,t,x,h,g,_,v);if(!(h&u)){var E=C&&m.call(e,`__wrapped__`),D=w&&m.call(t,`__wrapped__`);if(E||D){var O=E?e.value():e,k=D?t.value():t;return v||=new n,_(O,k,h,g,v)}}return T?(v||=new n,a(e,t,h,g,_,v)):!1}t.exports=h})),vH=s(((e,t)=>{var n=_H(),r=pB();function i(e,t,a,o,s){return e===t?!0:e==null||t==null||!r(e)&&!r(t)?e!==e&&t!==t:n(e,t,a,o,i,s)}t.exports=i})),yH=s(((e,t)=>{var n=kV(),r=vH(),i=1,a=2;function o(e,t,o,s){var c=o.length,l=c,u=!s;if(e==null)return!l;for(e=Object(e);c--;){var d=o[c];if(u&&d[2]?d[1]!==e[d[0]]:!(d[0]in e))return!1}for(;++c<l;){d=o[c];var f=d[0],p=e[f],m=d[1];if(u&&d[2]){if(p===void 0&&!(f in e))return!1}else{var h=new n;if(s)var g=s(p,m,f,e,t,h);if(!(g===void 0?r(m,p,i|a,s,h):g))return!1}}return!0}t.exports=o})),bH=s(((e,t)=>{var n=rB();function r(e){return e===e&&!n(e)}t.exports=r})),xH=s(((e,t)=>{var n=bH(),r=lH();function i(e){for(var t=r(e),i=t.length;i--;){var a=t[i],o=e[a];t[i]=[a,o,n(o)]}return t}t.exports=i})),SH=s(((e,t)=>{function n(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}t.exports=n})),CH=s(((e,t)=>{var n=yH(),r=xH(),i=SH();function a(e){var t=r(e);return t.length==1&&t[0][2]?i(t[0][0],t[0][1]):function(r){return r===e||n(r,e,t)}}t.exports=a})),wH=s(((e,t)=>{var n=VV(),r=mB(),i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;function o(e,t){if(n(e))return!1;var o=typeof e;return o==`number`||o==`symbol`||o==`boolean`||e==null||r(e)?!0:a.test(e)||!i.test(e)||t!=null&&e in Object(t)}t.exports=o})),TH=s(((e,t)=>{var n=DV(),r=`Expected a function`;function i(e,t){if(typeof e!=`function`||t!=null&&typeof t!=`function`)throw TypeError(r);var a=function(){var n=arguments,r=t?t.apply(this,n):n[0],i=a.cache;if(i.has(r))return i.get(r);var o=e.apply(this,n);return a.cache=i.set(r,o)||i,o};return a.cache=new(i.Cache||n),a}i.Cache=n,t.exports=i})),EH=s(((e,t)=>{var n=TH(),r=500;function i(e){var t=n(e,function(e){return i.size===r&&i.clear(),e}),i=t.cache;return t}t.exports=i})),DH=s(((e,t)=>{var n=EH(),r=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/\\(\\)?/g;t.exports=n(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(``),e.replace(r,function(e,n,r,a){t.push(r?a.replace(i,`$1`):n||e)}),t})})),OH=s(((e,t)=>{function n(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}t.exports=n})),kH=s(((e,t)=>{var n=lB(),r=OH(),i=VV(),a=mB(),o=1/0,s=n?n.prototype:void 0,c=s?s.toString:void 0;function l(e){if(typeof e==`string`)return e;if(i(e))return r(e,l)+``;if(a(e))return c?c.call(e):``;var t=e+``;return t==`0`&&1/e==-o?`-0`:t}t.exports=l})),AH=s(((e,t)=>{var n=kH();function r(e){return e==null?``:n(e)}t.exports=r})),jH=s(((e,t)=>{var n=VV(),r=wH(),i=DH(),a=AH();function o(e,t){return n(e)?e:r(e,t)?[e]:i(a(e))}t.exports=o})),MH=s(((e,t)=>{var n=mB(),r=1/0;function i(e){if(typeof e==`string`||n(e))return e;var t=e+``;return t==`0`&&1/e==-r?`-0`:t}t.exports=i})),NH=s(((e,t)=>{var n=jH(),r=MH();function i(e,t){t=n(t,e);for(var i=0,a=t.length;e!=null&&i<a;)e=e[r(t[i++])];return i&&i==a?e:void 0}t.exports=i})),PH=s(((e,t)=>{var n=NH();function r(e,t,r){var i=e==null?void 0:n(e,t);return i===void 0?r:i}t.exports=r})),FH=s(((e,t)=>{function n(e,t){return e!=null&&t in Object(e)}t.exports=n})),IH=s(((e,t)=>{var n=jH(),r=JV(),i=VV(),a=ZV(),o=QV(),s=MH();function c(e,t,c){t=n(t,e);for(var l=-1,u=t.length,d=!1;++l<u;){var f=s(t[l]);if(!(d=e!=null&&c(e,f)))break;e=e[f]}return d||++l!=u?d:(u=e==null?0:e.length,!!u&&o(u)&&a(f,u)&&(i(e)||r(e)))}t.exports=c})),LH=s(((e,t)=>{var n=FH(),r=IH();function i(e,t){return e!=null&&r(e,t,n)}t.exports=i})),RH=s(((e,t)=>{var n=vH(),r=PH(),i=LH(),a=wH(),o=bH(),s=SH(),c=MH(),l=1,u=2;function d(e,t){return a(e)&&o(t)?s(c(e),t):function(a){var o=r(a,e);return o===void 0&&o===t?i(a,e):n(t,o,l|u)}}t.exports=d})),zH=s(((e,t)=>{function n(e){return e}t.exports=n})),BH=s(((e,t)=>{function n(e){return function(t){return t?.[e]}}t.exports=n})),VH=s(((e,t)=>{var n=NH();function r(e){return function(t){return n(t,e)}}t.exports=r})),HH=s(((e,t)=>{var n=BH(),r=VH(),i=wH(),a=MH();function o(e){return i(e)?n(a(e)):r(e)}t.exports=o})),UH=s(((e,t)=>{var n=CH(),r=RH(),i=zH(),a=VV(),o=HH();function s(e){return typeof e==`function`?e:e==null?i:typeof e==`object`?a(e)?r(e[0],e[1]):n(e):o(e)}t.exports=s})),WH=s(((e,t)=>{function n(e,t,n,r){for(var i=e.length,a=n+(r?1:-1);r?a--:++a<i;)if(t(e[a],a,e))return a;return-1}t.exports=n})),GH=s(((e,t)=>{function n(e){return e!==e}t.exports=n})),KH=s(((e,t)=>{function n(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}t.exports=n})),qH=s(((e,t)=>{var n=WH(),r=GH(),i=KH();function a(e,t,a){return t===t?i(e,t,a):n(e,r,a)}t.exports=a})),JH=s(((e,t)=>{var n=qH();function r(e,t){return!!(e!=null&&e.length)&&n(e,t,0)>-1}t.exports=r})),YH=s(((e,t)=>{function n(e,t,n){for(var r=-1,i=e==null?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}t.exports=n})),XH=s(((e,t)=>{function n(){}t.exports=n})),ZH=s(((e,t)=>{var n=mH(),r=XH(),i=RV();t.exports=n&&1/i(new n([,-0]))[1]==1/0?function(e){return new n(e)}:r})),QH=s(((e,t)=>{var n=MV(),r=JH(),i=YH(),a=PV(),o=ZH(),s=RV(),c=200;function l(e,t,l){var u=-1,d=r,f=e.length,p=!0,m=[],h=m;if(l)p=!1,d=i;else if(f>=c){var g=t?null:o(e);if(g)return s(g);p=!1,d=a,h=new n}else h=t?[]:m;outer:for(;++u<f;){var _=e[u],v=t?t(_):_;if(_=l||_!==0?_:0,p&&v===v){for(var y=h.length;y--;)if(h[y]===v)continue outer;t&&h.push(v),m.push(_)}else d(h,v,l)||(h!==m&&h.push(v),m.push(_))}return m}t.exports=l})),$H=u(s(((e,t)=>{var n=UH(),r=QH();function i(e,t){return e&&e.length?r(e,n(t,2)):[]}t.exports=i}))(),1),eU=new WeakMap,tU=new WeakMap,nU=`data-a1-flight-combobox-open`;function rU(e){let t=tU.get(e);t!=null&&(clearTimeout(t),tU.delete(e));let n=(eU.get(e)??0)+1;eU.set(e,n),e.setAttribute(nU,``)}function iU(e){let t=Math.max(0,(eU.get(e)??0)-1);if(t===0){eU.delete(e);let t=tU.get(e);t!=null&&clearTimeout(t);let n=window.setTimeout(()=>{tU.delete(e),e.removeAttribute(nU)},400);tU.set(e,n)}else eU.set(e,t)}function aU({items:e,selectedItems:t,onInputChange:n,onSelectedItemsChange:r,fieldLabel:i,placeholder:a,icon:o,disabled:s,shadowRoot:c,dataTestId:l}){let[u,d]=(0,K.useState)(``),f=(0,K.useRef)(null),p=(0,K.useRef)(null),m=(0,K.useId)(),h=(0,K.useId)(),g=(0,K.useId)(),_=(0,K.useId)(),v=(0,K.useId)(),[y,b]=(0,K.useState)({}),x=c??null,S=(0,K.useCallback)(()=>{let e=f.current;if(!e)return;let t=e.getBoundingClientRect(),n=window.innerHeight-t.bottom-8,r=Math.max(120,Math.min(320,n-8)),i=t.left,a=t.width;i+a>window.innerWidth-8&&(i=Math.max(8,window.innerWidth-a-8)),b({position:`fixed`,top:t.bottom+8,left:i,width:a,maxHeight:r,zIndex:1e4})},[]),C=(0,K.useMemo)(()=>e.filter(e=>e.type===`airport`||e.type===`place`).reduce((e,t)=>{if(t.type===`airport`){let n=t,r=u.toLowerCase();if(n.iata_code.toLowerCase()===r||n.iata_display_list?.some(e=>e.toLowerCase()===r))return t.sectionIndex>=0?[...e,t]:[{...t,sectionIndex:-1},...e]}return[...e,t]},[]).reduce((e,t)=>t.type===`airport`?{items:[...e.items,t],airportCount:e.airportCount+1}:t.type===`place`?e.airportCount<20?{...e,items:[...e.items,t]}:e:e.airportCount<=20?{...e,items:[...e.items,t]}:e,{items:[],airportCount:0}).items,[u,e]);function w(e){return e.kayak?.stateCode&&e.kayak?.countryCode?`${e.name}, ${e.kayak.stateCode}, ${e.kayak.countryCode}`:e.kayak?.countryCode&&!e.kayak?.stateCode?`${e.name}, ${e.kayak.countryCode}`:e.formatted_address}function T(e){return e.state_code?`${e.city}, ${e.state_code}, ${e.country_code}`:e.location_display?e.location_display:`${e.city}, ${e.country_code}`}function E(e){return e.iata_display_list&&e.iata_display_list.length>0?e.iata_display_list.join(`, `):e.iata_code}function D(e){if(e.type===`airport`){let n=e;return t?.length>1?E(n):n.country_code===`US`?`${n.city} (${E(n)})`:`${n.city}, ${n.country_code} (${E(n)})`}if(e.type===`place`){let t=e;return t.formatted_address?.length<20?t.formatted_address:t.name}return``}let O=typeof Proxy==`function`&&!Object.isSealed(new Proxy({},{}));function k(e){let t=e.ownerDocument,n={document:t,addEventListener:t.addEventListener.bind(e),removeEventListener:t.removeEventListener.bind(e),Node:window.Node,Element:window.Element,HTMLElement:window.HTMLElement,SVGElement:window.SVGElement};return O?new Proxy(n,{get(e,t){return e[t]}}):n}let{getSelectedItemProps:A,getDropdownProps:j,removeSelectedItem:M}=Az({selectedItems:t,onStateChange({selectedItems:e,type:t}){t===Az.stateChangeTypes.FunctionRemoveSelectedItem&&r(e)}}),{isOpen:N,getMenuProps:P,getInputProps:ee,getItemProps:F,highlightedIndex:te,setHighlightedIndex:ne}=iz({environment:c?k(c):void 0,items:C,isItemDisabled(e){return!!e?.disabled},itemToKey(e){return e?.key??``},itemToString(e){return e?e.type===`airport`?D(e):e.name??``:``},defaultHighlightedIndex:0,selectedItem:null,inputValue:u,stateReducer(e,t){let{changes:n,type:r}=t;switch(r){case iz.stateChangeTypes.InputKeyDownEnter:case iz.stateChangeTypes.ItemClick:case iz.stateChangeTypes.InputKeyDownArrowDown:case iz.stateChangeTypes.InputKeyDownArrowUp:case iz.stateChangeTypes.InputBlur:case iz.stateChangeTypes.InputKeyDownEscape:return n;case iz.stateChangeTypes.ItemMouseMove:return e;case iz.stateChangeTypes.FunctionCloseMenu:return{...n,isOpen:!0};default:return n}},onStateChange({inputValue:e,type:t,selectedItem:n}){switch(t){case iz.stateChangeTypes.InputKeyDownEnter:case iz.stateChangeTypes.ItemClick:n&&(r([n]),d(``));break;case iz.stateChangeTypes.MenuMouseLeave:case iz.stateChangeTypes.ItemMouseMove:case iz.stateChangeTypes.InputKeyDownArrowDown:case iz.stateChangeTypes.InputKeyDownArrowUp:case iz.stateChangeTypes.InputBlur:case iz.stateChangeTypes.ControlledPropUpdatedSelectedItem:break;default:break}}}),re=(0,K.useMemo)(()=>{if(s)return`Field is locked.`;if(N&&C.length>0){let e=C.length;return`Suggestion list open, ${e} ${e===1?`option`:`options`}.`}return N&&C.length===0?u.trim()?`Suggestion list open, no matching options.`:`Suggestion list open, no options yet.`:`Suggestion list closed.`},[s,N,C.length,u]),ie=(0,K.useMemo)(()=>`Type to search airports and places. When the list is open, use arrow keys to move through suggestions and Enter to choose. Tab to selected locations above to remove them, or press Backspace in this field when it is empty.`,[]),ae=i?`${i}, search airports and places`:`Search airports and places`,oe=i?`${i} suggestions`:`Search results`,se=t.length===0?`No airport or place selected.`:(()=>{let e=t.map(e=>D(e));return`Selected ${t.length===1?`location`:`${t.length} locations`}: ${e.join(`, `)}.`})(),ce=[g,_,v].join(` `);(0,K.useEffect)(()=>{s&&queueMicrotask(()=>d(``))},[s]),(0,K.useLayoutEffect)(()=>{if(!N||C.length===0||!x)return;S();let e=f.current,t=e&&typeof ResizeObserver<`u`?new ResizeObserver(S):null;return e&&t?.observe(e),window.addEventListener(`scroll`,S,!0),window.addEventListener(`resize`,S),()=>{t?.disconnect(),window.removeEventListener(`scroll`,S,!0),window.removeEventListener(`resize`,S)}},[N,C.length,x,S]);let le=N&&C.length>0;(0,K.useEffect)(()=>{let e=c?.host;if(e instanceof HTMLElement&&!(!le||!x))return rU(e),()=>iU(e)},[le,c,x]);let ue=!!s;function de(e,t){e.pointerType===`touch`&&(e.preventDefault(),e.stopPropagation(),r([t]),d(``),n(``))}function fe(){let e=ee({...j(),id:h,role:`combobox`,"aria-autocomplete":`list`,"aria-expanded":N,"aria-controls":N?m:void 0,"aria-activedescendant":N&&te!=null&&te>-1?`${m}-${te}`:void 0,"aria-label":ae,onChange:e=>{let t=e.currentTarget.value;d(t),n(t)},onKeyDown:e=>{if(e.key===`Backspace`&&!u&&t.length>0&&!s){let e=t[t.length-1];M(e)}}});return(0,q.jsx)(`input`,{className:(0,J.default)(`aone:outline-none aone:disabled:bg-transparent aone:text-base aone:placeholder:text-gray-500`,{"aone:min-w-[120px] aone:max-w-[200px]":t.length>0,"aone:w-full":t.length===0}),placeholder:!ue&&t.length===0?a:``,...e,"aria-describedby":ce,disabled:ue})}let pe=(0,q.jsx)(`ul`,{...P(),ref:p,id:m,role:`listbox`,"aria-multiselectable":`true`,"aria-label":oe,tabIndex:-1,className:`aone:text-gray-900 aone:max-h-full aone:overflow-y-auto aone:overflow-x-hidden aone:focus:outline-none aone:focus:ring-2 aone:focus:ring-blue-500 aone:focus:ring-offset-2`,children:C.map((e,n)=>{if(e.type===`airport`){let r=e,i=(r.distance||0)*.621371,a=te===n,o=e.sectionIndex>-1&&!r.kayak_shimmed,s=!!t.find(t=>t.key===e.key),c=n+1;return(0,q.jsxs)(`li`,{...F({item:e,index:n,onPointerDown:t=>de(t,e),onMouseEnter:()=>ne(n)}),id:`${m}-${n}`,role:`option`,tabIndex:-1,"aria-selected":s,"aria-label":`Option ${c} - ${r.name}, ${T(r)}, ${E(r)}${o?`, ${i.toFixed(+(i<1))} miles away`:``}, ${s?`selected`:`not selected`}`,className:(0,J.default)({"aone:hover:bg-blue-100":!0,"aone:bg-blue-100":a,"aone:font-bold":a,"aone:shadow-sm aone:py-2 aone:px-2 aone:cursor-pointer":!0,"aone:pl-5 aone:border-l-4 aone:border-gray-500":e.sectionIndex>-1,"aone:grid aone:grid-cols-[26px_1fr_30px] aone:gap-1 aone:justify-start aone:items-center":!0,"aone:focus:outline-none aone:focus:ring-2 aone:focus:ring-blue-500 aone:focus:ring-offset-2":!0}),children:[(0,q.jsx)(yI,{className:`aone:w-6 aone:h-6 aone:-rotate-45 aone:text-gray-600`,icon:wA}),(0,q.jsxs)(`div`,{className:`aone:flex aone:flex-col aone:grow aone:gap-1 aone:overflow-hidden`,children:[(0,q.jsxs)(`div`,{className:`aone:gap-2 aone:flex aone:items-center aone:w-full`,children:[(0,q.jsx)(`span`,{className:`aone:flex-1 aone:min-w-0 aone:font-medium aone:text-base aone:text-gray-900 aone:whitespace-nowrap aone:overflow-hidden aone:text-ellipsis`,children:r.name}),(0,q.jsx)(`span`,{className:`aone:text-sm aone:uppercase aone:shrink-0 aone:text-gray-600`,children:E(r)})]}),(0,q.jsxs)(`span`,{className:`aone:text-sm aone:text-gray-600`,children:[T(r),o&&(0,q.jsxs)(q.Fragment,{children:[`\xA0•\xA0`,i.toFixed(+(i<1)),`mi`]})]})]}),(0,q.jsx)(`div`,{className:`aone:flex aone:justify-end aone:pl-1`,"aria-hidden":`true`,children:(0,q.jsx)(`span`,{className:(0,J.default)(`aone:h-4 aone:w-4 aone:shrink-0 aone:rounded-sm aone:border`,{"aone:border-gray-400 aone:bg-white":!s,"aone:border-primary aone:bg-primary":s})})})]},`${e.key}-${n}`)}if(e.type===`place`){let r=e,i=te===n,a=Kg(r.kayak?.apicode),o=w(r),s=!!t.find(t=>t.key===e.key);return(0,q.jsxs)(`li`,{...F({item:e,index:n,onPointerDown:t=>de(t,e),onMouseEnter:()=>ne(n)}),id:`${m}-${n}`,role:`option`,tabIndex:-1,"aria-selected":s,"aria-label":`${a?`${r.name}, ${a}, ${o}`:`${r.name}, ${o}`}, ${s?`selected`:`not selected`}`,className:(0,J.default)({"aone:hover:bg-blue-100":!0,"aone:bg-blue-100":i,"aone:font-bold":i,"aone:shadow-sm aone:py-2 aone:px-2 aone:cursor-pointer":!0,"aone:grid aone:grid-cols-[26px_1fr_30px] aone:gap-1 aone:justify-start aone:items-center":!0,"aone:focus:outline-none aone:focus:ring-2 aone:focus:ring-blue-500 aone:focus:ring-offset-2":!0}),children:[(0,q.jsx)(yI,{className:`aone:w-6 aone:h-6 aone:text-gray-600`,icon:DA}),(0,q.jsxs)(`div`,{className:`aone:flex aone:flex-col aone:grow aone:gap-1 aone:overflow-hidden`,children:[(0,q.jsxs)(`div`,{className:`aone:gap-2 aone:flex aone:items-end aone:w-full`,children:[(0,q.jsx)(`span`,{className:`aone:flex-1 aone:min-w-0 aone:font-medium aone:text-base aone:text-gray-900 aone:whitespace-nowrap aone:overflow-hidden aone:text-ellipsis`,children:r.name}),a&&(0,q.jsx)(`span`,{className:`aone:text-sm aone:uppercase aone:shrink-0 aone:text-gray-600`,children:a})]}),(0,q.jsx)(`span`,{className:`aone:text-sm aone:shrink-0 aone:text-gray-600`,children:o})]}),(0,q.jsx)(`div`,{className:`aone:flex aone:justify-end aone:pl-1`,"aria-hidden":`true`,children:(0,q.jsx)(`span`,{className:(0,J.default)(`aone:h-4 aone:w-4 aone:shrink-0 aone:rounded-sm aone:border`,{"aone:border-gray-400 aone:bg-white":!s,"aone:border-primary aone:bg-primary":s})})})]},`${e.key}-${n}`)}return null})});return(0,q.jsxs)(`div`,{className:`aone:w-full aone:h-full aone:relative aone:z-10`,"data-testid":l,role:`group`,"aria-disabled":s?!0:void 0,children:[(0,q.jsxs)(`div`,{ref:f,className:(0,J.default)({"aone:bg-white aone:text-gray-900 aone:rounded-lg aone:gap-2 aone:items-center aone:py-2 aone:px-3 aone:h-[44px] aone:box-border aone:w-full aone:overflow-hidden":!0,"aone:grid":!0,"aone:grid-cols-[24px_1fr]":t.length===0,"aone:grid-cols-[24px_auto_1fr]":t.length===1,"aone:grid-cols-[24px_auto_auto_1fr]":t.length===2,"aone:grid-cols-[24px_auto_auto_auto_1fr]":t.length===3,"aone:border-2 aone:border-gray-200 aone:focus-within:border-primary":!0,"aone:opacity-60 aone:cursor-not-allowed":!!s}),children:[o,t.map((e,n)=>(0,q.jsxs)(`span`,{...A({selectedItem:e,index:n}),"aria-label":`Selected location: ${D(e)}. Item ${n+1} of ${t.length}.`,className:(0,J.default)({"aone:bg-gray-200 aone:rounded aone:px-1 aone:focus:bg-gray-400 aone:whitespace-nowrap aone:text-ellipsis aone:shrink-0":!0,"aone:text-sm":t.length>0,"aone:flex aone:items-center":!0}),children:[(0,q.jsx)(`span`,{className:`aone:overflow-hidden aone:grow aone:font-medium`,children:D(e)}),!e.disabled&&(0,q.jsx)(`button`,{type:`button`,disabled:!!s||!!e.disabled,className:(0,J.default)(`aone:ml-2 aone:text-base aone:leading-[20px] aone:rounded aone:px-1 aone:transition-colors`,{"aone:hover:bg-gray-300 aone:focus-visible:outline-none aone:focus-visible:ring-2 aone:focus-visible:ring-offset-2 aone:focus-visible:ring-gray-400":!s&&!e.disabled,"aone:cursor-not-allowed aone:opacity-60":!!s}),"data-testid":`autocomplete-remove-item-button`,"aria-label":`Remove ${D(e)}`,onClick:t=>{t.stopPropagation(),!s&&M(e)},children:`×`})]},n)),(0,q.jsx)(`span`,{id:g,className:`aone:sr-only`,children:se}),(0,q.jsx)(`span`,{id:_,className:`aone:sr-only`,children:re}),(0,q.jsx)(`span`,{id:v,className:`aone:sr-only`,children:ie}),fe()]}),N&&C.length>0&&(x?(0,rS.createPortal)((0,q.jsx)(`div`,{className:`aone:bg-white aone:text-gray-900 aone:rounded-lg aone:overflow-hidden aone:shadow-md aone:p-0 aone:box-border`,style:y,children:pe}),x):(0,q.jsx)(`div`,{className:`aone:absolute aone:w-inherit aone:bg-white aone:text-gray-900 aone:mt-2 aone:rounded-lg aone:overflow-hidden aone:shadow-md aone:p-0 aone:z-10`,children:pe}))]})}var oU=100;function sU({items:e,selectedItems:t,onInputChange:n,onSelectedItemsChange:r,placeholder:i,icon:a,disabled:o,shadowRoot:s}){let[c,l]=(0,K.useState)(``),[u,d]=(0,K.useState)(!1),f=(0,K.useRef)(null),p=(0,K.useId)(),m=(0,K.useRef)(null),h=(0,K.useMemo)(()=>e=>{m.current&&clearTimeout(m.current),e.trim()&&d(!0),m.current=setTimeout(()=>{n(e),d(!1),m.current=null},300)},[n]),g=(0,K.useMemo)(()=>{if(!e||e.length===0)return[];let t=new Date(new Date().getTime()+720*60*60*1e3),n=new Set,r=e.reduce((e,r)=>{if(n.has(r.key))return e;let i=`routeStart`in r&&r.routeStart&&r.routeStart>t?{...r,isNewRoute:!0}:r;return n.add(r.key),[...e,i]},[]);if(c?.trim()){let e=c.toLowerCase().trim();r=r.filter(t=>{let n=t;return!!(n.iata_code?.toLowerCase().includes(e)||n.city?.toLowerCase().includes(e)||n.name?.toLowerCase().includes(e)||n.country_code?.toLowerCase().includes(e)||n.state?.toLowerCase().includes(e))}),r.sort((t,n)=>{let r=t,i=n,a=r.iata_code?.toLowerCase()||``,o=i.iata_code?.toLowerCase()||``,s=r.city?.toLowerCase()||``,c=i.city?.toLowerCase()||``,l=e.toLowerCase();return a===l&&o!==l?-1:o===l&&a!==l?1:a.startsWith(l)&&!o.startsWith(l)?-1:o.startsWith(l)&&!a.startsWith(l)?1:s.startsWith(l)&&!c.startsWith(l)?-1:c.startsWith(l)&&!s.startsWith(l)?1:a.includes(l)&&!o.includes(l)?-1:o.includes(l)&&!a.includes(l)?1:0})}else r=r.slice(0,250);return r.sort((e,t)=>{let n=e,r=t,i=n.city?.toLowerCase()||``,a=r.city?.toLowerCase()||``;if(i===a){let e=n.iata_code?.toLowerCase()||``,t=r.iata_code?.toLowerCase()||``;return e.localeCompare(t)}return i.localeCompare(a)}),r.slice(0,oU)},[c,e]),_=(0,K.useMemo)(()=>{let e={};return g.forEach((t,n)=>{if(t.type===`airport`){let r=t.city?.charAt(0).toUpperCase();r&&!e[r]&&(e[r]=n)}}),e},[g]),v=e=>{let t=_[e];if(t===void 0||!f.current)return;let n=f.current.querySelector(`ul`);if(!n)return;let r=n.children[t];if(!r)return;let i=n.getBoundingClientRect(),a=r.getBoundingClientRect(),o=n.scrollTop,s=a.top-i.top+o;n.scrollTo({top:s,behavior:`smooth`})},y=(0,K.useMemo)(()=>Array.from({length:26},(e,t)=>String.fromCharCode(65+t)),[]),b=(e,t)=>{e.preventDefault(),e.stopPropagation(),v(t)},x=e=>{let n=e;if(t.length>1)return n.iata_code||``;let r=n.country===`US`&&n.state?`, ${n.state}`:``;return`${n.city}${r} (${n.iata_code})`},S=e=>{let t=e.ownerDocument,n=typeof Proxy==`function`&&!Object.isSealed(new Proxy({},{})),r={document:t,addEventListener:t.addEventListener.bind(e),removeEventListener:t.removeEventListener.bind(e),Node:window.Node,Element:window.Element,HTMLElement:window.HTMLElement,SVGElement:window.SVGElement};return n?new Proxy(r,{get(e,t){return e[t]}}):r},{getSelectedItemProps:C,getDropdownProps:w,removeSelectedItem:T}=Az({selectedItems:t,onStateChange({selectedItems:e,type:t}){t===Az.stateChangeTypes.FunctionRemoveSelectedItem&&r(e)}}),{isOpen:E,getMenuProps:D,getInputProps:O,getItemProps:k,selectedItem:A}=iz({environment:s?S(s):void 0,items:g,itemToString:e=>e?x(e):``,defaultHighlightedIndex:0,selectedItem:null,inputValue:c,onStateChange({inputValue:e,type:t,selectedItem:n}){switch(t){case iz.stateChangeTypes.InputKeyDownEnter:case iz.stateChangeTypes.ItemClick:n&&(r([n]),l(``));break;case iz.stateChangeTypes.InputChange:{let t=e??``;l(t),h(t);break}case iz.stateChangeTypes.InputBlur:break}}}),j=!!o,M=t.length>0,N=(E||c.trim()&&g.length>0)&&g.length>10&&Object.keys(_).length>3,P=E||c.trim().length>0&&g.length>0;return(0,K.useEffect)(()=>{let e=s?.host;if(e instanceof HTMLElement&&P)return rU(e),()=>iU(e)},[P,s]),(0,q.jsxs)(`div`,{className:`aone:w-full aone:h-full aone:relative aone:z-10`,role:`group`,"aria-disabled":o?!0:void 0,children:[(0,q.jsxs)(`div`,{className:(0,J.default)({"aone:bg-white aone:text-gray-700 aone:rounded-lg aone:gap-2 aone:items-center aone:py-2 aone:px-3 aone:h-[44px] aone:box-border aone:w-full aone:overflow-hidden aone:grid":!0,"aone:grid-cols-[24px_1fr]":t.length===0,"aone:grid-cols-[24px_auto_1fr]":t.length===1,"aone:grid-cols-[24px_auto_auto_1fr]":t.length===2,"aone:grid-cols-[24px_auto_auto_auto_1fr]":t.length===3,"aone:border-2 aone:border-gray-200 aone:focus-within:border-primary":!0,"aone:opacity-60 aone:cursor-not-allowed":!!o}),children:[a,t.map((e,t)=>(0,q.jsxs)(`span`,{...C({selectedItem:e,index:t}),className:`aone:bg-gray-200 aone:rounded aone:px-1 aone:focus:bg-gray-400 aone:whitespace-nowrap aone:text-ellipsis aone:shrink-0 aone:text-sm aone:flex aone:items-center`,children:[(0,q.jsx)(`span`,{className:`aone:overflow-hidden aone:grow`,children:x(e)}),!e.disabled&&(0,q.jsx)(`button`,{type:`button`,disabled:!!o||!!e.disabled,className:(0,J.default)(`aone:ml-2 aone:text-base aone:leading-[20px] aone:rounded aone:px-1 aone:transition-colors`,{"aone:hover:bg-gray-300 aone:focus-visible:outline-none aone:focus-visible:ring-2 aone:focus-visible:ring-offset-2 aone:focus-visible:ring-gray-400":!o&&!e.disabled,"aone:cursor-not-allowed aone:opacity-60":!!o}),"aria-label":`Remove ${x(e)}`,"data-testid":`schedule-autocomplete-remove-item-button`,onClick:t=>{t.stopPropagation(),!o&&T(e)},children:`×`})]},t)),o&&(0,q.jsx)(`span`,{id:p,className:`aone:sr-only`,children:`Field is locked`}),(()=>{let e=O({...w({preventKeyAction:E}),onKeyDown:e=>{if(e.key===`Backspace`&&!c&&t.length>0&&!o){let e=t[t.length-1];T(e)}}});return(0,q.jsx)(`input`,{"aria-label":`autocomplete`,className:`aone:outline-none aone:disabled:bg-transparent aone:text-base`,placeholder:j?``:i,...e,"aria-describedby":o?p:void 0,readOnly:M,disabled:j})})()]}),(E||c.trim()&&g.length>0)&&(0,q.jsx)(`div`,{className:`aone:absolute aone:w-full aone:min-w-full aone:bg-white aone:text-gray-900 aone:mt-2 aone:rounded-lg aone:shadow-md aone:p-0 aone:z-10`,children:(0,q.jsx)(`div`,{className:`aone:relative aone:w-full aone:overflow-hidden`,children:(0,q.jsxs)(`div`,{...D({className:`aone:flex aone:flex-col aone:min-w-0 aone:overflow-hidden`}),children:[N&&(0,q.jsx)(`div`,{className:`aone:flex aone:flex-wrap aone:gap-x-0.5 aone:gap-y-1 aone:justify-center aone:border-b aone:border-gray-200 aone:bg-gray-50 aone:px-2 aone:py-1.5`,role:`navigation`,"aria-label":`Jump to results by letter`,children:y.map(e=>{let t=_[e]!==void 0;return(0,q.jsx)(`button`,{type:`button`,onClick:n=>t?b(n,e):void 0,className:(0,J.default)({"aone:min-w-5 aone:text-xs aone:font-medium aone:px-0.5 aone:py-0.5 aone:rounded aone:transition-colors aone:cursor-pointer aone:text-center aone:shrink-0 aone:leading-none":!0,"aone:text-gray-600 aone:hover:text-blue-600 aone:hover:bg-blue-50":t,"aone:text-gray-300 aone:cursor-default":!t}),"data-testid":`schedule-autocomplete-letter-${e.toLowerCase()}`,title:t?`Jump to ${e}`:`No results for ${e}`,disabled:!t,children:e},e)})}),(0,q.jsx)(`div`,{className:`aone:min-w-0`,ref:f,children:(0,q.jsxs)(`ul`,{className:`aone:text-gray-900 aone:max-h-[600px] aone:overflow-y-auto aone:overflow-x-hidden aone:w-full`,children:[u&&(0,q.jsx)(`li`,{className:`aone:py-4 aone:px-3 aone:text-center aone:text-gray-500`,children:(0,q.jsxs)(`div`,{className:`aone:flex aone:items-center aone:justify-center aone:gap-2`,children:[(0,q.jsx)(`div`,{className:`aone:animate-spin aone:rounded-full aone:h-4 aone:w-4 aone:border-b-2 aone:border-primary`}),(0,q.jsx)(`span`,{children:`Searching airports...`})]})}),!u&&g.length>0&&g.map((e,n)=>{let r=e;return(0,q.jsxs)(`li`,{...k({item:e,index:n}),className:(0,J.default)({"aone:shadow-sm aone:py-2 aone:pl-3 aone:pr-2 aone:cursor-pointer aone:grid aone:grid-cols-[26px_1fr_40px] aone:gap-2 aone:justify-start aone:items-center aone:relative":!0,"aone:font-bold":A===e}),children:[(0,q.jsx)(`div`,{className:`aone:w-6 aone:h-6 aone:relative aone:flex aone:items-center aone:justify-center`,children:r.airlineCodes&&r.airlineCodes.length>0&&(0,q.jsx)(q.Fragment,{children:r.airlineCodes.length===1?(0,q.jsx)(`img`,{src:`https://content.r9cdn.net/rimg/provider-logos/airlines/v/${r.airlineCodes[0]}.png`,alt:r.airlineCodes[0],className:`aone:w-6 aone:h-6 aone:object-contain`},r.airlineCodes[0]):(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(yI,{icon:CA,className:`aone:w-6 aone:h-6 aone:text-gray-600`,title:`${r.airlineCodes.length} airlines`}),(0,q.jsx)(`span`,{className:`aone:absolute aone:right-0 aone:bg-blue-600 aone:text-white aone:text-[9px] aone:font-semibold aone:leading-none aone:px-1 aone:py-0.5 aone:rounded-full aone:min-w-[16px] aone:h-[16px] aone:flex aone:items-center aone:justify-center aone:shadow-sm aone:border aone:border-white`,style:{bottom:`-8px`},title:`${r.airlineCodes.length} airlines`,children:r.airlineCodes.length})]})})}),(0,q.jsxs)(`div`,{className:`aone:flex aone:flex-col aone:grow aone:gap-1 aone:overflow-hidden`,children:[(0,q.jsx)(`div`,{className:`aone:gap-2 aone:flex aone:items-end`,children:(0,q.jsxs)(`span`,{className:(0,J.default)({"aone:font-medium aone:text-sm aone:text-gray-900 aone:whitespace-nowrap aone:overflow-hidden aone:text-ellipsis aone:shrink":!0}),children:[r.city,r.country_code===`US`&&r.state?`, ${r.state}`:``]})}),(0,q.jsxs)(`span`,{className:(0,J.default)({"aone:text-sm aone:text-gray-600":!0}),children:[r.iata_code,` -`,` `,r.stops===0?`Nonstop Flight`:`One Stop`,`routeStart`in r&&r.routeStart&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`br`,{}),(0,q.jsx)(`span`,{className:(0,J.default)({"aone:text-sm aone:font-bold aone:text-green-600 aone:whitespace-nowrap":!0}),children:e.isNewRoute?`Route Starts `+r.routeStart.toLocaleDateString(`en-US`,{month:`2-digit`,day:`2-digit`,year:`2-digit`}):``})]})]})]}),(0,q.jsx)(`div`,{className:`aone:flex aone:justify-end aone:pl-4`,children:(0,q.jsx)(`input`,{type:`checkbox`,className:`aone:h-4 aone:w-4 aone:shrink-0 aone:rounded-sm aone:border aone:border-gray-400 aone:bg-white`,defaultChecked:!!t.find(t=>t.key===e.key)})})]},`${e.key}-${n}`)}),!u&&g.length===0&&c.trim()&&(0,q.jsxs)(`li`,{className:`aone:shadow-sm aone:py-2 aone:pl-3 aone:pr-2 aone:grid aone:grid-cols-[26px_1fr_40px] aone:gap-2 aone:justify-start aone:items-center`,children:[(0,q.jsx)(`div`,{className:`aone:w-6 aone:h-6 aone:relative aone:flex aone:items-center aone:justify-center`,children:(0,q.jsx)(yI,{icon:wA,className:`aone:w-5 aone:h-5 aone:text-gray-300`})}),(0,q.jsxs)(`div`,{className:`aone:flex aone:flex-col aone:grow aone:gap-1 aone:overflow-hidden`,children:[(0,q.jsxs)(`span`,{className:`aone:font-medium aone:text-sm aone:text-gray-900 aone:whitespace-nowrap aone:overflow-hidden aone:text-ellipsis`,children:[`No airports found for`,(0,q.jsx)(`span`,{className:`aone:ml-1 aone:font-semibold`,children:c})]}),(0,q.jsx)(`span`,{className:`aone:text-sm aone:text-gray-600`,children:`Try a different search term`})]}),(0,q.jsx)(`div`,{className:`aone:flex aone:justify-end aone:pl-4`})]})]})})]})})})]})}function cU(...e){return rA(NO(e))}function lU({className:e,...t}){return(0,q.jsx)(qx,{role:`status`,"aria-label":`Loading`,className:cU(`aone:size-4 aone:animate-spin`,e),...t})}var uU=K.forwardRef(({open:e,onOpenChange:t,children:n,title:r,className:i,...a},o)=>{let s=(0,K.useRef)(null);return(0,K.useImperativeHandle)(o,()=>s.current),(0,K.useEffect)(()=>{let n=s.current;if(!n)return;e&&!n.open&&n.showModal(),!e&&n.open&&n.close();let r=()=>document.documentElement.style.overflow=`hidden`,i=()=>document.documentElement.style.removeProperty(`overflow`);e?r():i();let a=()=>{i(),t(!1)},o=e=>{e.preventDefault(),t(!1)};return n.addEventListener(`close`,a),n.addEventListener(`cancel`,o),()=>{n.removeEventListener(`close`,a),n.removeEventListener(`cancel`,o),i()}},[e,t]),(0,q.jsxs)(`dialog`,{ref:s,className:`ao-dialog ${i??``}`,...a,children:[r&&(0,q.jsx)(`h2`,{id:`ao-title`,className:`aone:text-lg aone:font-semibold`,children:r}),(0,q.jsx)(`div`,{className:`ao-dialog__body`,children:n})]})});uU.displayName=`TopLayerDialog`;function dU({...e}){return(0,q.jsx)(lT,{"data-slot":`dialog`,...e})}function fU({className:e,...t}){return(0,q.jsx)(uT,{"data-slot":`dialog-title`,className:iA(`aone:text-lg aone:leading-none aone:font-semibold`,e),...t})}function pU({...e}){return(0,q.jsx)(DO,{"data-slot":`popover`,...e})}function mU({className:e,align:t=`center`,sideOffset:n=4,portalContainer:r,...i}){return(0,q.jsx)(AO,{container:r,children:(0,q.jsx)(jO,{"data-slot":`popover-content`,align:t,sideOffset:n,className:iA(`aone:z-50 aone:w-72 aone:origin-(--radix-popover-content-transform-origin) aone:rounded-md aone:border aone:bg-popover aone:p-4 aone:text-popover-foreground aone:shadow-md aone:outline-hidden aone:data-[side=bottom]:slide-in-from-top-2 aone:data-[side=left]:slide-in-from-right-2 aone:data-[side=right]:slide-in-from-left-2 aone:data-[side=top]:slide-in-from-bottom-2 aone:data-[state=closed]:animate-out aone:data-[state=closed]:fade-out-0 aone:data-[state=closed]:zoom-out-95 aone:data-[state=open]:animate-in aone:data-[state=open]:fade-in-0 aone:data-[state=open]:zoom-in-95`,e),...i})})}function hU({...e}){return(0,q.jsx)(OO,{"data-slot":`popover-anchor`,...e})}var gU=768;function _U(){let[e,t]=K.useState(()=>typeof window<`u`&&window.innerWidth<gU);return K.useEffect(()=>{let e=window.matchMedia(`(max-width: ${gU-1}px)`),n=()=>{t(window.innerWidth<gU)};return e.addEventListener(`change`,n),()=>e.removeEventListener(`change`,n)},[]),e}var vU=`aone:text-[#16A34A]`,yU=`aone:text-[#5895F7]`;function bU({date:e,startDate:t,endDate:n,onChange:r,onHover:i,stops:a,onlyDirects:o,previewDate:s,referenceDates:c,minDate:l}){let u=hm(new Date),d=l||u,f=t?ym(e,t):!1,p=t&&n?mh(e,hm(t))&&hh(e,n):!1,m=n?ym(e,n):!1,h=hh(e,d),g=s&&!f&&!m?ym(e,s):!1,_=c?.filter(t=>ym(hm(e),hm(t.date)))||[],v=!1,y=o&&a!==0?null:a;return o&&a!==0&&(v=!0),(0,q.jsx)(`div`,{className:(0,J.default)({"aone:w-14 aone:h-14 aone:flex aone:flex-col aone:items-center aone:justify-start aone:cursor-pointer":!0,"aone:text-white":f||m,"aone:bg-gray-600 aone:rounded-sm":f||m,"aone:bg-gray-200":p&&!!t&&!!n,"aone:text-[#565656]":!f&&!m,"aone:ring-2 aone:ring-primary":g,"aone:ring-2 aone:ring-blue-500 aone:ring-opacity-75 aone:bg-blue-50":_.length>0&&!f&&!m,"aone:cursor-not-allowed":h||v,"aone:relative aone:hover:ring-2 aone:hover:ring-blue-500 aone:hover:rounded-sm":!h&&!v,"aone:relative aone:after:absolute aone:after:bg-gray-600 aone:after:top-0 aone:after:bottom-0 aone:after:left-0 aone:after:right-0 aone:after:rounded-sm":f,"aone:before:absolute aone:before:left-1/2 aone:before:right-0 aone:before:top-0 aone:before:bottom-0 aone:before:bg-gray-200":f&&!!n,"aone:rounded-none":p,"aone:relative aone:after:absolute aone:after:bg-gray-600 aone:after:top-0 aone:after:bottom-0 aone:after:left-0 aone:after:right-0 aone:after:rounded-sm aone:before:absolute aone:before:left-0 aone:before:right-1/2 aone:before:top-0 aone:before:bottom-0 aone:before:bg-gray-200":m}),role:`gridcell`,tabIndex:!h&&!v?0:-1,"aria-label":(()=>{let t=`${e.toLocaleDateString(`en-US`,{weekday:`long`})}, ${e.toLocaleDateString(`en-US`,{month:`long`})} ${e.getDate()}, ${e.getFullYear()}`;if(f?t+=`, selected as start date`:m?t+=`, selected as end date`:p?t+=`, within selected date range`:g&&(t+=`, preview date`),h?t+=`, not available (before minimum date)`:v&&(t+=`, not available (no direct flights)`),y===0?t+=`, direct flights available`:y===1&&(t+=`, one-stop flights available`),_.length>0){let e=_.map(e=>e.label).join(`, `);t+=`, reference dates: ${e}`}return t})(),"aria-selected":f||m||p,"aria-disabled":h||v,"data-preview":g?`true`:void 0,onClick:()=>{!h&&!v&&r(new Date(e))},onMouseOver:()=>{!h&&!v&&i(new Date(e))},onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&!h&&!v&&(t.preventDefault(),r(new Date(e)))},children:(0,q.jsxs)(`span`,{className:(0,J.default)({"aone:relative aone:z-20 aone:font-semibold aone:leading-[16px] aone:flex aone:flex-col aone:justify-start aone:items-center aone:gap-1 aone:pt-2":!0,"aone:opacity-50":h||v}),children:[(0,q.jsx)(`span`,{children:e.getDate()}),y===0&&(0,q.jsx)(`span`,{className:(0,J.default)({"aone:text-[9px] aone:font-light aone:leading-none aone:whitespace-nowrap":!0,[vU]:!0}),"aria-label":`Nonstop flights available`,children:`Nonstop`}),y===1&&(0,q.jsx)(`span`,{className:(0,J.default)({"aone:text-[9px] aone:font-light aone:leading-none aone:whitespace-nowrap":!0,[yU]:!0}),"aria-label":`One-stop flights available`,children:`1 Stop`}),_.map((e,t)=>(0,q.jsx)(`div`,{className:(0,J.default)({"aone:text-[10px] aone:font-light aone:text-blue-700 aone:leading-tight aone:bg-blue-100 aone:px-1 aone:rounded aone:whitespace-nowrap":!0}),"aria-label":`Reference date: ${e.label}`,children:e.label},`${e.label}-${t}`))]})})}function xU({origin:e,previewDate:t,initialDate:n,startDate:r,endDate:i,oneWay:a,onlyDirects:o,onMonthViewChange:s,onChange:c,flightCalendar:l,referenceDates:u,minDate:d}){let[f,p]=(0,K.useState)(Sm(n)),m=uh(f,`MMMM yyyy`),h=um(f),g=a?null:i;(0,K.useEffect)(()=>{r&&queueMicrotask(()=>p(Sm(r)))},[r]),(0,K.useEffect)(()=>{t&&queueMicrotask(()=>p(Sm(t)))},[t]),(0,K.useEffect)(()=>{let e=um(f);s(e,am(e,42))},[f,s]);let _=Array(42).fill(0).map((e,t)=>am(h,t));return(0,q.jsxs)(`div`,{className:`aone:w-max aone:max-[767px]:w-full aone:text-[14px] aone:max-w-[100vw] aone:md:px-2 aone:md:pt-2 aone:lg:m-2`,role:`application`,"aria-label":`Calendar`,children:[(0,q.jsx)(`div`,{className:`aone:px-3 aone:py-1 aone:md:px-4 aone:md:py-2 aone:flex aone:gap-4`,children:(0,q.jsxs)(`div`,{className:`aone:flex aone:flex-grow aone:justify-between aone:items-center aone:text-gray-700`,children:[(0,q.jsx)(`button`,{type:`button`,className:`aone:w-8 aone:h-8 aone:bg-white aone:rounded-full aone:flex aone:items-center aone:justify-center aone:text-gray-700 aone:p-0`,onClick:()=>p(Og(f,{months:1})),"aria-label":`Previous month, go to ${uh(Og(f,{months:1}),`MMMM yyyy`)}`,"data-testid":`calendar-previous-month-button`,children:(0,q.jsx)(hA,{})}),(0,q.jsx)(`div`,{className:`aone:text-base aone:font-bold aone:mx-2`,"aria-live":`polite`,"aria-label":`Current month: ${m}`,children:m}),(0,q.jsx)(`button`,{type:`button`,className:`aone:w-8 aone:h-8 aone:bg-white aone:rounded-full aone:flex aone:items-center aone:justify-center aone:text-gray-700 aone:p-0`,onClick:()=>p(sm(f,{months:1})),"aria-label":`Next month, go to ${uh(sm(f,{months:1}),`MMMM yyyy`)}`,"data-testid":`calendar-next-month-button`,children:(0,q.jsx)(gA,{})})]})}),(0,q.jsx)(`div`,{className:`aone:grid aone:grid-cols-7 aone:border-b`,role:`rowgroup`,"aria-label":`Weekday headers`,children:s_.map((e,t)=>(0,q.jsx)(`div`,{className:`aone:min-w-0 aone:w-full aone:md:w-10 aone:h-7 aone:md:h-8 aone:flex aone:items-center aone:justify-center aone:text-black aone:font-bold aone:text-[#5b5b5b] aone:text-[13px] aone:md:text-[16px]`,"aria-hidden":`true`,children:e},`${e}-${t}`))}),(0,q.jsx)(`div`,{className:`aone:grid aone:grid-cols-7 aone:grid-rows-6 aone:pt-1 aone:md:pt-2 aone:pb-4 aone:md:pb-2 `,role:`grid`,"aria-label":`Calendar for ${m}`,children:_.map(n=>{let i=uh(n,`yyyy-MM-dd`),a=l?.[i];return(0,q.jsx)(bU,{date:n,startDate:r,endDate:g,previewDate:t,onChange:c,onHover:()=>{},origin:e,onlyDirects:o,stops:a?.stops,flightState:a?.flightsState,referenceDates:u,minDate:d},n.toISOString())})})]})}function SU({message:e,className:t,buttonRef:n}){let r=(0,K.useId)(),[i,a]=(0,K.useState)(!1);return(0,q.jsxs)(`span`,{className:(0,J.default)(`aone:relative aone:inline-flex`,t),onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),children:[(0,q.jsx)(`button`,{type:`button`,ref:n,className:`aone:inline-flex aone:items-center aone:justify-center aone:h-4 aone:w-4 aone:cursor-pointer aone:rounded-sm aone:text-red-500 aone:focus:outline-none aone:focus:ring-2 aone:focus:ring-red-500 aone:focus:ring-offset-1`,"data-testid":`error-icon`,"aria-label":`Validation error: ${e}`,"aria-expanded":i,"aria-controls":r,"aria-describedby":i?r:void 0,onFocus:()=>a(!0),onBlur:()=>a(!1),onClick:()=>a(e=>!e),children:(0,q.jsx)(yI,{icon:EA,"aria-hidden":`true`,className:`aone:h-4 aone:w-4`})}),i&&(0,q.jsx)(`div`,{id:r,role:`tooltip`,className:`aone:absolute aone:z-20 aone:top-full aone:left-1/2 aone:-translate-x-1/2 aone:mt-2 aone:bg-red-600 aone:text-white aone:text-xs aone:rounded aone:px-2 aone:py-1 aone:whitespace-nowrap`,children:e})]})}var CU=e=>{let t=e.match(/\d+/g)??[];if(t.length===0)return null;let n=parseInt(t[0].slice(0,2),10);if(Number.isNaN(n)||n<1||n>12)return null;let r=t[1]?.slice(0,2),i=Number(r??`1`);(Number.isNaN(i)||i<1||i>31)&&(i=1);let a=new Date().getFullYear(),o=t[2],s=a;if(o){let e=parseInt(o,10);s=o.length<=2?2e3+e:e}let c=new Date(s,n-1,i);return xm(c)?hm(c):null},wU=/^\d{2}\/\d{2}\/\d{2}$/,TU=e=>e.toLocaleDateString(`en-US`,{year:`2-digit`,month:`2-digit`,day:`2-digit`}),EU=(e,t=``)=>{let n=e.length<t.length,r=e.replace(/\D/g,``).slice(0,8);if(!n&&e.endsWith(`/`)){let t=e.slice(0,-1).split(`/`);if(t.length===1){let e=t[0];if(e&&e.length===1)return`0${e}/`}if(t.length===2){let e=t[0],n=t[1];if(n&&n.length===1)return`${(e??``).padStart(2,`0`)}/${`0${n}`}/`}}if(r.length===1&&t===``&&!n&&parseInt(r,10)>=3)return`0${r}/`;if(e.indexOf(`/`)===1&&r.length>=1){let e=r.slice(0,1).padStart(2,`0`),t=r.slice(1);switch(t.length){case 0:return n?e:`${e}/`;case 1:return`${e}/${t}`;case 2:return n?`${e}/${t}`:`${e}/${t}/`;default:return`${e}/${t.slice(0,2)}/${t.slice(2).slice(-2).padStart(2,`0`)}`}}switch(r.length){case 0:return``;case 1:return r;case 2:return n?e:`${r}/`;case 3:{let e=r.slice(0,2),i=r.slice(2);return!n&&t.replace(/\D/g,``).length===2&&/^\d{2}\/$/.test(t)&&parseInt(i,10)>=4?`${e}/0${i}/`:`${e}/${i}`}case 4:{let e=r.slice(0,2),t=r.slice(2,4);return n?`${e}/${t}`:`${e}/${t}/`}default:return`${r.slice(0,2)}/${r.slice(2,4)}/${r.slice(4).slice(-2)}`}},DU=e=>{let t=e.trim();if(t===``)return``;let n=(t.match(/\d+/g)??[]).slice(0,3);if(n.length===0)return``;let r=n[0].slice(-2).padStart(2,`0`);if(n.length===1)return r;let i=n[1].slice(-2).padStart(2,`0`);return n.length===2?`${r}/${i}`:`${r}/${i}/${n[2].slice(-2).padStart(2,`0`)}`},OU=e=>{if(!wU.test(e))return null;let t=wg(e,`MM/dd/yy`,new Date);return xm(t)&&TU(hm(t))===e?hm(t):null};function kU({origin:e,destination:t,onChange:n,onMonthViewChange:r,oneWay:i,className:a,primaryColor:o,secondaryColor:s,startDateLabel:c=`Start Date`,endDateLabel:l=`End Date`,flightCalendar:u,flightCalendarStatus:d,onlyDirects:f,initialStartDate:p,initialEndDate:m,referenceDates:h,minDate:g,showButtons:_=!0}){let v=(0,K.useRef)(null),y=(0,K.useRef)(null),b=(0,K.useRef)(0),[x,S]=(0,K.useState)(null);(0,K.useLayoutEffect)(()=>{if(!v.current)return;let e=v.current.getRootNode();if(!(e instanceof ShadowRoot))return;let t=document.createElement(`div`);return e.appendChild(t),queueMicrotask(()=>S(t)),()=>{t.parentNode&&t.parentNode.removeChild(t)}},[]);let[C,w]=(0,K.useState)(``),[T,E]=(0,K.useState)(``),[D,O]=(0,K.useState)(null),[k,A]=(0,K.useState)(null),[j,M]=(0,K.useState)(p||null),[N,P]=(0,K.useState)(m||null),[ee,F]=(0,K.useState)(!1),[te,ne]=(0,K.useState)(p||null),[re,ie]=(0,K.useState)(!1),[ae,oe]=(0,K.useState)(!1),[se]=(0,K.useState)(()=>p||new Date),ce=(0,K.useRef)(n),le=()=>Date.now()<b.current,ue=()=>{le()||F(!0)},de=()=>{b.current=Date.now()+250,F(!1)},fe=e=>{if(e){ue();return}de()};(0,K.useEffect)(()=>{ce.current=n},[n]),(0,K.useEffect)(()=>{i&&queueMicrotask(()=>{P(null),E(``),A(null)})},[i]),(0,K.useEffect)(()=>{queueMicrotask(()=>{!j&&p&&M(p),!N&&m&&P(m)})},[p,m,j,N]);let pe=hm(new Date),me=om(pe,6),he=e=>{w(e);let t=OU(e);if(e===``||!e){O(null),M(null);return}if(!t){O(`Enter a date in MM/DD/YY format`),M(null);return}if(hh(t,pe)){O(`Date cannot be in the past`),M(null);return}if(mh(t,me)){O(`Date must be within 6 months`),M(null);return}if(g&&hh(t,g)){O(`Date must be no earlier than `+g.toLocaleDateString()),M(null);return}O(null),M(t),ne(t),N&&hh(N,t)&&(P(null),E(``))},ge=e=>{if(i)return;E(e);let t=OU(e);if(e===``||!e){A(null),P(null);return}if(!t){A(`Enter a date in MM/DD/YY format`),P(null);return}if(hh(t,pe)){A(`Date cannot be in the past`),P(null);return}if(mh(t,me)){A(`Date must be within 6 months`),P(null);return}if(!j){A(`Enter departure date first`),P(null);return}if(hh(t,j)){A(`Return date must be after departure`),P(null);return}if(g&&hh(t,g)){A(`Date must be no earlier than `+g.toLocaleDateString()),P(null);return}A(null),P(t),ne(t)},I=()=>he(C),_e=()=>ge(T),L=e=>{let t=e.getTime()<(j?.getTime()||0);j?!N&&t?M(e):N?j&&N&&(ym(e,j)&&ym(e,N)?(M(e),P(null)):hh(e,N)&&hh(e,am(j,3))?M(e):P(e)):i?M(e):P(e):M(e)},ve=()=>{M(null),P(null),w(``),E(``),O(null),A(null),ne(null),ce.current(null,null)};(0,K.useEffect)(()=>{ce.current(j,N)},[j,N]),(0,K.useEffect)(()=>{queueMicrotask(()=>{j?(w(TU(j)),O(null)):D||w(``)})},[j]),(0,K.useEffect)(()=>{queueMicrotask(()=>{N?(E(TU(N)),A(null)):k||E(``)})},[N]);let ye={};o&&(ye[`--color-primary`]=o),s&&(ye[`--color-secondary`]=s);let be=_U(),xe=(0,K.useId)(),Se=`${xe}-description`,Ce=(0,q.jsxs)(`div`,{ref:y,onClick:ue,className:(0,J.default)(`aone:relative aone:h-full aone:flex aone:flex-col aone:gap-4 aone:px-3 aone:py-2 aone:rounded-lg aone:bg-white aone:text-gray-700 aone:cursor-pointer`,`aone:@2xl:flex-row aone:@2xl:items-center`,{"aone:border-2 aone:border-primary":ee,"aone:border-2 aone:border-gray-200":!ee}),children:[(0,q.jsxs)(`fieldset`,{className:`aone:border-0 aone:p-0 aone:m-0 aone:@2xl:flex-1 aone:@2xl:pr-3`,children:[(0,q.jsx)(`legend`,{className:`aone:sr-only`,children:`Date range selection`}),(0,q.jsxs)(`div`,{className:`aone:flex aone:grow aone:items-center`,children:[(0,q.jsx)(`span`,{children:(0,q.jsx)(mA,{})}),(0,q.jsxs)(`div`,{className:`aone:relative aone:grow`,children:[(0,q.jsx)(`input`,{type:`text`,name:`start-date`,value:C,"aria-label":c,"aria-invalid":D?`true`:void 0,placeholder:re?`mm/dd/yy`:c,autoComplete:`off`,className:(0,J.default)(`aone:ml-2 aone:all-initial aone:focus:outline-none aone:disabled:bg-white aone:text-black aone:text-base aone:w-full aone:pr-1`,{"aone:text-red-500 ":!!D}),onChange:e=>{let t=EU(e.target.value,C);w(t),O(null),ne(CU(t)),ce.current(null,N)},onFocus:()=>{ie(!0),ue()},onBlur:e=>{let t=DU(e.target.value);w(t),he(t),ie(!1)},onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),I(),e.target.blur())}}),D&&(0,q.jsx)(`span`,{className:`aone:absolute aone:right-2 aone:top-1/2 aone:-translate-y-1/2`,children:(0,q.jsx)(SU,{message:D})})]})]})]}),!i&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`div`,{className:`aone:absolute aone:left-2 aone:right-2 aone:top-1/2 aone:@2xl:top-2 aone:@2xl:bottom-2 aone:@2xl:left-1/2 aone:rounded-lg aone:h-[2px] aone:@2xl:h-[initial] aone:@2xl:w-[2px] aone:bg-gray-200`}),(0,q.jsxs)(`fieldset`,{className:`aone:border-0 aone:p-0 aone:m-0 aone:@2xl:flex-1 aone:@2xl:pl-3`,children:[(0,q.jsx)(`legend`,{className:`aone:sr-only`,children:`Return date selection`}),(0,q.jsxs)(`div`,{className:`aone:flex aone:grow aone:items-center`,children:[(0,q.jsx)(`span`,{className:`aone:@2xl:hidden`,children:(0,q.jsx)(mA,{})}),(0,q.jsxs)(`div`,{className:`aone:relative aone:grow`,children:[(0,q.jsx)(`input`,{type:`text`,name:`end-date`,value:T,"aria-label":l,"aria-invalid":k?`true`:void 0,placeholder:ae?`mm/dd/yy`:l,autoComplete:`off`,className:(0,J.default)(`aone:ml-2 aone:focus:outline-none aone:disabled:bg-white aone:text-black aone:text-base aone:w-full aone:pr-7`,{"aone:text-red-500":!!k}),onChange:e=>{let t=EU(e.target.value,T);E(t),A(null),ne(CU(t)),ce.current(j,null)},onFocus:()=>{oe(!0),ue()},onBlur:e=>{let t=DU(e.target.value);E(t),ge(t),oe(!1)},onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),_e(),e.target.blur())}}),k&&(0,q.jsx)(`span`,{className:`aone:absolute aone:right-2 aone:top-1/2 aone:-translate-y-1/2`,children:(0,q.jsx)(SU,{message:k})})]})]})]})]})]});return(0,q.jsxs)(`div`,{id:`A1-DateRangePicker`,ref:v,className:a,style:ye,role:`group`,"aria-label":`Date range picker`,"aria-describedby":Se,children:[be?(0,q.jsxs)(dU,{open:ee,onOpenChange:fe,children:[Ce,(0,q.jsxs)(uU,{className:`ao-dialog--calendar-light`,open:ee,onOpenChange:fe,"aria-labelledby":xe,"aria-describedby":void 0,children:[(0,q.jsx)(fU,{id:xe,className:`aone:sr-only`,children:`Filter Options`}),(0,q.jsx)(xU,{origin:e,destination:t,initialDate:se,startDate:j,endDate:N,previewDate:te,onChange:L,onMonthViewChange:r,flightCalendar:u,flightCalendarStatus:d,onlyDirects:f,referenceDates:h,minDate:g},se.toISOString()),_&&(0,q.jsxs)(`div`,{className:`aone:mt-3 aone:flex aone:justify-between aone:items-center aone:pt-0 aone:pb-1 aone:md:pb-2 aone:px-1`,children:[(0,q.jsx)(`button`,{type:`button`,className:`aone:bg-slate-400 aone:text-white aone:text-[14px] aone:rounded-lg aone:px-4 aone:py-1 aone:ring-slate-500`,onClick:ve,"data-testid":`date-range-picker-reset-button`,children:`Reset`}),(0,q.jsx)(`button`,{type:`button`,className:`aone:bg-primary aone:text-white aone:text-[14px] aone:rounded-lg aone:px-4 aone:py-1 aone:ring-primary`,onClick:de,"data-testid":`date-range-picker-done-button`,children:`Done`})]})]})]}):(0,q.jsxs)(pU,{open:ee,onOpenChange:fe,children:[(0,q.jsx)(hU,{asChild:!0,children:Ce}),(0,q.jsxs)(mU,{side:`bottom`,align:`center`,sticky:`always`,avoidCollisions:!1,onOpenAutoFocus:e=>e.preventDefault(),onInteractOutside:e=>{let t=e.target;t&&y.current?.contains(t)&&e.preventDefault()},sideOffset:4,portalContainer:x,role:`dialog`,"aria-label":`Calendar for date selection`,"aria-describedby":`calendar-instructions`,className:`aone:w-max aone:max-w-[100vw] aone:max-h-[calc(100dvh-1.5rem)] aone:overflow-y-auto aone:p-0 aone:bg-white aone:border aone:border-gray-300 aone:rounded-xl aone:shadow-lg aone:md:mt-2 aone:pb-2`,children:[(0,q.jsx)(`div`,{id:`calendar-instructions`,className:`aone:sr-only`,children:`Use arrow keys to navigate dates. Press Enter or Space to select a date. Press Escape to close the calendar.`}),(0,q.jsx)(xU,{origin:e,destination:t,initialDate:se,startDate:j,endDate:N,previewDate:te,onChange:L,onMonthViewChange:r,flightCalendar:u,flightCalendarStatus:d,onlyDirects:f,referenceDates:h,minDate:g},se.toISOString()),_&&(0,q.jsxs)(`div`,{className:`aone:mt-3 aone:md:mt-0 aone:flex aone:justify-between aone:items-center aone:pt-0 aone:pb-1 aone:md:pb-2 aone:px-5`,children:[(0,q.jsx)(`button`,{type:`button`,className:`aone:bg-slate-400 aone:text-white aone:text-[14px] aone:rounded-lg aone:px-4 aone:py-1 aone:ring-slate-500`,onClick:ve,"data-testid":`date-range-picker-popover-reset-button`,children:`Reset`}),(0,q.jsx)(`button`,{type:`button`,className:`aone:bg-primary aone:text-white aone:text-[14px] aone:rounded-lg aone:px-4 aone:py-1 aone:ring-primary`,onClick:de,"data-testid":`date-range-picker-popover-done-button`,children:`Done`})]})]})]}),(0,q.jsx)(`div`,{id:Se,className:`aone:sr-only`,children:i?`Departure date input. Enter a date manually or open the calendar to pick one.`:`Departure and return date inputs. Enter dates manually or open the calendar to pick a date range.`})]})}var AU=ef({apiDomain:V(),locationId:V().optional(),origin:V().nullable().optional(),destination:V().nullable().optional(),destinations:V().optional(),primaryColor:V().optional(),secondaryColor:V().optional(),airlines:V().nullable().optional(),providers:V().nullable().optional(),workerUrl:V().optional(),theme:Cf([`dark`,`light`]).optional(),defaultNearbyDatesForLowerFares:U().optional(),shadowRoot:fp(e=>typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot).optional(),subscribingAirport:V().optional(),consentDataSharing:U().optional(),consentAnalytics:U().optional(),consentAdvertising:U().optional(),consentFunctional:U().optional(),onOriginChange:fp(e=>typeof e==`function`).optional(),onDestinationChange:fp(e=>typeof e==`function`).optional(),fmaDomain:V().optional(),hideBranding:U().optional(),hideCarButton:U().optional(),disableOrigins:U().optional(),disableDestinations:U().optional(),experimentId:V().optional(),autocompleteType:Cf(Qg).optional(),arrivalAirportLabel:V().optional(),departureAirportLabel:V().optional(),departureDateLabel:V().optional(),returnDateLabel:V().optional(),channel:Cf(zg).optional()}),jU=new tb;function MU(e){let t=``;for(let n=0;n<e.length;++n){let r=e[n];if(r){if(r.type===`place`){let e=r;e.iata_code?t+=e.iata_code:e.nearbyAirports&&e.nearbyAirports.length>0&&(t+=e.nearbyAirports[0].iata_code+`,nearby`)}r.type===`airport`&&(t+=r.iata_code),n<e.length-1&&e.length>1&&(t+=`,`)}}return t}function NU({apiDomain:e,origin:t,destination:n,airlines:r,providers:i,destinations:a,locationId:o,experimentId:s,departureDateLabel:c=`Departure Date`,returnDateLabel:l=`Return Date`,workerUrl:u=`https://worker-v2.flymyairport.com`,theme:d=`light`,channel:f,defaultNearbyDatesForLowerFares:p,shadowRoot:m,subscribingAirport:h,consentDataSharing:g=!0,consentAnalytics:_=!0,consentAdvertising:v=!0,consentFunctional:y=!0,onOriginChange:b=()=>{},onDestinationChange:x=()=>{},fmaDomain:S=`https://flymyairport.com`,hideBranding:C=!1,hideCarButton:w=!1,disableOrigins:T=!0,disableDestinations:E=!0,autocompleteType:D=Xg.kayak}){let[O,k]=(0,K.useState)({origins:[],destinations:[],startDate:null,endDate:null,oneWay:!1,defaultNearbyDatesForLowerFares:!!p}),{clickId:A}=Pv(),j=(0,K.useMemo)(()=>{let e=MU(O.origins);return b(e),e},[O.origins,b]),M=(0,K.useMemo)(()=>{let e=MU(O.destinations);return x(e),e},[O.destinations,x]),N=O.origins[0],P=O.destinations[0],ee=!!(N?.itemType===G.METRO&&N?.iata_code),F=!!(P?.itemType===G.METRO&&P?.iata_code);if(!Ug.safeParse(o).success)throw Error(`Unable to parse location id`);if(s&&s!==`0`&&s!==`1`)throw Error(`experimentId must be 0 or 1`);let te=t?.toLocaleUpperCase(),ne=n?.toLocaleUpperCase(),re=r?.split(`,`).map(e=>e.toLocaleUpperCase().trim()).filter(e=>e!==``),ie=i?.split(`,`).map(e=>e.toLocaleUpperCase().trim()).filter(e=>e!==``),ae=i===r&&i?.length===2&&r?.length===2,[oe,se]=(0,K.useState)(!1),ce=oe?!!ne:!!te,le=oe?!!te:!!ne,[ue,de]=(0,K.useState)(null),[fe,pe]=(0,K.useState)(null),me=(0,K.useMemo)(()=>O.origins?.length&&O.destinations?.length&&O.startDate?O.endDate&&O.oneWay===!1?!0:!(!O.endDate&&O.oneWay===!1):!1,[O]),he=e=>D===Xg.schedule_data?(0,q.jsx)(sU,{shadowRoot:m,icon:e.icon,placeholder:e.placeholder,disabled:e.disabled,items:e.items,selectedItems:e.selectedItems,onInputChange:e.onInputChange,onSelectedItemsChange:e.onSelectedItemsChange}):(0,q.jsx)(aU,{dataTestId:e.dataTestId,fieldLabel:e.fieldLabel,shadowRoot:m,icon:e.icon,placeholder:e.placeholder,disabled:e.disabled,items:e.items,selectedItems:e.selectedItems,onInputChange:e.onInputChange,onSelectedItemsChange:e.onSelectedItemsChange}),{data:ge,status:I,setQuery:_e}=kB({key:`origin-suggest`,apiDomain:e,airportIATA:M,providersArr:ie,airlinesArr:re,autocompleteType:D}),L=(0,K.useMemo)(()=>D===Xg.schedule_data?ge?.map((e,t)=>({...e,sectionIndex:t,type:`airport`,key:e.iata_code||`airport-${t}`}))||[]:(0,$H.default)(ge?.filter(e=>!!e.nearbyAirports?.length||e.itemType===G.METRO).map(e=>{let t=e.types.includes(`airport`);return[{...e,sectionIndex:0,type:t?`airport-place`:`place`,key:e.formatted_address},...e.nearbyAirports.map((e,n)=>({...e,itemType:G.AIRPORT,sectionIndex:t?-1:n,type:`airport`,key:`${e.iata_code}`}))]}).flat(),e=>e.key).filter((e,t,n)=>{if(e.type===`place`){let r=e;if(r.itemType===G.METRO&&r.iata_code)return!0;let i=n.at(t+1);if(!i||i.type!==`airport`)return!1}return!0}),[ge,D]),{data:ve,status:ye,setQuery:be}=kB({key:`destination-suggest`,apiDomain:e,airportIATA:j,providersArr:ie||[],airlinesArr:re||[],autocompleteType:D}),xe=(0,K.useMemo)(()=>D===Xg.schedule_data?ve?.map((e,t)=>({...e,sectionIndex:t,type:`airport`,key:e.iata_code||`airport-${t}`}))||[]:(0,$H.default)(ve?.filter(e=>!!e.nearbyAirports?.length||e.itemType===G.METRO).map(e=>{let t=e.types.includes(`airport`);return[{...e,sectionIndex:0,type:t?`airport-place`:`place`,key:e.formatted_address},...e.nearbyAirports.map((e,n)=>({...e,itemType:G.AIRPORT,sectionIndex:t?-1:n,type:`airport`,key:`${e.iata_code}`}))]}).flat(),e=>e.key).filter((e,t,n)=>{if(e.type===`place`){let r=e;if(r.itemType===G.METRO&&r.iata_code)return!0;let i=n.at(t+1);if(!i||i.type!==`airport`)return!1}return!0}),[ve,D]),Se=(0,K.useMemo)(()=>ue?vm([ue,new Date]):null,[ue]),Ce=(0,K.useMemo)(()=>O.startDate?am(O.startDate,1):null,[O.startDate]),we=(0,K.useMemo)(()=>({origin:j,destination:M,startDate:Se||void 0,endDate:fe||void 0,departureLocationType:ee?G.METRO:G.AIRPORT,arrivalLocationType:F?G.METRO:G.AIRPORT}),[j,M,Se,fe,ee,F]),Te=(0,K.useMemo)(()=>({origin:M,destination:j,startDate:Ce||void 0,endDate:fe||void 0,departureLocationType:F?G.METRO:G.AIRPORT,arrivalLocationType:ee?G.METRO:G.AIRPORT}),[M,j,Ce,fe,F,ee]),{data:Ee,status:De}=GB({apiDomain:e,params:we}),{data:Oe,status:ke}=GB({apiDomain:e,params:Te});(0,K.useEffect)(()=>{if(te&&DB({query:te,searchType:qg.Flights}).then(e=>{let t=e.find(e=>e.id.toLowerCase()===te.toLowerCase());if(t){let e={iata_code:t.id,city:t.cityonly,lat:t.lat,lng:t.lng,country_code:t.cc,name:t.displayname,itemType:t.isMetroOnly?G.METRO:G.AIRPORT};k(n=>({...n,origins:[{...e,type:`airport`,key:t.id,sectionIndex:-1,disabled:T}]}))}}),ne){let e=ne.split(`,`).map(e=>DB({query:e,searchType:qg.Flights}).then(t=>{let n=t.find(t=>t.id.toLowerCase()===e?.toLowerCase());return n?{iata_code:n.id,city:n.cityonly,lat:n.lat,lng:n.lng,country_code:n.cc,name:n.displayname,itemType:n.isMetroOnly?G.METRO:G.AIRPORT,type:`airport`,key:n.id,sectionIndex:-1,disabled:E}:null}));Promise.all(e).then(e=>{let t=e.filter(e=>e!==null);t.length>0&&k(e=>({...e,destinations:t}))})}},[te,ne,T,E]);let Ae=(0,K.useCallback)((e,n)=>{k({...O,startDate:e,endDate:n}),(e||n)&&Q_({name:`Flight Search - Date Range Change`,properties:{airport_iata:t||``,origin:j,desination:M,destination:M,departure_date:e?.toISOString(),return_date:n?.toISOString()}})},[O,t,j,M]),je=(0,K.useCallback)((e,t)=>{de(t=>t&&t.getTime()===e.getTime()?t:e),pe(e=>e&&e.getTime()===t.getTime()?e:t)},[]),Me=()=>{let{origins:e,destinations:t}=O;se(e=>!e),k({...O,origins:t,destinations:e})},Ne=e=>{e.preventDefault();let n=new FormData(e.currentTarget),r=Object.fromEntries(n.entries()),i=j,a=M,s=O.startDate,c=O.endDate,l=O.oneWay;if(!i||!a||!s||!c&&!l)throw Error(`All fields must be filled out`);let d=s.toISOString().split(`T`)[0],p=c?.toISOString().split(`T`)[0];if(r[`flexible-dates`]&&!ae){let e=`-flexible-3days`;d+=e,p+=e}let m=r.cabin,b=r.pax,x=p_({worker_domain:u,airport_iata:h||t||i,dep_iata:i||``,arr_iata:a+``||``,departDate:d||``,returnDate:p||``,cabin:m||void 0,pax:b||void 0,filterState:{providers:ie?.join(`,`),airlines:re?.join(`,`)},params:{enc_cid:A||``,enc_lid:Jg({airport:h||t||i,channel:f||`EMB`,action:`SEARCH`,userDefinedPage:o||`UNDEF`,originIATA:i,destinationIATA:a}),consent_data_sharing:g,consent_analytics:_,consent_advertising:v,consent_functional:y,departure_location_type:ee?G.METRO:G.AIRPORT,arrival_location_type:F?G.METRO:G.AIRPORT,from_url:encodeURIComponent(window?.location.href)}});Q_({name:`Flight Search - Search Button Clicked`,properties:{airport_iata:t||``,origin:j,desination:M,destination:M,departure_date:s?.toISOString(),return_date:O.endDate?.toISOString()}}),window.open(x,`_blank`)},R=[{display:`Roundtrip`,value:`roundtrip`},{display:`One-way`,value:`one-way`}],Pe=[{display:`Economy`,value:c_.enum.economy},{display:`Premium Economy`,value:c_.enum.premium},{display:`Business`,value:c_.enum.business},{display:`First`,value:c_.enum.first}],Fe=Array(9).fill(0).map((e,t)=>{let n=t+1;return{value:l_.options[t],display:`${n} Traveler${n>1?`s`:``}`}}),Ie=[`Flights`,...w?[]:[`Cars`]],Le=(0,K.useMemo)(()=>h&&ne?.includes(h)?`to`:`from`,[h,ne]),Re=(0,q.jsx)(`div`,{className:`aone:flex aone:rounded-md aone:items-center aone:justify-center aone:gap-2`,children:Ie.map((e,t)=>(0,q.jsx)(K.Fragment,{children:(0,q.jsx)(`a`,{href:t>0?`${S}/${Le}/${h}/${e.toLowerCase()}`:`#`,onClick:e=>{t===0&&e.preventDefault()},target:`_blank`,className:(0,J.default)({"aone:text-black aone:border-white aone:ring-1 aone:ring-white aone:focus-visible:outline-none aone:focus-visible:ring-2 aone:focus-visible:ring-white aone:dark:text-white aone:text-base aone:leading-tight aone:w-[96px] aone:text-center aone:px-4 aone:py-1":!0,"aone:@xl:hover:bg-secondary aone:grow-0":t>=1," aone:bg-transparent aone:rounded-lg aone:@xl:hover:text-black aone:dark:@xl:hover:text-white":t>=1,"aone:bg-primary aone:text-white aone:grow-0 aone:rounded-lg":t===0,"aone:justify-center aone:items-center":t===0}),children:e})},t))}),ze=(0,q.jsx)(nB,{hideByDefault:!0}),Be=(0,q.jsxs)(`div`,{className:`aone:@2xl:flex aone:@2xl:flex-row aone:pb-1 aone:items-center aone:justify-between`,children:[(0,q.jsx)(`div`,{className:`aone:flex aone:flex-col aone:@2xl:flex-row aone:items-center aone:@2xl:gap-2 aone:mb-2 aone:@2xl:mb-0`,children:(0,q.jsx)(`div`,{className:`aone:flex aone:justify-center aone:@2xl:justify-start aone:text-[35px] aone:text-foreground`,children:(0,q.jsx)(HB,{regMarkClassName:`aone:text-[16px] aone:ml-0.5 aone:leading-none`})})}),(0,q.jsx)(`div`,{className:(0,J.default)({"aone:hidden":!0,"aone:@2xl:justify-start aone:@2xl:flex aone:@2xl:w-[190px]":S!==``}),children:Re}),(0,q.jsx)(`div`,{className:`aone:block aone:@2xl:hidden`,children:Re}),(0,q.jsx)(`div`,{className:(0,J.default)({"aone:pb-0.5":!0,"aone:hidden aone:@2xl:flex aone:flex-col aone:items-center aone:@2xl:items-end aone:@2xl:w-[190px]":!0}),children:re&&re.length>0?null:(0,q.jsx)(`div`,{children:ze})})]});return(0,q.jsxs)(ib,{client:jU,children:[(0,q.jsx)(`div`,{"data-mode":d,style:{"--primary":`var(--color-primary-hsl, 210 100% 50%)`,"--secondary":`var(--color-secondary-hsl, 210 100% 50%)`},className:`aone:w-full aone:@container aone:relative`,children:(0,q.jsxs)(`form`,{className:`aone:flex aone:flex-col aone:gap-2`,onSubmit:Ne,children:[!C&&Be,(0,q.jsxs)(`div`,{className:`aone:flex aone:flex-wrap aone:justify-between aone:gap-4 aone:max-w-full aone:w-full`,children:[(0,q.jsxs)(`div`,{className:(0,J.default)({"aone:flex aone:gap-1 aone:@2xl:gap-4":!0}),children:[(0,q.jsx)(`select`,{"aria-label":`trip-option`,name:`trip-option`,className:`aone:text-foreground aone:text-base aone:bg-transparent aone:truncate aone:min-w-0 aone:w-full`,onChange:e=>{k(t=>({...t,oneWay:e.target.value===`one-way`}))},children:R.map((e,t)=>(0,q.jsx)(`option`,{className:`aone:dark:bg-black aone:dark:text-white aone:text-base`,value:e.value,children:e.display},`${e.value}-${t}`))}),(0,q.jsx)(`select`,{name:`pax`,"aria-label":`pax`,className:`aone:text-foreground aone:text-base aone:bg-transparent aone:truncate aone:min-w-0 aone:w-full`,children:Fe.map((e,t)=>(0,q.jsx)(`option`,{className:`aone:dark:bg-black aone:dark:text-white aone:text-base`,value:e.value,children:e.display},`${e.value}-${t}`))}),(0,q.jsx)(`select`,{name:`cabin`,"aria-label":`cabin`,className:`aone:text-foreground aone:text-base aone:bg-transparent aone:truncate aone:min-w-0 aone:w-full`,children:Pe.map((e,t)=>(0,q.jsx)(`option`,{className:`aone:dark:bg-black aone:dark:text-white aone:text-base`,value:e.value,children:e.display},`${e.value}-${t}`))})]}),!ae&&(0,q.jsxs)(`label`,{className:`aone:hidden aone:@5xl:flex aone:text-foreground aone:items-center aone:text-base`,children:[(0,q.jsx)(`input`,{type:`checkbox`,name:`flexible-dates`,defaultChecked:p}),`\xA0\xA0Show nearby dates for lower fares`]})]}),(0,q.jsxs)(`div`,{className:(0,J.default)({"aone:flex aone:flex-col aone:gap-6":!0,"aone:@5xl:grid aone:@5xl:grid-cols-2":!O.oneWay,"aone:@5xl:grid aone:@5xl:grid-cols-[3fr_400px]":O.oneWay}),children:[(0,q.jsxs)(`div`,{className:`aone:flex aone:flex-col aone:items-center aone:@xl:grid aone:@xl:grid-cols-[calc(50%-20px)_24px_calc(50%-20px)] aone:w-full aone:gap-2`,children:[(0,q.jsx)(`div`,{className:`aone:flex aone:items-center aone:w-full aone:relative aone:z-100`,children:he({dataTestId:`flight-search-form-origin`,fieldLabel:`Origin`,icon:I===`pending`?(0,q.jsx)(lU,{}):(0,q.jsx)(yI,{className:`aone:w-6 aone:h-6`,icon:CA,style:{width:`24px`,height:`24px`}}),placeholder:`From?`,disabled:ce,items:L||[],selectedItems:O.origins,onInputChange:e=>_e(e),onSelectedItemsChange:e=>{let n=T?e?.slice(0,1):e;Q_({name:`Flight Search - Origin Changed`,properties:{airport_iata:t||``,origin:j,desination:M,destination:M,departure_date:O.startDate?.toISOString(),return_date:O.endDate?.toISOString()}}),k(e=>({...e,origins:n||[]}))}})}),(0,q.jsx)(`button`,{type:`button`,className:`aone:w-6 aone:text-gray-900 aone:rotate-90 aone:@xl:rotate-0 aone:dark:text-gray-400`,onClick:Me,"aria-label":`Switch Origin and Destination`,"data-testid":`flight-search-switch-airports-button`,children:(0,q.jsx)(KB,{})}),(0,q.jsx)(`div`,{className:`aone:flex aone:items-center aone:w-full`,children:he({dataTestId:`flight-search-form-destination-autocomplete`,fieldLabel:`Destination`,icon:ye===`pending`?(0,q.jsx)(lU,{}):(0,q.jsx)(yI,{className:`aone:w-6 aone:h-6`,icon:xA,style:{width:`24px`,height:`24px`}}),placeholder:`To?`,disabled:le,items:xe||[],selectedItems:O.destinations,onInputChange:e=>be(e),onSelectedItemsChange:e=>{let n=E?e?.slice(0,1):e;Q_({name:`Flight Search - Destination Changed`,properties:{airport_iata:t||``,origin:j,desination:M,destination:M,departure_date:O.startDate?.toISOString(),return_date:O.endDate?.toISOString()}}),k(e=>({...e,destinations:n||[]}))}})})]}),(0,q.jsxs)(`div`,{className:(0,J.default)({"aone:flex aone:flex-col aone:items-center aone:gap-4":!0,"aone:@5xl:flex-row aone:@5xl:items-end aone:@5xl:gap-4":!0,grow:!0}),children:[(0,q.jsx)(`div`,{className:`aone:w-full aone:@5xl:flex-1 aone:@5xl:min-w-0`,children:(0,q.jsx)(kU,{origin:j,destination:M,startDateLabel:c,endDateLabel:l,onChange:Ae,onMonthViewChange:je,oneWay:O.oneWay,shadowRoot:m,onlyDirects:ie&&re&&ie?.length>0&&re?.length>0,flightCalendar:!O.startDate||O.oneWay?Ee:Oe,flightCalendarStatus:!O.startDate||O.oneWay?De:ke})}),(0,q.jsxs)(`div`,{className:`aone:flex aone:flex-col aone:gap-6 aone:items-center aone:justify-center aone:@5xl:shrink-0`,children:[!ae&&(0,q.jsxs)(`label`,{className:`aone:text-foreground aone:text-base aone:flex aone:items-center aone:@5xl:hidden aone:gap-3`,children:[(0,q.jsx)(`input`,{type:`checkbox`,name:`flexible-dates`,defaultChecked:p}),(0,q.jsx)(`span`,{children:`Show nearby dates for lower fares`})]}),(0,q.jsxs)(`button`,{"aria-label":me?`Search flights`:`Search flights - Please complete all required fields`,"aria-disabled":!me,tabIndex:0,type:`submit`,"data-testid":`flight-search-submit-button`,onClick:e=>{me||e.preventDefault()},className:`aone:h-[44px] aone:w-auto aone:min-w-[100px] aone:max-w-[200px] aone:rounded-lg aone:flex aone:align-center aone:items-center aone:gap-1 aone:px-4 aone:focus-visible:outline-none aone:focus-visible:ring-2 aone:focus-visible:ring-offset-2 aone:focus-visible:ring-offset-white aone:dark:focus-visible:ring-offset-black ${me?`aone:bg-green-500 aone:text-white aone:hover:bg-green-700 aone:active:bg-green-700 aone:focus-visible:ring-green-700 aone:dark:bg-green-600 aone:dark:hover:bg-green-800 aone:dark:active:bg-green-800 aone:dark:focus-visible:ring-green-600`:`aone:bg-gray-300 aone:text-gray-700 aone:cursor-not-allowed aone:dark:bg-gray-600 aone:dark:text-gray-300`}`,children:[(0,q.jsx)(AB,{}),(0,q.jsx)(`span`,{className:`aone:text-base`,children:`Search`})]})]})]})]})]})}),(0,q.jsx)(`div`,{className:`aone:visible aone:@2xl:hidden`,children:!C&&ze})]})}var PU=Object.keys(AU.shape);function FU(e,t,n){let r={...n};typeof r.destination!=`string`&&typeof r.destinations==`string`&&(r.destination=r.destinations),typeof r.destinations!=`string`&&typeof r.destination==`string`&&(r.destinations=r.destination),r.origin==null&&t?.iata&&(r.origin=t.iata.toUpperCase()),r.primaryColor==null&&t?.primaryColor&&(r.primaryColor=t.primaryColor),r.secondaryColor==null&&t?.secondaryColor&&(r.secondaryColor=t.secondaryColor);for(let t of PU){let n=zB(t).map(t=>e.getAttribute(t)).find(e=>e!==null&&e.trim()!==``);n!==void 0&&(r[t]=n)}return(r.subscribingAirport==null||typeof r.subscribingAirport==`string`&&r.subscribingAirport.trim()===``)&&t?.iata?.trim()&&(r.subscribingAirport=t.iata.trim().toUpperCase()),typeof r.defaultNearbyDatesForLowerFares==`string`&&(r.defaultNearbyDatesForLowerFares=BB(r.defaultNearbyDatesForLowerFares,!1)),typeof r.consentDataSharing==`string`&&(r.consentDataSharing=BB(r.consentDataSharing,!0)),typeof r.consentFunctional==`string`&&(r.consentFunctional=BB(r.consentFunctional,!0)),typeof r.consentAnalytics==`string`&&(r.consentAnalytics=BB(r.consentAnalytics,!0)),typeof r.consentAdvertising==`string`&&(r.consentAdvertising=BB(r.consentAdvertising,!0)),typeof r.hideCarButton==`string`&&(r.hideCarButton=BB(r.hideCarButton,!1)),r.consentAnalytics===void 0&&(r.consentAnalytics=!0),r.consentAdvertising===void 0&&(r.consentAdvertising=!0),r.consentFunctional===void 0&&(r.consentFunctional=!0),r.consentDataSharing===void 0&&(r.consentDataSharing=!0),r}function IU(e,t,n,r){return{...FU(e,n,r),apiDomain:t,...r.userStyleBlock?.trim()?{userStyleBlock:r.userStyleBlock}:{}}}var LU=new tb;function RU(e){let{userStyleBlock:t,...n}=e;return(0,q.jsx)(ib,{client:LU,children:(0,q.jsxs)(Tb,{useSessionStorageOnly:!0,children:[(0,q.jsx)(`style`,{children:Ab}),t?(0,q.jsx)(`style`,{children:t}):null,(0,q.jsx)(NU,{...n})]})})}function zU(e){if(!e||typeof e.iata!=`string`)return;let t=e.iata.trim().toUpperCase();return t.length===3?t:void 0}var BU=Object.keys(AU.shape),VU=[...new Set([...BU.flatMap(e=>zB(e)),`borderradius`,`border-radius`,`theme`,o_,`id`])],HU=class extends HTMLElement{_shadowRoot;_mountPoint;_reactRoot;_renderInProgress=!1;_renderQueued=!1;_renderScheduled=!1;_mountTelemetrySent=!1;_lastPublicConfigTelemetryKey=null;static get observedAttributes(){return Array.from(VU)}attributeChangedCallback(e,t,n){t!==n&&this.isConnected&&this._scheduleRender()}connectedCallback(){this.style.position=`relative`,this.style.zIndex=`10`,this.style.lineHeight=`1.5`,this.style.display=`flex`,this.style.flexDirection=`column`,this.style.background=`none`,this.style.backgroundColor=`transparent`,this._scheduleRender()}disconnectedCallback(){this._reactRoot&&=(this._reactRoot.unmount(),void 0),this._mountTelemetrySent=!1,this._lastPublicConfigTelemetryKey=null}_scheduleRender(){this._renderScheduled||(this._renderScheduled=!0,queueMicrotask(()=>{this._renderScheduled=!1,this.isConnected&&this._renderAsync()}))}async _renderAsync(){if(this._renderInProgress){this._renderQueued=!0;return}this._renderInProgress=!0;try{let e=A_(this),t=I_(),n=null,r=!1,i={attempted:!1,durationMs:0},a;if(e&&t){let t=await L_(e);i=t.metrics;let o=t.config;o?.widgetType&&o.widgetType!==`airfare-search`&&(console.warn(`[airport-one-widgets] Widget instance type does not match airfare-search:`,o.widgetType),a=`widget_type_mismatch`,o=null),n=o,r=!n,i.attempted&&n===null&&a===void 0&&i.failureKind&&(a=i.failureKind)}if(!this.isConnected)return;let o=G_(n),s=window[zp],c=IU(this,`https://flymyairport.vercel.app`,s,o),l=zU(n);l&&(c.subscribingAirport=l);let u=!i.attempted&&(!t||!e)?t?`no_instance_id`:`no_api_base`:void 0;if(c.consentAnalytics){let r=i.attempted?`attempt:${t}|${e}|${n===null?`fail`:`ok`}|${a??``}`:`skip:${u??`none`}`;r!==this._lastPublicConfigTelemetryKey&&(this._lastPublicConfigTelemetryKey=r,Wv(!0,{widget_runtime:`airfare-search`,attempted:i.attempted,duration_ms:i.durationMs,ok:i.attempted?n!==null:!1,error_kind:i.attempted&&n===null?a:void 0,skip_reason:u}))}r&&console.warn(`${M_}: airfare-search — managed instance config not applied; using host attributes and window defaults.`),this._paintAirfareSearch(c),c.consentAnalytics&&!this._mountTelemetrySent&&(this._mountTelemetrySent=!0,Gv(!0,{widget_runtime:`airfare-search`,public_config_unavailable:r}))}finally{this._renderInProgress=!1,this._renderQueued&&(this._renderQueued=!1,queueMicrotask(()=>{this.isConnected&&this._renderAsync()}))}}_paintAirfareSearch(e){let t=this._shadowRoot??=this.attachShadow({mode:`closed`}),n=this._mountPoint??=document.createElement(`span`);n.style.background=`none`,n.style.backgroundColor=`transparent`,n.parentNode!==t&&t.appendChild(n);let r={...e,shadowRoot:t},i=r.primaryColor!=null&&m_.test(r.primaryColor),a=r.secondaryColor!=null&&m_.test(r.secondaryColor),o=r.primaryColor??`210 100% 50%`,s=r.secondaryColor??`210 100% 50%`,c=i?__(o):o,l=a?__(s):s;this.style.setProperty(`--primary`,c),this.style.setProperty(`--secondary`,l),this.style.setProperty(`--color-primary`,`hsl(${c})`),this.style.setProperty(`--color-secondary`,`hsl(${l})`),this.style.setProperty(`--color-primary-hsl`,c),this.style.setProperty(`--color-secondary-hsl`,l);let u=this.getAttribute(`borderradius`)??this.getAttribute(`border-radius`);u?.trim()&&this.style.setProperty(`--radius`,VB(u)),r.theme===`dark`?this.setAttribute(`data-mode`,`dark`):this.removeAttribute(`data-mode`),(this._reactRoot??=T_.createRoot(n)).render((0,q.jsx)(RU,{...r}))}};customElements.get(`fma-airfare-search`)||customElements.define(`fma-airfare-search`,HU);var UU=new Map,WU=3600*1e3,GU=3600*12*1e3;function KU(){let e=Date.now(),t=e-WU,n=e+GU;return{scheduleWindowStartUtc:new Date(t).toISOString(),scheduleWindowEndUtcExclusive:new Date(n).toISOString()}}function qU(e){let t=e?.scheduleWindowStartUtc?.trim(),n=e?.scheduleWindowEndUtcExclusive?.trim();return t&&n?{scheduleWindowStartUtc:t,scheduleWindowEndUtcExclusive:n}:KU()}function JU(e){if(typeof e!=`object`||!e||Array.isArray(e))return null;let t={};for(let[n,r]of Object.entries(e)){if(!r||typeof r!=`object`||Array.isArray(r))return null;let e=r;if(typeof e.code!=`string`||typeof e.name!=`string`)return null;t[n]={code:e.code,name:e.name,iconUrl:typeof e.iconUrl==`string`?e.iconUrl:``,logoUrl:typeof e.logoUrl==`string`?e.logoUrl:``}}return t}function YU(e){if(e==null)return{};if(typeof e!=`object`||Array.isArray(e))return null;let t={};for(let[n,r]of Object.entries(e)){if(!r||typeof r!=`object`||Array.isArray(r))return null;let e=r.timezoneRegionName;if(typeof e!=`string`||!e.trim())return null;t[n]={timezoneRegionName:e.trim()}}return t}function XU(e){if(typeof e!=`object`||!e||Array.isArray(e))return null;let t=e;if(t.success!==!0)return null;let n=t.data;return typeof n!=`object`||!n||Array.isArray(n)?null:ZU(n)}function ZU(e){if(e.apiVersion!==3||typeof e.instanceId!=`string`||typeof e.iata!=`string`||e.mode!==`arrivals`&&e.mode!==`departures`&&e.mode!==`both`||!Array.isArray(e.arrivals)||!Array.isArray(e.departures)||typeof e.asOfUtc!=`string`)return null;let t=JU(e.airlines);if(!t)return null;let n=YU(e.airports);if(!n||!e.meta||typeof e.meta!=`object`||Array.isArray(e.meta)||typeof e.meta.lookbackEventsCap!=`number`||typeof e.meta.limitPerDirection!=`number`)return null;let r=e.meta,i=r.scheduleWindow,a;if(i!=null){if(typeof i!=`object`||Array.isArray(i))return null;let e=i;if(e.source!==`client`||typeof e.startUtc!=`string`||typeof e.endUtcExclusive!=`string`)return null;a={source:`client`,startUtc:e.startUtc,endUtcExclusive:e.endUtcExclusive}}return{apiVersion:3,instanceId:e.instanceId,iata:e.iata,mode:e.mode,asOfUtc:e.asOfUtc,arrivals:e.arrivals,departures:e.departures,airlines:t,airports:n,meta:{lookbackEventsCap:r.lookbackEventsCap,limitPerDirection:r.limitPerDirection,...a?{scheduleWindow:a}:{}}}}function QU(){return``}function $U(e,t){return`${e}\0${t.scheduleWindowStartUtc}\0${t.scheduleWindowEndUtcExclusive}`}function eW(e,t){let n=QU();if(!n||!e.trim())return Promise.resolve({data:null,metrics:{attempted:!1,durationMs:0}});let r=qU(t),i=$U(e,r),a=UU.get(i);if(a)return a;let o=`?${new URLSearchParams({scheduleWindowStartUtc:r.scheduleWindowStartUtc,scheduleWindowEndUtcExclusive:r.scheduleWindowEndUtcExclusive}).toString()}`,s=`${n}/widgets/v1/fids/widget-instances/${encodeURIComponent(e)}/flights${o}`,c=typeof performance<`u`&&typeof performance.now==`function`?performance.now():0,l=()=>typeof performance<`u`&&typeof performance.now==`function`?Math.round(performance.now()-c):0,u=(async()=>{try{let e=await fetch(s,{credentials:`omit`,mode:`cors`});if(!e.ok)return{data:null,metrics:{attempted:!0,durationMs:l(),failureKind:`http_error`}};let t;try{t=await e.json()}catch{return{data:null,metrics:{attempted:!0,durationMs:l(),failureKind:`invalid_json`}}}let n=XU(t);return n?{data:n,metrics:{attempted:!0,durationMs:l()}}:{data:null,metrics:{attempted:!0,durationMs:l(),failureKind:`parse_failed`}}}catch{return{data:null,metrics:{attempted:!0,durationMs:l(),failureKind:`network_error`}}}finally{UU.delete(i)}})();return UU.set(i,u),u}var tW={panelBackgroundColor:`#0c2748`,primaryTextColor:`#ffffff`,accentTextColor:`#f5d742`,mutedTextColor:`rgba(255, 255, 255, 0.7)`,headerIconTileBackgroundColor:`rgba(26, 58, 92, 0.95)`};function nW(e,t){let n=e[t];if(typeof n!=`string`)return;let r=n.trim();return r.length>0?r:void 0}function rW(e){let t={...tW};if(!e||typeof e!=`object`||Array.isArray(e))return t;let n=e;return{panelBackgroundColor:nW(n,`panelBackgroundColor`)??t.panelBackgroundColor,primaryTextColor:nW(n,`primaryTextColor`)??t.primaryTextColor,accentTextColor:nW(n,`accentTextColor`)??t.accentTextColor,mutedTextColor:nW(n,`mutedTextColor`)??t.mutedTextColor,headerIconTileBackgroundColor:nW(n,`headerIconTileBackgroundColor`)??t.headerIconTileBackgroundColor}}function iW(e){let t=e?.variables;if(!t||typeof t!=`object`||Array.isArray(t))return{...tW};let n=t.fids;if(!n||typeof n!=`object`||Array.isArray(n))return{...tW};let r=n.theme;return rW(r)}function aW(e){return`color-mix(in srgb, ${e.trim()} 18%, transparent)`}var oW={prefix:`fas`,iconName:`plane-landing-gear`,icon:[640,512,[],`e7bc`,`M249.8 74.4L401.7 240 552.3 240c30.9 0 56 25.1 56 56s-25.1 56-56 56l-450.6 0c-30.9 0-57.4-22.1-63-52.6l-19-104.6C18 185 25.5 176 35.5 176l17.3 0c7.3 0 14.2 3.3 18.7 9l44 55 103.5 0-51.6-154.9C163.9 74.7 171.6 64 182.5 64l43.7 0c9 0 17.5 3.8 23.6 10.4zM224.3 416a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm192-32a32 32 0 1 1 0 64 32 32 0 1 1 0-64z`]},sW={prefix:`fas`,iconName:`plane-departure`,icon:[576,512,[128747],`f5b0`,`M372 143.9L172.7 40.2c-8-4.1-17.3-4.8-25.7-1.7l-41.1 15c-10.3 3.7-13.8 16.4-7.1 25L200.3 206.4 100.1 242.8 40 206.2c-6.2-3.8-13.8-4.5-20.7-2.1L3 210.1c-9.4 3.4-13.4 14.5-8.3 23.1l53.6 91.8c15.6 26.7 48.1 38.4 77.1 27.8l12.9-4.7 0 0 398.4-145c29.1-10.6 44-42.7 33.5-71.8s-42.7-44-71.8-33.5L372 143.9zM32.2 448c-17.7 0-32 14.3-32 32s14.3 32 32 32l512 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-512 0z`]},cW={prefix:`fas`,iconName:`chevron-right`,icon:[320,512,[9002],`f054`,`M311.1 233.4c12.5 12.5 12.5 32.8 0 45.3l-192 192c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L243.2 256 73.9 86.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l192 192z`]},lW={prefix:`fas`,iconName:`chevron-down`,icon:[448,512,[],`f078`,`M201.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L224 338.7 54.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z`]};function uW(e){let t=e.trim();if(!t)return null;let n=!(/z\s*$/i.test(t)||/[+-]\d{2}:\d{2}\s*$/.test(t))&&/^\d{4}-\d{2}-\d{2}T/.test(t)?`${t}Z`:t,r=Date.parse(n);return Number.isNaN(r)?null:new Date(r)}var dW={kind:`on-time`};function fW(e){let t=Math.max(0,Math.round(e)),n=Math.floor(t/60),r=t%60,i=[];return n>0&&i.push(`${n} ${n===1?`hour`:`hours`}`),r>0&&i.push(`${r} ${r===1?`minute`:`minutes`}`),i.length===0?`0 minutes`:i.join(` `)}function pW(e){let t=e?.utc?.trim()||e?.local?.trim();if(!t)return null;let n=uW(t);return n?n.getTime():null}function mW(e){if(!e)return dW;let t=pW(e.estimated),n=pW(e.actual);if(t===null||n===null)return dW;let r=Math.round((n-t)/6e4);return Math.abs(r)<=15?dW:r>0?{kind:`delayed`,minutesDelta:r}:{kind:`early`,minutesDelta:-r}}function hW(e){return e.departureGatePunctuality??dW}function gW(e){return e.arrivalGatePunctuality??dW}function _W(e){if(e.kind===`on-time`)return`On-time`;let t=fW(e.minutesDelta);return e.kind===`early`?`${t} early`:`${t} late`}function vW(e){let t=e.direction===`departure`?hW(e):gW(e),n=t.kind===`on-time`?`on-time`:t.kind===`early`?`early`:`delayed`;return{text:_W(t),tone:n}}function yW(e,t){return e.kind===`on-time`?t.mutedTextColor:e.kind===`early`?`rgb(74, 222, 128)`:`rgb(251, 146, 60)`}function bW(e,t){return e===`on-time`?t.mutedTextColor:e===`early`?`rgb(74, 222, 128)`:e===`delayed`?`rgb(251, 146, 60)`:t.accentTextColor}function xW(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function SW(e){if(!e)return`—`;try{let t=uW(e);if(!t)return e;let n=new Date;if(xW(t,n))return t.toLocaleTimeString(void 0,{hour:`numeric`,minute:`2-digit`});let r={month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`};return t.getFullYear()!==n.getFullYear()&&(r.year=`numeric`),t.toLocaleString(void 0,r)}catch{return e}}function CW(e,t=new Date){let n=e?.trim();if(n)try{return new Intl.DateTimeFormat(`en-US`,{timeZone:n,timeZoneName:`short`}).formatToParts(t).find(e=>e.type===`timeZoneName`)?.value?.trim()||n}catch{return n}}function wW(e){return!!(e?.utc?.trim()||e?.local?.trim())}function TW(e){if(e)return e.actual?.utc?.trim()||e.actual?.local?.trim()||e.estimated?.utc?.trim()||e.estimated?.local?.trim()||e.scheduled?.utc?.trim()||e.scheduled?.local?.trim()||e.published?.utc?.trim()||e.published?.local?.trim()||void 0}function EW(e){if(e)return e.actual?.utc?.trim()||e.actual?.local?.trim()||e.estimated?.utc?.trim()||e.estimated?.local?.trim()||void 0}function DW(e){if(e)return SW(e)}function OW(e){let t=e.departure,n=e.arrival;if(!t&&!n)return null;let r=t?.airport?.iata??t?.airport?.fs??`—`,i=n?.airport?.iata??n?.airport?.fs??`—`,a=wW(t?.gateTime?.actual),o=wW(t?.runwayTime?.actual),s=wW(n?.runwayTime?.actual),c=wW(n?.gateTime?.actual),l=e.status?.toUpperCase()??``;l===`ACTIVE`&&(a=!0,o=!0),l===`LANDED`&&(a=!0,o=!0,s=!0);let u=null;return!a&&(wW(t?.gateTime?.estimated)||wW(t?.gateTime?.scheduled))?u=0:!o&&a&&wW(t?.runwayTime?.estimated)?u=1:!s&&o&&wW(n?.runwayTime?.estimated)?u=2:!c&&s&&wW(n?.gateTime?.estimated)&&(u=3),l===`ACTIVE`&&!s&&(u=2),l===`LANDED`&&s&&!c&&(u=3),[{key:`dep-gate`,title:`Gate out`,airport:r,complete:a,current:u===0,timeStr:DW(TW(t?.gateTime)),punctuality:hW(e)},{key:`dep-rwy`,title:`Takeoff`,airport:r,complete:o,current:u===1,timeStr:DW(EW(t?.runwayTime)),punctuality:mW(t?.runwayTime)},{key:`arr-rwy`,title:`Landing`,airport:i,complete:s,current:u===2,timeStr:DW(EW(n?.runwayTime)),punctuality:mW(n?.runwayTime)},{key:`arr-gate`,title:`Gate in`,airport:i,complete:c,current:u===3,timeStr:DW(TW(n?.gateTime)),punctuality:gW(e)}]}var kW={gridTemplateColumns:`repeat(4, minmax(0, 1fr))`,columnGap:6},AW=`aone:h-[3px] aone:min-w-0 aone:rounded-sm aone:self-center`,jW=22;function MW({row:e,theme:t,airports:n={}}){let r=OW(e);if(!r)return null;let i=r,a=t.accentTextColor,o=aW(t.primaryTextColor),s=t.mutedTextColor;function c(e){let t=i[e];return(0,q.jsxs)(`div`,{className:`aone:flex aone:min-w-0 aone:w-full aone:flex-row aone:items-center`,style:{minHeight:jW},children:[e===0?(0,q.jsx)(`div`,{className:`aone:min-w-0 aone:flex-1`,"aria-hidden":!0}):(0,q.jsx)(`div`,{className:AW,style:{flex:1,minWidth:0,backgroundColor:i[e-1].complete?a:o,opacity:i[e-1].complete?1:.45}}),u(t),e===3?(0,q.jsx)(`div`,{className:`aone:min-w-0 aone:flex-1`,"aria-hidden":!0}):(0,q.jsx)(`div`,{className:AW,style:{flex:1,minWidth:0,backgroundColor:i[e].complete?a:o,opacity:i[e].complete?1:.45}})]},`track-${t.key}`)}function l(e){let r=e.airport&&e.airport!==`—`?CW(n[e.airport.trim().toUpperCase()]?.timezoneRegionName):void 0;return(0,q.jsxs)(`div`,{className:`aone:flex aone:w-full aone:min-w-0 aone:flex-col aone:items-center aone:text-center`,children:[(0,q.jsx)(`div`,{className:`aone:text-base aone:font-semibold aone:leading-snug aone:whitespace-nowrap`,style:{color:t.primaryTextColor},children:e.title}),(0,q.jsx)(`div`,{className:`aone:mt-1 aone:text-sm aone:whitespace-nowrap`,style:{color:s},children:e.airport}),e.timeStr||r?(0,q.jsx)(`div`,{className:`aone:mt-1.5 aone:text-sm aone:tabular-nums aone:whitespace-nowrap`,style:{color:s},children:e.timeStr?(0,q.jsxs)(q.Fragment,{children:[e.timeStr,r?`\u00a0${r}`:null]}):r}):null,(0,q.jsx)(`div`,{className:`aone:mt-1 aone:max-w-full aone:text-[0.7rem] aone:font-semibold aone:leading-snug`,style:{color:yW(e.punctuality,t),overflowWrap:`break-word`,wordBreak:`normal`},children:_W(e.punctuality)})]})}function u(e){let n=e.key===`dep-rwy`?sW:e.key===`arr-rwy`?oW:null;if(n){let r=e.current?`3px solid ${a}`:`2px solid ${e.complete?a:o}`,i=e.complete?t.panelBackgroundColor:e.current?a:s;return(0,q.jsx)(`div`,{className:`aone:inline-flex aone:shrink-0 aone:box-border aone:items-center aone:justify-center aone:rounded`,style:{width:jW,height:jW,backgroundColor:e.complete?a:`transparent`,border:r},"aria-hidden":!0,children:(0,q.jsx)(yI,{icon:n,style:{width:15,height:15,color:i}})})}return(0,q.jsx)(`div`,{className:`aone:shrink-0 aone:box-border aone:rounded-full`,style:{width:jW,height:jW,backgroundColor:e.complete?a:`transparent`,border:e.current?`3px solid ${a}`:`2px solid ${e.complete?a:o}`},"aria-hidden":!0})}return(0,q.jsxs)(`div`,{className:`aone:mb-5 aone:box-border aone:w-full aone:max-w-full`,children:[(0,q.jsx)(`p`,{className:`aone:mb-3 aone:text-sm aone:font-semibold aone:tracking-[0.06em]`,style:{color:s},children:`Flight progress`}),(0,q.jsx)(`div`,{className:`aone:grid aone:w-full aone:items-center`,style:kW,children:[0,1,2,3].map(e=>c(e))}),(0,q.jsx)(`div`,{className:`aone:mt-3 aone:grid aone:min-h-0 aone:w-full aone:items-start`,style:kW,children:i.map(e=>(0,q.jsx)(`div`,{className:`aone:box-border aone:min-w-0 aone:max-w-full aone:px-0.5 aone:text-center`,children:l(e)},e.key))})]})}function NW(e){if(!e)return{gate:``,terminal:``};let t=e.gate,n=e.terminal;return{gate:typeof t==`string`?t.trim():typeof t==`number`&&Number.isFinite(t)?String(t).trim():``,terminal:typeof n==`string`?n.trim():typeof n==`number`&&Number.isFinite(n)?String(n).trim():``}}function PW(e,t){if(!t||!e?.airport)return!1;let n=e.airport.iata?.trim().toUpperCase()??``,r=e.airport.fs?.trim().toUpperCase()??``;return n===t||r===t}function FW(e){let{gate:t,terminal:n}=NW(e);return t.length>0||n.length>0}function IW(e,t){let n=t.trim().toUpperCase(),r=e.departure,i=e.arrival,a=PW(r,n),o=PW(i,n),s=!!(r?.airport&&i?.airport);if(e.direction===`departure`){if(a)return FW(r)?r:o&&FW(i)?i:r;if(!a&&o&&FW(i))return i;if(!s||!a&&!o&&!(r?.airport&&i?.airport)){if(FW(r))return r;if(FW(i))return i}return r??i}if(e.direction===`arrival`){if(o)return FW(i)?i:a&&FW(r)?r:i;if(!o&&a&&FW(r))return r;if(!s||!a&&!o&&!(r?.airport&&i?.airport)){if(FW(i))return i;if(FW(r))return r}return i??r}}function LW(e){let{gate:t,terminal:n}=NW(e),r=[];return t&&r.push(`Gate ${t}`),n&&r.push(`Terminal ${n}`),r.length>0?r.join(` · `):`—`}function RW(e){let t=e?.utc?.trim()||e?.local?.trim();return t?uW(t):null}function zW(e){return e?RW(e.published)??RW(e.scheduled):null}function BW(e){let t=e.departure?.gateTime,n=e.arrival?.gateTime;if(!t||!n)return null;let r=zW(t),i=zW(n);if(!r||!i)return null;let a=i.getTime()-r.getTime();return a>=0?a:null}function VW(e){let t=e.departure?.gateTime?.actual,n=e.arrival?.gateTime?.actual;if(!t||!n)return null;let r=RW(t),i=RW(n);if(!r||!i)return null;let a=i.getTime()-r.getTime();return a>=0?a:null}function HW(e){let t=Math.max(0,Math.round(e/6e4)),n=Math.floor(t/60),r=t%60;return n===0?`${t} min`:r===0?`${n}h`:`${n}h ${r}m`}var UW=36;function WW(e){if(!e)return`—`;try{let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString(void 0,{month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`})}catch{return e}}var GW=[`published`,`scheduled`,`estimated`,`actual`],KW=[`estimated`,`actual`];function qW(e){let t=uW(e);return t?t.toLocaleString(void 0,{month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`}):e}function JW(e){if(e.callsign?.trim())return!0;for(let t of[e.departure,e.arrival]){if(!t)continue;let e=t.gateTime;if(e)for(let t of GW){let n=e[t];if(n&&(t!==`scheduled`&&(n.utc||n.local)||t===`scheduled`&&n.local&&(!n.utc||n.local.trim()!==n.utc.trim())))return!0}let n=t.runwayTime;if(n?.estimated?.utc||n?.estimated?.local||n?.actual?.utc||n?.actual?.local)return!0}return!1}function YW(e){if(!e)return!1;let t=e.gateTime,n=e.runwayTime,r=t&&GW.some(e=>t[e]?.utc||t[e]?.local),i=n&&KW.some(e=>n[e]?.utc||n[e]?.local);return!!(r||i)}function XW({phaseLabel:e,pair:t,theme:n}){if(!t||!t.utc&&!t.local)return null;let r=t.local?.trim(),i=r&&r.length>0&&r!==t.utc?.trim();return(0,q.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`minmax(72px, 96px) 1fr`,gap:`4px 12px`,alignItems:`baseline`,fontSize:`1rem`},children:[(0,q.jsx)(`span`,{style:{color:n.mutedTextColor},children:e}),(0,q.jsxs)(`span`,{style:{color:n.primaryTextColor,wordBreak:`break-word`,overflowWrap:`break-word`},children:[t.utc?qW(t.utc):`—`,i?(0,q.jsxs)(`span`,{style:{color:n.mutedTextColor},children:[` · `,r]}):null]})]})}function ZW({title:e,leg:t,theme:n}){if(!t)return null;let r=t.gateTime,i=t.runwayTime,a=r&&GW.some(e=>r[e]?.utc||r[e]?.local),o=i&&KW.some(e=>i[e]?.utc||i[e]?.local);return!a&&!o?null:(0,q.jsxs)(`div`,{style:{marginBottom:0},children:[(0,q.jsx)(`div`,{style:{fontWeight:600,fontSize:`1rem`,marginBottom:8,color:n.accentTextColor},children:e}),a?(0,q.jsxs)(`div`,{style:{marginLeft:4,marginBottom:8},children:[(0,q.jsx)(`div`,{style:{fontSize:`1rem`,fontWeight:600,letterSpacing:`0.06em`,color:n.mutedTextColor,marginBottom:6},children:`Gate times`}),(0,q.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:4},children:GW.map(e=>(0,q.jsx)(XW,{phaseLabel:e.charAt(0).toUpperCase()+e.slice(1),pair:r?.[e],theme:n},e))})]}):null,o?(0,q.jsxs)(`div`,{style:{marginLeft:4},children:[(0,q.jsx)(`div`,{style:{fontSize:`1rem`,fontWeight:600,letterSpacing:`0.06em`,color:n.mutedTextColor,marginBottom:6},children:`Runway times`}),(0,q.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:4},children:KW.map(e=>(0,q.jsx)(XW,{phaseLabel:e.charAt(0).toUpperCase()+e.slice(1),pair:i?.[e],theme:n},e))})]}):null]})}function QW(e,t,n){let r=t.trim();if(!r)return e;let i=n[r.toUpperCase()]?.timezoneRegionName?.trim(),a=CW(i);return a?`${e} · ${r} · ${a}`:`${e} · ${r}`}function $W({row:e,theme:t}){let n=BW(e),r=VW(e);return n===null&&r===null?null:(0,q.jsxs)(`div`,{className:`aone:mb-5`,children:[(0,q.jsx)(`p`,{className:`aone:mb-2.5 aone:text-[0.8125rem] aone:font-semibold aone:uppercase aone:tracking-wider`,style:{color:t.mutedTextColor},children:`Gate to gate`}),(0,q.jsxs)(`div`,{className:`aone:flex aone:flex-col aone:gap-2 aone:text-[0.9375rem] aone:font-semibold`,children:[n===null?null:(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`span`,{style:{color:t.mutedTextColor},children:`Scheduled · `}),(0,q.jsx)(`span`,{style:{color:t.primaryTextColor},children:HW(n)})]}),r===null?null:(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`span`,{style:{color:t.mutedTextColor},children:`Actual · `}),(0,q.jsx)(`span`,{style:{color:t.primaryTextColor},children:HW(r)})]})]})]})}function eG({row:e,theme:t,operatingCarrierName:n,airports:r}){let i=e.departure?.airport?.iata??e.departure?.airport?.fs??``,a=e.arrival?.airport?.iata??e.arrival?.airport?.fs??``,o=YW(e.departure),s=YW(e.arrival),c=o&&s,l=e.operatingCarrier?.iata?.trim()||e.operatingCarrier?.fs?.trim()||null;return(0,q.jsxs)(`div`,{style:{paddingLeft:16,paddingRight:16,boxSizing:`border-box`},children:[e.callsign?.trim()?(0,q.jsxs)(`p`,{style:{fontSize:`1rem`,marginBottom:l?4:12,color:t.primaryTextColor},children:[(0,q.jsx)(`span`,{style:{color:t.mutedTextColor},children:`Callsign `}),e.callsign.trim()]}):null,l?(0,q.jsxs)(`p`,{style:{fontSize:`1rem`,marginTop:e.callsign?.trim()?0:void 0,marginBottom:12,color:t.primaryTextColor},children:[(0,q.jsxs)(`span`,{style:{color:t.mutedTextColor},children:[`Operating carrier`,` `]}),n?`${n} (${l})`:l]}):null,(0,q.jsxs)(`div`,{style:{marginBottom:20},children:[(0,q.jsx)(`p`,{style:{fontSize:`0.8125rem`,fontWeight:600,letterSpacing:`0.05em`,textTransform:`uppercase`,marginBottom:10,color:t.mutedTextColor},children:`Gate timing`}),(0,q.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:8,fontSize:`0.9375rem`,fontWeight:600},children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`span`,{style:{color:t.mutedTextColor},children:`Departure · `}),(0,q.jsx)(`span`,{style:{color:yW(hW(e),t),wordBreak:`break-word`,overflowWrap:`break-word`},children:_W(hW(e))})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`span`,{style:{color:t.mutedTextColor},children:`Arrival · `}),(0,q.jsx)(`span`,{style:{color:yW(gW(e),t),wordBreak:`break-word`,overflowWrap:`break-word`},children:_W(gW(e))})]})]})]}),(0,q.jsx)($W,{row:e,theme:t}),(0,q.jsx)(MW,{row:e,theme:t,airports:r}),(0,q.jsxs)(`div`,{style:{display:c?`grid`:`block`,gridTemplateColumns:c?`minmax(0, 1fr) minmax(0, 1fr)`:void 0,gap:c?24:0,alignItems:`start`},children:[(0,q.jsx)(ZW,{title:QW(`Departure`,i,r),leg:e.departure,theme:t}),(0,q.jsx)(ZW,{title:QW(`Arrival`,a,r),leg:e.arrival,theme:t})]})]})}function tG(e){let t=e.marketingCarrier??e.operatingCarrier;return t?.iata?t.iata:t?.fs?t.fs:``}function nG(e){let t=tG(e),n=e.flightNumber?.trim();return t&&n?`${t} ${n}`:n||e.flightId}function rG(e){let t=e.marketingCarrier??e.operatingCarrier;return t?.iata?.trim().toUpperCase()||(t?.fs?.trim().toUpperCase()??``)}function iG(e){return e?.iata?.trim().toUpperCase()||(e?.fs?.trim().toUpperCase()??``)}function aG(e,t){let n=rG(e);if(!n)return null;let r=t[n];if(!r)return null;let i=r.logoUrl?.trim(),a=r.iconUrl?.trim();return i||a||null}function oG(e,t){let n=rG(e);return n&&t[n]?.name?.trim()||null}function sG(e,t){let n=iG(e);return n&&t[n]?.name?.trim()||null}function cG(e){return e.direction===`departure`?e.arrival?.airport?.iata??e.arrival?.airport?.fs??`—`:e.departure?.airport?.iata??e.departure?.airport?.fs??`—`}function lG(e,t){return LW(IW(e,t))}function uG(e){let t=e.arrival?.baggage?.trim();return t&&t.length>0?t:`—`}function dG(e){return e.direction===`arrival`?e.arrival?.gateTime?.scheduled?.utc:e.departure?.gateTime?.scheduled?.utc}function fG(e,t){let n=e?.trim().toUpperCase()??``,r=t.accentTextColor,i=t.mutedTextColor,a=t.primaryTextColor;switch(n){case`CANCELLED`:return{label:`Cancelled`,dotStyle:{backgroundColor:`#fb923c`},textStyle:{color:`#fdba74`}};case`DIVERTED`:case`REDIRECTED`:return{label:n===`DIVERTED`?`Diverted`:`Redirected`,dotStyle:{backgroundColor:`#fbbf24`},textStyle:{color:`#fde68a`}};case`LANDED`:return{label:`Landed`,dotStyle:{backgroundColor:`#34d399`},textStyle:{color:a}};case`ACTIVE`:return{label:`En route`,dotStyle:{backgroundColor:`#34d399`},textStyle:{color:a}};case`SCHEDULED`:return{label:`Scheduled`,dotStyle:{backgroundColor:r},textStyle:{color:r}};case`UNKNOWN`:return{label:`Unknown`,dotStyle:{backgroundColor:i},textStyle:{color:i}};default:return e?{label:e.length<=20?e.charAt(0).toUpperCase()+e.slice(1).toLowerCase():e,dotStyle:{backgroundColor:r},textStyle:{color:r}}:{label:`—`,dotStyle:{backgroundColor:i},textStyle:{color:i}}}}function pG(e,t){let n=Math.max(e.dueAtMs-e.intervalStartMs,1);return Math.min(Math.max(t-e.intervalStartMs,0),n)/n*100}function mG({title:e,subtitle:t,headerPlaneIcon:n,theme:r,dataRefreshSchedule:i}){let a=i===null?``:`${i.intervalStartMs}-${i.dueAtMs}`,[o,s]=(0,K.useState)(()=>new Date);(0,K.useEffect)(()=>{let e=a?250:15e3,t=globalThis.setInterval(()=>s(new Date),e);return()=>globalThis.clearInterval(t)},[a]);let c=o.getTime(),l=o.toLocaleTimeString(void 0,{hour:`numeric`,minute:`2-digit`}),u=i===null?null:pG(i,c);return(0,q.jsxs)(`header`,{part:`fids-board-header`,style:{display:`flex`,alignItems:`flex-start`,gap:16,paddingLeft:20,paddingRight:20,paddingTop:20,paddingBottom:16,boxSizing:`border-box`,width:`100%`},children:[(0,q.jsx)(`div`,{style:{width:44,height:44,flexShrink:0,display:`flex`,alignItems:`center`,justifyContent:`center`,borderRadius:8,backgroundColor:r.headerIconTileBackgroundColor},"aria-hidden":!0,children:(0,q.jsx)(yI,{icon:n===`departure`?sW:oW,style:{width:22,height:22,color:r.accentTextColor}})}),(0,q.jsxs)(`div`,{style:{minWidth:0,flex:1},children:[(0,q.jsx)(`h2`,{part:`fids-board-title`,className:`aone:text-xl aone:font-bold aone:leading-tight aone:tracking-tight`,style:{color:r.accentTextColor,margin:0},children:e}),(0,q.jsxs)(`div`,{part:`fids-board-meta`,style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,gap:12,marginTop:6,flexWrap:`nowrap`},children:[(0,q.jsx)(`p`,{part:`fids-board-subtitle`,className:`aone:text-sm`,style:{color:r.primaryTextColor,opacity:.95,margin:0,minWidth:0},children:t}),(0,q.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,alignItems:`flex-end`,flexShrink:0,gap:6,minWidth:72},children:[(0,q.jsx)(`p`,{part:`fids-board-clock`,className:`aone:tabular-nums`,style:{margin:0,fontSize:`1.25rem`,fontWeight:600,color:r.accentTextColor,lineHeight:1},children:l}),u===null?null:(0,q.jsx)(`div`,{part:`fids-board-refresh-bar`,role:`progressbar`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.min(100,Math.round(u)),"aria-label":`Progress until flights refresh`,style:{width:`100%`,maxWidth:96,height:3,borderRadius:2,backgroundColor:aW(r.primaryTextColor),overflow:`hidden`},children:(0,q.jsx)(`div`,{style:{width:`${u}%`,height:`100%`,borderRadius:2,backgroundColor:r.accentTextColor}})})]})]})]})]})}function hG({rows:e,destinationColumnLabel:t,airlines:n,airports:r,theme:i,boardAirportIata:a,tableSection:o}){let s=aW(i.primaryTextColor),c=`aone:px-3 aone:py-2 aone:text-xs aone:font-semibold aone:uppercase aone:tracking-wide`,l=`aone:px-3 aone:py-3`,[u,d]=(0,K.useState)(()=>new Set),f={width:`100%`,maxWidth:`100%`,overflowX:`auto`,paddingLeft:20,paddingRight:20,paddingBottom:16,boxSizing:`border-box`},p={width:`100%`,maxWidth:`100%`,borderCollapse:`collapse`,textAlign:`left`,fontSize:`0.875rem`,lineHeight:1.4,tableLayout:`fixed`},m=o===`arrivals`,h=m?7:6;return(0,q.jsx)(`div`,{style:f,children:(0,q.jsxs)(`table`,{part:`fids-board-table`,style:p,children:[(0,q.jsxs)(`colgroup`,{children:[(0,q.jsx)(`col`,{style:{width:m?`32%`:`36%`}}),(0,q.jsx)(`col`,{style:{width:m?`11%`:`12%`}}),(0,q.jsx)(`col`,{style:{width:m?`9%`:`10%`}}),(0,q.jsx)(`col`,{style:{width:m?`12%`:`14%`}}),(0,q.jsx)(`col`,{style:{width:m?`8%`:`10%`}}),m?(0,q.jsx)(`col`,{part:`fids-board-col-baggage`,style:{width:`8%`}}):null,(0,q.jsx)(`col`,{style:{width:m?`20%`:`18%`}})]}),(0,q.jsx)(`thead`,{children:(0,q.jsxs)(`tr`,{style:{borderBottomWidth:1,borderBottomStyle:`solid`,borderBottomColor:s},children:[(0,q.jsx)(`th`,{className:c,style:{color:i.mutedTextColor},children:`Airline`}),(0,q.jsx)(`th`,{className:c,style:{color:i.mutedTextColor},children:`Status`}),(0,q.jsx)(`th`,{className:c,style:{color:i.mutedTextColor},children:t}),(0,q.jsx)(`th`,{className:c,style:{color:i.mutedTextColor},children:`Scheduled`}),(0,q.jsx)(`th`,{className:c,style:{color:i.mutedTextColor},children:`Gate / Terminal`}),m?(0,q.jsx)(`th`,{part:`fids-board-head-baggage`,className:c,style:{color:i.mutedTextColor},children:`Baggage`}):null,(0,q.jsx)(`th`,{className:c,style:{color:i.mutedTextColor,textAlign:`right`},children:`Flight status`})]})}),(0,q.jsx)(`tbody`,{children:e.length===0?(0,q.jsx)(`tr`,{children:(0,q.jsx)(`td`,{colSpan:h,className:`${l} aone:py-8 aone:text-center`,style:{color:i.mutedTextColor},children:`No flights in this view.`})}):e.map(e=>{let t=e.flightId,o=fG(e.status,i),c=oG(e,n),f=e.callsign?.trim()??``,p=sG(e.operatingCarrier,n),g=JW(e),_=u.has(t),v=vW(e);return(0,q.jsxs)(K.Fragment,{children:[(0,q.jsxs)(`tr`,{part:`fids-board-row`,style:{borderBottomWidth:1,borderBottomStyle:`solid`,borderBottomColor:s},children:[(0,q.jsx)(`td`,{className:l,style:{color:i.primaryTextColor,verticalAlign:`middle`,overflow:`hidden`,wordBreak:`break-word`},children:(0,q.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6,minHeight:UW},children:[g?(0,q.jsx)(`button`,{type:`button`,part:`fids-board-row-expand`,"aria-expanded":_,"aria-controls":`fids-detail-${t}`,id:`fids-expand-${t}`,"aria-label":_?`Collapse flight timing details`:`Expand flight timing details`,onClick:()=>{d(e=>{let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n})},style:{flexShrink:0,width:28,height:28,padding:0,margin:0,border:`none`,borderRadius:4,cursor:`pointer`,backgroundColor:i.headerIconTileBackgroundColor,color:i.accentTextColor,lineHeight:1,display:`inline-flex`,alignItems:`center`,justifyContent:`center`},children:(0,q.jsx)(yI,{"aria-hidden":!0,icon:_?lW:cW,style:{width:12,height:12}})}):(0,q.jsx)(`span`,{style:{width:28,flexShrink:0},"aria-hidden":!0}),(0,q.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,flex:1,minWidth:0},children:[(0,q.jsx)(`span`,{"aria-hidden":!0,className:`aone:inline-flex aone:h-[50px] aone:w-[100px] aone:shrink-0 aone:items-center aone:justify-center aone:overflow-hidden aone:bg-white aone:p-[5px]`,children:(()=>{let t=aG(e,n);return t?(0,q.jsx)(`img`,{src:t,alt:``,style:{maxWidth:`100%`,maxHeight:`100%`,width:`auto`,height:`auto`,objectFit:`contain`,display:`block`},loading:`lazy`,decoding:`async`}):null})()}),(0,q.jsxs)(`span`,{style:{display:`flex`,flexDirection:`column`,gap:4,minWidth:0,lineHeight:1.25},children:[c||f?(0,q.jsxs)(`span`,{part:`fids-board-row-airline-line`,style:{display:`flex`,flexWrap:`wrap`,alignItems:`baseline`,columnGap:6,rowGap:2,fontWeight:600,fontSize:`0.875rem`,color:i.primaryTextColor,minWidth:0},children:[c?(0,q.jsx)(`span`,{style:{fontWeight:600},children:c}):null,f?(0,q.jsx)(`span`,{part:`fids-board-row-callsign-inline`,className:`aone:tabular-nums`,title:`Callsign`,style:{fontWeight:500,fontSize:`0.8125rem`,color:i.mutedTextColor},children:c?`\u00b7 ${f}`:f}):null]}):null,(0,q.jsx)(`span`,{style:{fontSize:c||f?`0.8125rem`:`0.875rem`,color:c||f?i.mutedTextColor:i.primaryTextColor},children:nG(e)})]})]})]})}),(0,q.jsx)(`td`,{className:`${l} aone:min-w-0 aone:wrap-break-word`,part:`fids-board-row-gate-punctuality`,style:{verticalAlign:`middle`,fontSize:`0.8125rem`,fontWeight:600,color:bW(v.tone,i),lineHeight:1.25,wordBreak:`break-word`,overflowWrap:`break-word`},children:v.text}),(0,q.jsx)(`td`,{className:`${l} aone:font-medium`,style:{color:i.primaryTextColor,verticalAlign:`middle`},children:cG(e)}),(0,q.jsx)(`td`,{className:`${l} aone:tabular-nums`,style:{color:i.primaryTextColor,verticalAlign:`middle`},children:SW(dG(e))}),(0,q.jsx)(`td`,{className:l,style:{color:i.primaryTextColor,verticalAlign:`middle`},children:lG(e,a)}),m?(0,q.jsx)(`td`,{part:`fids-board-row-baggage`,className:l,style:{color:i.primaryTextColor,verticalAlign:`middle`},children:uG(e)}):null,(0,q.jsx)(`td`,{className:l,style:{verticalAlign:`middle`},children:(0,q.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`flex-end`,gap:8},children:[(0,q.jsx)(`span`,{className:`aone:text-sm aone:font-medium`,style:o.textStyle,children:o.label}),(0,q.jsx)(`span`,{className:`aone:inline-block aone:h-2 aone:w-2 aone:shrink-0 aone:rounded-full`,style:o.dotStyle,"aria-hidden":!0})]})})]}),g&&_?(0,q.jsx)(`tr`,{part:`fids-board-row-detail`,children:(0,q.jsx)(`td`,{colSpan:h,id:`fids-detail-${t}`,role:`region`,"aria-labelledby":`fids-expand-${t}`,className:l,style:{paddingTop:12,paddingBottom:16,paddingLeft:16,paddingRight:16,borderBottomWidth:1,borderBottomStyle:`solid`,borderBottomColor:s,borderLeftWidth:3,borderLeftStyle:`solid`,borderLeftColor:i.accentTextColor,backgroundColor:aW(i.primaryTextColor)},children:(0,q.jsx)(eG,{row:e,theme:i,operatingCarrierName:p,airports:r})})}):null]},t)})})]})})}function gG({modeLabel:e,airportLine:t,headerPlaneIcon:n,rows:r,endpointColumnLabel:i,airlines:a,airports:o,theme:s,dataRefreshSchedule:c,boardAirportIata:l}){return(0,q.jsxs)(`section`,{part:`fids-board-section`,className:`aone:mb-4 aone:overflow-hidden aone:rounded-xl last:aone:mb-0`,style:{width:`100%`,boxSizing:`border-box`,backgroundColor:s.panelBackgroundColor,boxShadow:`inset 0 1px 0 rgba(255,255,255,0.06)`},children:[(0,q.jsx)(mG,{title:e,subtitle:t,headerPlaneIcon:n,theme:s,dataRefreshSchedule:c}),(0,q.jsx)(hG,{rows:r,destinationColumnLabel:i,airlines:a,airports:o,theme:s,boardAirportIata:l,tableSection:n===`arrival`?`arrivals`:`departures`})]})}function _G({payload:e,loading:t,error:n,consentAnalytics:r,theme:i=tW,dataRefreshSchedule:a}){let o=`aone:font-sans aone:text-[15px] aone:leading-normal`;if(t&&!e)return(0,q.jsxs)(`div`,{part:`fids-board-root`,role:`status`,"aria-live":`polite`,"aria-busy":`true`,className:`${o} aone:rounded-xl aone:p-8`,style:{backgroundColor:i.panelBackgroundColor,color:i.mutedTextColor,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,gap:16},children:[(0,q.jsx)(`div`,{className:`aone:box-border aone:h-10 aone:w-10 aone:animate-spin aone:rounded-full aone:border-2 aone:border-solid`,style:{borderColor:aW(i.primaryTextColor),borderTopColor:i.accentTextColor},"aria-hidden":!0}),(0,q.jsx)(`p`,{className:`aone:m-0 aone:text-sm`,style:{color:i.mutedTextColor},children:`Loading flight information…`})]});if(n&&!e)return(0,q.jsx)(`div`,{part:`fids-board-root`,className:`${o} aone:rounded-xl aone:p-6 aone:text-center`,style:{backgroundColor:i.panelBackgroundColor,color:`#fdba74`},children:`Flight information is temporarily unavailable.`});if(!e)return(0,q.jsx)(`div`,{part:`fids-board-root`,className:`${o} aone:rounded-xl aone:p-6 aone:text-center`,style:{backgroundColor:i.panelBackgroundColor,color:i.mutedTextColor},children:`No flight data.`});let s=e.mode===`arrivals`||e.mode===`both`,c=e.mode===`departures`||e.mode===`both`,l=`(${e.iata})`,u=e.airlines,d=e.airports??{};return(0,q.jsxs)(`div`,{part:`fids-board-root`,className:o,style:{color:i.primaryTextColor,width:`100%`,maxWidth:`100%`,boxSizing:`border-box`},children:[c&&(0,q.jsx)(gG,{modeLabel:`Flight Departures`,airportLine:l,headerPlaneIcon:`departure`,rows:e.departures,endpointColumnLabel:`Destination`,airlines:u,airports:d,theme:i,dataRefreshSchedule:a,boardAirportIata:e.iata}),s&&(0,q.jsx)(gG,{modeLabel:`Flight Arrivals`,airportLine:l,headerPlaneIcon:`arrival`,rows:e.arrivals,endpointColumnLabel:`Origin`,airlines:u,airports:d,theme:i,dataRefreshSchedule:a,boardAirportIata:e.iata}),(0,q.jsxs)(`p`,{part:`fids-board-updated`,className:`aone:mt-3 aone:text-center aone:text-xs`,style:{color:i.mutedTextColor},children:[`Updated `,WW(e.asOfUtc),` · `,e.iata]})]})}function vG(e){return(0,q.jsx)(_G,{...e})}var yG=[`consent-analytics`,`consent-advertising`,`consent-functional`,o_,`id`],bG=12e4,xG=3e4;function SG(e,t){return e.getAttribute(t)?.trim().toLowerCase()===`true`}var CG=class extends HTMLElement{_shadow;_shadowStylesInjected=!1;_mount;_reactRoot;_renderInProgress=!1;_renderQueued=!1;_renderScheduled=!1;_pollTimer;_dataRefreshSchedule=null;_activeInstanceId=null;_mountTelemetrySent=!1;_lastPublicConfigTelemetryKey=null;_flightsCache=null;_flightsLoading=!0;_flightsError=!1;_resolvedTheme=tW;static get observedAttributes(){return Array.from(yG)}attributeChangedCallback(e,t,n){t!==n&&this.isConnected&&this._scheduleRender()}connectedCallback(){this.style.position=`relative`,this.style.zIndex=`10`,this.style.lineHeight=`1.5`,this.style.display=`flex`,this.style.flexDirection=`column`,this._scheduleRender()}disconnectedCallback(){this._clearPoll(),this._reactRoot&&=(this._reactRoot.unmount(),void 0),this._mountTelemetrySent=!1,this._lastPublicConfigTelemetryKey=null,this._activeInstanceId=null}_clearPoll(){this._pollTimer!==void 0&&(globalThis.clearTimeout(this._pollTimer),this._pollTimer=void 0),this._dataRefreshSchedule=null}_schedulePoll(){this._clearPoll();let e=bG+Math.floor(Math.random()*xG),t=Date.now();this._dataRefreshSchedule={intervalStartMs:t,dueAtMs:t+e},this._pollTimer=globalThis.setTimeout(()=>{this._pollTick()},e)}async _pollTick(){if(!this.isConnected)return;if(typeof document<`u`&&document.visibilityState===`hidden`){this._schedulePoll();return}let e=A_(this);if(!e||e!==this._activeInstanceId)return;let t=await eW(e);!this.isConnected||e!==this._activeInstanceId||(t.data?(this._flightsCache=t.data,this._flightsError=!1):this._flightsError=!0,this._flightsLoading=!1,this._schedulePoll(),this._paint())}_scheduleRender(){this._renderScheduled||(this._renderScheduled=!0,queueMicrotask(()=>{this._renderScheduled=!1,this.isConnected&&this._renderAsync()}))}async _renderAsync(){if(this._renderInProgress){this._renderQueued=!0;return}this._renderInProgress=!0;try{let e=A_(this),t=I_(),n=QU();e!==this._activeInstanceId&&(this._clearPoll(),this._activeInstanceId=e,this._flightsCache=null,this._flightsLoading=!0,this._flightsError=!1,this._resolvedTheme=tW),this._paint();let r=null,i={attempted:!1,durationMs:0},a;if(e&&t){let t=await L_(e);i=t.metrics;let n=t.config;n?.widgetType&&n.widgetType!==`fids-board`&&(console.warn(`[airport-one-widgets] Widget instance type does not match fids-board:`,n.widgetType),a=`widget_type_mismatch`,n=null),r=n,this._resolvedTheme=iW(r),i.attempted&&r===null&&a===void 0&&i.failureKind&&(a=i.failureKind)}else this._resolvedTheme=tW;if(!this.isConnected)return;let o=SG(this,`consent-analytics`),s=!i.attempted&&(!t||!e)?t?`no_instance_id`:`no_api_base`:void 0;if(o){let n=i.attempted?`attempt:${t}|${e}|${r===null?`fail`:`ok`}|${a??``}`:`skip:${s??`none`}`;n!==this._lastPublicConfigTelemetryKey&&(this._lastPublicConfigTelemetryKey=n,Wv(!0,{widget_runtime:`fids-board`,attempted:i.attempted,duration_ms:i.durationMs,ok:i.attempted?r!==null:!1,error_kind:i.attempted&&r===null?a:void 0,skip_reason:s}))}if(r===null&&e&&t&&console.warn(`${M_}: fids-board — managed instance config not applied or wrong type.`),e&&n){let t=await eW(e);if(!this.isConnected||e!==this._activeInstanceId)return;t.data?(this._flightsCache=t.data,this._flightsError=!1):this._flightsError=!0,this._flightsLoading=!1,this._schedulePoll()}else this._flightsLoading=!1,this._flightsError=!1,(!e||!n)&&(this._flightsCache=null);this._paint(),o&&!this._mountTelemetrySent&&(this._mountTelemetrySent=!0,Gv(!0,{widget_runtime:`fids-board`,public_config_unavailable:r===null&&!!t}))}finally{this._renderInProgress=!1,this._renderQueued&&(this._renderQueued=!1,queueMicrotask(()=>{this.isConnected&&this._renderAsync()}))}}_paint(){let e=this._shadow??=this.attachShadow({mode:`closed`});if(!this._shadowStylesInjected){let t=document.createElement(`style`);t.textContent=Ab,e.appendChild(t),this._shadowStylesInjected=!0}let t=this._mount??=document.createElement(`span`);t.parentNode!==e&&e.appendChild(t);let n=SG(this,`consent-analytics`);(this._reactRoot??=T_.createRoot(t)).render((0,q.jsx)(vG,{payload:this._flightsCache,loading:this._flightsLoading,error:this._flightsError,consentAnalytics:n,theme:this._resolvedTheme,dataRefreshSchedule:this._dataRefreshSchedule}))}};return customElements.get(`fma-fids-board`)||customElements.define(`fma-fids-board`,CG),e.AirfareContent=Lx,e.AirfareSearch=HU,e.CarfareSearch=LB,e.FidsBoardElement=CG,e})({});
|
|
650
|
+
If it declares any Font Awesome CSS pseudo-elements, they will not be rendered as SVG icons. Add crossorigin="anonymous" to the <link>, enable searchPseudoElementsFullScan for slower but more thorough DOM parsing, or suppress this warning by setting searchPseudoElementsWarnings to false.`)}}}catch(e){i.e(e)}finally{i.f()}if(!r.size)return;var p=Array.from(r).join(`, `);try{n=e.querySelectorAll(p)}catch{}}return new Promise(function(e,t){var r=oN(n).filter(kF).map(OF),i=RP.begin(`searchPseudoElements`);QP(),Promise.all(r).then(function(){i(),$P(),e()}).catch(function(){i(),$P(),t()})})}}var NF={hooks:function(){return{mutationObserverCallbacks:function(e){return e.pseudoElementsCallback=MF,e}}},provides:function(e){e.pseudoElements2svg=function(e){var t=e.node,n=t===void 0?tj:t;Q.searchPseudoElements&&MF(n)}}},PF=!1,FF={mixout:function(){return{dom:{unwatch:function(){QP(),PF=!0}}}},hooks:function(){return{bootstrap:function(){tF(mP(`mutationObserverCallbacks`,{}))},noAuto:function(){nF()},watch:function(e){var t=e.observeMutationsRoot;PF?$P():tF(mP(`mutationObserverCallbacks`,{observeMutationsRoot:t}))}}}},IF=function(e){return e.toLowerCase().split(` `).reduce(function(e,t){var n=t.toLowerCase().split(`-`),r=n[0],i=n.slice(1).join(`-`);if(r&&i===`h`)return e.flipX=!0,e;if(r&&i===`v`)return e.flipY=!0,e;if(i=parseFloat(i),isNaN(i))return e;switch(r){case`grow`:e.size+=i;break;case`shrink`:e.size-=i;break;case`left`:e.x-=i;break;case`right`:e.x+=i;break;case`up`:e.y-=i;break;case`down`:e.y+=i;break;case`rotate`:e.rotate+=i;break}return e},{size:16,x:0,y:0,flipX:!1,flipY:!1,rotate:0})},LF={mixout:function(){return{parse:{transform:function(e){return IF(e)}}}},hooks:function(){return{parseNodeAttributes:function(e,t){var n=t.getAttribute(`data-fa-transform`);return n&&(e.transform=IF(n)),e}}},provides:function(e){e.generateAbstractTransformGrouping=function(e){var t=e.main,n=e.transform,r=e.containerWidth,i=e.iconWidth,a={outer:{transform:`translate(${r/2} 256)`},inner:{transform:`${`translate(${n.x*32}, ${n.y*32}) `} ${`scale(${n.size/16*(n.flipX?-1:1)}, ${n.size/16*(n.flipY?-1:1)}) `} ${`rotate(${n.rotate} 0 0)`}`},path:{transform:`translate(${i/2*-1} -256)`}};return{tag:`g`,attributes:Z({},a.outer),children:[{tag:`g`,attributes:Z({},a.inner),children:[{tag:t.icon.tag,children:t.icon.children,attributes:Z(Z({},t.icon.attributes),a.path)}]}]}}}},RF={x:0,y:0,width:`100%`,height:`100%`};function zF(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return e.attributes&&(e.attributes.fill||t)&&(e.attributes.fill=`black`),e}function BF(e){return e.tag===`g`?e.children:[e]}pP([vN,hF,gF,_F,vF,NF,FF,LF,{hooks:function(){return{parseNodeAttributes:function(e,t){var n=t.getAttribute(`data-fa-mask`),r=n?rP(n.split(` `).map(function(e){return e.trim()})):ZN();return r.prefix||=XN(),e.mask=r,e.maskId=t.getAttribute(`data-fa-mask-id`),e}}},provides:function(e){e.generateAbstractMask=function(e){var t=e.children,n=e.attributes,r=e.main,i=e.mask,a=e.maskId,o=e.transform,s=r.width,c=r.icon,l=i.width,u=i.icon,d=fN({transform:o,containerWidth:l,iconWidth:s}),f={tag:`rect`,attributes:Z(Z({},RF),{},{fill:`white`})},p=c.children?{children:c.children.map(zF)}:{},m={tag:`g`,attributes:Z({},d.inner),children:[zF(Z({tag:c.tag,attributes:Z(Z({},c.attributes),d.path)},p))]},h={tag:`g`,attributes:Z({},d.outer),children:[m]},g=`mask-${a||aN()}`,_=`clip-${a||aN()}`,v={tag:`mask`,attributes:Z(Z({},RF),{},{id:g,maskUnits:`userSpaceOnUse`,maskContentUnits:`userSpaceOnUse`}),children:[f,h]},y={tag:`defs`,children:[{tag:`clipPath`,attributes:{id:_},children:BF(u)},v]};return t.push(y,{tag:`rect`,attributes:Z({fill:`currentColor`,"clip-path":`url(#${_})`,mask:`url(#${g})`},RF)}),{children:t,attributes:n}}}},{provides:function(e){var t=!1;ej.matchMedia&&(t=ej.matchMedia(`(prefers-reduced-motion: reduce)`).matches),e.missingIconAbstract=function(){var e=[],n={fill:`currentColor`},r={attributeType:`XML`,repeatCount:`indefinite`,dur:`2s`};e.push({tag:`path`,attributes:Z(Z({},n),{},{d:`M156.5,447.7l-12.6,29.5c-18.7-9.5-35.9-21.2-51.5-34.9l22.7-22.7C127.6,430.5,141.5,440,156.5,447.7z M40.6,272H8.5 c1.4,21.2,5.4,41.7,11.7,61.1L50,321.2C45.1,305.5,41.8,289,40.6,272z M40.6,240c1.4-18.8,5.2-37,11.1-54.1l-29.5-12.6 C14.7,194.3,10,216.7,8.5,240H40.6z M64.3,156.5c7.8-14.9,17.2-28.8,28.1-41.5L69.7,92.3c-13.7,15.6-25.5,32.8-34.9,51.5 L64.3,156.5z M397,419.6c-13.9,12-29.4,22.3-46.1,30.4l11.9,29.8c20.7-9.9,39.8-22.6,56.9-37.6L397,419.6z M115,92.4 c13.9-12,29.4-22.3,46.1-30.4l-11.9-29.8c-20.7,9.9-39.8,22.6-56.8,37.6L115,92.4z M447.7,355.5c-7.8,14.9-17.2,28.8-28.1,41.5 l22.7,22.7c13.7-15.6,25.5-32.9,34.9-51.5L447.7,355.5z M471.4,272c-1.4,18.8-5.2,37-11.1,54.1l29.5,12.6 c7.5-21.1,12.2-43.5,13.6-66.8H471.4z M321.2,462c-15.7,5-32.2,8.2-49.2,9.4v32.1c21.2-1.4,41.7-5.4,61.1-11.7L321.2,462z M240,471.4c-18.8-1.4-37-5.2-54.1-11.1l-12.6,29.5c21.1,7.5,43.5,12.2,66.8,13.6V471.4z M462,190.8c5,15.7,8.2,32.2,9.4,49.2h32.1 c-1.4-21.2-5.4-41.7-11.7-61.1L462,190.8z M92.4,397c-12-13.9-22.3-29.4-30.4-46.1l-29.8,11.9c9.9,20.7,22.6,39.8,37.6,56.9 L92.4,397z M272,40.6c18.8,1.4,36.9,5.2,54.1,11.1l12.6-29.5C317.7,14.7,295.3,10,272,8.5V40.6z M190.8,50 c15.7-5,32.2-8.2,49.2-9.4V8.5c-21.2,1.4-41.7,5.4-61.1,11.7L190.8,50z M442.3,92.3L419.6,115c12,13.9,22.3,29.4,30.5,46.1 l29.8-11.9C470,128.5,457.3,109.4,442.3,92.3z M397,92.4l22.7-22.7c-15.6-13.7-32.8-25.5-51.5-34.9l-12.6,29.5 C370.4,72.1,384.4,81.5,397,92.4z`})});var i=Z(Z({},r),{},{attributeName:`opacity`}),a={tag:`circle`,attributes:Z(Z({},n),{},{cx:`256`,cy:`364`,r:`28`}),children:[]};return t||a.children.push({tag:`animate`,attributes:Z(Z({},r),{},{attributeName:`r`,values:`28;14;28;28;14;28;`})},{tag:`animate`,attributes:Z(Z({},i),{},{values:`1;0;1;1;0;1;`})}),e.push(a),e.push({tag:`path`,attributes:Z(Z({},n),{},{opacity:`1`,d:`M263.7,312h-16c-6.6,0-12-5.4-12-12c0-71,77.4-63.9,77.4-107.8c0-20-17.8-40.2-57.4-40.2c-29.1,0-44.3,9.6-59.2,28.7 c-3.9,5-11.1,6-16.2,2.4l-13.1-9.2c-5.6-3.9-6.9-11.8-2.6-17.2c21.2-27.2,46.4-44.7,91.2-44.7c52.3,0,97.4,29.8,97.4,80.2 c0,67.6-77.4,63.5-77.4,107.8C275.7,306.6,270.3,312,263.7,312z`}),children:t?[]:[{tag:`animate`,attributes:Z(Z({},i),{},{values:`1;0;0;0;0;1;`})}]}),t||e.push({tag:`path`,attributes:Z(Z({},n),{},{opacity:`0`,d:`M232.5,134.5l7,168c0.3,6.4,5.6,11.5,12,11.5h9c6.4,0,11.7-5.1,12-11.5l7-168c0.3-6.8-5.2-12.5-12-12.5h-23 C237.7,122,232.2,127.7,232.5,134.5z`}),children:[{tag:`animate`,attributes:Z(Z({},i),{},{values:`0;0;1;1;0;0;`})}]}),{tag:`g`,attributes:{class:`missing`},children:e}}}},{hooks:function(){return{parseNodeAttributes:function(e,t){var n=t.getAttribute(`data-fa-symbol`);return e.symbol=n===null?!1:n===``?!0:n,e}}}}],{mixoutsTo:yP}),yP.noAuto;var VF=yP.config;yP.library,yP.dom;var HF=yP.parse;yP.findIconDefinition,yP.toHtml;var UF=yP.icon;yP.layer,yP.text,yP.counter;function WF(e){return e-=0,e===e}function GF(e){return WF(e)?e:(e=e.replace(/[_-]+(.)?/g,(e,t)=>t?t.toUpperCase():``),e.charAt(0).toLowerCase()+e.slice(1))}var KF=(e,t)=>K.createElement(`stop`,{key:`${t}-${e.offset}`,offset:e.offset,stopColor:e.color,...e.opacity!==void 0&&{stopOpacity:e.opacity}});function qF(e){return e.charAt(0).toUpperCase()+e.slice(1)}var JF=new Map,YF=1e3;function XF(e){if(JF.has(e))return JF.get(e);let t={},n=0,r=e.length;for(;n<r;){let i=e.indexOf(`;`,n),a=i===-1?r:i,o=e.slice(n,a).trim();if(o){let e=o.indexOf(`:`);if(e>0){let n=o.slice(0,e).trim(),r=o.slice(e+1).trim();if(n&&r){let e=GF(n);t[e.startsWith(`webkit`)?qF(e):e]=r}}}n=a+1}if(JF.size===YF){let e=JF.keys().next().value;e&&JF.delete(e)}return JF.set(e,t),t}function ZF(e,t,n={}){if(typeof t==`string`)return t;let r=(t.children||[]).map(t=>{let r=t;return(`fill`in n||n.gradientFill)&&t.tag===`path`&&`fill`in t.attributes&&(r={...t,attributes:{...t.attributes,fill:void 0}}),ZF(e,r)}),i=t.attributes||{},a={};for(let[e,t]of Object.entries(i))switch(!0){case e===`class`:a.className=t;break;case e===`style`:a.style=XF(String(t));break;case e.startsWith(`aria-`):case e.startsWith(`data-`):a[e.toLowerCase()]=t;break;default:a[GF(e)]=t}let{style:o,role:s,"aria-label":c,gradientFill:l,...u}=n;if(o&&(a.style=a.style?{...a.style,...o}:o),s&&(a.role=s),c&&(a[`aria-label`]=c,a[`aria-hidden`]=`false`),l){a.fill=`url(#${l.id})`;let{type:t,stops:n=[],...i}=l;r.unshift(e(t===`linear`?`linearGradient`:`radialGradient`,{...i,id:l.id},n.map(KF)))}return e(t.tag,{...a,...u},...r)}var QF=ZF.bind(null,K.createElement),$F=(e,t)=>{let n=(0,K.useId)();return e||(t?n:void 0)},eI=class{constructor(e=`react-fontawesome`){this.enabled=!1;let t=!1;try{t=!1}catch{}this.scope=e,this.enabled=t}log(...e){this.enabled&&console.log(`[${this.scope}]`,...e)}warn(...e){this.enabled&&console.warn(`[${this.scope}]`,...e)}error(...e){this.enabled&&console.error(`[${this.scope}]`,...e)}};({env:{NODE_ENV:`production`}}).env?.FA_VERSION;var tI=`searchPseudoElementsFullScan`in VF&&typeof VF.searchPseudoElementsFullScan==`boolean`?`7.0.0`:`6.0.0`,nI=Number.parseInt(tI)>=7,rI=()=>nI,iI=`fa`,aI={beat:`fa-beat`,fade:`fa-fade`,beatFade:`fa-beat-fade`,bounce:`fa-bounce`,shake:`fa-shake`,spin:`fa-spin`,spinPulse:`fa-spin-pulse`,spinReverse:`fa-spin-reverse`,pulse:`fa-pulse`},oI={left:`fa-pull-left`,right:`fa-pull-right`},sI={90:`fa-rotate-90`,180:`fa-rotate-180`,270:`fa-rotate-270`},cI={"2xs":`fa-2xs`,xs:`fa-xs`,sm:`fa-sm`,lg:`fa-lg`,xl:`fa-xl`,"2xl":`fa-2xl`,"1x":`fa-1x`,"2x":`fa-2x`,"3x":`fa-3x`,"4x":`fa-4x`,"5x":`fa-5x`,"6x":`fa-6x`,"7x":`fa-7x`,"8x":`fa-8x`,"9x":`fa-9x`,"10x":`fa-10x`},lI={border:`fa-border`,fixedWidth:`fa-fw`,flip:`fa-flip`,flipHorizontal:`fa-flip-horizontal`,flipVertical:`fa-flip-vertical`,inverse:`fa-inverse`,rotateBy:`fa-rotate-by`,swapOpacity:`fa-swap-opacity`,widthAuto:`fa-width-auto`},uI={default:`fa-layers`};function dI(e){let t=VF.cssPrefix||VF.familyPrefix||iI;return t===iI?e:e.replace(new RegExp(String.raw`(?<=^|\s)${iI}-`,`g`),`${t}-`)}function fI(e){let{beat:t,fade:n,beatFade:r,bounce:i,shake:a,spin:o,spinPulse:s,spinReverse:c,pulse:l,fixedWidth:u,inverse:d,border:f,flip:p,size:m,rotation:h,pull:g,swapOpacity:_,rotateBy:v,widthAuto:y,className:b}=e,x=[];return b&&x.push(...b.split(` `)),t&&x.push(aI.beat),n&&x.push(aI.fade),r&&x.push(aI.beatFade),i&&x.push(aI.bounce),a&&x.push(aI.shake),o&&x.push(aI.spin),c&&x.push(aI.spinReverse),s&&x.push(aI.spinPulse),l&&x.push(aI.pulse),u&&x.push(lI.fixedWidth),d&&x.push(lI.inverse),f&&x.push(lI.border),p===!0&&x.push(lI.flip),(p===`horizontal`||p===`both`)&&x.push(lI.flipHorizontal),(p===`vertical`||p===`both`)&&x.push(lI.flipVertical),m!=null&&x.push(cI[m]),h!=null&&h!==0&&x.push(sI[h]),g!=null&&x.push(oI[g]),_&&x.push(lI.swapOpacity),rI()?(v&&x.push(lI.rotateBy),y&&x.push(lI.widthAuto),(VF.cssPrefix||VF.familyPrefix||iI)===iI?x:x.map(dI)):x}var pI=e=>typeof e==`object`&&`icon`in e&&!!e.icon;function mI(e){if(e)return pI(e)?e:HF.icon(e)}function hI(e){return Object.keys(e)}var gI=new eI(`FontAwesomeIcon`),_I={border:!1,className:``,mask:void 0,maskId:void 0,fixedWidth:!1,inverse:!1,flip:!1,icon:void 0,listItem:!1,pull:void 0,pulse:!1,rotation:void 0,rotateBy:!1,size:void 0,spin:!1,spinPulse:!1,spinReverse:!1,beat:!1,fade:!1,beatFade:!1,bounce:!1,shake:!1,symbol:!1,title:``,titleId:void 0,transform:void 0,swapOpacity:!1,widthAuto:!1},vI=new Set(Object.keys(_I)),yI=K.forwardRef((e,t)=>{let n={..._I,...e},{icon:r,mask:i,symbol:a,title:o,titleId:s,maskId:c,transform:l}=n,u=$F(c,!!i),d=$F(s,!!o),f=mI(r);if(!f)return gI.error(`Icon lookup is undefined`,r),null;let p=fI(n),m=typeof l==`string`?HF.transform(l):l,h=mI(i),g=UF(f,{...p.length>0&&{classes:p},...m&&{transform:m},...h&&{mask:h},symbol:a,title:o,titleId:d,maskId:u});if(!g)return gI.error(`Could not find icon`,f),null;let{abstract:_}=g,v={ref:t};for(let e of hI(n))vI.has(e)||(v[e]=n[e]);return QF(_[0],v)});yI.displayName=`FontAwesomeIcon`,`${uI.default}${lI.fixedWidth}`;function bI({message:e,className:t,buttonRef:n}){let r=(0,K.useId)(),[i,a]=(0,K.useState)(!1);return(0,q.jsxs)(`span`,{className:(0,J.default)(`aone:relative aone:inline-flex`,t),onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),children:[(0,q.jsx)(`button`,{type:`button`,ref:n,className:`aone:inline-flex aone:items-center aone:justify-center aone:h-4 aone:w-4 aone:cursor-pointer aone:rounded-sm aone:text-red-500 aone:focus:outline-none aone:focus:ring-2 aone:focus:ring-red-500 aone:focus:ring-offset-1`,"data-testid":`error-icon`,"aria-label":`Validation error: ${e}`,"aria-expanded":i,"aria-controls":r,"aria-describedby":i?r:void 0,onFocus:()=>a(!0),onBlur:()=>a(!1),onClick:()=>a(e=>!e),children:(0,q.jsx)(yI,{icon:EA,"aria-hidden":`true`,className:`aone:h-4 aone:w-4`})}),i&&(0,q.jsx)(`div`,{id:r,role:`tooltip`,className:`aone:absolute aone:z-20 aone:top-full aone:left-1/2 aone:-translate-x-1/2 aone:mt-2 aone:bg-red-600 aone:text-white aone:text-xs aone:rounded aone:px-2 aone:py-1 aone:whitespace-nowrap`,children:e})]})}var xI=e=>{let t=e.match(/\d+/g)??[];if(t.length===0)return null;let n=parseInt(t[0].slice(0,2),10);if(Number.isNaN(n)||n<1||n>12)return null;let r=t[1]?.slice(0,2),i=Number(r??`1`);(Number.isNaN(i)||i<1||i>31)&&(i=1);let a=new Date().getFullYear(),o=t[2],s=a;if(o){let e=parseInt(o,10);s=o.length<=2?2e3+e:e}let c=new Date(s,n-1,i);return xm(c)?hm(c):null},SI=/^\d{2}\/\d{2}\/\d{2}$/,CI=e=>e.toLocaleDateString(`en-US`,{year:`2-digit`,month:`2-digit`,day:`2-digit`}),wI=(e,t=``)=>{let n=e.length<t.length,r=e.replace(/\D/g,``).slice(0,8);if(!n&&e.endsWith(`/`)){let t=e.slice(0,-1).split(`/`);if(t.length===1){let e=t[0];if(e&&e.length===1)return`0${e}/`}if(t.length===2){let e=t[0],n=t[1];if(n&&n.length===1)return`${(e??``).padStart(2,`0`)}/${`0${n}`}/`}}if(r.length===1&&t===``&&!n&&parseInt(r,10)>=3)return`0${r}/`;if(e.indexOf(`/`)===1&&r.length>=1){let e=r.slice(0,1).padStart(2,`0`),t=r.slice(1);switch(t.length){case 0:return n?e:`${e}/`;case 1:return`${e}/${t}`;case 2:return n?`${e}/${t}`:`${e}/${t}/`;default:return`${e}/${t.slice(0,2)}/${t.slice(2).slice(-2).padStart(2,`0`)}`}}switch(r.length){case 0:return``;case 1:return r;case 2:return n?e:`${r}/`;case 3:{let e=r.slice(0,2),i=r.slice(2);return!n&&t.replace(/\D/g,``).length===2&&/^\d{2}\/$/.test(t)&&parseInt(i,10)>=4?`${e}/0${i}/`:`${e}/${i}`}case 4:{let e=r.slice(0,2),t=r.slice(2,4);return n?`${e}/${t}`:`${e}/${t}/`}default:return`${r.slice(0,2)}/${r.slice(2,4)}/${r.slice(4).slice(-2)}`}},TI=e=>{let t=e.trim();if(t===``)return``;let n=(t.match(/\d+/g)??[]).slice(0,3);if(n.length===0)return``;let r=n[0].slice(-2).padStart(2,`0`);if(n.length===1)return r;let i=n[1].slice(-2).padStart(2,`0`);return n.length===2?`${r}/${i}`:`${r}/${i}/${n[2].slice(-2).padStart(2,`0`)}`},EI=e=>{if(!SI.test(e))return null;let t=wg(e,`MM/dd/yy`,new Date);return xm(t)&&CI(hm(t))===e?hm(t):null};function DI({origin:e,destination:t,onChange:n,onMonthViewChange:r,oneWay:i,className:a,primaryColor:o,secondaryColor:s,startDateLabel:c=`Start Date`,endDateLabel:l=`End Date`,flightCalendar:u,flightCalendarStatus:d,onlyDirects:f,initialStartDate:p,initialEndDate:m,referenceDates:h,minDate:g,showButtons:_=!0}){let v=(0,K.useRef)(null),[y,b]=(0,K.useState)(null);(0,K.useLayoutEffect)(()=>{if(!v.current)return;let e=v.current.getRootNode();if(!(e instanceof ShadowRoot))return;let t=document.createElement(`div`);return e.appendChild(t),queueMicrotask(()=>b(t)),()=>{t.parentNode&&t.parentNode.removeChild(t)}},[]);let[x,S]=(0,K.useState)(``),[C,w]=(0,K.useState)(``),[T,E]=(0,K.useState)(null),[D,O]=(0,K.useState)(null),[k,A]=(0,K.useState)(p||null),[j,M]=(0,K.useState)(m||null),[N,P]=(0,K.useState)(!1),[ee,F]=(0,K.useState)(p||null),[te,ne]=(0,K.useState)(!1),[re,ie]=(0,K.useState)(!1),[ae]=(0,K.useState)(()=>p||new Date),oe=(0,K.useRef)(n),se=(0,K.useRef)(null),ce=(0,K.useRef)(null),le=(0,K.useRef)(null),ue=(0,K.useRef)(0),de=(0,K.useRef)(null),fe=(0,K.useRef)(null),pe=()=>Date.now()<ue.current,me=()=>{pe()||P(!0)},he=()=>{ue.current=Date.now()+250,P(!1)},ge=e=>{if(e){me();return}he()};(0,K.useEffect)(()=>{oe.current=n},[n]),(0,K.useEffect)(()=>{i&&queueMicrotask(()=>{M(null),w(``),O(null)})},[i]),(0,K.useEffect)(()=>{queueMicrotask(()=>{!k&&p&&A(p),!j&&m&&M(m)})},[p,m,k,j]);let I=hm(new Date),_e=om(I,6),L=e=>{S(e);let t=EI(e);return e===``||!e?(E(null),A(null),!0):t?hh(t,I)?(E(`Date cannot be in the past`),A(null),!1):mh(t,_e)?(E(`Date must be within 6 months`),A(null),!1):g&&hh(t,g)?(E(`Date must be no earlier than `+g.toLocaleDateString()),A(null),!1):(E(null),A(t),F(t),j&&hh(j,t)&&(M(null),w(``)),!0):(E(`Enter a date in MM/DD/YY format`),A(null),!1)},ve=e=>{if(i)return!0;w(e);let t=EI(e);return e===``||!e?(O(null),M(null),!0):t?hh(t,I)?(O(`Date cannot be in the past`),M(null),!1):mh(t,_e)?(O(`Date must be within 6 months`),M(null),!1):k?hh(t,k)?(O(`Return date must be after departure`),M(null),!1):g&&hh(t,g)?(O(`Date must be no earlier than `+g.toLocaleDateString()),M(null),!1):(O(null),M(t),F(t),!0):(O(`Enter departure date first`),M(null),!1):(O(`Enter a date in MM/DD/YY format`),M(null),!1)},ye=()=>L(x),be=()=>ve(C),xe=e=>{let t=e.getTime()<(k?.getTime()||0);k?!j&&t?A(e):j?k&&j&&(ym(e,k)&&ym(e,j)?(A(e),M(null)):hh(e,j)&&hh(e,am(k,3))?A(e):M(e)):i?A(e):M(e):A(e)},Se=()=>{A(null),M(null),S(``),w(``),E(null),O(null),F(null),oe.current(null,null)};(0,K.useEffect)(()=>{oe.current(k,j)},[k,j]),(0,K.useEffect)(()=>{queueMicrotask(()=>{k?(S(CI(k)),E(null)):T||S(``)})},[k]),(0,K.useEffect)(()=>{queueMicrotask(()=>{j?(w(CI(j)),O(null)):D||w(``)})},[j]);let Ce={};o&&(Ce[`--color-primary`]=o),s&&(Ce[`--color-secondary`]=s);let we=pA(),Te=(0,K.useId)(),Ee=`${Te}-description`,De=(0,q.jsxs)(`div`,{ref:le,onClick:me,className:(0,J.default)(`aone:relative aone:h-full aone:flex aone:flex-col aone:gap-4 aone:px-3 aone:py-2 aone:rounded-lg aone:bg-white aone:cursor-pointer`,`aone:@2xl:flex-row aone:@2xl:items-center`,{"aone:border-2 aone:border-primary":N,"aone:border-2 aone:border-gray-200":!N}),children:[(0,q.jsxs)(`fieldset`,{className:`aone:border-0 aone:p-0 aone:m-0 aone:@2xl:flex-1 aone:@2xl:pr-3`,children:[(0,q.jsx)(`legend`,{className:`aone:sr-only`,children:`Date range selection`}),(0,q.jsxs)(`div`,{className:`aone:flex aone:grow aone:items-center`,children:[(0,q.jsx)(`span`,{children:(0,q.jsx)(mA,{})}),(0,q.jsxs)(`div`,{className:`aone:relative aone:flex-grow`,children:[(0,q.jsx)(`input`,{type:`text`,name:`start-date`,value:x,"aria-label":c,"aria-invalid":T?`true`:void 0,placeholder:te?`mm/dd/yy`:c,autoComplete:`off`,className:(0,J.default)(`aone:ml-2 aone:all-initial aone:focus:outline-none aone:disabled:bg-white aone:text-black aone:text-base aone:w-full aone:pr-1`,{"aone:text-red-500 ":!!T}),onChange:e=>{let t=wI(e.target.value,x);S(t),E(null),F(xI(t)),oe.current(null,j)},onFocus:()=>{ne(!0),me()},onBlur:e=>{let t=TI(e.target.value);S(t);let n=L(t);ne(!1),!n&&de.current===`forward`&&requestAnimationFrame(()=>se.current?.focus()),de.current=null},onKeyDown:e=>{e.key===`Tab`&&(de.current=e.shiftKey?`backward`:`forward`),e.key===`Enter`&&(e.preventDefault(),ye(),e.target.blur())}}),T&&(0,q.jsx)(`span`,{className:`aone:absolute aone:right-2 aone:top-1/2 aone:-translate-y-1/2`,children:(0,q.jsx)(bI,{message:T,buttonRef:se})})]})]})]}),!i&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`div`,{className:`aone:absolute aone:left-2 aone:right-2 aone:top-1/2 aone:@2xl:top-2 aone:@2xl:bottom-2 aone:@2xl:left-1/2 aone:rounded-lg aone:h-[2px] aone:@2xl:h-[initial] aone:@2xl:w-[2px] aone:bg-gray-200`}),(0,q.jsxs)(`fieldset`,{className:`aone:border-0 aone:p-0 aone:m-0 aone:@2xl:flex-1 aone:@2xl:pl-3`,children:[(0,q.jsx)(`legend`,{className:`aone:sr-only`,children:`Return date selection`}),(0,q.jsxs)(`div`,{className:`aone:flex aone:grow aone:items-center`,children:[(0,q.jsx)(`span`,{className:`aone:@2xl:hidden`,children:(0,q.jsx)(mA,{})}),(0,q.jsxs)(`div`,{className:`aone:relative aone:flex-grow`,children:[(0,q.jsx)(`input`,{type:`text`,name:`end-date`,value:C,"aria-label":l,"aria-invalid":D?`true`:void 0,placeholder:re?`mm/dd/yy`:l,autoComplete:`off`,className:(0,J.default)(`aone:ml-2 aone:focus:outline-none aone:disabled:bg-white aone:text-black aone:text-base aone:w-full aone:pr-7`,{"aone:text-red-500":!!D}),onChange:e=>{let t=wI(e.target.value,C);w(t),O(null),F(xI(t)),oe.current(k,null)},onFocus:()=>{ie(!0),me()},onBlur:e=>{let t=TI(e.target.value);w(t);let n=ve(t);ie(!1),!n&&fe.current===`forward`&&requestAnimationFrame(()=>ce.current?.focus()),fe.current=null},onKeyDown:e=>{e.key===`Tab`&&(fe.current=e.shiftKey?`backward`:`forward`),e.key===`Enter`&&(e.preventDefault(),be(),e.target.blur())}}),D&&(0,q.jsx)(`span`,{className:`aone:absolute aone:right-2 aone:top-1/2 aone:-translate-y-1/2`,children:(0,q.jsx)(bI,{message:D,buttonRef:ce})})]})]})]})]})]});return(0,q.jsxs)(`div`,{id:`A1-DateRangePicker`,ref:v,className:a,style:Ce,role:`group`,"aria-label":`Date range picker`,"aria-describedby":Ee,children:[we?(0,q.jsxs)(oA,{open:N,onOpenChange:ge,children:[De,(0,q.jsxs)(aA,{className:`ao-dialog--calendar-light`,open:N,onOpenChange:ge,"aria-labelledby":Te,"aria-describedby":void 0,children:[(0,q.jsx)(sA,{id:Te,className:`aone:sr-only`,children:`Filter Options`}),(0,q.jsx)(bA,{origin:e,destination:t,initialDate:ae,startDate:k,endDate:j,previewDate:ee,onChange:xe,onMonthViewChange:r,flightCalendar:u,flightCalendarStatus:d,onlyDirects:f,referenceDates:h,minDate:g},ae.toISOString()),_&&(0,q.jsxs)(`div`,{className:`aone:mt-3 aone:flex aone:justify-between aone:items-center aone:pt-0 aone:pb-1 aone:md:pb-2 aone:px-1`,children:[(0,q.jsx)(`button`,{type:`button`,className:`aone:bg-slate-400 aone:text-white aone:text-[14px] aone:rounded-lg aone:px-4 aone:py-1 aone:ring-slate-500`,onClick:Se,"data-testid":`date-range-picker-reset-button`,children:`Reset`}),(0,q.jsx)(`button`,{type:`button`,className:`aone:bg-primary aone:text-white aone:text-[14px] aone:rounded-lg aone:px-4 aone:py-1 aone:ring-primary`,onClick:he,"data-testid":`date-range-picker-done-button`,children:`Done`})]})]})]}):(0,q.jsxs)(cA,{open:N,onOpenChange:ge,children:[(0,q.jsx)(dA,{asChild:!0,children:De}),(0,q.jsxs)(uA,{side:`bottom`,align:`center`,sticky:`always`,avoidCollisions:!1,onOpenAutoFocus:e=>e.preventDefault(),onInteractOutside:e=>{let t=e.target;t&&le.current?.contains(t)&&e.preventDefault()},sideOffset:4,portalContainer:y,role:`dialog`,"aria-label":`Calendar for date selection`,"aria-describedby":`calendar-instructions`,className:`aone:w-max aone:max-w-[100vw] aone:p-0 aone:bg-white aone:border aone:border-gray-300 aone:rounded-xl aone:shadow-lg aone:md:mt-2 aone:pb-2`,children:[(0,q.jsx)(`div`,{id:`calendar-instructions`,className:`aone:sr-only`,children:`Use arrow keys to navigate dates. Press Enter or Space to select a date. Press Escape to close the calendar.`}),(0,q.jsx)(bA,{origin:e,destination:t,initialDate:ae,startDate:k,endDate:j,previewDate:ee,onChange:xe,onMonthViewChange:r,flightCalendar:u,flightCalendarStatus:d,onlyDirects:f,referenceDates:h,minDate:g},ae.toISOString()),_&&(0,q.jsxs)(`div`,{className:`aone:mt-3 aone:md:mt-0 aone:flex aone:justify-between aone:items-center aone:pt-0 aone:pb-1 aone:md:pb-2 aone:px-5`,children:[(0,q.jsx)(`button`,{type:`button`,className:`aone:bg-slate-400 aone:text-white aone:text-[14px] aone:rounded-lg aone:px-4 aone:py-1 aone:ring-slate-500`,onClick:Se,"data-testid":`date-range-picker-popover-reset-button`,children:`Reset`}),(0,q.jsx)(`button`,{type:`button`,className:`aone:bg-primary aone:text-white aone:text-[14px] aone:rounded-lg aone:px-4 aone:py-1 aone:ring-primary`,onClick:he,"data-testid":`date-range-picker-popover-done-button`,children:`Done`})]})]})]}),(0,q.jsx)(`div`,{id:Ee,className:`aone:sr-only`,children:i?`Departure date input. Enter a date manually or open the calendar to pick one.`:`Departure and return date inputs. Enter dates manually or open the calendar to pick a date range.`})]})}function OI(e){if(e===`00:00`)return`Midnight`;if(e===`12:00`)return`Noon`;let[t=`00`,n=`00`]=e.split(`:`),r=parseInt(t,10),i=r<12?`am`:`pm`;return r===0&&(r=12),r>12&&(r-=12),`${r}:${n.padStart(2,`0`)} ${i}`}var kI=Array.from({length:48},(e,t)=>{let n=Math.floor(t/2),r=t%2==0?`00`:`30`;return`${n.toString().padStart(2,`0`)}:${r}`}),AI=({value:e,onChange:t,label:n,header:r=`Select pick-up time`,portalContainer:i})=>{let[a,o]=(0,K.useState)(!1);return(0,q.jsxs)(cA,{open:a,onOpenChange:o,children:[(0,q.jsx)(lA,{asChild:!0,children:(0,q.jsxs)(`button`,{type:`button`,className:`aone:w-full aone:h-full aone:text-base aone:px-4 aone:py-2 aone:bg-white aone:dark:bg-gray-800 aone:rounded-md aone:text-left aone:shadow-sm aone:flex aone:items-center aone:justify-between aone:cursor-pointer aone:border-2 aone:border-gray-200 aone:dark:border-gray-600 aone:text-foreground`,"data-testid":`time-picker-trigger`,children:[(0,q.jsx)(`span`,{children:e?OI(e):n||`Select time`}),(0,q.jsx)(`div`,{className:`aone:pointer-events-none aone:flex aone:items-center`,children:(0,q.jsx)(yI,{icon:a?SA:TA,className:`aone:h-4 aone:w-4 aone:text-muted-foreground`})})]})}),(0,q.jsxs)(uA,{className:`aone:p-0 aone:w-64 aone:shadow-lg aone:rounded-xl`,portalContainer:i,children:[(0,q.jsx)(`div`,{className:`aone:border-b aone:px-4 aone:py-3 aone:font-semibold aone:text-base aone:text-foreground`,children:r}),(0,q.jsx)(`div`,{className:`aone:max-h-72 aone:overflow-y-auto aone:p-2`,style:{WebkitOverflowScrolling:`touch`,overscrollBehavior:`contain`,touchAction:`pan-y`},onTouchStart:e=>e.stopPropagation(),onTouchMove:e=>e.stopPropagation(),children:(0,q.jsx)(`div`,{className:`aone:grid aone:grid-cols-2 aone:gap-2`,children:kI.map(n=>(0,q.jsx)(`button`,{type:`button`,className:`py-2 px-2 rounded-md text-sm w-full text-left transition ${e===n?`bg-primary text-primary-foreground hover:bg-primary/90`:`bg-background text-foreground border border-transparent hover:bg-muted`}`,onClick:()=>{t(n),o(!1)},"data-testid":`time-picker-option-${n.replace(`:`,`-`)}`,children:OI(n)},n))})})]})]})};function jI({label:e,dateValue:t,timeValue:n,onDateChange:r,onTimeChange:i,origin:a,destination:o,className:s,referenceDates:c,minDate:l,shadowRoot:u}){let d=(0,K.useRef)(null),[f,p]=(0,K.useState)(null);return(0,K.useLayoutEffect)(()=>{if(!u||!d.current)return;let e=document.createElement(`div`);return u.appendChild(e),queueMicrotask(()=>p(e)),()=>{e.parentNode&&e.parentNode.removeChild(e)}},[u]),(0,q.jsxs)(`div`,{ref:d,className:`w-full md:w-auto md:flex-1 md:min-w-[325px] ${s||``}`,children:[(0,q.jsx)(`label`,{className:`aone:block aone:text-sm aone:font-medium aone:text-gray-700 aone:dark:text-gray-300`,children:e}),(0,q.jsxs)(`div`,{className:`aone:mt-1 aone:flex aone:bg-white aone:dark:bg-gray-800 aone:rounded-lg`,children:[(0,q.jsx)(`div`,{className:`aone:grow`,children:(0,q.jsx)(DI,{className:`aone:grow`,origin:a,destination:o,startDateLabel:e,endDateLabel:``,initialStartDate:t?new Date(t):null,initialEndDate:null,onChange:r,onMonthViewChange:()=>{},oneWay:!0,referenceDates:c,minDate:l,showButtons:!0,shadowRoot:u})}),(0,q.jsx)(`div`,{className:`aone:min-w-[150px] `,children:(0,q.jsx)(AI,{value:n,onChange:i,portalContainer:f})})]})]})}function MI(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function NI(){return NI=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},NI.apply(null,arguments)}var PI=s(((e,t)=>{t.exports=`SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED`})),FI=s(((e,t)=>{var n=PI();function r(){}function i(){}i.resetWarningCache=r,t.exports=function(){function e(e,t,r,i,a,o){if(o!==n){var s=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name=`Invariant Violation`,s}}e.isRequired=e;function t(){return e}var a={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:r};return a.PropTypes=a,a}})),II=s(((e,t)=>{t.exports=FI()()})),LI=s((e=>{})),RI=s(((e,t)=>{t.exports=LI()})),$=u(II(),1);RI();var zI=e=>typeof e==`object`&&!!e&&e.nodeType===1,BI=(e,t)=>(!t||e!==`hidden`)&&e!==`visible`&&e!==`clip`,VI=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){let n=getComputedStyle(e,null);return BI(n.overflowY,t)||BI(n.overflowX,t)||(e=>{let t=(e=>{if(!e.ownerDocument||!e.ownerDocument.defaultView)return null;try{return e.ownerDocument.defaultView.frameElement}catch{return null}})(e);return!!t&&(t.clientHeight<e.scrollHeight||t.clientWidth<e.scrollWidth)})(e)}return!1},HI=(e,t,n,r,i,a,o,s)=>a<e&&o>t||a>e&&o<t?0:a<=e&&s<=n||o>=t&&s>=n?a-e-r:o>t&&s<n||a<e&&s>n?o-t+i:0,UI=e=>e.parentElement??(e.getRootNode().host||null),WI=(e,t)=>{if(typeof document>`u`)return[];let{scrollMode:n,block:r,inline:i,boundary:a,skipOverflowHiddenElements:o}=t,s=typeof a==`function`?a:e=>e!==a;if(!zI(e))throw TypeError(`Invalid target`);let c=document.scrollingElement||document.documentElement,l=[],u=e;for(;zI(u)&&s(u);){if(u=UI(u),u===c){l.push(u);break}u!=null&&u===document.body&&VI(u)&&!VI(document.documentElement)||u!=null&&VI(u,o)&&l.push(u)}let d=window.visualViewport?.width??innerWidth,f=window.visualViewport?.height??innerHeight,{scrollX:p,scrollY:m}=window,{height:h,width:g,top:_,right:v,bottom:y,left:b}=e.getBoundingClientRect(),{top:x,right:S,bottom:C,left:w}=(e=>{let t=window.getComputedStyle(e);return{top:parseFloat(t.scrollMarginTop)||0,right:parseFloat(t.scrollMarginRight)||0,bottom:parseFloat(t.scrollMarginBottom)||0,left:parseFloat(t.scrollMarginLeft)||0}})(e),T=r===`start`||r===`nearest`?_-x:r===`end`?y+C:_+h/2-x+C,E=i===`center`?b+g/2-w+S:i===`end`?v+S:b-w,D=[];for(let e=0;e<l.length;e++){let t=l[e],{height:a,width:o,top:s,right:u,bottom:x,left:S}=t.getBoundingClientRect();if(n===`if-needed`&&_>=0&&b>=0&&y<=f&&v<=d&&(t===c&&!VI(t)||_>=s&&y<=x&&b>=S&&v<=u))return D;let C=getComputedStyle(t),w=parseInt(C.borderLeftWidth,10),O=parseInt(C.borderTopWidth,10),k=parseInt(C.borderRightWidth,10),A=parseInt(C.borderBottomWidth,10),j=0,M=0,N=`offsetWidth`in t?t.offsetWidth-t.clientWidth-w-k:0,P=`offsetHeight`in t?t.offsetHeight-t.clientHeight-O-A:0,ee=`offsetWidth`in t?t.offsetWidth===0?0:o/t.offsetWidth:0,F=`offsetHeight`in t?t.offsetHeight===0?0:a/t.offsetHeight:0;if(c===t)j=r===`start`?T:r===`end`?T-f:r===`nearest`?HI(m,m+f,f,O,A,m+T,m+T+h,h):T-f/2,M=i===`start`?E:i===`center`?E-d/2:i===`end`?E-d:HI(p,p+d,d,w,k,p+E,p+E+g,g),j=Math.max(0,j+m),M=Math.max(0,M+p);else{j=r===`start`?T-s-O:r===`end`?T-x+A+P:r===`nearest`?HI(s,x,a,O,A+P,T,T+h,h):T-(s+a/2)+P/2,M=i===`start`?E-S-w:i===`center`?E-(S+o/2)+N/2:i===`end`?E-u+k+N:HI(S,u,o,w,k+N,E,E+g,g);let{scrollLeft:e,scrollTop:n}=t;j=F===0?0:Math.max(0,Math.min(n+j/F,t.scrollHeight-a/F+P)),M=ee===0?0:Math.max(0,Math.min(e+M/ee,t.scrollWidth-o/ee+N)),T+=n-j,E+=e-M}D.push({el:t,top:j,left:M})}return D},GI=0;function KI(){return String(GI++)}function qI(e){var t=K.useRef(e);return t.current=e,t}function JI(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){t.forEach(function(t){typeof t==`function`?t(e):t&&(t.current=e)})}}function YI(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){for(var n=arguments.length,r=Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return t.some(function(t){return t&&t.apply(void 0,[e].concat(r)),e.preventDownshiftDefault||e.hasOwnProperty(`nativeEvent`)&&e.nativeEvent.preventDownshiftDefault})}}function XI(e,t){var n;function r(){n&&clearTimeout(n)}function i(){for(var i=arguments.length,a=Array(i),o=0;o<i;o++)a[o]=arguments[o];r(),n=setTimeout(function(){n=null,e.apply(void 0,a)},t)}return i.cancel=r,i}var ZI=XI(function(e){QI(e).textContent=``},500);function QI(e){var t=e.getElementById(`a11y-status-message`);return t||(t=e.createElement(`div`),t.setAttribute(`id`,`a11y-status-message`),t.setAttribute(`role`,`status`),t.setAttribute(`aria-live`,`polite`),t.setAttribute(`aria-relevant`,`additions text`),Object.assign(t.style,{border:`0`,clip:`rect(0 0 0 0)`,height:`1px`,margin:`-1px`,overflow:`hidden`,padding:`0`,position:`absolute`,width:`1px`}),e.body.appendChild(t),t)}function $I(e,t){if(!(!e||!t)){var n=QI(t);n.textContent=e,ZI(t)}}function eL(e){var t=e?.getElementById(`a11y-status-message`);t&&t.remove()}function tL(){}var nL=tL;function rL(e,t){return t?Object.keys(e).reduce(function(e,n){return t[n]!==void 0&&(e[n]=t[n]),e},NI({},e)):e}function iL(e,t){e&&WI(e,{boundary:t,block:`nearest`,scrollMode:`if-needed`}).forEach(function(e){var t=e.el,n=e.top,r=e.left;t.scrollTop=n,t.scrollLeft=r})}function aL(e,t,n){return e===t||t instanceof n.Node&&e.contains&&e.contains(t)}function oL(e,t){var n;function r(){n&&clearTimeout(n)}function i(){for(var i=arguments.length,a=Array(i),o=0;o<i;o++)a[o]=arguments[o];r(),n=setTimeout(function(){n=null,e.apply(void 0,a)},t)}return i.cancel=r,i}function sL(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){for(var n=arguments.length,r=Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return t.some(function(t){return t&&t.apply(void 0,[e].concat(r)),e.preventDownshiftDefault||e.hasOwnProperty(`nativeEvent`)&&e.nativeEvent.preventDownshiftDefault})}}function cL(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){t.forEach(function(t){typeof t==`function`?t(e):t&&(t.current=e)})}}function lL(e,t){return e[t]!==void 0}function uL(e){var t=e.key,n=e.keyCode;return n>=37&&n<=40&&t.indexOf(`Arrow`)!==0?`Arrow`+t:t}function dL(e,t,n,r,i){i===void 0&&(i=!1);var a=n.length;if(a===0)return-1;var o=a-1;(typeof e!=`number`||e<0||e>o)&&(e=t>0?-1:o+1);var s=e+t;s<0?s=i?o:0:s>o&&(s=i?0:o);var c=fL(s,t<0,n,r,i);return c===-1?e>=a?-1:e:c}function fL(e,t,n,r,i){i===void 0&&(i=!1);var a=n.length;if(t){for(var o=e;o>=0;o--)if(!r(n[o],o))return o}else for(var s=e;s<a;s++)if(!r(n[s],s))return s;return i?fL(t?a-1:0,t,n,r):-1}function pL(e,t,n,r){return r===void 0&&(r=!0),n&&t.some(function(t){return t&&(aL(t,e,n)||r&&aL(t,n.document.activeElement,n))})}function mL(e){return``+e.slice(0,1).toUpperCase()+e.slice(1)}function hL(e,t,n,r){for(var i=e.type,a={},o=Object.keys(n),s=0,c=o;s<c.length;s++){var l=c[s];gL(l,e,t,n,r),r[l]!==n[l]&&(a[l]=r[l])}t.onStateChange&&Object.keys(a).length&&t.onStateChange(NI({type:i},a))}function gL(e,t,n,r,i){if(i[e]!==r[e]){var a=n[`on`+mL(e)+`Change`];if(typeof a==`function`){var o=t.type;a(NI({type:o},i))}}}function _L(e,t,n,r){var i=K.useRef(null),a=K.useRef(void 0),o=qI(t),s=K.useCallback(function(t,n){a.current=n,t=rL(t,o.current);var r=e(t,o.current,n),i=o.current.stateReducer(t,NI({},n,{changes:r}));return NI({},t,i)},[o,e]),c=K.useReducer(s,t,n),l=c[0],u=c[1],d=a.current;return K.useEffect(function(){var e=rL(i.current??{},o.current);d&&i.current&&!r(e,l)&&hL(d,o.current,e,l),i.current=l},[l,d,r,o]),[l,u]}function vL(e,t,n,r){var i=_L(e,t,n,r),a=i[0],o=i[1];return[rL(a,t),o]}function yL(e,t,n,r){if(e!==void 0&&t!==void 0)return[e,t];if(e!==void 0){if(n.indexOf(e)<0)throw Error(r);return[e,n.indexOf(e)]}if(t!==void 0){var i=n[t];if(i===void 0)throw Error(r);return[i,t]}throw Error(r)}function bL(){var e=K.useRef(!0);return K.useEffect(function(){return e.current=!1,function(){e.current=!0}},[]),e.current}function xL(e,t){return t.changes}var SL={environment:$.default.shape({addEventListener:$.default.func.isRequired,removeEventListener:$.default.func.isRequired,document:$.default.shape({createElement:$.default.func.isRequired,getElementById:$.default.func.isRequired,activeElement:$.default.any.isRequired,body:$.default.any.isRequired}).isRequired,Node:$.default.func.isRequired}),itemToKey:$.default.func,stateReducer:$.default.func};function CL(e,t,n){var r=e[`default`+mL(t)];return r===void 0?n[t]:r}function wL(e,t,n){var r=e[t];if(r!==void 0)return r;var i=e[`initial`+mL(t)];return i===void 0?CL(e,t,n):i}var TL=XI(function(e,t){$I(e,t)},200);function EL(e,t,n,r){var i=r?.document,a=bL();K.useEffect(function(){!e||a||!i||TL(e(t),i)},n),K.useEffect(function(){return function(){TL.cancel(),eL(i)}},[i])}var DL=NI({},SL,{getA11yStatusMessage:$.default.func,highlightedIndex:$.default.number,defaultHighlightedIndex:$.default.number,initialHighlightedIndex:$.default.number,isOpen:$.default.bool,defaultIsOpen:$.default.bool,initialIsOpen:$.default.bool,selectedItem:$.default.any,initialSelectedItem:$.default.any,defaultSelectedItem:$.default.any,id:$.default.string,labelId:$.default.string,menuId:$.default.string,getItemId:$.default.func,toggleButtonId:$.default.string,onSelectedItemChange:$.default.func,onHighlightedIndexChange:$.default.func,onStateChange:$.default.func,onIsOpenChange:$.default.func,scrollIntoView:$.default.func}),OL={itemToString:function(e){return e?String(e):``},itemToKey:function(e){return e},stateReducer:xL,scrollIntoView:iL,environment:typeof window>`u`?void 0:window},kL={highlightedIndex:-1,isOpen:!1,selectedItem:null,inputValue:``},AL=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0?K.useLayoutEffect:K.useEffect;function jL(e){return/^\S{1}$/.test(e)}function ML(e){var t=wL(e,`selectedItem`,kL),n=wL(e,`isOpen`,kL),r=VL(e),i=wL(e,`inputValue`,kL);return{highlightedIndex:r<0&&t&&n?e.items.findIndex(function(n){return e.itemToKey(n)===e.itemToKey(t)}):r,isOpen:n,selectedItem:t,inputValue:i}}function NL(e,t,n){var r=e.items,i=e.initialHighlightedIndex,a=e.defaultHighlightedIndex,o=e.isItemDisabled,s=e.itemToKey,c=t.selectedItem,l=t.highlightedIndex;return r.length===0?-1:i!==void 0&&l===i&&!o(r[i],i)?i:a!==void 0&&!o(r[a],a)?a:c?r.findIndex(function(e){return s(c)===s(e)}):n<0&&!o(r[r.length-1],r.length-1)?r.length-1:n>0&&!o(r[0],0)?0:-1}function PL(e,t,n){var r=K.useRef({isMouseDown:!1,isTouchMove:!1,isTouchEnd:!1}),i=K.useCallback(function(){return n.map(function(e){return e.current})},[n]);return K.useEffect(function(){if(!e)return tL;function n(){r.current.isTouchEnd=!1,r.current.isMouseDown=!0}function a(n){r.current.isMouseDown=!1,pL(n.target,i(),e)||t()}function o(){r.current.isTouchEnd=!1,r.current.isTouchMove=!1}function s(){r.current.isTouchMove=!0}function c(n){r.current.isTouchEnd=!0,!r.current.isTouchMove&&!pL(n.target,i(),e,!1)&&t()}return e.addEventListener(`mousedown`,n),e.addEventListener(`mouseup`,a),e.addEventListener(`touchstart`,o),e.addEventListener(`touchmove`,s),e.addEventListener(`touchend`,c),function(){e.removeEventListener(`mousedown`,n),e.removeEventListener(`mouseup`,a),e.removeEventListener(`touchstart`,o),e.removeEventListener(`touchmove`,s),e.removeEventListener(`touchend`,c)}},[e,i,t]),r.current}var FL=function(){return tL};function IL(e){var t=e.highlightedIndex,n=e.isOpen,r=e.itemRefs,i=e.getItemNodeFromIndex,a=e.menuElement,o=e.scrollIntoView,s=K.useRef(!0);return AL(function(){t<0||!n||!Object.keys(r.current).length||(s.current===!1?s.current=!0:o(i(t),a))},[t]),s}var LL=tL;function RL(e,t,n){return n===void 0&&(n=!0),NI({isOpen:!1,highlightedIndex:-1},e.items?.length&&t>=0&&NI({selectedItem:e.items[t],isOpen:CL(e,`isOpen`,kL),highlightedIndex:CL(e,`highlightedIndex`,kL)},n&&{inputValue:e.itemToString(e.items[t])}))}function zL(e,t){return e.isOpen===t.isOpen&&e.inputValue===t.inputValue&&e.highlightedIndex===t.highlightedIndex&&e.selectedItem===t.selectedItem}function BL(e){var t=CL(e,`highlightedIndex`,kL);return t>-1&&e.isItemDisabled(e.items[t],t)?-1:t}function VL(e){var t=wL(e,`highlightedIndex`,kL);return t>-1&&e.isItemDisabled(e.items[t],t)?-1:t}function HL(e,t,n,r){var i=n.type,a;switch(i){case r.ItemMouseMove:a={highlightedIndex:n.disabled?-1:n.index};break;case r.MenuMouseLeave:a={highlightedIndex:-1};break;case r.ToggleButtonClick:case r.FunctionToggleMenu:a={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:NL(t,e,0)};break;case r.FunctionOpenMenu:a={isOpen:!0,highlightedIndex:NL(t,e,0)};break;case r.FunctionCloseMenu:a={isOpen:!1};break;case r.FunctionSetHighlightedIndex:a={highlightedIndex:t.isItemDisabled(t.items[n.highlightedIndex],n.highlightedIndex)?-1:n.highlightedIndex};break;case r.FunctionSetInputValue:a={inputValue:n.inputValue};break;case r.FunctionReset:a={highlightedIndex:BL(t),isOpen:CL(t,`isOpen`,kL),selectedItem:CL(t,`selectedItem`,kL),inputValue:CL(t,`inputValue`,kL)};break;default:throw Error(`Reducer called without proper action type.`)}return NI({},e,a)}var UL=NI({},DL,{items:$.default.array.isRequired,isItemDisabled:$.default.func}),WL=NI({},OL,{isItemDisabled:function(){return!1}});function GL(e){for(var t=e.keysSoFar,n=e.highlightedIndex,r=e.items,i=e.itemToString,a=e.isItemDisabled,o=t.toLowerCase(),s=0;s<r.length;s++){var c=(s+n+ +(t.length<2))%r.length,l=r[c];if(l!==void 0&&i(l).toLowerCase().startsWith(o)&&!a(l,c))return c}return n}var KL=0,qL=1,JL=2,YL=3,XL=4,ZL=5,QL=6,$L=7,eR=8,tR=9,nR=10,rR=11,iR=12,aR=13,oR=14,sR=15,cR=16,lR=17,uR=18,dR=19,fR=20,pR=21,mR=Object.freeze({__proto__:null,FunctionCloseMenu:lR,FunctionOpenMenu:cR,FunctionReset:pR,FunctionSelectItem:dR,FunctionSetHighlightedIndex:uR,FunctionSetInputValue:fR,FunctionToggleMenu:sR,ItemClick:oR,ItemMouseMove:aR,MenuMouseLeave:iR,ToggleButtonBlur:rR,ToggleButtonClick:KL,ToggleButtonKeyDownArrowDown:qL,ToggleButtonKeyDownArrowUp:JL,ToggleButtonKeyDownCharacter:YL,ToggleButtonKeyDownEnd:QL,ToggleButtonKeyDownEnter:$L,ToggleButtonKeyDownEscape:XL,ToggleButtonKeyDownHome:ZL,ToggleButtonKeyDownPageDown:nR,ToggleButtonKeyDownPageUp:tR,ToggleButtonKeyDownSpaceButton:eR});function hR(e,t,n){var r=n.type,i=n.altKey,a;switch(r){case oR:a={isOpen:CL(t,`isOpen`,kL),highlightedIndex:BL(t),selectedItem:t.items[n.index]};break;case YL:var o=n.key,s=``+e.inputValue+o;a={inputValue:s,highlightedIndex:GL({keysSoFar:s,highlightedIndex:!e.isOpen&&e.selectedItem?t.items.findIndex(function(n){return t.itemToKey(n)===t.itemToKey(e.selectedItem)}):e.highlightedIndex,items:t.items,itemToString:t.itemToString,isItemDisabled:t.isItemDisabled}),isOpen:!0};break;case qL:a={highlightedIndex:e.isOpen?dL(e.highlightedIndex,1,t.items,t.isItemDisabled):i&&e.selectedItem==null?-1:NL(t,e,1),isOpen:!0};break;case JL:a=e.isOpen&&i?RL(t,e.highlightedIndex,!1):{highlightedIndex:e.isOpen?dL(e.highlightedIndex,-1,t.items,t.isItemDisabled):NL(t,e,-1),isOpen:!0};break;case $L:case eR:a=RL(t,e.highlightedIndex,!1);break;case ZL:a={highlightedIndex:fL(0,!1,t.items,t.isItemDisabled),isOpen:!0};break;case QL:a={highlightedIndex:fL(t.items.length-1,!0,t.items,t.isItemDisabled),isOpen:!0};break;case tR:a={highlightedIndex:dL(e.highlightedIndex,-10,t.items,t.isItemDisabled)};break;case nR:a={highlightedIndex:dL(e.highlightedIndex,10,t.items,t.isItemDisabled)};break;case XL:a={isOpen:!1,highlightedIndex:-1};break;case rR:a=NI({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&t.items?.length&&{selectedItem:t.items[e.highlightedIndex]});break;case dR:a={selectedItem:n.selectedItem};break;default:return HL(e,t,n,mR)}return NI({},e,a)}var gR=NI({},K).useId,_R=typeof gR==`function`?vR:yR;function vR(e){var t=e.id,n=e.labelId,r=e.menuId,i=e.getItemId,a=e.toggleButtonId,o=e.inputId,s=`downshift-`+gR();return t||=s,K.useMemo(function(){return{labelId:n??t+`-label`,menuId:r??t+`-menu`,getItemId:i??function(e){return t+`-item-`+e},toggleButtonId:a??t+`-toggle-button`,inputId:o??t+`-input`}},[i,t,o,n,r,a])}function yR(e){var t=e.id,n=e.labelId,r=e.menuId,i=e.getItemId,a=e.toggleButtonId,o=e.inputId,s=K.useRef(t??`downshift-`+KI()).current;return K.useMemo(function(){return{labelId:n??s+`-label`,menuId:r??s+`-menu`,getItemId:i??function(e){return s+`-item-`+e},toggleButtonId:a??s+`-toggle-button`,inputId:o??s+`-input`}},[i,o,n,r,a,s])}var bR=[`onClick`],xR=[`onMouseLeave`,`refKey`,`ref`],SR=[`onBlur`,`onClick`,`onPress`,`onKeyDown`,`refKey`,`ref`],CR=[`item`,`index`,`onMouseMove`,`onClick`,`onMouseDown`,`onPress`,`refKey`,`disabled`,`ref`];wR.stateChangeTypes=mR;function wR(e){e===void 0&&(e={}),nL(e,wR,UL);var t=NI({},WL,e),n=t.scrollIntoView,r=t.environment,i=t.getA11yStatusMessage,a=vL(hR,t,ML,zL),o=a[0],s=a[1],c=o.isOpen,l=o.highlightedIndex,u=o.selectedItem,d=o.inputValue,f=(0,K.useRef)(null),p=(0,K.useRef)(null),m=(0,K.useRef)({}),h=(0,K.useRef)(null),g=_R(t),_=qI({state:o,props:t}),v=(0,K.useCallback)(function(e){return m.current[g.getItemId(e)]},[g]);EL(i,o,[c,l,u,d],r);var y=IL({menuElement:p.current,highlightedIndex:l,isOpen:c,itemRefs:m,scrollIntoView:n,getItemNodeFromIndex:v});(0,K.useEffect)(function(){return h.current=oL(function(e){e({type:fR,inputValue:``})},500),function(){h.current.cancel()}},[]),(0,K.useEffect)(function(){d&&h.current(s)},[s,d]),LL({props:t,state:o}),(0,K.useEffect)(function(){wL(t,`isOpen`,kL)&&f.current&&f.current.focus()},[]);var b=PL(r,(0,K.useCallback)(function(){_.current.state.isOpen&&s({type:rR})},[s,_]),(0,K.useMemo)(function(){return[p,f]},[])),x=FL(`getMenuProps`,`getToggleButtonProps`);(0,K.useEffect)(function(){c||(m.current={})},[c]);var S=(0,K.useMemo)(function(){return{ArrowDown:function(e){e.preventDefault(),s({type:qL,altKey:e.altKey})},ArrowUp:function(e){e.preventDefault(),s({type:JL,altKey:e.altKey})},Home:function(e){e.preventDefault(),s({type:ZL})},End:function(e){e.preventDefault(),s({type:QL})},Escape:function(){_.current.state.isOpen&&s({type:XL})},Enter:function(e){e.preventDefault(),s({type:_.current.state.isOpen?$L:KL})},PageUp:function(e){_.current.state.isOpen&&(e.preventDefault(),s({type:tR}))},PageDown:function(e){_.current.state.isOpen&&(e.preventDefault(),s({type:nR}))}," ":function(e){e.preventDefault();var t=_.current.state;if(!t.isOpen){s({type:KL});return}t.inputValue?s({type:YL,key:` `}):s({type:eR})}}},[s,_]),C=(0,K.useCallback)(function(){s({type:sR})},[s]),w=(0,K.useCallback)(function(){s({type:lR})},[s]),T=(0,K.useCallback)(function(){s({type:cR})},[s]),E=(0,K.useCallback)(function(e){s({type:uR,highlightedIndex:e})},[s]),D=(0,K.useCallback)(function(e){s({type:dR,selectedItem:e})},[s]),O=(0,K.useCallback)(function(){s({type:pR})},[s]),k=(0,K.useCallback)(function(e){s({type:fR,inputValue:e})},[s]),A=(0,K.useCallback)(function(e){var t=e===void 0?{}:e,n=t.onClick,r=MI(t,bR);return NI({id:g.labelId,htmlFor:g.toggleButtonId,onClick:sL(n,function(){var e;(e=f.current)==null||e.focus()})},r)},[g]),j=(0,K.useCallback)(function(e,t){var n,r=e===void 0?{}:e,i=r.onMouseLeave,a=r.refKey,o=a===void 0?`ref`:a,c=r.ref,l=MI(r,xR),u=(t===void 0?{}:t).suppressRefError;return x(`getMenuProps`,u===void 0?!1:u,o,p),NI((n={},n[o]=cL(c,function(e){p.current=e}),n.id=g.menuId,n.role=`listbox`,n[`aria-labelledby`]=l&&l[`aria-label`]?void 0:``+g.labelId,n.onMouseLeave=sL(i,function(){s({type:iR})}),n),l)},[s,x,g]);return{getToggleButtonProps:(0,K.useCallback)(function(e,t){var n,r=e===void 0?{}:e,i=r.onBlur,a=r.onClick;r.onPress;var o=r.onKeyDown,c=r.refKey,l=c===void 0?`ref`:c,u=r.ref,d=MI(r,SR),p=(t===void 0?{}:t).suppressRefError,m=p===void 0?!1:p,h=_.current.state,v=function(){s({type:KL})},y=function(){h.isOpen&&!b.isMouseDown&&s({type:rR})},C=function(e){var t=uL(e);t&&S[t]?S[t](e):jL(t)&&s({type:YL,key:t})},w=NI((n={},n[l]=cL(u,function(e){f.current=e}),n[`aria-activedescendant`]=h.isOpen&&h.highlightedIndex>-1?g.getItemId(h.highlightedIndex):``,n[`aria-controls`]=g.menuId,n[`aria-expanded`]=_.current.state.isOpen,n[`aria-haspopup`]=`listbox`,n[`aria-labelledby`]=d&&d[`aria-label`]?void 0:``+g.labelId,n.id=g.toggleButtonId,n.role=`combobox`,n.tabIndex=0,n.onBlur=sL(i,y),n),d);return d.disabled||(w.onClick=sL(a,v),w.onKeyDown=sL(o,C)),x(`getToggleButtonProps`,m,l,f),w},[s,g,_,b,x,S]),getLabelProps:A,getMenuProps:j,getItemProps:(0,K.useCallback)(function(e){var t,n=e===void 0?{}:e,r=n.item,i=n.index,a=n.onMouseMove,o=n.onClick,c=n.onMouseDown;n.onPress;var l=n.refKey,u=l===void 0?`ref`:l,d=n.disabled,f=n.ref,p=MI(n,CR);d!==void 0&&console.warn(`Passing "disabled" as an argument to getItemProps is not supported anymore. Please use the isItemDisabled prop from useSelect.`);var h=_.current,v=h.state,x=h.props,S=yL(r,i,x.items,`Pass either item or index to getItemProps!`),C=S[0],w=S[1],T=x.isItemDisabled(C,w),E=function(){b.isTouchEnd||w===v.highlightedIndex||(y.current=!1,s({type:aR,index:w,disabled:T}))},D=function(){s({type:oR,index:w})},O=function(e){return e.preventDefault()},k=NI((t={},t[u]=cL(f,function(e){e&&(m.current[g.getItemId(w)]=e)}),t[`aria-disabled`]=T,t[`aria-selected`]=C===v.selectedItem,t.id=g.getItemId(w),t.role=`option`,t),p);return T||(k.onClick=sL(o,D)),k.onMouseMove=sL(a,E),k.onMouseDown=sL(c,O),k},[_,g,b,y,s]),toggleMenu:C,openMenu:T,closeMenu:w,setHighlightedIndex:E,selectItem:D,reset:O,setInputValue:k,highlightedIndex:l,isOpen:c,selectedItem:u,inputValue:d}}var TR=0,ER=1,DR=2,OR=3,kR=4,AR=5,jR=6,MR=7,NR=8,PR=9,FR=10,IR=11,LR=12,RR=13,zR=14,BR=15,VR=16,HR=17,UR=18,WR=19,GR=20,KR=21,qR=22,JR=Object.freeze({__proto__:null,ControlledPropUpdatedSelectedItem:qR,FunctionCloseMenu:HR,FunctionOpenMenu:VR,FunctionReset:KR,FunctionSelectItem:WR,FunctionSetHighlightedIndex:UR,FunctionSetInputValue:GR,FunctionToggleMenu:BR,InputBlur:PR,InputChange:NR,InputClick:FR,InputKeyDownArrowDown:TR,InputKeyDownArrowUp:ER,InputKeyDownEnd:kR,InputKeyDownEnter:MR,InputKeyDownEscape:DR,InputKeyDownHome:OR,InputKeyDownPageDown:jR,InputKeyDownPageUp:AR,ItemClick:RR,ItemMouseMove:LR,MenuMouseLeave:IR,ToggleButtonClick:zR});function YR(e){var t=ML(e),n=t.selectedItem,r=t.inputValue;return r===``&&n&&e.defaultInputValue===void 0&&e.initialInputValue===void 0&&e.inputValue===void 0&&(r=e.itemToString(n)),NI({},t,{inputValue:r})}var XR=NI({},DL,{items:$.default.array.isRequired,isItemDisabled:$.default.func,inputValue:$.default.string,defaultInputValue:$.default.string,initialInputValue:$.default.string,inputId:$.default.string,onInputValueChange:$.default.func});function ZR(e,t,n,r){var i=(0,K.useRef)(),a=_L(e,t,n,r),o=a[0],s=a[1],c=bL();return(0,K.useEffect)(function(){lL(t,`selectedItem`)&&(c||t.itemToKey(t.selectedItem)!==t.itemToKey(i.current)&&s({type:qR,inputValue:t.itemToString(t.selectedItem)}),i.current=o.selectedItem===i.current?t.selectedItem:o.selectedItem)},[o.selectedItem,t.selectedItem]),[rL(o,t),s]}var QR=NI({},OL,{isItemDisabled:function(){return!1}});function $R(e,t,n){var r=n.type,i=n.altKey,a;switch(r){case RR:a={isOpen:CL(t,`isOpen`,kL),highlightedIndex:BL(t),selectedItem:t.items[n.index],inputValue:t.itemToString(t.items[n.index])};break;case TR:a=e.isOpen?{highlightedIndex:dL(e.highlightedIndex,1,t.items,t.isItemDisabled,!0)}:{highlightedIndex:i&&e.selectedItem==null?-1:NL(t,e,1),isOpen:t.items.length>=0};break;case ER:a=e.isOpen?i?RL(t,e.highlightedIndex):{highlightedIndex:dL(e.highlightedIndex,-1,t.items,t.isItemDisabled,!0)}:{highlightedIndex:NL(t,e,-1),isOpen:t.items.length>=0};break;case MR:a=RL(t,e.highlightedIndex);break;case DR:a=NI({isOpen:!1,highlightedIndex:-1},!e.isOpen&&{selectedItem:null,inputValue:``});break;case AR:a={highlightedIndex:dL(e.highlightedIndex,-10,t.items,t.isItemDisabled,!0)};break;case jR:a={highlightedIndex:dL(e.highlightedIndex,10,t.items,t.isItemDisabled,!0)};break;case OR:a={highlightedIndex:fL(0,!1,t.items,t.isItemDisabled)};break;case kR:a={highlightedIndex:fL(t.items.length-1,!0,t.items,t.isItemDisabled)};break;case PR:a=NI({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&t.items?.length&&n.selectItem&&{selectedItem:t.items[e.highlightedIndex],inputValue:t.itemToString(t.items[e.highlightedIndex])});break;case NR:a={isOpen:!0,highlightedIndex:BL(t),inputValue:n.inputValue};break;case FR:a={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:NL(t,e,0)};break;case WR:a={selectedItem:n.selectedItem,inputValue:t.itemToString(n.selectedItem)};break;case qR:a={inputValue:n.inputValue};break;default:return HL(e,t,n,JR)}return NI({},e,a)}var ez=[`onMouseLeave`,`refKey`,`ref`],tz=[`item`,`index`,`refKey`,`ref`,`onMouseMove`,`onMouseDown`,`onClick`,`onPress`,`disabled`],nz=[`onClick`,`onPress`,`refKey`,`ref`],rz=[`onKeyDown`,`onChange`,`onInput`,`onBlur`,`onChangeText`,`onClick`,`refKey`,`ref`];iz.stateChangeTypes=JR;function iz(e){e===void 0&&(e={}),nL(e,iz,XR);var t=NI({},QR,e),n=t.items,r=t.scrollIntoView,i=t.environment,a=t.getA11yStatusMessage,o=ZR($R,t,YR,zL),s=o[0],c=o[1],l=s.isOpen,u=s.highlightedIndex,d=s.selectedItem,f=s.inputValue,p=(0,K.useRef)(null),m=(0,K.useRef)({}),h=(0,K.useRef)(null),g=(0,K.useRef)(null),_=bL(),v=_R(t),y=(0,K.useRef)(),b=qI({state:s,props:t}),x=(0,K.useCallback)(function(e){return m.current[v.getItemId(e)]},[v]);EL(a,s,[l,u,d,f],i);var S=IL({menuElement:p.current,highlightedIndex:u,isOpen:l,itemRefs:m,scrollIntoView:r,getItemNodeFromIndex:x});LL({props:t,state:s}),(0,K.useEffect)(function(){wL(t,`isOpen`,kL)&&h.current&&h.current.focus()},[]),(0,K.useEffect)(function(){_||(y.current=n.length)});var C=PL(i,(0,K.useCallback)(function(){b.current.state.isOpen&&c({type:PR})},[c,b]),(0,K.useMemo)(function(){return[p,g,h]},[])),w=FL(`getInputProps`,`getMenuProps`);(0,K.useEffect)(function(){l||(m.current={})},[l]),(0,K.useEffect)(function(){var e;!l||!(i!=null&&i.document)||!(h!=null&&(e=h.current)!=null&&e.focus)||i.document.activeElement!==h.current&&h.current.focus()},[l,i]);var T=(0,K.useMemo)(function(){return{ArrowDown:function(e){e.preventDefault(),c({type:TR,altKey:e.altKey})},ArrowUp:function(e){e.preventDefault(),c({type:ER,altKey:e.altKey})},Home:function(e){b.current.state.isOpen&&(e.preventDefault(),c({type:OR}))},End:function(e){b.current.state.isOpen&&(e.preventDefault(),c({type:kR}))},Escape:function(e){var t=b.current.state;(t.isOpen||t.inputValue||t.selectedItem||t.highlightedIndex>-1)&&(e.preventDefault(),c({type:DR}))},Enter:function(e){!b.current.state.isOpen||e.which===229||(e.preventDefault(),c({type:MR}))},PageUp:function(e){b.current.state.isOpen&&(e.preventDefault(),c({type:AR}))},PageDown:function(e){b.current.state.isOpen&&(e.preventDefault(),c({type:jR}))}}},[c,b]),E=(0,K.useCallback)(function(e){return NI({id:v.labelId,htmlFor:v.inputId},e)},[v]),D=(0,K.useCallback)(function(e,t){var n,r=e===void 0?{}:e,i=r.onMouseLeave,a=r.refKey,o=a===void 0?`ref`:a,s=r.ref,l=MI(r,ez),u=(t===void 0?{}:t).suppressRefError;return w(`getMenuProps`,u===void 0?!1:u,o,p),NI((n={},n[o]=cL(s,function(e){p.current=e}),n.id=v.menuId,n.role=`listbox`,n[`aria-labelledby`]=l&&l[`aria-label`]?void 0:``+v.labelId,n.onMouseLeave=sL(i,function(){c({type:IR})}),n),l)},[c,w,v]),O=(0,K.useCallback)(function(e){var t,n,r=e===void 0?{}:e,i=r.item,a=r.index,o=r.refKey,s=o===void 0?`ref`:o,l=r.ref,u=r.onMouseMove,d=r.onMouseDown,f=r.onClick;r.onPress;var p=r.disabled,h=MI(r,tz);p!==void 0&&console.warn(`Passing "disabled" as an argument to getItemProps is not supported anymore. Please use the isItemDisabled prop from useCombobox.`);var g=b.current,_=g.props,y=g.state,x=yL(i,a,_.items,`Pass either item or index to getItemProps!`),w=x[0],T=x[1],E=_.isItemDisabled(w,T),D=`onClick`,O=f;return NI((t={},t[s]=cL(l,function(e){e&&(m.current[v.getItemId(T)]=e)}),t[`aria-disabled`]=E,t[`aria-selected`]=T===y.highlightedIndex,t.id=v.getItemId(T),t.role=`option`,t),!E&&(n={},n[D]=sL(O,function(){c({type:RR,index:T})}),n),{onMouseMove:sL(u,function(){C.isTouchEnd||T===y.highlightedIndex||(S.current=!1,c({type:LR,index:T,disabled:E}))}),onMouseDown:sL(d,function(e){return e.preventDefault()})},h)},[c,v,b,C,S]),k=(0,K.useCallback)(function(e){var t,n=e===void 0?{}:e,r=n.onClick;n.onPress;var i=n.refKey,a=i===void 0?`ref`:i,o=n.ref,s=MI(n,nz),l=b.current.state;return NI((t={},t[a]=cL(o,function(e){g.current=e}),t[`aria-controls`]=v.menuId,t[`aria-expanded`]=l.isOpen,t.id=v.toggleButtonId,t.tabIndex=-1,t),!s.disabled&&NI({},{onClick:sL(r,function(){c({type:zR})})}),s)},[c,b,v]),A=(0,K.useCallback)(function(e,t){var n,r=e===void 0?{}:e,a=r.onKeyDown,o=r.onChange,s=r.onInput,l=r.onBlur;r.onChangeText;var u=r.onClick,d=r.refKey,f=d===void 0?`ref`:d,p=r.ref,m=MI(r,rz),g=(t===void 0?{}:t).suppressRefError;w(`getInputProps`,g===void 0?!1:g,f,h);var _=b.current.state,y=function(e){var t=uL(e);t&&T[t]&&T[t](e)},x=function(e){c({type:NR,inputValue:e.target.value})},S=function(e){i!=null&&i.document&&_.isOpen&&!C.isMouseDown&&c({type:PR,selectItem:!(e.relatedTarget===null&&i.document.activeElement!==i.document.body)})},E=function(){c({type:FR})},D=`onChange`,O={};if(!m.disabled){var k;O=(k={},k[D]=sL(o,s,x),k.onKeyDown=sL(a,y),k.onBlur=sL(l,S),k.onClick=sL(u,E),k)}return NI((n={},n[f]=cL(p,function(e){h.current=e}),n[`aria-activedescendant`]=_.isOpen&&_.highlightedIndex>-1?v.getItemId(_.highlightedIndex):``,n[`aria-autocomplete`]=`list`,n[`aria-controls`]=v.menuId,n[`aria-expanded`]=_.isOpen,n[`aria-labelledby`]=m&&m[`aria-label`]?void 0:v.labelId,n.autoComplete=`off`,n.id=v.inputId,n.role=`combobox`,n.value=_.inputValue,n),O,m)},[c,v,i,T,b,C,w]),j=(0,K.useCallback)(function(){c({type:BR})},[c]),M=(0,K.useCallback)(function(){c({type:HR})},[c]),N=(0,K.useCallback)(function(){c({type:VR})},[c]),P=(0,K.useCallback)(function(e){c({type:UR,highlightedIndex:e})},[c]),ee=(0,K.useCallback)(function(e){c({type:WR,selectedItem:e})},[c]);return{getItemProps:O,getLabelProps:E,getMenuProps:D,getInputProps:A,getToggleButtonProps:k,toggleMenu:j,openMenu:N,closeMenu:M,setHighlightedIndex:P,setInputValue:(0,K.useCallback)(function(e){c({type:GR,inputValue:e})},[c]),selectItem:ee,reset:(0,K.useCallback)(function(){c({type:KR})},[c]),highlightedIndex:u,isOpen:l,selectedItem:d,inputValue:f}}var az={activeIndex:-1,selectedItems:[]};function oz(e,t){return wL(e,t,az)}function sz(e,t){return CL(e,t,az)}function cz(e){return{activeIndex:oz(e,`activeIndex`),selectedItems:oz(e,`selectedItems`)}}function lz(e){if(e.shiftKey||e.metaKey||e.ctrlKey||e.altKey)return!1;var t=e.target;return!(t instanceof HTMLInputElement&&t.value!==``&&(t.selectionStart!==0||t.selectionEnd!==0))}function uz(e,t){return e.selectedItems===t.selectedItems&&e.activeIndex===t.activeIndex}DL.stateReducer,DL.itemToKey,DL.environment,$.default.array,$.default.array,$.default.array,$.default.func,$.default.number,$.default.number,$.default.number,$.default.func,$.default.func,$.default.string,$.default.string;var dz={itemToKey:OL.itemToKey,stateReducer:OL.stateReducer,environment:OL.environment,keyNavigationNext:`ArrowRight`,keyNavigationPrevious:`ArrowLeft`},fz=tL,pz=0,mz=1,hz=2,gz=3,_z=4,vz=5,yz=6,bz=7,xz=8,Sz=9,Cz=10,wz=11,Tz=12,Ez=Object.freeze({__proto__:null,DropdownClick:bz,DropdownKeyDownBackspace:yz,DropdownKeyDownNavigationPrevious:vz,FunctionAddSelectedItem:xz,FunctionRemoveSelectedItem:Sz,FunctionReset:Tz,FunctionSetActiveIndex:wz,FunctionSetSelectedItems:Cz,SelectedItemClick:pz,SelectedItemKeyDownBackspace:hz,SelectedItemKeyDownDelete:mz,SelectedItemKeyDownNavigationNext:gz,SelectedItemKeyDownNavigationPrevious:_z});function Dz(e,t,n){var r=n.type,i=n.index,a=n.selectedItem,o=e.activeIndex,s=e.selectedItems,c;switch(r){case pz:c={activeIndex:i};break;case _z:c={activeIndex:o-1<0?0:o-1};break;case gz:c={activeIndex:o+1>=s.length?-1:o+1};break;case hz:case mz:if(o<0)break;var l=o;s.length===1?l=-1:o===s.length-1&&(l=s.length-2),c=NI({selectedItems:[].concat(s.slice(0,o),s.slice(o+1))},{activeIndex:l});break;case vz:c={activeIndex:s.length-1};break;case yz:c={selectedItems:s.slice(0,s.length-1)};break;case xz:c={selectedItems:[].concat(s,[a])};break;case bz:c={activeIndex:-1};break;case Sz:var u=o,d=s.findIndex(function(e){return t.itemToKey(e)===t.itemToKey(a)});if(d<0)break;s.length===1?u=-1:d===s.length-1&&(u=s.length-2),c={selectedItems:[].concat(s.slice(0,d),s.slice(d+1)),activeIndex:u};break;case Cz:c={selectedItems:n.selectedItems};break;case wz:c={activeIndex:n.activeIndex};break;case Tz:c={activeIndex:sz(t,`activeIndex`),selectedItems:sz(t,`selectedItems`)};break;default:throw Error(`Reducer called without proper action type.`)}return NI({},e,c)}var Oz=[`refKey`,`ref`,`onClick`,`onKeyDown`,`selectedItem`,`index`],kz=[`refKey`,`ref`,`onKeyDown`,`onClick`,`preventKeyAction`];Az.stateChangeTypes=Ez;function Az(e){e===void 0&&(e={}),fz(e,Az);var t=NI({},dz,e),n=t.getA11yStatusMessage,r=t.environment,i=t.keyNavigationNext,a=t.keyNavigationPrevious,o=vL(Dz,t,cz,uz),s=o[0],c=o[1],l=s.activeIndex,u=s.selectedItems,d=bL(),f=(0,K.useRef)(null),p=(0,K.useRef)();p.current=[];var m=qI({state:s,props:t});EL(n,s,[l,u],r),(0,K.useEffect)(function(){d||(l===-1&&f.current?f.current.focus():p.current[l]&&p.current[l].focus())},[l]),LL({props:t,state:s});var h=FL(`getDropdownProps`),g=(0,K.useMemo)(function(){var e;return e={},e[a]=function(){c({type:_z})},e[i]=function(){c({type:gz})},e.Delete=function(){c({type:mz})},e.Backspace=function(){c({type:hz})},e},[c,i,a]),_=(0,K.useMemo)(function(){var e;return e={},e[a]=function(e){lz(e)&&c({type:vz})},e.Backspace=function(e){lz(e)&&c({type:yz})},e},[c,a]);return{getSelectedItemProps:(0,K.useCallback)(function(e){var t,n=e===void 0?{}:e,r=n.refKey,i=r===void 0?`ref`:r,a=n.ref,o=n.onClick,s=n.onKeyDown,l=n.selectedItem,u=n.index,d=MI(n,Oz),f=m.current.state,h=yL(l,u,f.selectedItems,`Pass either item or index to getSelectedItemProps!`)[1],_=h>-1&&h===f.activeIndex;return NI((t={},t[i]=cL(a,function(e){e&&p.current.push(e)}),t.tabIndex=_?0:-1,t.onClick=sL(o,function(){c({type:pz,index:h})}),t.onKeyDown=sL(s,function(e){var t=uL(e);t&&g[t]&&g[t](e)}),t),d)},[c,m,g]),getDropdownProps:(0,K.useCallback)(function(e,t){var n,r=e===void 0?{}:e,i=r.refKey,a=i===void 0?`ref`:i,o=r.ref,s=r.onKeyDown,l=r.onClick,u=r.preventKeyAction,d=u===void 0?!1:u,p=MI(r,kz),m=(t===void 0?{}:t).suppressRefError;return h(`getDropdownProps`,m===void 0?!1:m,a,f),NI((n={},n[a]=cL(o,function(e){e&&(f.current=e)}),n),!d&&{onKeyDown:sL(s,function(e){var t=uL(e);t&&_[t]&&_[t](e)}),onClick:sL(l,function(){c({type:bz})})},p)},[c,_,h]),addSelectedItem:(0,K.useCallback)(function(e){c({type:xz,selectedItem:e})},[c]),removeSelectedItem:(0,K.useCallback)(function(e){c({type:Sz,selectedItem:e})},[c]),setSelectedItems:(0,K.useCallback)(function(e){c({type:Cz,selectedItems:e})},[c]),setActiveIndex:(0,K.useCallback)(function(e){c({type:wz,activeIndex:e})},[c]),reset:(0,K.useCallback)(function(){c({type:Tz})},[c]),selectedItems:u,activeIndex:l}}var jz=0,Mz=1,Nz=2,Pz=3,Fz=4,Iz=5,Lz=6,Rz=Object.freeze({__proto__:null,FunctionAddItem:Lz,TagClick:jz,TagGroupKeyDownArrowLeft:Mz,TagGroupKeyDownArrowRight:Nz,TagGroupKeyDownBackspace:Fz,TagGroupKeyDownDelete:Pz,TagRemoveClick:Iz});function zz(e,t,n){var r=n.type,i;switch(r){case jz:i={activeIndex:n.index};break;case Mz:i={activeIndex:e.activeIndex===0?e.items.length-1:e.activeIndex-1};break;case Nz:i={activeIndex:e.activeIndex===e.items.length-1?0:e.activeIndex+1};break;case Fz:case Pz:var a=[].concat(e.items.slice(0,e.activeIndex),e.items.slice(e.activeIndex+1)),o=a.length===0?-1:a.length===e.activeIndex?e.activeIndex-1:e.activeIndex;i={items:[].concat(e.items.slice(0,e.activeIndex),e.items.slice(e.activeIndex+1)),activeIndex:o};break;case Iz:var s=[].concat(e.items.slice(0,n.index),e.items.slice(n.index+1));i={items:s,activeIndex:s.length===0?-1:s.length===n.index?n.index-1:n.index};break;case Lz:var c=[];c=n.index===void 0?[].concat(e.items,[n.item]):[].concat(e.items.slice(0,n.index),[n.item],e.items.slice(n.index));var l=e.activeIndex===-1?c.length-1:e.activeIndex;i={items:c,activeIndex:l};break;default:throw Error(`Invalid useTagGroup reducer action.`)}return NI({},e,i)}var Bz=NI({},K).useId,Vz=typeof Bz==`function`?Hz:Uz;function Hz(e){var t=e.id,n=e.tagGroupId,r=e.getTagId,i=`downshift-`+Bz();return t||=i,K.useMemo(function(){return{tagGroupId:n??t+`-tag-group`,getTagId:r??function(e){return t+`-tag-`+e}}},[r,t,n])}function Uz(e){var t=e.id,n=e.getTagId,r=e.tagGroupId,i=K.useRef(t??`downshift-`+KI()).current;return K.useMemo(function(){return{tagGroupId:r??i+`-tag-group`,getTagId:n??function(e){return i+`-tag-`+e}}},[n,i,r])}function Wz(e){var t=e.items??e.initialItems??[];return{activeIndex:e.activeIndex??e.initialActiveIndex??(t.length===0?-1:0),items:t}}function Gz(e,t){return e.activeIndex===t.activeIndex&&e.items===t.items}var Kz=`tag-group-a11y-description`;function qz(e,t){K.useEffect(function(){if(e){var n=e.createElement(`div`);return n.setAttribute(`id`,Kz),n.style.display=`none`,n.textContent=t,e.body.appendChild(n),function(){n.remove()}}},[t,e])}function Jz(e){return NI({stateReducer:function(e,t){return t.changes},environment:typeof window>`u`?void 0:window,removeElementDescription:`Press Delete or Backspace to remove tag.`},e)}function Yz(e,t,n){var r=K.useRef({}),i=K.useRef(e),a=K.useRef(t);return K.useEffect(function(){if(e!==-1&&i.current!==-1&&e!==i.current||a.current===t+1){var o;(o=r.current[n(e)])==null||o.focus()}i.current=e,a.current=t},[e,n,t]),r}var Xz={isItemDisabled:$.default.func},Zz=[`onKeyDown`],Qz=[`index`,`refKey`,`ref`,`onClick`],$z=[`index`,`onClick`],eB=function(e){e===void 0&&(e={}),nL(e,eB,Xz);var t=Jz(e),n=vL(zz,t,Wz,Gz),r=n[0],i=n[1],a=r.activeIndex,o=r.items,s=qI({state:r,props:t}),c=Vz({getTagId:t.getTagId,id:t.id,tagGroupId:t.tagGroupId});qz(t.environment?.document,t.removeElementDescription);var l=Yz(a,o.length,c.getTagId),u=(0,K.useCallback)(function(e){var t=e??{},n=t.onKeyDown,r=MI(t,Zz);return NI({id:c.tagGroupId,"aria-live":`polite`,"aria-atomic":`false`,"aria-relevant":`additions`,role:`listbox`,onKeyDown:YI(n,function(e){switch(e.key){case`ArrowLeft`:i({type:Mz});break;case`ArrowRight`:i({type:Nz});break;case`Delete`:i({type:Pz});break;case`Backspace`:i({type:Fz});break}})},r)},[i,c.tagGroupId]),d=(0,K.useCallback)(function(e){var t,n=e.index,r=e.refKey,a=r===void 0?`ref`:r,o=e.ref,u=e.onClick,d=MI(e,Qz);if(!Number.isInteger(n)||n<0)throw Error(`Pass correct item index to getTagProps!`);var f=s.current.state,p=function(){i({type:jz,index:n})},m=c.getTagId(n);return NI((t={"aria-describedby":Kz},t[a]=JI(o,function(e){e&&(l.current[m]=e)}),t[`aria-labelledby`]=m,t.role=`option`,t.id=m,t.onClick=YI(u,p),t.tabIndex=f.activeIndex===n?0:-1,t),d)},[i,c,s,l]),f=(0,K.useCallback)(function(e){var t=e.index,n=e.onClick,r=MI(e,$z);if(!Number.isInteger(t)||t<0)throw Error(`Pass correct item index to getTagRemoveProps!`);var a=function(e){e.stopPropagation(),i({type:Iz,index:t})},o=c.getTagId(t),s=o+`-remove`;return NI({id:s,tabIndex:-1,"aria-labelledby":s+` `+o,onClick:YI(n,a)},r)},[c,i]);return{activeIndex:a,addItem:(0,K.useCallback)(function(e,t){i({type:Lz,item:e,index:t})},[i]),getTagGroupProps:u,getTagProps:d,getTagRemoveProps:f,items:o}};eB.stateChangeTypes=Rz;function tB({items:e,selectedItems:t,onInputChange:n,onSelectedItemsChange:r,fieldLabel:i,placeholder:a,icon:o,disabled:s,shadowRoot:c,dataTestId:l}){let[u,d]=(0,K.useState)(``),f=(0,K.useRef)(null),p=(0,K.useId)(),m=(0,K.useId)(),h=(0,K.useId)(),g=(0,K.useId)(),_=(0,K.useId)(),v=(0,K.useMemo)(()=>e.filter(e=>e.type===`airport`||e.type===`place`).reduce((e,t)=>{if(t.type===`airport`){let n=t,r=u.toLowerCase();if(n.iata_code.toLowerCase()===r||n.iata_display_list?.some(e=>e.toLowerCase()===r))return t.sectionIndex>=0?[...e,t]:[{...t,sectionIndex:-1},...e]}return[...e,t]},[]).reduce((e,t)=>t.type===`airport`?{items:[...e.items,t],airportCount:e.airportCount+1}:t.type===`place`?e.airportCount<20?{...e,items:[...e.items,t]}:e:e.airportCount<=20?{...e,items:[...e.items,t]}:e,{items:[],airportCount:0}).items,[u,e]);function y(e){return e.kayak?.stateCode&&e.kayak?.countryCode?`${e.name}, ${e.kayak.stateCode}, ${e.kayak.countryCode}`:e.kayak?.countryCode&&!e.kayak?.stateCode?`${e.name}, ${e.kayak.countryCode}`:e.formatted_address}function b(e){return e.state_code?`${e.city}, ${e.state_code}, ${e.country_code}`:e.location_display?e.location_display:`${e.city}, ${e.country_code}`}function x(e){return e.iata_display_list&&e.iata_display_list.length>0?e.iata_display_list.join(`, `):e.iata_code}function S(e){if(e.type===`airport`){let n=e;return t?.length>1?x(n):n.country_code===`US`?`${n.city} (${x(n)})`:`${n.city}, ${n.country_code} (${x(n)})`}if(e.type===`place`){let t=e;return t.formatted_address?.length<20?t.formatted_address:t.name}return``}let C=typeof Proxy==`function`&&!Object.isSealed(new Proxy({},{}));function w(e){let t=e.ownerDocument,n={document:t,addEventListener:t.addEventListener.bind(e),removeEventListener:t.removeEventListener.bind(e),Node:window.Node,Element:window.Element,HTMLElement:window.HTMLElement,SVGElement:window.SVGElement};return C?new Proxy(n,{get(e,t){return e[t]}}):n}let{getSelectedItemProps:T,getDropdownProps:E,removeSelectedItem:D}=Az({selectedItems:t,onStateChange({selectedItems:e,type:t}){t===Az.stateChangeTypes.FunctionRemoveSelectedItem&&r(e)}}),{isOpen:O,getMenuProps:k,getInputProps:A,getItemProps:j,highlightedIndex:M,setHighlightedIndex:N}=iz({environment:c?w(c):void 0,items:v,isItemDisabled(e){return!!e?.disabled},itemToKey(e){return e?.key??``},itemToString(e){return e?e.type===`airport`?S(e):e.name??``:``},defaultHighlightedIndex:0,selectedItem:null,inputValue:u,stateReducer(e,t){let{changes:n,type:r}=t;switch(r){case iz.stateChangeTypes.InputKeyDownEnter:case iz.stateChangeTypes.ItemClick:return n;case iz.stateChangeTypes.InputKeyDownArrowDown:case iz.stateChangeTypes.InputKeyDownArrowUp:return n;case iz.stateChangeTypes.InputBlur:return n;case iz.stateChangeTypes.FunctionCloseMenu:return{...n,isOpen:!0};case iz.stateChangeTypes.InputKeyDownEscape:return n;case iz.stateChangeTypes.ItemMouseMove:return e;default:return n}},onStateChange({inputValue:e,type:t,selectedItem:n}){switch(t){case iz.stateChangeTypes.InputKeyDownEnter:case iz.stateChangeTypes.ItemClick:n&&(r([n]),d(``));break;case iz.stateChangeTypes.MenuMouseLeave:case iz.stateChangeTypes.ItemMouseMove:break;case iz.stateChangeTypes.InputKeyDownArrowDown:case iz.stateChangeTypes.InputKeyDownArrowUp:break;case iz.stateChangeTypes.InputBlur:break;case iz.stateChangeTypes.ControlledPropUpdatedSelectedItem:break;default:break}}}),P=(0,K.useMemo)(()=>{if(s)return`Field is locked.`;if(O&&v.length>0){let e=v.length;return`Suggestion list open, ${e} ${e===1?`option`:`options`}.`}return O&&v.length===0?u.trim()?`Suggestion list open, no matching options.`:`Suggestion list open, no options yet.`:`Suggestion list closed.`},[s,O,v.length,u]),ee=(0,K.useMemo)(()=>`Type to search airports and places. When the list is open, use arrow keys to move through suggestions and Enter to choose. Tab to selected locations above to remove them, or press Backspace in this field when it is empty.`,[]),F=i?`${i}, search airports and places`:`Search airports and places`,te=i?`${i} suggestions`:`Search results`,ne=t.length===0?`No airport or place selected.`:(()=>{let e=t.map(e=>S(e));return`Selected ${t.length===1?`location`:`${t.length} locations`}: ${e.join(`, `)}.`})(),re=[h,g,_].join(` `);(0,K.useEffect)(()=>{s&&queueMicrotask(()=>d(``))},[s]);let ie=!!s;function ae(){let e=A({...E(),id:m,role:`combobox`,"aria-autocomplete":`list`,"aria-expanded":O,"aria-controls":O?p:void 0,"aria-activedescendant":O&&M!=null&&M>-1?`${p}-${M}`:void 0,"aria-label":F,onChange:e=>{let t=e.currentTarget.value;d(t),n(t)},onKeyDown:e=>{if(e.key===`Backspace`&&!u&&t.length>0&&!s){let e=t[t.length-1];D(e)}}});return(0,q.jsx)(`input`,{className:(0,J.default)(`aone:outline-none aone:disabled:bg-transparent aone:text-base aone:placeholder:text-gray-500`,{"aone:min-w-[120px] aone:max-w-[200px]":t.length>0,"aone:w-full":t.length===0}),placeholder:!ie&&t.length===0?a:``,...e,"aria-describedby":re,disabled:ie})}return(0,q.jsxs)(`div`,{className:`aone:w-full aone:h-full aone:relative aone:z-10`,"data-testid":l,role:`group`,"aria-disabled":s?!0:void 0,children:[(0,q.jsxs)(`div`,{className:(0,J.default)({"aone:bg-white aone:rounded-lg aone:gap-2 aone:items-center aone:py-2 aone:px-3 aone:h-[44px] aone:box-border aone:w-full aone:overflow-hidden":!0,"aone:grid":!0,"aone:grid-cols-[24px_1fr]":t.length===0,"aone:grid-cols-[24px_auto_1fr]":t.length===1,"aone:grid-cols-[24px_auto_auto_1fr]":t.length===2,"aone:grid-cols-[24px_auto_auto_auto_1fr]":t.length===3,"aone:border-2 aone:border-gray-200 aone:focus-within:border-primary":!0,"aone:opacity-60 aone:cursor-not-allowed":!!s}),children:[o,t.map((e,n)=>(0,q.jsxs)(`span`,{...T({selectedItem:e,index:n}),"aria-label":`Selected location: ${S(e)}. Item ${n+1} of ${t.length}.`,className:(0,J.default)({"aone:bg-gray-200 aone:rounded aone:px-1 aone:focus:bg-gray-400 aone:whitespace-nowrap aone:text-ellipsis aone:shrink-0":!0,"aone:text-sm":t.length>0,"aone:flex aone:items-center":!0}),children:[(0,q.jsx)(`span`,{className:`aone:overflow-hidden aone:grow aone:font-medium`,children:S(e)}),!e.disabled&&(0,q.jsx)(`button`,{type:`button`,disabled:!!s||!!e.disabled,className:(0,J.default)(`aone:ml-2 aone:text-base aone:leading-[20px] aone:rounded aone:px-1 aone:transition-colors`,{"aone:hover:bg-gray-300 aone:focus-visible:outline-none aone:focus-visible:ring-2 aone:focus-visible:ring-offset-2 aone:focus-visible:ring-gray-400":!s&&!e.disabled,"aone:cursor-not-allowed aone:opacity-60":!!s}),"data-testid":`autocomplete-remove-item-button`,"aria-label":`Remove ${S(e)}`,onClick:t=>{t.stopPropagation(),!s&&D(e)},children:`×`})]},n)),(0,q.jsx)(`span`,{id:h,className:`aone:sr-only`,children:ne}),(0,q.jsx)(`span`,{id:g,className:`aone:sr-only`,children:P}),(0,q.jsx)(`span`,{id:_,className:`aone:sr-only`,children:ee}),ae()]}),O&&v.length>0&&(0,q.jsx)(`div`,{className:`aone:absolute aone:w-inherit aone:bg-white aone:mt-2 aone:rounded-lg aone:overflow-hidden aone:shadow-md aone:p-0 aone:z-10`,children:(0,q.jsx)(`ul`,{ref:f,...k(),id:p,role:`listbox`,"aria-multiselectable":`true`,"aria-label":te,tabIndex:-1,className:`aone:overflow-y-auto aone:overflow-x-hidden aone:focus:outline-none aone:focus:ring-2 aone:focus:ring-blue-500 aone:focus:ring-offset-2`,children:v.map((e,n)=>{if(e.type===`airport`){let r=e,i=(r.distance||0)*.621371,a=M===n,o=e.sectionIndex>-1&&!r.kayak_shimmed,s=!!t.find(t=>t.key===e.key),c=n+1;return(0,q.jsxs)(`li`,{...j({item:e,index:n,onMouseEnter:()=>N(n)}),id:`${p}-${n}`,role:`option`,tabIndex:-1,"aria-selected":s,"aria-label":`Option ${c} - ${r.name}, ${b(r)}, ${x(r)}${o?`, ${i.toFixed(+(i<1))} miles away`:``}, ${s?`selected`:`not selected`}`,className:(0,J.default)({"aone:hover:bg-blue-100":!0,"aone:bg-blue-100":a,"aone:font-bold":a,"aone:shadow-sm aone:py-2 aone:px-2 aone:cursor-pointer":!0,"aone:pl-5 aone:border-l-4 aone:border-gray-500":e.sectionIndex>-1,"aone:grid aone:grid-cols-[26px_1fr_30px] aone:gap-1 aone:justify-start aone:items-center":!0,"aone:focus:outline-none aone:focus:ring-2 aone:focus:ring-blue-500 aone:focus:ring-offset-2":!0}),children:[(0,q.jsx)(yI,{className:`aone:w-6 aone:h-6 aone:-rotate-45`,icon:wA}),(0,q.jsxs)(`div`,{className:`aone:flex aone:flex-col aone:grow aone:gap-1 aone:overflow-hidden`,children:[(0,q.jsxs)(`div`,{className:`aone:gap-2 aone:flex aone:items-center aone:w-full`,children:[(0,q.jsx)(`span`,{className:`aone:flex-1 aone:min-w-0 aone:font-medium aone:text-base aone:whitespace-nowrap aone:overflow-hidden aone:text-ellipsis`,children:r.name}),(0,q.jsx)(`span`,{className:`aone:text-sm aone:uppercase aone:shrink-0 aone:text-gray-500`,children:x(r)})]}),(0,q.jsxs)(`span`,{className:`aone:text-sm aone:text-gray-500`,children:[b(r),o&&(0,q.jsxs)(q.Fragment,{children:[`\xA0•\xA0`,i.toFixed(+(i<1)),`mi`]})]})]}),(0,q.jsx)(`div`,{className:`aone:flex aone:justify-end aone:pl-1`,"aria-hidden":`true`,children:(0,q.jsx)(`span`,{className:(0,J.default)(`aone:h-4 aone:w-4 aone:shrink-0 aone:rounded-sm aone:border`,{"aone:border-gray-400 aone:bg-white":!s,"aone:border-primary aone:bg-primary":s})})})]},`${e.key}-${n}`)}if(e.type===`place`){let r=e,i=M===n,a=Kg(r.kayak?.apicode),o=y(r),s=!!t.find(t=>t.key===e.key);return(0,q.jsxs)(`li`,{...j({item:e,index:n,onMouseEnter:()=>N(n)}),id:`${p}-${n}`,role:`option`,tabIndex:-1,"aria-selected":s,"aria-label":`${a?`${r.name}, ${a}, ${o}`:`${r.name}, ${o}`}, ${s?`selected`:`not selected`}`,className:(0,J.default)({"aone:hover:bg-blue-100":!0,"aone:bg-blue-100":i,"aone:font-bold":i,"aone:shadow-sm aone:py-2 aone:px-2 aone:cursor-pointer":!0,"aone:grid aone:grid-cols-[26px_1fr_30px] aone:gap-1 aone:justify-start aone:items-center":!0,"aone:focus:outline-none aone:focus:ring-2 aone:focus:ring-blue-500 aone:focus:ring-offset-2":!0}),children:[(0,q.jsx)(yI,{className:`aone:w-6 aone:h-6`,icon:DA}),(0,q.jsxs)(`div`,{className:`aone:flex aone:flex-col aone:grow aone:gap-1 aone:overflow-hidden`,children:[(0,q.jsxs)(`div`,{className:`aone:gap-2 aone:flex aone:items-end aone:w-full`,children:[(0,q.jsx)(`span`,{className:`aone:flex-1 aone:min-w-0 aone:font-medium aone:text-base aone:whitespace-nowrap aone:overflow-hidden aone:text-ellipsis`,children:r.name}),a&&(0,q.jsx)(`span`,{className:`aone:text-sm aone:uppercase aone:shrink-0 aone:text-gray-500`,children:a})]}),(0,q.jsx)(`span`,{className:`aone:text-sm aone:shrink-0 aone:text-gray-500`,children:o})]}),(0,q.jsx)(`div`,{className:`aone:flex aone:justify-end aone:pl-1`,"aria-hidden":`true`,children:(0,q.jsx)(`span`,{className:(0,J.default)(`aone:h-4 aone:w-4 aone:shrink-0 aone:rounded-sm aone:border`,{"aone:border-gray-400 aone:bg-white":!s,"aone:border-primary aone:bg-primary":s})})})]},`${e.key}-${n}`)}})})})]})}function nB({hideByDefault:e=!0}){return(0,q.jsx)(`div`,{className:(0,J.default)({"aone:pb-0.5 aone:flex-col aone:items-center aone:@2xl:items-end aone:@2xl:w-[175px]":!0,"aone:hidden aone:@2xl:flex":e,flex:!e}),children:(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`p`,{className:`aone:text-center aone:text-[12px] aone:text-black aone:dark:text-white`,children:`Powered by`}),(0,q.jsx)(`div`,{className:`aone:flex aone:justify-center aone:max-w-[95px]`,children:(0,q.jsx)(`img`,{src:`https://content.r9cdn.net/res/images/horizon/common/promo/powered-kayak-logo.png?v=5845dc09c6b1c19380844fe6157a3b640856624b&cluster=4`,alt:`Kayak`,width:95,height:21})})]})})}var rB=s(((e,t)=>{function n(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}t.exports=n})),iB=s(((e,t)=>{t.exports=typeof global==`object`&&global&&global.Object===Object&&global})),aB=s(((e,t)=>{var n=iB(),r=typeof self==`object`&&self&&self.Object===Object&&self;t.exports=n||r||Function(`return this`)()})),oB=s(((e,t)=>{var n=aB();t.exports=function(){return n.Date.now()}})),sB=s(((e,t)=>{var n=/\s/;function r(e){for(var t=e.length;t--&&n.test(e.charAt(t)););return t}t.exports=r})),cB=s(((e,t)=>{var n=sB(),r=/^\s+/;function i(e){return e&&e.slice(0,n(e)+1).replace(r,``)}t.exports=i})),lB=s(((e,t)=>{t.exports=aB().Symbol})),uB=s(((e,t)=>{var n=lB(),r=Object.prototype,i=r.hasOwnProperty,a=r.toString,o=n?n.toStringTag:void 0;function s(e){var t=i.call(e,o),n=e[o];try{e[o]=void 0;var r=!0}catch{}var s=a.call(e);return r&&(t?e[o]=n:delete e[o]),s}t.exports=s})),dB=s(((e,t)=>{var n=Object.prototype.toString;function r(e){return n.call(e)}t.exports=r})),fB=s(((e,t)=>{var n=lB(),r=uB(),i=dB(),a=`[object Null]`,o=`[object Undefined]`,s=n?n.toStringTag:void 0;function c(e){return e==null?e===void 0?o:a:s&&s in Object(e)?r(e):i(e)}t.exports=c})),pB=s(((e,t)=>{function n(e){return typeof e==`object`&&!!e}t.exports=n})),mB=s(((e,t)=>{var n=fB(),r=pB(),i=`[object Symbol]`;function a(e){return typeof e==`symbol`||r(e)&&n(e)==i}t.exports=a})),hB=s(((e,t)=>{var n=cB(),r=rB(),i=mB(),a=NaN,o=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,c=/^0o[0-7]+$/i,l=parseInt;function u(e){if(typeof e==`number`)return e;if(i(e))return a;if(r(e)){var t=typeof e.valueOf==`function`?e.valueOf():e;e=r(t)?t+``:t}if(typeof e!=`string`)return e===0?e:+e;e=n(e);var u=s.test(e);return u||c.test(e)?l(e.slice(2),u?2:8):o.test(e)?a:+e}t.exports=u})),gB=u(s(((e,t)=>{var n=rB(),r=oB(),i=hB(),a=`Expected a function`,o=Math.max,s=Math.min;function c(e,t,c){var l,u,d,f,p,m,h=0,g=!1,_=!1,v=!0;if(typeof e!=`function`)throw TypeError(a);t=i(t)||0,n(c)&&(g=!!c.leading,_=`maxWait`in c,d=_?o(i(c.maxWait)||0,t):d,v=`trailing`in c?!!c.trailing:v);function y(t){var n=l,r=u;return l=u=void 0,h=t,f=e.apply(r,n),f}function b(e){return h=e,p=setTimeout(C,t),g?y(e):f}function x(e){var n=e-m,r=e-h,i=t-n;return _?s(i,d-r):i}function S(e){var n=e-m,r=e-h;return m===void 0||n>=t||n<0||_&&r>=d}function C(){var e=r();if(S(e))return w(e);p=setTimeout(C,x(e))}function w(e){return p=void 0,v&&l?y(e):(l=u=void 0,f)}function T(){p!==void 0&&clearTimeout(p),h=0,l=m=u=p=void 0}function E(){return p===void 0?f:w(r())}function D(){var e=r(),n=S(e);if(l=arguments,u=this,m=e,n){if(p===void 0)return b(m);if(_)return clearTimeout(p),p=setTimeout(C,t),y(m)}return p===void 0&&(p=setTimeout(C,t)),f}return D.cancel=T,D.flush=E,D}t.exports=c}))(),1);async function _B({departureAirport:e,apiDomain:t,sessionId:n,clickId:r}){let i=new URLSearchParams({departureAirportIATA:e}).toString(),a={};n&&(a[jb]=n),r&&(a[Mb]=r);let o=await fetch(`${t}/api/iata-auto-complete?${i}`,{headers:a});if(!o.ok)throw console.error(`Unable to fetch airport suggestions`,{departureAirport:e,apiDomain:t,status:o.status,statusText:o.statusText}),Error(`Unable to fetch airport suggestions`);let s=await o.json();return Ag.parse(s)}async function vB(e,t,n,r,i){if(!t)return[];let a=await _B({query:e,departureAirport:t,apiDomain:n,sessionId:r,clickId:i});return a.success?a.data.map(e=>({itemType:G.AIRPORT,iata_code:e.airportIATA,city:e.city,state:e.state,country:e.country,stops:e.stops||0,airlineCodes:e.airlineCodes||[],name:e.city+` (`+e.airportIATA+`)`,type:`airport`,lat:0,lng:0,country_code:e.country||``,geometry:{location:{lat:0,lng:0}},formatted_address:``,cid:e.airportIATA,types:[`airport`],nearbyAirports:[{name:e.airportIATA+` (`+e.city+`)`,iata_code:e.airportIATA,city:e.city,country_code:e.country,stops:e.stops||0,airlineCodes:e.airlineCodes||[],routeStart:e.routeStart,lat:0,lng:0}]})).map(e=>{let t={...e,airlineCodes:e.airlineCodes?.map(e=>e===`DWI`?`DW`:e)};return t.nearbyAirports=e.nearbyAirports.map(e=>({...e,airlineCodes:e.airlineCodes?.map(e=>e===`DWI`?`DW`:e)})),t}).sort((e,t)=>!e.city||!t.city?0:e.city.localeCompare(t.city)):[]}async function yB({query:e,departureAirport:t,marketingCarrierCodeIATA:n,apiDomain:r,sessionId:i,clickId:a}){let o=new URLSearchParams({query:e,departureAirportIATA:t,marketingCarrierCodeIATA:n}).toString(),s={};i&&(s[jb]=i),a&&(s[Mb]=a);let c=await fetch(`${r}/api/iata-directs?${o}`,{headers:s});if(!c.ok)throw console.error(`Unable to fetch airport suggestions`,{departureAirport:t,apiDomain:r,status:c.status,statusText:c.statusText}),Error(`Unable to fetch airport suggestions`);let l=await c.json();return Gp.parse(l)}async function bB(e,t,n,r,i,a){if(!t)return[];let o=await yB({query:e,departureAirport:t,marketingCarrierCodeIATA:n,apiDomain:r,sessionId:i,clickId:a});return o.success?o.data.map(e=>({itemType:G.AIRPORT,iata_code:e.airportIATA,city:e.city,lat:0,lng:0,country_code:e.country,name:e.airportIATA+` (`+e.city+`)`,geometry:{location:{lat:0,lng:0}},formatted_address:``,cid:e.airportIATA,types:[`airport`],nearbyAirports:[{name:e.airportIATA+` (`+e.city+`)`,iata_code:e.airportIATA,city:e.city,country_code:e.country,lat:0,lng:0}]})):[]}function xB(e){return Math.PI/180*e}function SB(e){return e*.621371}function CB(e,t,n,r){let i=xB(n-e),a=xB(r-t),o=Math.sin(i/2)*Math.sin(i/2)+Math.cos(xB(e))*Math.cos(xB(n))*Math.sin(a/2)*Math.sin(a/2);return 6371*(2*Math.atan2(Math.sqrt(o),Math.sqrt(1-o)))}function wB(e,t){if(!Array.isArray(e.types)||!e.types.includes(`place`)||e.itemType!==G.METRO)return!1;let n=Gg(e.kayak?.apicode);if(n.length>0&&n.includes(t.id.toUpperCase()))return!0;let r=e.kayak?.ctid;if(r!==void 0&&r===t.ctid)return!0;let i=e.kayak?.metroId?.toUpperCase(),a=t.cityCode?.toUpperCase();return!!(t.sub===!0&&i&&a===i)}function TB(e){let t=new Set;for(let n=0;n<e.length;n++){let r=e[n];if(!r||!Array.isArray(r.types)||!r.types.includes(`airport`))continue;let i=r.kayakAirport;if(!i)continue;let a=e.findIndex(e=>wB(e,i));if(a<0)continue;let o=e[a],s=r.nearbyAirports[0];if(s){if(!o.nearbyAirports.some(e=>e.iata_code.toUpperCase()===s.iata_code.toUpperCase())){let{lat:e,lng:t}=o.geometry.location;s.distance=SB(CB(e,t,s.lat,s.lng)),o.nearbyAirports.push(s)}t.add(n)}}return e.filter((e,n)=>!t.has(n))}function EB(e){if(!Array.isArray(e.types)||!e.types.includes(`place`))return;let t=e.kayak?.apicode;if(!t?.trim())return;let n=Gg(t);if(n.length===0)return;let r=n.length>1,{lat:i,lng:a}=e.geometry.location,o=e.name,s=e.kayak?.stateCode,c=e.kayak?.countryCode;if(!c)return;let l=e.kayak?.metroId??``,u=t=>e.nearbyAirports.find(e=>e.iata_code.toUpperCase()===t.toUpperCase()),d=[],f=new Set,p=l.toUpperCase();for(let t of n){let n=t.toUpperCase(),l=u(t);if(n===p){l?(d.push(l),f.add(t)):r&&(d.push({iata_code:t,city:o,lat:i,lng:a,country_code:c,name:`${o} (${t})`,state_code:s,location_display:s?void 0:e.formatted_address,kayak_shimmed:!0}),f.add(t));continue}l?(d.push(l),f.add(t)):r&&(d.push({iata_code:t,city:o,lat:i,lng:a,country_code:c,name:`${o} (${t})`,state_code:s,location_display:s?void 0:e.formatted_address,kayak_shimmed:!0}),f.add(t))}for(let t of e.nearbyAirports){let e=t.iata_code.toUpperCase();f.has(e)||d.push(t)}let m=d.filter(e=>e.kayak_shimmed),h=d.filter(e=>!e.kayak_shimmed);h.sort((e,t)=>{let n=e.distance??1/0,r=t.distance??1/0;return n===r?e.iata_code.localeCompare(t.iata_code):n-r}),e.nearbyAirports=[...m,...h]}async function DB({query:e,searchType:t}){let n=await fetch(`https://www.kayak.com/mv/marvel?f=j&s=${t}&v=v1&where=${e}&lc=en&lc_cc=US`);if(!n.ok)throw Error(`Unable to get kayak suggestions`);return await n.json()}async function OB(e,t=qg.Hotels){if(!e?.length||e.length<3)return[];let n=TB((await DB({query:e,searchType:t})).reduce((e,t)=>{if(t.isMetroOnly){let n=t.rc?.trim();e.push({nearbyAirports:[],itemType:G.METRO,iata_code:t.displayType.type===`country`?void 0:t.id,formatted_address:t.cityname,geometry:{location:{lat:t.lat,lng:t.lng}},name:t.cityonly,cid:t.cid,kayak:{ctid:t.ctid,apicode:t.apicode,stateCode:n||void 0,countryCode:t.cc,metroId:t.id,metroAirportName:t.airportname},types:[`place`]})}else if(t.displayType.type===`country`)e.push({nearbyAirports:[],itemType:G.AIRPORT,formatted_address:t.displayname,geometry:{location:{lat:t.lat,lng:t.lng}},name:t.displayname,cid:t.cid,types:[`place`]});else if(t.displayType.type===`state`)e.push({nearbyAirports:[],itemType:G.AIRPORT,formatted_address:t.displayname,geometry:{location:{lat:t.lat,lng:t.lng}},name:t.displayname,cid:t.cid,types:[`place`]});else if(t.displayType.type===`airport`){let n=e.findIndex(e=>wB(e,t)),r=t.rc?.trim(),i={iata_code:t.id,city:t.cityonly,lat:t.lat,lng:t.lng,country_code:t.cc,name:t.displayname,state_code:r||void 0,location_display:r?void 0:t.cityname};if(n>-1){let{lat:r,lng:a}=e[n].geometry.location;i.distance=SB(CB(r,a,t.lat,t.lng)),e[n].nearbyAirports.push(i)}else e.push({nearbyAirports:[i],itemType:G.AIRPORT,formatted_address:t.cityname,geometry:{location:{lat:t.lat,lng:t.lng}},name:t.name,rid:t.rid,kayakAirport:{id:t.id,ctid:t.ctid,sub:t.sub,cityCode:t.cityCode},types:[`airport`]})}return e},[]));for(let e of n)EB(e);return n}function kB({key:e,apiDomain:t,airportIATA:n,providersArr:r,airlinesArr:i,debounceTime:a=500,autocompleteType:o=`kayak`}){let{sessionId:s}=Eb(),{clickId:c}=Pv(),[l,u]=(0,K.useState)(``),d=(0,K.useMemo)(()=>(0,gB.default)(u,a),[a]),{data:f,status:p}=yb({queryKey:[e,n,r,i,l,o,s].flat(),queryFn:()=>o===Xg.schedule_data&&n?.length&&n?.length===3?vB(l,n,t,s,c):n?.length&&n?.length===3&&(r?.length||0)>0&&(i?.length||0)>0&&r?.every(e=>e===`G4`)&&i?.every(e=>e===`G4`)?bB(l,n,i[0],t,s,c):OB(l),enabled:!!s});return{data:f,status:p,setQuery:d}}function AB(){return(0,q.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:2,stroke:`currentColor`,"aria-hidden":`true`,className:`aone:w-6 aone:h-6`,children:(0,q.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z`})})}function jB({value:e,onChange:t}){return(0,q.jsxs)(`div`,{className:`aone:flex aone:flex-col aone:gap-2`,children:[(0,q.jsx)(`label`,{className:`aone:text-sm aone:font-medium aone:text-gray-700 aone:dark:text-gray-300`,children:`Pick-up / Drop-off location`}),(0,q.jsxs)(`div`,{className:`aone:flex aone:items-center aone:gap-3`,children:[(0,q.jsx)(`span`,{className:`aone:text-sm aone:font-medium aone:text-gray-700 aone:dark:text-gray-300`,children:`Same`}),(0,q.jsx)(`button`,{type:`button`,onClick:()=>t(e===`same-location`?`different-location`:`same-location`),className:`aone:relative aone:inline-flex aone:h-6 aone:w-11 aone:shrink-0 aone:cursor-pointer aone:items-center aone:rounded-full aone:border-2 aone:border-transparent aone:transition-colors aone:focus-visible:outline-none aone:focus-visible:ring-2 aone:focus-visible:ring-blue-500 aone:focus-visible:ring-offset-2 ${e===`different-location`?`aone:bg-blue-600 aone:dark:bg-blue-500`:`aone:bg-gray-200 aone:dark:bg-gray-600`}`,"aria-label":`Toggle to ${e===`same-location`?`different location`:`same location`}`,children:(0,q.jsx)(`span`,{className:`aone:pointer-events-none aone:block aone:h-5 aone:w-5 aone:rounded-full aone:bg-white aone:shadow-lg aone:ring-0 aone:transition-transform ${e===`different-location`?`aone:translate-x-5`:`aone:translate-x-0`}`})}),(0,q.jsx)(`span`,{className:`aone:text-sm aone:font-medium aone:text-gray-700 aone:dark:text-gray-300`,children:`Different`})]})]})}function MB({shadowRoot:e,origin:t,theme:n}){let{apiDomain:r}=kb(),[i,a]=(0,K.useState)(`same-location`),[o,s]=(0,K.useState)(t.toUpperCase()),[c,l]=(0,K.useState)(t.toUpperCase()),[u,d]=(0,K.useState)(``),[f,p]=(0,K.useState)(`12:00`),[m,h]=(0,K.useState)(``),[g,_]=(0,K.useState)(`12:00`),v=(0,K.useMemo)(()=>u&&f?`${u}T${f}`:``,[u,f]),y=(0,K.useMemo)(()=>m&&g?`${m}T${g}`:``,[m,g]),b=i===`same-location`?o:c,{data:x,status:S,setQuery:C}=kB({key:`carfare-from-suggest`,apiDomain:r,airportIATA:b}),{data:w,status:T,setQuery:E}=kB({key:`carfare-to-suggest`,apiDomain:r,airportIATA:o}),[D,O]=(0,K.useState)([]),[k,A]=(0,K.useState)([]),[j,M]=(0,K.useState)(!1);(0,K.useEffect)(()=>{t&&t.length===3&&!j&&C(t)},[t,C,j]),(0,K.useEffect)(()=>{if(x&&x.length>0&&!D.length&&!j){let e=x.filter(e=>e.nearbyAirports?.length).flatMap(e=>e.nearbyAirports).find(e=>e.iata_code?.toUpperCase()===t.toUpperCase());if(e){let t={...e,sectionIndex:0,type:`airport`,key:e.iata_code},n=e.iata_code??``;queueMicrotask(()=>{O([t]),s(n),M(!0)})}}},[x,t,D.length,j]);let N=(0,K.useMemo)(()=>x?x.filter(e=>e.nearbyAirports?.length).map(e=>{let t=e.types.includes(`airport`);return[{...e,sectionIndex:0,type:t?`airport-place`:`place`,key:e.formatted_address},...e.nearbyAirports.map((e,n)=>({...e,sectionIndex:t?-1:n,type:`airport`,key:`${e.iata_code}`}))]}).flat().filter((e,t,n)=>{if(e.type===`place`){let e=n.at(t+1);if(!e||e.type!==`airport`)return!1}return!0}):[],[x]),P=(0,K.useMemo)(()=>w?w.filter(e=>e.nearbyAirports?.length).map(e=>{let t=e.types.includes(`airport`);return[{...e,sectionIndex:0,type:t?`airport-place`:`place`,key:e.formatted_address},...e.nearbyAirports.map((e,n)=>({...e,sectionIndex:t?-1:n,type:`airport`,key:`${e.iata_code}`}))]}).flat().filter((e,t,n)=>{if(e.type===`place`){let e=n.at(t+1);if(!e||e.type!==`airport`)return!1}return!0}):[],[w]),ee=(0,K.useCallback)(()=>{let e=/^[A-Za-z]{3}$/,t=e.test(o),n=e.test(b);if(!t||!n||!v||!y)return;let r=new URLSearchParams({fromAirport:o.toUpperCase(),toAirport:b.toUpperCase(),tripOption:i,fromDateTime:v,toDateTime:y}),a=`https://flymyairport.com/from/${o.toUpperCase()}/cars?${r.toString()}`,s=document.createElement(`a`);s.href=a,s.target=`_blank`,s.rel=`noopener noreferrer`,s.click(),s.remove()},[o,b,i,v,y]),F=(0,K.useMemo)(()=>{let e=/^[A-Za-z]{3}$/;if(!e.test(o)||!e.test(b)||!v||!y)return!1;try{let e=new Date(v),t=new Date(y),n=new Date;return n.setHours(0,0,0,0),e.getTime()<=t.getTime()&&e.getTime()>=n.getTime()}catch{return!1}},[o,b,v,y]);return(0,q.jsxs)(`div`,{className:`aone:flex aone:flex-col aone:gap-3`,part:`carfare-search-container`,"data-mode":n,children:[(0,q.jsxs)(`div`,{className:`aone:flex aone:items-center aone:justify-between aone:gap-2`,children:[(0,q.jsx)(jB,{value:i,onChange:a}),(0,q.jsx)(`div`,{className:`aone:ml-2`,children:(0,q.jsx)(nB,{hideByDefault:!1})})]}),(0,q.jsxs)(`div`,{className:`aone:flex aone:flex-col aone:md:flex-row aone:md:flex-wrap aone:gap-2 aone:md:gap-4 aone:md:items-end`,children:[(0,q.jsxs)(`div`,{className:`aone:w-full aone:md:w-auto aone:md:flex-1 aone:md:min-w-[200px] aone:h-[72px]`,children:[(0,q.jsx)(`label`,{className:`aone:block aone:text-sm aone:font-medium aone:text-gray-700 aone:dark:text-gray-300`,children:`Pick-up Location`}),(0,q.jsx)(`div`,{className:`aone:mt-1 aone:md:mt-2`,children:(0,q.jsx)(tB,{shadowRoot:e,dataTestId:`carfare-from-airport`,icon:S===`pending`?(0,q.jsx)(qv,{}):(0,q.jsx)(AB,{}),placeholder:`From?`,items:N,selectedItems:D,onInputChange:C,onSelectedItemsChange:e=>{if(!e||e.length===0){O([]),s(``);return}let t=e[0];t.type===`airport`&&(O(e),s(t.iata_code??``))}})})]}),i===`different-location`&&(0,q.jsxs)(`div`,{className:`aone:w-full aone:md:w-auto aone:md:flex-1 aone:md:min-w-[200px]`,children:[(0,q.jsx)(`label`,{className:`aone:block aone:text-sm aone:font-medium aone:text-gray-700 aone:dark:text-gray-300`,children:`Drop-off Location`}),(0,q.jsx)(`div`,{className:`aone:mt-1 aone:md:mt-2`,children:(0,q.jsx)(tB,{shadowRoot:e,dataTestId:`carfare-to-airport`,icon:T===`pending`?(0,q.jsx)(qv,{}):(0,q.jsx)(AB,{}),placeholder:`To?`,items:P,selectedItems:k,onInputChange:E,onSelectedItemsChange:e=>{if(!e||e.length===0){A([]),l(``);return}let t=e[0];t.type===`airport`&&(A(e),l(t.iata_code??``))}})})]}),(0,q.jsx)(jI,{label:`Pick-up Date`,dateValue:u,timeValue:f,onDateChange:e=>{let t=e?e.toISOString().split(`T`)[0]??``:``;d(t),t&&h(e=>{if(e)return e;let n=new Date(t);return n.setDate(n.getDate()+1),n.toISOString().split(`T`)[0]??``})},onTimeChange:e=>p(e),origin:o,destination:b,minDate:new Date,shadowRoot:e}),(0,q.jsx)(jI,{label:`Drop-off Date`,dateValue:m,timeValue:g,onDateChange:e=>{h(e?e.toISOString().split(`T`)[0]??``:``)},onTimeChange:e=>_(e),origin:o,destination:b,minDate:u?new Date(u):new Date,shadowRoot:e,referenceDates:(()=>{let e=[];if(u){let t=u.split(`-`);if(t.length===3){let n=t[0],r=t[1],i=t[2],a=parseInt(n,10),o=parseInt(r,10),s=parseInt(i,10);!Number.isNaN(a)&&!Number.isNaN(o)&&!Number.isNaN(s)&&e.push({date:new Date(a,o-1,s,12,0,0),label:`Pick-up`})}}if(m){let t=m.split(`-`);if(t.length===3){let n=t[0],r=t[1],i=t[2],a=parseInt(n,10),o=parseInt(r,10),s=parseInt(i,10);!Number.isNaN(a)&&!Number.isNaN(o)&&!Number.isNaN(s)&&e.push({date:new Date(a,o-1,s,12,0,0),label:`Drop-off`})}}return e.length?e:void 0})()}),(0,q.jsx)(`button`,{type:`button`,disabled:!F,onClick:ee,"aria-label":`Search for car rentals`,className:`aone:w-full aone:md:w-auto aone:px-6 aone:py-2 aone:bg-green-500 aone:dark:bg-green-600 aone:text-white aone:rounded-lg aone:focus:outline-none aone:focus:ring-2 aone:focus:ring-green-700 aone:focus:ring-offset-2 aone:h-[44px] aone:text-base aone:font-medium aone:enabled:hover:bg-green-700 aone:enabled:active:bg-green-700 aone:disabled:bg-gray-400 aone:dark:disabled:bg-gray-600 aone:disabled:text-white/70 aone:disabled:cursor-not-allowed`,children:(0,q.jsxs)(`div`,{className:`aone:flex aone:items-center aone:justify-center aone:gap-2`,children:[(0,q.jsx)(AB,{}),(0,q.jsx)(`span`,{children:`Search`})]})})]})]})}var NB=new tb;function PB({children:e,props:t}){return(0,q.jsx)(ib,{client:NB,children:(0,q.jsx)(Ob,{apiDomain:t.apiDomain,consentAnalytics:t.consentAnalytics,consentAdvertising:t.consentAdvertising,consentFunctional:t.consentFunctional,children:e})})}function FB(e){return!e.origin||e.origin.length!==3?(console.error(`Origin is not a valid IATA code, not rendering widget.`),null):(0,q.jsxs)(PB,{props:e,children:[(0,q.jsx)(`style`,{children:Ab}),e.userStyleBlock?(0,q.jsx)(`style`,{children:e.userStyleBlock}):null,(0,q.jsx)(xb,{componentName:`carfare search`,children:(0,q.jsx)(K.Suspense,{fallback:(0,q.jsx)(qv,{}),children:(0,q.jsx)(MB,{shadowRoot:e.shadowRoot,origin:e.origin,theme:e.theme})})})]})}var IB=[`origin`,`primary-color`,`secondary-color`,`consent-analytics`,`consent-advertising`,`consent-functional`,`theme`,o_,`id`],LB=class extends HTMLElement{_shadowRoot;_mountPoint;_reactRoot;_renderInProgress=!1;_renderQueued=!1;_renderScheduled=!1;_mountTelemetrySent=!1;_lastPublicConfigTelemetryKey=null;static get observedAttributes(){return Array.from(IB)}attributeChangedCallback(e,t,n){t!==n&&this.isConnected&&this._scheduleRender()}connectedCallback(){this.style.position=`relative`,this.style.zIndex=`10`,this.style.lineHeight=`1.5`,this.style.display=`flex`,this.style.flexDirection=`column`,this._scheduleRender()}disconnectedCallback(){this._reactRoot&&=(this._reactRoot.unmount(),void 0),this._mountTelemetrySent=!1,this._lastPublicConfigTelemetryKey=null}_scheduleRender(){this._renderScheduled||(this._renderScheduled=!0,queueMicrotask(()=>{this._renderScheduled=!1,this.isConnected&&this._renderAsync()}))}async _renderAsync(){if(this._renderInProgress){this._renderQueued=!0;return}this._renderInProgress=!0;try{let e=A_(this),t=I_(),n=null,r=!1,i={attempted:!1,durationMs:0},a;if(e&&t){let t=await L_(e);i=t.metrics;let o=t.config;o?.widgetType&&o.widgetType!==`carfare-search`&&(console.warn(`[airport-one-widgets] Widget instance type does not match carfare-search:`,o.widgetType),a=`widget_type_mismatch`,o=null),n=o,r=!n,i.attempted&&n===null&&a===void 0&&i.failureKind&&(a=i.failureKind)}if(!this.isConnected)return;let o=U_(n),s=window[zp],c=Rx(this,`https://flymyairport.vercel.app`,s,o),l=!i.attempted&&(!t||!e)?t?`no_instance_id`:`no_api_base`:void 0;if(c.consentAnalytics){let r=i.attempted?`attempt:${t}|${e}|${n===null?`fail`:`ok`}|${a??``}`:`skip:${l??`none`}`;r!==this._lastPublicConfigTelemetryKey&&(this._lastPublicConfigTelemetryKey=r,Wv(!0,{widget_runtime:`carfare-search`,attempted:i.attempted,duration_ms:i.durationMs,ok:i.attempted?n!==null:!1,error_kind:i.attempted&&n===null?a:void 0,skip_reason:l}))}r&&console.warn(`${M_}: carfare-search — managed instance config not applied; using host attributes and window defaults.`),this._paintCarfare(c),c.consentAnalytics&&!this._mountTelemetrySent&&(this._mountTelemetrySent=!0,Gv(!0,{widget_runtime:`carfare-search`,public_config_unavailable:r}))}finally{this._renderInProgress=!1,this._renderQueued&&(this._renderQueued=!1,queueMicrotask(()=>{this.isConnected&&this._renderAsync()}))}}_paintCarfare(e){let t=this._shadowRoot??=this.attachShadow({mode:`closed`}),n=this._mountPoint??=document.createElement(`span`);n.parentNode!==t&&t.appendChild(n);let r={...e,shadowRoot:t},i=r.primaryColor??`210 100% 50%`,a=r.secondaryColor??`210 100% 50%`,o=r.primaryColor!=null&&m_.test(r.primaryColor),s=r.secondaryColor!=null&&m_.test(r.secondaryColor);n.style.setProperty(`--primary`,o?__(i):i),n.style.setProperty(`--secondary`,s?__(a):a),r.theme===`dark`?this.setAttribute(`data-mode`,`dark`):this.removeAttribute(`data-mode`),(this._reactRoot??=T_.createRoot(n)).render((0,q.jsx)(FB,{...r}))}};customElements.get(`fma-carfare-search`)||customElements.define(`fma-carfare-search`,LB);function RB(e){return e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase()}function zB(e){return Array.from(new Set([e,e.toLowerCase(),RB(e)]))}function BB(e,t){if(e===void 0)return t;let n=e.trim().toLowerCase();return t?n!==`false`:n===`true`}function VB(e){let t=e.trim();return/^(?:\d+\.?\d*|\.\d+)$/.test(t)?`${t.endsWith(`.`)?t.slice(0,-1):t}px`:t}function HB({className:e,regMarkClassName:t}){return(0,q.jsxs)(`span`,{className:e,children:[`Fly`,(0,q.jsx)(`strong`,{children:`MyAirport`}),(0,q.jsx)(`sup`,{"aria-hidden":`true`,className:t||`aone:text-[0.5em] aone:ml-0.5 aone:leading-none`,children:`®`}),(0,q.jsx)(`span`,{className:`aone:sr-only`,children:` Registered`})]})}function UB(e,t=500){let[n,r]=(0,K.useState)(e),i=(0,K.useRef)(e);return(0,K.useEffect)(()=>{if(i.current===e)return;let n=e,a=setTimeout(()=>{i.current!==n&&(i.current=n,r(n))},t);return()=>clearTimeout(a)},[e,t]),n}async function WB(e,t,n,r){let i=`${e}/api/calendar-v2`,a={"Content-Type":`application/json`};n&&(a[jb]=n),r&&(a[Mb]=r);let o=await fetch(i,{method:`POST`,headers:a,body:JSON.stringify(t)});if(!o.ok)throw Error(`Unable to get flight calendar`);let s=await o.json();return Up.parse(s)}function GB({apiDomain:e,params:t,debounceTime:n=500}){let{sessionId:r}=Eb(),{clickId:i}=Pv(),a=UB(t,n),o=typeof a.origin==`string`&&a.origin.trim().length>0,s=typeof a.destination==`string`&&a.destination.trim().length>0,c=!!a.startDate&&o&&s,l=a.startDate?uh(a.startDate,`yyyy-MM-dd`):null,u=a.endDate?uh(a.endDate,`yyyy-MM-dd`):null,{data:d,status:f}=yb({queryKey:[`flight-calendar`,a.origin,a.destination,a.departureLocationType??G.AIRPORT,a.arrivalLocationType??G.AIRPORT,l,u,a.includePriceInsights?`price-insights-v2`:`no-price-insights`,r],enabled:c&&!!r,queryFn:()=>{let t=uh(a.startDate,`yyyy-MM-dd`),n=a.endDate?uh(a.endDate,`yyyy-MM-dd`):void 0,o=Hp.safeParse({departureAirport:a.origin.split(`,`)[0]??``,arrivalAirport:a.destination.split(`,`)[0]??``,startDate:t,endDate:n,includePriceInsights:a.includePriceInsights??!1,departureLocationType:a.departureLocationType??G.AIRPORT,arrivalLocationType:a.arrivalLocationType??G.AIRPORT});if(!o.success)throw Error(`Invalid flight-calendar parameters`);return WB(e,o.data,r,i)},refetchOnWindowFocus:!1,refetchOnMount:!1,staleTime:1e3*60*1});return{data:d,status:f}}function KB(){return(0,q.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,className:`aone:w-6 aone:h-6`,children:(0,q.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M7.5 21L3 16.5m0 0L7.5 12M3 16.5h13.5m0-13.5L21 7.5m0 0L16.5 12M21 7.5H7.5`})})}var qB=s(((e,t)=>{function n(){this.__data__=[],this.size=0}t.exports=n})),JB=s(((e,t)=>{function n(e,t){return e===t||e!==e&&t!==t}t.exports=n})),YB=s(((e,t)=>{var n=JB();function r(e,t){for(var r=e.length;r--;)if(n(e[r][0],t))return r;return-1}t.exports=r})),XB=s(((e,t)=>{var n=YB(),r=Array.prototype.splice;function i(e){var t=this.__data__,i=n(t,e);return i<0?!1:(i==t.length-1?t.pop():r.call(t,i,1),--this.size,!0)}t.exports=i})),ZB=s(((e,t)=>{var n=YB();function r(e){var t=this.__data__,r=n(t,e);return r<0?void 0:t[r][1]}t.exports=r})),QB=s(((e,t)=>{var n=YB();function r(e){return n(this.__data__,e)>-1}t.exports=r})),$B=s(((e,t)=>{var n=YB();function r(e,t){var r=this.__data__,i=n(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this}t.exports=r})),eV=s(((e,t)=>{var n=qB(),r=XB(),i=ZB(),a=QB(),o=$B();function s(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=n,s.prototype.delete=r,s.prototype.get=i,s.prototype.has=a,s.prototype.set=o,t.exports=s})),tV=s(((e,t)=>{var n=eV();function r(){this.__data__=new n,this.size=0}t.exports=r})),nV=s(((e,t)=>{function n(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}t.exports=n})),rV=s(((e,t)=>{function n(e){return this.__data__.get(e)}t.exports=n})),iV=s(((e,t)=>{function n(e){return this.__data__.has(e)}t.exports=n})),aV=s(((e,t)=>{var n=fB(),r=rB(),i=`[object AsyncFunction]`,a=`[object Function]`,o=`[object GeneratorFunction]`,s=`[object Proxy]`;function c(e){if(!r(e))return!1;var t=n(e);return t==a||t==o||t==i||t==s}t.exports=c})),oV=s(((e,t)=>{t.exports=aB()[`__core-js_shared__`]})),sV=s(((e,t)=>{var n=oV(),r=function(){var e=/[^.]+$/.exec(n&&n.keys&&n.keys.IE_PROTO||``);return e?`Symbol(src)_1.`+e:``}();function i(e){return!!r&&r in e}t.exports=i})),cV=s(((e,t)=>{var n=Function.prototype.toString;function r(e){if(e!=null){try{return n.call(e)}catch{}try{return e+``}catch{}}return``}t.exports=r})),lV=s(((e,t)=>{var n=aV(),r=sV(),i=rB(),a=cV(),o=/[\\^$.*+?()[\]{}|]/g,s=/^\[object .+?Constructor\]$/,c=Function.prototype,l=Object.prototype,u=c.toString,d=l.hasOwnProperty,f=RegExp(`^`+u.call(d).replace(o,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`);function p(e){return!i(e)||r(e)?!1:(n(e)?f:s).test(a(e))}t.exports=p})),uV=s(((e,t)=>{function n(e,t){return e?.[t]}t.exports=n})),dV=s(((e,t)=>{var n=lV(),r=uV();function i(e,t){var i=r(e,t);return n(i)?i:void 0}t.exports=i})),fV=s(((e,t)=>{t.exports=dV()(aB(),`Map`)})),pV=s(((e,t)=>{t.exports=dV()(Object,`create`)})),mV=s(((e,t)=>{var n=pV();function r(){this.__data__=n?n(null):{},this.size=0}t.exports=r})),hV=s(((e,t)=>{function n(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=+!!t,t}t.exports=n})),gV=s(((e,t)=>{var n=pV(),r=`__lodash_hash_undefined__`,i=Object.prototype.hasOwnProperty;function a(e){var t=this.__data__;if(n){var a=t[e];return a===r?void 0:a}return i.call(t,e)?t[e]:void 0}t.exports=a})),_V=s(((e,t)=>{var n=pV(),r=Object.prototype.hasOwnProperty;function i(e){var t=this.__data__;return n?t[e]!==void 0:r.call(t,e)}t.exports=i})),vV=s(((e,t)=>{var n=pV(),r=`__lodash_hash_undefined__`;function i(e,t){var i=this.__data__;return this.size+=+!this.has(e),i[e]=n&&t===void 0?r:t,this}t.exports=i})),yV=s(((e,t)=>{var n=mV(),r=hV(),i=gV(),a=_V(),o=vV();function s(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=n,s.prototype.delete=r,s.prototype.get=i,s.prototype.has=a,s.prototype.set=o,t.exports=s})),bV=s(((e,t)=>{var n=yV(),r=eV(),i=fV();function a(){this.size=0,this.__data__={hash:new n,map:new(i||r),string:new n}}t.exports=a})),xV=s(((e,t)=>{function n(e){var t=typeof e;return t==`string`||t==`number`||t==`symbol`||t==`boolean`?e!==`__proto__`:e===null}t.exports=n})),SV=s(((e,t)=>{var n=xV();function r(e,t){var r=e.__data__;return n(t)?r[typeof t==`string`?`string`:`hash`]:r.map}t.exports=r})),CV=s(((e,t)=>{var n=SV();function r(e){var t=n(this,e).delete(e);return this.size-=+!!t,t}t.exports=r})),wV=s(((e,t)=>{var n=SV();function r(e){return n(this,e).get(e)}t.exports=r})),TV=s(((e,t)=>{var n=SV();function r(e){return n(this,e).has(e)}t.exports=r})),EV=s(((e,t)=>{var n=SV();function r(e,t){var r=n(this,e),i=r.size;return r.set(e,t),this.size+=r.size==i?0:1,this}t.exports=r})),DV=s(((e,t)=>{var n=bV(),r=CV(),i=wV(),a=TV(),o=EV();function s(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=n,s.prototype.delete=r,s.prototype.get=i,s.prototype.has=a,s.prototype.set=o,t.exports=s})),OV=s(((e,t)=>{var n=eV(),r=fV(),i=DV(),a=200;function o(e,t){var o=this.__data__;if(o instanceof n){var s=o.__data__;if(!r||s.length<a-1)return s.push([e,t]),this.size=++o.size,this;o=this.__data__=new i(s)}return o.set(e,t),this.size=o.size,this}t.exports=o})),kV=s(((e,t)=>{var n=eV(),r=tV(),i=nV(),a=rV(),o=iV(),s=OV();function c(e){var t=this.__data__=new n(e);this.size=t.size}c.prototype.clear=r,c.prototype.delete=i,c.prototype.get=a,c.prototype.has=o,c.prototype.set=s,t.exports=c})),AV=s(((e,t)=>{var n=`__lodash_hash_undefined__`;function r(e){return this.__data__.set(e,n),this}t.exports=r})),jV=s(((e,t)=>{function n(e){return this.__data__.has(e)}t.exports=n})),MV=s(((e,t)=>{var n=DV(),r=AV(),i=jV();function a(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new n;++t<r;)this.add(e[t])}a.prototype.add=a.prototype.push=r,a.prototype.has=i,t.exports=a})),NV=s(((e,t)=>{function n(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}t.exports=n})),PV=s(((e,t)=>{function n(e,t){return e.has(t)}t.exports=n})),FV=s(((e,t)=>{var n=MV(),r=NV(),i=PV(),a=1,o=2;function s(e,t,s,c,l,u){var d=s&a,f=e.length,p=t.length;if(f!=p&&!(d&&p>f))return!1;var m=u.get(e),h=u.get(t);if(m&&h)return m==t&&h==e;var g=-1,_=!0,v=s&o?new n:void 0;for(u.set(e,t),u.set(t,e);++g<f;){var y=e[g],b=t[g];if(c)var x=d?c(b,y,g,t,e,u):c(y,b,g,e,t,u);if(x!==void 0){if(x)continue;_=!1;break}if(v){if(!r(t,function(e,t){if(!i(v,t)&&(y===e||l(y,e,s,c,u)))return v.push(t)})){_=!1;break}}else if(!(y===b||l(y,b,s,c,u))){_=!1;break}}return u.delete(e),u.delete(t),_}t.exports=s})),IV=s(((e,t)=>{t.exports=aB().Uint8Array})),LV=s(((e,t)=>{function n(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}t.exports=n})),RV=s(((e,t)=>{function n(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}t.exports=n})),zV=s(((e,t)=>{var n=lB(),r=IV(),i=JB(),a=FV(),o=LV(),s=RV(),c=1,l=2,u=`[object Boolean]`,d=`[object Date]`,f=`[object Error]`,p=`[object Map]`,m=`[object Number]`,h=`[object RegExp]`,g=`[object Set]`,_=`[object String]`,v=`[object Symbol]`,y=`[object ArrayBuffer]`,b=`[object DataView]`,x=n?n.prototype:void 0,S=x?x.valueOf:void 0;function C(e,t,n,x,C,w,T){switch(n){case b:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case y:return!(e.byteLength!=t.byteLength||!w(new r(e),new r(t)));case u:case d:case m:return i(+e,+t);case f:return e.name==t.name&&e.message==t.message;case h:case _:return e==t+``;case p:var E=o;case g:var D=x&c;if(E||=s,e.size!=t.size&&!D)return!1;var O=T.get(e);if(O)return O==t;x|=l,T.set(e,t);var k=a(E(e),E(t),x,C,w,T);return T.delete(e),k;case v:if(S)return S.call(e)==S.call(t)}return!1}t.exports=C})),BV=s(((e,t)=>{function n(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}t.exports=n})),VV=s(((e,t)=>{t.exports=Array.isArray})),HV=s(((e,t)=>{var n=BV(),r=VV();function i(e,t,i){var a=t(e);return r(e)?a:n(a,i(e))}t.exports=i})),UV=s(((e,t)=>{function n(e,t){for(var n=-1,r=e==null?0:e.length,i=0,a=[];++n<r;){var o=e[n];t(o,n,e)&&(a[i++]=o)}return a}t.exports=n})),WV=s(((e,t)=>{function n(){return[]}t.exports=n})),GV=s(((e,t)=>{var n=UV(),r=WV(),i=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols;t.exports=a?function(e){return e==null?[]:(e=Object(e),n(a(e),function(t){return i.call(e,t)}))}:r})),KV=s(((e,t)=>{function n(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}t.exports=n})),qV=s(((e,t)=>{var n=fB(),r=pB(),i=`[object Arguments]`;function a(e){return r(e)&&n(e)==i}t.exports=a})),JV=s(((e,t)=>{var n=qV(),r=pB(),i=Object.prototype,a=i.hasOwnProperty,o=i.propertyIsEnumerable;t.exports=n(function(){return arguments}())?n:function(e){return r(e)&&a.call(e,`callee`)&&!o.call(e,`callee`)}})),YV=s(((e,t)=>{function n(){return!1}t.exports=n})),XV=s(((e,t)=>{var n=aB(),r=YV(),i=typeof e==`object`&&e&&!e.nodeType&&e,a=i&&typeof t==`object`&&t&&!t.nodeType&&t,o=a&&a.exports===i?n.Buffer:void 0;t.exports=(o?o.isBuffer:void 0)||r})),ZV=s(((e,t)=>{var n=9007199254740991,r=/^(?:0|[1-9]\d*)$/;function i(e,t){var i=typeof e;return t??=n,!!t&&(i==`number`||i!=`symbol`&&r.test(e))&&e>-1&&e%1==0&&e<t}t.exports=i})),QV=s(((e,t)=>{var n=9007199254740991;function r(e){return typeof e==`number`&&e>-1&&e%1==0&&e<=n}t.exports=r})),$V=s(((e,t)=>{var n=fB(),r=QV(),i=pB(),a=`[object Arguments]`,o=`[object Array]`,s=`[object Boolean]`,c=`[object Date]`,l=`[object Error]`,u=`[object Function]`,d=`[object Map]`,f=`[object Number]`,p=`[object Object]`,m=`[object RegExp]`,h=`[object Set]`,g=`[object String]`,_=`[object WeakMap]`,v=`[object ArrayBuffer]`,y=`[object DataView]`,b=`[object Float32Array]`,x=`[object Float64Array]`,S=`[object Int8Array]`,C=`[object Int16Array]`,w=`[object Int32Array]`,T=`[object Uint8Array]`,E=`[object Uint8ClampedArray]`,D=`[object Uint16Array]`,O=`[object Uint32Array]`,k={};k[b]=k[x]=k[S]=k[C]=k[w]=k[T]=k[E]=k[D]=k[O]=!0,k[a]=k[o]=k[v]=k[s]=k[y]=k[c]=k[l]=k[u]=k[d]=k[f]=k[p]=k[m]=k[h]=k[g]=k[_]=!1;function A(e){return i(e)&&r(e.length)&&!!k[n(e)]}t.exports=A})),eH=s(((e,t)=>{function n(e){return function(t){return e(t)}}t.exports=n})),tH=s(((e,t)=>{var n=iB(),r=typeof e==`object`&&e&&!e.nodeType&&e,i=r&&typeof t==`object`&&t&&!t.nodeType&&t,a=i&&i.exports===r&&n.process;t.exports=function(){try{return i&&i.require&&i.require(`util`).types||a&&a.binding&&a.binding(`util`)}catch{}}()})),nH=s(((e,t)=>{var n=$V(),r=eH(),i=tH(),a=i&&i.isTypedArray;t.exports=a?r(a):n})),rH=s(((e,t)=>{var n=KV(),r=JV(),i=VV(),a=XV(),o=ZV(),s=nH(),c=Object.prototype.hasOwnProperty;function l(e,t){var l=i(e),u=!l&&r(e),d=!l&&!u&&a(e),f=!l&&!u&&!d&&s(e),p=l||u||d||f,m=p?n(e.length,String):[],h=m.length;for(var g in e)(t||c.call(e,g))&&!(p&&(g==`length`||d&&(g==`offset`||g==`parent`)||f&&(g==`buffer`||g==`byteLength`||g==`byteOffset`)||o(g,h)))&&m.push(g);return m}t.exports=l})),iH=s(((e,t)=>{var n=Object.prototype;function r(e){var t=e&&e.constructor;return e===(typeof t==`function`&&t.prototype||n)}t.exports=r})),aH=s(((e,t)=>{function n(e,t){return function(n){return e(t(n))}}t.exports=n})),oH=s(((e,t)=>{t.exports=aH()(Object.keys,Object)})),sH=s(((e,t)=>{var n=iH(),r=oH(),i=Object.prototype.hasOwnProperty;function a(e){if(!n(e))return r(e);var t=[];for(var a in Object(e))i.call(e,a)&&a!=`constructor`&&t.push(a);return t}t.exports=a})),cH=s(((e,t)=>{var n=aV(),r=QV();function i(e){return e!=null&&r(e.length)&&!n(e)}t.exports=i})),lH=s(((e,t)=>{var n=rH(),r=sH(),i=cH();function a(e){return i(e)?n(e):r(e)}t.exports=a})),uH=s(((e,t)=>{var n=HV(),r=GV(),i=lH();function a(e){return n(e,i,r)}t.exports=a})),dH=s(((e,t)=>{var n=uH(),r=1,i=Object.prototype.hasOwnProperty;function a(e,t,a,o,s,c){var l=a&r,u=n(e),d=u.length;if(d!=n(t).length&&!l)return!1;for(var f=d;f--;){var p=u[f];if(!(l?p in t:i.call(t,p)))return!1}var m=c.get(e),h=c.get(t);if(m&&h)return m==t&&h==e;var g=!0;c.set(e,t),c.set(t,e);for(var _=l;++f<d;){p=u[f];var v=e[p],y=t[p];if(o)var b=l?o(y,v,p,t,e,c):o(v,y,p,e,t,c);if(!(b===void 0?v===y||s(v,y,a,o,c):b)){g=!1;break}_||=p==`constructor`}if(g&&!_){var x=e.constructor,S=t.constructor;x!=S&&`constructor`in e&&`constructor`in t&&!(typeof x==`function`&&x instanceof x&&typeof S==`function`&&S instanceof S)&&(g=!1)}return c.delete(e),c.delete(t),g}t.exports=a})),fH=s(((e,t)=>{t.exports=dV()(aB(),`DataView`)})),pH=s(((e,t)=>{t.exports=dV()(aB(),`Promise`)})),mH=s(((e,t)=>{t.exports=dV()(aB(),`Set`)})),hH=s(((e,t)=>{t.exports=dV()(aB(),`WeakMap`)})),gH=s(((e,t)=>{var n=fH(),r=fV(),i=pH(),a=mH(),o=hH(),s=fB(),c=cV(),l=`[object Map]`,u=`[object Object]`,d=`[object Promise]`,f=`[object Set]`,p=`[object WeakMap]`,m=`[object DataView]`,h=c(n),g=c(r),_=c(i),v=c(a),y=c(o),b=s;(n&&b(new n(new ArrayBuffer(1)))!=m||r&&b(new r)!=l||i&&b(i.resolve())!=d||a&&b(new a)!=f||o&&b(new o)!=p)&&(b=function(e){var t=s(e),n=t==u?e.constructor:void 0,r=n?c(n):``;if(r)switch(r){case h:return m;case g:return l;case _:return d;case v:return f;case y:return p}return t}),t.exports=b})),_H=s(((e,t)=>{var n=kV(),r=FV(),i=zV(),a=dH(),o=gH(),s=VV(),c=XV(),l=nH(),u=1,d=`[object Arguments]`,f=`[object Array]`,p=`[object Object]`,m=Object.prototype.hasOwnProperty;function h(e,t,h,g,_,v){var y=s(e),b=s(t),x=y?f:o(e),S=b?f:o(t);x=x==d?p:x,S=S==d?p:S;var C=x==p,w=S==p,T=x==S;if(T&&c(e)){if(!c(t))return!1;y=!0,C=!1}if(T&&!C)return v||=new n,y||l(e)?r(e,t,h,g,_,v):i(e,t,x,h,g,_,v);if(!(h&u)){var E=C&&m.call(e,`__wrapped__`),D=w&&m.call(t,`__wrapped__`);if(E||D){var O=E?e.value():e,k=D?t.value():t;return v||=new n,_(O,k,h,g,v)}}return T?(v||=new n,a(e,t,h,g,_,v)):!1}t.exports=h})),vH=s(((e,t)=>{var n=_H(),r=pB();function i(e,t,a,o,s){return e===t?!0:e==null||t==null||!r(e)&&!r(t)?e!==e&&t!==t:n(e,t,a,o,i,s)}t.exports=i})),yH=s(((e,t)=>{var n=kV(),r=vH(),i=1,a=2;function o(e,t,o,s){var c=o.length,l=c,u=!s;if(e==null)return!l;for(e=Object(e);c--;){var d=o[c];if(u&&d[2]?d[1]!==e[d[0]]:!(d[0]in e))return!1}for(;++c<l;){d=o[c];var f=d[0],p=e[f],m=d[1];if(u&&d[2]){if(p===void 0&&!(f in e))return!1}else{var h=new n;if(s)var g=s(p,m,f,e,t,h);if(!(g===void 0?r(m,p,i|a,s,h):g))return!1}}return!0}t.exports=o})),bH=s(((e,t)=>{var n=rB();function r(e){return e===e&&!n(e)}t.exports=r})),xH=s(((e,t)=>{var n=bH(),r=lH();function i(e){for(var t=r(e),i=t.length;i--;){var a=t[i],o=e[a];t[i]=[a,o,n(o)]}return t}t.exports=i})),SH=s(((e,t)=>{function n(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}t.exports=n})),CH=s(((e,t)=>{var n=yH(),r=xH(),i=SH();function a(e){var t=r(e);return t.length==1&&t[0][2]?i(t[0][0],t[0][1]):function(r){return r===e||n(r,e,t)}}t.exports=a})),wH=s(((e,t)=>{var n=VV(),r=mB(),i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;function o(e,t){if(n(e))return!1;var o=typeof e;return o==`number`||o==`symbol`||o==`boolean`||e==null||r(e)?!0:a.test(e)||!i.test(e)||t!=null&&e in Object(t)}t.exports=o})),TH=s(((e,t)=>{var n=DV(),r=`Expected a function`;function i(e,t){if(typeof e!=`function`||t!=null&&typeof t!=`function`)throw TypeError(r);var a=function(){var n=arguments,r=t?t.apply(this,n):n[0],i=a.cache;if(i.has(r))return i.get(r);var o=e.apply(this,n);return a.cache=i.set(r,o)||i,o};return a.cache=new(i.Cache||n),a}i.Cache=n,t.exports=i})),EH=s(((e,t)=>{var n=TH(),r=500;function i(e){var t=n(e,function(e){return i.size===r&&i.clear(),e}),i=t.cache;return t}t.exports=i})),DH=s(((e,t)=>{var n=EH(),r=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/\\(\\)?/g;t.exports=n(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(``),e.replace(r,function(e,n,r,a){t.push(r?a.replace(i,`$1`):n||e)}),t})})),OH=s(((e,t)=>{function n(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}t.exports=n})),kH=s(((e,t)=>{var n=lB(),r=OH(),i=VV(),a=mB(),o=1/0,s=n?n.prototype:void 0,c=s?s.toString:void 0;function l(e){if(typeof e==`string`)return e;if(i(e))return r(e,l)+``;if(a(e))return c?c.call(e):``;var t=e+``;return t==`0`&&1/e==-o?`-0`:t}t.exports=l})),AH=s(((e,t)=>{var n=kH();function r(e){return e==null?``:n(e)}t.exports=r})),jH=s(((e,t)=>{var n=VV(),r=wH(),i=DH(),a=AH();function o(e,t){return n(e)?e:r(e,t)?[e]:i(a(e))}t.exports=o})),MH=s(((e,t)=>{var n=mB(),r=1/0;function i(e){if(typeof e==`string`||n(e))return e;var t=e+``;return t==`0`&&1/e==-r?`-0`:t}t.exports=i})),NH=s(((e,t)=>{var n=jH(),r=MH();function i(e,t){t=n(t,e);for(var i=0,a=t.length;e!=null&&i<a;)e=e[r(t[i++])];return i&&i==a?e:void 0}t.exports=i})),PH=s(((e,t)=>{var n=NH();function r(e,t,r){var i=e==null?void 0:n(e,t);return i===void 0?r:i}t.exports=r})),FH=s(((e,t)=>{function n(e,t){return e!=null&&t in Object(e)}t.exports=n})),IH=s(((e,t)=>{var n=jH(),r=JV(),i=VV(),a=ZV(),o=QV(),s=MH();function c(e,t,c){t=n(t,e);for(var l=-1,u=t.length,d=!1;++l<u;){var f=s(t[l]);if(!(d=e!=null&&c(e,f)))break;e=e[f]}return d||++l!=u?d:(u=e==null?0:e.length,!!u&&o(u)&&a(f,u)&&(i(e)||r(e)))}t.exports=c})),LH=s(((e,t)=>{var n=FH(),r=IH();function i(e,t){return e!=null&&r(e,t,n)}t.exports=i})),RH=s(((e,t)=>{var n=vH(),r=PH(),i=LH(),a=wH(),o=bH(),s=SH(),c=MH(),l=1,u=2;function d(e,t){return a(e)&&o(t)?s(c(e),t):function(a){var o=r(a,e);return o===void 0&&o===t?i(a,e):n(t,o,l|u)}}t.exports=d})),zH=s(((e,t)=>{function n(e){return e}t.exports=n})),BH=s(((e,t)=>{function n(e){return function(t){return t?.[e]}}t.exports=n})),VH=s(((e,t)=>{var n=NH();function r(e){return function(t){return n(t,e)}}t.exports=r})),HH=s(((e,t)=>{var n=BH(),r=VH(),i=wH(),a=MH();function o(e){return i(e)?n(a(e)):r(e)}t.exports=o})),UH=s(((e,t)=>{var n=CH(),r=RH(),i=zH(),a=VV(),o=HH();function s(e){return typeof e==`function`?e:e==null?i:typeof e==`object`?a(e)?r(e[0],e[1]):n(e):o(e)}t.exports=s})),WH=s(((e,t)=>{function n(e,t,n,r){for(var i=e.length,a=n+(r?1:-1);r?a--:++a<i;)if(t(e[a],a,e))return a;return-1}t.exports=n})),GH=s(((e,t)=>{function n(e){return e!==e}t.exports=n})),KH=s(((e,t)=>{function n(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}t.exports=n})),qH=s(((e,t)=>{var n=WH(),r=GH(),i=KH();function a(e,t,a){return t===t?i(e,t,a):n(e,r,a)}t.exports=a})),JH=s(((e,t)=>{var n=qH();function r(e,t){return!!(e!=null&&e.length)&&n(e,t,0)>-1}t.exports=r})),YH=s(((e,t)=>{function n(e,t,n){for(var r=-1,i=e==null?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}t.exports=n})),XH=s(((e,t)=>{function n(){}t.exports=n})),ZH=s(((e,t)=>{var n=mH(),r=XH(),i=RV();t.exports=n&&1/i(new n([,-0]))[1]==1/0?function(e){return new n(e)}:r})),QH=s(((e,t)=>{var n=MV(),r=JH(),i=YH(),a=PV(),o=ZH(),s=RV(),c=200;function l(e,t,l){var u=-1,d=r,f=e.length,p=!0,m=[],h=m;if(l)p=!1,d=i;else if(f>=c){var g=t?null:o(e);if(g)return s(g);p=!1,d=a,h=new n}else h=t?[]:m;outer:for(;++u<f;){var _=e[u],v=t?t(_):_;if(_=l||_!==0?_:0,p&&v===v){for(var y=h.length;y--;)if(h[y]===v)continue outer;t&&h.push(v),m.push(_)}else d(h,v,l)||(h!==m&&h.push(v),m.push(_))}return m}t.exports=l})),$H=u(s(((e,t)=>{var n=UH(),r=QH();function i(e,t){return e&&e.length?r(e,n(t,2)):[]}t.exports=i}))(),1),eU=new WeakMap,tU=new WeakMap,nU=`data-a1-flight-combobox-open`;function rU(e){let t=tU.get(e);t!=null&&(clearTimeout(t),tU.delete(e));let n=(eU.get(e)??0)+1;eU.set(e,n),e.setAttribute(nU,``)}function iU(e){let t=Math.max(0,(eU.get(e)??0)-1);if(t===0){eU.delete(e);let t=tU.get(e);t!=null&&clearTimeout(t);let n=window.setTimeout(()=>{tU.delete(e),e.removeAttribute(nU)},400);tU.set(e,n)}else eU.set(e,t)}function aU({items:e,selectedItems:t,onInputChange:n,onSelectedItemsChange:r,fieldLabel:i,placeholder:a,icon:o,disabled:s,shadowRoot:c,dataTestId:l}){let[u,d]=(0,K.useState)(``),f=(0,K.useRef)(null),p=(0,K.useRef)(null),m=(0,K.useId)(),h=(0,K.useId)(),g=(0,K.useId)(),_=(0,K.useId)(),v=(0,K.useId)(),[y,b]=(0,K.useState)({}),x=c??null,S=(0,K.useCallback)(()=>{let e=f.current;if(!e)return;let t=e.getBoundingClientRect(),n=window.innerHeight-t.bottom-8,r=Math.max(120,Math.min(320,n-8)),i=t.left,a=t.width;i+a>window.innerWidth-8&&(i=Math.max(8,window.innerWidth-a-8)),b({position:`fixed`,top:t.bottom+8,left:i,width:a,maxHeight:r,zIndex:1e4})},[]),C=(0,K.useMemo)(()=>e.filter(e=>e.type===`airport`||e.type===`place`).reduce((e,t)=>{if(t.type===`airport`){let n=t,r=u.toLowerCase();if(n.iata_code.toLowerCase()===r||n.iata_display_list?.some(e=>e.toLowerCase()===r))return t.sectionIndex>=0?[...e,t]:[{...t,sectionIndex:-1},...e]}return[...e,t]},[]).reduce((e,t)=>t.type===`airport`?{items:[...e.items,t],airportCount:e.airportCount+1}:t.type===`place`?e.airportCount<20?{...e,items:[...e.items,t]}:e:e.airportCount<=20?{...e,items:[...e.items,t]}:e,{items:[],airportCount:0}).items,[u,e]);function w(e){return e.kayak?.stateCode&&e.kayak?.countryCode?`${e.name}, ${e.kayak.stateCode}, ${e.kayak.countryCode}`:e.kayak?.countryCode&&!e.kayak?.stateCode?`${e.name}, ${e.kayak.countryCode}`:e.formatted_address}function T(e){return e.state_code?`${e.city}, ${e.state_code}, ${e.country_code}`:e.location_display?e.location_display:`${e.city}, ${e.country_code}`}function E(e){return e.iata_display_list&&e.iata_display_list.length>0?e.iata_display_list.join(`, `):e.iata_code}function D(e){if(e.type===`airport`){let n=e;return t?.length>1?E(n):n.country_code===`US`?`${n.city} (${E(n)})`:`${n.city}, ${n.country_code} (${E(n)})`}if(e.type===`place`){let t=e;return t.formatted_address?.length<20?t.formatted_address:t.name}return``}let O=typeof Proxy==`function`&&!Object.isSealed(new Proxy({},{}));function k(e){let t=e.ownerDocument,n={document:t,addEventListener:t.addEventListener.bind(e),removeEventListener:t.removeEventListener.bind(e),Node:window.Node,Element:window.Element,HTMLElement:window.HTMLElement,SVGElement:window.SVGElement};return O?new Proxy(n,{get(e,t){return e[t]}}):n}let{getSelectedItemProps:A,getDropdownProps:j,removeSelectedItem:M}=Az({selectedItems:t,onStateChange({selectedItems:e,type:t}){t===Az.stateChangeTypes.FunctionRemoveSelectedItem&&r(e)}}),{isOpen:N,getMenuProps:P,getInputProps:ee,getItemProps:F,highlightedIndex:te,setHighlightedIndex:ne}=iz({environment:c?k(c):void 0,items:C,isItemDisabled(e){return!!e?.disabled},itemToKey(e){return e?.key??``},itemToString(e){return e?e.type===`airport`?D(e):e.name??``:``},defaultHighlightedIndex:0,selectedItem:null,inputValue:u,stateReducer(e,t){let{changes:n,type:r}=t;switch(r){case iz.stateChangeTypes.InputKeyDownEnter:case iz.stateChangeTypes.ItemClick:case iz.stateChangeTypes.InputKeyDownArrowDown:case iz.stateChangeTypes.InputKeyDownArrowUp:case iz.stateChangeTypes.InputBlur:case iz.stateChangeTypes.InputKeyDownEscape:return n;case iz.stateChangeTypes.ItemMouseMove:return e;case iz.stateChangeTypes.FunctionCloseMenu:return{...n,isOpen:!0};default:return n}},onStateChange({inputValue:e,type:t,selectedItem:n}){switch(t){case iz.stateChangeTypes.InputKeyDownEnter:case iz.stateChangeTypes.ItemClick:n&&(r([n]),d(``));break;case iz.stateChangeTypes.MenuMouseLeave:case iz.stateChangeTypes.ItemMouseMove:case iz.stateChangeTypes.InputKeyDownArrowDown:case iz.stateChangeTypes.InputKeyDownArrowUp:case iz.stateChangeTypes.InputBlur:case iz.stateChangeTypes.ControlledPropUpdatedSelectedItem:break;default:break}}}),re=(0,K.useMemo)(()=>{if(s)return`Field is locked.`;if(N&&C.length>0){let e=C.length;return`Suggestion list open, ${e} ${e===1?`option`:`options`}.`}return N&&C.length===0?u.trim()?`Suggestion list open, no matching options.`:`Suggestion list open, no options yet.`:`Suggestion list closed.`},[s,N,C.length,u]),ie=(0,K.useMemo)(()=>`Type to search airports and places. When the list is open, use arrow keys to move through suggestions and Enter to choose. Tab to selected locations above to remove them, or press Backspace in this field when it is empty.`,[]),ae=i?`${i}, search airports and places`:`Search airports and places`,oe=i?`${i} suggestions`:`Search results`,se=t.length===0?`No airport or place selected.`:(()=>{let e=t.map(e=>D(e));return`Selected ${t.length===1?`location`:`${t.length} locations`}: ${e.join(`, `)}.`})(),ce=[g,_,v].join(` `);(0,K.useEffect)(()=>{s&&queueMicrotask(()=>d(``))},[s]),(0,K.useLayoutEffect)(()=>{if(!N||C.length===0||!x)return;S();let e=f.current,t=e&&typeof ResizeObserver<`u`?new ResizeObserver(S):null;return e&&t?.observe(e),window.addEventListener(`scroll`,S,!0),window.addEventListener(`resize`,S),()=>{t?.disconnect(),window.removeEventListener(`scroll`,S,!0),window.removeEventListener(`resize`,S)}},[N,C.length,x,S]);let le=N&&C.length>0;(0,K.useEffect)(()=>{let e=c?.host;if(e instanceof HTMLElement&&!(!le||!x))return rU(e),()=>iU(e)},[le,c,x]);let ue=!!s;function de(e,t){e.pointerType===`touch`&&(e.preventDefault(),e.stopPropagation(),r([t]),d(``),n(``))}function fe(){let e=ee({...j(),id:h,role:`combobox`,"aria-autocomplete":`list`,"aria-expanded":N,"aria-controls":N?m:void 0,"aria-activedescendant":N&&te!=null&&te>-1?`${m}-${te}`:void 0,"aria-label":ae,onChange:e=>{let t=e.currentTarget.value;d(t),n(t)},onKeyDown:e=>{if(e.key===`Backspace`&&!u&&t.length>0&&!s){let e=t[t.length-1];M(e)}}});return(0,q.jsx)(`input`,{className:(0,J.default)(`aone:outline-none aone:disabled:bg-transparent aone:text-base aone:placeholder:text-gray-500`,{"aone:min-w-[120px] aone:max-w-[200px]":t.length>0,"aone:w-full":t.length===0}),placeholder:!ue&&t.length===0?a:``,...e,"aria-describedby":ce,disabled:ue})}let pe=(0,q.jsx)(`ul`,{...P(),ref:p,id:m,role:`listbox`,"aria-multiselectable":`true`,"aria-label":oe,tabIndex:-1,className:`aone:text-gray-900 aone:max-h-full aone:overflow-y-auto aone:overflow-x-hidden aone:focus:outline-none aone:focus:ring-2 aone:focus:ring-blue-500 aone:focus:ring-offset-2`,children:C.map((e,n)=>{if(e.type===`airport`){let r=e,i=(r.distance||0)*.621371,a=te===n,o=e.sectionIndex>-1&&!r.kayak_shimmed,s=!!t.find(t=>t.key===e.key),c=n+1;return(0,q.jsxs)(`li`,{...F({item:e,index:n,onPointerDown:t=>de(t,e),onMouseEnter:()=>ne(n)}),id:`${m}-${n}`,role:`option`,tabIndex:-1,"aria-selected":s,"aria-label":`Option ${c} - ${r.name}, ${T(r)}, ${E(r)}${o?`, ${i.toFixed(+(i<1))} miles away`:``}, ${s?`selected`:`not selected`}`,className:(0,J.default)({"aone:hover:bg-blue-100":!0,"aone:bg-blue-100":a,"aone:font-bold":a,"aone:shadow-sm aone:py-2 aone:px-2 aone:cursor-pointer":!0,"aone:pl-5 aone:border-l-4 aone:border-gray-500":e.sectionIndex>-1,"aone:grid aone:grid-cols-[26px_1fr_30px] aone:gap-1 aone:justify-start aone:items-center":!0,"aone:focus:outline-none aone:focus:ring-2 aone:focus:ring-blue-500 aone:focus:ring-offset-2":!0}),children:[(0,q.jsx)(yI,{className:`aone:w-6 aone:h-6 aone:-rotate-45 aone:text-gray-600`,icon:wA}),(0,q.jsxs)(`div`,{className:`aone:flex aone:flex-col aone:grow aone:gap-1 aone:overflow-hidden`,children:[(0,q.jsxs)(`div`,{className:`aone:gap-2 aone:flex aone:items-center aone:w-full`,children:[(0,q.jsx)(`span`,{className:`aone:flex-1 aone:min-w-0 aone:font-medium aone:text-base aone:text-gray-900 aone:whitespace-nowrap aone:overflow-hidden aone:text-ellipsis`,children:r.name}),(0,q.jsx)(`span`,{className:`aone:text-sm aone:uppercase aone:shrink-0 aone:text-gray-600`,children:E(r)})]}),(0,q.jsxs)(`span`,{className:`aone:text-sm aone:text-gray-600`,children:[T(r),o&&(0,q.jsxs)(q.Fragment,{children:[`\xA0•\xA0`,i.toFixed(+(i<1)),`mi`]})]})]}),(0,q.jsx)(`div`,{className:`aone:flex aone:justify-end aone:pl-1`,"aria-hidden":`true`,children:(0,q.jsx)(`span`,{className:(0,J.default)(`aone:h-4 aone:w-4 aone:shrink-0 aone:rounded-sm aone:border`,{"aone:border-gray-400 aone:bg-white":!s,"aone:border-primary aone:bg-primary":s})})})]},`${e.key}-${n}`)}if(e.type===`place`){let r=e,i=te===n,a=Kg(r.kayak?.apicode),o=w(r),s=!!t.find(t=>t.key===e.key);return(0,q.jsxs)(`li`,{...F({item:e,index:n,onPointerDown:t=>de(t,e),onMouseEnter:()=>ne(n)}),id:`${m}-${n}`,role:`option`,tabIndex:-1,"aria-selected":s,"aria-label":`${a?`${r.name}, ${a}, ${o}`:`${r.name}, ${o}`}, ${s?`selected`:`not selected`}`,className:(0,J.default)({"aone:hover:bg-blue-100":!0,"aone:bg-blue-100":i,"aone:font-bold":i,"aone:shadow-sm aone:py-2 aone:px-2 aone:cursor-pointer":!0,"aone:grid aone:grid-cols-[26px_1fr_30px] aone:gap-1 aone:justify-start aone:items-center":!0,"aone:focus:outline-none aone:focus:ring-2 aone:focus:ring-blue-500 aone:focus:ring-offset-2":!0}),children:[(0,q.jsx)(yI,{className:`aone:w-6 aone:h-6 aone:text-gray-600`,icon:DA}),(0,q.jsxs)(`div`,{className:`aone:flex aone:flex-col aone:grow aone:gap-1 aone:overflow-hidden`,children:[(0,q.jsxs)(`div`,{className:`aone:gap-2 aone:flex aone:items-end aone:w-full`,children:[(0,q.jsx)(`span`,{className:`aone:flex-1 aone:min-w-0 aone:font-medium aone:text-base aone:text-gray-900 aone:whitespace-nowrap aone:overflow-hidden aone:text-ellipsis`,children:r.name}),a&&(0,q.jsx)(`span`,{className:`aone:text-sm aone:uppercase aone:shrink-0 aone:text-gray-600`,children:a})]}),(0,q.jsx)(`span`,{className:`aone:text-sm aone:shrink-0 aone:text-gray-600`,children:o})]}),(0,q.jsx)(`div`,{className:`aone:flex aone:justify-end aone:pl-1`,"aria-hidden":`true`,children:(0,q.jsx)(`span`,{className:(0,J.default)(`aone:h-4 aone:w-4 aone:shrink-0 aone:rounded-sm aone:border`,{"aone:border-gray-400 aone:bg-white":!s,"aone:border-primary aone:bg-primary":s})})})]},`${e.key}-${n}`)}return null})});return(0,q.jsxs)(`div`,{className:`aone:w-full aone:h-full aone:relative aone:z-10`,"data-testid":l,role:`group`,"aria-disabled":s?!0:void 0,children:[(0,q.jsxs)(`div`,{ref:f,className:(0,J.default)({"aone:bg-white aone:text-gray-900 aone:rounded-lg aone:gap-2 aone:items-center aone:py-2 aone:px-3 aone:h-[44px] aone:box-border aone:w-full aone:overflow-hidden":!0,"aone:grid":!0,"aone:grid-cols-[24px_1fr]":t.length===0,"aone:grid-cols-[24px_auto_1fr]":t.length===1,"aone:grid-cols-[24px_auto_auto_1fr]":t.length===2,"aone:grid-cols-[24px_auto_auto_auto_1fr]":t.length===3,"aone:border-2 aone:border-gray-200 aone:focus-within:border-primary":!0,"aone:opacity-60 aone:cursor-not-allowed":!!s}),children:[o,t.map((e,n)=>(0,q.jsxs)(`span`,{...A({selectedItem:e,index:n}),"aria-label":`Selected location: ${D(e)}. Item ${n+1} of ${t.length}.`,className:(0,J.default)({"aone:bg-gray-200 aone:rounded aone:px-1 aone:focus:bg-gray-400 aone:whitespace-nowrap aone:text-ellipsis aone:shrink-0":!0,"aone:text-sm":t.length>0,"aone:flex aone:items-center":!0}),children:[(0,q.jsx)(`span`,{className:`aone:overflow-hidden aone:grow aone:font-medium`,children:D(e)}),!e.disabled&&(0,q.jsx)(`button`,{type:`button`,disabled:!!s||!!e.disabled,className:(0,J.default)(`aone:ml-2 aone:text-base aone:leading-[20px] aone:rounded aone:px-1 aone:transition-colors`,{"aone:hover:bg-gray-300 aone:focus-visible:outline-none aone:focus-visible:ring-2 aone:focus-visible:ring-offset-2 aone:focus-visible:ring-gray-400":!s&&!e.disabled,"aone:cursor-not-allowed aone:opacity-60":!!s}),"data-testid":`autocomplete-remove-item-button`,"aria-label":`Remove ${D(e)}`,onClick:t=>{t.stopPropagation(),!s&&M(e)},children:`×`})]},n)),(0,q.jsx)(`span`,{id:g,className:`aone:sr-only`,children:se}),(0,q.jsx)(`span`,{id:_,className:`aone:sr-only`,children:re}),(0,q.jsx)(`span`,{id:v,className:`aone:sr-only`,children:ie}),fe()]}),N&&C.length>0&&(x?(0,rS.createPortal)((0,q.jsx)(`div`,{className:`aone:bg-white aone:text-gray-900 aone:rounded-lg aone:overflow-hidden aone:shadow-md aone:p-0 aone:box-border`,style:y,children:pe}),x):(0,q.jsx)(`div`,{className:`aone:absolute aone:w-inherit aone:bg-white aone:text-gray-900 aone:mt-2 aone:rounded-lg aone:overflow-hidden aone:shadow-md aone:p-0 aone:z-10`,children:pe}))]})}var oU=100;function sU({items:e,selectedItems:t,onInputChange:n,onSelectedItemsChange:r,placeholder:i,icon:a,disabled:o,shadowRoot:s}){let[c,l]=(0,K.useState)(``),[u,d]=(0,K.useState)(!1),f=(0,K.useRef)(null),p=(0,K.useId)(),m=(0,K.useRef)(null),h=(0,K.useMemo)(()=>e=>{m.current&&clearTimeout(m.current),e.trim()&&d(!0),m.current=setTimeout(()=>{n(e),d(!1),m.current=null},300)},[n]),g=(0,K.useMemo)(()=>{if(!e||e.length===0)return[];let t=new Date(new Date().getTime()+720*60*60*1e3),n=new Set,r=e.reduce((e,r)=>{if(n.has(r.key))return e;let i=`routeStart`in r&&r.routeStart&&r.routeStart>t?{...r,isNewRoute:!0}:r;return n.add(r.key),[...e,i]},[]);if(c?.trim()){let e=c.toLowerCase().trim();r=r.filter(t=>{let n=t;return!!(n.iata_code?.toLowerCase().includes(e)||n.city?.toLowerCase().includes(e)||n.name?.toLowerCase().includes(e)||n.country_code?.toLowerCase().includes(e)||n.state?.toLowerCase().includes(e))}),r.sort((t,n)=>{let r=t,i=n,a=r.iata_code?.toLowerCase()||``,o=i.iata_code?.toLowerCase()||``,s=r.city?.toLowerCase()||``,c=i.city?.toLowerCase()||``,l=e.toLowerCase();return a===l&&o!==l?-1:o===l&&a!==l?1:a.startsWith(l)&&!o.startsWith(l)?-1:o.startsWith(l)&&!a.startsWith(l)?1:s.startsWith(l)&&!c.startsWith(l)?-1:c.startsWith(l)&&!s.startsWith(l)?1:a.includes(l)&&!o.includes(l)?-1:o.includes(l)&&!a.includes(l)?1:0})}else r=r.slice(0,250);return r.sort((e,t)=>{let n=e,r=t,i=n.city?.toLowerCase()||``,a=r.city?.toLowerCase()||``;if(i===a){let e=n.iata_code?.toLowerCase()||``,t=r.iata_code?.toLowerCase()||``;return e.localeCompare(t)}return i.localeCompare(a)}),r.slice(0,oU)},[c,e]),_=(0,K.useMemo)(()=>{let e={};return g.forEach((t,n)=>{if(t.type===`airport`){let r=t.city?.charAt(0).toUpperCase();r&&!e[r]&&(e[r]=n)}}),e},[g]),v=e=>{let t=_[e];if(t===void 0||!f.current)return;let n=f.current.querySelector(`ul`);if(!n)return;let r=n.children[t];if(!r)return;let i=n.getBoundingClientRect(),a=r.getBoundingClientRect(),o=n.scrollTop,s=a.top-i.top+o;n.scrollTo({top:s,behavior:`smooth`})},y=(0,K.useMemo)(()=>Array.from({length:26},(e,t)=>String.fromCharCode(65+t)),[]),b=(e,t)=>{e.preventDefault(),e.stopPropagation(),v(t)},x=e=>{let n=e;if(t.length>1)return n.iata_code||``;let r=n.country===`US`&&n.state?`, ${n.state}`:``;return`${n.city}${r} (${n.iata_code})`},S=e=>{let t=e.ownerDocument,n=typeof Proxy==`function`&&!Object.isSealed(new Proxy({},{})),r={document:t,addEventListener:t.addEventListener.bind(e),removeEventListener:t.removeEventListener.bind(e),Node:window.Node,Element:window.Element,HTMLElement:window.HTMLElement,SVGElement:window.SVGElement};return n?new Proxy(r,{get(e,t){return e[t]}}):r},{getSelectedItemProps:C,getDropdownProps:w,removeSelectedItem:T}=Az({selectedItems:t,onStateChange({selectedItems:e,type:t}){t===Az.stateChangeTypes.FunctionRemoveSelectedItem&&r(e)}}),{isOpen:E,getMenuProps:D,getInputProps:O,getItemProps:k,selectedItem:A}=iz({environment:s?S(s):void 0,items:g,itemToString:e=>e?x(e):``,defaultHighlightedIndex:0,selectedItem:null,inputValue:c,onStateChange({inputValue:e,type:t,selectedItem:n}){switch(t){case iz.stateChangeTypes.InputKeyDownEnter:case iz.stateChangeTypes.ItemClick:n&&(r([n]),l(``));break;case iz.stateChangeTypes.InputChange:{let t=e??``;l(t),h(t);break}case iz.stateChangeTypes.InputBlur:break}}}),j=!!o,M=t.length>0,N=(E||c.trim()&&g.length>0)&&g.length>10&&Object.keys(_).length>3,P=E||c.trim().length>0&&g.length>0;return(0,K.useEffect)(()=>{let e=s?.host;if(e instanceof HTMLElement&&P)return rU(e),()=>iU(e)},[P,s]),(0,q.jsxs)(`div`,{className:`aone:w-full aone:h-full aone:relative aone:z-10`,role:`group`,"aria-disabled":o?!0:void 0,children:[(0,q.jsxs)(`div`,{className:(0,J.default)({"aone:bg-white aone:text-gray-700 aone:rounded-lg aone:gap-2 aone:items-center aone:py-2 aone:px-3 aone:h-[44px] aone:box-border aone:w-full aone:overflow-hidden aone:grid":!0,"aone:grid-cols-[24px_1fr]":t.length===0,"aone:grid-cols-[24px_auto_1fr]":t.length===1,"aone:grid-cols-[24px_auto_auto_1fr]":t.length===2,"aone:grid-cols-[24px_auto_auto_auto_1fr]":t.length===3,"aone:border-2 aone:border-gray-200 aone:focus-within:border-primary":!0,"aone:opacity-60 aone:cursor-not-allowed":!!o}),children:[a,t.map((e,t)=>(0,q.jsxs)(`span`,{...C({selectedItem:e,index:t}),className:`aone:bg-gray-200 aone:rounded aone:px-1 aone:focus:bg-gray-400 aone:whitespace-nowrap aone:text-ellipsis aone:shrink-0 aone:text-sm aone:flex aone:items-center`,children:[(0,q.jsx)(`span`,{className:`aone:overflow-hidden aone:grow`,children:x(e)}),!e.disabled&&(0,q.jsx)(`button`,{type:`button`,disabled:!!o||!!e.disabled,className:(0,J.default)(`aone:ml-2 aone:text-base aone:leading-[20px] aone:rounded aone:px-1 aone:transition-colors`,{"aone:hover:bg-gray-300 aone:focus-visible:outline-none aone:focus-visible:ring-2 aone:focus-visible:ring-offset-2 aone:focus-visible:ring-gray-400":!o&&!e.disabled,"aone:cursor-not-allowed aone:opacity-60":!!o}),"aria-label":`Remove ${x(e)}`,"data-testid":`schedule-autocomplete-remove-item-button`,onClick:t=>{t.stopPropagation(),!o&&T(e)},children:`×`})]},t)),o&&(0,q.jsx)(`span`,{id:p,className:`aone:sr-only`,children:`Field is locked`}),(()=>{let e=O({...w({preventKeyAction:E}),onKeyDown:e=>{if(e.key===`Backspace`&&!c&&t.length>0&&!o){let e=t[t.length-1];T(e)}}});return(0,q.jsx)(`input`,{"aria-label":`autocomplete`,className:`aone:outline-none aone:disabled:bg-transparent aone:text-base`,placeholder:j?``:i,...e,"aria-describedby":o?p:void 0,readOnly:M,disabled:j})})()]}),(E||c.trim()&&g.length>0)&&(0,q.jsx)(`div`,{className:`aone:absolute aone:w-full aone:min-w-full aone:bg-white aone:text-gray-900 aone:mt-2 aone:rounded-lg aone:shadow-md aone:p-0 aone:z-10`,children:(0,q.jsx)(`div`,{className:`aone:relative aone:w-full aone:overflow-hidden`,children:(0,q.jsxs)(`div`,{...D({className:`aone:flex aone:flex-col aone:min-w-0 aone:overflow-hidden`}),children:[N&&(0,q.jsx)(`div`,{className:`aone:flex aone:flex-wrap aone:gap-x-0.5 aone:gap-y-1 aone:justify-center aone:border-b aone:border-gray-200 aone:bg-gray-50 aone:px-2 aone:py-1.5`,role:`navigation`,"aria-label":`Jump to results by letter`,children:y.map(e=>{let t=_[e]!==void 0;return(0,q.jsx)(`button`,{type:`button`,onClick:n=>t?b(n,e):void 0,className:(0,J.default)({"aone:min-w-5 aone:text-xs aone:font-medium aone:px-0.5 aone:py-0.5 aone:rounded aone:transition-colors aone:cursor-pointer aone:text-center aone:shrink-0 aone:leading-none":!0,"aone:text-gray-600 aone:hover:text-blue-600 aone:hover:bg-blue-50":t,"aone:text-gray-300 aone:cursor-default":!t}),"data-testid":`schedule-autocomplete-letter-${e.toLowerCase()}`,title:t?`Jump to ${e}`:`No results for ${e}`,disabled:!t,children:e},e)})}),(0,q.jsx)(`div`,{className:`aone:min-w-0`,ref:f,children:(0,q.jsxs)(`ul`,{className:`aone:text-gray-900 aone:max-h-[600px] aone:overflow-y-auto aone:overflow-x-hidden aone:w-full`,children:[u&&(0,q.jsx)(`li`,{className:`aone:py-4 aone:px-3 aone:text-center aone:text-gray-500`,children:(0,q.jsxs)(`div`,{className:`aone:flex aone:items-center aone:justify-center aone:gap-2`,children:[(0,q.jsx)(`div`,{className:`aone:animate-spin aone:rounded-full aone:h-4 aone:w-4 aone:border-b-2 aone:border-primary`}),(0,q.jsx)(`span`,{children:`Searching airports...`})]})}),!u&&g.length>0&&g.map((e,n)=>{let r=e;return(0,q.jsxs)(`li`,{...k({item:e,index:n}),className:(0,J.default)({"aone:shadow-sm aone:py-2 aone:pl-3 aone:pr-2 aone:cursor-pointer aone:grid aone:grid-cols-[26px_1fr_40px] aone:gap-2 aone:justify-start aone:items-center aone:relative":!0,"aone:font-bold":A===e}),children:[(0,q.jsx)(`div`,{className:`aone:w-6 aone:h-6 aone:relative aone:flex aone:items-center aone:justify-center`,children:r.airlineCodes&&r.airlineCodes.length>0&&(0,q.jsx)(q.Fragment,{children:r.airlineCodes.length===1?(0,q.jsx)(`img`,{src:`https://content.r9cdn.net/rimg/provider-logos/airlines/v/${r.airlineCodes[0]}.png`,alt:r.airlineCodes[0],className:`aone:w-6 aone:h-6 aone:object-contain`},r.airlineCodes[0]):(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(yI,{icon:CA,className:`aone:w-6 aone:h-6 aone:text-gray-600`,title:`${r.airlineCodes.length} airlines`}),(0,q.jsx)(`span`,{className:`aone:absolute aone:right-0 aone:bg-blue-600 aone:text-white aone:text-[9px] aone:font-semibold aone:leading-none aone:px-1 aone:py-0.5 aone:rounded-full aone:min-w-[16px] aone:h-[16px] aone:flex aone:items-center aone:justify-center aone:shadow-sm aone:border aone:border-white`,style:{bottom:`-8px`},title:`${r.airlineCodes.length} airlines`,children:r.airlineCodes.length})]})})}),(0,q.jsxs)(`div`,{className:`aone:flex aone:flex-col aone:grow aone:gap-1 aone:overflow-hidden`,children:[(0,q.jsx)(`div`,{className:`aone:gap-2 aone:flex aone:items-end`,children:(0,q.jsxs)(`span`,{className:(0,J.default)({"aone:font-medium aone:text-sm aone:text-gray-900 aone:whitespace-nowrap aone:overflow-hidden aone:text-ellipsis aone:shrink":!0}),children:[r.city,r.country_code===`US`&&r.state?`, ${r.state}`:``]})}),(0,q.jsxs)(`span`,{className:(0,J.default)({"aone:text-sm aone:text-gray-600":!0}),children:[r.iata_code,` -`,` `,r.stops===0?`Nonstop Flight`:`One Stop`,`routeStart`in r&&r.routeStart&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`br`,{}),(0,q.jsx)(`span`,{className:(0,J.default)({"aone:text-sm aone:font-bold aone:text-green-600 aone:whitespace-nowrap":!0}),children:e.isNewRoute?`Route Starts `+r.routeStart.toLocaleDateString(`en-US`,{month:`2-digit`,day:`2-digit`,year:`2-digit`}):``})]})]})]}),(0,q.jsx)(`div`,{className:`aone:flex aone:justify-end aone:pl-4`,children:(0,q.jsx)(`input`,{type:`checkbox`,className:`aone:h-4 aone:w-4 aone:shrink-0 aone:rounded-sm aone:border aone:border-gray-400 aone:bg-white`,defaultChecked:!!t.find(t=>t.key===e.key)})})]},`${e.key}-${n}`)}),!u&&g.length===0&&c.trim()&&(0,q.jsxs)(`li`,{className:`aone:shadow-sm aone:py-2 aone:pl-3 aone:pr-2 aone:grid aone:grid-cols-[26px_1fr_40px] aone:gap-2 aone:justify-start aone:items-center`,children:[(0,q.jsx)(`div`,{className:`aone:w-6 aone:h-6 aone:relative aone:flex aone:items-center aone:justify-center`,children:(0,q.jsx)(yI,{icon:wA,className:`aone:w-5 aone:h-5 aone:text-gray-300`})}),(0,q.jsxs)(`div`,{className:`aone:flex aone:flex-col aone:grow aone:gap-1 aone:overflow-hidden`,children:[(0,q.jsxs)(`span`,{className:`aone:font-medium aone:text-sm aone:text-gray-900 aone:whitespace-nowrap aone:overflow-hidden aone:text-ellipsis`,children:[`No airports found for`,(0,q.jsx)(`span`,{className:`aone:ml-1 aone:font-semibold`,children:c})]}),(0,q.jsx)(`span`,{className:`aone:text-sm aone:text-gray-600`,children:`Try a different search term`})]}),(0,q.jsx)(`div`,{className:`aone:flex aone:justify-end aone:pl-4`})]})]})})]})})})]})}function cU(...e){return rA(NO(e))}function lU({className:e,...t}){return(0,q.jsx)(qx,{role:`status`,"aria-label":`Loading`,className:cU(`aone:size-4 aone:animate-spin`,e),...t})}var uU=K.forwardRef(({open:e,onOpenChange:t,children:n,title:r,className:i,...a},o)=>{let s=(0,K.useRef)(null);return(0,K.useImperativeHandle)(o,()=>s.current),(0,K.useEffect)(()=>{let n=s.current;if(!n)return;e&&!n.open&&n.showModal(),!e&&n.open&&n.close();let r=()=>document.documentElement.style.overflow=`hidden`,i=()=>document.documentElement.style.removeProperty(`overflow`);e?r():i();let a=()=>{i(),t(!1)},o=e=>{e.preventDefault(),t(!1)};return n.addEventListener(`close`,a),n.addEventListener(`cancel`,o),()=>{n.removeEventListener(`close`,a),n.removeEventListener(`cancel`,o),i()}},[e,t]),(0,q.jsxs)(`dialog`,{ref:s,className:`ao-dialog ${i??``}`,...a,children:[r&&(0,q.jsx)(`h2`,{id:`ao-title`,className:`aone:text-lg aone:font-semibold`,children:r}),(0,q.jsx)(`div`,{className:`ao-dialog__body`,children:n})]})});uU.displayName=`TopLayerDialog`;function dU({...e}){return(0,q.jsx)(lT,{"data-slot":`dialog`,...e})}function fU({className:e,...t}){return(0,q.jsx)(uT,{"data-slot":`dialog-title`,className:iA(`aone:text-lg aone:leading-none aone:font-semibold`,e),...t})}function pU({...e}){return(0,q.jsx)(DO,{"data-slot":`popover`,...e})}function mU({className:e,align:t=`center`,sideOffset:n=4,portalContainer:r,...i}){return(0,q.jsx)(AO,{container:r,children:(0,q.jsx)(jO,{"data-slot":`popover-content`,align:t,sideOffset:n,className:iA(`aone:z-50 aone:w-72 aone:origin-(--radix-popover-content-transform-origin) aone:rounded-md aone:border aone:bg-popover aone:p-4 aone:text-popover-foreground aone:shadow-md aone:outline-hidden aone:data-[side=bottom]:slide-in-from-top-2 aone:data-[side=left]:slide-in-from-right-2 aone:data-[side=right]:slide-in-from-left-2 aone:data-[side=top]:slide-in-from-bottom-2 aone:data-[state=closed]:animate-out aone:data-[state=closed]:fade-out-0 aone:data-[state=closed]:zoom-out-95 aone:data-[state=open]:animate-in aone:data-[state=open]:fade-in-0 aone:data-[state=open]:zoom-in-95`,e),...i})})}function hU({...e}){return(0,q.jsx)(OO,{"data-slot":`popover-anchor`,...e})}var gU=768;function _U(){let[e,t]=K.useState(()=>typeof window<`u`&&window.innerWidth<gU);return K.useEffect(()=>{let e=window.matchMedia(`(max-width: ${gU-1}px)`),n=()=>{t(window.innerWidth<gU)};return e.addEventListener(`change`,n),()=>e.removeEventListener(`change`,n)},[]),e}var vU=`aone:text-[#16A34A]`,yU=`aone:text-[#5895F7]`;function bU({date:e,startDate:t,endDate:n,onChange:r,onHover:i,stops:a,onlyDirects:o,previewDate:s,referenceDates:c,minDate:l}){let u=hm(new Date),d=l||u,f=t?ym(e,t):!1,p=t&&n?mh(e,hm(t))&&hh(e,n):!1,m=n?ym(e,n):!1,h=hh(e,d),g=s&&!f&&!m?ym(e,s):!1,_=c?.filter(t=>ym(hm(e),hm(t.date)))||[],v=!1,y=o&&a!==0?null:a;return o&&a!==0&&(v=!0),(0,q.jsx)(`div`,{className:(0,J.default)({"aone:w-14 aone:h-14 aone:flex aone:flex-col aone:items-center aone:justify-start aone:cursor-pointer":!0,"aone:text-white":f||m,"aone:bg-gray-600 aone:rounded-sm":f||m,"aone:bg-gray-200":p&&!!t&&!!n,"aone:text-[#565656]":!f&&!m,"aone:ring-2 aone:ring-primary":g,"aone:ring-2 aone:ring-blue-500 aone:ring-opacity-75 aone:bg-blue-50":_.length>0&&!f&&!m,"aone:cursor-not-allowed":h||v,"aone:relative aone:hover:ring-2 aone:hover:ring-blue-500 aone:hover:rounded-sm":!h&&!v,"aone:relative aone:after:absolute aone:after:bg-gray-600 aone:after:top-0 aone:after:bottom-0 aone:after:left-0 aone:after:right-0 aone:after:rounded-sm":f,"aone:before:absolute aone:before:left-1/2 aone:before:right-0 aone:before:top-0 aone:before:bottom-0 aone:before:bg-gray-200":f&&!!n,"aone:rounded-none":p,"aone:relative aone:after:absolute aone:after:bg-gray-600 aone:after:top-0 aone:after:bottom-0 aone:after:left-0 aone:after:right-0 aone:after:rounded-sm aone:before:absolute aone:before:left-0 aone:before:right-1/2 aone:before:top-0 aone:before:bottom-0 aone:before:bg-gray-200":m}),role:`gridcell`,tabIndex:!h&&!v?0:-1,"aria-label":(()=>{let t=`${e.toLocaleDateString(`en-US`,{weekday:`long`})}, ${e.toLocaleDateString(`en-US`,{month:`long`})} ${e.getDate()}, ${e.getFullYear()}`;if(f?t+=`, selected as start date`:m?t+=`, selected as end date`:p?t+=`, within selected date range`:g&&(t+=`, preview date`),h?t+=`, not available (before minimum date)`:v&&(t+=`, not available (no direct flights)`),y===0?t+=`, direct flights available`:y===1&&(t+=`, one-stop flights available`),_.length>0){let e=_.map(e=>e.label).join(`, `);t+=`, reference dates: ${e}`}return t})(),"aria-selected":f||m||p,"aria-disabled":h||v,"data-preview":g?`true`:void 0,onClick:()=>{!h&&!v&&r(new Date(e))},onMouseOver:()=>{!h&&!v&&i(new Date(e))},onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&!h&&!v&&(t.preventDefault(),r(new Date(e)))},children:(0,q.jsxs)(`span`,{className:(0,J.default)({"aone:relative aone:z-20 aone:font-semibold aone:leading-[16px] aone:flex aone:flex-col aone:justify-start aone:items-center aone:gap-1 aone:pt-2":!0,"aone:opacity-50":h||v}),children:[(0,q.jsx)(`span`,{children:e.getDate()}),y===0&&(0,q.jsx)(`span`,{className:(0,J.default)({"aone:text-[9px] aone:font-light aone:leading-none aone:whitespace-nowrap":!0,[vU]:!0}),"aria-label":`Nonstop flights available`,children:`Nonstop`}),y===1&&(0,q.jsx)(`span`,{className:(0,J.default)({"aone:text-[9px] aone:font-light aone:leading-none aone:whitespace-nowrap":!0,[yU]:!0}),"aria-label":`One-stop flights available`,children:`1 Stop`}),_.map((e,t)=>(0,q.jsx)(`div`,{className:(0,J.default)({"aone:text-[10px] aone:font-light aone:text-blue-700 aone:leading-tight aone:bg-blue-100 aone:px-1 aone:rounded aone:whitespace-nowrap":!0}),"aria-label":`Reference date: ${e.label}`,children:e.label},`${e.label}-${t}`))]})})}function xU({origin:e,previewDate:t,initialDate:n,startDate:r,endDate:i,oneWay:a,onlyDirects:o,onMonthViewChange:s,onChange:c,flightCalendar:l,referenceDates:u,minDate:d}){let[f,p]=(0,K.useState)(Sm(n)),m=uh(f,`MMMM yyyy`),h=um(f),g=a?null:i;(0,K.useEffect)(()=>{r&&queueMicrotask(()=>p(Sm(r)))},[r]),(0,K.useEffect)(()=>{t&&queueMicrotask(()=>p(Sm(t)))},[t]),(0,K.useEffect)(()=>{let e=um(f);s(e,am(e,42))},[f,s]);let _=Array(42).fill(0).map((e,t)=>am(h,t));return(0,q.jsxs)(`div`,{className:`aone:w-max aone:max-[767px]:w-full aone:text-[14px] aone:max-w-[100vw] aone:md:px-2 aone:md:pt-2 aone:lg:m-2`,role:`application`,"aria-label":`Calendar`,children:[(0,q.jsx)(`div`,{className:`aone:px-3 aone:py-1 aone:md:px-4 aone:md:py-2 aone:flex aone:gap-4`,children:(0,q.jsxs)(`div`,{className:`aone:flex aone:flex-grow aone:justify-between aone:items-center aone:text-gray-700`,children:[(0,q.jsx)(`button`,{type:`button`,className:`aone:w-8 aone:h-8 aone:bg-white aone:rounded-full aone:flex aone:items-center aone:justify-center aone:text-gray-700 aone:p-0`,onClick:()=>p(Og(f,{months:1})),"aria-label":`Previous month, go to ${uh(Og(f,{months:1}),`MMMM yyyy`)}`,"data-testid":`calendar-previous-month-button`,children:(0,q.jsx)(hA,{})}),(0,q.jsx)(`div`,{className:`aone:text-base aone:font-bold aone:mx-2`,"aria-live":`polite`,"aria-label":`Current month: ${m}`,children:m}),(0,q.jsx)(`button`,{type:`button`,className:`aone:w-8 aone:h-8 aone:bg-white aone:rounded-full aone:flex aone:items-center aone:justify-center aone:text-gray-700 aone:p-0`,onClick:()=>p(sm(f,{months:1})),"aria-label":`Next month, go to ${uh(sm(f,{months:1}),`MMMM yyyy`)}`,"data-testid":`calendar-next-month-button`,children:(0,q.jsx)(gA,{})})]})}),(0,q.jsx)(`div`,{className:`aone:grid aone:grid-cols-7 aone:border-b`,role:`rowgroup`,"aria-label":`Weekday headers`,children:s_.map((e,t)=>(0,q.jsx)(`div`,{className:`aone:min-w-0 aone:w-full aone:md:w-10 aone:h-7 aone:md:h-8 aone:flex aone:items-center aone:justify-center aone:text-black aone:font-bold aone:text-[#5b5b5b] aone:text-[13px] aone:md:text-[16px]`,"aria-hidden":`true`,children:e},`${e}-${t}`))}),(0,q.jsx)(`div`,{className:`aone:grid aone:grid-cols-7 aone:grid-rows-6 aone:pt-1 aone:md:pt-2 aone:pb-4 aone:md:pb-2 `,role:`grid`,"aria-label":`Calendar for ${m}`,children:_.map(n=>{let i=uh(n,`yyyy-MM-dd`),a=l?.[i];return(0,q.jsx)(bU,{date:n,startDate:r,endDate:g,previewDate:t,onChange:c,onHover:()=>{},origin:e,onlyDirects:o,stops:a?.stops,flightState:a?.flightsState,referenceDates:u,minDate:d},n.toISOString())})})]})}function SU({message:e,className:t,buttonRef:n}){let r=(0,K.useId)(),[i,a]=(0,K.useState)(!1);return(0,q.jsxs)(`span`,{className:(0,J.default)(`aone:relative aone:inline-flex`,t),onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),children:[(0,q.jsx)(`button`,{type:`button`,ref:n,className:`aone:inline-flex aone:items-center aone:justify-center aone:h-4 aone:w-4 aone:cursor-pointer aone:rounded-sm aone:text-red-500 aone:focus:outline-none aone:focus:ring-2 aone:focus:ring-red-500 aone:focus:ring-offset-1`,"data-testid":`error-icon`,"aria-label":`Validation error: ${e}`,"aria-expanded":i,"aria-controls":r,"aria-describedby":i?r:void 0,onFocus:()=>a(!0),onBlur:()=>a(!1),onClick:()=>a(e=>!e),children:(0,q.jsx)(yI,{icon:EA,"aria-hidden":`true`,className:`aone:h-4 aone:w-4`})}),i&&(0,q.jsx)(`div`,{id:r,role:`tooltip`,className:`aone:absolute aone:z-20 aone:top-full aone:left-1/2 aone:-translate-x-1/2 aone:mt-2 aone:bg-red-600 aone:text-white aone:text-xs aone:rounded aone:px-2 aone:py-1 aone:whitespace-nowrap`,children:e})]})}var CU=e=>{let t=e.match(/\d+/g)??[];if(t.length===0)return null;let n=parseInt(t[0].slice(0,2),10);if(Number.isNaN(n)||n<1||n>12)return null;let r=t[1]?.slice(0,2),i=Number(r??`1`);(Number.isNaN(i)||i<1||i>31)&&(i=1);let a=new Date().getFullYear(),o=t[2],s=a;if(o){let e=parseInt(o,10);s=o.length<=2?2e3+e:e}let c=new Date(s,n-1,i);return xm(c)?hm(c):null},wU=/^\d{2}\/\d{2}\/\d{2}$/,TU=e=>e.toLocaleDateString(`en-US`,{year:`2-digit`,month:`2-digit`,day:`2-digit`}),EU=(e,t=``)=>{let n=e.length<t.length,r=e.replace(/\D/g,``).slice(0,8);if(!n&&e.endsWith(`/`)){let t=e.slice(0,-1).split(`/`);if(t.length===1){let e=t[0];if(e&&e.length===1)return`0${e}/`}if(t.length===2){let e=t[0],n=t[1];if(n&&n.length===1)return`${(e??``).padStart(2,`0`)}/${`0${n}`}/`}}if(r.length===1&&t===``&&!n&&parseInt(r,10)>=3)return`0${r}/`;if(e.indexOf(`/`)===1&&r.length>=1){let e=r.slice(0,1).padStart(2,`0`),t=r.slice(1);switch(t.length){case 0:return n?e:`${e}/`;case 1:return`${e}/${t}`;case 2:return n?`${e}/${t}`:`${e}/${t}/`;default:return`${e}/${t.slice(0,2)}/${t.slice(2).slice(-2).padStart(2,`0`)}`}}switch(r.length){case 0:return``;case 1:return r;case 2:return n?e:`${r}/`;case 3:{let e=r.slice(0,2),i=r.slice(2);return!n&&t.replace(/\D/g,``).length===2&&/^\d{2}\/$/.test(t)&&parseInt(i,10)>=4?`${e}/0${i}/`:`${e}/${i}`}case 4:{let e=r.slice(0,2),t=r.slice(2,4);return n?`${e}/${t}`:`${e}/${t}/`}default:return`${r.slice(0,2)}/${r.slice(2,4)}/${r.slice(4).slice(-2)}`}},DU=e=>{let t=e.trim();if(t===``)return``;let n=(t.match(/\d+/g)??[]).slice(0,3);if(n.length===0)return``;let r=n[0].slice(-2).padStart(2,`0`);if(n.length===1)return r;let i=n[1].slice(-2).padStart(2,`0`);return n.length===2?`${r}/${i}`:`${r}/${i}/${n[2].slice(-2).padStart(2,`0`)}`},OU=e=>{if(!wU.test(e))return null;let t=wg(e,`MM/dd/yy`,new Date);return xm(t)&&TU(hm(t))===e?hm(t):null};function kU({origin:e,destination:t,onChange:n,onMonthViewChange:r,oneWay:i,className:a,primaryColor:o,secondaryColor:s,startDateLabel:c=`Start Date`,endDateLabel:l=`End Date`,flightCalendar:u,flightCalendarStatus:d,onlyDirects:f,initialStartDate:p,initialEndDate:m,referenceDates:h,minDate:g,showButtons:_=!0}){let v=(0,K.useRef)(null),y=(0,K.useRef)(null),b=(0,K.useRef)(0),[x,S]=(0,K.useState)(null);(0,K.useLayoutEffect)(()=>{if(!v.current)return;let e=v.current.getRootNode();if(!(e instanceof ShadowRoot))return;let t=document.createElement(`div`);return e.appendChild(t),queueMicrotask(()=>S(t)),()=>{t.parentNode&&t.parentNode.removeChild(t)}},[]);let[C,w]=(0,K.useState)(``),[T,E]=(0,K.useState)(``),[D,O]=(0,K.useState)(null),[k,A]=(0,K.useState)(null),[j,M]=(0,K.useState)(p||null),[N,P]=(0,K.useState)(m||null),[ee,F]=(0,K.useState)(!1),[te,ne]=(0,K.useState)(p||null),[re,ie]=(0,K.useState)(!1),[ae,oe]=(0,K.useState)(!1),[se]=(0,K.useState)(()=>p||new Date),ce=(0,K.useRef)(n),le=()=>Date.now()<b.current,ue=()=>{le()||F(!0)},de=()=>{b.current=Date.now()+250,F(!1)},fe=e=>{if(e){ue();return}de()};(0,K.useEffect)(()=>{ce.current=n},[n]),(0,K.useEffect)(()=>{i&&queueMicrotask(()=>{P(null),E(``),A(null)})},[i]),(0,K.useEffect)(()=>{queueMicrotask(()=>{!j&&p&&M(p),!N&&m&&P(m)})},[p,m,j,N]);let pe=hm(new Date),me=om(pe,6),he=e=>{w(e);let t=OU(e);if(e===``||!e){O(null),M(null);return}if(!t){O(`Enter a date in MM/DD/YY format`),M(null);return}if(hh(t,pe)){O(`Date cannot be in the past`),M(null);return}if(mh(t,me)){O(`Date must be within 6 months`),M(null);return}if(g&&hh(t,g)){O(`Date must be no earlier than `+g.toLocaleDateString()),M(null);return}O(null),M(t),ne(t),N&&hh(N,t)&&(P(null),E(``))},ge=e=>{if(i)return;E(e);let t=OU(e);if(e===``||!e){A(null),P(null);return}if(!t){A(`Enter a date in MM/DD/YY format`),P(null);return}if(hh(t,pe)){A(`Date cannot be in the past`),P(null);return}if(mh(t,me)){A(`Date must be within 6 months`),P(null);return}if(!j){A(`Enter departure date first`),P(null);return}if(hh(t,j)){A(`Return date must be after departure`),P(null);return}if(g&&hh(t,g)){A(`Date must be no earlier than `+g.toLocaleDateString()),P(null);return}A(null),P(t),ne(t)},I=()=>he(C),_e=()=>ge(T),L=e=>{let t=e.getTime()<(j?.getTime()||0);j?!N&&t?M(e):N?j&&N&&(ym(e,j)&&ym(e,N)?(M(e),P(null)):hh(e,N)&&hh(e,am(j,3))?M(e):P(e)):i?M(e):P(e):M(e)},ve=()=>{M(null),P(null),w(``),E(``),O(null),A(null),ne(null),ce.current(null,null)};(0,K.useEffect)(()=>{ce.current(j,N)},[j,N]),(0,K.useEffect)(()=>{queueMicrotask(()=>{j?(w(TU(j)),O(null)):D||w(``)})},[j]),(0,K.useEffect)(()=>{queueMicrotask(()=>{N?(E(TU(N)),A(null)):k||E(``)})},[N]);let ye={};o&&(ye[`--color-primary`]=o),s&&(ye[`--color-secondary`]=s);let be=_U(),xe=(0,K.useId)(),Se=`${xe}-description`,Ce=(0,q.jsxs)(`div`,{ref:y,onClick:ue,className:(0,J.default)(`aone:relative aone:h-full aone:flex aone:flex-col aone:gap-4 aone:px-3 aone:py-2 aone:rounded-lg aone:bg-white aone:text-gray-700 aone:cursor-pointer`,`aone:@2xl:flex-row aone:@2xl:items-center`,{"aone:border-2 aone:border-primary":ee,"aone:border-2 aone:border-gray-200":!ee}),children:[(0,q.jsxs)(`fieldset`,{className:`aone:border-0 aone:p-0 aone:m-0 aone:@2xl:flex-1 aone:@2xl:pr-3`,children:[(0,q.jsx)(`legend`,{className:`aone:sr-only`,children:`Date range selection`}),(0,q.jsxs)(`div`,{className:`aone:flex aone:grow aone:items-center`,children:[(0,q.jsx)(`span`,{children:(0,q.jsx)(mA,{})}),(0,q.jsxs)(`div`,{className:`aone:relative aone:grow`,children:[(0,q.jsx)(`input`,{type:`text`,name:`start-date`,value:C,"aria-label":c,"aria-invalid":D?`true`:void 0,placeholder:re?`mm/dd/yy`:c,autoComplete:`off`,className:(0,J.default)(`aone:ml-2 aone:all-initial aone:focus:outline-none aone:disabled:bg-white aone:text-black aone:text-base aone:w-full aone:pr-1`,{"aone:text-red-500 ":!!D}),onChange:e=>{let t=EU(e.target.value,C);w(t),O(null),ne(CU(t)),ce.current(null,N)},onFocus:()=>{ie(!0),ue()},onBlur:e=>{let t=DU(e.target.value);w(t),he(t),ie(!1)},onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),I(),e.target.blur())}}),D&&(0,q.jsx)(`span`,{className:`aone:absolute aone:right-2 aone:top-1/2 aone:-translate-y-1/2`,children:(0,q.jsx)(SU,{message:D})})]})]})]}),!i&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`div`,{className:`aone:absolute aone:left-2 aone:right-2 aone:top-1/2 aone:@2xl:top-2 aone:@2xl:bottom-2 aone:@2xl:left-1/2 aone:rounded-lg aone:h-[2px] aone:@2xl:h-[initial] aone:@2xl:w-[2px] aone:bg-gray-200`}),(0,q.jsxs)(`fieldset`,{className:`aone:border-0 aone:p-0 aone:m-0 aone:@2xl:flex-1 aone:@2xl:pl-3`,children:[(0,q.jsx)(`legend`,{className:`aone:sr-only`,children:`Return date selection`}),(0,q.jsxs)(`div`,{className:`aone:flex aone:grow aone:items-center`,children:[(0,q.jsx)(`span`,{className:`aone:@2xl:hidden`,children:(0,q.jsx)(mA,{})}),(0,q.jsxs)(`div`,{className:`aone:relative aone:grow`,children:[(0,q.jsx)(`input`,{type:`text`,name:`end-date`,value:T,"aria-label":l,"aria-invalid":k?`true`:void 0,placeholder:ae?`mm/dd/yy`:l,autoComplete:`off`,className:(0,J.default)(`aone:ml-2 aone:focus:outline-none aone:disabled:bg-white aone:text-black aone:text-base aone:w-full aone:pr-7`,{"aone:text-red-500":!!k}),onChange:e=>{let t=EU(e.target.value,T);E(t),A(null),ne(CU(t)),ce.current(j,null)},onFocus:()=>{oe(!0),ue()},onBlur:e=>{let t=DU(e.target.value);E(t),ge(t),oe(!1)},onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),_e(),e.target.blur())}}),k&&(0,q.jsx)(`span`,{className:`aone:absolute aone:right-2 aone:top-1/2 aone:-translate-y-1/2`,children:(0,q.jsx)(SU,{message:k})})]})]})]})]})]});return(0,q.jsxs)(`div`,{id:`A1-DateRangePicker`,ref:v,className:a,style:ye,role:`group`,"aria-label":`Date range picker`,"aria-describedby":Se,children:[be?(0,q.jsxs)(dU,{open:ee,onOpenChange:fe,children:[Ce,(0,q.jsxs)(uU,{className:`ao-dialog--calendar-light`,open:ee,onOpenChange:fe,"aria-labelledby":xe,"aria-describedby":void 0,children:[(0,q.jsx)(fU,{id:xe,className:`aone:sr-only`,children:`Filter Options`}),(0,q.jsx)(xU,{origin:e,destination:t,initialDate:se,startDate:j,endDate:N,previewDate:te,onChange:L,onMonthViewChange:r,flightCalendar:u,flightCalendarStatus:d,onlyDirects:f,referenceDates:h,minDate:g},se.toISOString()),_&&(0,q.jsxs)(`div`,{className:`aone:mt-3 aone:flex aone:justify-between aone:items-center aone:pt-0 aone:pb-1 aone:md:pb-2 aone:px-1`,children:[(0,q.jsx)(`button`,{type:`button`,className:`aone:bg-slate-400 aone:text-white aone:text-[14px] aone:rounded-lg aone:px-4 aone:py-1 aone:ring-slate-500`,onClick:ve,"data-testid":`date-range-picker-reset-button`,children:`Reset`}),(0,q.jsx)(`button`,{type:`button`,className:`aone:bg-primary aone:text-white aone:text-[14px] aone:rounded-lg aone:px-4 aone:py-1 aone:ring-primary`,onClick:de,"data-testid":`date-range-picker-done-button`,children:`Done`})]})]})]}):(0,q.jsxs)(pU,{open:ee,onOpenChange:fe,children:[(0,q.jsx)(hU,{asChild:!0,children:Ce}),(0,q.jsxs)(mU,{side:`bottom`,align:`center`,sticky:`always`,avoidCollisions:!1,onOpenAutoFocus:e=>e.preventDefault(),onInteractOutside:e=>{let t=e.target;t&&y.current?.contains(t)&&e.preventDefault()},sideOffset:4,portalContainer:x,role:`dialog`,"aria-label":`Calendar for date selection`,"aria-describedby":`calendar-instructions`,className:`aone:w-max aone:max-w-[100vw] aone:max-h-[calc(100dvh-1.5rem)] aone:overflow-y-auto aone:p-0 aone:bg-white aone:border aone:border-gray-300 aone:rounded-xl aone:shadow-lg aone:md:mt-2 aone:pb-2`,children:[(0,q.jsx)(`div`,{id:`calendar-instructions`,className:`aone:sr-only`,children:`Use arrow keys to navigate dates. Press Enter or Space to select a date. Press Escape to close the calendar.`}),(0,q.jsx)(xU,{origin:e,destination:t,initialDate:se,startDate:j,endDate:N,previewDate:te,onChange:L,onMonthViewChange:r,flightCalendar:u,flightCalendarStatus:d,onlyDirects:f,referenceDates:h,minDate:g},se.toISOString()),_&&(0,q.jsxs)(`div`,{className:`aone:mt-3 aone:md:mt-0 aone:flex aone:justify-between aone:items-center aone:pt-0 aone:pb-1 aone:md:pb-2 aone:px-5`,children:[(0,q.jsx)(`button`,{type:`button`,className:`aone:bg-slate-400 aone:text-white aone:text-[14px] aone:rounded-lg aone:px-4 aone:py-1 aone:ring-slate-500`,onClick:ve,"data-testid":`date-range-picker-popover-reset-button`,children:`Reset`}),(0,q.jsx)(`button`,{type:`button`,className:`aone:bg-primary aone:text-white aone:text-[14px] aone:rounded-lg aone:px-4 aone:py-1 aone:ring-primary`,onClick:de,"data-testid":`date-range-picker-popover-done-button`,children:`Done`})]})]})]}),(0,q.jsx)(`div`,{id:Se,className:`aone:sr-only`,children:i?`Departure date input. Enter a date manually or open the calendar to pick one.`:`Departure and return date inputs. Enter dates manually or open the calendar to pick a date range.`})]})}var AU=ef({apiDomain:V(),locationId:V().optional(),origin:V().nullable().optional(),destination:V().nullable().optional(),destinations:V().optional(),primaryColor:V().optional(),secondaryColor:V().optional(),airlines:V().nullable().optional(),providers:V().nullable().optional(),workerUrl:V().optional(),theme:Cf([`dark`,`light`]).optional(),defaultNearbyDatesForLowerFares:U().optional(),shadowRoot:fp(e=>typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot).optional(),subscribingAirport:V().optional(),consentDataSharing:U().optional(),consentAnalytics:U().optional(),consentAdvertising:U().optional(),consentFunctional:U().optional(),onOriginChange:fp(e=>typeof e==`function`).optional(),onDestinationChange:fp(e=>typeof e==`function`).optional(),fmaDomain:V().optional(),hideBranding:U().optional(),hideCarButton:U().optional(),disableOrigins:U().optional(),disableDestinations:U().optional(),experimentId:V().optional(),autocompleteType:Cf(Qg).optional(),arrivalAirportLabel:V().optional(),departureAirportLabel:V().optional(),departureDateLabel:V().optional(),returnDateLabel:V().optional(),channel:Cf(zg).optional()}),jU=new tb;function MU(e){let t=``;for(let n=0;n<e.length;++n){let r=e[n];if(r){if(r.type===`place`){let e=r;e.iata_code?t+=e.iata_code:e.nearbyAirports&&e.nearbyAirports.length>0&&(t+=e.nearbyAirports[0].iata_code+`,nearby`)}r.type===`airport`&&(t+=r.iata_code),n<e.length-1&&e.length>1&&(t+=`,`)}}return t}function NU({apiDomain:e,origin:t,destination:n,airlines:r,providers:i,destinations:a,locationId:o,experimentId:s,departureDateLabel:c=`Departure Date`,returnDateLabel:l=`Return Date`,workerUrl:u=`https://worker-v2.flymyairport.com`,theme:d=`light`,channel:f,defaultNearbyDatesForLowerFares:p,shadowRoot:m,subscribingAirport:h,consentDataSharing:g=!0,consentAnalytics:_=!0,consentAdvertising:v=!0,consentFunctional:y=!0,onOriginChange:b=()=>{},onDestinationChange:x=()=>{},fmaDomain:S=`https://flymyairport.com`,hideBranding:C=!1,hideCarButton:w=!1,disableOrigins:T=!0,disableDestinations:E=!0,autocompleteType:D=Xg.kayak}){let[O,k]=(0,K.useState)({origins:[],destinations:[],startDate:null,endDate:null,oneWay:!1,defaultNearbyDatesForLowerFares:!!p}),{clickId:A}=Pv(),j=(0,K.useMemo)(()=>{let e=MU(O.origins);return b(e),e},[O.origins,b]),M=(0,K.useMemo)(()=>{let e=MU(O.destinations);return x(e),e},[O.destinations,x]),N=O.origins[0],P=O.destinations[0],ee=!!(N?.itemType===G.METRO&&N?.iata_code),F=!!(P?.itemType===G.METRO&&P?.iata_code);if(!Ug.safeParse(o).success)throw Error(`Unable to parse location id`);if(s&&s!==`0`&&s!==`1`)throw Error(`experimentId must be 0 or 1`);let te=t?.toLocaleUpperCase(),ne=n?.toLocaleUpperCase(),re=r?.split(`,`).map(e=>e.toLocaleUpperCase().trim()).filter(e=>e!==``),ie=i?.split(`,`).map(e=>e.toLocaleUpperCase().trim()).filter(e=>e!==``),ae=i===r&&i?.length===2&&r?.length===2,[oe,se]=(0,K.useState)(!1),ce=oe?!!ne:!!te,le=oe?!!te:!!ne,[ue,de]=(0,K.useState)(null),[fe,pe]=(0,K.useState)(null),me=(0,K.useMemo)(()=>O.origins?.length&&O.destinations?.length&&O.startDate?O.endDate&&O.oneWay===!1?!0:!(!O.endDate&&O.oneWay===!1):!1,[O]),he=e=>D===Xg.schedule_data?(0,q.jsx)(sU,{shadowRoot:m,icon:e.icon,placeholder:e.placeholder,disabled:e.disabled,items:e.items,selectedItems:e.selectedItems,onInputChange:e.onInputChange,onSelectedItemsChange:e.onSelectedItemsChange}):(0,q.jsx)(aU,{dataTestId:e.dataTestId,fieldLabel:e.fieldLabel,shadowRoot:m,icon:e.icon,placeholder:e.placeholder,disabled:e.disabled,items:e.items,selectedItems:e.selectedItems,onInputChange:e.onInputChange,onSelectedItemsChange:e.onSelectedItemsChange}),{data:ge,status:I,setQuery:_e}=kB({key:`origin-suggest`,apiDomain:e,airportIATA:M,providersArr:ie,airlinesArr:re,autocompleteType:D}),L=(0,K.useMemo)(()=>D===Xg.schedule_data?ge?.map((e,t)=>({...e,sectionIndex:t,type:`airport`,key:e.iata_code||`airport-${t}`}))||[]:(0,$H.default)(ge?.filter(e=>!!e.nearbyAirports?.length||e.itemType===G.METRO).map(e=>{let t=e.types.includes(`airport`);return[{...e,sectionIndex:0,type:t?`airport-place`:`place`,key:e.formatted_address},...e.nearbyAirports.map((e,n)=>({...e,itemType:G.AIRPORT,sectionIndex:t?-1:n,type:`airport`,key:`${e.iata_code}`}))]}).flat(),e=>e.key).filter((e,t,n)=>{if(e.type===`place`){let r=e;if(r.itemType===G.METRO&&r.iata_code)return!0;let i=n.at(t+1);if(!i||i.type!==`airport`)return!1}return!0}),[ge,D]),{data:ve,status:ye,setQuery:be}=kB({key:`destination-suggest`,apiDomain:e,airportIATA:j,providersArr:ie||[],airlinesArr:re||[],autocompleteType:D}),xe=(0,K.useMemo)(()=>D===Xg.schedule_data?ve?.map((e,t)=>({...e,sectionIndex:t,type:`airport`,key:e.iata_code||`airport-${t}`}))||[]:(0,$H.default)(ve?.filter(e=>!!e.nearbyAirports?.length||e.itemType===G.METRO).map(e=>{let t=e.types.includes(`airport`);return[{...e,sectionIndex:0,type:t?`airport-place`:`place`,key:e.formatted_address},...e.nearbyAirports.map((e,n)=>({...e,itemType:G.AIRPORT,sectionIndex:t?-1:n,type:`airport`,key:`${e.iata_code}`}))]}).flat(),e=>e.key).filter((e,t,n)=>{if(e.type===`place`){let r=e;if(r.itemType===G.METRO&&r.iata_code)return!0;let i=n.at(t+1);if(!i||i.type!==`airport`)return!1}return!0}),[ve,D]),Se=(0,K.useMemo)(()=>ue?vm([ue,new Date]):null,[ue]),Ce=(0,K.useMemo)(()=>O.startDate?am(O.startDate,1):null,[O.startDate]),we=(0,K.useMemo)(()=>({origin:j,destination:M,startDate:Se||void 0,endDate:fe||void 0,departureLocationType:ee?G.METRO:G.AIRPORT,arrivalLocationType:F?G.METRO:G.AIRPORT}),[j,M,Se,fe,ee,F]),Te=(0,K.useMemo)(()=>({origin:M,destination:j,startDate:Ce||void 0,endDate:fe||void 0,departureLocationType:F?G.METRO:G.AIRPORT,arrivalLocationType:ee?G.METRO:G.AIRPORT}),[M,j,Ce,fe,F,ee]),{data:Ee,status:De}=GB({apiDomain:e,params:we}),{data:Oe,status:ke}=GB({apiDomain:e,params:Te});(0,K.useEffect)(()=>{if(te&&DB({query:te,searchType:qg.Flights}).then(e=>{let t=e.find(e=>e.id.toLowerCase()===te.toLowerCase());if(t){let e={iata_code:t.id,city:t.cityonly,lat:t.lat,lng:t.lng,country_code:t.cc,name:t.displayname,itemType:t.isMetroOnly?G.METRO:G.AIRPORT};k(n=>({...n,origins:[{...e,type:`airport`,key:t.id,sectionIndex:-1,disabled:T}]}))}}),ne){let e=ne.split(`,`).map(e=>DB({query:e,searchType:qg.Flights}).then(t=>{let n=t.find(t=>t.id.toLowerCase()===e?.toLowerCase());return n?{iata_code:n.id,city:n.cityonly,lat:n.lat,lng:n.lng,country_code:n.cc,name:n.displayname,itemType:n.isMetroOnly?G.METRO:G.AIRPORT,type:`airport`,key:n.id,sectionIndex:-1,disabled:E}:null}));Promise.all(e).then(e=>{let t=e.filter(e=>e!==null);t.length>0&&k(e=>({...e,destinations:t}))})}},[te,ne,T,E]);let Ae=(0,K.useCallback)((e,n)=>{k({...O,startDate:e,endDate:n}),(e||n)&&Q_({name:`Flight Search - Date Range Change`,properties:{airport_iata:t||``,origin:j,desination:M,destination:M,departure_date:e?.toISOString(),return_date:n?.toISOString()}})},[O,t,j,M]),je=(0,K.useCallback)((e,t)=>{de(t=>t&&t.getTime()===e.getTime()?t:e),pe(e=>e&&e.getTime()===t.getTime()?e:t)},[]),Me=()=>{let{origins:e,destinations:t}=O;se(e=>!e),k({...O,origins:t,destinations:e})},Ne=e=>{e.preventDefault();let n=new FormData(e.currentTarget),r=Object.fromEntries(n.entries()),i=j,a=M,s=O.startDate,c=O.endDate,l=O.oneWay;if(!i||!a||!s||!c&&!l)throw Error(`All fields must be filled out`);let d=s.toISOString().split(`T`)[0],p=c?.toISOString().split(`T`)[0];if(r[`flexible-dates`]&&!ae){let e=`-flexible-3days`;d+=e,p+=e}let m=r.cabin,b=r.pax,x=p_({worker_domain:u,airport_iata:h||t||i,dep_iata:i||``,arr_iata:a+``||``,departDate:d||``,returnDate:p||``,cabin:m||void 0,pax:b||void 0,filterState:{providers:ie?.join(`,`),airlines:re?.join(`,`)},params:{enc_cid:A||``,enc_lid:Jg({airport:h||t||i,channel:f||`EMB`,action:`SEARCH`,userDefinedPage:o||`UNDEF`,originIATA:i,destinationIATA:a}),consent_data_sharing:g,consent_analytics:_,consent_advertising:v,consent_functional:y,departure_location_type:ee?G.METRO:G.AIRPORT,arrival_location_type:F?G.METRO:G.AIRPORT,from_url:encodeURIComponent(window?.location.href)}});Q_({name:`Flight Search - Search Button Clicked`,properties:{airport_iata:t||``,origin:j,desination:M,destination:M,departure_date:s?.toISOString(),return_date:O.endDate?.toISOString()}}),window.open(x,`_blank`)},R=[{display:`Roundtrip`,value:`roundtrip`},{display:`One-way`,value:`one-way`}],Pe=[{display:`Economy`,value:c_.enum.economy},{display:`Premium Economy`,value:c_.enum.premium},{display:`Business`,value:c_.enum.business},{display:`First`,value:c_.enum.first}],Fe=Array(9).fill(0).map((e,t)=>{let n=t+1;return{value:l_.options[t],display:`${n} Traveler${n>1?`s`:``}`}}),Ie=[`Flights`,...w?[]:[`Cars`]],Le=(0,K.useMemo)(()=>h&&ne?.includes(h)?`to`:`from`,[h,ne]),Re=(0,q.jsx)(`div`,{className:`aone:flex aone:rounded-md aone:items-center aone:justify-center aone:gap-2`,children:Ie.map((e,t)=>(0,q.jsx)(K.Fragment,{children:(0,q.jsx)(`a`,{href:t>0?`${S}/${Le}/${h}/${e.toLowerCase()}`:`#`,onClick:e=>{t===0&&e.preventDefault()},target:`_blank`,className:(0,J.default)({"aone:text-black aone:border-white aone:ring-1 aone:ring-white aone:focus-visible:outline-none aone:focus-visible:ring-2 aone:focus-visible:ring-white aone:dark:text-white aone:text-base aone:leading-tight aone:w-[96px] aone:text-center aone:px-4 aone:py-1":!0,"aone:@xl:hover:bg-secondary aone:grow-0":t>=1," aone:bg-transparent aone:rounded-lg aone:@xl:hover:text-black aone:dark:@xl:hover:text-white":t>=1,"aone:bg-primary aone:text-white aone:grow-0 aone:rounded-lg":t===0,"aone:justify-center aone:items-center":t===0}),children:e})},t))}),ze=(0,q.jsx)(nB,{hideByDefault:!0}),Be=(0,q.jsxs)(`div`,{className:`aone:@2xl:flex aone:@2xl:flex-row aone:pb-1 aone:items-center aone:justify-between`,children:[(0,q.jsx)(`div`,{className:`aone:flex aone:flex-col aone:@2xl:flex-row aone:items-center aone:@2xl:gap-2 aone:mb-2 aone:@2xl:mb-0`,children:(0,q.jsx)(`div`,{className:`aone:flex aone:justify-center aone:@2xl:justify-start aone:text-[35px] aone:text-foreground`,children:(0,q.jsx)(HB,{regMarkClassName:`aone:text-[16px] aone:ml-0.5 aone:leading-none`})})}),(0,q.jsx)(`div`,{className:(0,J.default)({"aone:hidden":!0,"aone:@2xl:justify-start aone:@2xl:flex aone:@2xl:w-[190px]":S!==``}),children:Re}),(0,q.jsx)(`div`,{className:`aone:block aone:@2xl:hidden`,children:Re}),(0,q.jsx)(`div`,{className:(0,J.default)({"aone:pb-0.5":!0,"aone:hidden aone:@2xl:flex aone:flex-col aone:items-center aone:@2xl:items-end aone:@2xl:w-[190px]":!0}),children:re&&re.length>0?null:(0,q.jsx)(`div`,{children:ze})})]});return(0,q.jsxs)(ib,{client:jU,children:[(0,q.jsx)(`div`,{"data-mode":d,style:{"--primary":`var(--color-primary-hsl, 210 100% 50%)`,"--secondary":`var(--color-secondary-hsl, 210 100% 50%)`},className:`aone:w-full aone:@container aone:relative`,children:(0,q.jsxs)(`form`,{className:`aone:flex aone:flex-col aone:gap-2`,onSubmit:Ne,children:[!C&&Be,(0,q.jsxs)(`div`,{className:`aone:flex aone:flex-wrap aone:justify-between aone:gap-4 aone:max-w-full aone:w-full`,children:[(0,q.jsxs)(`div`,{className:(0,J.default)({"aone:flex aone:gap-1 aone:@2xl:gap-4":!0}),children:[(0,q.jsx)(`select`,{"aria-label":`trip-option`,name:`trip-option`,className:`aone:text-foreground aone:text-base aone:bg-transparent aone:truncate aone:min-w-0 aone:w-full`,onChange:e=>{k(t=>({...t,oneWay:e.target.value===`one-way`}))},children:R.map((e,t)=>(0,q.jsx)(`option`,{className:`aone:dark:bg-black aone:dark:text-white aone:text-base`,value:e.value,children:e.display},`${e.value}-${t}`))}),(0,q.jsx)(`select`,{name:`pax`,"aria-label":`pax`,className:`aone:text-foreground aone:text-base aone:bg-transparent aone:truncate aone:min-w-0 aone:w-full`,children:Fe.map((e,t)=>(0,q.jsx)(`option`,{className:`aone:dark:bg-black aone:dark:text-white aone:text-base`,value:e.value,children:e.display},`${e.value}-${t}`))}),(0,q.jsx)(`select`,{name:`cabin`,"aria-label":`cabin`,className:`aone:text-foreground aone:text-base aone:bg-transparent aone:truncate aone:min-w-0 aone:w-full`,children:Pe.map((e,t)=>(0,q.jsx)(`option`,{className:`aone:dark:bg-black aone:dark:text-white aone:text-base`,value:e.value,children:e.display},`${e.value}-${t}`))})]}),!ae&&(0,q.jsxs)(`label`,{className:`aone:hidden aone:@5xl:flex aone:text-foreground aone:items-center aone:text-base`,children:[(0,q.jsx)(`input`,{type:`checkbox`,name:`flexible-dates`,defaultChecked:p}),`\xA0\xA0Show nearby dates for lower fares`]})]}),(0,q.jsxs)(`div`,{className:(0,J.default)({"aone:flex aone:flex-col aone:gap-6":!0,"aone:@5xl:grid aone:@5xl:grid-cols-2":!O.oneWay,"aone:@5xl:grid aone:@5xl:grid-cols-[3fr_400px]":O.oneWay}),children:[(0,q.jsxs)(`div`,{className:`aone:flex aone:flex-col aone:items-center aone:@xl:grid aone:@xl:grid-cols-[calc(50%-20px)_24px_calc(50%-20px)] aone:w-full aone:gap-2`,children:[(0,q.jsx)(`div`,{className:`aone:flex aone:items-center aone:w-full aone:relative aone:z-100`,children:he({dataTestId:`flight-search-form-origin`,fieldLabel:`Origin`,icon:I===`pending`?(0,q.jsx)(lU,{}):(0,q.jsx)(yI,{className:`aone:w-6 aone:h-6`,icon:CA,style:{width:`24px`,height:`24px`}}),placeholder:`From?`,disabled:ce,items:L||[],selectedItems:O.origins,onInputChange:e=>_e(e),onSelectedItemsChange:e=>{let n=T?e?.slice(0,1):e;Q_({name:`Flight Search - Origin Changed`,properties:{airport_iata:t||``,origin:j,desination:M,destination:M,departure_date:O.startDate?.toISOString(),return_date:O.endDate?.toISOString()}}),k(e=>({...e,origins:n||[]}))}})}),(0,q.jsx)(`button`,{type:`button`,className:`aone:w-6 aone:text-gray-900 aone:rotate-90 aone:@xl:rotate-0 aone:dark:text-gray-400`,onClick:Me,"aria-label":`Switch Origin and Destination`,"data-testid":`flight-search-switch-airports-button`,children:(0,q.jsx)(KB,{})}),(0,q.jsx)(`div`,{className:`aone:flex aone:items-center aone:w-full`,children:he({dataTestId:`flight-search-form-destination-autocomplete`,fieldLabel:`Destination`,icon:ye===`pending`?(0,q.jsx)(lU,{}):(0,q.jsx)(yI,{className:`aone:w-6 aone:h-6`,icon:xA,style:{width:`24px`,height:`24px`}}),placeholder:`To?`,disabled:le,items:xe||[],selectedItems:O.destinations,onInputChange:e=>be(e),onSelectedItemsChange:e=>{let n=E?e?.slice(0,1):e;Q_({name:`Flight Search - Destination Changed`,properties:{airport_iata:t||``,origin:j,desination:M,destination:M,departure_date:O.startDate?.toISOString(),return_date:O.endDate?.toISOString()}}),k(e=>({...e,destinations:n||[]}))}})})]}),(0,q.jsxs)(`div`,{className:(0,J.default)({"aone:flex aone:flex-col aone:items-center aone:gap-4":!0,"aone:@5xl:flex-row aone:@5xl:items-end aone:@5xl:gap-4":!0,grow:!0}),children:[(0,q.jsx)(`div`,{className:`aone:w-full aone:@5xl:flex-1 aone:@5xl:min-w-0`,children:(0,q.jsx)(kU,{origin:j,destination:M,startDateLabel:c,endDateLabel:l,onChange:Ae,onMonthViewChange:je,oneWay:O.oneWay,shadowRoot:m,onlyDirects:ie&&re&&ie?.length>0&&re?.length>0,flightCalendar:!O.startDate||O.oneWay?Ee:Oe,flightCalendarStatus:!O.startDate||O.oneWay?De:ke})}),(0,q.jsxs)(`div`,{className:`aone:flex aone:flex-col aone:gap-6 aone:items-center aone:justify-center aone:@5xl:shrink-0`,children:[!ae&&(0,q.jsxs)(`label`,{className:`aone:text-foreground aone:text-base aone:flex aone:items-center aone:@5xl:hidden aone:gap-3`,children:[(0,q.jsx)(`input`,{type:`checkbox`,name:`flexible-dates`,defaultChecked:p}),(0,q.jsx)(`span`,{children:`Show nearby dates for lower fares`})]}),(0,q.jsxs)(`button`,{"aria-label":me?`Search flights`:`Search flights - Please complete all required fields`,"aria-disabled":!me,tabIndex:0,type:`submit`,"data-testid":`flight-search-submit-button`,onClick:e=>{me||e.preventDefault()},className:`aone:h-[44px] aone:w-auto aone:min-w-[100px] aone:max-w-[200px] aone:rounded-lg aone:flex aone:align-center aone:items-center aone:gap-1 aone:px-4 aone:focus-visible:outline-none aone:focus-visible:ring-2 aone:focus-visible:ring-offset-2 aone:focus-visible:ring-offset-white aone:dark:focus-visible:ring-offset-black ${me?`aone:bg-green-500 aone:text-white aone:hover:bg-green-700 aone:active:bg-green-700 aone:focus-visible:ring-green-700 aone:dark:bg-green-600 aone:dark:hover:bg-green-800 aone:dark:active:bg-green-800 aone:dark:focus-visible:ring-green-600`:`aone:bg-gray-300 aone:text-gray-700 aone:cursor-not-allowed aone:dark:bg-gray-600 aone:dark:text-gray-300`}`,children:[(0,q.jsx)(AB,{}),(0,q.jsx)(`span`,{className:`aone:text-base`,children:`Search`})]})]})]})]})]})}),(0,q.jsx)(`div`,{className:`aone:visible aone:@2xl:hidden`,children:!C&&ze})]})}var PU=Object.keys(AU.shape);function FU(e,t,n){let r={...n};typeof r.destination!=`string`&&typeof r.destinations==`string`&&(r.destination=r.destinations),typeof r.destinations!=`string`&&typeof r.destination==`string`&&(r.destinations=r.destination),r.origin==null&&t?.iata&&(r.origin=t.iata.toUpperCase()),r.primaryColor==null&&t?.primaryColor&&(r.primaryColor=t.primaryColor),r.secondaryColor==null&&t?.secondaryColor&&(r.secondaryColor=t.secondaryColor);for(let t of PU){let n=zB(t).map(t=>e.getAttribute(t)).find(e=>e!==null&&e.trim()!==``);n!==void 0&&(r[t]=n)}return(r.subscribingAirport==null||typeof r.subscribingAirport==`string`&&r.subscribingAirport.trim()===``)&&t?.iata?.trim()&&(r.subscribingAirport=t.iata.trim().toUpperCase()),typeof r.defaultNearbyDatesForLowerFares==`string`&&(r.defaultNearbyDatesForLowerFares=BB(r.defaultNearbyDatesForLowerFares,!1)),typeof r.consentDataSharing==`string`&&(r.consentDataSharing=BB(r.consentDataSharing,!0)),typeof r.consentFunctional==`string`&&(r.consentFunctional=BB(r.consentFunctional,!0)),typeof r.consentAnalytics==`string`&&(r.consentAnalytics=BB(r.consentAnalytics,!0)),typeof r.consentAdvertising==`string`&&(r.consentAdvertising=BB(r.consentAdvertising,!0)),typeof r.hideCarButton==`string`&&(r.hideCarButton=BB(r.hideCarButton,!1)),r.consentAnalytics===void 0&&(r.consentAnalytics=!0),r.consentAdvertising===void 0&&(r.consentAdvertising=!0),r.consentFunctional===void 0&&(r.consentFunctional=!0),r.consentDataSharing===void 0&&(r.consentDataSharing=!0),r}function IU(e,t,n,r){return{...FU(e,n,r),apiDomain:t,...r.userStyleBlock?.trim()?{userStyleBlock:r.userStyleBlock}:{}}}var LU=new tb;function RU(e){let{userStyleBlock:t,...n}=e;return(0,q.jsx)(ib,{client:LU,children:(0,q.jsxs)(Tb,{useSessionStorageOnly:!0,children:[(0,q.jsx)(`style`,{children:Ab}),t?(0,q.jsx)(`style`,{children:t}):null,(0,q.jsx)(NU,{...n})]})})}function zU(e){if(!e||typeof e.iata!=`string`)return;let t=e.iata.trim().toUpperCase();return t.length===3?t:void 0}var BU=Object.keys(AU.shape),VU=[...new Set([...BU.flatMap(e=>zB(e)),`borderradius`,`border-radius`,`theme`,o_,`id`])],HU=class extends HTMLElement{_shadowRoot;_mountPoint;_reactRoot;_renderInProgress=!1;_renderQueued=!1;_renderScheduled=!1;_mountTelemetrySent=!1;_lastPublicConfigTelemetryKey=null;static get observedAttributes(){return Array.from(VU)}attributeChangedCallback(e,t,n){t!==n&&this.isConnected&&this._scheduleRender()}connectedCallback(){this.style.position=`relative`,this.style.zIndex=`10`,this.style.lineHeight=`1.5`,this.style.display=`flex`,this.style.flexDirection=`column`,this.style.background=`none`,this.style.backgroundColor=`transparent`,this._scheduleRender()}disconnectedCallback(){this._reactRoot&&=(this._reactRoot.unmount(),void 0),this._mountTelemetrySent=!1,this._lastPublicConfigTelemetryKey=null}_scheduleRender(){this._renderScheduled||(this._renderScheduled=!0,queueMicrotask(()=>{this._renderScheduled=!1,this.isConnected&&this._renderAsync()}))}async _renderAsync(){if(this._renderInProgress){this._renderQueued=!0;return}this._renderInProgress=!0;try{let e=A_(this),t=I_(),n=null,r=!1,i={attempted:!1,durationMs:0},a;if(e&&t){let t=await L_(e);i=t.metrics;let o=t.config;o?.widgetType&&o.widgetType!==`airfare-search`&&(console.warn(`[airport-one-widgets] Widget instance type does not match airfare-search:`,o.widgetType),a=`widget_type_mismatch`,o=null),n=o,r=!n,i.attempted&&n===null&&a===void 0&&i.failureKind&&(a=i.failureKind)}if(!this.isConnected)return;let o=G_(n),s=window[zp],c=IU(this,`https://flymyairport.vercel.app`,s,o),l=zU(n);l&&(c.subscribingAirport=l);let u=!i.attempted&&(!t||!e)?t?`no_instance_id`:`no_api_base`:void 0;if(c.consentAnalytics){let r=i.attempted?`attempt:${t}|${e}|${n===null?`fail`:`ok`}|${a??``}`:`skip:${u??`none`}`;r!==this._lastPublicConfigTelemetryKey&&(this._lastPublicConfigTelemetryKey=r,Wv(!0,{widget_runtime:`airfare-search`,attempted:i.attempted,duration_ms:i.durationMs,ok:i.attempted?n!==null:!1,error_kind:i.attempted&&n===null?a:void 0,skip_reason:u}))}r&&console.warn(`${M_}: airfare-search — managed instance config not applied; using host attributes and window defaults.`),this._paintAirfareSearch(c),c.consentAnalytics&&!this._mountTelemetrySent&&(this._mountTelemetrySent=!0,Gv(!0,{widget_runtime:`airfare-search`,public_config_unavailable:r}))}finally{this._renderInProgress=!1,this._renderQueued&&(this._renderQueued=!1,queueMicrotask(()=>{this.isConnected&&this._renderAsync()}))}}_paintAirfareSearch(e){let t=this._shadowRoot??=this.attachShadow({mode:`closed`}),n=this._mountPoint??=document.createElement(`span`);n.style.background=`none`,n.style.backgroundColor=`transparent`,n.parentNode!==t&&t.appendChild(n);let r={...e,shadowRoot:t},i=r.primaryColor!=null&&m_.test(r.primaryColor),a=r.secondaryColor!=null&&m_.test(r.secondaryColor),o=r.primaryColor??`210 100% 50%`,s=r.secondaryColor??`210 100% 50%`,c=i?__(o):o,l=a?__(s):s;this.style.setProperty(`--primary`,c),this.style.setProperty(`--secondary`,l),this.style.setProperty(`--color-primary`,`hsl(${c})`),this.style.setProperty(`--color-secondary`,`hsl(${l})`),this.style.setProperty(`--color-primary-hsl`,c),this.style.setProperty(`--color-secondary-hsl`,l);let u=this.getAttribute(`borderradius`)??this.getAttribute(`border-radius`);u?.trim()&&this.style.setProperty(`--radius`,VB(u)),r.theme===`dark`?this.setAttribute(`data-mode`,`dark`):this.removeAttribute(`data-mode`),(this._reactRoot??=T_.createRoot(n)).render((0,q.jsx)(RU,{...r}))}};customElements.get(`fma-airfare-search`)||customElements.define(`fma-airfare-search`,HU);var UU=new Map,WU=3600*1e3,GU=3600*12*1e3;function KU(){let e=Date.now(),t=e-WU,n=e+GU;return{scheduleWindowStartUtc:new Date(t).toISOString(),scheduleWindowEndUtcExclusive:new Date(n).toISOString()}}function qU(e){let t=e?.scheduleWindowStartUtc?.trim(),n=e?.scheduleWindowEndUtcExclusive?.trim();return t&&n?{scheduleWindowStartUtc:t,scheduleWindowEndUtcExclusive:n}:KU()}function JU(e){if(typeof e!=`object`||!e||Array.isArray(e))return null;let t={};for(let[n,r]of Object.entries(e)){if(!r||typeof r!=`object`||Array.isArray(r))return null;let e=r;if(typeof e.code!=`string`||typeof e.name!=`string`)return null;t[n]={code:e.code,name:e.name,iconUrl:typeof e.iconUrl==`string`?e.iconUrl:``,logoUrl:typeof e.logoUrl==`string`?e.logoUrl:``}}return t}function YU(e){if(e==null)return{};if(typeof e!=`object`||Array.isArray(e))return null;let t={};for(let[n,r]of Object.entries(e)){if(!r||typeof r!=`object`||Array.isArray(r))return null;let e=r.timezoneRegionName;if(typeof e!=`string`||!e.trim())return null;t[n]={timezoneRegionName:e.trim()}}return t}function XU(e){if(typeof e!=`object`||!e||Array.isArray(e))return null;let t=e;if(t.success!==!0)return null;let n=t.data;return typeof n!=`object`||!n||Array.isArray(n)?null:ZU(n)}function ZU(e){if(e.apiVersion!==3||typeof e.instanceId!=`string`||typeof e.iata!=`string`||e.mode!==`arrivals`&&e.mode!==`departures`&&e.mode!==`both`||!Array.isArray(e.arrivals)||!Array.isArray(e.departures)||typeof e.asOfUtc!=`string`)return null;let t=JU(e.airlines);if(!t)return null;let n=YU(e.airports);if(!n||!e.meta||typeof e.meta!=`object`||Array.isArray(e.meta)||typeof e.meta.lookbackEventsCap!=`number`||typeof e.meta.limitPerDirection!=`number`)return null;let r=e.meta,i=r.scheduleWindow,a;if(i!=null){if(typeof i!=`object`||Array.isArray(i))return null;let e=i;if(e.source!==`client`||typeof e.startUtc!=`string`||typeof e.endUtcExclusive!=`string`)return null;a={source:`client`,startUtc:e.startUtc,endUtcExclusive:e.endUtcExclusive}}return{apiVersion:3,instanceId:e.instanceId,iata:e.iata,mode:e.mode,asOfUtc:e.asOfUtc,arrivals:e.arrivals,departures:e.departures,airlines:t,airports:n,meta:{lookbackEventsCap:r.lookbackEventsCap,limitPerDirection:r.limitPerDirection,...a?{scheduleWindow:a}:{}}}}function QU(){return`https://api.airportonellc.com`.replace(/\/+$/,``)}function $U(e,t){return`${e}\0${t.scheduleWindowStartUtc}\0${t.scheduleWindowEndUtcExclusive}`}function eW(e,t){let n=QU();if(!n||!e.trim())return Promise.resolve({data:null,metrics:{attempted:!1,durationMs:0}});let r=qU(t),i=$U(e,r),a=UU.get(i);if(a)return a;let o=`?${new URLSearchParams({scheduleWindowStartUtc:r.scheduleWindowStartUtc,scheduleWindowEndUtcExclusive:r.scheduleWindowEndUtcExclusive}).toString()}`,s=`${n}/widgets/v1/fids/widget-instances/${encodeURIComponent(e)}/flights${o}`,c=typeof performance<`u`&&typeof performance.now==`function`?performance.now():0,l=()=>typeof performance<`u`&&typeof performance.now==`function`?Math.round(performance.now()-c):0,u=(async()=>{try{let e=await fetch(s,{credentials:`omit`,mode:`cors`});if(!e.ok)return{data:null,metrics:{attempted:!0,durationMs:l(),failureKind:`http_error`}};let t;try{t=await e.json()}catch{return{data:null,metrics:{attempted:!0,durationMs:l(),failureKind:`invalid_json`}}}let n=XU(t);return n?{data:n,metrics:{attempted:!0,durationMs:l()}}:{data:null,metrics:{attempted:!0,durationMs:l(),failureKind:`parse_failed`}}}catch{return{data:null,metrics:{attempted:!0,durationMs:l(),failureKind:`network_error`}}}finally{UU.delete(i)}})();return UU.set(i,u),u}var tW={panelBackgroundColor:`#0c2748`,primaryTextColor:`#ffffff`,accentTextColor:`#f5d742`,mutedTextColor:`rgba(255, 255, 255, 0.7)`,headerIconTileBackgroundColor:`rgba(26, 58, 92, 0.95)`};function nW(e,t){let n=e[t];if(typeof n!=`string`)return;let r=n.trim();return r.length>0?r:void 0}function rW(e){let t={...tW};if(!e||typeof e!=`object`||Array.isArray(e))return t;let n=e;return{panelBackgroundColor:nW(n,`panelBackgroundColor`)??t.panelBackgroundColor,primaryTextColor:nW(n,`primaryTextColor`)??t.primaryTextColor,accentTextColor:nW(n,`accentTextColor`)??t.accentTextColor,mutedTextColor:nW(n,`mutedTextColor`)??t.mutedTextColor,headerIconTileBackgroundColor:nW(n,`headerIconTileBackgroundColor`)??t.headerIconTileBackgroundColor}}function iW(e){let t=e?.variables;if(!t||typeof t!=`object`||Array.isArray(t))return{...tW};let n=t.fids;if(!n||typeof n!=`object`||Array.isArray(n))return{...tW};let r=n.theme;return rW(r)}function aW(e){return`color-mix(in srgb, ${e.trim()} 18%, transparent)`}var oW={prefix:`fas`,iconName:`plane-landing-gear`,icon:[640,512,[],`e7bc`,`M249.8 74.4L401.7 240 552.3 240c30.9 0 56 25.1 56 56s-25.1 56-56 56l-450.6 0c-30.9 0-57.4-22.1-63-52.6l-19-104.6C18 185 25.5 176 35.5 176l17.3 0c7.3 0 14.2 3.3 18.7 9l44 55 103.5 0-51.6-154.9C163.9 74.7 171.6 64 182.5 64l43.7 0c9 0 17.5 3.8 23.6 10.4zM224.3 416a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm192-32a32 32 0 1 1 0 64 32 32 0 1 1 0-64z`]},sW={prefix:`fas`,iconName:`plane-departure`,icon:[576,512,[128747],`f5b0`,`M372 143.9L172.7 40.2c-8-4.1-17.3-4.8-25.7-1.7l-41.1 15c-10.3 3.7-13.8 16.4-7.1 25L200.3 206.4 100.1 242.8 40 206.2c-6.2-3.8-13.8-4.5-20.7-2.1L3 210.1c-9.4 3.4-13.4 14.5-8.3 23.1l53.6 91.8c15.6 26.7 48.1 38.4 77.1 27.8l12.9-4.7 0 0 398.4-145c29.1-10.6 44-42.7 33.5-71.8s-42.7-44-71.8-33.5L372 143.9zM32.2 448c-17.7 0-32 14.3-32 32s14.3 32 32 32l512 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-512 0z`]},cW={prefix:`fas`,iconName:`chevron-right`,icon:[320,512,[9002],`f054`,`M311.1 233.4c12.5 12.5 12.5 32.8 0 45.3l-192 192c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L243.2 256 73.9 86.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l192 192z`]},lW={prefix:`fas`,iconName:`chevron-down`,icon:[448,512,[],`f078`,`M201.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L224 338.7 54.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z`]};function uW(e){let t=e.trim();if(!t)return null;let n=!(/z\s*$/i.test(t)||/[+-]\d{2}:\d{2}\s*$/.test(t))&&/^\d{4}-\d{2}-\d{2}T/.test(t)?`${t}Z`:t,r=Date.parse(n);return Number.isNaN(r)?null:new Date(r)}var dW={kind:`on-time`};function fW(e){let t=Math.max(0,Math.round(e)),n=Math.floor(t/60),r=t%60,i=[];return n>0&&i.push(`${n} ${n===1?`hour`:`hours`}`),r>0&&i.push(`${r} ${r===1?`minute`:`minutes`}`),i.length===0?`0 minutes`:i.join(` `)}function pW(e){let t=e?.utc?.trim()||e?.local?.trim();if(!t)return null;let n=uW(t);return n?n.getTime():null}function mW(e){if(!e)return dW;let t=pW(e.estimated),n=pW(e.actual);if(t===null||n===null)return dW;let r=Math.round((n-t)/6e4);return Math.abs(r)<=15?dW:r>0?{kind:`delayed`,minutesDelta:r}:{kind:`early`,minutesDelta:-r}}function hW(e){return e.departureGatePunctuality??dW}function gW(e){return e.arrivalGatePunctuality??dW}function _W(e){if(e.kind===`on-time`)return`On-time`;let t=fW(e.minutesDelta);return e.kind===`early`?`${t} early`:`${t} late`}function vW(e){let t=e.direction===`departure`?hW(e):gW(e),n=t.kind===`on-time`?`on-time`:t.kind===`early`?`early`:`delayed`;return{text:_W(t),tone:n}}function yW(e,t){return e.kind===`on-time`?t.mutedTextColor:e.kind===`early`?`rgb(74, 222, 128)`:`rgb(251, 146, 60)`}function bW(e,t){return e===`on-time`?t.mutedTextColor:e===`early`?`rgb(74, 222, 128)`:e===`delayed`?`rgb(251, 146, 60)`:t.accentTextColor}function xW(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function SW(e){if(!e)return`—`;try{let t=uW(e);if(!t)return e;let n=new Date;if(xW(t,n))return t.toLocaleTimeString(void 0,{hour:`numeric`,minute:`2-digit`});let r={month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`};return t.getFullYear()!==n.getFullYear()&&(r.year=`numeric`),t.toLocaleString(void 0,r)}catch{return e}}function CW(e,t=new Date){let n=e?.trim();if(n)try{return new Intl.DateTimeFormat(`en-US`,{timeZone:n,timeZoneName:`short`}).formatToParts(t).find(e=>e.type===`timeZoneName`)?.value?.trim()||n}catch{return n}}function wW(e){return!!(e?.utc?.trim()||e?.local?.trim())}function TW(e){if(e)return e.actual?.utc?.trim()||e.actual?.local?.trim()||e.estimated?.utc?.trim()||e.estimated?.local?.trim()||e.scheduled?.utc?.trim()||e.scheduled?.local?.trim()||e.published?.utc?.trim()||e.published?.local?.trim()||void 0}function EW(e){if(e)return e.actual?.utc?.trim()||e.actual?.local?.trim()||e.estimated?.utc?.trim()||e.estimated?.local?.trim()||void 0}function DW(e){if(e)return SW(e)}function OW(e){let t=e.departure,n=e.arrival;if(!t&&!n)return null;let r=t?.airport?.iata??t?.airport?.fs??`—`,i=n?.airport?.iata??n?.airport?.fs??`—`,a=wW(t?.gateTime?.actual),o=wW(t?.runwayTime?.actual),s=wW(n?.runwayTime?.actual),c=wW(n?.gateTime?.actual),l=e.status?.toUpperCase()??``;l===`ACTIVE`&&(a=!0,o=!0),l===`LANDED`&&(a=!0,o=!0,s=!0);let u=null;return!a&&(wW(t?.gateTime?.estimated)||wW(t?.gateTime?.scheduled))?u=0:!o&&a&&wW(t?.runwayTime?.estimated)?u=1:!s&&o&&wW(n?.runwayTime?.estimated)?u=2:!c&&s&&wW(n?.gateTime?.estimated)&&(u=3),l===`ACTIVE`&&!s&&(u=2),l===`LANDED`&&s&&!c&&(u=3),[{key:`dep-gate`,title:`Gate out`,airport:r,complete:a,current:u===0,timeStr:DW(TW(t?.gateTime)),punctuality:hW(e)},{key:`dep-rwy`,title:`Takeoff`,airport:r,complete:o,current:u===1,timeStr:DW(EW(t?.runwayTime)),punctuality:mW(t?.runwayTime)},{key:`arr-rwy`,title:`Landing`,airport:i,complete:s,current:u===2,timeStr:DW(EW(n?.runwayTime)),punctuality:mW(n?.runwayTime)},{key:`arr-gate`,title:`Gate in`,airport:i,complete:c,current:u===3,timeStr:DW(TW(n?.gateTime)),punctuality:gW(e)}]}var kW={gridTemplateColumns:`repeat(4, minmax(0, 1fr))`,columnGap:6},AW=`aone:h-[3px] aone:min-w-0 aone:rounded-sm aone:self-center`,jW=22;function MW({row:e,theme:t,airports:n={}}){let r=OW(e);if(!r)return null;let i=r,a=t.accentTextColor,o=aW(t.primaryTextColor),s=t.mutedTextColor;function c(e){let t=i[e];return(0,q.jsxs)(`div`,{className:`aone:flex aone:min-w-0 aone:w-full aone:flex-row aone:items-center`,style:{minHeight:jW},children:[e===0?(0,q.jsx)(`div`,{className:`aone:min-w-0 aone:flex-1`,"aria-hidden":!0}):(0,q.jsx)(`div`,{className:AW,style:{flex:1,minWidth:0,backgroundColor:i[e-1].complete?a:o,opacity:i[e-1].complete?1:.45}}),u(t),e===3?(0,q.jsx)(`div`,{className:`aone:min-w-0 aone:flex-1`,"aria-hidden":!0}):(0,q.jsx)(`div`,{className:AW,style:{flex:1,minWidth:0,backgroundColor:i[e].complete?a:o,opacity:i[e].complete?1:.45}})]},`track-${t.key}`)}function l(e){let r=e.airport&&e.airport!==`—`?CW(n[e.airport.trim().toUpperCase()]?.timezoneRegionName):void 0;return(0,q.jsxs)(`div`,{className:`aone:flex aone:w-full aone:min-w-0 aone:flex-col aone:items-center aone:text-center`,children:[(0,q.jsx)(`div`,{className:`aone:text-base aone:font-semibold aone:leading-snug aone:whitespace-nowrap`,style:{color:t.primaryTextColor},children:e.title}),(0,q.jsx)(`div`,{className:`aone:mt-1 aone:text-sm aone:whitespace-nowrap`,style:{color:s},children:e.airport}),e.timeStr||r?(0,q.jsx)(`div`,{className:`aone:mt-1.5 aone:text-sm aone:tabular-nums aone:whitespace-nowrap`,style:{color:s},children:e.timeStr?(0,q.jsxs)(q.Fragment,{children:[e.timeStr,r?`\u00a0${r}`:null]}):r}):null,(0,q.jsx)(`div`,{className:`aone:mt-1 aone:max-w-full aone:text-[0.7rem] aone:font-semibold aone:leading-snug`,style:{color:yW(e.punctuality,t),overflowWrap:`break-word`,wordBreak:`normal`},children:_W(e.punctuality)})]})}function u(e){let n=e.key===`dep-rwy`?sW:e.key===`arr-rwy`?oW:null;if(n){let r=e.current?`3px solid ${a}`:`2px solid ${e.complete?a:o}`,i=e.complete?t.panelBackgroundColor:e.current?a:s;return(0,q.jsx)(`div`,{className:`aone:inline-flex aone:shrink-0 aone:box-border aone:items-center aone:justify-center aone:rounded`,style:{width:jW,height:jW,backgroundColor:e.complete?a:`transparent`,border:r},"aria-hidden":!0,children:(0,q.jsx)(yI,{icon:n,style:{width:15,height:15,color:i}})})}return(0,q.jsx)(`div`,{className:`aone:shrink-0 aone:box-border aone:rounded-full`,style:{width:jW,height:jW,backgroundColor:e.complete?a:`transparent`,border:e.current?`3px solid ${a}`:`2px solid ${e.complete?a:o}`},"aria-hidden":!0})}return(0,q.jsxs)(`div`,{className:`aone:mb-5 aone:box-border aone:w-full aone:max-w-full`,children:[(0,q.jsx)(`p`,{className:`aone:mb-3 aone:text-sm aone:font-semibold aone:tracking-[0.06em]`,style:{color:s},children:`Flight progress`}),(0,q.jsx)(`div`,{className:`aone:grid aone:w-full aone:items-center`,style:kW,children:[0,1,2,3].map(e=>c(e))}),(0,q.jsx)(`div`,{className:`aone:mt-3 aone:grid aone:min-h-0 aone:w-full aone:items-start`,style:kW,children:i.map(e=>(0,q.jsx)(`div`,{className:`aone:box-border aone:min-w-0 aone:max-w-full aone:px-0.5 aone:text-center`,children:l(e)},e.key))})]})}function NW(e){if(!e)return{gate:``,terminal:``};let t=e.gate,n=e.terminal;return{gate:typeof t==`string`?t.trim():typeof t==`number`&&Number.isFinite(t)?String(t).trim():``,terminal:typeof n==`string`?n.trim():typeof n==`number`&&Number.isFinite(n)?String(n).trim():``}}function PW(e,t){if(!t||!e?.airport)return!1;let n=e.airport.iata?.trim().toUpperCase()??``,r=e.airport.fs?.trim().toUpperCase()??``;return n===t||r===t}function FW(e){let{gate:t,terminal:n}=NW(e);return t.length>0||n.length>0}function IW(e,t){let n=t.trim().toUpperCase(),r=e.departure,i=e.arrival,a=PW(r,n),o=PW(i,n),s=!!(r?.airport&&i?.airport);if(e.direction===`departure`){if(a)return FW(r)?r:o&&FW(i)?i:r;if(!a&&o&&FW(i))return i;if(!s||!a&&!o&&!(r?.airport&&i?.airport)){if(FW(r))return r;if(FW(i))return i}return r??i}if(e.direction===`arrival`){if(o)return FW(i)?i:a&&FW(r)?r:i;if(!o&&a&&FW(r))return r;if(!s||!a&&!o&&!(r?.airport&&i?.airport)){if(FW(i))return i;if(FW(r))return r}return i??r}}function LW(e){let{gate:t,terminal:n}=NW(e),r=[];return t&&r.push(`Gate ${t}`),n&&r.push(`Terminal ${n}`),r.length>0?r.join(` · `):`—`}function RW(e){let t=e?.utc?.trim()||e?.local?.trim();return t?uW(t):null}function zW(e){return e?RW(e.published)??RW(e.scheduled):null}function BW(e){let t=e.departure?.gateTime,n=e.arrival?.gateTime;if(!t||!n)return null;let r=zW(t),i=zW(n);if(!r||!i)return null;let a=i.getTime()-r.getTime();return a>=0?a:null}function VW(e){let t=e.departure?.gateTime?.actual,n=e.arrival?.gateTime?.actual;if(!t||!n)return null;let r=RW(t),i=RW(n);if(!r||!i)return null;let a=i.getTime()-r.getTime();return a>=0?a:null}function HW(e){let t=Math.max(0,Math.round(e/6e4)),n=Math.floor(t/60),r=t%60;return n===0?`${t} min`:r===0?`${n}h`:`${n}h ${r}m`}var UW=36;function WW(e){if(!e)return`—`;try{let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString(void 0,{month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`})}catch{return e}}var GW=[`published`,`scheduled`,`estimated`,`actual`],KW=[`estimated`,`actual`];function qW(e){let t=uW(e);return t?t.toLocaleString(void 0,{month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`}):e}function JW(e){if(e.callsign?.trim())return!0;for(let t of[e.departure,e.arrival]){if(!t)continue;let e=t.gateTime;if(e)for(let t of GW){let n=e[t];if(n&&(t!==`scheduled`&&(n.utc||n.local)||t===`scheduled`&&n.local&&(!n.utc||n.local.trim()!==n.utc.trim())))return!0}let n=t.runwayTime;if(n?.estimated?.utc||n?.estimated?.local||n?.actual?.utc||n?.actual?.local)return!0}return!1}function YW(e){if(!e)return!1;let t=e.gateTime,n=e.runwayTime,r=t&&GW.some(e=>t[e]?.utc||t[e]?.local),i=n&&KW.some(e=>n[e]?.utc||n[e]?.local);return!!(r||i)}function XW({phaseLabel:e,pair:t,theme:n}){if(!t||!t.utc&&!t.local)return null;let r=t.local?.trim(),i=r&&r.length>0&&r!==t.utc?.trim();return(0,q.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`minmax(72px, 96px) 1fr`,gap:`4px 12px`,alignItems:`baseline`,fontSize:`1rem`},children:[(0,q.jsx)(`span`,{style:{color:n.mutedTextColor},children:e}),(0,q.jsxs)(`span`,{style:{color:n.primaryTextColor,wordBreak:`break-word`,overflowWrap:`break-word`},children:[t.utc?qW(t.utc):`—`,i?(0,q.jsxs)(`span`,{style:{color:n.mutedTextColor},children:[` · `,r]}):null]})]})}function ZW({title:e,leg:t,theme:n}){if(!t)return null;let r=t.gateTime,i=t.runwayTime,a=r&&GW.some(e=>r[e]?.utc||r[e]?.local),o=i&&KW.some(e=>i[e]?.utc||i[e]?.local);return!a&&!o?null:(0,q.jsxs)(`div`,{style:{marginBottom:0},children:[(0,q.jsx)(`div`,{style:{fontWeight:600,fontSize:`1rem`,marginBottom:8,color:n.accentTextColor},children:e}),a?(0,q.jsxs)(`div`,{style:{marginLeft:4,marginBottom:8},children:[(0,q.jsx)(`div`,{style:{fontSize:`1rem`,fontWeight:600,letterSpacing:`0.06em`,color:n.mutedTextColor,marginBottom:6},children:`Gate times`}),(0,q.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:4},children:GW.map(e=>(0,q.jsx)(XW,{phaseLabel:e.charAt(0).toUpperCase()+e.slice(1),pair:r?.[e],theme:n},e))})]}):null,o?(0,q.jsxs)(`div`,{style:{marginLeft:4},children:[(0,q.jsx)(`div`,{style:{fontSize:`1rem`,fontWeight:600,letterSpacing:`0.06em`,color:n.mutedTextColor,marginBottom:6},children:`Runway times`}),(0,q.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:4},children:KW.map(e=>(0,q.jsx)(XW,{phaseLabel:e.charAt(0).toUpperCase()+e.slice(1),pair:i?.[e],theme:n},e))})]}):null]})}function QW(e,t,n){let r=t.trim();if(!r)return e;let i=n[r.toUpperCase()]?.timezoneRegionName?.trim(),a=CW(i);return a?`${e} · ${r} · ${a}`:`${e} · ${r}`}function $W({row:e,theme:t}){let n=BW(e),r=VW(e);return n===null&&r===null?null:(0,q.jsxs)(`div`,{className:`aone:mb-5`,children:[(0,q.jsx)(`p`,{className:`aone:mb-2.5 aone:text-[0.8125rem] aone:font-semibold aone:uppercase aone:tracking-wider`,style:{color:t.mutedTextColor},children:`Gate to gate`}),(0,q.jsxs)(`div`,{className:`aone:flex aone:flex-col aone:gap-2 aone:text-[0.9375rem] aone:font-semibold`,children:[n===null?null:(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`span`,{style:{color:t.mutedTextColor},children:`Scheduled · `}),(0,q.jsx)(`span`,{style:{color:t.primaryTextColor},children:HW(n)})]}),r===null?null:(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`span`,{style:{color:t.mutedTextColor},children:`Actual · `}),(0,q.jsx)(`span`,{style:{color:t.primaryTextColor},children:HW(r)})]})]})]})}function eG({row:e,theme:t,operatingCarrierName:n,airports:r}){let i=e.departure?.airport?.iata??e.departure?.airport?.fs??``,a=e.arrival?.airport?.iata??e.arrival?.airport?.fs??``,o=YW(e.departure),s=YW(e.arrival),c=o&&s,l=e.operatingCarrier?.iata?.trim()||e.operatingCarrier?.fs?.trim()||null;return(0,q.jsxs)(`div`,{style:{paddingLeft:16,paddingRight:16,boxSizing:`border-box`},children:[e.callsign?.trim()?(0,q.jsxs)(`p`,{style:{fontSize:`1rem`,marginBottom:l?4:12,color:t.primaryTextColor},children:[(0,q.jsx)(`span`,{style:{color:t.mutedTextColor},children:`Callsign `}),e.callsign.trim()]}):null,l?(0,q.jsxs)(`p`,{style:{fontSize:`1rem`,marginTop:e.callsign?.trim()?0:void 0,marginBottom:12,color:t.primaryTextColor},children:[(0,q.jsxs)(`span`,{style:{color:t.mutedTextColor},children:[`Operating carrier`,` `]}),n?`${n} (${l})`:l]}):null,(0,q.jsxs)(`div`,{style:{marginBottom:20},children:[(0,q.jsx)(`p`,{style:{fontSize:`0.8125rem`,fontWeight:600,letterSpacing:`0.05em`,textTransform:`uppercase`,marginBottom:10,color:t.mutedTextColor},children:`Gate timing`}),(0,q.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:8,fontSize:`0.9375rem`,fontWeight:600},children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`span`,{style:{color:t.mutedTextColor},children:`Departure · `}),(0,q.jsx)(`span`,{style:{color:yW(hW(e),t),wordBreak:`break-word`,overflowWrap:`break-word`},children:_W(hW(e))})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`span`,{style:{color:t.mutedTextColor},children:`Arrival · `}),(0,q.jsx)(`span`,{style:{color:yW(gW(e),t),wordBreak:`break-word`,overflowWrap:`break-word`},children:_W(gW(e))})]})]})]}),(0,q.jsx)($W,{row:e,theme:t}),(0,q.jsx)(MW,{row:e,theme:t,airports:r}),(0,q.jsxs)(`div`,{style:{display:c?`grid`:`block`,gridTemplateColumns:c?`minmax(0, 1fr) minmax(0, 1fr)`:void 0,gap:c?24:0,alignItems:`start`},children:[(0,q.jsx)(ZW,{title:QW(`Departure`,i,r),leg:e.departure,theme:t}),(0,q.jsx)(ZW,{title:QW(`Arrival`,a,r),leg:e.arrival,theme:t})]})]})}function tG(e){let t=e.marketingCarrier??e.operatingCarrier;return t?.iata?t.iata:t?.fs?t.fs:``}function nG(e){let t=tG(e),n=e.flightNumber?.trim();return t&&n?`${t} ${n}`:n||e.flightId}function rG(e){let t=e.marketingCarrier??e.operatingCarrier;return t?.iata?.trim().toUpperCase()||(t?.fs?.trim().toUpperCase()??``)}function iG(e){return e?.iata?.trim().toUpperCase()||(e?.fs?.trim().toUpperCase()??``)}function aG(e,t){let n=rG(e);if(!n)return null;let r=t[n];if(!r)return null;let i=r.logoUrl?.trim(),a=r.iconUrl?.trim();return i||a||null}function oG(e,t){let n=rG(e);return n&&t[n]?.name?.trim()||null}function sG(e,t){let n=iG(e);return n&&t[n]?.name?.trim()||null}function cG(e){return e.direction===`departure`?e.arrival?.airport?.iata??e.arrival?.airport?.fs??`—`:e.departure?.airport?.iata??e.departure?.airport?.fs??`—`}function lG(e,t){return LW(IW(e,t))}function uG(e){let t=e.arrival?.baggage?.trim();return t&&t.length>0?t:`—`}function dG(e){return e.direction===`arrival`?e.arrival?.gateTime?.scheduled?.utc:e.departure?.gateTime?.scheduled?.utc}function fG(e,t){let n=e?.trim().toUpperCase()??``,r=t.accentTextColor,i=t.mutedTextColor,a=t.primaryTextColor;switch(n){case`CANCELLED`:return{label:`Cancelled`,dotStyle:{backgroundColor:`#fb923c`},textStyle:{color:`#fdba74`}};case`DIVERTED`:case`REDIRECTED`:return{label:n===`DIVERTED`?`Diverted`:`Redirected`,dotStyle:{backgroundColor:`#fbbf24`},textStyle:{color:`#fde68a`}};case`LANDED`:return{label:`Landed`,dotStyle:{backgroundColor:`#34d399`},textStyle:{color:a}};case`ACTIVE`:return{label:`En route`,dotStyle:{backgroundColor:`#34d399`},textStyle:{color:a}};case`SCHEDULED`:return{label:`Scheduled`,dotStyle:{backgroundColor:r},textStyle:{color:r}};case`UNKNOWN`:return{label:`Unknown`,dotStyle:{backgroundColor:i},textStyle:{color:i}};default:return e?{label:e.length<=20?e.charAt(0).toUpperCase()+e.slice(1).toLowerCase():e,dotStyle:{backgroundColor:r},textStyle:{color:r}}:{label:`—`,dotStyle:{backgroundColor:i},textStyle:{color:i}}}}function pG(e,t){let n=Math.max(e.dueAtMs-e.intervalStartMs,1);return Math.min(Math.max(t-e.intervalStartMs,0),n)/n*100}function mG({title:e,subtitle:t,headerPlaneIcon:n,theme:r,dataRefreshSchedule:i}){let a=i===null?``:`${i.intervalStartMs}-${i.dueAtMs}`,[o,s]=(0,K.useState)(()=>new Date);(0,K.useEffect)(()=>{let e=a?250:15e3,t=globalThis.setInterval(()=>s(new Date),e);return()=>globalThis.clearInterval(t)},[a]);let c=o.getTime(),l=o.toLocaleTimeString(void 0,{hour:`numeric`,minute:`2-digit`}),u=i===null?null:pG(i,c);return(0,q.jsxs)(`header`,{part:`fids-board-header`,style:{display:`flex`,alignItems:`flex-start`,gap:16,paddingLeft:20,paddingRight:20,paddingTop:20,paddingBottom:16,boxSizing:`border-box`,width:`100%`},children:[(0,q.jsx)(`div`,{style:{width:44,height:44,flexShrink:0,display:`flex`,alignItems:`center`,justifyContent:`center`,borderRadius:8,backgroundColor:r.headerIconTileBackgroundColor},"aria-hidden":!0,children:(0,q.jsx)(yI,{icon:n===`departure`?sW:oW,style:{width:22,height:22,color:r.accentTextColor}})}),(0,q.jsxs)(`div`,{style:{minWidth:0,flex:1},children:[(0,q.jsx)(`h2`,{part:`fids-board-title`,className:`aone:text-xl aone:font-bold aone:leading-tight aone:tracking-tight`,style:{color:r.accentTextColor,margin:0},children:e}),(0,q.jsxs)(`div`,{part:`fids-board-meta`,style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,gap:12,marginTop:6,flexWrap:`nowrap`},children:[(0,q.jsx)(`p`,{part:`fids-board-subtitle`,className:`aone:text-sm`,style:{color:r.primaryTextColor,opacity:.95,margin:0,minWidth:0},children:t}),(0,q.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,alignItems:`flex-end`,flexShrink:0,gap:6,minWidth:72},children:[(0,q.jsx)(`p`,{part:`fids-board-clock`,className:`aone:tabular-nums`,style:{margin:0,fontSize:`1.25rem`,fontWeight:600,color:r.accentTextColor,lineHeight:1},children:l}),u===null?null:(0,q.jsx)(`div`,{part:`fids-board-refresh-bar`,role:`progressbar`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.min(100,Math.round(u)),"aria-label":`Progress until flights refresh`,style:{width:`100%`,maxWidth:96,height:3,borderRadius:2,backgroundColor:aW(r.primaryTextColor),overflow:`hidden`},children:(0,q.jsx)(`div`,{style:{width:`${u}%`,height:`100%`,borderRadius:2,backgroundColor:r.accentTextColor}})})]})]})]})]})}function hG({rows:e,destinationColumnLabel:t,airlines:n,airports:r,theme:i,boardAirportIata:a,tableSection:o}){let s=aW(i.primaryTextColor),c=`aone:px-3 aone:py-2 aone:text-xs aone:font-semibold aone:uppercase aone:tracking-wide`,l=`aone:px-3 aone:py-3`,[u,d]=(0,K.useState)(()=>new Set),f={width:`100%`,maxWidth:`100%`,overflowX:`auto`,paddingLeft:20,paddingRight:20,paddingBottom:16,boxSizing:`border-box`},p={width:`100%`,maxWidth:`100%`,borderCollapse:`collapse`,textAlign:`left`,fontSize:`0.875rem`,lineHeight:1.4,tableLayout:`fixed`},m=o===`arrivals`,h=m?7:6;return(0,q.jsx)(`div`,{style:f,children:(0,q.jsxs)(`table`,{part:`fids-board-table`,style:p,children:[(0,q.jsxs)(`colgroup`,{children:[(0,q.jsx)(`col`,{style:{width:m?`32%`:`36%`}}),(0,q.jsx)(`col`,{style:{width:m?`11%`:`12%`}}),(0,q.jsx)(`col`,{style:{width:m?`9%`:`10%`}}),(0,q.jsx)(`col`,{style:{width:m?`12%`:`14%`}}),(0,q.jsx)(`col`,{style:{width:m?`8%`:`10%`}}),m?(0,q.jsx)(`col`,{part:`fids-board-col-baggage`,style:{width:`8%`}}):null,(0,q.jsx)(`col`,{style:{width:m?`20%`:`18%`}})]}),(0,q.jsx)(`thead`,{children:(0,q.jsxs)(`tr`,{style:{borderBottomWidth:1,borderBottomStyle:`solid`,borderBottomColor:s},children:[(0,q.jsx)(`th`,{className:c,style:{color:i.mutedTextColor},children:`Airline`}),(0,q.jsx)(`th`,{className:c,style:{color:i.mutedTextColor},children:`Status`}),(0,q.jsx)(`th`,{className:c,style:{color:i.mutedTextColor},children:t}),(0,q.jsx)(`th`,{className:c,style:{color:i.mutedTextColor},children:`Scheduled`}),(0,q.jsx)(`th`,{className:c,style:{color:i.mutedTextColor},children:`Gate / Terminal`}),m?(0,q.jsx)(`th`,{part:`fids-board-head-baggage`,className:c,style:{color:i.mutedTextColor},children:`Baggage`}):null,(0,q.jsx)(`th`,{className:c,style:{color:i.mutedTextColor,textAlign:`right`},children:`Flight status`})]})}),(0,q.jsx)(`tbody`,{children:e.length===0?(0,q.jsx)(`tr`,{children:(0,q.jsx)(`td`,{colSpan:h,className:`${l} aone:py-8 aone:text-center`,style:{color:i.mutedTextColor},children:`No flights in this view.`})}):e.map(e=>{let t=e.flightId,o=fG(e.status,i),c=oG(e,n),f=e.callsign?.trim()??``,p=sG(e.operatingCarrier,n),g=JW(e),_=u.has(t),v=vW(e);return(0,q.jsxs)(K.Fragment,{children:[(0,q.jsxs)(`tr`,{part:`fids-board-row`,style:{borderBottomWidth:1,borderBottomStyle:`solid`,borderBottomColor:s},children:[(0,q.jsx)(`td`,{className:l,style:{color:i.primaryTextColor,verticalAlign:`middle`,overflow:`hidden`,wordBreak:`break-word`},children:(0,q.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6,minHeight:UW},children:[g?(0,q.jsx)(`button`,{type:`button`,part:`fids-board-row-expand`,"aria-expanded":_,"aria-controls":`fids-detail-${t}`,id:`fids-expand-${t}`,"aria-label":_?`Collapse flight timing details`:`Expand flight timing details`,onClick:()=>{d(e=>{let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n})},style:{flexShrink:0,width:28,height:28,padding:0,margin:0,border:`none`,borderRadius:4,cursor:`pointer`,backgroundColor:i.headerIconTileBackgroundColor,color:i.accentTextColor,lineHeight:1,display:`inline-flex`,alignItems:`center`,justifyContent:`center`},children:(0,q.jsx)(yI,{"aria-hidden":!0,icon:_?lW:cW,style:{width:12,height:12}})}):(0,q.jsx)(`span`,{style:{width:28,flexShrink:0},"aria-hidden":!0}),(0,q.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,flex:1,minWidth:0},children:[(0,q.jsx)(`span`,{"aria-hidden":!0,className:`aone:inline-flex aone:h-[50px] aone:w-[100px] aone:shrink-0 aone:items-center aone:justify-center aone:overflow-hidden aone:bg-white aone:p-[5px]`,children:(()=>{let t=aG(e,n);return t?(0,q.jsx)(`img`,{src:t,alt:``,style:{maxWidth:`100%`,maxHeight:`100%`,width:`auto`,height:`auto`,objectFit:`contain`,display:`block`},loading:`lazy`,decoding:`async`}):null})()}),(0,q.jsxs)(`span`,{style:{display:`flex`,flexDirection:`column`,gap:4,minWidth:0,lineHeight:1.25},children:[c||f?(0,q.jsxs)(`span`,{part:`fids-board-row-airline-line`,style:{display:`flex`,flexWrap:`wrap`,alignItems:`baseline`,columnGap:6,rowGap:2,fontWeight:600,fontSize:`0.875rem`,color:i.primaryTextColor,minWidth:0},children:[c?(0,q.jsx)(`span`,{style:{fontWeight:600},children:c}):null,f?(0,q.jsx)(`span`,{part:`fids-board-row-callsign-inline`,className:`aone:tabular-nums`,title:`Callsign`,style:{fontWeight:500,fontSize:`0.8125rem`,color:i.mutedTextColor},children:c?`\u00b7 ${f}`:f}):null]}):null,(0,q.jsx)(`span`,{style:{fontSize:c||f?`0.8125rem`:`0.875rem`,color:c||f?i.mutedTextColor:i.primaryTextColor},children:nG(e)})]})]})]})}),(0,q.jsx)(`td`,{className:`${l} aone:min-w-0 aone:wrap-break-word`,part:`fids-board-row-gate-punctuality`,style:{verticalAlign:`middle`,fontSize:`0.8125rem`,fontWeight:600,color:bW(v.tone,i),lineHeight:1.25,wordBreak:`break-word`,overflowWrap:`break-word`},children:v.text}),(0,q.jsx)(`td`,{className:`${l} aone:font-medium`,style:{color:i.primaryTextColor,verticalAlign:`middle`},children:cG(e)}),(0,q.jsx)(`td`,{className:`${l} aone:tabular-nums`,style:{color:i.primaryTextColor,verticalAlign:`middle`},children:SW(dG(e))}),(0,q.jsx)(`td`,{className:l,style:{color:i.primaryTextColor,verticalAlign:`middle`},children:lG(e,a)}),m?(0,q.jsx)(`td`,{part:`fids-board-row-baggage`,className:l,style:{color:i.primaryTextColor,verticalAlign:`middle`},children:uG(e)}):null,(0,q.jsx)(`td`,{className:l,style:{verticalAlign:`middle`},children:(0,q.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`flex-end`,gap:8},children:[(0,q.jsx)(`span`,{className:`aone:text-sm aone:font-medium`,style:o.textStyle,children:o.label}),(0,q.jsx)(`span`,{className:`aone:inline-block aone:h-2 aone:w-2 aone:shrink-0 aone:rounded-full`,style:o.dotStyle,"aria-hidden":!0})]})})]}),g&&_?(0,q.jsx)(`tr`,{part:`fids-board-row-detail`,children:(0,q.jsx)(`td`,{colSpan:h,id:`fids-detail-${t}`,role:`region`,"aria-labelledby":`fids-expand-${t}`,className:l,style:{paddingTop:12,paddingBottom:16,paddingLeft:16,paddingRight:16,borderBottomWidth:1,borderBottomStyle:`solid`,borderBottomColor:s,borderLeftWidth:3,borderLeftStyle:`solid`,borderLeftColor:i.accentTextColor,backgroundColor:aW(i.primaryTextColor)},children:(0,q.jsx)(eG,{row:e,theme:i,operatingCarrierName:p,airports:r})})}):null]},t)})})]})})}function gG({modeLabel:e,airportLine:t,headerPlaneIcon:n,rows:r,endpointColumnLabel:i,airlines:a,airports:o,theme:s,dataRefreshSchedule:c,boardAirportIata:l}){return(0,q.jsxs)(`section`,{part:`fids-board-section`,className:`aone:mb-4 aone:overflow-hidden aone:rounded-xl last:aone:mb-0`,style:{width:`100%`,boxSizing:`border-box`,backgroundColor:s.panelBackgroundColor,boxShadow:`inset 0 1px 0 rgba(255,255,255,0.06)`},children:[(0,q.jsx)(mG,{title:e,subtitle:t,headerPlaneIcon:n,theme:s,dataRefreshSchedule:c}),(0,q.jsx)(hG,{rows:r,destinationColumnLabel:i,airlines:a,airports:o,theme:s,boardAirportIata:l,tableSection:n===`arrival`?`arrivals`:`departures`})]})}function _G({payload:e,loading:t,error:n,consentAnalytics:r,theme:i=tW,dataRefreshSchedule:a}){let o=`aone:font-sans aone:text-[15px] aone:leading-normal`;if(t&&!e)return(0,q.jsxs)(`div`,{part:`fids-board-root`,role:`status`,"aria-live":`polite`,"aria-busy":`true`,className:`${o} aone:rounded-xl aone:p-8`,style:{backgroundColor:i.panelBackgroundColor,color:i.mutedTextColor,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,gap:16},children:[(0,q.jsx)(`div`,{className:`aone:box-border aone:h-10 aone:w-10 aone:animate-spin aone:rounded-full aone:border-2 aone:border-solid`,style:{borderColor:aW(i.primaryTextColor),borderTopColor:i.accentTextColor},"aria-hidden":!0}),(0,q.jsx)(`p`,{className:`aone:m-0 aone:text-sm`,style:{color:i.mutedTextColor},children:`Loading flight information…`})]});if(n&&!e)return(0,q.jsx)(`div`,{part:`fids-board-root`,className:`${o} aone:rounded-xl aone:p-6 aone:text-center`,style:{backgroundColor:i.panelBackgroundColor,color:`#fdba74`},children:`Flight information is temporarily unavailable.`});if(!e)return(0,q.jsx)(`div`,{part:`fids-board-root`,className:`${o} aone:rounded-xl aone:p-6 aone:text-center`,style:{backgroundColor:i.panelBackgroundColor,color:i.mutedTextColor},children:`No flight data.`});let s=e.mode===`arrivals`||e.mode===`both`,c=e.mode===`departures`||e.mode===`both`,l=`(${e.iata})`,u=e.airlines,d=e.airports??{};return(0,q.jsxs)(`div`,{part:`fids-board-root`,className:o,style:{color:i.primaryTextColor,width:`100%`,maxWidth:`100%`,boxSizing:`border-box`},children:[c&&(0,q.jsx)(gG,{modeLabel:`Flight Departures`,airportLine:l,headerPlaneIcon:`departure`,rows:e.departures,endpointColumnLabel:`Destination`,airlines:u,airports:d,theme:i,dataRefreshSchedule:a,boardAirportIata:e.iata}),s&&(0,q.jsx)(gG,{modeLabel:`Flight Arrivals`,airportLine:l,headerPlaneIcon:`arrival`,rows:e.arrivals,endpointColumnLabel:`Origin`,airlines:u,airports:d,theme:i,dataRefreshSchedule:a,boardAirportIata:e.iata}),(0,q.jsxs)(`p`,{part:`fids-board-updated`,className:`aone:mt-3 aone:text-center aone:text-xs`,style:{color:i.mutedTextColor},children:[`Updated `,WW(e.asOfUtc),` · `,e.iata]})]})}function vG(e){return(0,q.jsx)(_G,{...e})}var yG=[`consent-analytics`,`consent-advertising`,`consent-functional`,o_,`id`],bG=12e4,xG=3e4;function SG(e,t){return e.getAttribute(t)?.trim().toLowerCase()===`true`}var CG=class extends HTMLElement{_shadow;_shadowStylesInjected=!1;_mount;_reactRoot;_renderInProgress=!1;_renderQueued=!1;_renderScheduled=!1;_pollTimer;_dataRefreshSchedule=null;_activeInstanceId=null;_mountTelemetrySent=!1;_lastPublicConfigTelemetryKey=null;_flightsCache=null;_flightsLoading=!0;_flightsError=!1;_resolvedTheme=tW;static get observedAttributes(){return Array.from(yG)}attributeChangedCallback(e,t,n){t!==n&&this.isConnected&&this._scheduleRender()}connectedCallback(){this.style.position=`relative`,this.style.zIndex=`10`,this.style.lineHeight=`1.5`,this.style.display=`flex`,this.style.flexDirection=`column`,this._scheduleRender()}disconnectedCallback(){this._clearPoll(),this._reactRoot&&=(this._reactRoot.unmount(),void 0),this._mountTelemetrySent=!1,this._lastPublicConfigTelemetryKey=null,this._activeInstanceId=null}_clearPoll(){this._pollTimer!==void 0&&(globalThis.clearTimeout(this._pollTimer),this._pollTimer=void 0),this._dataRefreshSchedule=null}_schedulePoll(){this._clearPoll();let e=bG+Math.floor(Math.random()*xG),t=Date.now();this._dataRefreshSchedule={intervalStartMs:t,dueAtMs:t+e},this._pollTimer=globalThis.setTimeout(()=>{this._pollTick()},e)}async _pollTick(){if(!this.isConnected)return;if(typeof document<`u`&&document.visibilityState===`hidden`){this._schedulePoll();return}let e=A_(this);if(!e||e!==this._activeInstanceId)return;let t=await eW(e);!this.isConnected||e!==this._activeInstanceId||(t.data?(this._flightsCache=t.data,this._flightsError=!1):this._flightsError=!0,this._flightsLoading=!1,this._schedulePoll(),this._paint())}_scheduleRender(){this._renderScheduled||(this._renderScheduled=!0,queueMicrotask(()=>{this._renderScheduled=!1,this.isConnected&&this._renderAsync()}))}async _renderAsync(){if(this._renderInProgress){this._renderQueued=!0;return}this._renderInProgress=!0;try{let e=A_(this),t=I_(),n=QU();e!==this._activeInstanceId&&(this._clearPoll(),this._activeInstanceId=e,this._flightsCache=null,this._flightsLoading=!0,this._flightsError=!1,this._resolvedTheme=tW),this._paint();let r=null,i={attempted:!1,durationMs:0},a;if(e&&t){let t=await L_(e);i=t.metrics;let n=t.config;n?.widgetType&&n.widgetType!==`fids-board`&&(console.warn(`[airport-one-widgets] Widget instance type does not match fids-board:`,n.widgetType),a=`widget_type_mismatch`,n=null),r=n,this._resolvedTheme=iW(r),i.attempted&&r===null&&a===void 0&&i.failureKind&&(a=i.failureKind)}else this._resolvedTheme=tW;if(!this.isConnected)return;let o=SG(this,`consent-analytics`),s=!i.attempted&&(!t||!e)?t?`no_instance_id`:`no_api_base`:void 0;if(o){let n=i.attempted?`attempt:${t}|${e}|${r===null?`fail`:`ok`}|${a??``}`:`skip:${s??`none`}`;n!==this._lastPublicConfigTelemetryKey&&(this._lastPublicConfigTelemetryKey=n,Wv(!0,{widget_runtime:`fids-board`,attempted:i.attempted,duration_ms:i.durationMs,ok:i.attempted?r!==null:!1,error_kind:i.attempted&&r===null?a:void 0,skip_reason:s}))}if(r===null&&e&&t&&console.warn(`${M_}: fids-board — managed instance config not applied or wrong type.`),e&&n){let t=await eW(e);if(!this.isConnected||e!==this._activeInstanceId)return;t.data?(this._flightsCache=t.data,this._flightsError=!1):this._flightsError=!0,this._flightsLoading=!1,this._schedulePoll()}else this._flightsLoading=!1,this._flightsError=!1,(!e||!n)&&(this._flightsCache=null);this._paint(),o&&!this._mountTelemetrySent&&(this._mountTelemetrySent=!0,Gv(!0,{widget_runtime:`fids-board`,public_config_unavailable:r===null&&!!t}))}finally{this._renderInProgress=!1,this._renderQueued&&(this._renderQueued=!1,queueMicrotask(()=>{this.isConnected&&this._renderAsync()}))}}_paint(){let e=this._shadow??=this.attachShadow({mode:`closed`});if(!this._shadowStylesInjected){let t=document.createElement(`style`);t.textContent=Ab,e.appendChild(t),this._shadowStylesInjected=!0}let t=this._mount??=document.createElement(`span`);t.parentNode!==e&&e.appendChild(t);let n=SG(this,`consent-analytics`);(this._reactRoot??=T_.createRoot(t)).render((0,q.jsx)(vG,{payload:this._flightsCache,loading:this._flightsLoading,error:this._flightsError,consentAnalytics:n,theme:this._resolvedTheme,dataRefreshSchedule:this._dataRefreshSchedule}))}};return customElements.get(`fma-fids-board`)||customElements.define(`fma-fids-board`,CG),e.AirfareContent=Lx,e.AirfareSearch=HU,e.CarfareSearch=LB,e.FidsBoardElement=CG,e})({});
|