airport-one-widgets 0.2.48 → 0.2.49
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.
|
@@ -672,4 +672,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
672
672
|
}`;function xP(){var e=ON,t=kN,n=Q.cssPrefix,r=Q.replacementClass,i=bP;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 SP=!1;function CP(){Q.autoAddCss&&!SP&&(lP(xP()),SP=!0)}var wP={mixout:function(){return{dom:{css:xP,insertCss:CP}}},hooks:function(){return{beforeDOMElementCreation:function(){CP()},beforeI2svg:function(){CP()}}}},TP=oM||{};TP[EN]||(TP[EN]={}),TP[EN].styles||(TP[EN].styles={}),TP[EN].hooks||(TP[EN].hooks={}),TP[EN].shims||(TP[EN].shims=[]);var EP=TP[EN],DP=[],OP=function(){sM.removeEventListener(`DOMContentLoaded`,OP),kP=1,DP.map(function(e){return e()})},kP=!1;uM&&(kP=(sM.documentElement.doScroll?/^loaded|^c/:/^loaded|^i|^c/).test(sM.readyState),kP||sM.addEventListener(`DOMContentLoaded`,OP));function AP(e){uM&&(kP?setTimeout(e,0):DP.push(e))}function jP(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`?mP(e):`<${t} ${hP(r)}>${a.map(jP).join(``)}</${t}>`}function MP(e,t,n){if(e&&e[t]&&e[t][n])return{prefix:t,iconName:n,icon:e[t][n]}}var NP=function(e,t){return function(n,r,i,a){return e.call(t,n,r,i,a)}},PP=function(e,t,n,r){var i=Object.keys(e),a=i.length,o=r===void 0?t:NP(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 FP(e){return Jj(e).length===1?e.codePointAt(0).toString(16):null}function IP(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 LP(e,t){var n=(arguments.length>2&&arguments[2]!==void 0?arguments[2]:{}).skipHooks,r=n===void 0?!1:n,i=IP(t);typeof EP.hooks.addPack==`function`&&!r?EP.hooks.addPack(e,IP(t)):EP.styles[e]=Z(Z({},EP.styles[e]||{}),i),e===`fas`&&LP(`fa`,t)}var RP=EP.styles,zP=EP.shims,BP=Object.keys(KN),VP=BP.reduce(function(e,t){return e[t]=Object.keys(KN[t]),e},{}),HP=null,UP={},WP={},GP={},KP={},qP={};function JP(e){return~$N.indexOf(e)}function YP(e,t){var n=t.split(`-`),r=n[0],i=n.slice(1).join(`-`);return r===e&&i!==``&&!JP(i)?i:null}var XP=function(){var e=function(e){return PP(RP,function(t,n,r){return t[r]=PP(n,e,{}),t},{})};UP=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}),WP=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}),qP=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 RP||Q.autoFetchSvg,n=PP(zP,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:{}});GP=n.names,KP=n.unicodes,HP=aF(Q.styleDefault,{family:Q.familyDefault})};oP(function(e){HP=aF(e.styleDefault,{family:Q.familyDefault})}),XP();function ZP(e,t){return(UP[e]||{})[t]}function QP(e,t){return(WP[e]||{})[t]}function $P(e,t){return(qP[e]||{})[t]}function eF(e){return GP[e]||{prefix:null,iconName:null}}function tF(e){var t=KP[e],n=ZP(`fas`,e);return t||(n?{prefix:`fas`,iconName:n}:null)||{prefix:null,iconName:null}}function nF(){return HP}var rF=function(){return{prefix:null,iconName:null,rest:[]}};function iF(e){var t=vM,n=BP.reduce(function(e,t){return e[t]=`${Q.cssPrefix}-${t}`,e},{});return nN.forEach(function(r){(e.includes(n[r])||e.some(function(e){return VP[r].includes(e)}))&&(t=r)}),t}function aF(e){var t=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}).family,n=t===void 0?vM:t,r=HN[n][e];if(n===yM&&!e)return`fad`;var i=WN[n][e]||WN[n][r],a=e in EP.styles?e:null;return i||a||null}function oF(e){var t=[],n=null;return e.forEach(function(e){var r=YP(Q.cssPrefix,e);r?n=r:e&&t.push(e)}),{iconName:n,rest:t}}function sF(e){return e.sort().filter(function(e,t,n){return n.indexOf(e)===t})}var cF=bN.concat(sN);function lF(e){var t=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}).skipLookups,n=t===void 0?!1:t,r=null,i=sF(e.filter(function(e){return cF.includes(e)})),a=sF(e.filter(function(e){return!cF.includes(e)})),o=qj(i.filter(function(e){return r=e,!_M.includes(e)}),1)[0],s=o===void 0?null:o,c=iF(i),l=Z(Z({},oF(a)),{},{prefix:aF(s,{family:c})});return Z(Z(Z({},l),pF({values:e,family:c,styles:RP,config:Q,canonical:l,givenPrefix:r})),uF(n,r,l))}function uF(e,t,n){var r=n.prefix,i=n.iconName;if(e||!r||!i)return{prefix:r,iconName:i};var a=t===`fa`?eF(i):{},o=$P(r,i);return i=a.iconName||o||i,r=a.prefix||r,r===`far`&&!RP.far&&RP.fas&&!Q.autoFetchSvg&&(r=`fas`),{prefix:r,iconName:i}}var dF=nN.filter(function(e){return e!==vM||e!==yM}),fF=Object.keys(yN).filter(function(e){return e!==vM}).map(function(e){return Object.keys(yN[e])}).flat();function pF(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===yM,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&&dF.includes(n)&&(Object.keys(s).find(function(e){return fF.includes(e)})||l.autoFetchSvg)&&(r.prefix=aN.get(n).defaultShortPrefixId,r.iconName=$P(r.prefix,r.iconName)||r.iconName),(r.prefix===`fa`||a===`fa`)&&(r.prefix=nF()||`fas`),r}var mF=function(){function e(){Lj(this,e),this.definitions={}}return zj(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]),LP(t,i[t]);var n=KN[vM][t];n&&LP(n,i[t]),XP()})}},{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}}])}(),hF=[],gF={},_F={},vF=Object.keys(_F);function yF(e,t){var n=t.mixoutsTo;return hF=e,gF={},Object.keys(_F).forEach(function(e){vF.indexOf(e)===-1&&delete _F[e]}),hF.forEach(function(e){var t=e.mixout?e.mixout():{};if(Object.keys(t).forEach(function(e){typeof t[e]==`function`&&(n[e]=t[e]),Zj(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){gF[e]||(gF[e]=[]),gF[e].push(r[e])})}e.provides&&e.provides(_F)}),n}function bF(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(gF[e]||[]).forEach(function(e){t=e.apply(null,[t].concat(r))}),t}function xF(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];(gF[e]||[]).forEach(function(e){e.apply(null,n)})}function SF(){var e=arguments[0],t=Array.prototype.slice.call(arguments,1);return _F[e]?_F[e].apply(null,t):void 0}function CF(e){e.prefix===`fa`&&(e.prefix=`fas`);var t=e.iconName,n=e.prefix||nF();if(t)return t=$P(n,t)||t,MP(wF.definitions,n,t)||MP(EP.styles,n,t)}var wF=new mF,TF={noAuto:function(){Q.autoReplaceSvg=!1,Q.observeMutations=!1,xF(`noAuto`)},config:Q,dom:{i2svg:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return uM?(xF(`beforeI2svg`,e),SF(`pseudoElements2svg`,e),SF(`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,AP(function(){EF({autoReplaceSvgRoot:t}),xF(`watch`,e)})}},parse:{icon:function(e){if(e===null)return null;if(Zj(e)===`object`&&e.prefix&&e.iconName)return{prefix:e.prefix,iconName:$P(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=aF(e[0]);return{prefix:n,iconName:$P(n,t)||t}}if(typeof e==`string`&&(e.indexOf(`${Q.cssPrefix}-`)>-1||e.match(JN))){var r=lF(e.split(` `),{skipLookups:!0});return{prefix:r.prefix||nF(),iconName:$P(r.prefix,r.iconName)||r.iconName}}if(typeof e==`string`){var i=nF();return{prefix:i,iconName:$P(i,e)||e}}}},library:wF,findIconDefinition:CF,toHtml:jP},EF=function(){var e=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}).autoReplaceSvgRoot,t=e===void 0?sM:e;(Object.keys(EP.styles).length>0||Q.autoFetchSvg)&&uM&&Q.autoReplaceSvg&&TF.dom.i2svg({node:t})};function DF(e,t){return Object.defineProperty(e,"abstract",{get:t}),Object.defineProperty(e,"html",{get:function(){return e.abstract.map(function(e){return jP(e)})}}),Object.defineProperty(e,"node",{get:function(){if(uM){var t=sM.createElement(`div`);return t.innerHTML=e.html,t.children}}}),e}function OF(e){var t=e.children,n=e.main,r=e.mask,i=e.attributes,a=e.styles,o=e.transform;if(_P(o)&&n.found&&!r.found){var s={x:n.width/n.height/2,y:.5};i.style=gP(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 kF(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 AF(e){return[`aria-label`,`aria-labelledby`,`title`,`role`].some(function(t){return t in e})}function jF(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}`})};!AF(l.attributes)&&!l.attributes[`aria-hidden`]&&(g.attributes[`aria-hidden`]=`true`),d&&(g.attributes[AN]=``);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?SF(`generateAbstractMask`,_)||{children:[],attributes:{}}:SF(`generateAbstractIcon`,_)||{children:[],attributes:{}},y=v.children,b=v.attributes;return _.children=y,_.attributes=b,s?kF(_):OF(_)}function MF(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[AN]=``);var l=Z({},a.styles);_P(i)&&(l.transform=yP({transform:i,startCentered:!0,width:n,height:r}),l[`-webkit-transform`]=l.transform);var u=gP(l);u.length>0&&(c.style=u);var d=[];return d.push({tag:`span`,attributes:c,children:[t]}),d}function NF(e){var t=e.content,n=e.extra,r=Z(Z({},n.attributes),{},{class:n.classes.join(` `)}),i=gP(n.styles);i.length>0&&(r.style=i);var a=[];return a.push({tag:`span`,attributes:r,children:[t]}),a}var PF=EP.styles;function FF(e){var t=e[0],n=e[1],r=qj(e.slice(4),1)[0],i=null;return i=Array.isArray(r)?{tag:`g`,attributes:{class:`${Q.cssPrefix}-${QN.GROUP}`},children:[{tag:`path`,attributes:{class:`${Q.cssPrefix}-${QN.SECONDARY}`,fill:`currentColor`,d:r[0]}},{tag:`path`,attributes:{class:`${Q.cssPrefix}-${QN.PRIMARY}`,fill:`currentColor`,d:r[1]}}]}:{tag:`path`,attributes:{fill:`currentColor`,d:r}},{found:!0,width:t,height:n,icon:i}}var IF={found:!1,width:512,height:512};function LF(e,t){!zN&&!Q.showMissingIcons&&e&&console.error(`Icon with name "${e}" and prefix "${t}" is missing.`)}function RF(e,t){var n=t;return t===`fa`&&Q.styleDefault!==null&&(t=nF()),new Promise(function(r,i){if(n===`fa`){var a=eF(e)||{};e=a.iconName||e,t=a.prefix||t}if(e&&t&&PF[t]&&PF[t][e]){var o=PF[t][e];return r(FF(o))}LF(e,t),r(Z(Z({},IF),{},{icon:Q.showMissingIcons&&e&&SF(`missingIconAbstract`)||{}}))})}var zF=function(){},BF=Q.measurePerformance&&lM&&lM.mark&&lM.measure?lM:{mark:zF,measure:zF},VF=`FA "7.2.0"`,HF=function(e){return BF.mark(`${VF} ${e} begins`),function(){return UF(e)}},UF=function(e){BF.mark(`${VF} ${e} ends`),BF.measure(`${VF} ${e}`,`${VF} ${e} begins`,`${VF} ${e} ends`)},WF={begin:HF,end:UF},GF=function(){};function KF(e){return typeof(e.getAttribute?e.getAttribute(AN):null)==`string`}function qF(e){var t=e.getAttribute?e.getAttribute(NN):null,n=e.getAttribute?e.getAttribute(PN):null;return t&&n}function JF(e){return e&&e.classList&&e.classList.contains&&e.classList.contains(Q.replacementClass)}function YF(){return Q.autoReplaceSvg===!0?eI.replace:eI[Q.autoReplaceSvg]||eI.replace}function XF(e){return sM.createElementNS(`http://www.w3.org/2000/svg`,e)}function ZF(e){return sM.createElement(e)}function QF(e){var t=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}).ceFn,n=t===void 0?e.tag===`svg`?XF:ZF:t;if(typeof e==`string`)return sM.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(QF(e,{ceFn:n}))}),r}function $F(e){var t=` ${e.outerHTML} `;return t=`${t}Font Awesome fontawesome.com `,t}var eI={replace:function(e){var t=e[0];if(t.parentNode)if(e[1].forEach(function(e){t.parentNode.insertBefore(QF(e),t)}),t.getAttribute(AN)===null&&Q.keepOriginalSource){var n=sM.createComment($F(t));t.parentNode.replaceChild(n,t)}else t.remove()},nest:function(e){var t=e[0],n=e[1];if(~pP(t).indexOf(Q.replacementClass))return eI.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 jP(e)}).join(`
|
|
673
673
|
`);t.setAttribute(AN,``),t.innerHTML=a}};function tI(e){e()}function nI(e,t){var n=typeof t==`function`?t:GF;if(e.length===0)n();else{var r=tI;Q.mutateApproach===IN&&(r=oM.requestAnimationFrame||tI),r(function(){var t=YF(),r=WF.begin(`mutate`);e.map(t),r(),n()})}}var rI=!1;function iI(){rI=!0}function aI(){rI=!1}var oI=null;function sI(e){if(cM&&Q.observeMutations){var t=e.treeCallback,n=t===void 0?GF:t,r=e.nodeCallback,i=r===void 0?GF:r,a=e.pseudoElementsCallback,o=a===void 0?GF:a,s=e.observeMutationsRoot,c=s===void 0?sM:s;oI=new cM(function(e){if(!rI){var t=nF();fP(e).forEach(function(e){if(e.type===`childList`&&e.addedNodes.length>0&&!KF(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`&&KF(e.target)&&~ZN.indexOf(e.attributeName))if(e.attributeName===`class`&&qF(e.target)){var r=lF(pP(e.target)),a=r.prefix,s=r.iconName;e.target.setAttribute(NN,a||t),s&&e.target.setAttribute(PN,s)}else JF(e.target)&&i(e.target)})}}),uM&&oI.observe(c,{childList:!0,attributes:!0,characterData:!0,subtree:!0})}}function cI(){oI&&oI.disconnect()}function lI(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 uI(e){var t=e.getAttribute(`data-prefix`),n=e.getAttribute(`data-icon`),r=e.innerText===void 0?``:e.innerText.trim(),i=lF(pP(e));return i.prefix||=nF(),t&&n&&(i.prefix=t,i.iconName=n),i.iconName&&i.prefix?i:(i.prefix&&r.length>0&&(i.iconName=QP(i.prefix,e.innerText)||ZP(i.prefix,FP(e.innerText))),!i.iconName&&Q.autoFetchSvg&&e.firstChild&&e.firstChild.nodeType===Node.TEXT_NODE&&(i.iconName=e.firstChild.data),i)}function dI(e){return fP(e.attributes).reduce(function(e,t){return e.name!==`class`&&e.name!==`style`&&(e[t.name]=t.value),e},{})}function fI(){return{iconName:null,prefix:null,transform:cP,symbol:!1,mask:{iconName:null,prefix:null,rest:[]},maskId:null,extra:{classes:[],styles:{},attributes:{}}}}function pI(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{styleParser:!0},n=uI(e),r=n.iconName,i=n.prefix,a=n.rest,o=dI(e),s=bF(`parseNodeAttributes`,{},e);return Z({iconName:r,prefix:i,transform:cP,mask:{iconName:null,prefix:null,rest:[]},maskId:null,symbol:!1,extra:{classes:a,styles:t.styleParser?lI(e):[],attributes:o}},s)}var mI=EP.styles;function hI(e){var t=Q.autoReplaceSvg===`nest`?pI(e,{styleParser:!1}):pI(e);return~t.extra.classes.indexOf(YN)?SF(`generateLayersText`,e,t):SF(`generateSvgReplacementMutation`,e,t)}function gI(){return[].concat(Jj(sN),Jj(bN))}function _I(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(!uM)return Promise.resolve();var n=sM.documentElement.classList,r=function(e){return n.add(`${FN}-${e}`)},i=function(e){return n.remove(`${FN}-${e}`)},a=Q.autoFetchSvg?gI():_M.concat(Object.keys(mI));a.includes(`fa`)||a.push(`fa`);var o=[`.${YN}:not([${AN}])`].concat(a.map(function(e){return`.${e}:not([${AN}])`})).join(`, `);if(o.length===0)return Promise.resolve();var s=[];try{s=fP(e.querySelectorAll(o))}catch{}if(s.length>0)r(`pending`),i(`complete`);else return Promise.resolve();var c=WF.begin(`onTree`),l=s.reduce(function(e,t){try{var n=hI(t);n&&e.push(n)}catch(e){zN||e.name===`MissingIcon`&&console.error(e)}return e},[]);return new Promise(function(e,n){Promise.all(l).then(function(n){nI(n,function(){r(`active`),r(`complete`),i(`pending`),typeof t==`function`&&t(),c(),e()})}).catch(function(e){c(),n(e)})})}function vI(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;hI(e).then(function(e){e&&nI([e],t)})}function yI(e){return function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=(t||{}).icon?t:CF(t||{}),i=n.mask;return i&&=(i||{}).icon?i:CF(i||{}),e(r,Z(Z({},n),{},{mask:i}))}}var bI=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.transform,r=n===void 0?cP: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 DF(Z({type:`icon`},e),function(){return xF(`beforeDOMElementCreation`,{iconDefinition:e,params:t}),jF({icons:{main:FF(v),mask:s?FF(s.icon):{found:!1,width:null,height:null,icon:{}}},prefix:g,iconName:_,transform:Z(Z({},cP),r),symbol:a,maskId:l,extra:{attributes:p,styles:h,classes:d}})})}},xI={mixout:function(){return{icon:yI(bI)}},hooks:function(){return{mutationObserverCallbacks:function(e){return e.treeCallback=_I,e.nodeCallback=vI,e}}},provides:function(e){e.i2svg=function(e){var t=e.node,n=t===void 0?sM:t,r=e.callback;return _I(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([RF(n,r),o.iconName?RF(o.iconName,o.prefix):Promise.resolve({found:!1,width:512,height:512,icon:{}})]).then(function(o){var l=qj(o,2),u=l[0],d=l[1];t([e,jF({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=gP(a);o.length>0&&(n.style=o);var s;return _P(i)&&(s=SF(`generateAbstractTransformGrouping`,{main:r,transform:i,containerWidth:r.width,iconWidth:r.width})),t.push(s||r.icon),{children:t,attributes:n}}}},SI={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 DF({type:`layer`},function(){xF(`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(Jj(r)).join(` `)},children:n}]})}}}},CI={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 DF({type:`counter`,content:e},function(){return xF(`beforeDOMElementCreation`,{content:e,params:t}),NF({content:e.toString(),title:r,extra:{attributes:s,styles:l,classes:[`${Q.cssPrefix}-layers-counter`].concat(Jj(a))}})})}}}},wI={mixout:function(){return{text:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.transform,r=n===void 0?cP: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 DF({type:`text`,content:e},function(){return xF(`beforeDOMElementCreation`,{content:e,params:t}),MF({content:e,transform:Z(Z({},cP),r),extra:{attributes:s,styles:l,classes:[`${Q.cssPrefix}-layers-text`].concat(Jj(a))}})})}}},provides:function(e){e.generateLayersText=function(e,t){var n=t.transform,r=t.extra,i=null,a=null;if(dM){var o=parseInt(getComputedStyle(e).fontSize,10),s=e.getBoundingClientRect();i=s.width/o,a=s.height/o}return Promise.resolve([e,MF({content:e.innerHTML,width:i,height:a,transform:n,extra:r,watchable:!0})])}}},TI=RegExp(`"`,`ug`),EI=[1105920,1112319],DI=Z(Z(Z(Z({},{FontAwesome:{normal:`fas`,400:`fas`}}),iN),TN),dN),OI=Object.keys(DI).reduce(function(e,t){return e[t.toLowerCase()]=DI[t],e},{}),kI=Object.keys(OI).reduce(function(e,t){var n=OI[t];return e[t]=n[900]||Jj(Object.entries(n))[0][1],e},{});function AI(e){return FP(Jj(e.replace(TI,``))[0]||``)}function jI(e){var t=e.getPropertyValue(`font-feature-settings`).includes(`ss01`),n=e.getPropertyValue(`content`).replace(TI,``),r=n.codePointAt(0),i=r>=EI[0]&&r<=EI[1],a=n.length===2?n[0]===n[1]:!1;return i||a||t}function MI(e,t){var n=e.replace(/^['"]|['"]$/g,``).toLowerCase(),r=parseInt(t),i=isNaN(r)?`normal`:r;return(OI[n]||{})[i]||kI[n]}function NI(e,t){var n=`${MN}${t.replace(`:`,`-`)}`;return new Promise(function(r,i){if(e.getAttribute(n)!==null)return r();var a=fP(e.children).filter(function(e){return e.getAttribute(jN)===t})[0],o=oM.getComputedStyle(e,t),s=o.getPropertyValue(`font-family`),c=s.match(XN),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=MI(s,l),p=AI(d),m=c[0].startsWith(`FontAwesome`),h=jI(o),g=ZP(f,p),_=g;if(m){var v=tF(p);v.iconName&&v.prefix&&(g=v.iconName,f=v.prefix)}if(g&&!h&&(!a||a.getAttribute(NN)!==f||a.getAttribute(PN)!==_)){e.setAttribute(n,_),a&&e.removeChild(a);var y=fI(),b=y.extra;b.attributes[jN]=t,RF(g,f).then(function(i){var a=jF(Z(Z({},y),{},{icons:{main:i,mask:rF()},prefix:f,iconName:_,extra:b,watchable:!0})),o=sM.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 jP(e)}).join(`
|
|
674
674
|
`),e.removeAttribute(n),r()}).catch(i)}else r()}else r()})}function PI(e){return Promise.all([NI(e,`::before`),NI(e,`::after`)])}function FI(e){return e.parentNode!==document.head&&!~LN.indexOf(e.tagName.toUpperCase())&&!e.getAttribute(jN)&&(!e.parentNode||e.parentNode.tagName!==`svg`)}var II=function(e){return!!e&&RN.some(function(t){return e.includes(t)})},LI=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=Bj(n),i;try{for(r.s();!(i=r.n()).done;){var a=i.value;if(II(a)){var o=RN.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 RI(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(uM){var n;if(t)n=e;else if(Q.searchPseudoElementsFullScan)n=e.querySelectorAll(`*`);else{var r=new Set,i=Bj(document.styleSheets),a;try{for(i.s();!(a=i.n()).done;){var o=a.value;try{var s=Bj(o.cssRules),c;try{for(s.s();!(c=s.n()).done;){var l=c.value,u=Bj(LI(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})
|
|
675
|
-
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=fP(n).filter(FI).map(PI),i=WF.begin(`searchPseudoElements`);iI(),Promise.all(r).then(function(){i(),aI(),e()}).catch(function(){i(),aI(),t()})})}}var zI={hooks:function(){return{mutationObserverCallbacks:function(e){return e.pseudoElementsCallback=RI,e}}},provides:function(e){e.pseudoElements2svg=function(e){var t=e.node,n=t===void 0?sM:t;Q.searchPseudoElements&&RI(n)}}},BI=!1,VI={mixout:function(){return{dom:{unwatch:function(){iI(),BI=!0}}}},hooks:function(){return{bootstrap:function(){sI(bF(`mutationObserverCallbacks`,{}))},noAuto:function(){cI()},watch:function(e){var t=e.observeMutationsRoot;BI?aI():sI(bF(`mutationObserverCallbacks`,{observeMutationsRoot:t}))}}}},HI=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})},UI={mixout:function(){return{parse:{transform:function(e){return HI(e)}}}},hooks:function(){return{parseNodeAttributes:function(e,t){var n=t.getAttribute(`data-fa-transform`);return n&&(e.transform=HI(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)}]}]}}}},WI={x:0,y:0,width:`100%`,height:`100%`};function GI(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 KI(e){return e.tag===`g`?e.children:[e]}yF([wP,xI,SI,CI,wI,zI,VI,UI,{hooks:function(){return{parseNodeAttributes:function(e,t){var n=t.getAttribute(`data-fa-mask`),r=n?lF(n.split(` `).map(function(e){return e.trim()})):rF();return r.prefix||=nF(),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=vP({transform:o,containerWidth:l,iconWidth:s}),f={tag:`rect`,attributes:Z(Z({},WI),{},{fill:`white`})},p=c.children?{children:c.children.map(GI)}:{},m={tag:`g`,attributes:Z({},d.inner),children:[GI(Z({tag:c.tag,attributes:Z(Z({},c.attributes),d.path)},p))]},h={tag:`g`,attributes:Z({},d.outer),children:[m]},g=`mask-${a||dP()}`,_=`clip-${a||dP()}`,v={tag:`mask`,attributes:Z(Z({},WI),{},{id:g,maskUnits:`userSpaceOnUse`,maskContentUnits:`userSpaceOnUse`}),children:[f,h]},y={tag:`defs`,children:[{tag:`clipPath`,attributes:{id:_},children:KI(u)},v]};return t.push(y,{tag:`rect`,attributes:Z({fill:`currentColor`,"clip-path":`url(#${_})`,mask:`url(#${g})`},WI)}),{children:t,attributes:n}}}},{provides:function(e){var t=!1;oM.matchMedia&&(t=oM.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:TF}),TF.noAuto;var qI=TF.config;TF.library,TF.dom;var JI=TF.parse;TF.findIconDefinition,TF.toHtml;var YI=TF.icon;TF.layer,TF.text,TF.counter;function XI(e){return e-=0,e===e}function ZI(e){return XI(e)?e:(e=e.replace(/[_-]+(.)?/g,(e,t)=>t?t.toUpperCase():``),e.charAt(0).toLowerCase()+e.slice(1))}var QI=(e,t)=>K.createElement(`stop`,{key:`${t}-${e.offset}`,offset:e.offset,stopColor:e.color,...e.opacity!==void 0&&{stopOpacity:e.opacity}});function $I(e){return e.charAt(0).toUpperCase()+e.slice(1)}var eL=new Map,tL=1e3;function nL(e){if(eL.has(e))return eL.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=ZI(n);t[e.startsWith(`webkit`)?$I(e):e]=r}}}n=a+1}if(eL.size===tL){let e=eL.keys().next().value;e&&eL.delete(e)}return eL.set(e,t),t}function rL(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}}),rL(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=nL(String(t));break;case e.startsWith(`aria-`):case e.startsWith(`data-`):a[e.toLowerCase()]=t;break;default:a[ZI(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(QI)))}return e(t.tag,{...a,...u},...r)}var iL=rL.bind(null,K.createElement),aL=(e,t)=>{let n=(0,K.useId)();return e||(t?n:void 0)},oL=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 sL=`searchPseudoElementsFullScan`in qI&&typeof qI.searchPseudoElementsFullScan==`boolean`?`7.0.0`:`6.0.0`,cL=Number.parseInt(sL)>=7,lL=()=>cL,uL=`fa`,dL={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`},fL={left:`fa-pull-left`,right:`fa-pull-right`},pL={90:`fa-rotate-90`,180:`fa-rotate-180`,270:`fa-rotate-270`},mL={"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`},hL={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`},gL={default:`fa-layers`};function _L(e){let t=qI.cssPrefix||qI.familyPrefix||uL;return t===uL?e:e.replace(new RegExp(String.raw`(?<=^|\s)${uL}-`,`g`),`${t}-`)}function vL(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(dL.beat),n&&x.push(dL.fade),r&&x.push(dL.beatFade),i&&x.push(dL.bounce),a&&x.push(dL.shake),o&&x.push(dL.spin),c&&x.push(dL.spinReverse),s&&x.push(dL.spinPulse),l&&x.push(dL.pulse),u&&x.push(hL.fixedWidth),d&&x.push(hL.inverse),f&&x.push(hL.border),p===!0&&x.push(hL.flip),(p===`horizontal`||p===`both`)&&x.push(hL.flipHorizontal),(p===`vertical`||p===`both`)&&x.push(hL.flipVertical),m!=null&&x.push(mL[m]),h!=null&&h!==0&&x.push(pL[h]),g!=null&&x.push(fL[g]),_&&x.push(hL.swapOpacity),lL()?(v&&x.push(hL.rotateBy),y&&x.push(hL.widthAuto),(qI.cssPrefix||qI.familyPrefix||uL)===uL?x:x.map(_L)):x}var yL=e=>typeof e==`object`&&`icon`in e&&!!e.icon;function bL(e){if(e)return yL(e)?e:JI.icon(e)}function xL(e){return Object.keys(e)}var SL=new oL(`FontAwesomeIcon`),CL={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},wL=new Set(Object.keys(CL)),TL=K.forwardRef((e,t)=>{let n={...CL,...e},{icon:r,mask:i,symbol:a,title:o,titleId:s,maskId:c,transform:l}=n,u=aL(c,!!i),d=aL(s,!!o),f=bL(r);if(!f)return SL.error(`Icon lookup is undefined`,r),null;let p=vL(n),m=typeof l==`string`?JI.transform(l):l,h=bL(i),g=YI(f,{...p.length>0&&{classes:p},...m&&{transform:m},...h&&{mask:h},symbol:a,title:o,titleId:d,maskId:u});if(!g)return SL.error(`Could not find icon`,f),null;let{abstract:_}=g,v={ref:t};for(let e of xL(n))wL.has(e)||(v[e]=n[e]);return iL(_[0],v)});TL.displayName=`FontAwesomeIcon`,`${gL.default}${hL.fixedWidth}`;function EL({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)(TL,{icon:jj,"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 DL=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 zm(c)?Nm(c):null},OL=/^\d{2}\/\d{2}\/\d{2}$/,kL=e=>e.toLocaleDateString(`en-US`,{year:`2-digit`,month:`2-digit`,day:`2-digit`}),AL=(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)}`}},jL=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`)}`},ML=e=>{if(!OL.test(e))return null;let t=Hg(e,`MM/dd/yy`,new Date);return zm(t)&&kL(Nm(t))===e?Nm(t):null};function NL({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,I]=(0,K.useState)(!1),[ie]=(0,K.useState)(()=>p||new Date),ae=(0,K.useRef)(n),oe=(0,K.useRef)(null),se=(0,K.useRef)(null),ce=(0,K.useRef)(null),le=(0,K.useRef)(0),ue=(0,K.useRef)(null),de=(0,K.useRef)(null),fe=()=>Date.now()<le.current,pe=()=>{fe()||P(!0)},me=()=>{le.current=Date.now()+250,P(!1)},he=e=>{if(e){pe();return}me()};(0,K.useEffect)(()=>{ae.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 ge=Nm(new Date),_e=wm(ge,6),ve=e=>{S(e);let t=ML(e);return e===``||!e?(E(null),A(null),!0):t?Nh(t,ge)?(E(`Date cannot be in the past`),A(null),!1):Mh(t,_e)?(E(`Date must be within 6 months`),A(null),!1):g&&Nh(t,g)?(E(`Date must be no earlier than `+g.toLocaleDateString()),A(null),!1):(E(null),A(t),F(t),j&&Nh(j,t)&&(M(null),w(``)),!0):(E(`Enter a date in MM/DD/YY format`),A(null),!1)},ye=e=>{if(i)return!0;w(e);let t=ML(e);return e===``||!e?(O(null),M(null),!0):t?Nh(t,ge)?(O(`Date cannot be in the past`),M(null),!1):Mh(t,_e)?(O(`Date must be within 6 months`),M(null),!1):k?Nh(t,k)?(O(`Return date must be after departure`),M(null),!1):g&&Nh(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)},L=()=>ve(x),be=()=>ye(C),R=e=>{let t=e.getTime()<(k?.getTime()||0);k?!j&&t?A(e):j?k&&j&&(Lm(e,k)&&Lm(e,j)?(A(e),M(null)):Nh(e,j)&&Nh(e,Cm(k,3))?A(e):M(e)):i?A(e):M(e):A(e)},xe=()=>{A(null),M(null),S(``),w(``),E(null),O(null),F(null),ae.current(null,null)};(0,K.useEffect)(()=>{ae.current(k,j)},[k,j]),(0,K.useEffect)(()=>{queueMicrotask(()=>{k?(S(kL(k)),E(null)):T||S(``)})},[k]),(0,K.useEffect)(()=>{queueMicrotask(()=>{j?(w(kL(j)),O(null)):D||w(``)})},[j]);let Se={};o&&(Se[`--color-primary`]=o),s&&(Se[`--color-secondary`]=s);let Ce=hj(),we=(0,K.useId)(),Te=`${we}-description`,Ee=(0,q.jsxs)(`div`,{ref:ce,onClick:pe,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)(gj,{})}),(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=AL(e.target.value,x);S(t),E(null),F(DL(t)),ae.current(null,j)},onFocus:()=>{ne(!0),pe()},onBlur:e=>{let t=jL(e.target.value);S(t);let n=ve(t);ne(!1),!n&&ue.current===`forward`&&requestAnimationFrame(()=>oe.current?.focus()),ue.current=null},onKeyDown:e=>{e.key===`Tab`&&(ue.current=e.shiftKey?`backward`:`forward`),e.key===`Enter`&&(e.preventDefault(),L(),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)(EL,{message:T,buttonRef:oe})})]})]})]}),!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)(gj,{})}),(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=AL(e.target.value,C);w(t),O(null),F(DL(t)),ae.current(k,null)},onFocus:()=>{I(!0),pe()},onBlur:e=>{let t=jL(e.target.value);w(t);let n=ye(t);I(!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(),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)(EL,{message:D,buttonRef:se})})]})]})]})]})]});return(0,q.jsxs)(`div`,{id:`A1-DateRangePicker`,ref:v,className:a,style:Se,role:`group`,"aria-label":`Date range picker`,"aria-describedby":Te,children:[Ce?(0,q.jsxs)(cj,{open:N,onOpenChange:he,children:[Ee,(0,q.jsxs)(sj,{className:`ao-dialog--calendar-light`,open:N,onOpenChange:he,"aria-labelledby":we,"aria-describedby":void 0,children:[(0,q.jsx)(lj,{id:we,className:`aone:sr-only`,children:`Filter Options`}),(0,q.jsx)(Sj,{origin:e,destination:t,initialDate:ie,startDate:k,endDate:j,previewDate:ee,onChange:R,onMonthViewChange:r,flightCalendar:u,flightCalendarStatus:d,onlyDirects:f,referenceDates:h,minDate:g},ie.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:xe,"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:me,"data-testid":`date-range-picker-done-button`,children:`Done`})]})]})]}):(0,q.jsxs)(uj,{open:N,onOpenChange:he,children:[(0,q.jsx)(pj,{asChild:!0,children:Ee}),(0,q.jsxs)(fj,{side:`bottom`,align:`center`,sticky:`always`,avoidCollisions:!1,onOpenAutoFocus:e=>e.preventDefault(),onInteractOutside:e=>{let t=e.target;t&&ce.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)(Sj,{origin:e,destination:t,initialDate:ie,startDate:k,endDate:j,previewDate:ee,onChange:R,onMonthViewChange:r,flightCalendar:u,flightCalendarStatus:d,onlyDirects:f,referenceDates:h,minDate:g},ie.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:xe,"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:me,"data-testid":`date-range-picker-popover-done-button`,children:`Done`})]})]})]}),(0,q.jsx)(`div`,{id:Te,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 PL(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 FL=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}`}),IL=({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)(uj,{open:a,onOpenChange:o,children:[(0,q.jsx)(dj,{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?PL(e):n||`Select time`}),(0,q.jsx)(`div`,{className:`aone:pointer-events-none aone:flex aone:items-center`,children:(0,q.jsx)(TL,{icon:a?wj:Aj,className:`aone:h-4 aone:w-4 aone:text-muted-foreground`})})]})}),(0,q.jsxs)(fj,{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:FL.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:PL(n)},n))})})]})]})};function LL({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)(NL,{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)(IL,{value:n,onChange:i,portalContainer:f})})]})]})}function RL(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 zL(){return zL=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},zL.apply(null,arguments)}var BL=s(((e,t)=>{t.exports=`SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED`})),VL=s(((e,t)=>{var n=BL();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}})),HL=s(((e,t)=>{t.exports=VL()()})),UL=s((e=>{})),WL=s(((e,t)=>{t.exports=UL()})),$=u(HL(),1);WL();var GL=e=>typeof e==`object`&&!!e&&e.nodeType===1,KL=(e,t)=>(!t||e!==`hidden`)&&e!==`visible`&&e!==`clip`,qL=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){let n=getComputedStyle(e,null);return KL(n.overflowY,t)||KL(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},JL=(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,YL=e=>e.parentElement??(e.getRootNode().host||null),XL=(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(!GL(e))throw TypeError(`Invalid target`);let c=document.scrollingElement||document.documentElement,l=[],u=e;for(;GL(u)&&s(u);){if(u=YL(u),u===c){l.push(u);break}u!=null&&u===document.body&&qL(u)&&!qL(document.documentElement)||u!=null&&qL(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&&!qL(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`?JL(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:JL(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`?JL(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:JL(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},ZL=0;function QL(){return String(ZL++)}function $L(e){var t=K.useRef(e);return t.current=e,t}function eR(){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 tR(){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 nR(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 rR=nR(function(e){iR(e).textContent=``},500);function iR(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 aR(e,t){if(!(!e||!t)){var n=iR(t);n.textContent=e,rR(t)}}function oR(e){var t=e?.getElementById(`a11y-status-message`);t&&t.remove()}function sR(){}var cR=sR;function lR(e,t){return t?Object.keys(e).reduce(function(e,n){return t[n]!==void 0&&(e[n]=t[n]),e},zL({},e)):e}function uR(e,t){e&&XL(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 dR(e,t,n){return e===t||t instanceof n.Node&&e.contains&&e.contains(t)}function fR(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 pR(){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 mR(){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 hR(e,t){return e[t]!==void 0}function gR(e){var t=e.key,n=e.keyCode;return n>=37&&n<=40&&t.indexOf(`Arrow`)!==0?`Arrow`+t:t}function _R(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=vR(s,t<0,n,r,i);return c===-1?e>=a?-1:e:c}function vR(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?vR(t?a-1:0,t,n,r):-1}function yR(e,t,n,r){return r===void 0&&(r=!0),n&&t.some(function(t){return t&&(dR(t,e,n)||r&&dR(t,n.document.activeElement,n))})}function bR(e){return``+e.slice(0,1).toUpperCase()+e.slice(1)}function xR(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];SR(l,e,t,n,r),r[l]!==n[l]&&(a[l]=r[l])}t.onStateChange&&Object.keys(a).length&&t.onStateChange(zL({type:i},a))}function SR(e,t,n,r,i){if(i[e]!==r[e]){var a=n[`on`+bR(e)+`Change`];if(typeof a==`function`){var o=t.type;a(zL({type:o},i))}}}function CR(e,t,n,r){var i=K.useRef(null),a=K.useRef(void 0),o=$L(t),s=K.useCallback(function(t,n){a.current=n,t=lR(t,o.current);var r=e(t,o.current,n),i=o.current.stateReducer(t,zL({},n,{changes:r}));return zL({},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=lR(i.current??{},o.current);d&&i.current&&!r(e,l)&&xR(d,o.current,e,l),i.current=l},[l,d,r,o]),[l,u]}function wR(e,t,n,r){var i=CR(e,t,n,r),a=i[0],o=i[1];return[lR(a,t),o]}function TR(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 ER(){var e=K.useRef(!0);return K.useEffect(function(){return e.current=!1,function(){e.current=!0}},[]),e.current}function DR(e,t){return t.changes}var OR={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 kR(e,t,n){var r=e[`default`+bR(t)];return r===void 0?n[t]:r}function AR(e,t,n){var r=e[t];if(r!==void 0)return r;var i=e[`initial`+bR(t)];return i===void 0?kR(e,t,n):i}var jR=nR(function(e,t){aR(e,t)},200);function MR(e,t,n,r){var i=r?.document,a=ER();K.useEffect(function(){!e||a||!i||jR(e(t),i)},n),K.useEffect(function(){return function(){jR.cancel(),oR(i)}},[i])}var NR=zL({},OR,{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}),PR={itemToString:function(e){return e?String(e):``},itemToKey:function(e){return e},stateReducer:DR,scrollIntoView:uR,environment:typeof window>`u`?void 0:window},FR={highlightedIndex:-1,isOpen:!1,selectedItem:null,inputValue:``},IR=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0?K.useLayoutEffect:K.useEffect;function LR(e){return/^\S{1}$/.test(e)}function RR(e){var t=AR(e,`selectedItem`,FR),n=AR(e,`isOpen`,FR),r=qR(e),i=AR(e,`inputValue`,FR);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 zR(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 BR(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 sR;function n(){r.current.isTouchEnd=!1,r.current.isMouseDown=!0}function a(n){r.current.isMouseDown=!1,yR(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&&!yR(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 VR=function(){return sR};function HR(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 IR(function(){t<0||!n||!Object.keys(r.current).length||(s.current===!1?s.current=!0:o(i(t),a))},[t]),s}var UR=sR;function WR(e,t,n){return n===void 0&&(n=!0),zL({isOpen:!1,highlightedIndex:-1},e.items?.length&&t>=0&&zL({selectedItem:e.items[t],isOpen:kR(e,`isOpen`,FR),highlightedIndex:kR(e,`highlightedIndex`,FR)},n&&{inputValue:e.itemToString(e.items[t])}))}function GR(e,t){return e.isOpen===t.isOpen&&e.inputValue===t.inputValue&&e.highlightedIndex===t.highlightedIndex&&e.selectedItem===t.selectedItem}function KR(e){var t=kR(e,`highlightedIndex`,FR);return t>-1&&e.isItemDisabled(e.items[t],t)?-1:t}function qR(e){var t=AR(e,`highlightedIndex`,FR);return t>-1&&e.isItemDisabled(e.items[t],t)?-1:t}function JR(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:zR(t,e,0)};break;case r.FunctionOpenMenu:a={isOpen:!0,highlightedIndex:zR(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:KR(t),isOpen:kR(t,`isOpen`,FR),selectedItem:kR(t,`selectedItem`,FR),inputValue:kR(t,`inputValue`,FR)};break;default:throw Error(`Reducer called without proper action type.`)}return zL({},e,a)}var YR=zL({},NR,{items:$.default.array.isRequired,isItemDisabled:$.default.func}),XR=zL({},PR,{isItemDisabled:function(){return!1}});function ZR(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 QR=0,$R=1,ez=2,tz=3,nz=4,rz=5,iz=6,az=7,oz=8,sz=9,cz=10,lz=11,uz=12,dz=13,fz=14,pz=15,mz=16,hz=17,gz=18,_z=19,vz=20,yz=21,bz=Object.freeze({__proto__:null,FunctionCloseMenu:hz,FunctionOpenMenu:mz,FunctionReset:yz,FunctionSelectItem:_z,FunctionSetHighlightedIndex:gz,FunctionSetInputValue:vz,FunctionToggleMenu:pz,ItemClick:fz,ItemMouseMove:dz,MenuMouseLeave:uz,ToggleButtonBlur:lz,ToggleButtonClick:QR,ToggleButtonKeyDownArrowDown:$R,ToggleButtonKeyDownArrowUp:ez,ToggleButtonKeyDownCharacter:tz,ToggleButtonKeyDownEnd:iz,ToggleButtonKeyDownEnter:az,ToggleButtonKeyDownEscape:nz,ToggleButtonKeyDownHome:rz,ToggleButtonKeyDownPageDown:cz,ToggleButtonKeyDownPageUp:sz,ToggleButtonKeyDownSpaceButton:oz});function xz(e,t,n){var r=n.type,i=n.altKey,a;switch(r){case fz:a={isOpen:kR(t,`isOpen`,FR),highlightedIndex:KR(t),selectedItem:t.items[n.index]};break;case tz:var o=n.key,s=``+e.inputValue+o;a={inputValue:s,highlightedIndex:ZR({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 $R:a={highlightedIndex:e.isOpen?_R(e.highlightedIndex,1,t.items,t.isItemDisabled):i&&e.selectedItem==null?-1:zR(t,e,1),isOpen:!0};break;case ez:a=e.isOpen&&i?WR(t,e.highlightedIndex,!1):{highlightedIndex:e.isOpen?_R(e.highlightedIndex,-1,t.items,t.isItemDisabled):zR(t,e,-1),isOpen:!0};break;case az:case oz:a=WR(t,e.highlightedIndex,!1);break;case rz:a={highlightedIndex:vR(0,!1,t.items,t.isItemDisabled),isOpen:!0};break;case iz:a={highlightedIndex:vR(t.items.length-1,!0,t.items,t.isItemDisabled),isOpen:!0};break;case sz:a={highlightedIndex:_R(e.highlightedIndex,-10,t.items,t.isItemDisabled)};break;case cz:a={highlightedIndex:_R(e.highlightedIndex,10,t.items,t.isItemDisabled)};break;case nz:a={isOpen:!1,highlightedIndex:-1};break;case lz:a=zL({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&t.items?.length&&{selectedItem:t.items[e.highlightedIndex]});break;case _z:a={selectedItem:n.selectedItem};break;default:return JR(e,t,n,bz)}return zL({},e,a)}var Sz=zL({},K).useId,Cz=typeof Sz==`function`?wz:Tz;function wz(e){var t=e.id,n=e.labelId,r=e.menuId,i=e.getItemId,a=e.toggleButtonId,o=e.inputId,s=`downshift-`+Sz();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 Tz(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-`+QL()).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 Ez=[`onClick`],Dz=[`onMouseLeave`,`refKey`,`ref`],Oz=[`onBlur`,`onClick`,`onPress`,`onKeyDown`,`refKey`,`ref`],kz=[`item`,`index`,`onMouseMove`,`onClick`,`onMouseDown`,`onPress`,`refKey`,`disabled`,`ref`];Az.stateChangeTypes=bz;function Az(e){e===void 0&&(e={}),cR(e,Az,YR);var t=zL({},XR,e),n=t.scrollIntoView,r=t.environment,i=t.getA11yStatusMessage,a=wR(xz,t,RR,GR),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=Cz(t),_=$L({state:o,props:t}),v=(0,K.useCallback)(function(e){return m.current[g.getItemId(e)]},[g]);MR(i,o,[c,l,u,d],r);var y=HR({menuElement:p.current,highlightedIndex:l,isOpen:c,itemRefs:m,scrollIntoView:n,getItemNodeFromIndex:v});(0,K.useEffect)(function(){return h.current=fR(function(e){e({type:vz,inputValue:``})},500),function(){h.current.cancel()}},[]),(0,K.useEffect)(function(){d&&h.current(s)},[s,d]),UR({props:t,state:o}),(0,K.useEffect)(function(){AR(t,`isOpen`,FR)&&f.current&&f.current.focus()},[]);var b=BR(r,(0,K.useCallback)(function(){_.current.state.isOpen&&s({type:lz})},[s,_]),(0,K.useMemo)(function(){return[p,f]},[])),x=VR(`getMenuProps`,`getToggleButtonProps`);(0,K.useEffect)(function(){c||(m.current={})},[c]);var S=(0,K.useMemo)(function(){return{ArrowDown:function(e){e.preventDefault(),s({type:$R,altKey:e.altKey})},ArrowUp:function(e){e.preventDefault(),s({type:ez,altKey:e.altKey})},Home:function(e){e.preventDefault(),s({type:rz})},End:function(e){e.preventDefault(),s({type:iz})},Escape:function(){_.current.state.isOpen&&s({type:nz})},Enter:function(e){e.preventDefault(),s({type:_.current.state.isOpen?az:QR})},PageUp:function(e){_.current.state.isOpen&&(e.preventDefault(),s({type:sz}))},PageDown:function(e){_.current.state.isOpen&&(e.preventDefault(),s({type:cz}))}," ":function(e){e.preventDefault();var t=_.current.state;if(!t.isOpen){s({type:QR});return}t.inputValue?s({type:tz,key:` `}):s({type:oz})}}},[s,_]),C=(0,K.useCallback)(function(){s({type:pz})},[s]),w=(0,K.useCallback)(function(){s({type:hz})},[s]),T=(0,K.useCallback)(function(){s({type:mz})},[s]),E=(0,K.useCallback)(function(e){s({type:gz,highlightedIndex:e})},[s]),D=(0,K.useCallback)(function(e){s({type:_z,selectedItem:e})},[s]),O=(0,K.useCallback)(function(){s({type:yz})},[s]),k=(0,K.useCallback)(function(e){s({type:vz,inputValue:e})},[s]),A=(0,K.useCallback)(function(e){var t=e===void 0?{}:e,n=t.onClick,r=RL(t,Ez);return zL({id:g.labelId,htmlFor:g.toggleButtonId,onClick:pR(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=RL(r,Dz),u=(t===void 0?{}:t).suppressRefError;return x(`getMenuProps`,u===void 0?!1:u,o,p),zL((n={},n[o]=mR(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=pR(i,function(){s({type:uz})}),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=RL(r,Oz),p=(t===void 0?{}:t).suppressRefError,m=p===void 0?!1:p,h=_.current.state,v=function(){s({type:QR})},y=function(){h.isOpen&&!b.isMouseDown&&s({type:lz})},C=function(e){var t=gR(e);t&&S[t]?S[t](e):LR(t)&&s({type:tz,key:t})},w=zL((n={},n[l]=mR(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=pR(i,y),n),d);return d.disabled||(w.onClick=pR(a,v),w.onKeyDown=pR(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=RL(n,kz);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=TR(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:dz,index:w,disabled:T}))},D=function(){s({type:fz,index:w})},O=function(e){return e.preventDefault()},k=zL((t={},t[u]=mR(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=pR(o,D)),k.onMouseMove=pR(a,E),k.onMouseDown=pR(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 jz=0,Mz=1,Nz=2,Pz=3,Fz=4,Iz=5,Lz=6,Rz=7,zz=8,Bz=9,Vz=10,Hz=11,Uz=12,Wz=13,Gz=14,Kz=15,qz=16,Jz=17,Yz=18,Xz=19,Zz=20,Qz=21,$z=22,eB=Object.freeze({__proto__:null,ControlledPropUpdatedSelectedItem:$z,FunctionCloseMenu:Jz,FunctionOpenMenu:qz,FunctionReset:Qz,FunctionSelectItem:Xz,FunctionSetHighlightedIndex:Yz,FunctionSetInputValue:Zz,FunctionToggleMenu:Kz,InputBlur:Bz,InputChange:zz,InputClick:Vz,InputKeyDownArrowDown:jz,InputKeyDownArrowUp:Mz,InputKeyDownEnd:Fz,InputKeyDownEnter:Rz,InputKeyDownEscape:Nz,InputKeyDownHome:Pz,InputKeyDownPageDown:Lz,InputKeyDownPageUp:Iz,ItemClick:Wz,ItemMouseMove:Uz,MenuMouseLeave:Hz,ToggleButtonClick:Gz});function tB(e){var t=RR(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)),zL({},t,{inputValue:r})}var nB=zL({},NR,{items:$.default.array.isRequired,isItemDisabled:$.default.func,inputValue:$.default.string,defaultInputValue:$.default.string,initialInputValue:$.default.string,inputId:$.default.string,onInputValueChange:$.default.func});function rB(e,t,n,r){var i=(0,K.useRef)(),a=CR(e,t,n,r),o=a[0],s=a[1],c=ER();return(0,K.useEffect)(function(){hR(t,`selectedItem`)&&(c||t.itemToKey(t.selectedItem)!==t.itemToKey(i.current)&&s({type:$z,inputValue:t.itemToString(t.selectedItem)}),i.current=o.selectedItem===i.current?t.selectedItem:o.selectedItem)},[o.selectedItem,t.selectedItem]),[lR(o,t),s]}var iB=zL({},PR,{isItemDisabled:function(){return!1}});function aB(e,t,n){var r=n.type,i=n.altKey,a;switch(r){case Wz:a={isOpen:kR(t,`isOpen`,FR),highlightedIndex:KR(t),selectedItem:t.items[n.index],inputValue:t.itemToString(t.items[n.index])};break;case jz:a=e.isOpen?{highlightedIndex:_R(e.highlightedIndex,1,t.items,t.isItemDisabled,!0)}:{highlightedIndex:i&&e.selectedItem==null?-1:zR(t,e,1),isOpen:t.items.length>=0};break;case Mz:a=e.isOpen?i?WR(t,e.highlightedIndex):{highlightedIndex:_R(e.highlightedIndex,-1,t.items,t.isItemDisabled,!0)}:{highlightedIndex:zR(t,e,-1),isOpen:t.items.length>=0};break;case Rz:a=WR(t,e.highlightedIndex);break;case Nz:a=zL({isOpen:!1,highlightedIndex:-1},!e.isOpen&&{selectedItem:null,inputValue:``});break;case Iz:a={highlightedIndex:_R(e.highlightedIndex,-10,t.items,t.isItemDisabled,!0)};break;case Lz:a={highlightedIndex:_R(e.highlightedIndex,10,t.items,t.isItemDisabled,!0)};break;case Pz:a={highlightedIndex:vR(0,!1,t.items,t.isItemDisabled)};break;case Fz:a={highlightedIndex:vR(t.items.length-1,!0,t.items,t.isItemDisabled)};break;case Bz:a=zL({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 zz:a={isOpen:!0,highlightedIndex:KR(t),inputValue:n.inputValue};break;case Vz:a={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:zR(t,e,0)};break;case Xz:a={selectedItem:n.selectedItem,inputValue:t.itemToString(n.selectedItem)};break;case $z:a={inputValue:n.inputValue};break;default:return JR(e,t,n,eB)}return zL({},e,a)}var oB=[`onMouseLeave`,`refKey`,`ref`],sB=[`item`,`index`,`refKey`,`ref`,`onMouseMove`,`onMouseDown`,`onClick`,`onPress`,`disabled`],cB=[`onClick`,`onPress`,`refKey`,`ref`],lB=[`onKeyDown`,`onChange`,`onInput`,`onBlur`,`onChangeText`,`onClick`,`refKey`,`ref`];uB.stateChangeTypes=eB;function uB(e){e===void 0&&(e={}),cR(e,uB,nB);var t=zL({},iB,e),n=t.items,r=t.scrollIntoView,i=t.environment,a=t.getA11yStatusMessage,o=rB(aB,t,tB,GR),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),_=ER(),v=Cz(t),y=(0,K.useRef)(),b=$L({state:s,props:t}),x=(0,K.useCallback)(function(e){return m.current[v.getItemId(e)]},[v]);MR(a,s,[l,u,d,f],i);var S=HR({menuElement:p.current,highlightedIndex:u,isOpen:l,itemRefs:m,scrollIntoView:r,getItemNodeFromIndex:x});UR({props:t,state:s}),(0,K.useEffect)(function(){AR(t,`isOpen`,FR)&&h.current&&h.current.focus()},[]),(0,K.useEffect)(function(){_||(y.current=n.length)});var C=BR(i,(0,K.useCallback)(function(){b.current.state.isOpen&&c({type:Bz})},[c,b]),(0,K.useMemo)(function(){return[p,g,h]},[])),w=VR(`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:jz,altKey:e.altKey})},ArrowUp:function(e){e.preventDefault(),c({type:Mz,altKey:e.altKey})},Home:function(e){b.current.state.isOpen&&(e.preventDefault(),c({type:Pz}))},End:function(e){b.current.state.isOpen&&(e.preventDefault(),c({type:Fz}))},Escape:function(e){var t=b.current.state;(t.isOpen||t.inputValue||t.selectedItem||t.highlightedIndex>-1)&&(e.preventDefault(),c({type:Nz}))},Enter:function(e){!b.current.state.isOpen||e.which===229||(e.preventDefault(),c({type:Rz}))},PageUp:function(e){b.current.state.isOpen&&(e.preventDefault(),c({type:Iz}))},PageDown:function(e){b.current.state.isOpen&&(e.preventDefault(),c({type:Lz}))}}},[c,b]),E=(0,K.useCallback)(function(e){return zL({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=RL(r,oB),u=(t===void 0?{}:t).suppressRefError;return w(`getMenuProps`,u===void 0?!1:u,o,p),zL((n={},n[o]=mR(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=pR(i,function(){c({type:Hz})}),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=RL(r,sB);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=TR(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 zL((t={},t[s]=mR(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]=pR(O,function(){c({type:Wz,index:T})}),n),{onMouseMove:pR(u,function(){C.isTouchEnd||T===y.highlightedIndex||(S.current=!1,c({type:Uz,index:T,disabled:E}))}),onMouseDown:pR(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=RL(n,cB),l=b.current.state;return zL((t={},t[a]=mR(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&&zL({},{onClick:pR(r,function(){c({type:Gz})})}),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=RL(r,lB),g=(t===void 0?{}:t).suppressRefError;w(`getInputProps`,g===void 0?!1:g,f,h);var _=b.current.state,y=function(e){var t=gR(e);t&&T[t]&&T[t](e)},x=function(e){c({type:zz,inputValue:e.target.value})},S=function(e){i!=null&&i.document&&_.isOpen&&!C.isMouseDown&&c({type:Bz,selectItem:!(e.relatedTarget===null&&i.document.activeElement!==i.document.body)})},E=function(){c({type:Vz})},D=`onChange`,O={};if(!m.disabled){var k;O=(k={},k[D]=pR(o,s,x),k.onKeyDown=pR(a,y),k.onBlur=pR(l,S),k.onClick=pR(u,E),k)}return zL((n={},n[f]=mR(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:Kz})},[c]),M=(0,K.useCallback)(function(){c({type:Jz})},[c]),N=(0,K.useCallback)(function(){c({type:qz})},[c]),P=(0,K.useCallback)(function(e){c({type:Yz,highlightedIndex:e})},[c]),ee=(0,K.useCallback)(function(e){c({type:Xz,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:Zz,inputValue:e})},[c]),selectItem:ee,reset:(0,K.useCallback)(function(){c({type:Qz})},[c]),highlightedIndex:u,isOpen:l,selectedItem:d,inputValue:f}}var dB={activeIndex:-1,selectedItems:[]};function fB(e,t){return AR(e,t,dB)}function pB(e,t){return kR(e,t,dB)}function mB(e){return{activeIndex:fB(e,`activeIndex`),selectedItems:fB(e,`selectedItems`)}}function hB(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 gB(e,t){return e.selectedItems===t.selectedItems&&e.activeIndex===t.activeIndex}NR.stateReducer,NR.itemToKey,NR.environment,$.default.array,$.default.array,$.default.array,$.default.func,$.default.number,$.default.number,$.default.number,$.default.func,$.default.func,$.default.string,$.default.string;var _B={itemToKey:PR.itemToKey,stateReducer:PR.stateReducer,environment:PR.environment,keyNavigationNext:`ArrowRight`,keyNavigationPrevious:`ArrowLeft`},vB=sR,yB=0,bB=1,xB=2,SB=3,CB=4,wB=5,TB=6,EB=7,DB=8,OB=9,kB=10,AB=11,jB=12,MB=Object.freeze({__proto__:null,DropdownClick:EB,DropdownKeyDownBackspace:TB,DropdownKeyDownNavigationPrevious:wB,FunctionAddSelectedItem:DB,FunctionRemoveSelectedItem:OB,FunctionReset:jB,FunctionSetActiveIndex:AB,FunctionSetSelectedItems:kB,SelectedItemClick:yB,SelectedItemKeyDownBackspace:xB,SelectedItemKeyDownDelete:bB,SelectedItemKeyDownNavigationNext:SB,SelectedItemKeyDownNavigationPrevious:CB});function NB(e,t,n){var r=n.type,i=n.index,a=n.selectedItem,o=e.activeIndex,s=e.selectedItems,c;switch(r){case yB:c={activeIndex:i};break;case CB:c={activeIndex:o-1<0?0:o-1};break;case SB:c={activeIndex:o+1>=s.length?-1:o+1};break;case xB:case bB:if(o<0)break;var l=o;s.length===1?l=-1:o===s.length-1&&(l=s.length-2),c=zL({selectedItems:[].concat(s.slice(0,o),s.slice(o+1))},{activeIndex:l});break;case wB:c={activeIndex:s.length-1};break;case TB:c={selectedItems:s.slice(0,s.length-1)};break;case DB:c={selectedItems:[].concat(s,[a])};break;case EB:c={activeIndex:-1};break;case OB: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 kB:c={selectedItems:n.selectedItems};break;case AB:c={activeIndex:n.activeIndex};break;case jB:c={activeIndex:pB(t,`activeIndex`),selectedItems:pB(t,`selectedItems`)};break;default:throw Error(`Reducer called without proper action type.`)}return zL({},e,c)}var PB=[`refKey`,`ref`,`onClick`,`onKeyDown`,`selectedItem`,`index`],FB=[`refKey`,`ref`,`onKeyDown`,`onClick`,`preventKeyAction`];IB.stateChangeTypes=MB;function IB(e){e===void 0&&(e={}),vB(e,IB);var t=zL({},_B,e),n=t.getA11yStatusMessage,r=t.environment,i=t.keyNavigationNext,a=t.keyNavigationPrevious,o=wR(NB,t,mB,gB),s=o[0],c=o[1],l=s.activeIndex,u=s.selectedItems,d=ER(),f=(0,K.useRef)(null),p=(0,K.useRef)();p.current=[];var m=$L({state:s,props:t});MR(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]),UR({props:t,state:s});var h=VR(`getDropdownProps`),g=(0,K.useMemo)(function(){var e;return e={},e[a]=function(){c({type:CB})},e[i]=function(){c({type:SB})},e.Delete=function(){c({type:bB})},e.Backspace=function(){c({type:xB})},e},[c,i,a]),_=(0,K.useMemo)(function(){var e;return e={},e[a]=function(e){hB(e)&&c({type:wB})},e.Backspace=function(e){hB(e)&&c({type:TB})},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=RL(n,PB),f=m.current.state,h=TR(l,u,f.selectedItems,`Pass either item or index to getSelectedItemProps!`)[1],_=h>-1&&h===f.activeIndex;return zL((t={},t[i]=mR(a,function(e){e&&p.current.push(e)}),t.tabIndex=_?0:-1,t.onClick=pR(o,function(){c({type:yB,index:h})}),t.onKeyDown=pR(s,function(e){var t=gR(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=RL(r,FB),m=(t===void 0?{}:t).suppressRefError;return h(`getDropdownProps`,m===void 0?!1:m,a,f),zL((n={},n[a]=mR(o,function(e){e&&(f.current=e)}),n),!d&&{onKeyDown:pR(s,function(e){var t=gR(e);t&&_[t]&&_[t](e)}),onClick:pR(l,function(){c({type:EB})})},p)},[c,_,h]),addSelectedItem:(0,K.useCallback)(function(e){c({type:DB,selectedItem:e})},[c]),removeSelectedItem:(0,K.useCallback)(function(e){c({type:OB,selectedItem:e})},[c]),setSelectedItems:(0,K.useCallback)(function(e){c({type:kB,selectedItems:e})},[c]),setActiveIndex:(0,K.useCallback)(function(e){c({type:AB,activeIndex:e})},[c]),reset:(0,K.useCallback)(function(){c({type:jB})},[c]),selectedItems:u,activeIndex:l}}var LB=0,RB=1,zB=2,BB=3,VB=4,HB=5,UB=6,WB=Object.freeze({__proto__:null,FunctionAddItem:UB,TagClick:LB,TagGroupKeyDownArrowLeft:RB,TagGroupKeyDownArrowRight:zB,TagGroupKeyDownBackspace:VB,TagGroupKeyDownDelete:BB,TagRemoveClick:HB});function GB(e,t,n){var r=n.type,i;switch(r){case LB:i={activeIndex:n.index};break;case RB:i={activeIndex:e.activeIndex===0?e.items.length-1:e.activeIndex-1};break;case zB:i={activeIndex:e.activeIndex===e.items.length-1?0:e.activeIndex+1};break;case VB:case BB: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 HB: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 UB: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 zL({},e,i)}var KB=zL({},K).useId,qB=typeof KB==`function`?JB:YB;function JB(e){var t=e.id,n=e.tagGroupId,r=e.getTagId,i=`downshift-`+KB();return t||=i,K.useMemo(function(){return{tagGroupId:n??t+`-tag-group`,getTagId:r??function(e){return t+`-tag-`+e}}},[r,t,n])}function YB(e){var t=e.id,n=e.getTagId,r=e.tagGroupId,i=K.useRef(t??`downshift-`+QL()).current;return K.useMemo(function(){return{tagGroupId:r??i+`-tag-group`,getTagId:n??function(e){return i+`-tag-`+e}}},[n,i,r])}function XB(e){var t=e.items??e.initialItems??[];return{activeIndex:e.activeIndex??e.initialActiveIndex??(t.length===0?-1:0),items:t}}function ZB(e,t){return e.activeIndex===t.activeIndex&&e.items===t.items}var QB=`tag-group-a11y-description`;function $B(e,t){K.useEffect(function(){if(e){var n=e.createElement(`div`);return n.setAttribute(`id`,QB),n.style.display=`none`,n.textContent=t,e.body.appendChild(n),function(){n.remove()}}},[t,e])}function eV(e){return zL({stateReducer:function(e,t){return t.changes},environment:typeof window>`u`?void 0:window,removeElementDescription:`Press Delete or Backspace to remove tag.`},e)}function tV(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 nV={isItemDisabled:$.default.func},rV=[`onKeyDown`],iV=[`index`,`refKey`,`ref`,`onClick`],aV=[`index`,`onClick`],oV=function(e){e===void 0&&(e={}),cR(e,oV,nV);var t=eV(e),n=wR(GB,t,XB,ZB),r=n[0],i=n[1],a=r.activeIndex,o=r.items,s=$L({state:r,props:t}),c=qB({getTagId:t.getTagId,id:t.id,tagGroupId:t.tagGroupId});$B(t.environment?.document,t.removeElementDescription);var l=tV(a,o.length,c.getTagId),u=(0,K.useCallback)(function(e){var t=e??{},n=t.onKeyDown,r=RL(t,rV);return zL({id:c.tagGroupId,"aria-live":`polite`,"aria-atomic":`false`,"aria-relevant":`additions`,role:`listbox`,onKeyDown:tR(n,function(e){switch(e.key){case`ArrowLeft`:i({type:RB});break;case`ArrowRight`:i({type:zB});break;case`Delete`:i({type:BB});break;case`Backspace`:i({type:VB});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=RL(e,iV);if(!Number.isInteger(n)||n<0)throw Error(`Pass correct item index to getTagProps!`);var f=s.current.state,p=function(){i({type:LB,index:n})},m=c.getTagId(n);return zL((t={"aria-describedby":QB},t[a]=eR(o,function(e){e&&(l.current[m]=e)}),t[`aria-labelledby`]=m,t.role=`option`,t.id=m,t.onClick=tR(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=RL(e,aV);if(!Number.isInteger(t)||t<0)throw Error(`Pass correct item index to getTagRemoveProps!`);var a=function(e){e.stopPropagation(),i({type:HB,index:t})},o=c.getTagId(t),s=o+`-remove`;return zL({id:s,tabIndex:-1,"aria-labelledby":s+` `+o,onClick:tR(n,a)},r)},[c,i]);return{activeIndex:a,addItem:(0,K.useCallback)(function(e,t){i({type:UB,item:e,index:t})},[i]),getTagGroupProps:u,getTagProps:d,getTagRemoveProps:f,items:o}};oV.stateChangeTypes=WB;function sV({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}=IB({selectedItems:t,onStateChange({selectedItems:e,type:t}){t===IB.stateChangeTypes.FunctionRemoveSelectedItem&&r(e)}}),{isOpen:O,getMenuProps:k,getInputProps:A,getItemProps:j,highlightedIndex:M,setHighlightedIndex:N}=uB({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 uB.stateChangeTypes.InputKeyDownEnter:case uB.stateChangeTypes.ItemClick:return n;case uB.stateChangeTypes.InputKeyDownArrowDown:case uB.stateChangeTypes.InputKeyDownArrowUp:return n;case uB.stateChangeTypes.InputBlur:return n;case uB.stateChangeTypes.FunctionCloseMenu:return{...n,isOpen:!0};case uB.stateChangeTypes.InputKeyDownEscape:return n;case uB.stateChangeTypes.ItemMouseMove:return e;default:return n}},onStateChange({inputValue:e,type:t,selectedItem:n}){switch(t){case uB.stateChangeTypes.InputKeyDownEnter:case uB.stateChangeTypes.ItemClick:n&&(r([n]),d(``));break;case uB.stateChangeTypes.MenuMouseLeave:case uB.stateChangeTypes.ItemMouseMove:break;case uB.stateChangeTypes.InputKeyDownArrowDown:case uB.stateChangeTypes.InputKeyDownArrowUp:break;case uB.stateChangeTypes.InputBlur:break;case uB.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 I=!!s;function ie(){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:!I&&t.length===0?a:``,...e,"aria-describedby":re,disabled:I})}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}),ie()]}),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)(TL,{className:`aone:w-6 aone:h-6 aone:-rotate-45`,icon:kj}),(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=N_(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)(TL,{className:`aone:w-6 aone:h-6`,icon:Nj}),(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 cV({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 lV=s(((e,t)=>{function n(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}t.exports=n})),uV=s(((e,t)=>{t.exports=typeof global==`object`&&global&&global.Object===Object&&global})),dV=s(((e,t)=>{var n=uV(),r=typeof self==`object`&&self&&self.Object===Object&&self;t.exports=n||r||Function(`return this`)()})),fV=s(((e,t)=>{var n=dV();t.exports=function(){return n.Date.now()}})),pV=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})),mV=s(((e,t)=>{var n=pV(),r=/^\s+/;function i(e){return e&&e.slice(0,n(e)+1).replace(r,``)}t.exports=i})),hV=s(((e,t)=>{t.exports=dV().Symbol})),gV=s(((e,t)=>{var n=hV(),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})),_V=s(((e,t)=>{var n=Object.prototype.toString;function r(e){return n.call(e)}t.exports=r})),vV=s(((e,t)=>{var n=hV(),r=gV(),i=_V(),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})),yV=s(((e,t)=>{function n(e){return typeof e==`object`&&!!e}t.exports=n})),bV=s(((e,t)=>{var n=vV(),r=yV(),i=`[object Symbol]`;function a(e){return typeof e==`symbol`||r(e)&&n(e)==i}t.exports=a})),xV=s(((e,t)=>{var n=mV(),r=lV(),i=bV(),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})),SV=u(s(((e,t)=>{var n=lV(),r=fV(),i=xV(),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 CV({departureAirport:e,apiDomain:t,sessionId:n,clickId:r}){let i=new URLSearchParams({departureAirportIATA:e}).toString(),a={};n&&(a[fS]=n),r&&(a[pS]=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 Jg.parse(s)}async function wV(e,t,n,r,i){if(!t)return[];let a=await CV({query:e,departureAirport:t,apiDomain:n,sessionId:r,clickId:i});return a.success?a.data.map(e=>({itemType:am.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 TV({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[fS]=i),a&&(s[pS]=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 um.parse(l)}async function EV(e,t,n,r,i,a){if(!t)return[];let o=await TV({query:e,departureAirport:t,marketingCarrierCodeIATA:n,apiDomain:r,sessionId:i,clickId:a});return o.success?o.data.map(e=>({itemType:am.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 DV(e){return Math.PI/180*e}function OV(e){return e*.621371}function kV(e,t,n,r){let i=DV(n-e),a=DV(r-t),o=Math.sin(i/2)*Math.sin(i/2)+Math.cos(DV(e))*Math.cos(DV(n))*Math.sin(a/2)*Math.sin(a/2);return 6371*(2*Math.atan2(Math.sqrt(o),Math.sqrt(1-o)))}function AV(e,t){if(!Array.isArray(e.types)||!e.types.includes(`place`)||e.itemType!==am.METRO)return!1;let n=M_(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 jV(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=>AV(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=OV(kV(e,t,s.lat,s.lng)),o.nearbyAirports.push(s)}t.add(n)}}return e.filter((e,n)=>!t.has(n))}function MV(e){if(!Array.isArray(e.types)||!e.types.includes(`place`))return;let t=e.kayak?.apicode;if(!t?.trim())return;let n=M_(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 NV({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 PV(e,t=P_.Hotels){if(!e?.length||e.length<3)return[];let n=jV((await NV({query:e,searchType:t})).reduce((e,t)=>{if(t.isMetroOnly){let n=t.rc?.trim();e.push({nearbyAirports:[],itemType:am.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:am.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:am.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=>AV(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=OV(kV(r,a,t.lat,t.lng)),e[n].nearbyAirports.push(i)}else e.push({nearbyAirports:[i],itemType:am.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)MV(e);return n}function FV({key:e,apiDomain:t,airportIATA:n,providersArr:r,airlinesArr:i,debounceTime:a=500,autocompleteType:o=`kayak`}){let{sessionId:s}=fx(),{clickId:c}=by(),[l,u]=(0,K.useState)(``),d=(0,K.useMemo)(()=>(0,SV.default)(u,a),[a]),{data:f,status:p}=ax({queryKey:[e,n,r,i,l,o,s].flat(),queryFn:()=>o===L_.schedule_data&&n?.length&&n?.length===3?wV(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`)?EV(l,n,i[0],t,s,c):PV(l),enabled:!!s});return{data:f,status:p,setQuery:d}}function IV(){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 LV({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 RV({shadowRoot:e,origin:t,theme:n}){let{apiDomain:r}=hx(),[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}=FV({key:`carfare-from-suggest`,apiDomain:r,airportIATA:b}),{data:w,status:T,setQuery:E}=FV({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)(LV,{value:i,onChange:a}),(0,q.jsx)(`div`,{className:`aone:ml-2`,children:(0,q.jsx)(cV,{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)(sV,{shadowRoot:e,dataTestId:`carfare-from-airport`,icon:S===`pending`?(0,q.jsx)(Ny,{}):(0,q.jsx)(IV,{}),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)(sV,{shadowRoot:e,dataTestId:`carfare-to-airport`,icon:T===`pending`?(0,q.jsx)(Ny,{}):(0,q.jsx)(IV,{}),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)(LL,{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)(LL,{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)(IV,{}),(0,q.jsx)(`span`,{children:`Search`})]})})]})]})}var zV=new Vb;function BV({children:e,props:t}){return(0,q.jsx)(Wb,{client:zV,children:(0,q.jsx)(mx,{apiDomain:t.apiDomain,consentAnalytics:t.consentAnalytics,consentAdvertising:t.consentAdvertising,consentFunctional:t.consentFunctional,children:e})})}function VV(e){return!e.origin||e.origin.length!==3?(console.error(`Origin is not a valid IATA code, not rendering widget.`),null):(0,q.jsxs)(BV,{props:e,children:[(0,q.jsx)(`style`,{children:gx}),e.userStyleBlock?(0,q.jsx)(`style`,{children:e.userStyleBlock}):null,(0,q.jsx)(sx,{componentName:`carfare search`,children:(0,q.jsx)(K.Suspense,{fallback:(0,q.jsx)(Ny,{}),children:(0,q.jsx)(RV,{shadowRoot:e.shadowRoot,origin:e.origin,theme:e.theme})})})]})}var HV=[`origin`,`primary-color`,`secondary-color`,`consent-analytics`,`consent-advertising`,`consent-functional`,`theme`,K_,`id`],UV=class extends HTMLElement{_shadowRoot;_mountPoint;_reactRoot;_renderInProgress=!1;_renderQueued=!1;_renderScheduled=!1;_mountTelemetrySent=!1;_lastPublicConfigTelemetryKey=null;static get observedAttributes(){return Array.from(HV)}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=gv(this),t=Sv(),n=null,r=!1,i={attempted:!1,durationMs:0},a;if(e&&t){let t=await Cv(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=kv(n),s=window[rm],c=TS(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,Ay(!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(`${vv}: carfare-search — managed instance config not applied; using host attributes and window defaults.`),this._paintCarfare(c),c.consentAnalytics&&!this._mountTelemetrySent&&(this._mountTelemetrySent=!0,jy(!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&&ev.test(r.primaryColor),s=r.secondaryColor!=null&&ev.test(r.secondaryColor);n.style.setProperty(`--primary`,o?rv(i):i),n.style.setProperty(`--secondary`,s?rv(a):a),r.theme===`dark`?this.setAttribute(`data-mode`,`dark`):this.removeAttribute(`data-mode`),(this._reactRoot??=dv.createRoot(n)).render((0,q.jsx)(VV,{...r}))}};customElements.get(`fma-carfare-search`)||customElements.define(`fma-carfare-search`,UV);function WV(e){return e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase()}function GV(e){return Array.from(new Set([e,e.toLowerCase(),WV(e)]))}function KV(e,t){if(e===void 0)return t;let n=e.trim().toLowerCase();return t?n!==`false`:n===`true`}function qV(e){let t=e.trim();return/^(?:\d+\.?\d*|\.\d+)$/.test(t)?`${t.endsWith(`.`)?t.slice(0,-1):t}px`:t}function JV({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 YV(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 XV(e,t,n,r){let i=`${e}/api/calendar-v2`,a={"Content-Type":`application/json`};n&&(a[fS]=n),r&&(a[pS]=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 cm.parse(s)}function ZV({apiDomain:e,params:t,debounceTime:n=500}){let{sessionId:r}=fx(),{clickId:i}=by(),a=YV(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?Oh(a.startDate,`yyyy-MM-dd`):null,u=a.endDate?Oh(a.endDate,`yyyy-MM-dd`):null,{data:d,status:f}=ax({queryKey:[`flight-calendar`,a.origin,a.destination,a.departureLocationType??am.AIRPORT,a.arrivalLocationType??am.AIRPORT,l,u,a.includePriceInsights?`price-insights-v2`:`no-price-insights`,r],enabled:c&&!!r,queryFn:()=>{let t=Oh(a.startDate,`yyyy-MM-dd`),n=a.endDate?Oh(a.endDate,`yyyy-MM-dd`):void 0,o=sm.safeParse({departureAirport:a.origin.split(`,`)[0]??``,arrivalAirport:a.destination.split(`,`)[0]??``,startDate:t,endDate:n,includePriceInsights:a.includePriceInsights??!1,departureLocationType:a.departureLocationType??am.AIRPORT,arrivalLocationType:a.arrivalLocationType??am.AIRPORT});if(!o.success)throw Error(`Invalid flight-calendar parameters`);return XV(e,o.data,r,i)},refetchOnWindowFocus:!1,refetchOnMount:!1,staleTime:1e3*60*1});return{data:d,status:f}}function QV(){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 $V=s(((e,t)=>{function n(){this.__data__=[],this.size=0}t.exports=n})),eH=s(((e,t)=>{function n(e,t){return e===t||e!==e&&t!==t}t.exports=n})),tH=s(((e,t)=>{var n=eH();function r(e,t){for(var r=e.length;r--;)if(n(e[r][0],t))return r;return-1}t.exports=r})),nH=s(((e,t)=>{var n=tH(),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})),rH=s(((e,t)=>{var n=tH();function r(e){var t=this.__data__,r=n(t,e);return r<0?void 0:t[r][1]}t.exports=r})),iH=s(((e,t)=>{var n=tH();function r(e){return n(this.__data__,e)>-1}t.exports=r})),aH=s(((e,t)=>{var n=tH();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})),oH=s(((e,t)=>{var n=$V(),r=nH(),i=rH(),a=iH(),o=aH();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})),sH=s(((e,t)=>{var n=oH();function r(){this.__data__=new n,this.size=0}t.exports=r})),cH=s(((e,t)=>{function n(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}t.exports=n})),lH=s(((e,t)=>{function n(e){return this.__data__.get(e)}t.exports=n})),uH=s(((e,t)=>{function n(e){return this.__data__.has(e)}t.exports=n})),dH=s(((e,t)=>{var n=vV(),r=lV(),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})),fH=s(((e,t)=>{t.exports=dV()[`__core-js_shared__`]})),pH=s(((e,t)=>{var n=fH(),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})),mH=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})),hH=s(((e,t)=>{var n=dH(),r=pH(),i=lV(),a=mH(),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})),gH=s(((e,t)=>{function n(e,t){return e?.[t]}t.exports=n})),_H=s(((e,t)=>{var n=hH(),r=gH();function i(e,t){var i=r(e,t);return n(i)?i:void 0}t.exports=i})),vH=s(((e,t)=>{t.exports=_H()(dV(),`Map`)})),yH=s(((e,t)=>{t.exports=_H()(Object,`create`)})),bH=s(((e,t)=>{var n=yH();function r(){this.__data__=n?n(null):{},this.size=0}t.exports=r})),xH=s(((e,t)=>{function n(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=+!!t,t}t.exports=n})),SH=s(((e,t)=>{var n=yH(),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})),CH=s(((e,t)=>{var n=yH(),r=Object.prototype.hasOwnProperty;function i(e){var t=this.__data__;return n?t[e]!==void 0:r.call(t,e)}t.exports=i})),wH=s(((e,t)=>{var n=yH(),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})),TH=s(((e,t)=>{var n=bH(),r=xH(),i=SH(),a=CH(),o=wH();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})),EH=s(((e,t)=>{var n=TH(),r=oH(),i=vH();function a(){this.size=0,this.__data__={hash:new n,map:new(i||r),string:new n}}t.exports=a})),DH=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})),OH=s(((e,t)=>{var n=DH();function r(e,t){var r=e.__data__;return n(t)?r[typeof t==`string`?`string`:`hash`]:r.map}t.exports=r})),kH=s(((e,t)=>{var n=OH();function r(e){var t=n(this,e).delete(e);return this.size-=+!!t,t}t.exports=r})),AH=s(((e,t)=>{var n=OH();function r(e){return n(this,e).get(e)}t.exports=r})),jH=s(((e,t)=>{var n=OH();function r(e){return n(this,e).has(e)}t.exports=r})),MH=s(((e,t)=>{var n=OH();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})),NH=s(((e,t)=>{var n=EH(),r=kH(),i=AH(),a=jH(),o=MH();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})),PH=s(((e,t)=>{var n=oH(),r=vH(),i=NH(),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})),FH=s(((e,t)=>{var n=oH(),r=sH(),i=cH(),a=lH(),o=uH(),s=PH();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})),IH=s(((e,t)=>{var n=`__lodash_hash_undefined__`;function r(e){return this.__data__.set(e,n),this}t.exports=r})),LH=s(((e,t)=>{function n(e){return this.__data__.has(e)}t.exports=n})),RH=s(((e,t)=>{var n=NH(),r=IH(),i=LH();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})),zH=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})),BH=s(((e,t)=>{function n(e,t){return e.has(t)}t.exports=n})),VH=s(((e,t)=>{var n=RH(),r=zH(),i=BH(),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})),HH=s(((e,t)=>{t.exports=dV().Uint8Array})),UH=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})),WH=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})),GH=s(((e,t)=>{var n=hV(),r=HH(),i=eH(),a=VH(),o=UH(),s=WH(),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})),KH=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})),qH=s(((e,t)=>{t.exports=Array.isArray})),JH=s(((e,t)=>{var n=KH(),r=qH();function i(e,t,i){var a=t(e);return r(e)?a:n(a,i(e))}t.exports=i})),YH=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})),XH=s(((e,t)=>{function n(){return[]}t.exports=n})),ZH=s(((e,t)=>{var n=YH(),r=XH(),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})),QH=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})),$H=s(((e,t)=>{var n=vV(),r=yV(),i=`[object Arguments]`;function a(e){return r(e)&&n(e)==i}t.exports=a})),eU=s(((e,t)=>{var n=$H(),r=yV(),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`)}})),tU=s(((e,t)=>{function n(){return!1}t.exports=n})),nU=s(((e,t)=>{var n=dV(),r=tU(),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})),rU=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})),iU=s(((e,t)=>{var n=9007199254740991;function r(e){return typeof e==`number`&&e>-1&&e%1==0&&e<=n}t.exports=r})),aU=s(((e,t)=>{var n=vV(),r=iU(),i=yV(),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})),oU=s(((e,t)=>{function n(e){return function(t){return e(t)}}t.exports=n})),sU=s(((e,t)=>{var n=uV(),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{}}()})),cU=s(((e,t)=>{var n=aU(),r=oU(),i=sU(),a=i&&i.isTypedArray;t.exports=a?r(a):n})),lU=s(((e,t)=>{var n=QH(),r=eU(),i=qH(),a=nU(),o=rU(),s=cU(),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})),uU=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})),dU=s(((e,t)=>{function n(e,t){return function(n){return e(t(n))}}t.exports=n})),fU=s(((e,t)=>{t.exports=dU()(Object.keys,Object)})),pU=s(((e,t)=>{var n=uU(),r=fU(),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})),mU=s(((e,t)=>{var n=dH(),r=iU();function i(e){return e!=null&&r(e.length)&&!n(e)}t.exports=i})),hU=s(((e,t)=>{var n=lU(),r=pU(),i=mU();function a(e){return i(e)?n(e):r(e)}t.exports=a})),gU=s(((e,t)=>{var n=JH(),r=ZH(),i=hU();function a(e){return n(e,i,r)}t.exports=a})),_U=s(((e,t)=>{var n=gU(),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})),vU=s(((e,t)=>{t.exports=_H()(dV(),`DataView`)})),yU=s(((e,t)=>{t.exports=_H()(dV(),`Promise`)})),bU=s(((e,t)=>{t.exports=_H()(dV(),`Set`)})),xU=s(((e,t)=>{t.exports=_H()(dV(),`WeakMap`)})),SU=s(((e,t)=>{var n=vU(),r=vH(),i=yU(),a=bU(),o=xU(),s=vV(),c=mH(),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})),CU=s(((e,t)=>{var n=FH(),r=VH(),i=GH(),a=_U(),o=SU(),s=qH(),c=nU(),l=cU(),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})),wU=s(((e,t)=>{var n=CU(),r=yV();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})),TU=s(((e,t)=>{var n=FH(),r=wU(),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})),EU=s(((e,t)=>{var n=lV();function r(e){return e===e&&!n(e)}t.exports=r})),DU=s(((e,t)=>{var n=EU(),r=hU();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})),OU=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})),kU=s(((e,t)=>{var n=TU(),r=DU(),i=OU();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})),AU=s(((e,t)=>{var n=qH(),r=bV(),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})),jU=s(((e,t)=>{var n=NH(),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})),MU=s(((e,t)=>{var n=jU(),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})),NU=s(((e,t)=>{var n=MU(),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})})),PU=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})),FU=s(((e,t)=>{var n=hV(),r=PU(),i=qH(),a=bV(),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})),IU=s(((e,t)=>{var n=FU();function r(e){return e==null?``:n(e)}t.exports=r})),LU=s(((e,t)=>{var n=qH(),r=AU(),i=NU(),a=IU();function o(e,t){return n(e)?e:r(e,t)?[e]:i(a(e))}t.exports=o})),RU=s(((e,t)=>{var n=bV(),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})),zU=s(((e,t)=>{var n=LU(),r=RU();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})),BU=s(((e,t)=>{var n=zU();function r(e,t,r){var i=e==null?void 0:n(e,t);return i===void 0?r:i}t.exports=r})),VU=s(((e,t)=>{function n(e,t){return e!=null&&t in Object(e)}t.exports=n})),HU=s(((e,t)=>{var n=LU(),r=eU(),i=qH(),a=rU(),o=iU(),s=RU();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})),UU=s(((e,t)=>{var n=VU(),r=HU();function i(e,t){return e!=null&&r(e,t,n)}t.exports=i})),WU=s(((e,t)=>{var n=wU(),r=BU(),i=UU(),a=AU(),o=EU(),s=OU(),c=RU(),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})),GU=s(((e,t)=>{function n(e){return e}t.exports=n})),KU=s(((e,t)=>{function n(e){return function(t){return t?.[e]}}t.exports=n})),qU=s(((e,t)=>{var n=zU();function r(e){return function(t){return n(t,e)}}t.exports=r})),JU=s(((e,t)=>{var n=KU(),r=qU(),i=AU(),a=RU();function o(e){return i(e)?n(a(e)):r(e)}t.exports=o})),YU=s(((e,t)=>{var n=kU(),r=WU(),i=GU(),a=qH(),o=JU();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})),XU=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})),ZU=s(((e,t)=>{function n(e){return e!==e}t.exports=n})),QU=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})),$U=s(((e,t)=>{var n=XU(),r=ZU(),i=QU();function a(e,t,a){return t===t?i(e,t,a):n(e,r,a)}t.exports=a})),eW=s(((e,t)=>{var n=$U();function r(e,t){return!!(e!=null&&e.length)&&n(e,t,0)>-1}t.exports=r})),tW=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})),nW=s(((e,t)=>{function n(){}t.exports=n})),rW=s(((e,t)=>{var n=bU(),r=nW(),i=WH();t.exports=n&&1/i(new n([,-0]))[1]==1/0?function(e){return new n(e)}:r})),iW=s(((e,t)=>{var n=RH(),r=eW(),i=tW(),a=BH(),o=rW(),s=WH(),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})),aW=u(s(((e,t)=>{var n=YU(),r=iW();function i(e,t){return e&&e.length?r(e,n(t,2)):[]}t.exports=i}))(),1),oW=new WeakMap,sW=new WeakMap,cW=`data-a1-flight-combobox-open`;function lW(e){let t=sW.get(e);t!=null&&(clearTimeout(t),sW.delete(e));let n=(oW.get(e)??0)+1;oW.set(e,n),e.setAttribute(cW,``)}function uW(e){let t=Math.max(0,(oW.get(e)??0)-1);if(t===0){oW.delete(e);let t=sW.get(e);t!=null&&clearTimeout(t);let n=window.setTimeout(()=>{sW.delete(e),e.removeAttribute(cW)},400);sW.set(e,n)}else oW.set(e,t)}function dW({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}=IB({selectedItems:t,onStateChange({selectedItems:e,type:t}){t===IB.stateChangeTypes.FunctionRemoveSelectedItem&&r(e)}}),{isOpen:N,getMenuProps:P,getInputProps:ee,getItemProps:F,highlightedIndex:te,setHighlightedIndex:ne}=uB({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 uB.stateChangeTypes.InputKeyDownEnter:case uB.stateChangeTypes.ItemClick:case uB.stateChangeTypes.InputKeyDownArrowDown:case uB.stateChangeTypes.InputKeyDownArrowUp:case uB.stateChangeTypes.InputBlur:case uB.stateChangeTypes.InputKeyDownEscape:return n;case uB.stateChangeTypes.ItemMouseMove:return e;case uB.stateChangeTypes.FunctionCloseMenu:return{...n,isOpen:!0};default:return n}},onStateChange({inputValue:e,type:t,selectedItem:n}){switch(t){case uB.stateChangeTypes.InputKeyDownEnter:case uB.stateChangeTypes.ItemClick:n&&(r([n]),d(``));break;case uB.stateChangeTypes.MenuMouseLeave:case uB.stateChangeTypes.ItemMouseMove:case uB.stateChangeTypes.InputKeyDownArrowDown:case uB.stateChangeTypes.InputKeyDownArrowUp:case uB.stateChangeTypes.InputBlur:case uB.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]),I=(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.`,[]),ie=i?`${i}, search airports and places`:`Search airports and places`,ae=i?`${i} suggestions`:`Search results`,oe=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(`, `)}.`})(),se=[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 ce=N&&C.length>0;(0,K.useEffect)(()=>{let e=c?.host;if(e instanceof HTMLElement&&!(!ce||!x))return lW(e),()=>uW(e)},[ce,c,x]);let le=!!s;function ue(e,t){e.pointerType===`touch`&&(e.preventDefault(),e.stopPropagation(),r([t]),d(``),n(``))}function de(){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":ie,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:!le&&t.length===0?a:``,...e,"aria-describedby":se,disabled:le})}let fe=(0,q.jsx)(`ul`,{...P(),ref:p,id:m,role:`listbox`,"aria-multiselectable":`true`,"aria-label":ae,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=>ue(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)(TL,{className:`aone:w-6 aone:h-6 aone:-rotate-45 aone:text-gray-600`,icon:kj}),(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=N_(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=>ue(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)(TL,{className:`aone:w-6 aone:h-6 aone:text-gray-600`,icon:Nj}),(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:oe}),(0,q.jsx)(`span`,{id:_,className:`aone:sr-only`,children:re}),(0,q.jsx)(`span`,{id:v,className:`aone:sr-only`,children:I}),de()]}),N&&C.length>0&&(x?(0,rC.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:fe}),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:fe}))]})}var fW=100;function pW({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,fW)},[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}=IB({selectedItems:t,onStateChange({selectedItems:e,type:t}){t===IB.stateChangeTypes.FunctionRemoveSelectedItem&&r(e)}}),{isOpen:E,getMenuProps:D,getInputProps:O,getItemProps:k,selectedItem:A}=uB({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 uB.stateChangeTypes.InputKeyDownEnter:case uB.stateChangeTypes.ItemClick:n&&(r([n]),l(``));break;case uB.stateChangeTypes.InputChange:{let t=e??``;l(t),h(t);break}case uB.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 lW(e),()=>uW(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)(TL,{icon:Tj,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)(TL,{icon:kj,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 mW(...e){return aj(Ak(e))}function hW({className:e,...t}){return(0,q.jsx)(LS,{role:`status`,"aria-label":`Loading`,className:mW(`aone:size-4 aone:animate-spin`,e),...t})}var gW=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})]})});gW.displayName=`TopLayerDialog`;function _W({...e}){return(0,q.jsx)(sE,{"data-slot":`dialog`,...e})}function vW({...e}){return(0,q.jsx)(cE,{"data-slot":`dialog-portal`,...e})}function yW({className:e,...t}){return(0,q.jsx)(lE,{"data-slot":`dialog-overlay`,className:oj(`aone:fixed aone:inset-0 aone:z-50 aone:bg-black/50 aone:data-[state=closed]:animate-out aone:data-[state=closed]:fade-out-0 aone:data-[state=open]:animate-in aone:data-[state=open]:fade-in-0`,e),...t})}function bW({className:e,children:t,showCloseButton:n=!0,portalContainer:r,overlayClassName:i,...a}){return(0,q.jsxs)(vW,{container:r??void 0,"data-slot":`dialog-portal`,children:[(0,q.jsx)(yW,{className:i}),(0,q.jsxs)(uE,{"data-slot":`dialog-content`,className:oj(`aone:fixed aone:top-[50%] aone:left-[50%] aone:z-50 aone:grid aone:w-full aone:max-w-[calc(100%-2rem)] aone:translate-x-[-50%] aone:translate-y-[-50%] aone:gap-4 aone:rounded-lg aone:border aone:bg-background aone:p-6 aone:shadow-lg aone:duration-200 aone:outline-none 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 aone:sm:max-w-lg`,e),...a,children:[t,n&&(0,q.jsxs)(fE,{"data-slot":`dialog-close`,className:`aone:absolute aone:top-4 aone:right-4 aone:z-60 aone:pointer-events-auto aone:rounded-xs aone:bg-white/90 aone:opacity-70 aone:ring-offset-background aone:transition-opacity aone:hover:opacity-100 aone:focus:outline-hidden aone:disabled:pointer-events-none aone:data-[state=open]:bg-accent aone:data-[state=open]:text-muted-foreground aone:[&_svg]:pointer-events-none aone:[&_svg]:shrink-0 aone:[&_svg:not([class*=size-])]:size-4`,children:[(0,q.jsx)(BS,{}),(0,q.jsx)(`span`,{className:`aone:sr-only`,children:`Close`})]})]})]})}function xW({className:e,...t}){return(0,q.jsx)(dE,{"data-slot":`dialog-title`,className:oj(`aone:text-lg aone:leading-none aone:font-semibold`,e),...t})}function SW({...e}){return(0,q.jsx)(wk,{"data-slot":`popover`,...e})}function CW({className:e,align:t=`center`,sideOffset:n=4,portalContainer:r,...i}){return(0,q.jsx)(Dk,{container:r,children:(0,q.jsx)(Ok,{"data-slot":`popover-content`,align:t,sideOffset:n,className:oj(`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 wW({...e}){return(0,q.jsx)(Tk,{"data-slot":`popover-anchor`,...e})}var TW=768;function EW(){let[e,t]=K.useState(()=>typeof window<`u`&&window.innerWidth<TW);return K.useEffect(()=>{let e=window.matchMedia(`(max-width: ${TW-1}px)`),n=()=>{t(window.innerWidth<TW)};return e.addEventListener(`change`,n),()=>e.removeEventListener(`change`,n)},[]),e}var DW=`aone:text-[#16A34A]`,OW=`aone:text-[#5895F7]`;function kW({date:e,startDate:t,endDate:n,onChange:r,onHover:i,stops:a,onlyDirects:o,previewDate:s,referenceDates:c,minDate:l}){let u=Nm(new Date),d=l||u,f=t?Lm(e,t):!1,p=t&&n?Mh(e,Nm(t))&&Nh(e,n):!1,m=n?Lm(e,n):!1,h=Nh(e,d),g=s&&!f&&!m?Lm(e,s):!1,_=c?.filter(t=>Lm(Nm(e),Nm(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,[DW]:!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,[OW]:!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 AW({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)(Bm(n)),m=Oh(f,`MMMM yyyy`),h=Om(f),g=a?null:i;(0,K.useEffect)(()=>{r&&queueMicrotask(()=>p(Bm(r)))},[r]),(0,K.useEffect)(()=>{t&&queueMicrotask(()=>p(Bm(t)))},[t]),(0,K.useEffect)(()=>{let e=Om(f);s(e,Cm(e,42))},[f,s]);let _=Array(42).fill(0).map((e,t)=>Cm(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(Kg(f,{months:1})),"aria-label":`Previous month, go to ${Oh(Kg(f,{months:1}),`MMMM yyyy`)}`,"data-testid":`calendar-previous-month-button`,children:(0,q.jsx)(_j,{})}),(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(Tm(f,{months:1})),"aria-label":`Next month, go to ${Oh(Tm(f,{months:1}),`MMMM yyyy`)}`,"data-testid":`calendar-next-month-button`,children:(0,q.jsx)(vj,{})})]})}),(0,q.jsx)(`div`,{className:`aone:grid aone:grid-cols-7 aone:border-b`,role:`rowgroup`,"aria-label":`Weekday headers`,children:q_.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=Oh(n,`yyyy-MM-dd`),a=l?.[i];return(0,q.jsx)(kW,{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 jW({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)(TL,{icon:jj,"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 MW=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 zm(c)?Nm(c):null},NW=/^\d{2}\/\d{2}\/\d{2}$/,PW=e=>e.toLocaleDateString(`en-US`,{year:`2-digit`,month:`2-digit`,day:`2-digit`}),FW=(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)}`}},IW=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`)}`},LW=e=>{if(!NW.test(e))return null;let t=Hg(e,`MM/dd/yy`,new Date);return zm(t)&&PW(Nm(t))===e?Nm(t):null};function RW({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,I]=(0,K.useState)(!1),[ie,ae]=(0,K.useState)(!1),[oe]=(0,K.useState)(()=>p||new Date),se=(0,K.useRef)(n),ce=()=>Date.now()<b.current,le=()=>{ce()||F(!0)},ue=()=>{b.current=Date.now()+250,F(!1)},de=e=>{if(e){le();return}ue()};(0,K.useEffect)(()=>{se.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 fe=Nm(new Date),pe=wm(fe,6),me=e=>{w(e);let t=LW(e);if(e===``||!e){O(null),M(null);return}if(!t){O(`Enter a date in MM/DD/YY format`),M(null);return}if(Nh(t,fe)){O(`Date cannot be in the past`),M(null);return}if(Mh(t,pe)){O(`Date must be within 6 months`),M(null);return}if(g&&Nh(t,g)){O(`Date must be no earlier than `+g.toLocaleDateString()),M(null);return}O(null),M(t),ne(t),N&&Nh(N,t)&&(P(null),E(``))},he=e=>{if(i)return;E(e);let t=LW(e);if(e===``||!e){A(null),P(null);return}if(!t){A(`Enter a date in MM/DD/YY format`),P(null);return}if(Nh(t,fe)){A(`Date cannot be in the past`),P(null);return}if(Mh(t,pe)){A(`Date must be within 6 months`),P(null);return}if(!j){A(`Enter departure date first`),P(null);return}if(Nh(t,j)){A(`Return date must be after departure`),P(null);return}if(g&&Nh(t,g)){A(`Date must be no earlier than `+g.toLocaleDateString()),P(null);return}A(null),P(t),ne(t)},ge=()=>me(C),_e=()=>he(T),ve=e=>{let t=e.getTime()<(j?.getTime()||0);j?!N&&t?M(e):N?j&&N&&(Lm(e,j)&&Lm(e,N)?(M(e),P(null)):Nh(e,N)&&Nh(e,Cm(j,3))?M(e):P(e)):i?M(e):P(e):M(e)},ye=()=>{M(null),P(null),w(``),E(``),O(null),A(null),ne(null),se.current(null,null)};(0,K.useEffect)(()=>{se.current(j,N)},[j,N]),(0,K.useEffect)(()=>{queueMicrotask(()=>{j?(w(PW(j)),O(null)):D||w(``)})},[j]),(0,K.useEffect)(()=>{queueMicrotask(()=>{N?(E(PW(N)),A(null)):k||E(``)})},[N]);let L={};o&&(L[`--color-primary`]=o),s&&(L[`--color-secondary`]=s);let be=EW(),R=(0,K.useId)(),xe=`${R}-description`,Se=(0,q.jsxs)(`div`,{ref:y,onClick:le,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)(gj,{})}),(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=FW(e.target.value,C);w(t),O(null),ne(MW(t)),se.current(null,N)},onFocus:()=>{I(!0),le()},onBlur:e=>{let t=IW(e.target.value);w(t),me(t),I(!1)},onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),ge(),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)(jW,{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)(gj,{})}),(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:ie?`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=FW(e.target.value,T);E(t),A(null),ne(MW(t)),se.current(j,null)},onFocus:()=>{ae(!0),le()},onBlur:e=>{let t=IW(e.target.value);E(t),he(t),ae(!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)(jW,{message:k})})]})]})]})]})]});return(0,q.jsxs)(`div`,{id:`A1-DateRangePicker`,ref:v,className:a,style:L,role:`group`,"aria-label":`Date range picker`,"aria-describedby":xe,children:[be?(0,q.jsxs)(_W,{open:ee,onOpenChange:de,children:[Se,(0,q.jsxs)(gW,{className:`ao-dialog--calendar-light`,open:ee,onOpenChange:de,"aria-labelledby":R,"aria-describedby":void 0,children:[(0,q.jsx)(xW,{id:R,className:`aone:sr-only`,children:`Filter Options`}),(0,q.jsx)(AW,{origin:e,destination:t,initialDate:oe,startDate:j,endDate:N,previewDate:te,onChange:ve,onMonthViewChange:r,flightCalendar:u,flightCalendarStatus:d,onlyDirects:f,referenceDates:h,minDate:g},oe.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:ye,"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:ue,"data-testid":`date-range-picker-done-button`,children:`Done`})]})]})]}):(0,q.jsxs)(SW,{open:ee,onOpenChange:de,children:[(0,q.jsx)(wW,{asChild:!0,children:Se}),(0,q.jsxs)(CW,{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)(AW,{origin:e,destination:t,initialDate:oe,startDate:j,endDate:N,previewDate:te,onChange:ve,onMonthViewChange:r,flightCalendar:u,flightCalendarStatus:d,onlyDirects:f,referenceDates:h,minDate:g},oe.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:ye,"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:ue,"data-testid":`date-range-picker-popover-done-button`,children:`Done`})]})]})]}),(0,q.jsx)(`div`,{id:xe,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 zW=W({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:zf([`dark`,`light`]).optional(),defaultNearbyDatesForLowerFares:U().optional(),shadowRoot:Ap(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:Ap(e=>typeof e==`function`).optional(),onDestinationChange:Ap(e=>typeof e==`function`).optional(),fmaDomain:V().optional(),hideBranding:U().optional(),hideCarButton:U().optional(),disableOrigins:U().optional(),disableDestinations:U().optional(),experimentId:V().optional(),autocompleteType:zf(z_).optional(),arrivalAirportLabel:V().optional(),departureAirportLabel:V().optional(),departureDateLabel:V().optional(),returnDateLabel:V().optional(),channel:zf(E_).optional()}),BW=new Vb;function VW(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 HW({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=L_.kayak}){let[O,k]=(0,K.useState)({origins:[],destinations:[],startDate:null,endDate:null,oneWay:!1,defaultNearbyDatesForLowerFares:!!p}),{clickId:A}=by(),j=(0,K.useMemo)(()=>{let e=VW(O.origins);return b(e),e},[O.origins,b]),M=(0,K.useMemo)(()=>{let e=VW(O.destinations);return x(e),e},[O.destinations,x]),N=O.origins[0],P=O.destinations[0],ee=!!(N?.itemType===am.METRO&&N?.iata_code),F=!!(P?.itemType===am.METRO&&P?.iata_code);if(!A_.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!==``),I=i?.split(`,`).map(e=>e.toLocaleUpperCase().trim()).filter(e=>e!==``),ie=i===r&&i?.length===2&&r?.length===2,[ae,oe]=(0,K.useState)(!1),se=ae?!!ne:!!te,ce=ae?!!te:!!ne,[le,ue]=(0,K.useState)(null),[de,fe]=(0,K.useState)(null),pe=(0,K.useMemo)(()=>O.origins?.length&&O.destinations?.length&&O.startDate?O.endDate&&O.oneWay===!1?!0:!(!O.endDate&&O.oneWay===!1):!1,[O]),me=e=>D===L_.schedule_data?(0,q.jsx)(pW,{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)(dW,{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:he,status:ge,setQuery:_e}=FV({key:`origin-suggest`,apiDomain:e,airportIATA:M,providersArr:I,airlinesArr:re,autocompleteType:D}),ve=(0,K.useMemo)(()=>D===L_.schedule_data?he?.map((e,t)=>({...e,sectionIndex:t,type:`airport`,key:e.iata_code||`airport-${t}`}))||[]:(0,aW.default)(he?.filter(e=>!!e.nearbyAirports?.length||e.itemType===am.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:am.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===am.METRO&&r.iata_code)return!0;let i=n.at(t+1);if(!i||i.type!==`airport`)return!1}return!0}),[he,D]),{data:ye,status:L,setQuery:be}=FV({key:`destination-suggest`,apiDomain:e,airportIATA:j,providersArr:I||[],airlinesArr:re||[],autocompleteType:D}),R=(0,K.useMemo)(()=>D===L_.schedule_data?ye?.map((e,t)=>({...e,sectionIndex:t,type:`airport`,key:e.iata_code||`airport-${t}`}))||[]:(0,aW.default)(ye?.filter(e=>!!e.nearbyAirports?.length||e.itemType===am.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:am.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===am.METRO&&r.iata_code)return!0;let i=n.at(t+1);if(!i||i.type!==`airport`)return!1}return!0}),[ye,D]),xe=(0,K.useMemo)(()=>le?Im([le,new Date]):null,[le]),Se=(0,K.useMemo)(()=>O.startDate?Cm(O.startDate,1):null,[O.startDate]),Ce=(0,K.useMemo)(()=>({origin:j,destination:M,startDate:xe||void 0,endDate:de||void 0,departureLocationType:ee?am.METRO:am.AIRPORT,arrivalLocationType:F?am.METRO:am.AIRPORT}),[j,M,xe,de,ee,F]),we=(0,K.useMemo)(()=>({origin:M,destination:j,startDate:Se||void 0,endDate:de||void 0,departureLocationType:F?am.METRO:am.AIRPORT,arrivalLocationType:ee?am.METRO:am.AIRPORT}),[M,j,Se,de,F,ee]),{data:Te,status:Ee}=ZV({apiDomain:e,params:Ce}),{data:De,status:Oe}=ZV({apiDomain:e,params:we});(0,K.useEffect)(()=>{if(te&&NV({query:te,searchType:P_.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?am.METRO:am.AIRPORT};k(n=>({...n,origins:[{...e,type:`airport`,key:t.id,sectionIndex:-1,disabled:T}]}))}}),ne){let e=ne.split(`,`).map(e=>NV({query:e,searchType:P_.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?am.METRO:am.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 ke=(0,K.useCallback)((e,n)=>{k({...O,startDate:e,endDate:n}),(e||n)&&Rv({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]),Ae=(0,K.useCallback)((e,t)=>{ue(t=>t&&t.getTime()===e.getTime()?t:e),fe(e=>e&&e.getTime()===t.getTime()?e:t)},[]),je=()=>{let{origins:e,destinations:t}=O;oe(e=>!e),k({...O,origins:t,destinations:e})},Me=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`]&&!ie){let e=`-flexible-3days`;d+=e,p+=e}let m=r.cabin,b=r.pax,x=$_({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:I?.join(`,`),airlines:re?.join(`,`)},params:{enc_cid:A||``,enc_lid:F_({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?am.METRO:am.AIRPORT,arrival_location_type:F?am.METRO:am.AIRPORT,from_url:encodeURIComponent(window?.location.href)}});Rv({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`)},Ne=[{display:`Roundtrip`,value:`roundtrip`},{display:`One-way`,value:`one-way`}],Pe=[{display:`Economy`,value:J_.enum.economy},{display:`Premium Economy`,value:J_.enum.premium},{display:`Business`,value:J_.enum.business},{display:`First`,value:J_.enum.first}],Fe=Array(9).fill(0).map((e,t)=>{let n=t+1;return{value:Y_.options[t],display:`${n} Traveler${n>1?`s`:``}`}}),Ie=[`Flights`,...w?[]:[`Cars`]],Le=(0,K.useMemo)(()=>h&&ne?.includes(h)?`to`:`from`,[h,ne]),z=(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))}),Re=(0,q.jsx)(cV,{hideByDefault:!0}),ze=(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)(JV,{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:z}),(0,q.jsx)(`div`,{className:`aone:block aone:@2xl:hidden`,children:z}),(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:Re})})]});return(0,q.jsxs)(Wb,{client:BW,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:Me,children:[!C&&ze,(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:Ne.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}`))})]}),!ie&&(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:me({dataTestId:`flight-search-form-origin`,fieldLabel:`Origin`,icon:ge===`pending`?(0,q.jsx)(hW,{}):(0,q.jsx)(TL,{className:`aone:w-6 aone:h-6`,icon:Tj,style:{width:`24px`,height:`24px`}}),placeholder:`From?`,disabled:se,items:ve||[],selectedItems:O.origins,onInputChange:e=>_e(e),onSelectedItemsChange:e=>{let n=T?e?.slice(0,1):e;Rv({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:je,"aria-label":`Switch Origin and Destination`,"data-testid":`flight-search-switch-airports-button`,children:(0,q.jsx)(QV,{})}),(0,q.jsx)(`div`,{className:`aone:flex aone:items-center aone:w-full`,children:me({dataTestId:`flight-search-form-destination-autocomplete`,fieldLabel:`Destination`,icon:L===`pending`?(0,q.jsx)(hW,{}):(0,q.jsx)(TL,{className:`aone:w-6 aone:h-6`,icon:Cj,style:{width:`24px`,height:`24px`}}),placeholder:`To?`,disabled:ce,items:R||[],selectedItems:O.destinations,onInputChange:e=>be(e),onSelectedItemsChange:e=>{let n=E?e?.slice(0,1):e;Rv({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)(RW,{origin:j,destination:M,startDateLabel:c,endDateLabel:l,onChange:ke,onMonthViewChange:Ae,oneWay:O.oneWay,shadowRoot:m,onlyDirects:I&&re&&I?.length>0&&re?.length>0,flightCalendar:!O.startDate||O.oneWay?Te:De,flightCalendarStatus:!O.startDate||O.oneWay?Ee:Oe})}),(0,q.jsxs)(`div`,{className:`aone:flex aone:flex-col aone:gap-6 aone:items-center aone:justify-center aone:@5xl:shrink-0`,children:[!ie&&(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":pe?`Search flights`:`Search flights - Please complete all required fields`,"aria-disabled":!pe,tabIndex:0,type:`submit`,"data-testid":`flight-search-submit-button`,onClick:e=>{pe||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 ${pe?`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)(IV,{}),(0,q.jsx)(`span`,{className:`aone:text-base`,children:`Search`})]})]})]})]})]})}),(0,q.jsx)(`div`,{className:`aone:visible aone:@2xl:hidden`,children:!C&&Re})]})}var UW=Object.keys(zW.shape);function WW(e){typeof e.destination!=`string`&&typeof e.destinations==`string`&&(e.destination=e.destinations),typeof e.destinations!=`string`&&typeof e.destination==`string`&&(e.destinations=e.destination)}function GW(e){return typeof e.destination==`string`&&e.destination.trim()!==``||typeof e.destinations==`string`&&e.destinations.trim()!==``}function KW(e,t){return GV(t).map(t=>e.getAttribute(t)).find(e=>e!==null&&e.trim()!==``)}function qW(e,t,n){let r={...n},i=KW(e,`origin`),a=KW(e,`destination`)??KW(e,`destinations`);WW(r),r.primaryColor==null&&t?.primaryColor&&(r.primaryColor=t.primaryColor),r.secondaryColor==null&&t?.secondaryColor&&(r.secondaryColor=t.secondaryColor);for(let t of UW){let n=GV(t).map(t=>e.getAttribute(t)).find(e=>e!==null&&e.trim()!==``);n!==void 0&&(r[t]=n)}return WW(r),a&&!i?delete r.origin:r.origin==null&&!GW(r)&&t?.iata&&(r.origin=t.iata.toUpperCase()),(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=KV(r.defaultNearbyDatesForLowerFares,!1)),typeof r.consentDataSharing==`string`&&(r.consentDataSharing=KV(r.consentDataSharing,!0)),typeof r.consentFunctional==`string`&&(r.consentFunctional=KV(r.consentFunctional,!0)),typeof r.consentAnalytics==`string`&&(r.consentAnalytics=KV(r.consentAnalytics,!0)),typeof r.consentAdvertising==`string`&&(r.consentAdvertising=KV(r.consentAdvertising,!0)),typeof r.hideCarButton==`string`&&(r.hideCarButton=KV(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 JW(e,t,n,r){return{...qW(e,n,r),apiDomain:t,...r.userStyleBlock?.trim()?{userStyleBlock:r.userStyleBlock}:{}}}var YW=new Vb;function XW(e){let{userStyleBlock:t,...n}=e;return(0,q.jsx)(Wb,{client:YW,children:(0,q.jsxs)(dx,{useSessionStorageOnly:!0,children:[(0,q.jsx)(`style`,{children:gx}),t?(0,q.jsx)(`style`,{children:t}):null,(0,q.jsx)(HW,{...n})]})})}function ZW(e){if(!e||typeof e.iata!=`string`)return;let t=e.iata.trim().toUpperCase();return t.length===3?t:void 0}var QW=Object.keys(zW.shape),$W=[...new Set([...QW.flatMap(e=>GV(e)),`borderradius`,`border-radius`,`theme`,K_,`id`])],eG=class extends HTMLElement{_shadowRoot;_mountPoint;_reactRoot;_renderInProgress=!1;_renderQueued=!1;_renderScheduled=!1;_mountTelemetrySent=!1;_lastPublicConfigTelemetryKey=null;static get observedAttributes(){return Array.from($W)}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=gv(this),t=Sv(),n=null,r=!1,i={attempted:!1,durationMs:0},a;if(e&&t){let t=await Cv(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=jv(n),s=window[rm],c=JW(this,`https://flymyairport.vercel.app`,s,o),l=ZW(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,Ay(!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(`${vv}: airfare-search — managed instance config not applied; using host attributes and window defaults.`),this._paintAirfareSearch(c),c.consentAnalytics&&!this._mountTelemetrySent&&(this._mountTelemetrySent=!0,jy(!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&&ev.test(r.primaryColor),a=r.secondaryColor!=null&&ev.test(r.secondaryColor),o=r.primaryColor??`210 100% 50%`,s=r.secondaryColor??`210 100% 50%`,c=i?rv(o):o,l=a?rv(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`,qV(u)),r.theme===`dark`?this.setAttribute(`data-mode`,`dark`):this.removeAttribute(`data-mode`),(this._reactRoot??=dv.createRoot(n)).render((0,q.jsx)(XW,{...r}))}};customElements.get(`fma-airfare-search`)||customElements.define(`fma-airfare-search`,eG);var tG=new Map,nG=3600*1e3,rG=3600*12*1e3;function iG(){let e=Date.now(),t=e-nG,n=e+rG;return{scheduleWindowStartUtc:new Date(t).toISOString(),scheduleWindowEndUtcExclusive:new Date(n).toISOString()}}function aG(e){let t=e?.scheduleWindowStartUtc?.trim(),n=e?.scheduleWindowEndUtcExclusive?.trim();return t&&n?{scheduleWindowStartUtc:t,scheduleWindowEndUtcExclusive:n}:iG()}function oG(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 sG(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;let i=r.name,a=r.cityName;t[n]={timezoneRegionName:e.trim(),...typeof i==`string`&&i.trim()?{name:i.trim()}:{},...typeof a==`string`&&a.trim()?{cityName:a.trim()}:{}}}return t}function cG(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:lG(n)}function lG(e){if(e.apiVersion!==3||typeof e.instanceId!=`string`||typeof e.iata!=`string`||e.mode!==`arrivals`&&e.mode!==`departures`&&e.mode!==`both`&&e.mode!==`weather`||!Array.isArray(e.arrivals)||!Array.isArray(e.departures)||typeof e.asOfUtc!=`string`)return null;let t=oG(e.airlines);if(!t)return null;let n=sG(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 uG(){return`https://api.airportonellc.com`.replace(/\/+$/,``)}function dG(e,t){return`${e}\0${t.scheduleWindowStartUtc}\0${t.scheduleWindowEndUtcExclusive}`}function fG(e,t){let n=uG();if(!n||!e.trim())return Promise.resolve({data:null,metrics:{attempted:!1,durationMs:0}});let r=aG(t),i=dG(e,r),a=tG.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=cG(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{tG.delete(i)}})();return tG.set(i,u),u}var pG={panelBackgroundColor:`#ffffff`,primaryTextColor:`#0f172a`,accentTextColor:`#0f766e`,mutedTextColor:`#64748b`,headerIconTileBackgroundColor:`#f1f5f9`};function mG(e){let t=e?.trim();return t&&t.length>0?t:void 0}function hG(e,t){let n=e[t];if(typeof n!=`string`)return;let r=n.trim();return r.length>0?r:void 0}function gG(e){let t={...pG};if(!e||typeof e!=`object`||Array.isArray(e))return t;let n=e;return{panelBackgroundColor:hG(n,`panelBackgroundColor`)??t.panelBackgroundColor,primaryTextColor:hG(n,`primaryTextColor`)??t.primaryTextColor,accentTextColor:hG(n,`accentTextColor`)??t.accentTextColor,mutedTextColor:hG(n,`mutedTextColor`)??t.mutedTextColor,headerIconTileBackgroundColor:hG(n,`headerIconTileBackgroundColor`)??t.headerIconTileBackgroundColor}}function _G(e,t={}){let n=e?.variables,r=mG(t.primaryColor),i=mG(t.secondaryColor),a=e=>({...e,accentTextColor:r??e.accentTextColor,headerIconTileBackgroundColor:i??e.headerIconTileBackgroundColor});if(!n||typeof n!=`object`||Array.isArray(n))return a({...pG});let o=n.fids;if(!o||typeof o!=`object`||Array.isArray(o))return a({...pG});let s=o.theme;return a(gG(s))}function vG(e){return`color-mix(in srgb, ${e.trim()} 18%, transparent)`}var yG={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`]},bG={prefix:`fas`,iconName:`bell`,icon:[448,512,[128276,61602],`f0f3`,`M224 0c-17.7 0-32 14.3-32 32l0 3.2C119 50 64 114.6 64 192l0 21.7c0 48.1-16.4 94.8-46.4 132.4L7.8 358.3C2.7 364.6 0 372.4 0 380.5 0 400.1 15.9 416 35.5 416l376.9 0c19.6 0 35.5-15.9 35.5-35.5 0-8.1-2.7-15.9-7.8-22.2l-9.8-12.2C400.4 308.5 384 261.8 384 213.7l0-21.7c0-77.4-55-142-128-156.8l0-3.2c0-17.7-14.3-32-32-32zM162 464c7.1 27.6 32.2 48 62 48s54.9-20.4 62-48l-124 0z`]},xG={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`]};function SG(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 CG(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 wG(e){let{gate:t,terminal:n}=SG(e);return t.length>0||n.length>0}function TG(e,t){let n=t.trim().toUpperCase(),r=e.departure,i=e.arrival,a=CG(r,n),o=CG(i,n),s=!!(r?.airport&&i?.airport);if(e.direction===`departure`){if(a)return wG(r)?r:o&&wG(i)?i:r;if(!a&&o&&wG(i))return i;if(!s||!a&&!o&&!(r?.airport&&i?.airport)){if(wG(r))return r;if(wG(i))return i}return r??i}if(e.direction===`arrival`){if(o)return wG(i)?i:a&&wG(r)?r:i;if(!o&&a&&wG(r))return r;if(!s||!a&&!o&&!(r?.airport&&i?.airport)){if(wG(i))return i;if(wG(r))return r}return i??r}}function EG(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)}function DG(e){let t=e?.utc?.trim()||e?.local?.trim();return t?EG(t):null}function OG(e){return e?DG(e.published)??DG(e.scheduled):null}function kG(e){let t=e.departure?.gateTime,n=e.arrival?.gateTime;if(!t||!n)return null;let r=OG(t),i=OG(n);if(!r||!i)return null;let a=i.getTime()-r.getTime();return a>=0?a:null}function AG(e){let t=e.departure?.gateTime?.actual,n=e.arrival?.gateTime?.actual;if(!t||!n)return null;let r=DG(t),i=DG(n);if(!r||!i)return null;let a=i.getTime()-r.getTime();return a>=0?a:null}function jG(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`}function MG(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}}var NG={kind:`on-time`};function PG(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 FG(e){let t=e?.utc?.trim()||e?.local?.trim();if(!t)return null;let n=EG(t);return n?n.getTime():null}function IG(e){if(!e)return NG;let t=FG(e.estimated),n=FG(e.actual);if(t===null||n===null)return NG;let r=Math.round((n-t)/6e4);return Math.abs(r)<=15?NG:r>0?{kind:`delayed`,minutesDelta:r}:{kind:`early`,minutesDelta:-r}}function LG(e){return e.departureGatePunctuality??NG}function RG(e){return e.arrivalGatePunctuality??NG}function zG(e){if(e.kind===`on-time`)return`On-time`;let t=PG(e.minutesDelta);return e.kind===`early`?`${t} early`:`${t} late`}function BG(e){let t=e.direction===`departure`?LG(e):RG(e),n=t.kind===`on-time`?`on-time`:t.kind===`early`?`early`:`delayed`;return{text:zG(t),tone:n}}function VG(e,t){return e.kind===`on-time`?t.mutedTextColor:e.kind===`early`?`rgb(74, 222, 128)`:`rgb(251, 146, 60)`}function HG(e,t){return e===`on-time`?t.mutedTextColor:e===`early`?`rgb(74, 222, 128)`:e===`delayed`?`rgb(251, 146, 60)`:t.accentTextColor}function UG(e,t){return new Intl.DateTimeFormat(`en-CA`,{year:`numeric`,month:`2-digit`,day:`2-digit`,...t?{timeZone:t}:{}}).format(e)}function WG(e,t){return new Intl.DateTimeFormat(`en-US`,{year:`numeric`,...t?{timeZone:t}:{}}).format(e)}function GG(e,t){if(!e)return`—`;try{let n=EG(e);if(!n)return e;let r=t?.trim()||void 0,i=new Date;if(UG(n,r)===UG(i,r))return n.toLocaleTimeString(void 0,{hour:`numeric`,minute:`2-digit`,...r?{timeZone:r}:{}});let a={month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`,...r?{timeZone:r}:{}};return WG(n,r)!==WG(i,r)&&(a.year=`numeric`),n.toLocaleString(void 0,a)}catch{return e}}function KG(e){return!!(e?.utc?.trim()||e?.local?.trim())}function qG(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 JG(e){if(e)return e.actual?.utc?.trim()||e.actual?.local?.trim()||e.estimated?.utc?.trim()||e.estimated?.local?.trim()||void 0}function YG(e,t){if(e)return GG(e,t)}function XG(e,t){let n=e.departure,r=e.arrival;if(!n&&!r)return null;let i=n?.airport?.iata??n?.airport?.fs??`—`,a=r?.airport?.iata??r?.airport?.fs??`—`,o=t[i.trim().toUpperCase()]?.timezoneRegionName?.trim()||void 0,s=t[a.trim().toUpperCase()]?.timezoneRegionName?.trim()||void 0,c=KG(n?.gateTime?.actual),l=KG(n?.runwayTime?.actual),u=KG(r?.runwayTime?.actual),d=KG(r?.gateTime?.actual),f=e.status?.toUpperCase()??``;f===`ACTIVE`&&(c=!0,l=!0),f===`LANDED`&&(c=!0,l=!0,u=!0);let p=null;return!c&&(KG(n?.gateTime?.estimated)||KG(n?.gateTime?.scheduled))?p=0:!l&&c&&KG(n?.runwayTime?.estimated)?p=1:!u&&l&&KG(r?.runwayTime?.estimated)?p=2:!d&&u&&KG(r?.gateTime?.estimated)&&(p=3),f===`ACTIVE`&&!u&&(p=2),f===`LANDED`&&u&&!d&&(p=3),[{key:`dep-gate`,title:`Gate out`,airport:i,complete:c,current:p===0,timeStr:YG(qG(n?.gateTime),o),punctuality:LG(e)},{key:`dep-rwy`,title:`Takeoff`,airport:i,complete:l,current:p===1,timeStr:YG(JG(n?.runwayTime),o),punctuality:IG(n?.runwayTime)},{key:`arr-rwy`,title:`Landing`,airport:a,complete:u,current:p===2,timeStr:YG(JG(r?.runwayTime),s),punctuality:IG(r?.runwayTime)},{key:`arr-gate`,title:`Gate in`,airport:a,complete:d,current:p===3,timeStr:YG(qG(r?.gateTime),s),punctuality:RG(e)}]}var ZG={gridTemplateColumns:`repeat(4, minmax(0, 1fr))`,columnGap:6},QG=`aone:h-[3px] aone:min-w-0 aone:rounded-sm aone:self-center`,$G=22;function eK({row:e,theme:t,airports:n={}}){let r=XG(e,n);if(!r)return null;let i=r,a=t.accentTextColor,o=vG(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:$G},children:[e===0?(0,q.jsx)(`div`,{className:`aone:min-w-0 aone:flex-1`,"aria-hidden":!0}):(0,q.jsx)(`div`,{className:QG,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:QG,style:{flex:1,minWidth:0,backgroundColor:i[e].complete?a:o,opacity:i[e].complete?1:.45}})]},`track-${t.key}`)}function l(e){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?(0,q.jsx)(`div`,{className:`aone:mt-1.5 aone:text-sm aone:tabular-nums aone:whitespace-nowrap`,style:{color:s},children:e.timeStr}):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:VG(e.punctuality,t),overflowWrap:`break-word`,wordBreak:`normal`},children:zG(e.punctuality)})]})}function u(e){let n=e.key===`dep-rwy`?xG:e.key===`arr-rwy`?yG: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:$G,height:$G,backgroundColor:e.complete?a:`transparent`,border:r},"aria-hidden":!0,children:(0,q.jsx)(TL,{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:$G,height:$G,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:ZG,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:ZG,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 tK(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 nK=[`published`,`scheduled`,`estimated`,`actual`],rK=[`estimated`,`actual`];function iK(e,t){let n=EG(e);if(!n)return e;let r=t?.trim()||void 0;return n.toLocaleString(void 0,{month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`,...r?{timeZone:r}:{}})}function aK(e,t){let n=e?.trim().toUpperCase();if(n)return t[n]?.timezoneRegionName?.trim()||void 0}function oK(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 nK){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 sK(e){if(!e)return!1;let t=e.gateTime,n=e.runwayTime,r=t&&nK.some(e=>t[e]?.utc||t[e]?.local),i=n&&rK.some(e=>n[e]?.utc||n[e]?.local);return!!(r||i)}function cK({phaseLabel:e,pair:t,theme:n,timeZone:r}){if(!t||!t.utc&&!t.local)return null;let i=t.local?.trim(),a=i&&i.length>0&&i!==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?iK(t.utc,r):`—`,a?(0,q.jsxs)(`span`,{style:{color:n.mutedTextColor},children:[` · `,i]}):null]})]})}function lK({title:e,leg:t,theme:n,timeZone:r}){if(!t)return null;let i=t.gateTime,a=t.runwayTime,o=i&&nK.some(e=>i[e]?.utc||i[e]?.local),s=a&&rK.some(e=>a[e]?.utc||a[e]?.local);return!o&&!s?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}),o?(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:nK.map(e=>(0,q.jsx)(cK,{phaseLabel:e.charAt(0).toUpperCase()+e.slice(1),pair:i?.[e],theme:n,timeZone:r},e))})]}):null,s?(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:rK.map(e=>(0,q.jsx)(cK,{phaseLabel:e.charAt(0).toUpperCase()+e.slice(1),pair:a?.[e],theme:n,timeZone:r},e))})]}):null]})}function uK(e,t){let n=t.trim();return n?`${e} · ${n}`:e}function dK({row:e,theme:t}){let n=kG(e),r=AG(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:jG(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:jG(r)})]})]})]})}function fK({row:e,airports:t,theme:n,operatingCarrierName:r}){let i=e.departure?.airport?.iata??e.departure?.airport?.fs??``,a=e.arrival?.airport?.iata??e.arrival?.airport?.fs??``,o=sK(e.departure),s=sK(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:n.primaryTextColor},children:[(0,q.jsx)(`span`,{style:{color:n.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:n.primaryTextColor},children:[(0,q.jsxs)(`span`,{style:{color:n.mutedTextColor},children:[`Operating carrier`,` `]}),r?`${r} (${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:n.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:n.mutedTextColor},children:`Departure · `}),(0,q.jsx)(`span`,{style:{color:VG(LG(e),n),wordBreak:`break-word`,overflowWrap:`break-word`},children:zG(LG(e))})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`span`,{style:{color:n.mutedTextColor},children:`Arrival · `}),(0,q.jsx)(`span`,{style:{color:VG(RG(e),n),wordBreak:`break-word`,overflowWrap:`break-word`},children:zG(RG(e))})]})]})]}),(0,q.jsx)(dK,{row:e,theme:n}),(0,q.jsx)(eK,{row:e,theme:n,airports:t}),(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)(lK,{title:uK(`Departure`,i),leg:e.departure,theme:n,timeZone:aK(i,t)}),(0,q.jsx)(lK,{title:uK(`Arrival`,a),leg:e.arrival,theme:n,timeZone:aK(a,t)})]})]})}function pK(e){let t=e.marketingCarrier??e.operatingCarrier;return t?.iata?t.iata:t?.fs?t.fs:``}function mK(e){let t=pK(e),n=e.flightNumber?.trim();return t&&n?`${t} ${n}`:n||e.flightId}function hK(e){let t=e.marketingCarrier??e.operatingCarrier;return t?.iata?.trim().toUpperCase()||(t?.fs?.trim().toUpperCase()??``)}function gK(e){return e?.iata?.trim().toUpperCase()||(e?.fs?.trim().toUpperCase()??``)}function _K(e,t){let n=hK(e);return n&&t[n]?.name?.trim()||null}function vK(e,t){let n=hK(e);return n&&t[n]?.iconUrl?.trim()||null}function yK(e,t){let n=gK(e);return n&&t[n]?.name?.trim()||null}function bK(e){let t=e.arrival?.baggage?.trim();return t&&t.length>0?t:`—`}function xK(e){return typeof e==`string`?e.trim():typeof e==`number`&&Number.isFinite(e)?String(e):``}function SK(e,t){let n=TG(e,t);return{gate:xK(n?.gate)||`—`,terminal:xK(n?.terminal)||`—`}}function CK(e,t){return xK(TG(e,t)?.terminal).length>0}function wK(e){return e.direction===`arrival`?e.arrival?.gateTime?.scheduled?.utc:e.departure?.gateTime?.scheduled?.utc}function TK(e){let t=e.direction===`departure`?e.departure:e.arrival;return t?.gateTime?.published?.utc??t?.gateTime?.scheduled?.utc}function EK(e){let t=e.direction===`departure`?e.departure:e.arrival;return t?.gateTime?.actual?.utc??t?.gateTime?.estimated?.utc}function DK(e){if(e)return e.replace(/\s+(?:[A-Z]{2,5}|GMT[+-]\d{1,2}(?::?\d{2})?)$/u,``).trim()}function OK(e,t,n){if(e.displayTime){let n=HG(e.displayTime.punctuality,t);return{timeLabel:DK(e.displayTime.label)??e.displayTime.label,scheduledLabel:DK(e.displayTime.scheduledLabel),statusText:e.displayTime.statusLabel,punctualityColor:n}}let r=BG(e),i=GG(TK(e),n),a=GG(EK(e),n);return r.tone!==`on-time`&&i!==`—`&&a!==`—`&&i!==a?{timeLabel:a,scheduledLabel:i,statusText:r.text,punctualityColor:HG(r.tone,t)}:{timeLabel:GG(wK(e),n),statusText:r.text,punctualityColor:HG(r.tone,t)}}function kK(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:`In Flight`,dotStyle:{backgroundColor:`#34d399`},textStyle:{color:a}};case`SCHEDULED`:return{label:`On-time`,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 AK(e){let t=e.trim(),n=t.match(/^#([0-9a-f]{3}|[0-9a-f]{6})$/i),r=t.match(/^rgba?\(\s*(\d{1,3})[\s,]+(\d{1,3})[\s,]+(\d{1,3})/i),i,a,o;if(n){let e=n[1];if(!e)return`#ffffff`;let t=e.length===3?e.split(``).map(e=>`${e}${e}`).join(``):e;i=parseInt(t.slice(0,2),16),a=parseInt(t.slice(2,4),16),o=parseInt(t.slice(4,6),16)}else if(r){let[,e,t,n]=r;if(!e||!t||!n)return`#ffffff`;i=Number(e),a=Number(t),o=Number(n)}else return`#ffffff`;return(.2126*i+.7152*a+.0722*o)/255>.56?`#0f172a`:`#ffffff`}function jK(e,t){let n=e.trim();if(n)return t[n]?.timezoneRegionName?.trim()||t[n.toUpperCase()]?.timezoneRegionName?.trim()||t[n.toLowerCase()]?.timezoneRegionName?.trim()||void 0}function MK(e,t){let n={hour:`numeric`,minute:`2-digit`};t&&(n.timeZone=t);try{return e.toLocaleTimeString(void 0,n)}catch{return e.toLocaleTimeString(void 0,{hour:`numeric`,minute:`2-digit`})}}function NK(e,t){let n=Math.max(e.dueAtMs-e.intervalStartMs,1);return Math.min(Math.max(t-e.intervalStartMs,0),n)/n*100}function PK({title:e,headerPlaneIcon:t,theme:n,dataRefreshSchedule:r,timezoneRegionName:i,timezoneLabel:a}){let o=r===null?``:`${r.intervalStartMs}-${r.dueAtMs}`,[s,c]=(0,K.useState)(()=>new Date);(0,K.useEffect)(()=>{let e=o?250:15e3,t=globalThis.setInterval(()=>c(new Date),e);return()=>globalThis.clearInterval(t)},[o]);let l=s.getTime(),u=MK(s,i),d=r===null?null:NK(r,l);return(0,q.jsxs)(`header`,{part:`fids-board-header`,style:{display:`flex`,alignItems:`flex-start`,justifyContent:`space-between`,gap:12,paddingLeft:20,paddingRight:20,paddingTop:20,paddingBottom:16,boxSizing:`border-box`,width:`100%`},children:[(0,q.jsxs)(`div`,{part:`fids-board-meta`,style:{display:`flex`,alignItems:`center`,gap:16,minWidth:0,flex:1},children:[(0,q.jsx)(`div`,{style:{width:44,height:44,flexShrink:0,display:`flex`,alignItems:`center`,justifyContent:`center`,borderRadius:8,backgroundColor:n.headerIconTileBackgroundColor},"aria-hidden":!0,children:(0,q.jsx)(TL,{icon:t===`departure`?xG:yG,style:{width:22,height:22,color:`#ffffff`}})}),(0,q.jsx)(`h2`,{part:`fids-board-title`,className:`aone:text-xl aone:font-bold aone:leading-tight aone:tracking-tight`,style:{color:n.accentTextColor,margin:0,minWidth:0},children:e})]}),(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:n.accentTextColor,lineHeight:1},children:u}),d===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(d)),"aria-label":`Progress until flights refresh`,style:{width:`100%`,maxWidth:96,height:3,borderRadius:2,backgroundColor:vG(n.primaryTextColor),overflow:`hidden`},children:(0,q.jsx)(`div`,{style:{width:`${d}%`,height:`100%`,borderRadius:2,backgroundColor:n.accentTextColor}})}),a?(0,q.jsxs)(`p`,{part:`fids-board-timezone`,style:{margin:0,fontSize:`0.75rem`,fontWeight:700,color:n.mutedTextColor,letterSpacing:`0.05em`,lineHeight:1},children:[`Time Zone: `,a]}):null]})]})}function FK({rows:e,airlines:t,airports:n,theme:r,boardAirportIata:i,tableSection:a}){let o=vG(r.primaryTextColor),s=(0,K.useRef)(null),[c]=(0,K.useState)(()=>new Set),[l,u]=(0,K.useState)(null),[d,f]=(0,K.useState)(null);(0,K.useEffect)(()=>{let e=s.current;if(!e)return;let t=()=>{f(e.getBoundingClientRect().width)};if(t(),typeof ResizeObserver>`u`)return globalThis.addEventListener(`resize`,t),()=>globalThis.removeEventListener(`resize`,t);let n=new ResizeObserver(e=>{let t=e[0];t&&f(t.contentRect.width)});return n.observe(e),()=>n.disconnect()},[]);let p=d!==null&&d<760,m={width:`100%`,maxWidth:`100%`,paddingLeft:p?12:20,paddingRight:p?12:20,paddingBottom:16,boxSizing:`border-box`},h={display:`grid`,gridTemplateColumns:p?`34px minmax(0, 1fr)`:`38px minmax(180px, 1.35fr) minmax(220px, 1.55fr) minmax(72px, 96px) minmax(188px, 0.95fr)`,alignItems:`center`,gap:p?`14px 10px`:18,width:`100%`,boxSizing:`border-box`,padding:p?`14px`:`16px 18px`,borderRadius:18,backgroundColor:r.panelBackgroundColor,borderWidth:1,borderStyle:`solid`,borderColor:o,boxShadow:`none`,transition:`box-shadow 160ms ease, border-color 160ms ease, transform 160ms ease`},g=a===`arrivals`,_=e.some(e=>CK(e,i)),v=+!!_+1+ +!!g;return(0,q.jsx)(`div`,{ref:s,part:`fids-board-card-list`,style:m,children:e.length===0?(0,q.jsx)(`div`,{part:`fids-board-empty`,className:`aone:py-8 aone:text-center`,style:{color:r.mutedTextColor},children:`No flights in this view.`}):(0,q.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:12},children:e.map(e=>{let a=e.flightId,s=kK(e.status,r),d=_K(e,t),f=vK(e,t),m=e.callsign?.trim()??``,y=yK(e.operatingCarrier,t),b=oK(e),x=c.has(a),S=OK(e,r,aK(i,n)),C=SK(e,i),w=String(s.dotStyle.backgroundColor??r.accentTextColor),T=l===a;return(0,q.jsxs)(K.Fragment,{children:[(0,q.jsxs)(`article`,{part:`fids-board-row-card`,onMouseEnter:()=>u(a),onMouseLeave:()=>u(null),onFocus:()=>u(a),onBlur:()=>u(null),style:{...h,...T?{borderColor:r.accentTextColor,boxShadow:`0 6px 14px rgba(15, 23, 42, 0.06)`,transform:`translateY(-1px)`}:{}},children:[(0,q.jsx)(`span`,{part:`fids-board-row-airline-icon`,"aria-hidden":!f,style:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,width:34,height:34,overflow:`hidden`},children:f?(0,q.jsx)(`img`,{src:f,alt:d?`${d} icon`:``,style:{display:`block`,maxWidth:`100%`,maxHeight:`100%`,width:`auto`,height:`auto`,objectFit:`contain`},loading:`lazy`,decoding:`async`}):null}),(0,q.jsxs)(`div`,{style:{minWidth:0,color:r.primaryTextColor},children:[(0,q.jsx)(`div`,{part:`fids-board-row-endpoint`,style:{fontSize:`1.05rem`,fontWeight:700,lineHeight:1.15,overflowWrap:`break-word`},children:__(e,n)}),(0,q.jsxs)(`div`,{part:`fids-board-row-airline-line`,style:{display:`flex`,flexWrap:`wrap`,alignItems:`baseline`,columnGap:6,rowGap:2,marginTop:4,fontSize:`0.78rem`,lineHeight:1.2,color:r.mutedTextColor},children:[d?(0,q.jsx)(`span`,{style:{fontWeight:700},children:d}):null,(0,q.jsx)(`span`,{className:`aone:tabular-nums`,children:mK(e)}),m?(0,q.jsx)(`span`,{part:`fids-board-row-callsign-inline`,className:`aone:tabular-nums`,title:`Callsign`,children:m}):null]})]}),(0,q.jsxs)(`div`,{part:`fids-board-row-facts`,style:{display:`grid`,gridColumn:p?`1 / -1`:void 0,gridTemplateColumns:`repeat(${v}, minmax(${p?0:72}px, 1fr))`,gap:12,minWidth:0},children:[_?(0,q.jsx)(IK,{label:`Terminal`,value:C.terminal,theme:r}):null,(0,q.jsx)(IK,{label:`Gate`,value:C.gate,theme:r}),g?(0,q.jsx)(IK,{label:`Baggage`,value:bK(e),theme:r}):null]}),(0,q.jsxs)(`div`,{part:`fids-board-row-time`,className:`aone:tabular-nums`,style:{display:`flex`,flexDirection:`column`,gap:2,gridColumn:p?`1 / -1`:void 0,color:r.primaryTextColor,fontWeight:700,fontSize:`1.05rem`,lineHeight:1.1},children:[S.scheduledLabel?(0,q.jsx)(`span`,{style:{color:r.mutedTextColor,fontSize:`0.9rem`,fontWeight:500,textDecorationLine:`line-through`},children:S.scheduledLabel}):null,(0,q.jsx)(`span`,{children:S.timeLabel})]}),(0,q.jsxs)(`div`,{style:{display:`grid`,gridColumn:p?`1 / -1`:void 0,gridTemplateColumns:`minmax(112px, 1fr) 92px`,alignItems:`center`,gap:12,minWidth:0,width:p?`100%`:void 0},children:[(0,q.jsx)(`div`,{part:`fids-board-row-status`,style:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,minHeight:28,padding:`5px 14px`,borderRadius:999,color:AK(w),backgroundColor:w,fontSize:`0.75rem`,fontWeight:800,lineHeight:1,textTransform:`uppercase`,whiteSpace:`nowrap`},children:s.label}),(0,q.jsxs)(`span`,{part:`fids-board-row-notifications`,"aria-label":`Notifications`,title:`Notifications`,style:{display:`inline-flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,gap:6,minWidth:0},children:[(0,q.jsx)(`span`,{style:{color:r.mutedTextColor,fontSize:`0.67rem`,fontWeight:700,letterSpacing:`0.05em`,lineHeight:1,textTransform:`uppercase`,whiteSpace:`nowrap`},children:`Notifications`}),(0,q.jsx)(`span`,{style:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,color:r.headerIconTileBackgroundColor},children:(0,q.jsx)(`span`,{"aria-label":`Flight notifications`,title:`Flight notifications`,style:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,width:24,height:24},children:(0,q.jsx)(TL,{icon:bG,style:{width:14,height:14}})})})]})]})]}),b&&x?(0,q.jsx)(`div`,{part:`fids-board-row-detail`,id:`fids-detail-${a}`,role:`region`,"aria-labelledby":`fids-expand-${a}`,style:{paddingTop:12,paddingBottom:16,paddingLeft:16,paddingRight:16,borderWidth:1,borderStyle:`solid`,borderColor:o,borderLeftWidth:3,borderLeftColor:r.accentTextColor,borderRadius:14,backgroundColor:vG(r.primaryTextColor)},children:(0,q.jsx)(fK,{row:e,airports:n,theme:r,operatingCarrierName:y})}):null]},a)})})})}function IK({label:e,value:t,theme:n}){return(0,q.jsxs)(`div`,{style:{minWidth:0},children:[(0,q.jsx)(`div`,{style:{marginBottom:6,color:n.mutedTextColor,fontSize:`0.67rem`,fontWeight:700,letterSpacing:`0.05em`,textTransform:`uppercase`,whiteSpace:`nowrap`},children:e}),(0,q.jsx)(`div`,{style:{display:`inline-flex`,maxWidth:`100%`,minHeight:24,alignItems:`center`,justifyContent:`center`,padding:`4px 9px`,borderRadius:6,backgroundColor:vG(n.primaryTextColor),color:n.primaryTextColor,fontSize:`0.78rem`,fontWeight:800,lineHeight:1,overflowWrap:`anywhere`},children:t})]})}function LK({modeLabel:e,headerPlaneIcon:t,rows:n,airlines:r,airports:i,theme:a,dataRefreshSchedule:o,boardAirportIata:s,timezoneRegionName:c,timezoneLabel: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:a.panelBackgroundColor,boxShadow:`inset 0 1px 0 rgba(255,255,255,0.06)`},children:[(0,q.jsx)(PK,{title:e,headerPlaneIcon:t,theme:a,dataRefreshSchedule:o,timezoneRegionName:c,timezoneLabel:l}),(0,q.jsx)(FK,{rows:n,airlines:r,airports:i,theme:a,boardAirportIata:s,tableSection:t===`arrival`?`arrivals`:`departures`})]})}function RK({payload:e,loading:t,error:n,consentAnalytics:r,theme:i=pG,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:vG(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.airlines,u=e.airports??{},d=jK(e.iata,u),f=MG(d);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)(LK,{modeLabel:`Flight Departures`,headerPlaneIcon:`departure`,rows:e.departures,airlines:l,airports:u,theme:i,dataRefreshSchedule:a,boardAirportIata:e.iata,timezoneRegionName:d,timezoneLabel:f}),s&&(0,q.jsx)(LK,{modeLabel:`Flight Arrivals`,headerPlaneIcon:`arrival`,rows:e.arrivals,airlines:l,airports:u,theme:i,dataRefreshSchedule:a,boardAirportIata:e.iata,timezoneRegionName:d,timezoneLabel:f}),(0,q.jsxs)(`p`,{part:`fids-board-updated`,className:`aone:mt-3 aone:text-center aone:text-xs`,style:{color:i.mutedTextColor},children:[`Updated `,tK(e.asOfUtc),` · `,e.iata]})]})}function zK(e){return(0,q.jsx)(RK,{...e})}var BK=[`consent-analytics`,`consent-advertising`,`consent-functional`,K_,`id`],VK=12e4,HK=3e4;function UK(e){let t=e?.trim().toLowerCase();if(t===`true`)return!0;if(t===`false`)return!1}function WK(e){let t=e?.variables?.preview;if(!t?.variableOverridesEnabled||!t.variableOverrideValues)return{};let n=t.variableOverrideValues;return{consentAnalytics:UK(n.consentAnalytics),consentAdvertising:UK(n.consentAdvertising),consentFunctional:UK(n.consentFunctional)}}var GK=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=pG;_publicConsentAnalytics;static get observedAttributes(){return Array.from(BK)}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=VK+Math.floor(Math.random()*HK),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=gv(this);if(!e||e!==this._activeInstanceId)return;let t=await fG(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=gv(this),t=Sv(),n=uG(),r=window[rm],i={primaryColor:typeof r?.primaryColor==`string`?r.primaryColor:void 0,secondaryColor:typeof r?.secondaryColor==`string`?r.secondaryColor:void 0};e!==this._activeInstanceId&&(this._clearPoll(),this._activeInstanceId=e,this._flightsCache=null,this._flightsLoading=!0,this._flightsError=!1,this._resolvedTheme=_G(null,i)),this._paint();let a=null,o={attempted:!1,durationMs:0},s;if(e&&t){let t=await Cv(e);o=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),s=`widget_type_mismatch`,n=null),a=n,this._resolvedTheme=_G(a,i),o.attempted&&a===null&&s===void 0&&o.failureKind&&(s=o.failureKind)}else this._resolvedTheme=_G(null,i);if(!this.isConnected)return;let c=WK(a);this._publicConsentAnalytics=c.consentAnalytics;let l=mv(this,`consent-analytics`,c.consentAnalytics),u=!o.attempted&&(!t||!e)?t?`no_instance_id`:`no_api_base`:void 0;if(l){let n=o.attempted?`attempt:${t}|${e}|${a===null?`fail`:`ok`}|${s??``}`:`skip:${u??`none`}`;n!==this._lastPublicConfigTelemetryKey&&(this._lastPublicConfigTelemetryKey=n,Ay(!0,{widget_runtime:`fids-board`,attempted:o.attempted,duration_ms:o.durationMs,ok:o.attempted?a!==null:!1,error_kind:o.attempted&&a===null?s:void 0,skip_reason:u}))}if(a===null&&e&&t&&console.warn(`${vv}: fids-board — managed instance config not applied or wrong type.`),e&&n){let t=await fG(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(),l&&!this._mountTelemetrySent&&(this._mountTelemetrySent=!0,jy(!0,{widget_runtime:`fids-board`,public_config_unavailable:a===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=gx,e.appendChild(t),this._shadowStylesInjected=!0}let t=this._mount??=document.createElement(`span`);t.parentNode!==e&&e.appendChild(t);let n=mv(this,`consent-analytics`,this._publicConsentAnalytics);(this._reactRoot??=dv.createRoot(t)).render((0,q.jsx)(zK,{payload:this._flightsCache,loading:this._flightsLoading,error:this._flightsError,consentAnalytics:n,theme:this._resolvedTheme,dataRefreshSchedule:this._dataRefreshSchedule}))}};customElements.get(`fma-fids-board`)||customElements.define(`fma-fids-board`,GK);var KK=[`plane`,`plane-departure`,`compass`,`earth-americas`,`location-dot`,`suitcase`];function qK(e){if(typeof e!=`string`)return;let t=e.trim().toUpperCase();return/^[A-Z]{3}$/.test(t)?t:void 0}function JK(e){let t=e?.trim().toLowerCase();if(t===`true`)return!0;if(t===`false`)return!1}function YK(e){let t=e?.trim().toLowerCase();if(t===`middle-right`)return`middle-right`;if(t===`bottom-right`)return`bottom-right`}function XK(e){let t=e?.trim().toLowerCase();if(t===`floating`||t===`attached`)return t}function ZK(e){if(typeof e!=`string`)return;let t=e.trim();return/^#[0-9a-fA-F]{6}$/.test(t)?t:void 0}function QK(e){if(typeof e!=`string`)return;let t=e.trim();return t.length>0?t:void 0}function $K(e){let t=e?.trim().toLowerCase();if(t===`text`||t===`icon`||t===`both`)return t}function eq(e){let t=e?.trim().toLowerCase();if(t)return KK.includes(t)?t:void 0}function tq(e){if(!e||e.widgetType!==`flymyairport-fab`)return{};let t={},n=qK(e.iata);n&&(t.iata=n);let r=e.variables?.preview;if(r?.variableOverridesEnabled&&r.variableOverrideValues){let e=r.variableOverrideValues,n=qK(e.iata)??qK(e.sourceIata);n&&(t.iata=n);let i=JK(e.consentAnalytics);i!==void 0&&(t.consentAnalytics=i);let a=JK(e.consentAdvertising);a!==void 0&&(t.consentAdvertising=a);let o=JK(e.consentFunctional);o!==void 0&&(t.consentFunctional=o);let s=QK(e.label);s&&(t.label=s);let c=JK(e.enableCars);c!==void 0&&(t.enableCars=c);let l=JK(e.enableHotels);l!==void 0&&(t.enableHotels=l);let u=JK(e.enablePackages);u!==void 0&&(t.enablePackages=u);let d=YK(e.position);d&&(t.position=d);let f=XK(e.edgeStyle)??XK(e[`edge-style`]);f&&(t.edgeStyle=f);let p=ZK(e.primaryColor);p&&(t.primaryColor=p);let m=ZK(e.secondaryColor);m&&(t.secondaryColor=m);let h=QK(e.airfareSearchWidgetInstanceId)??QK(e[`airfare-search-widget-instance-id`]);h&&(t.airfareSearchWidgetInstanceId=h);let g=$K(e.primaryButtonContent)??$K(e[`primary-button-content`]);g&&(t.primaryButtonContent=g);let _=$K(e.secondaryButtonContent)??$K(e[`secondary-button-content`]);_&&(t.secondaryButtonContent=_);let v=eq(e.primaryIcon)??eq(e[`primary-icon`]);v&&(t.primaryIcon=v)}return r?.stylesEnabled&&r.customStyles?.trim()&&(t.userStyleBlock=r.customStyles),t}function nq(e){return qK(e.sourceIataAttribute)??qK(e.publicIata)??qK(e.globalIata??void 0)}function rq(e){return JK(e.consentAttribute??void 0)??e.publicConsent??!0}function iq(e){return QK(e.labelAttribute)??QK(e.publicLabel)??`Plan your trip`}function aq(e){return JK(e.rawAttribute??void 0)??e.publicToggle??!0}function oq(e){return QK(e.rawAttribute)??QK(e.publicAirfareSearchWidgetInstanceId)}function sq(e){return YK(e.rawAttribute)??e.publicPosition??`bottom-right`}function cq(e){return XK(e.rawAttribute)??e.publicEdgeStyle??`floating`}function lq(e){return $K(e.rawAttribute)??e.publicMode??`both`}function uq(e){return eq(e.rawAttribute)??e.publicIcon??`plane`}function dq(e){return ZK(e.primaryColorAttribute)??ZK(e.publicPrimaryColor)??ZK(e.globalPrimaryColor)??`#b91c1c`}function fq(e){return ZK(e.secondaryColorAttribute)??ZK(e.publicSecondaryColor)??ZK(e.globalSecondaryColor)??`#b91c1c`}function pq(e,t){let n=qK(e);if(!n)throw Error(`Invalid IATA code for vertical URL`);return`https://flymyairport.com/from/${encodeURIComponent(n)}/${t}`}function mq(e,t,n){if(!e||typeof window>`u`)return;let r=window.consentedAnalytics;try{r?.track?.(t,n)}catch{}}var hq=Nk(`aone:inline-flex aone:shrink-0 aone:items-center aone:justify-center aone:gap-2 aone:rounded-md aone:text-sm aone:font-medium aone:whitespace-nowrap aone:transition-all aone:outline-none aone:focus-visible:border-ring aone:focus-visible:ring-[3px] aone:focus-visible:ring-ring/50 aone:disabled:pointer-events-none aone:disabled:opacity-50 aone:aria-invalid:border-destructive aone:aria-invalid:ring-destructive/20 aone:dark:aria-invalid:ring-destructive/40 aone:[&_svg]:pointer-events-none aone:[&_svg]:shrink-0 aone:[&_svg:not([class*=size-])]:size-4`,{variants:{variant:{default:`aone:bg-primary aone:text-primary-foreground aone:hover:bg-primary/90`,destructive:`aone:bg-destructive aone:text-white aone:hover:bg-destructive/90 aone:focus-visible:ring-destructive/20 aone:dark:bg-destructive/60 aone:dark:focus-visible:ring-destructive/40`,outline:`aone:border aone:bg-background aone:shadow-xs aone:hover:bg-accent aone:hover:text-accent-foreground aone:dark:border-input aone:dark:bg-input/30 aone:dark:hover:bg-input/50`,secondary:`aone:bg-secondary aone:text-secondary-foreground aone:hover:bg-secondary/80`,ghost:`aone:hover:bg-accent aone:hover:text-accent-foreground aone:dark:hover:bg-accent/50`,link:`aone:text-primary aone:underline-offset-4 aone:hover:underline`,save:`aone:bg-save aone:text-save-foreground aone:hover:bg-save/90`,success:`aone:bg-success aone:text-success-foreground aone:hover:bg-success/90`},size:{default:`aone:h-9 aone:px-4 aone:py-2 aone:has-[>svg]:px-3`,xs:`aone:h-6 aone:gap-1 aone:rounded-md aone:px-2 aone:text-xs aone:has-[>svg]:px-1.5 aone:[&_svg:not([class*=size-])]:size-3`,sm:`aone:h-8 aone:gap-1.5 aone:rounded-md aone:px-3 aone:has-[>svg]:px-2.5`,lg:`aone:h-10 aone:rounded-md aone:px-6 aone:has-[>svg]:px-4`,icon:`aone:size-9`,"icon-xs":`aone:size-6 aone:rounded-md aone:[&_svg:not([class*=size-])]:size-3`,"icon-sm":`aone:size-8`,"icon-lg":`aone:size-10`}},defaultVariants:{variant:`default`,size:`default`}});function gq({className:e,variant:t=`default`,size:n=`default`,asChild:r=!1,...i}){return(0,q.jsx)(r?GS:`button`,{"data-slot":`button`,"data-variant":t,"data-size":n,className:oj(hq({variant:t,size:n,className:e})),...i})}var _q={plane:kj,"plane-departure":Tj,compass:Mj,"earth-americas":Ej,"location-dot":Nj,suitcase:Dj};function vq({iata:e,consentAnalytics:t,consentAdvertising:n,consentFunctional:r,label:i,enableCars:a,enableHotels:o,enablePackages:s,primaryColor:c,secondaryColor:l,position:u,edgeStyle:d=`floating`,airfareSearchWidgetInstanceId:f,primaryButtonContent:p=`both`,secondaryButtonContent:m=`both`,primaryIcon:h=`plane`,dialogPortalContainer:g,layoutContained:_=!1}){let[v,y]=(0,K.useState)(!1),[b,x]=(0,K.useState)(!1),S=(0,K.useCallback)(()=>{y(!1),mq(t,`Widget FYF Closed`,{iata:e??null})},[t,e]),C=(0,K.useCallback)(()=>{y(!0),mq(t,`Widget FYF Opened`,{iata:e??null})},[t,e]),w=(0,K.useCallback)(()=>{v?S():C()},[S,v,C]);(0,K.useEffect)(()=>{if(!v||b)return;let e=e=>{e.key===`Escape`&&(e.stopPropagation(),S())};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[S,v,b]);let T=n=>{e&&(mq(t,`Widget FYF Vertical Clicked`,{iata:e,vertical:n}),S())},E=()=>{e&&(x(!0),y(!1),mq(t,`Widget FYF Flight Modal Opened`,{iata:e}))},D=[{vertical:`cars`,label:`Cars`,Icon:IS},{vertical:`packages`,label:`Packages`,Icon:zS},{vertical:`hotels`,label:`Hotels`,Icon:FS}].filter(({vertical:e})=>e===`cars`?a:e===`hotels`?o:s),O=p!==`text`,k=p!==`icon`,A=m!==`text`,j=m!==`icon`,M=O&&k?`aone:gap-1.5 aone:sm:gap-2 aone:px-2.5 aone:sm:px-5`:O&&!k?`aone:gap-0 aone:justify-center aone:px-2 aone:sm:px-3`:`aone:gap-0 aone:justify-center aone:px-2.5 aone:sm:px-5`,N=d===`attached`?`aone:right-0`:`aone:right-4`,P=d===`attached`?`aone:rounded-l-full aone:rounded-r-none`:`aone:rounded-full`,ee=A&&j?`aone:justify-start aone:gap-2`:`aone:justify-center aone:gap-0`,F=u===`bottom-right`?`aone:top-auto aone:bottom-4`:`aone:top-0 aone:bottom-0`,te=u===`bottom-right`?`aone:flex aone:flex-col aone:items-end aone:gap-3`:`aone:flex aone:flex-row aone:items-center aone:gap-3`,ne=_?`aone:absolute`:`aone:fixed`,re=(0,K.useMemo)(()=>({right:d===`attached`?`0px`:`var(--fyf-fab-shell-right, 1rem)`,bottom:`var(--fyf-fab-shell-bottom, 1rem)`}),[d]),I=e=>{let t=[`aone:delay-0`,`aone:delay-75`,`aone:delay-100`,`aone:delay-150`,`aone:delay-200`];return[`aone:animate-in`,`aone:fade-in-0`,u===`bottom-right`?`aone:slide-in-from-bottom-4`:`aone:slide-in-from-right-4`,`aone:zoom-in-95`,`aone:duration-250`,`aone:ease-out`,`aone:fill-mode-both`,t[Math.min(e,t.length-1)]??`aone:delay-200`].join(` `)},ie=(0,q.jsxs)(q.Fragment,{children:[v?(0,q.jsx)(`div`,{"aria-hidden":!0,className:`aone:pointer-events-auto ${ne} aone:inset-0 aone:z-90 aone:bg-black/5 aone:animate-in aone:fade-in-0 aone:duration-300 aone:ease-out`,onClick:S,onKeyDown:e=>{e.key===`Escape`&&S()}}):null,(0,q.jsxs)(`div`,{className:`aone:pointer-events-none ${ne} ${F} ${N} ${te} ${b?`aone:z-40`:`aone:z-100`}`,"data-fyf-speed-dial":!0,part:`fab-shell`,style:re,children:[v?(0,q.jsx)(`div`,{className:`aone:pointer-events-auto aone:flex aone:w-max aone:min-w-0 aone:flex-col aone:items-stretch aone:gap-2`,part:`fab-travel-menu`,role:`menu`,"aria-label":`Travel options`,children:e?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(gq,{"aria-label":j?void 0:`Flights`,className:`aone:h-11 aone:w-full aone:rounded-full aone:border-0 aone:px-4 aone:text-sm aone:text-white aone:sm:text-base aone:shadow-md aone:focus-visible:ring-offset-2 ${ee} ${I(0)}`,onClick:E,part:`fab-menu-item`,role:`menuitem`,style:{backgroundColor:l},type:`button`,variant:`default`,children:[A?(0,q.jsx)(RS,{"aria-hidden":!0,className:`aone:size-4 aone:shrink-0 aone:sm:size-5 aone:lg:size-6`}):null,j?`Flights`:null]}),D.map(({vertical:t,label:n,Icon:r},i)=>(0,q.jsx)(gq,{asChild:!0,className:`aone:h-11 aone:w-full aone:rounded-full aone:border-0 aone:px-4 aone:text-sm aone:text-white aone:sm:text-base aone:shadow-md aone:focus-visible:ring-offset-2 ${ee} ${I(i+1)}`,part:`fab-menu-item`,role:`menuitem`,style:{backgroundColor:l},variant:`default`,children:(0,q.jsxs)(`a`,{"aria-label":j?void 0:n,href:pq(e,t),onClick:()=>T(t),rel:`noopener noreferrer`,target:`_blank`,children:[A?(0,q.jsx)(r,{"aria-hidden":!0,className:`aone:size-4 aone:shrink-0 aone:sm:size-5 aone:lg:size-6`}):null,j?n:null]})},t))]}):(0,q.jsxs)(`div`,{className:`aone:w-full aone:max-w-[min(100vw-6rem,20rem)] aone:rounded-full aone:border aone:border-amber-200 aone:bg-amber-50 aone:px-4 aone:py-3 aone:text-sm aone:sm:text-base aone:text-amber-950 aone:shadow-md ${I(0)}`,role:`status`,children:[`Add a valid managed instance id or`,` `,(0,q.jsx)(`code`,{className:`aone:rounded aone:bg-white/80 aone:px-1`,children:`source-iata`}),`.`]})}):null,(0,q.jsxs)(gq,{"aria-expanded":v,"aria-haspopup":`menu`,"aria-label":v?`Close Plan your trip menu`:`Open Plan your trip menu`,className:`aone:pointer-events-auto aone:h-10 aone:sm:h-12 ${P} aone:border-0 aone:bg-[#b91c1c] aone:text-sm aone:text-white aone:sm:text-base aone:shadow-lg aone:transition-[transform,box-shadow] aone:duration-200 aone:ease-out aone:hover:bg-[#991b1b] aone:focus-visible:ring-[#b91c1c] ${M} ${v?`aone:scale-105 aone:shadow-xl`:`aone:scale-100`}`,onClick:w,part:`fab-toggle`,style:{backgroundColor:c},type:`button`,variant:`default`,children:[O?v?(0,q.jsx)(TL,{"aria-hidden":!0,className:`aone:size-4 aone:shrink-0 aone:sm:size-5 aone:lg:size-6`,icon:Oj}):(0,q.jsx)(TL,{"aria-hidden":!0,className:`aone:size-4 aone:shrink-0 aone:sm:size-5 aone:lg:size-6`,icon:_q[h]}):null,k?(0,q.jsx)(`span`,{className:`aone:max-w-38 aone:truncate aone:text-sm aone:font-semibold aone:lg:text-base aone:sm:max-w-44`,children:v?`Close`:i}):null]})]}),(0,q.jsx)(_W,{onOpenChange:n=>{x(n),n||mq(t,`Widget FYF Flight Modal Closed`,{iata:e??null})},open:b,children:(0,q.jsxs)(bW,{"aria-describedby":void 0,className:`a1-visual-viewport-modal aone:top-0 aone:right-0 aone:bottom-0 aone:left-0 aone:m-auto aone:h-fit aone:w-[min(95vw,90rem)] aone:max-w-[min(95vw,90rem)] aone:translate-none aone:gap-0 aone:p-0 aone:sm:max-w-[min(95vw,90rem)]`,overlayClassName:`aone:backdrop-blur-md aone:bg-black/40`,portalContainer:g,children:[(0,q.jsx)(xW,{className:`aone:sr-only`,children:`Find Your Flight`}),(0,q.jsx)(`div`,{className:`aone:p-4`,children:e?(0,K.createElement)(`fma-airfare-search`,{key:`fyf-embed-airfare-${e}`,className:`aone:block aone:w-full`,"consent-analytics":String(t),"consent-advertising":String(n),"consent-functional":String(r),...f?{"data-widget-instance-id":f}:{origin:e}}):(0,q.jsx)(`p`,{className:`aone:p-4 aone:text-sm aone:sm:text-base aone:text-muted-foreground`,children:`Airport code unavailable; cannot load flights.`})})]})})]});return _?(0,q.jsx)(`div`,{className:`aone:relative aone:isolate aone:min-h-[min(20rem,50vh)] aone:w-full`,children:ie}):ie}function yq({shadowRoot:e,userStyleBlock:t,...n}){return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`style`,{children:gx}),t?(0,q.jsx)(`style`,{children:t}):null,(0,q.jsx)(vq,{dialogPortalContainer:e,...n})]})}var bq=[`source-iata`,`primary-color`,`secondary-color`,`consent-analytics`,`consent-advertising`,`consent-functional`,`label`,`enable-cars`,`enable-hotels`,`enable-packages`,`airfare-search-widget-instance-id`,`position`,`edge-style`,`primary-button-content`,`secondary-button-content`,`primary-icon`,K_,`id`,`data-preview-contained`],xq=`--fyf-fab-shell-bottom`,Sq=`--fyf-fab-shell-right`,Cq=`fma-fab`;function wq(e){if(typeof e!=`string`)return null;let t=e.trim();return t?/^-?\d+(\.\d+)?$/.test(t)?`${t}px`:/^-?\d+(\.\d+)?(px|rem|em|vh|vw|%)$/.test(t)?t:null:null}function Tq(e){if(typeof e!=`string`)return;let t=e.trim();if(t)return t.split(Cq).join(`:host`)}var Eq=class extends HTMLElement{_shadowRoot;_mountPoint;_reactRoot;_renderInProgress=!1;_renderQueued=!1;_renderScheduled=!1;static get observedAttributes(){return Array.from(bq)}attributeChangedCallback(e,t,n){t===n||!this.isConnected||this._scheduleRender()}connectedCallback(){this.style.position=`relative`,this.style.display=`contents`,this._scheduleRender()}disconnectedCallback(){this._reactRoot&&=(this._reactRoot.unmount(),void 0)}_scheduleRender(){this._renderScheduled||(this._renderScheduled=!0,queueMicrotask(()=>{this._renderScheduled=!1,this.isConnected&&this._renderAsync()}))}_resolveInstanceId(){return this.getAttribute(K_)?.trim()||this.id?.trim()||null}async _renderAsync(){if(this._renderInProgress){this._renderQueued=!0;return}this._renderInProgress=!0;try{let e=this._resolveInstanceId(),t=Sv(),n=null,r={attempted:!1,durationMs:0};if(e&&t){let t=await Cv(e);r=t.metrics,n=t.config}n?.widgetType&&n.widgetType!==`flymyairport-fab`&&(console.warn(`[airport-one-widgets] Widget instance type does not match flymyairport-fab:`,n.widgetType),n=null);let i=n?.variables?.preview?.stylesEnabled===!0?n.variables.preview.styleVariableValues:void 0,a=wq(i?.shellBottom),o=wq(i?.shellRight);a?this.style.setProperty(xq,a):this.style.removeProperty(xq),o?this.style.setProperty(Sq,o):this.style.removeProperty(Sq);let s=window[rm],c=tq(n),l=Tq(c.userStyleBlock),u=typeof s?.iata==`string`?s.iata:null,d=typeof s?.primaryColor==`string`?s.primaryColor:null,f=typeof s?.secondaryColor==`string`?s.secondaryColor:null,p=nq({sourceIataAttribute:this.getAttribute(`source-iata`),publicIata:c.iata,globalIata:u}),m=rq({consentAttribute:this.getAttribute(`consent-analytics`),publicConsent:c.consentAnalytics}),h=rq({consentAttribute:this.getAttribute(`consent-advertising`),publicConsent:c.consentAdvertising}),g=rq({consentAttribute:this.getAttribute(`consent-functional`),publicConsent:c.consentFunctional}),_=iq({labelAttribute:this.getAttribute(`label`),publicLabel:c.label}),v=aq({rawAttribute:this.getAttribute(`enable-cars`),publicToggle:c.enableCars}),y=aq({rawAttribute:this.getAttribute(`enable-hotels`),publicToggle:c.enableHotels}),b=aq({rawAttribute:this.getAttribute(`enable-packages`),publicToggle:c.enablePackages}),x=sq({rawAttribute:this.getAttribute(`position`),publicPosition:c.position}),S=cq({rawAttribute:this.getAttribute(`edge-style`),publicEdgeStyle:c.edgeStyle}),C=dq({primaryColorAttribute:this.getAttribute(`primary-color`),publicPrimaryColor:c.primaryColor,globalPrimaryColor:d}),w=fq({secondaryColorAttribute:this.getAttribute(`secondary-color`),publicSecondaryColor:c.secondaryColor,globalSecondaryColor:f}),T=oq({rawAttribute:this.getAttribute(`airfare-search-widget-instance-id`),publicAirfareSearchWidgetInstanceId:c.airfareSearchWidgetInstanceId}),E=lq({rawAttribute:this.getAttribute(`primary-button-content`),publicMode:c.primaryButtonContent}),D=lq({rawAttribute:this.getAttribute(`secondary-button-content`),publicMode:c.secondaryButtonContent}),O=uq({rawAttribute:this.getAttribute(`primary-icon`),publicIcon:c.primaryIcon});if(!r.attempted&&(!e||!t)&&n===null&&console.warn(`${vv}: flymyairport-fab — managed config fetch skipped; using element attributes only.`),r.attempted&&n===null&&console.warn(`${vv}: flymyairport-fab — managed config unavailable; using element attributes fallback.`),!this.isConnected)return;this._paint({iata:p,consentAnalytics:m,consentAdvertising:h,consentFunctional:g,label:_,enableCars:v,enableHotels:y,enablePackages:b,position:x,edgeStyle:S,primaryColor:C,secondaryColor:w,airfareSearchWidgetInstanceId:T,primaryButtonContent:E,secondaryButtonContent:D,primaryIcon:O,userStyleBlock:l,layoutContained:this.hasAttribute(`data-preview-contained`)})}finally{this._renderInProgress=!1,this._renderQueued&&(this._renderQueued=!1,queueMicrotask(()=>{this.isConnected&&this._renderAsync()}))}}_paint(e){let t=this._shadowRoot??=this.attachShadow({mode:`closed`}),n=this._mountPoint??=document.createElement(`span`);n.parentNode!==t&&t.appendChild(n),(this._reactRoot??=dv.createRoot(n)).render((0,q.jsx)(yq,{consentAnalytics:e.consentAnalytics,consentAdvertising:e.consentAdvertising,consentFunctional:e.consentFunctional,enableCars:e.enableCars,enableHotels:e.enableHotels,enablePackages:e.enablePackages,airfareSearchWidgetInstanceId:e.airfareSearchWidgetInstanceId,iata:e.iata,label:e.label,layoutContained:e.layoutContained,position:e.position,edgeStyle:e.edgeStyle,primaryColor:e.primaryColor,secondaryColor:e.secondaryColor,primaryButtonContent:e.primaryButtonContent,secondaryButtonContent:e.secondaryButtonContent,primaryIcon:e.primaryIcon,userStyleBlock:e.userStyleBlock,shadowRoot:t}))}};return customElements.get(`fma-fab`)||customElements.define(`fma-fab`,Eq),e.AirfareContent=wS,e.AirfareSearch=eG,e.CarfareSearch=UV,e.FidsBoardElement=GK,e.FlyMyAirportFabElement=Eq,e})({});
|
|
675
|
+
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=fP(n).filter(FI).map(PI),i=WF.begin(`searchPseudoElements`);iI(),Promise.all(r).then(function(){i(),aI(),e()}).catch(function(){i(),aI(),t()})})}}var zI={hooks:function(){return{mutationObserverCallbacks:function(e){return e.pseudoElementsCallback=RI,e}}},provides:function(e){e.pseudoElements2svg=function(e){var t=e.node,n=t===void 0?sM:t;Q.searchPseudoElements&&RI(n)}}},BI=!1,VI={mixout:function(){return{dom:{unwatch:function(){iI(),BI=!0}}}},hooks:function(){return{bootstrap:function(){sI(bF(`mutationObserverCallbacks`,{}))},noAuto:function(){cI()},watch:function(e){var t=e.observeMutationsRoot;BI?aI():sI(bF(`mutationObserverCallbacks`,{observeMutationsRoot:t}))}}}},HI=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})},UI={mixout:function(){return{parse:{transform:function(e){return HI(e)}}}},hooks:function(){return{parseNodeAttributes:function(e,t){var n=t.getAttribute(`data-fa-transform`);return n&&(e.transform=HI(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)}]}]}}}},WI={x:0,y:0,width:`100%`,height:`100%`};function GI(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 KI(e){return e.tag===`g`?e.children:[e]}yF([wP,xI,SI,CI,wI,zI,VI,UI,{hooks:function(){return{parseNodeAttributes:function(e,t){var n=t.getAttribute(`data-fa-mask`),r=n?lF(n.split(` `).map(function(e){return e.trim()})):rF();return r.prefix||=nF(),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=vP({transform:o,containerWidth:l,iconWidth:s}),f={tag:`rect`,attributes:Z(Z({},WI),{},{fill:`white`})},p=c.children?{children:c.children.map(GI)}:{},m={tag:`g`,attributes:Z({},d.inner),children:[GI(Z({tag:c.tag,attributes:Z(Z({},c.attributes),d.path)},p))]},h={tag:`g`,attributes:Z({},d.outer),children:[m]},g=`mask-${a||dP()}`,_=`clip-${a||dP()}`,v={tag:`mask`,attributes:Z(Z({},WI),{},{id:g,maskUnits:`userSpaceOnUse`,maskContentUnits:`userSpaceOnUse`}),children:[f,h]},y={tag:`defs`,children:[{tag:`clipPath`,attributes:{id:_},children:KI(u)},v]};return t.push(y,{tag:`rect`,attributes:Z({fill:`currentColor`,"clip-path":`url(#${_})`,mask:`url(#${g})`},WI)}),{children:t,attributes:n}}}},{provides:function(e){var t=!1;oM.matchMedia&&(t=oM.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:TF}),TF.noAuto;var qI=TF.config;TF.library,TF.dom;var JI=TF.parse;TF.findIconDefinition,TF.toHtml;var YI=TF.icon;TF.layer,TF.text,TF.counter;function XI(e){return e-=0,e===e}function ZI(e){return XI(e)?e:(e=e.replace(/[_-]+(.)?/g,(e,t)=>t?t.toUpperCase():``),e.charAt(0).toLowerCase()+e.slice(1))}var QI=(e,t)=>K.createElement(`stop`,{key:`${t}-${e.offset}`,offset:e.offset,stopColor:e.color,...e.opacity!==void 0&&{stopOpacity:e.opacity}});function $I(e){return e.charAt(0).toUpperCase()+e.slice(1)}var eL=new Map,tL=1e3;function nL(e){if(eL.has(e))return eL.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=ZI(n);t[e.startsWith(`webkit`)?$I(e):e]=r}}}n=a+1}if(eL.size===tL){let e=eL.keys().next().value;e&&eL.delete(e)}return eL.set(e,t),t}function rL(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}}),rL(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=nL(String(t));break;case e.startsWith(`aria-`):case e.startsWith(`data-`):a[e.toLowerCase()]=t;break;default:a[ZI(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(QI)))}return e(t.tag,{...a,...u},...r)}var iL=rL.bind(null,K.createElement),aL=(e,t)=>{let n=(0,K.useId)();return e||(t?n:void 0)},oL=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 sL=`searchPseudoElementsFullScan`in qI&&typeof qI.searchPseudoElementsFullScan==`boolean`?`7.0.0`:`6.0.0`,cL=Number.parseInt(sL)>=7,lL=()=>cL,uL=`fa`,dL={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`},fL={left:`fa-pull-left`,right:`fa-pull-right`},pL={90:`fa-rotate-90`,180:`fa-rotate-180`,270:`fa-rotate-270`},mL={"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`},hL={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`},gL={default:`fa-layers`};function _L(e){let t=qI.cssPrefix||qI.familyPrefix||uL;return t===uL?e:e.replace(new RegExp(String.raw`(?<=^|\s)${uL}-`,`g`),`${t}-`)}function vL(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(dL.beat),n&&x.push(dL.fade),r&&x.push(dL.beatFade),i&&x.push(dL.bounce),a&&x.push(dL.shake),o&&x.push(dL.spin),c&&x.push(dL.spinReverse),s&&x.push(dL.spinPulse),l&&x.push(dL.pulse),u&&x.push(hL.fixedWidth),d&&x.push(hL.inverse),f&&x.push(hL.border),p===!0&&x.push(hL.flip),(p===`horizontal`||p===`both`)&&x.push(hL.flipHorizontal),(p===`vertical`||p===`both`)&&x.push(hL.flipVertical),m!=null&&x.push(mL[m]),h!=null&&h!==0&&x.push(pL[h]),g!=null&&x.push(fL[g]),_&&x.push(hL.swapOpacity),lL()?(v&&x.push(hL.rotateBy),y&&x.push(hL.widthAuto),(qI.cssPrefix||qI.familyPrefix||uL)===uL?x:x.map(_L)):x}var yL=e=>typeof e==`object`&&`icon`in e&&!!e.icon;function bL(e){if(e)return yL(e)?e:JI.icon(e)}function xL(e){return Object.keys(e)}var SL=new oL(`FontAwesomeIcon`),CL={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},wL=new Set(Object.keys(CL)),TL=K.forwardRef((e,t)=>{let n={...CL,...e},{icon:r,mask:i,symbol:a,title:o,titleId:s,maskId:c,transform:l}=n,u=aL(c,!!i),d=aL(s,!!o),f=bL(r);if(!f)return SL.error(`Icon lookup is undefined`,r),null;let p=vL(n),m=typeof l==`string`?JI.transform(l):l,h=bL(i),g=YI(f,{...p.length>0&&{classes:p},...m&&{transform:m},...h&&{mask:h},symbol:a,title:o,titleId:d,maskId:u});if(!g)return SL.error(`Could not find icon`,f),null;let{abstract:_}=g,v={ref:t};for(let e of xL(n))wL.has(e)||(v[e]=n[e]);return iL(_[0],v)});TL.displayName=`FontAwesomeIcon`,`${gL.default}${hL.fixedWidth}`;function EL({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)(TL,{icon:jj,"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 DL=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 zm(c)?Nm(c):null},OL=/^\d{2}\/\d{2}\/\d{2}$/,kL=e=>e.toLocaleDateString(`en-US`,{year:`2-digit`,month:`2-digit`,day:`2-digit`}),AL=(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)}`}},jL=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`)}`},ML=e=>{if(!OL.test(e))return null;let t=Hg(e,`MM/dd/yy`,new Date);return zm(t)&&kL(Nm(t))===e?Nm(t):null};function NL({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,I]=(0,K.useState)(!1),[ie]=(0,K.useState)(()=>p||new Date),ae=(0,K.useRef)(n),oe=(0,K.useRef)(null),se=(0,K.useRef)(null),ce=(0,K.useRef)(null),le=(0,K.useRef)(0),ue=(0,K.useRef)(null),de=(0,K.useRef)(null),fe=()=>Date.now()<le.current,pe=()=>{fe()||P(!0)},me=()=>{le.current=Date.now()+250,P(!1)},he=e=>{if(e){pe();return}me()};(0,K.useEffect)(()=>{ae.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 ge=Nm(new Date),_e=wm(ge,6),ve=e=>{S(e);let t=ML(e);return e===``||!e?(E(null),A(null),!0):t?Nh(t,ge)?(E(`Date cannot be in the past`),A(null),!1):Mh(t,_e)?(E(`Date must be within 6 months`),A(null),!1):g&&Nh(t,g)?(E(`Date must be no earlier than `+g.toLocaleDateString()),A(null),!1):(E(null),A(t),F(t),j&&Nh(j,t)&&(M(null),w(``)),!0):(E(`Enter a date in MM/DD/YY format`),A(null),!1)},ye=e=>{if(i)return!0;w(e);let t=ML(e);return e===``||!e?(O(null),M(null),!0):t?Nh(t,ge)?(O(`Date cannot be in the past`),M(null),!1):Mh(t,_e)?(O(`Date must be within 6 months`),M(null),!1):k?Nh(t,k)?(O(`Return date must be after departure`),M(null),!1):g&&Nh(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)},L=()=>ve(x),be=()=>ye(C),R=e=>{let t=e.getTime()<(k?.getTime()||0);k?!j&&t?A(e):j?k&&j&&(Lm(e,k)&&Lm(e,j)?(A(e),M(null)):Nh(e,j)&&Nh(e,Cm(k,3))?A(e):M(e)):i?A(e):M(e):A(e)},xe=()=>{A(null),M(null),S(``),w(``),E(null),O(null),F(null),ae.current(null,null)};(0,K.useEffect)(()=>{ae.current(k,j)},[k,j]),(0,K.useEffect)(()=>{queueMicrotask(()=>{k?(S(kL(k)),E(null)):T||S(``)})},[k]),(0,K.useEffect)(()=>{queueMicrotask(()=>{j?(w(kL(j)),O(null)):D||w(``)})},[j]);let Se={};o&&(Se[`--color-primary`]=o),s&&(Se[`--color-secondary`]=s);let Ce=hj(),we=(0,K.useId)(),Te=`${we}-description`,Ee=(0,q.jsxs)(`div`,{ref:ce,onClick:pe,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)(gj,{})}),(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=AL(e.target.value,x);S(t),E(null),F(DL(t)),ae.current(null,j)},onFocus:()=>{ne(!0),pe()},onBlur:e=>{let t=jL(e.target.value);S(t);let n=ve(t);ne(!1),!n&&ue.current===`forward`&&requestAnimationFrame(()=>oe.current?.focus()),ue.current=null},onKeyDown:e=>{e.key===`Tab`&&(ue.current=e.shiftKey?`backward`:`forward`),e.key===`Enter`&&(e.preventDefault(),L(),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)(EL,{message:T,buttonRef:oe})})]})]})]}),!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)(gj,{})}),(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=AL(e.target.value,C);w(t),O(null),F(DL(t)),ae.current(k,null)},onFocus:()=>{I(!0),pe()},onBlur:e=>{let t=jL(e.target.value);w(t);let n=ye(t);I(!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(),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)(EL,{message:D,buttonRef:se})})]})]})]})]})]});return(0,q.jsxs)(`div`,{id:`A1-DateRangePicker`,ref:v,className:a,style:Se,role:`group`,"aria-label":`Date range picker`,"aria-describedby":Te,children:[Ce?(0,q.jsxs)(cj,{open:N,onOpenChange:he,children:[Ee,(0,q.jsxs)(sj,{className:`ao-dialog--calendar-light`,open:N,onOpenChange:he,"aria-labelledby":we,"aria-describedby":void 0,children:[(0,q.jsx)(lj,{id:we,className:`aone:sr-only`,children:`Filter Options`}),(0,q.jsx)(Sj,{origin:e,destination:t,initialDate:ie,startDate:k,endDate:j,previewDate:ee,onChange:R,onMonthViewChange:r,flightCalendar:u,flightCalendarStatus:d,onlyDirects:f,referenceDates:h,minDate:g},ie.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:xe,"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:me,"data-testid":`date-range-picker-done-button`,children:`Done`})]})]})]}):(0,q.jsxs)(uj,{open:N,onOpenChange:he,children:[(0,q.jsx)(pj,{asChild:!0,children:Ee}),(0,q.jsxs)(fj,{side:`bottom`,align:`center`,sticky:`always`,avoidCollisions:!1,onOpenAutoFocus:e=>e.preventDefault(),onInteractOutside:e=>{let t=e.target;t&&ce.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)(Sj,{origin:e,destination:t,initialDate:ie,startDate:k,endDate:j,previewDate:ee,onChange:R,onMonthViewChange:r,flightCalendar:u,flightCalendarStatus:d,onlyDirects:f,referenceDates:h,minDate:g},ie.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:xe,"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:me,"data-testid":`date-range-picker-popover-done-button`,children:`Done`})]})]})]}),(0,q.jsx)(`div`,{id:Te,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 PL(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 FL=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}`}),IL=({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)(uj,{open:a,onOpenChange:o,children:[(0,q.jsx)(dj,{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?PL(e):n||`Select time`}),(0,q.jsx)(`div`,{className:`aone:pointer-events-none aone:flex aone:items-center`,children:(0,q.jsx)(TL,{icon:a?wj:Aj,className:`aone:h-4 aone:w-4 aone:text-muted-foreground`})})]})}),(0,q.jsxs)(fj,{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:FL.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:PL(n)},n))})})]})]})};function LL({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)(NL,{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)(IL,{value:n,onChange:i,portalContainer:f})})]})]})}function RL(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 zL(){return zL=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},zL.apply(null,arguments)}var BL=s(((e,t)=>{t.exports=`SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED`})),VL=s(((e,t)=>{var n=BL();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}})),HL=s(((e,t)=>{t.exports=VL()()})),UL=s((e=>{})),WL=s(((e,t)=>{t.exports=UL()})),$=u(HL(),1);WL();var GL=e=>typeof e==`object`&&!!e&&e.nodeType===1,KL=(e,t)=>(!t||e!==`hidden`)&&e!==`visible`&&e!==`clip`,qL=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){let n=getComputedStyle(e,null);return KL(n.overflowY,t)||KL(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},JL=(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,YL=e=>e.parentElement??(e.getRootNode().host||null),XL=(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(!GL(e))throw TypeError(`Invalid target`);let c=document.scrollingElement||document.documentElement,l=[],u=e;for(;GL(u)&&s(u);){if(u=YL(u),u===c){l.push(u);break}u!=null&&u===document.body&&qL(u)&&!qL(document.documentElement)||u!=null&&qL(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&&!qL(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`?JL(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:JL(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`?JL(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:JL(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},ZL=0;function QL(){return String(ZL++)}function $L(e){var t=K.useRef(e);return t.current=e,t}function eR(){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 tR(){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 nR(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 rR=nR(function(e){iR(e).textContent=``},500);function iR(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 aR(e,t){if(!(!e||!t)){var n=iR(t);n.textContent=e,rR(t)}}function oR(e){var t=e?.getElementById(`a11y-status-message`);t&&t.remove()}function sR(){}var cR=sR;function lR(e,t){return t?Object.keys(e).reduce(function(e,n){return t[n]!==void 0&&(e[n]=t[n]),e},zL({},e)):e}function uR(e,t){e&&XL(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 dR(e,t,n){return e===t||t instanceof n.Node&&e.contains&&e.contains(t)}function fR(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 pR(){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 mR(){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 hR(e,t){return e[t]!==void 0}function gR(e){var t=e.key,n=e.keyCode;return n>=37&&n<=40&&t.indexOf(`Arrow`)!==0?`Arrow`+t:t}function _R(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=vR(s,t<0,n,r,i);return c===-1?e>=a?-1:e:c}function vR(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?vR(t?a-1:0,t,n,r):-1}function yR(e,t,n,r){return r===void 0&&(r=!0),n&&t.some(function(t){return t&&(dR(t,e,n)||r&&dR(t,n.document.activeElement,n))})}function bR(e){return``+e.slice(0,1).toUpperCase()+e.slice(1)}function xR(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];SR(l,e,t,n,r),r[l]!==n[l]&&(a[l]=r[l])}t.onStateChange&&Object.keys(a).length&&t.onStateChange(zL({type:i},a))}function SR(e,t,n,r,i){if(i[e]!==r[e]){var a=n[`on`+bR(e)+`Change`];if(typeof a==`function`){var o=t.type;a(zL({type:o},i))}}}function CR(e,t,n,r){var i=K.useRef(null),a=K.useRef(void 0),o=$L(t),s=K.useCallback(function(t,n){a.current=n,t=lR(t,o.current);var r=e(t,o.current,n),i=o.current.stateReducer(t,zL({},n,{changes:r}));return zL({},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=lR(i.current??{},o.current);d&&i.current&&!r(e,l)&&xR(d,o.current,e,l),i.current=l},[l,d,r,o]),[l,u]}function wR(e,t,n,r){var i=CR(e,t,n,r),a=i[0],o=i[1];return[lR(a,t),o]}function TR(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 ER(){var e=K.useRef(!0);return K.useEffect(function(){return e.current=!1,function(){e.current=!0}},[]),e.current}function DR(e,t){return t.changes}var OR={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 kR(e,t,n){var r=e[`default`+bR(t)];return r===void 0?n[t]:r}function AR(e,t,n){var r=e[t];if(r!==void 0)return r;var i=e[`initial`+bR(t)];return i===void 0?kR(e,t,n):i}var jR=nR(function(e,t){aR(e,t)},200);function MR(e,t,n,r){var i=r?.document,a=ER();K.useEffect(function(){!e||a||!i||jR(e(t),i)},n),K.useEffect(function(){return function(){jR.cancel(),oR(i)}},[i])}var NR=zL({},OR,{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}),PR={itemToString:function(e){return e?String(e):``},itemToKey:function(e){return e},stateReducer:DR,scrollIntoView:uR,environment:typeof window>`u`?void 0:window},FR={highlightedIndex:-1,isOpen:!1,selectedItem:null,inputValue:``},IR=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0?K.useLayoutEffect:K.useEffect;function LR(e){return/^\S{1}$/.test(e)}function RR(e){var t=AR(e,`selectedItem`,FR),n=AR(e,`isOpen`,FR),r=qR(e),i=AR(e,`inputValue`,FR);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 zR(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 BR(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 sR;function n(){r.current.isTouchEnd=!1,r.current.isMouseDown=!0}function a(n){r.current.isMouseDown=!1,yR(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&&!yR(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 VR=function(){return sR};function HR(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 IR(function(){t<0||!n||!Object.keys(r.current).length||(s.current===!1?s.current=!0:o(i(t),a))},[t]),s}var UR=sR;function WR(e,t,n){return n===void 0&&(n=!0),zL({isOpen:!1,highlightedIndex:-1},e.items?.length&&t>=0&&zL({selectedItem:e.items[t],isOpen:kR(e,`isOpen`,FR),highlightedIndex:kR(e,`highlightedIndex`,FR)},n&&{inputValue:e.itemToString(e.items[t])}))}function GR(e,t){return e.isOpen===t.isOpen&&e.inputValue===t.inputValue&&e.highlightedIndex===t.highlightedIndex&&e.selectedItem===t.selectedItem}function KR(e){var t=kR(e,`highlightedIndex`,FR);return t>-1&&e.isItemDisabled(e.items[t],t)?-1:t}function qR(e){var t=AR(e,`highlightedIndex`,FR);return t>-1&&e.isItemDisabled(e.items[t],t)?-1:t}function JR(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:zR(t,e,0)};break;case r.FunctionOpenMenu:a={isOpen:!0,highlightedIndex:zR(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:KR(t),isOpen:kR(t,`isOpen`,FR),selectedItem:kR(t,`selectedItem`,FR),inputValue:kR(t,`inputValue`,FR)};break;default:throw Error(`Reducer called without proper action type.`)}return zL({},e,a)}var YR=zL({},NR,{items:$.default.array.isRequired,isItemDisabled:$.default.func}),XR=zL({},PR,{isItemDisabled:function(){return!1}});function ZR(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 QR=0,$R=1,ez=2,tz=3,nz=4,rz=5,iz=6,az=7,oz=8,sz=9,cz=10,lz=11,uz=12,dz=13,fz=14,pz=15,mz=16,hz=17,gz=18,_z=19,vz=20,yz=21,bz=Object.freeze({__proto__:null,FunctionCloseMenu:hz,FunctionOpenMenu:mz,FunctionReset:yz,FunctionSelectItem:_z,FunctionSetHighlightedIndex:gz,FunctionSetInputValue:vz,FunctionToggleMenu:pz,ItemClick:fz,ItemMouseMove:dz,MenuMouseLeave:uz,ToggleButtonBlur:lz,ToggleButtonClick:QR,ToggleButtonKeyDownArrowDown:$R,ToggleButtonKeyDownArrowUp:ez,ToggleButtonKeyDownCharacter:tz,ToggleButtonKeyDownEnd:iz,ToggleButtonKeyDownEnter:az,ToggleButtonKeyDownEscape:nz,ToggleButtonKeyDownHome:rz,ToggleButtonKeyDownPageDown:cz,ToggleButtonKeyDownPageUp:sz,ToggleButtonKeyDownSpaceButton:oz});function xz(e,t,n){var r=n.type,i=n.altKey,a;switch(r){case fz:a={isOpen:kR(t,`isOpen`,FR),highlightedIndex:KR(t),selectedItem:t.items[n.index]};break;case tz:var o=n.key,s=``+e.inputValue+o;a={inputValue:s,highlightedIndex:ZR({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 $R:a={highlightedIndex:e.isOpen?_R(e.highlightedIndex,1,t.items,t.isItemDisabled):i&&e.selectedItem==null?-1:zR(t,e,1),isOpen:!0};break;case ez:a=e.isOpen&&i?WR(t,e.highlightedIndex,!1):{highlightedIndex:e.isOpen?_R(e.highlightedIndex,-1,t.items,t.isItemDisabled):zR(t,e,-1),isOpen:!0};break;case az:case oz:a=WR(t,e.highlightedIndex,!1);break;case rz:a={highlightedIndex:vR(0,!1,t.items,t.isItemDisabled),isOpen:!0};break;case iz:a={highlightedIndex:vR(t.items.length-1,!0,t.items,t.isItemDisabled),isOpen:!0};break;case sz:a={highlightedIndex:_R(e.highlightedIndex,-10,t.items,t.isItemDisabled)};break;case cz:a={highlightedIndex:_R(e.highlightedIndex,10,t.items,t.isItemDisabled)};break;case nz:a={isOpen:!1,highlightedIndex:-1};break;case lz:a=zL({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&t.items?.length&&{selectedItem:t.items[e.highlightedIndex]});break;case _z:a={selectedItem:n.selectedItem};break;default:return JR(e,t,n,bz)}return zL({},e,a)}var Sz=zL({},K).useId,Cz=typeof Sz==`function`?wz:Tz;function wz(e){var t=e.id,n=e.labelId,r=e.menuId,i=e.getItemId,a=e.toggleButtonId,o=e.inputId,s=`downshift-`+Sz();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 Tz(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-`+QL()).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 Ez=[`onClick`],Dz=[`onMouseLeave`,`refKey`,`ref`],Oz=[`onBlur`,`onClick`,`onPress`,`onKeyDown`,`refKey`,`ref`],kz=[`item`,`index`,`onMouseMove`,`onClick`,`onMouseDown`,`onPress`,`refKey`,`disabled`,`ref`];Az.stateChangeTypes=bz;function Az(e){e===void 0&&(e={}),cR(e,Az,YR);var t=zL({},XR,e),n=t.scrollIntoView,r=t.environment,i=t.getA11yStatusMessage,a=wR(xz,t,RR,GR),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=Cz(t),_=$L({state:o,props:t}),v=(0,K.useCallback)(function(e){return m.current[g.getItemId(e)]},[g]);MR(i,o,[c,l,u,d],r);var y=HR({menuElement:p.current,highlightedIndex:l,isOpen:c,itemRefs:m,scrollIntoView:n,getItemNodeFromIndex:v});(0,K.useEffect)(function(){return h.current=fR(function(e){e({type:vz,inputValue:``})},500),function(){h.current.cancel()}},[]),(0,K.useEffect)(function(){d&&h.current(s)},[s,d]),UR({props:t,state:o}),(0,K.useEffect)(function(){AR(t,`isOpen`,FR)&&f.current&&f.current.focus()},[]);var b=BR(r,(0,K.useCallback)(function(){_.current.state.isOpen&&s({type:lz})},[s,_]),(0,K.useMemo)(function(){return[p,f]},[])),x=VR(`getMenuProps`,`getToggleButtonProps`);(0,K.useEffect)(function(){c||(m.current={})},[c]);var S=(0,K.useMemo)(function(){return{ArrowDown:function(e){e.preventDefault(),s({type:$R,altKey:e.altKey})},ArrowUp:function(e){e.preventDefault(),s({type:ez,altKey:e.altKey})},Home:function(e){e.preventDefault(),s({type:rz})},End:function(e){e.preventDefault(),s({type:iz})},Escape:function(){_.current.state.isOpen&&s({type:nz})},Enter:function(e){e.preventDefault(),s({type:_.current.state.isOpen?az:QR})},PageUp:function(e){_.current.state.isOpen&&(e.preventDefault(),s({type:sz}))},PageDown:function(e){_.current.state.isOpen&&(e.preventDefault(),s({type:cz}))}," ":function(e){e.preventDefault();var t=_.current.state;if(!t.isOpen){s({type:QR});return}t.inputValue?s({type:tz,key:` `}):s({type:oz})}}},[s,_]),C=(0,K.useCallback)(function(){s({type:pz})},[s]),w=(0,K.useCallback)(function(){s({type:hz})},[s]),T=(0,K.useCallback)(function(){s({type:mz})},[s]),E=(0,K.useCallback)(function(e){s({type:gz,highlightedIndex:e})},[s]),D=(0,K.useCallback)(function(e){s({type:_z,selectedItem:e})},[s]),O=(0,K.useCallback)(function(){s({type:yz})},[s]),k=(0,K.useCallback)(function(e){s({type:vz,inputValue:e})},[s]),A=(0,K.useCallback)(function(e){var t=e===void 0?{}:e,n=t.onClick,r=RL(t,Ez);return zL({id:g.labelId,htmlFor:g.toggleButtonId,onClick:pR(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=RL(r,Dz),u=(t===void 0?{}:t).suppressRefError;return x(`getMenuProps`,u===void 0?!1:u,o,p),zL((n={},n[o]=mR(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=pR(i,function(){s({type:uz})}),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=RL(r,Oz),p=(t===void 0?{}:t).suppressRefError,m=p===void 0?!1:p,h=_.current.state,v=function(){s({type:QR})},y=function(){h.isOpen&&!b.isMouseDown&&s({type:lz})},C=function(e){var t=gR(e);t&&S[t]?S[t](e):LR(t)&&s({type:tz,key:t})},w=zL((n={},n[l]=mR(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=pR(i,y),n),d);return d.disabled||(w.onClick=pR(a,v),w.onKeyDown=pR(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=RL(n,kz);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=TR(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:dz,index:w,disabled:T}))},D=function(){s({type:fz,index:w})},O=function(e){return e.preventDefault()},k=zL((t={},t[u]=mR(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=pR(o,D)),k.onMouseMove=pR(a,E),k.onMouseDown=pR(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 jz=0,Mz=1,Nz=2,Pz=3,Fz=4,Iz=5,Lz=6,Rz=7,zz=8,Bz=9,Vz=10,Hz=11,Uz=12,Wz=13,Gz=14,Kz=15,qz=16,Jz=17,Yz=18,Xz=19,Zz=20,Qz=21,$z=22,eB=Object.freeze({__proto__:null,ControlledPropUpdatedSelectedItem:$z,FunctionCloseMenu:Jz,FunctionOpenMenu:qz,FunctionReset:Qz,FunctionSelectItem:Xz,FunctionSetHighlightedIndex:Yz,FunctionSetInputValue:Zz,FunctionToggleMenu:Kz,InputBlur:Bz,InputChange:zz,InputClick:Vz,InputKeyDownArrowDown:jz,InputKeyDownArrowUp:Mz,InputKeyDownEnd:Fz,InputKeyDownEnter:Rz,InputKeyDownEscape:Nz,InputKeyDownHome:Pz,InputKeyDownPageDown:Lz,InputKeyDownPageUp:Iz,ItemClick:Wz,ItemMouseMove:Uz,MenuMouseLeave:Hz,ToggleButtonClick:Gz});function tB(e){var t=RR(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)),zL({},t,{inputValue:r})}var nB=zL({},NR,{items:$.default.array.isRequired,isItemDisabled:$.default.func,inputValue:$.default.string,defaultInputValue:$.default.string,initialInputValue:$.default.string,inputId:$.default.string,onInputValueChange:$.default.func});function rB(e,t,n,r){var i=(0,K.useRef)(),a=CR(e,t,n,r),o=a[0],s=a[1],c=ER();return(0,K.useEffect)(function(){hR(t,`selectedItem`)&&(c||t.itemToKey(t.selectedItem)!==t.itemToKey(i.current)&&s({type:$z,inputValue:t.itemToString(t.selectedItem)}),i.current=o.selectedItem===i.current?t.selectedItem:o.selectedItem)},[o.selectedItem,t.selectedItem]),[lR(o,t),s]}var iB=zL({},PR,{isItemDisabled:function(){return!1}});function aB(e,t,n){var r=n.type,i=n.altKey,a;switch(r){case Wz:a={isOpen:kR(t,`isOpen`,FR),highlightedIndex:KR(t),selectedItem:t.items[n.index],inputValue:t.itemToString(t.items[n.index])};break;case jz:a=e.isOpen?{highlightedIndex:_R(e.highlightedIndex,1,t.items,t.isItemDisabled,!0)}:{highlightedIndex:i&&e.selectedItem==null?-1:zR(t,e,1),isOpen:t.items.length>=0};break;case Mz:a=e.isOpen?i?WR(t,e.highlightedIndex):{highlightedIndex:_R(e.highlightedIndex,-1,t.items,t.isItemDisabled,!0)}:{highlightedIndex:zR(t,e,-1),isOpen:t.items.length>=0};break;case Rz:a=WR(t,e.highlightedIndex);break;case Nz:a=zL({isOpen:!1,highlightedIndex:-1},!e.isOpen&&{selectedItem:null,inputValue:``});break;case Iz:a={highlightedIndex:_R(e.highlightedIndex,-10,t.items,t.isItemDisabled,!0)};break;case Lz:a={highlightedIndex:_R(e.highlightedIndex,10,t.items,t.isItemDisabled,!0)};break;case Pz:a={highlightedIndex:vR(0,!1,t.items,t.isItemDisabled)};break;case Fz:a={highlightedIndex:vR(t.items.length-1,!0,t.items,t.isItemDisabled)};break;case Bz:a=zL({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 zz:a={isOpen:!0,highlightedIndex:KR(t),inputValue:n.inputValue};break;case Vz:a={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:zR(t,e,0)};break;case Xz:a={selectedItem:n.selectedItem,inputValue:t.itemToString(n.selectedItem)};break;case $z:a={inputValue:n.inputValue};break;default:return JR(e,t,n,eB)}return zL({},e,a)}var oB=[`onMouseLeave`,`refKey`,`ref`],sB=[`item`,`index`,`refKey`,`ref`,`onMouseMove`,`onMouseDown`,`onClick`,`onPress`,`disabled`],cB=[`onClick`,`onPress`,`refKey`,`ref`],lB=[`onKeyDown`,`onChange`,`onInput`,`onBlur`,`onChangeText`,`onClick`,`refKey`,`ref`];uB.stateChangeTypes=eB;function uB(e){e===void 0&&(e={}),cR(e,uB,nB);var t=zL({},iB,e),n=t.items,r=t.scrollIntoView,i=t.environment,a=t.getA11yStatusMessage,o=rB(aB,t,tB,GR),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),_=ER(),v=Cz(t),y=(0,K.useRef)(),b=$L({state:s,props:t}),x=(0,K.useCallback)(function(e){return m.current[v.getItemId(e)]},[v]);MR(a,s,[l,u,d,f],i);var S=HR({menuElement:p.current,highlightedIndex:u,isOpen:l,itemRefs:m,scrollIntoView:r,getItemNodeFromIndex:x});UR({props:t,state:s}),(0,K.useEffect)(function(){AR(t,`isOpen`,FR)&&h.current&&h.current.focus()},[]),(0,K.useEffect)(function(){_||(y.current=n.length)});var C=BR(i,(0,K.useCallback)(function(){b.current.state.isOpen&&c({type:Bz})},[c,b]),(0,K.useMemo)(function(){return[p,g,h]},[])),w=VR(`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:jz,altKey:e.altKey})},ArrowUp:function(e){e.preventDefault(),c({type:Mz,altKey:e.altKey})},Home:function(e){b.current.state.isOpen&&(e.preventDefault(),c({type:Pz}))},End:function(e){b.current.state.isOpen&&(e.preventDefault(),c({type:Fz}))},Escape:function(e){var t=b.current.state;(t.isOpen||t.inputValue||t.selectedItem||t.highlightedIndex>-1)&&(e.preventDefault(),c({type:Nz}))},Enter:function(e){!b.current.state.isOpen||e.which===229||(e.preventDefault(),c({type:Rz}))},PageUp:function(e){b.current.state.isOpen&&(e.preventDefault(),c({type:Iz}))},PageDown:function(e){b.current.state.isOpen&&(e.preventDefault(),c({type:Lz}))}}},[c,b]),E=(0,K.useCallback)(function(e){return zL({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=RL(r,oB),u=(t===void 0?{}:t).suppressRefError;return w(`getMenuProps`,u===void 0?!1:u,o,p),zL((n={},n[o]=mR(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=pR(i,function(){c({type:Hz})}),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=RL(r,sB);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=TR(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 zL((t={},t[s]=mR(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]=pR(O,function(){c({type:Wz,index:T})}),n),{onMouseMove:pR(u,function(){C.isTouchEnd||T===y.highlightedIndex||(S.current=!1,c({type:Uz,index:T,disabled:E}))}),onMouseDown:pR(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=RL(n,cB),l=b.current.state;return zL((t={},t[a]=mR(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&&zL({},{onClick:pR(r,function(){c({type:Gz})})}),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=RL(r,lB),g=(t===void 0?{}:t).suppressRefError;w(`getInputProps`,g===void 0?!1:g,f,h);var _=b.current.state,y=function(e){var t=gR(e);t&&T[t]&&T[t](e)},x=function(e){c({type:zz,inputValue:e.target.value})},S=function(e){i!=null&&i.document&&_.isOpen&&!C.isMouseDown&&c({type:Bz,selectItem:!(e.relatedTarget===null&&i.document.activeElement!==i.document.body)})},E=function(){c({type:Vz})},D=`onChange`,O={};if(!m.disabled){var k;O=(k={},k[D]=pR(o,s,x),k.onKeyDown=pR(a,y),k.onBlur=pR(l,S),k.onClick=pR(u,E),k)}return zL((n={},n[f]=mR(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:Kz})},[c]),M=(0,K.useCallback)(function(){c({type:Jz})},[c]),N=(0,K.useCallback)(function(){c({type:qz})},[c]),P=(0,K.useCallback)(function(e){c({type:Yz,highlightedIndex:e})},[c]),ee=(0,K.useCallback)(function(e){c({type:Xz,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:Zz,inputValue:e})},[c]),selectItem:ee,reset:(0,K.useCallback)(function(){c({type:Qz})},[c]),highlightedIndex:u,isOpen:l,selectedItem:d,inputValue:f}}var dB={activeIndex:-1,selectedItems:[]};function fB(e,t){return AR(e,t,dB)}function pB(e,t){return kR(e,t,dB)}function mB(e){return{activeIndex:fB(e,`activeIndex`),selectedItems:fB(e,`selectedItems`)}}function hB(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 gB(e,t){return e.selectedItems===t.selectedItems&&e.activeIndex===t.activeIndex}NR.stateReducer,NR.itemToKey,NR.environment,$.default.array,$.default.array,$.default.array,$.default.func,$.default.number,$.default.number,$.default.number,$.default.func,$.default.func,$.default.string,$.default.string;var _B={itemToKey:PR.itemToKey,stateReducer:PR.stateReducer,environment:PR.environment,keyNavigationNext:`ArrowRight`,keyNavigationPrevious:`ArrowLeft`},vB=sR,yB=0,bB=1,xB=2,SB=3,CB=4,wB=5,TB=6,EB=7,DB=8,OB=9,kB=10,AB=11,jB=12,MB=Object.freeze({__proto__:null,DropdownClick:EB,DropdownKeyDownBackspace:TB,DropdownKeyDownNavigationPrevious:wB,FunctionAddSelectedItem:DB,FunctionRemoveSelectedItem:OB,FunctionReset:jB,FunctionSetActiveIndex:AB,FunctionSetSelectedItems:kB,SelectedItemClick:yB,SelectedItemKeyDownBackspace:xB,SelectedItemKeyDownDelete:bB,SelectedItemKeyDownNavigationNext:SB,SelectedItemKeyDownNavigationPrevious:CB});function NB(e,t,n){var r=n.type,i=n.index,a=n.selectedItem,o=e.activeIndex,s=e.selectedItems,c;switch(r){case yB:c={activeIndex:i};break;case CB:c={activeIndex:o-1<0?0:o-1};break;case SB:c={activeIndex:o+1>=s.length?-1:o+1};break;case xB:case bB:if(o<0)break;var l=o;s.length===1?l=-1:o===s.length-1&&(l=s.length-2),c=zL({selectedItems:[].concat(s.slice(0,o),s.slice(o+1))},{activeIndex:l});break;case wB:c={activeIndex:s.length-1};break;case TB:c={selectedItems:s.slice(0,s.length-1)};break;case DB:c={selectedItems:[].concat(s,[a])};break;case EB:c={activeIndex:-1};break;case OB: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 kB:c={selectedItems:n.selectedItems};break;case AB:c={activeIndex:n.activeIndex};break;case jB:c={activeIndex:pB(t,`activeIndex`),selectedItems:pB(t,`selectedItems`)};break;default:throw Error(`Reducer called without proper action type.`)}return zL({},e,c)}var PB=[`refKey`,`ref`,`onClick`,`onKeyDown`,`selectedItem`,`index`],FB=[`refKey`,`ref`,`onKeyDown`,`onClick`,`preventKeyAction`];IB.stateChangeTypes=MB;function IB(e){e===void 0&&(e={}),vB(e,IB);var t=zL({},_B,e),n=t.getA11yStatusMessage,r=t.environment,i=t.keyNavigationNext,a=t.keyNavigationPrevious,o=wR(NB,t,mB,gB),s=o[0],c=o[1],l=s.activeIndex,u=s.selectedItems,d=ER(),f=(0,K.useRef)(null),p=(0,K.useRef)();p.current=[];var m=$L({state:s,props:t});MR(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]),UR({props:t,state:s});var h=VR(`getDropdownProps`),g=(0,K.useMemo)(function(){var e;return e={},e[a]=function(){c({type:CB})},e[i]=function(){c({type:SB})},e.Delete=function(){c({type:bB})},e.Backspace=function(){c({type:xB})},e},[c,i,a]),_=(0,K.useMemo)(function(){var e;return e={},e[a]=function(e){hB(e)&&c({type:wB})},e.Backspace=function(e){hB(e)&&c({type:TB})},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=RL(n,PB),f=m.current.state,h=TR(l,u,f.selectedItems,`Pass either item or index to getSelectedItemProps!`)[1],_=h>-1&&h===f.activeIndex;return zL((t={},t[i]=mR(a,function(e){e&&p.current.push(e)}),t.tabIndex=_?0:-1,t.onClick=pR(o,function(){c({type:yB,index:h})}),t.onKeyDown=pR(s,function(e){var t=gR(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=RL(r,FB),m=(t===void 0?{}:t).suppressRefError;return h(`getDropdownProps`,m===void 0?!1:m,a,f),zL((n={},n[a]=mR(o,function(e){e&&(f.current=e)}),n),!d&&{onKeyDown:pR(s,function(e){var t=gR(e);t&&_[t]&&_[t](e)}),onClick:pR(l,function(){c({type:EB})})},p)},[c,_,h]),addSelectedItem:(0,K.useCallback)(function(e){c({type:DB,selectedItem:e})},[c]),removeSelectedItem:(0,K.useCallback)(function(e){c({type:OB,selectedItem:e})},[c]),setSelectedItems:(0,K.useCallback)(function(e){c({type:kB,selectedItems:e})},[c]),setActiveIndex:(0,K.useCallback)(function(e){c({type:AB,activeIndex:e})},[c]),reset:(0,K.useCallback)(function(){c({type:jB})},[c]),selectedItems:u,activeIndex:l}}var LB=0,RB=1,zB=2,BB=3,VB=4,HB=5,UB=6,WB=Object.freeze({__proto__:null,FunctionAddItem:UB,TagClick:LB,TagGroupKeyDownArrowLeft:RB,TagGroupKeyDownArrowRight:zB,TagGroupKeyDownBackspace:VB,TagGroupKeyDownDelete:BB,TagRemoveClick:HB});function GB(e,t,n){var r=n.type,i;switch(r){case LB:i={activeIndex:n.index};break;case RB:i={activeIndex:e.activeIndex===0?e.items.length-1:e.activeIndex-1};break;case zB:i={activeIndex:e.activeIndex===e.items.length-1?0:e.activeIndex+1};break;case VB:case BB: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 HB: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 UB: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 zL({},e,i)}var KB=zL({},K).useId,qB=typeof KB==`function`?JB:YB;function JB(e){var t=e.id,n=e.tagGroupId,r=e.getTagId,i=`downshift-`+KB();return t||=i,K.useMemo(function(){return{tagGroupId:n??t+`-tag-group`,getTagId:r??function(e){return t+`-tag-`+e}}},[r,t,n])}function YB(e){var t=e.id,n=e.getTagId,r=e.tagGroupId,i=K.useRef(t??`downshift-`+QL()).current;return K.useMemo(function(){return{tagGroupId:r??i+`-tag-group`,getTagId:n??function(e){return i+`-tag-`+e}}},[n,i,r])}function XB(e){var t=e.items??e.initialItems??[];return{activeIndex:e.activeIndex??e.initialActiveIndex??(t.length===0?-1:0),items:t}}function ZB(e,t){return e.activeIndex===t.activeIndex&&e.items===t.items}var QB=`tag-group-a11y-description`;function $B(e,t){K.useEffect(function(){if(e){var n=e.createElement(`div`);return n.setAttribute(`id`,QB),n.style.display=`none`,n.textContent=t,e.body.appendChild(n),function(){n.remove()}}},[t,e])}function eV(e){return zL({stateReducer:function(e,t){return t.changes},environment:typeof window>`u`?void 0:window,removeElementDescription:`Press Delete or Backspace to remove tag.`},e)}function tV(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 nV={isItemDisabled:$.default.func},rV=[`onKeyDown`],iV=[`index`,`refKey`,`ref`,`onClick`],aV=[`index`,`onClick`],oV=function(e){e===void 0&&(e={}),cR(e,oV,nV);var t=eV(e),n=wR(GB,t,XB,ZB),r=n[0],i=n[1],a=r.activeIndex,o=r.items,s=$L({state:r,props:t}),c=qB({getTagId:t.getTagId,id:t.id,tagGroupId:t.tagGroupId});$B(t.environment?.document,t.removeElementDescription);var l=tV(a,o.length,c.getTagId),u=(0,K.useCallback)(function(e){var t=e??{},n=t.onKeyDown,r=RL(t,rV);return zL({id:c.tagGroupId,"aria-live":`polite`,"aria-atomic":`false`,"aria-relevant":`additions`,role:`listbox`,onKeyDown:tR(n,function(e){switch(e.key){case`ArrowLeft`:i({type:RB});break;case`ArrowRight`:i({type:zB});break;case`Delete`:i({type:BB});break;case`Backspace`:i({type:VB});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=RL(e,iV);if(!Number.isInteger(n)||n<0)throw Error(`Pass correct item index to getTagProps!`);var f=s.current.state,p=function(){i({type:LB,index:n})},m=c.getTagId(n);return zL((t={"aria-describedby":QB},t[a]=eR(o,function(e){e&&(l.current[m]=e)}),t[`aria-labelledby`]=m,t.role=`option`,t.id=m,t.onClick=tR(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=RL(e,aV);if(!Number.isInteger(t)||t<0)throw Error(`Pass correct item index to getTagRemoveProps!`);var a=function(e){e.stopPropagation(),i({type:HB,index:t})},o=c.getTagId(t),s=o+`-remove`;return zL({id:s,tabIndex:-1,"aria-labelledby":s+` `+o,onClick:tR(n,a)},r)},[c,i]);return{activeIndex:a,addItem:(0,K.useCallback)(function(e,t){i({type:UB,item:e,index:t})},[i]),getTagGroupProps:u,getTagProps:d,getTagRemoveProps:f,items:o}};oV.stateChangeTypes=WB;function sV({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}=IB({selectedItems:t,onStateChange({selectedItems:e,type:t}){t===IB.stateChangeTypes.FunctionRemoveSelectedItem&&r(e)}}),{isOpen:O,getMenuProps:k,getInputProps:A,getItemProps:j,highlightedIndex:M,setHighlightedIndex:N}=uB({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 uB.stateChangeTypes.InputKeyDownEnter:case uB.stateChangeTypes.ItemClick:return n;case uB.stateChangeTypes.InputKeyDownArrowDown:case uB.stateChangeTypes.InputKeyDownArrowUp:return n;case uB.stateChangeTypes.InputBlur:return n;case uB.stateChangeTypes.FunctionCloseMenu:return{...n,isOpen:!0};case uB.stateChangeTypes.InputKeyDownEscape:return n;case uB.stateChangeTypes.ItemMouseMove:return e;default:return n}},onStateChange({inputValue:e,type:t,selectedItem:n}){switch(t){case uB.stateChangeTypes.InputKeyDownEnter:case uB.stateChangeTypes.ItemClick:n&&(r([n]),d(``));break;case uB.stateChangeTypes.MenuMouseLeave:case uB.stateChangeTypes.ItemMouseMove:break;case uB.stateChangeTypes.InputKeyDownArrowDown:case uB.stateChangeTypes.InputKeyDownArrowUp:break;case uB.stateChangeTypes.InputBlur:break;case uB.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 I=!!s;function ie(){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:!I&&t.length===0?a:``,...e,"aria-describedby":re,disabled:I})}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}),ie()]}),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)(TL,{className:`aone:w-6 aone:h-6 aone:-rotate-45`,icon:kj}),(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=N_(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)(TL,{className:`aone:w-6 aone:h-6`,icon:Nj}),(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 cV({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 lV=s(((e,t)=>{function n(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}t.exports=n})),uV=s(((e,t)=>{t.exports=typeof global==`object`&&global&&global.Object===Object&&global})),dV=s(((e,t)=>{var n=uV(),r=typeof self==`object`&&self&&self.Object===Object&&self;t.exports=n||r||Function(`return this`)()})),fV=s(((e,t)=>{var n=dV();t.exports=function(){return n.Date.now()}})),pV=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})),mV=s(((e,t)=>{var n=pV(),r=/^\s+/;function i(e){return e&&e.slice(0,n(e)+1).replace(r,``)}t.exports=i})),hV=s(((e,t)=>{t.exports=dV().Symbol})),gV=s(((e,t)=>{var n=hV(),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})),_V=s(((e,t)=>{var n=Object.prototype.toString;function r(e){return n.call(e)}t.exports=r})),vV=s(((e,t)=>{var n=hV(),r=gV(),i=_V(),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})),yV=s(((e,t)=>{function n(e){return typeof e==`object`&&!!e}t.exports=n})),bV=s(((e,t)=>{var n=vV(),r=yV(),i=`[object Symbol]`;function a(e){return typeof e==`symbol`||r(e)&&n(e)==i}t.exports=a})),xV=s(((e,t)=>{var n=mV(),r=lV(),i=bV(),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})),SV=u(s(((e,t)=>{var n=lV(),r=fV(),i=xV(),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 CV({departureAirport:e,apiDomain:t,sessionId:n,clickId:r}){let i=new URLSearchParams({departureAirportIATA:e}).toString(),a={};n&&(a[fS]=n),r&&(a[pS]=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 Jg.parse(s)}async function wV(e,t,n,r,i){if(!t)return[];let a=await CV({query:e,departureAirport:t,apiDomain:n,sessionId:r,clickId:i});return a.success?a.data.map(e=>({itemType:am.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 TV({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[fS]=i),a&&(s[pS]=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 um.parse(l)}async function EV(e,t,n,r,i,a){if(!t)return[];let o=await TV({query:e,departureAirport:t,marketingCarrierCodeIATA:n,apiDomain:r,sessionId:i,clickId:a});return o.success?o.data.map(e=>({itemType:am.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 DV(e){return Math.PI/180*e}function OV(e){return e*.621371}function kV(e,t,n,r){let i=DV(n-e),a=DV(r-t),o=Math.sin(i/2)*Math.sin(i/2)+Math.cos(DV(e))*Math.cos(DV(n))*Math.sin(a/2)*Math.sin(a/2);return 6371*(2*Math.atan2(Math.sqrt(o),Math.sqrt(1-o)))}function AV(e,t){if(!Array.isArray(e.types)||!e.types.includes(`place`)||e.itemType!==am.METRO)return!1;let n=M_(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 jV(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=>AV(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=OV(kV(e,t,s.lat,s.lng)),o.nearbyAirports.push(s)}t.add(n)}}return e.filter((e,n)=>!t.has(n))}function MV(e){if(!Array.isArray(e.types)||!e.types.includes(`place`))return;let t=e.kayak?.apicode;if(!t?.trim())return;let n=M_(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 NV({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 PV(e,t=P_.Hotels){if(!e?.length||e.length<3)return[];let n=jV((await NV({query:e,searchType:t})).reduce((e,t)=>{if(t.isMetroOnly){let n=t.rc?.trim();e.push({nearbyAirports:[],itemType:am.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:am.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:am.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=>AV(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=OV(kV(r,a,t.lat,t.lng)),e[n].nearbyAirports.push(i)}else e.push({nearbyAirports:[i],itemType:am.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)MV(e);return n}function FV({key:e,apiDomain:t,airportIATA:n,providersArr:r,airlinesArr:i,debounceTime:a=500,autocompleteType:o=`kayak`}){let{sessionId:s}=fx(),{clickId:c}=by(),[l,u]=(0,K.useState)(``),d=(0,K.useMemo)(()=>(0,SV.default)(u,a),[a]),{data:f,status:p}=ax({queryKey:[e,n,r,i,l,o,s].flat(),queryFn:()=>o===L_.schedule_data&&n?.length&&n?.length===3?wV(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`)?EV(l,n,i[0],t,s,c):PV(l),enabled:!!s});return{data:f,status:p,setQuery:d}}function IV(){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 LV({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 RV({shadowRoot:e,origin:t,theme:n}){let{apiDomain:r}=hx(),[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}=FV({key:`carfare-from-suggest`,apiDomain:r,airportIATA:b}),{data:w,status:T,setQuery:E}=FV({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)(LV,{value:i,onChange:a}),(0,q.jsx)(`div`,{className:`aone:ml-2`,children:(0,q.jsx)(cV,{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)(sV,{shadowRoot:e,dataTestId:`carfare-from-airport`,icon:S===`pending`?(0,q.jsx)(Ny,{}):(0,q.jsx)(IV,{}),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)(sV,{shadowRoot:e,dataTestId:`carfare-to-airport`,icon:T===`pending`?(0,q.jsx)(Ny,{}):(0,q.jsx)(IV,{}),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)(LL,{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)(LL,{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)(IV,{}),(0,q.jsx)(`span`,{children:`Search`})]})})]})]})}var zV=new Vb;function BV({children:e,props:t}){return(0,q.jsx)(Wb,{client:zV,children:(0,q.jsx)(mx,{apiDomain:t.apiDomain,consentAnalytics:t.consentAnalytics,consentAdvertising:t.consentAdvertising,consentFunctional:t.consentFunctional,children:e})})}function VV(e){return!e.origin||e.origin.length!==3?(console.error(`Origin is not a valid IATA code, not rendering widget.`),null):(0,q.jsxs)(BV,{props:e,children:[(0,q.jsx)(`style`,{children:gx}),e.userStyleBlock?(0,q.jsx)(`style`,{children:e.userStyleBlock}):null,(0,q.jsx)(sx,{componentName:`carfare search`,children:(0,q.jsx)(K.Suspense,{fallback:(0,q.jsx)(Ny,{}),children:(0,q.jsx)(RV,{shadowRoot:e.shadowRoot,origin:e.origin,theme:e.theme})})})]})}var HV=[`origin`,`primary-color`,`secondary-color`,`consent-analytics`,`consent-advertising`,`consent-functional`,`theme`,K_,`id`],UV=class extends HTMLElement{_shadowRoot;_mountPoint;_reactRoot;_renderInProgress=!1;_renderQueued=!1;_renderScheduled=!1;_mountTelemetrySent=!1;_lastPublicConfigTelemetryKey=null;static get observedAttributes(){return Array.from(HV)}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=gv(this),t=Sv(),n=null,r=!1,i={attempted:!1,durationMs:0},a;if(e&&t){let t=await Cv(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=kv(n),s=window[rm],c=TS(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,Ay(!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(`${vv}: carfare-search — managed instance config not applied; using host attributes and window defaults.`),this._paintCarfare(c),c.consentAnalytics&&!this._mountTelemetrySent&&(this._mountTelemetrySent=!0,jy(!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&&ev.test(r.primaryColor),s=r.secondaryColor!=null&&ev.test(r.secondaryColor);n.style.setProperty(`--primary`,o?rv(i):i),n.style.setProperty(`--secondary`,s?rv(a):a),r.theme===`dark`?this.setAttribute(`data-mode`,`dark`):this.removeAttribute(`data-mode`),(this._reactRoot??=dv.createRoot(n)).render((0,q.jsx)(VV,{...r}))}};customElements.get(`fma-carfare-search`)||customElements.define(`fma-carfare-search`,UV);function WV(e){return e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase()}function GV(e){return Array.from(new Set([e,e.toLowerCase(),WV(e)]))}function KV(e,t){if(e===void 0)return t;let n=e.trim().toLowerCase();return t?n!==`false`:n===`true`}function qV(e){let t=e.trim();return/^(?:\d+\.?\d*|\.\d+)$/.test(t)?`${t.endsWith(`.`)?t.slice(0,-1):t}px`:t}function JV({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 YV(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 XV(e,t,n,r){let i=`${e}/api/calendar-v2`,a={"Content-Type":`application/json`};n&&(a[fS]=n),r&&(a[pS]=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 cm.parse(s)}function ZV({apiDomain:e,params:t,debounceTime:n=500}){let{sessionId:r}=fx(),{clickId:i}=by(),a=YV(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?Oh(a.startDate,`yyyy-MM-dd`):null,u=a.endDate?Oh(a.endDate,`yyyy-MM-dd`):null,{data:d,status:f}=ax({queryKey:[`flight-calendar`,a.origin,a.destination,a.departureLocationType??am.AIRPORT,a.arrivalLocationType??am.AIRPORT,l,u,a.includePriceInsights?`price-insights-v2`:`no-price-insights`,r],enabled:c&&!!r,queryFn:()=>{let t=Oh(a.startDate,`yyyy-MM-dd`),n=a.endDate?Oh(a.endDate,`yyyy-MM-dd`):void 0,o=sm.safeParse({departureAirport:a.origin.split(`,`)[0]??``,arrivalAirport:a.destination.split(`,`)[0]??``,startDate:t,endDate:n,includePriceInsights:a.includePriceInsights??!1,departureLocationType:a.departureLocationType??am.AIRPORT,arrivalLocationType:a.arrivalLocationType??am.AIRPORT});if(!o.success)throw Error(`Invalid flight-calendar parameters`);return XV(e,o.data,r,i)},refetchOnWindowFocus:!1,refetchOnMount:!1,staleTime:1e3*60*1});return{data:d,status:f}}function QV(){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 $V=s(((e,t)=>{function n(){this.__data__=[],this.size=0}t.exports=n})),eH=s(((e,t)=>{function n(e,t){return e===t||e!==e&&t!==t}t.exports=n})),tH=s(((e,t)=>{var n=eH();function r(e,t){for(var r=e.length;r--;)if(n(e[r][0],t))return r;return-1}t.exports=r})),nH=s(((e,t)=>{var n=tH(),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})),rH=s(((e,t)=>{var n=tH();function r(e){var t=this.__data__,r=n(t,e);return r<0?void 0:t[r][1]}t.exports=r})),iH=s(((e,t)=>{var n=tH();function r(e){return n(this.__data__,e)>-1}t.exports=r})),aH=s(((e,t)=>{var n=tH();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})),oH=s(((e,t)=>{var n=$V(),r=nH(),i=rH(),a=iH(),o=aH();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})),sH=s(((e,t)=>{var n=oH();function r(){this.__data__=new n,this.size=0}t.exports=r})),cH=s(((e,t)=>{function n(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}t.exports=n})),lH=s(((e,t)=>{function n(e){return this.__data__.get(e)}t.exports=n})),uH=s(((e,t)=>{function n(e){return this.__data__.has(e)}t.exports=n})),dH=s(((e,t)=>{var n=vV(),r=lV(),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})),fH=s(((e,t)=>{t.exports=dV()[`__core-js_shared__`]})),pH=s(((e,t)=>{var n=fH(),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})),mH=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})),hH=s(((e,t)=>{var n=dH(),r=pH(),i=lV(),a=mH(),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})),gH=s(((e,t)=>{function n(e,t){return e?.[t]}t.exports=n})),_H=s(((e,t)=>{var n=hH(),r=gH();function i(e,t){var i=r(e,t);return n(i)?i:void 0}t.exports=i})),vH=s(((e,t)=>{t.exports=_H()(dV(),`Map`)})),yH=s(((e,t)=>{t.exports=_H()(Object,`create`)})),bH=s(((e,t)=>{var n=yH();function r(){this.__data__=n?n(null):{},this.size=0}t.exports=r})),xH=s(((e,t)=>{function n(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=+!!t,t}t.exports=n})),SH=s(((e,t)=>{var n=yH(),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})),CH=s(((e,t)=>{var n=yH(),r=Object.prototype.hasOwnProperty;function i(e){var t=this.__data__;return n?t[e]!==void 0:r.call(t,e)}t.exports=i})),wH=s(((e,t)=>{var n=yH(),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})),TH=s(((e,t)=>{var n=bH(),r=xH(),i=SH(),a=CH(),o=wH();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})),EH=s(((e,t)=>{var n=TH(),r=oH(),i=vH();function a(){this.size=0,this.__data__={hash:new n,map:new(i||r),string:new n}}t.exports=a})),DH=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})),OH=s(((e,t)=>{var n=DH();function r(e,t){var r=e.__data__;return n(t)?r[typeof t==`string`?`string`:`hash`]:r.map}t.exports=r})),kH=s(((e,t)=>{var n=OH();function r(e){var t=n(this,e).delete(e);return this.size-=+!!t,t}t.exports=r})),AH=s(((e,t)=>{var n=OH();function r(e){return n(this,e).get(e)}t.exports=r})),jH=s(((e,t)=>{var n=OH();function r(e){return n(this,e).has(e)}t.exports=r})),MH=s(((e,t)=>{var n=OH();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})),NH=s(((e,t)=>{var n=EH(),r=kH(),i=AH(),a=jH(),o=MH();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})),PH=s(((e,t)=>{var n=oH(),r=vH(),i=NH(),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})),FH=s(((e,t)=>{var n=oH(),r=sH(),i=cH(),a=lH(),o=uH(),s=PH();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})),IH=s(((e,t)=>{var n=`__lodash_hash_undefined__`;function r(e){return this.__data__.set(e,n),this}t.exports=r})),LH=s(((e,t)=>{function n(e){return this.__data__.has(e)}t.exports=n})),RH=s(((e,t)=>{var n=NH(),r=IH(),i=LH();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})),zH=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})),BH=s(((e,t)=>{function n(e,t){return e.has(t)}t.exports=n})),VH=s(((e,t)=>{var n=RH(),r=zH(),i=BH(),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})),HH=s(((e,t)=>{t.exports=dV().Uint8Array})),UH=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})),WH=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})),GH=s(((e,t)=>{var n=hV(),r=HH(),i=eH(),a=VH(),o=UH(),s=WH(),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})),KH=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})),qH=s(((e,t)=>{t.exports=Array.isArray})),JH=s(((e,t)=>{var n=KH(),r=qH();function i(e,t,i){var a=t(e);return r(e)?a:n(a,i(e))}t.exports=i})),YH=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})),XH=s(((e,t)=>{function n(){return[]}t.exports=n})),ZH=s(((e,t)=>{var n=YH(),r=XH(),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})),QH=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})),$H=s(((e,t)=>{var n=vV(),r=yV(),i=`[object Arguments]`;function a(e){return r(e)&&n(e)==i}t.exports=a})),eU=s(((e,t)=>{var n=$H(),r=yV(),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`)}})),tU=s(((e,t)=>{function n(){return!1}t.exports=n})),nU=s(((e,t)=>{var n=dV(),r=tU(),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})),rU=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})),iU=s(((e,t)=>{var n=9007199254740991;function r(e){return typeof e==`number`&&e>-1&&e%1==0&&e<=n}t.exports=r})),aU=s(((e,t)=>{var n=vV(),r=iU(),i=yV(),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})),oU=s(((e,t)=>{function n(e){return function(t){return e(t)}}t.exports=n})),sU=s(((e,t)=>{var n=uV(),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{}}()})),cU=s(((e,t)=>{var n=aU(),r=oU(),i=sU(),a=i&&i.isTypedArray;t.exports=a?r(a):n})),lU=s(((e,t)=>{var n=QH(),r=eU(),i=qH(),a=nU(),o=rU(),s=cU(),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})),uU=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})),dU=s(((e,t)=>{function n(e,t){return function(n){return e(t(n))}}t.exports=n})),fU=s(((e,t)=>{t.exports=dU()(Object.keys,Object)})),pU=s(((e,t)=>{var n=uU(),r=fU(),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})),mU=s(((e,t)=>{var n=dH(),r=iU();function i(e){return e!=null&&r(e.length)&&!n(e)}t.exports=i})),hU=s(((e,t)=>{var n=lU(),r=pU(),i=mU();function a(e){return i(e)?n(e):r(e)}t.exports=a})),gU=s(((e,t)=>{var n=JH(),r=ZH(),i=hU();function a(e){return n(e,i,r)}t.exports=a})),_U=s(((e,t)=>{var n=gU(),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})),vU=s(((e,t)=>{t.exports=_H()(dV(),`DataView`)})),yU=s(((e,t)=>{t.exports=_H()(dV(),`Promise`)})),bU=s(((e,t)=>{t.exports=_H()(dV(),`Set`)})),xU=s(((e,t)=>{t.exports=_H()(dV(),`WeakMap`)})),SU=s(((e,t)=>{var n=vU(),r=vH(),i=yU(),a=bU(),o=xU(),s=vV(),c=mH(),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})),CU=s(((e,t)=>{var n=FH(),r=VH(),i=GH(),a=_U(),o=SU(),s=qH(),c=nU(),l=cU(),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})),wU=s(((e,t)=>{var n=CU(),r=yV();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})),TU=s(((e,t)=>{var n=FH(),r=wU(),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})),EU=s(((e,t)=>{var n=lV();function r(e){return e===e&&!n(e)}t.exports=r})),DU=s(((e,t)=>{var n=EU(),r=hU();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})),OU=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})),kU=s(((e,t)=>{var n=TU(),r=DU(),i=OU();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})),AU=s(((e,t)=>{var n=qH(),r=bV(),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})),jU=s(((e,t)=>{var n=NH(),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})),MU=s(((e,t)=>{var n=jU(),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})),NU=s(((e,t)=>{var n=MU(),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})})),PU=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})),FU=s(((e,t)=>{var n=hV(),r=PU(),i=qH(),a=bV(),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})),IU=s(((e,t)=>{var n=FU();function r(e){return e==null?``:n(e)}t.exports=r})),LU=s(((e,t)=>{var n=qH(),r=AU(),i=NU(),a=IU();function o(e,t){return n(e)?e:r(e,t)?[e]:i(a(e))}t.exports=o})),RU=s(((e,t)=>{var n=bV(),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})),zU=s(((e,t)=>{var n=LU(),r=RU();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})),BU=s(((e,t)=>{var n=zU();function r(e,t,r){var i=e==null?void 0:n(e,t);return i===void 0?r:i}t.exports=r})),VU=s(((e,t)=>{function n(e,t){return e!=null&&t in Object(e)}t.exports=n})),HU=s(((e,t)=>{var n=LU(),r=eU(),i=qH(),a=rU(),o=iU(),s=RU();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})),UU=s(((e,t)=>{var n=VU(),r=HU();function i(e,t){return e!=null&&r(e,t,n)}t.exports=i})),WU=s(((e,t)=>{var n=wU(),r=BU(),i=UU(),a=AU(),o=EU(),s=OU(),c=RU(),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})),GU=s(((e,t)=>{function n(e){return e}t.exports=n})),KU=s(((e,t)=>{function n(e){return function(t){return t?.[e]}}t.exports=n})),qU=s(((e,t)=>{var n=zU();function r(e){return function(t){return n(t,e)}}t.exports=r})),JU=s(((e,t)=>{var n=KU(),r=qU(),i=AU(),a=RU();function o(e){return i(e)?n(a(e)):r(e)}t.exports=o})),YU=s(((e,t)=>{var n=kU(),r=WU(),i=GU(),a=qH(),o=JU();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})),XU=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})),ZU=s(((e,t)=>{function n(e){return e!==e}t.exports=n})),QU=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})),$U=s(((e,t)=>{var n=XU(),r=ZU(),i=QU();function a(e,t,a){return t===t?i(e,t,a):n(e,r,a)}t.exports=a})),eW=s(((e,t)=>{var n=$U();function r(e,t){return!!(e!=null&&e.length)&&n(e,t,0)>-1}t.exports=r})),tW=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})),nW=s(((e,t)=>{function n(){}t.exports=n})),rW=s(((e,t)=>{var n=bU(),r=nW(),i=WH();t.exports=n&&1/i(new n([,-0]))[1]==1/0?function(e){return new n(e)}:r})),iW=s(((e,t)=>{var n=RH(),r=eW(),i=tW(),a=BH(),o=rW(),s=WH(),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})),aW=u(s(((e,t)=>{var n=YU(),r=iW();function i(e,t){return e&&e.length?r(e,n(t,2)):[]}t.exports=i}))(),1),oW=new WeakMap,sW=new WeakMap,cW=`data-a1-flight-combobox-open`;function lW(e){let t=sW.get(e);t!=null&&(clearTimeout(t),sW.delete(e));let n=(oW.get(e)??0)+1;oW.set(e,n),e.setAttribute(cW,``)}function uW(e){let t=Math.max(0,(oW.get(e)??0)-1);if(t===0){oW.delete(e);let t=sW.get(e);t!=null&&clearTimeout(t);let n=window.setTimeout(()=>{sW.delete(e),e.removeAttribute(cW)},400);sW.set(e,n)}else oW.set(e,t)}function dW({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}=IB({selectedItems:t,onStateChange({selectedItems:e,type:t}){t===IB.stateChangeTypes.FunctionRemoveSelectedItem&&r(e)}}),{isOpen:N,getMenuProps:P,getInputProps:ee,getItemProps:F,highlightedIndex:te,setHighlightedIndex:ne}=uB({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 uB.stateChangeTypes.InputKeyDownEnter:case uB.stateChangeTypes.ItemClick:case uB.stateChangeTypes.InputKeyDownArrowDown:case uB.stateChangeTypes.InputKeyDownArrowUp:case uB.stateChangeTypes.InputBlur:case uB.stateChangeTypes.InputKeyDownEscape:return n;case uB.stateChangeTypes.ItemMouseMove:return e;case uB.stateChangeTypes.FunctionCloseMenu:return{...n,isOpen:!0};default:return n}},onStateChange({inputValue:e,type:t,selectedItem:n}){switch(t){case uB.stateChangeTypes.InputKeyDownEnter:case uB.stateChangeTypes.ItemClick:n&&(r([n]),d(``));break;case uB.stateChangeTypes.MenuMouseLeave:case uB.stateChangeTypes.ItemMouseMove:case uB.stateChangeTypes.InputKeyDownArrowDown:case uB.stateChangeTypes.InputKeyDownArrowUp:case uB.stateChangeTypes.InputBlur:case uB.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]),I=(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.`,[]),ie=i?`${i}, search airports and places`:`Search airports and places`,ae=i?`${i} suggestions`:`Search results`,oe=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(`, `)}.`})(),se=[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 ce=N&&C.length>0;(0,K.useEffect)(()=>{let e=c?.host;if(e instanceof HTMLElement&&!(!ce||!x))return lW(e),()=>uW(e)},[ce,c,x]);let le=!!s;function ue(e,t){e.pointerType===`touch`&&(e.preventDefault(),e.stopPropagation(),r([t]),d(``),n(``))}function de(){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":ie,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:!le&&t.length===0?a:``,...e,"aria-describedby":se,disabled:le})}let fe=(0,q.jsx)(`ul`,{...P(),ref:p,id:m,role:`listbox`,"aria-multiselectable":`true`,"aria-label":ae,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=>ue(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)(TL,{className:`aone:w-6 aone:h-6 aone:-rotate-45 aone:text-gray-600`,icon:kj}),(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=N_(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=>ue(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)(TL,{className:`aone:w-6 aone:h-6 aone:text-gray-600`,icon:Nj}),(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:oe}),(0,q.jsx)(`span`,{id:_,className:`aone:sr-only`,children:re}),(0,q.jsx)(`span`,{id:v,className:`aone:sr-only`,children:I}),de()]}),N&&C.length>0&&(x?(0,rC.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:fe}),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:fe}))]})}var fW=100;function pW({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,fW)},[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}=IB({selectedItems:t,onStateChange({selectedItems:e,type:t}){t===IB.stateChangeTypes.FunctionRemoveSelectedItem&&r(e)}}),{isOpen:E,getMenuProps:D,getInputProps:O,getItemProps:k,selectedItem:A}=uB({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 uB.stateChangeTypes.InputKeyDownEnter:case uB.stateChangeTypes.ItemClick:n&&(r([n]),l(``));break;case uB.stateChangeTypes.InputChange:{let t=e??``;l(t),h(t);break}case uB.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 lW(e),()=>uW(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)(TL,{icon:Tj,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)(TL,{icon:kj,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 mW(...e){return aj(Ak(e))}function hW({className:e,...t}){return(0,q.jsx)(LS,{role:`status`,"aria-label":`Loading`,className:mW(`aone:size-4 aone:animate-spin`,e),...t})}var gW=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})]})});gW.displayName=`TopLayerDialog`;function _W({...e}){return(0,q.jsx)(sE,{"data-slot":`dialog`,...e})}function vW({...e}){return(0,q.jsx)(cE,{"data-slot":`dialog-portal`,...e})}function yW({className:e,...t}){return(0,q.jsx)(lE,{"data-slot":`dialog-overlay`,className:oj(`aone:fixed aone:inset-0 aone:z-50 aone:bg-black/50 aone:data-[state=closed]:animate-out aone:data-[state=closed]:fade-out-0 aone:data-[state=open]:animate-in aone:data-[state=open]:fade-in-0`,e),...t})}function bW({className:e,children:t,showCloseButton:n=!0,portalContainer:r,overlayClassName:i,...a}){return(0,q.jsxs)(vW,{container:r??void 0,"data-slot":`dialog-portal`,children:[(0,q.jsx)(yW,{className:i}),(0,q.jsxs)(uE,{"data-slot":`dialog-content`,className:oj(`aone:fixed aone:top-[50%] aone:left-[50%] aone:z-50 aone:grid aone:w-full aone:max-w-[calc(100%-2rem)] aone:translate-x-[-50%] aone:translate-y-[-50%] aone:gap-4 aone:rounded-lg aone:border aone:bg-background aone:p-6 aone:shadow-lg aone:duration-200 aone:outline-none 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 aone:sm:max-w-lg`,e),...a,children:[t,n&&(0,q.jsxs)(fE,{"data-slot":`dialog-close`,className:`aone:absolute aone:top-4 aone:right-4 aone:z-60 aone:pointer-events-auto aone:rounded-xs aone:bg-white/90 aone:opacity-70 aone:ring-offset-background aone:transition-opacity aone:hover:opacity-100 aone:focus:outline-hidden aone:disabled:pointer-events-none aone:data-[state=open]:bg-accent aone:data-[state=open]:text-muted-foreground aone:[&_svg]:pointer-events-none aone:[&_svg]:shrink-0 aone:[&_svg:not([class*=size-])]:size-4`,children:[(0,q.jsx)(BS,{}),(0,q.jsx)(`span`,{className:`aone:sr-only`,children:`Close`})]})]})]})}function xW({className:e,...t}){return(0,q.jsx)(dE,{"data-slot":`dialog-title`,className:oj(`aone:text-lg aone:leading-none aone:font-semibold`,e),...t})}function SW({...e}){return(0,q.jsx)(wk,{"data-slot":`popover`,...e})}function CW({className:e,align:t=`center`,sideOffset:n=4,portalContainer:r,...i}){return(0,q.jsx)(Dk,{container:r,children:(0,q.jsx)(Ok,{"data-slot":`popover-content`,align:t,sideOffset:n,className:oj(`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 wW({...e}){return(0,q.jsx)(Tk,{"data-slot":`popover-anchor`,...e})}var TW=768;function EW(){let[e,t]=K.useState(()=>typeof window<`u`&&window.innerWidth<TW);return K.useEffect(()=>{let e=window.matchMedia(`(max-width: ${TW-1}px)`),n=()=>{t(window.innerWidth<TW)};return e.addEventListener(`change`,n),()=>e.removeEventListener(`change`,n)},[]),e}var DW=`aone:text-[#16A34A]`,OW=`aone:text-[#5895F7]`;function kW({date:e,startDate:t,endDate:n,onChange:r,onHover:i,stops:a,onlyDirects:o,previewDate:s,referenceDates:c,minDate:l}){let u=Nm(new Date),d=l||u,f=t?Lm(e,t):!1,p=t&&n?Mh(e,Nm(t))&&Nh(e,n):!1,m=n?Lm(e,n):!1,h=Nh(e,d),g=s&&!f&&!m?Lm(e,s):!1,_=c?.filter(t=>Lm(Nm(e),Nm(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,[DW]:!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,[OW]:!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 AW({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)(Bm(n)),m=Oh(f,`MMMM yyyy`),h=Om(f),g=a?null:i;(0,K.useEffect)(()=>{r&&queueMicrotask(()=>p(Bm(r)))},[r]),(0,K.useEffect)(()=>{t&&queueMicrotask(()=>p(Bm(t)))},[t]),(0,K.useEffect)(()=>{let e=Om(f);s(e,Cm(e,42))},[f,s]);let _=Array(42).fill(0).map((e,t)=>Cm(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(Kg(f,{months:1})),"aria-label":`Previous month, go to ${Oh(Kg(f,{months:1}),`MMMM yyyy`)}`,"data-testid":`calendar-previous-month-button`,children:(0,q.jsx)(_j,{})}),(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(Tm(f,{months:1})),"aria-label":`Next month, go to ${Oh(Tm(f,{months:1}),`MMMM yyyy`)}`,"data-testid":`calendar-next-month-button`,children:(0,q.jsx)(vj,{})})]})}),(0,q.jsx)(`div`,{className:`aone:grid aone:grid-cols-7 aone:border-b`,role:`rowgroup`,"aria-label":`Weekday headers`,children:q_.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=Oh(n,`yyyy-MM-dd`),a=l?.[i];return(0,q.jsx)(kW,{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 jW({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)(TL,{icon:jj,"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 MW=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 zm(c)?Nm(c):null},NW=/^\d{2}\/\d{2}\/\d{2}$/,PW=e=>e.toLocaleDateString(`en-US`,{year:`2-digit`,month:`2-digit`,day:`2-digit`}),FW=(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)}`}},IW=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`)}`},LW=e=>{if(!NW.test(e))return null;let t=Hg(e,`MM/dd/yy`,new Date);return zm(t)&&PW(Nm(t))===e?Nm(t):null};function RW({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,I]=(0,K.useState)(!1),[ie,ae]=(0,K.useState)(!1),[oe]=(0,K.useState)(()=>p||new Date),se=(0,K.useRef)(n),ce=()=>Date.now()<b.current,le=()=>{ce()||F(!0)},ue=()=>{b.current=Date.now()+250,F(!1)},de=e=>{if(e){le();return}ue()};(0,K.useEffect)(()=>{se.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 fe=Nm(new Date),pe=wm(fe,6),me=e=>{w(e);let t=LW(e);if(e===``||!e){O(null),M(null);return}if(!t){O(`Enter a date in MM/DD/YY format`),M(null);return}if(Nh(t,fe)){O(`Date cannot be in the past`),M(null);return}if(Mh(t,pe)){O(`Date must be within 6 months`),M(null);return}if(g&&Nh(t,g)){O(`Date must be no earlier than `+g.toLocaleDateString()),M(null);return}O(null),M(t),ne(t),N&&Nh(N,t)&&(P(null),E(``))},he=e=>{if(i)return;E(e);let t=LW(e);if(e===``||!e){A(null),P(null);return}if(!t){A(`Enter a date in MM/DD/YY format`),P(null);return}if(Nh(t,fe)){A(`Date cannot be in the past`),P(null);return}if(Mh(t,pe)){A(`Date must be within 6 months`),P(null);return}if(!j){A(`Enter departure date first`),P(null);return}if(Nh(t,j)){A(`Return date must be after departure`),P(null);return}if(g&&Nh(t,g)){A(`Date must be no earlier than `+g.toLocaleDateString()),P(null);return}A(null),P(t),ne(t)},ge=()=>me(C),_e=()=>he(T),ve=e=>{let t=e.getTime()<(j?.getTime()||0);j?!N&&t?M(e):N?j&&N&&(Lm(e,j)&&Lm(e,N)?(M(e),P(null)):Nh(e,N)&&Nh(e,Cm(j,3))?M(e):P(e)):i?M(e):P(e):M(e)},ye=()=>{M(null),P(null),w(``),E(``),O(null),A(null),ne(null),se.current(null,null)};(0,K.useEffect)(()=>{se.current(j,N)},[j,N]),(0,K.useEffect)(()=>{queueMicrotask(()=>{j?(w(PW(j)),O(null)):D||w(``)})},[j]),(0,K.useEffect)(()=>{queueMicrotask(()=>{N?(E(PW(N)),A(null)):k||E(``)})},[N]);let L={};o&&(L[`--color-primary`]=o),s&&(L[`--color-secondary`]=s);let be=EW(),R=(0,K.useId)(),xe=`${R}-description`,Se=(0,q.jsxs)(`div`,{ref:y,onClick:le,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)(gj,{})}),(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=FW(e.target.value,C);w(t),O(null),ne(MW(t)),se.current(null,N)},onFocus:()=>{I(!0),le()},onBlur:e=>{let t=IW(e.target.value);w(t),me(t),I(!1)},onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),ge(),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)(jW,{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)(gj,{})}),(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:ie?`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=FW(e.target.value,T);E(t),A(null),ne(MW(t)),se.current(j,null)},onFocus:()=>{ae(!0),le()},onBlur:e=>{let t=IW(e.target.value);E(t),he(t),ae(!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)(jW,{message:k})})]})]})]})]})]});return(0,q.jsxs)(`div`,{id:`A1-DateRangePicker`,ref:v,className:a,style:L,role:`group`,"aria-label":`Date range picker`,"aria-describedby":xe,children:[be?(0,q.jsxs)(_W,{open:ee,onOpenChange:de,children:[Se,(0,q.jsxs)(gW,{className:`ao-dialog--calendar-light`,open:ee,onOpenChange:de,"aria-labelledby":R,"aria-describedby":void 0,children:[(0,q.jsx)(xW,{id:R,className:`aone:sr-only`,children:`Filter Options`}),(0,q.jsx)(AW,{origin:e,destination:t,initialDate:oe,startDate:j,endDate:N,previewDate:te,onChange:ve,onMonthViewChange:r,flightCalendar:u,flightCalendarStatus:d,onlyDirects:f,referenceDates:h,minDate:g},oe.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:ye,"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:ue,"data-testid":`date-range-picker-done-button`,children:`Done`})]})]})]}):(0,q.jsxs)(SW,{open:ee,onOpenChange:de,children:[(0,q.jsx)(wW,{asChild:!0,children:Se}),(0,q.jsxs)(CW,{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)(AW,{origin:e,destination:t,initialDate:oe,startDate:j,endDate:N,previewDate:te,onChange:ve,onMonthViewChange:r,flightCalendar:u,flightCalendarStatus:d,onlyDirects:f,referenceDates:h,minDate:g},oe.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:ye,"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:ue,"data-testid":`date-range-picker-popover-done-button`,children:`Done`})]})]})]}),(0,q.jsx)(`div`,{id:xe,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 zW=W({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:zf([`dark`,`light`]).optional(),defaultNearbyDatesForLowerFares:U().optional(),shadowRoot:Ap(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:Ap(e=>typeof e==`function`).optional(),onDestinationChange:Ap(e=>typeof e==`function`).optional(),fmaDomain:V().optional(),hideBranding:U().optional(),hideCarButton:U().optional(),disableOrigins:U().optional(),disableDestinations:U().optional(),experimentId:V().optional(),autocompleteType:zf(z_).optional(),arrivalAirportLabel:V().optional(),departureAirportLabel:V().optional(),departureDateLabel:V().optional(),returnDateLabel:V().optional(),channel:zf(E_).optional()}),BW=new Vb;function VW(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 HW({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=L_.kayak}){let[O,k]=(0,K.useState)({origins:[],destinations:[],startDate:null,endDate:null,oneWay:!1,defaultNearbyDatesForLowerFares:!!p}),{clickId:A}=by(),j=(0,K.useMemo)(()=>{let e=VW(O.origins);return b(e),e},[O.origins,b]),M=(0,K.useMemo)(()=>{let e=VW(O.destinations);return x(e),e},[O.destinations,x]),N=O.origins[0],P=O.destinations[0],ee=!!(N?.itemType===am.METRO&&N?.iata_code),F=!!(P?.itemType===am.METRO&&P?.iata_code);if(!A_.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!==``),I=i?.split(`,`).map(e=>e.toLocaleUpperCase().trim()).filter(e=>e!==``),ie=i===r&&i?.length===2&&r?.length===2,[ae,oe]=(0,K.useState)(!1),se=ae?!!ne:!!te,ce=ae?!!te:!!ne,[le,ue]=(0,K.useState)(null),[de,fe]=(0,K.useState)(null),pe=(0,K.useMemo)(()=>O.origins?.length&&O.destinations?.length&&O.startDate?O.endDate&&O.oneWay===!1?!0:!(!O.endDate&&O.oneWay===!1):!1,[O]),me=e=>D===L_.schedule_data?(0,q.jsx)(pW,{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)(dW,{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:he,status:ge,setQuery:_e}=FV({key:`origin-suggest`,apiDomain:e,airportIATA:M,providersArr:I,airlinesArr:re,autocompleteType:D}),ve=(0,K.useMemo)(()=>D===L_.schedule_data?he?.map((e,t)=>({...e,sectionIndex:t,type:`airport`,key:e.iata_code||`airport-${t}`}))||[]:(0,aW.default)(he?.filter(e=>!!e.nearbyAirports?.length||e.itemType===am.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:am.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===am.METRO&&r.iata_code)return!0;let i=n.at(t+1);if(!i||i.type!==`airport`)return!1}return!0}),[he,D]),{data:ye,status:L,setQuery:be}=FV({key:`destination-suggest`,apiDomain:e,airportIATA:j,providersArr:I||[],airlinesArr:re||[],autocompleteType:D}),R=(0,K.useMemo)(()=>D===L_.schedule_data?ye?.map((e,t)=>({...e,sectionIndex:t,type:`airport`,key:e.iata_code||`airport-${t}`}))||[]:(0,aW.default)(ye?.filter(e=>!!e.nearbyAirports?.length||e.itemType===am.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:am.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===am.METRO&&r.iata_code)return!0;let i=n.at(t+1);if(!i||i.type!==`airport`)return!1}return!0}),[ye,D]),xe=(0,K.useMemo)(()=>le?Im([le,new Date]):null,[le]),Se=(0,K.useMemo)(()=>O.startDate?Cm(O.startDate,1):null,[O.startDate]),Ce=(0,K.useMemo)(()=>({origin:j,destination:M,startDate:xe||void 0,endDate:de||void 0,departureLocationType:ee?am.METRO:am.AIRPORT,arrivalLocationType:F?am.METRO:am.AIRPORT}),[j,M,xe,de,ee,F]),we=(0,K.useMemo)(()=>({origin:M,destination:j,startDate:Se||void 0,endDate:de||void 0,departureLocationType:F?am.METRO:am.AIRPORT,arrivalLocationType:ee?am.METRO:am.AIRPORT}),[M,j,Se,de,F,ee]),{data:Te,status:Ee}=ZV({apiDomain:e,params:Ce}),{data:De,status:Oe}=ZV({apiDomain:e,params:we});(0,K.useEffect)(()=>{if(te&&NV({query:te,searchType:P_.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?am.METRO:am.AIRPORT};k(n=>({...n,origins:[{...e,type:`airport`,key:t.id,sectionIndex:-1,disabled:T}]}))}}),ne){let e=ne.split(`,`).map(e=>NV({query:e,searchType:P_.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?am.METRO:am.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 ke=(0,K.useCallback)((e,n)=>{k({...O,startDate:e,endDate:n}),(e||n)&&Rv({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]),Ae=(0,K.useCallback)((e,t)=>{ue(t=>t&&t.getTime()===e.getTime()?t:e),fe(e=>e&&e.getTime()===t.getTime()?e:t)},[]),je=()=>{let{origins:e,destinations:t}=O;oe(e=>!e),k({...O,origins:t,destinations:e})},Me=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`]&&!ie){let e=`-flexible-3days`;d+=e,p+=e}let m=r.cabin,b=r.pax,x=$_({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:I?.join(`,`),airlines:re?.join(`,`)},params:{enc_cid:A||``,enc_lid:F_({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?am.METRO:am.AIRPORT,arrival_location_type:F?am.METRO:am.AIRPORT,from_url:encodeURIComponent(window?.location.href)}});Rv({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`)},Ne=[{display:`Roundtrip`,value:`roundtrip`},{display:`One-way`,value:`one-way`}],Pe=[{display:`Economy`,value:J_.enum.economy},{display:`Premium Economy`,value:J_.enum.premium},{display:`Business`,value:J_.enum.business},{display:`First`,value:J_.enum.first}],Fe=Array(9).fill(0).map((e,t)=>{let n=t+1;return{value:Y_.options[t],display:`${n} Traveler${n>1?`s`:``}`}}),Ie=[`Flights`,...w?[]:[`Cars`]],Le=(0,K.useMemo)(()=>h&&ne?.includes(h)?`to`:`from`,[h,ne]),z=(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))}),Re=(0,q.jsx)(cV,{hideByDefault:!0}),ze=(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)(JV,{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:z}),(0,q.jsx)(`div`,{className:`aone:block aone:@2xl:hidden`,children:z}),(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:Re})})]});return(0,q.jsxs)(Wb,{client:BW,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:Me,children:[!C&&ze,(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:Ne.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}`))})]}),!ie&&(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:me({dataTestId:`flight-search-form-origin`,fieldLabel:`Origin`,icon:ge===`pending`?(0,q.jsx)(hW,{}):(0,q.jsx)(TL,{className:`aone:w-6 aone:h-6`,icon:Tj,style:{width:`24px`,height:`24px`}}),placeholder:`From?`,disabled:se,items:ve||[],selectedItems:O.origins,onInputChange:e=>_e(e),onSelectedItemsChange:e=>{let n=T?e?.slice(0,1):e;Rv({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:je,"aria-label":`Switch Origin and Destination`,"data-testid":`flight-search-switch-airports-button`,children:(0,q.jsx)(QV,{})}),(0,q.jsx)(`div`,{className:`aone:flex aone:items-center aone:w-full`,children:me({dataTestId:`flight-search-form-destination-autocomplete`,fieldLabel:`Destination`,icon:L===`pending`?(0,q.jsx)(hW,{}):(0,q.jsx)(TL,{className:`aone:w-6 aone:h-6`,icon:Cj,style:{width:`24px`,height:`24px`}}),placeholder:`To?`,disabled:ce,items:R||[],selectedItems:O.destinations,onInputChange:e=>be(e),onSelectedItemsChange:e=>{let n=E?e?.slice(0,1):e;Rv({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)(RW,{origin:j,destination:M,startDateLabel:c,endDateLabel:l,onChange:ke,onMonthViewChange:Ae,oneWay:O.oneWay,shadowRoot:m,onlyDirects:I&&re&&I?.length>0&&re?.length>0,flightCalendar:!O.startDate||O.oneWay?Te:De,flightCalendarStatus:!O.startDate||O.oneWay?Ee:Oe})}),(0,q.jsxs)(`div`,{className:`aone:flex aone:flex-col aone:gap-6 aone:items-center aone:justify-center aone:@5xl:shrink-0`,children:[!ie&&(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":pe?`Search flights`:`Search flights - Please complete all required fields`,"aria-disabled":!pe,tabIndex:0,type:`submit`,"data-testid":`flight-search-submit-button`,onClick:e=>{pe||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 ${pe?`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)(IV,{}),(0,q.jsx)(`span`,{className:`aone:text-base`,children:`Search`})]})]})]})]})]})}),(0,q.jsx)(`div`,{className:`aone:visible aone:@2xl:hidden`,children:!C&&Re})]})}var UW=Object.keys(zW.shape);function WW(e){typeof e.destination!=`string`&&typeof e.destinations==`string`&&(e.destination=e.destinations),typeof e.destinations!=`string`&&typeof e.destination==`string`&&(e.destinations=e.destination)}function GW(e){return typeof e.destination==`string`&&e.destination.trim()!==``||typeof e.destinations==`string`&&e.destinations.trim()!==``}function KW(e,t){return GV(t).map(t=>e.getAttribute(t)).find(e=>e!==null&&e.trim()!==``)}function qW(e,t,n){let r={...n},i=KW(e,`origin`),a=KW(e,`destination`)??KW(e,`destinations`);WW(r),r.primaryColor==null&&t?.primaryColor&&(r.primaryColor=t.primaryColor),r.secondaryColor==null&&t?.secondaryColor&&(r.secondaryColor=t.secondaryColor);for(let t of UW){let n=GV(t).map(t=>e.getAttribute(t)).find(e=>e!==null&&e.trim()!==``);n!==void 0&&(r[t]=n)}return WW(r),a&&!i?delete r.origin:r.origin==null&&!GW(r)&&t?.iata&&(r.origin=t.iata.toUpperCase()),(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=KV(r.defaultNearbyDatesForLowerFares,!1)),typeof r.consentDataSharing==`string`&&(r.consentDataSharing=KV(r.consentDataSharing,!0)),typeof r.consentFunctional==`string`&&(r.consentFunctional=KV(r.consentFunctional,!0)),typeof r.consentAnalytics==`string`&&(r.consentAnalytics=KV(r.consentAnalytics,!0)),typeof r.consentAdvertising==`string`&&(r.consentAdvertising=KV(r.consentAdvertising,!0)),typeof r.hideCarButton==`string`&&(r.hideCarButton=KV(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 JW(e,t,n,r){return{...qW(e,n,r),apiDomain:t,...r.userStyleBlock?.trim()?{userStyleBlock:r.userStyleBlock}:{}}}var YW=new Vb;function XW(e){let{userStyleBlock:t,...n}=e;return(0,q.jsx)(Wb,{client:YW,children:(0,q.jsxs)(dx,{useSessionStorageOnly:!0,children:[(0,q.jsx)(`style`,{children:gx}),t?(0,q.jsx)(`style`,{children:t}):null,(0,q.jsx)(HW,{...n})]})})}function ZW(e){if(!e||typeof e.iata!=`string`)return;let t=e.iata.trim().toUpperCase();return t.length===3?t:void 0}var QW=Object.keys(zW.shape),$W=[...new Set([...QW.flatMap(e=>GV(e)),`borderradius`,`border-radius`,`theme`,K_,`id`])],eG=class extends HTMLElement{_shadowRoot;_mountPoint;_reactRoot;_renderInProgress=!1;_renderQueued=!1;_renderScheduled=!1;_mountTelemetrySent=!1;_lastPublicConfigTelemetryKey=null;static get observedAttributes(){return Array.from($W)}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=gv(this),t=Sv(),n=null,r=!1,i={attempted:!1,durationMs:0},a;if(e&&t){let t=await Cv(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=jv(n),s=window[rm],c=JW(this,`https://flymyairport.vercel.app`,s,o),l=ZW(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,Ay(!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(`${vv}: airfare-search — managed instance config not applied; using host attributes and window defaults.`),this._paintAirfareSearch(c),c.consentAnalytics&&!this._mountTelemetrySent&&(this._mountTelemetrySent=!0,jy(!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&&ev.test(r.primaryColor),a=r.secondaryColor!=null&&ev.test(r.secondaryColor),o=r.primaryColor??`210 100% 50%`,s=r.secondaryColor??`210 100% 50%`,c=i?rv(o):o,l=a?rv(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`,qV(u)),r.theme===`dark`?this.setAttribute(`data-mode`,`dark`):this.removeAttribute(`data-mode`),(this._reactRoot??=dv.createRoot(n)).render((0,q.jsx)(XW,{...r}))}};customElements.get(`fma-airfare-search`)||customElements.define(`fma-airfare-search`,eG);var tG=new Map,nG=3600*1e3,rG=3600*12*1e3;function iG(){let e=Date.now(),t=e-nG,n=e+rG;return{scheduleWindowStartUtc:new Date(t).toISOString(),scheduleWindowEndUtcExclusive:new Date(n).toISOString()}}function aG(e){let t=e?.scheduleWindowStartUtc?.trim(),n=e?.scheduleWindowEndUtcExclusive?.trim();return t&&n?{scheduleWindowStartUtc:t,scheduleWindowEndUtcExclusive:n}:iG()}function oG(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 sG(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;let i=r.name,a=r.cityName;t[n]={timezoneRegionName:e.trim(),...typeof i==`string`&&i.trim()?{name:i.trim()}:{},...typeof a==`string`&&a.trim()?{cityName:a.trim()}:{}}}return t}function cG(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:lG(n)}function lG(e){if(e.apiVersion!==3||typeof e.instanceId!=`string`||typeof e.iata!=`string`||e.mode!==`arrivals`&&e.mode!==`departures`&&e.mode!==`both`&&e.mode!==`weather`||!Array.isArray(e.arrivals)||!Array.isArray(e.departures)||typeof e.asOfUtc!=`string`)return null;let t=oG(e.airlines);if(!t)return null;let n=sG(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 uG(){return`https://api.airportonellc.com`.replace(/\/+$/,``)}function dG(e,t){return`${e}\0${t.scheduleWindowStartUtc}\0${t.scheduleWindowEndUtcExclusive}`}function fG(e,t){let n=uG();if(!n||!e.trim())return Promise.resolve({data:null,metrics:{attempted:!1,durationMs:0}});let r=aG(t),i=dG(e,r),a=tG.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=cG(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{tG.delete(i)}})();return tG.set(i,u),u}var pG={panelBackgroundColor:`#ffffff`,primaryTextColor:`#0f172a`,accentTextColor:`#0f766e`,mutedTextColor:`#64748b`,headerIconTileBackgroundColor:`#f1f5f9`};function mG(e){let t=e?.trim();return t&&t.length>0?t:void 0}function hG(e,t){let n=e[t];if(typeof n!=`string`)return;let r=n.trim();return r.length>0?r:void 0}function gG(e){let t={...pG};if(!e||typeof e!=`object`||Array.isArray(e))return t;let n=e;return{panelBackgroundColor:hG(n,`panelBackgroundColor`)??t.panelBackgroundColor,primaryTextColor:hG(n,`primaryTextColor`)??t.primaryTextColor,accentTextColor:hG(n,`accentTextColor`)??t.accentTextColor,mutedTextColor:hG(n,`mutedTextColor`)??t.mutedTextColor,headerIconTileBackgroundColor:hG(n,`headerIconTileBackgroundColor`)??t.headerIconTileBackgroundColor}}function _G(e,t={}){let n=e?.variables,r=mG(t.primaryColor),i=mG(t.secondaryColor),a=e=>({...e,accentTextColor:r??e.accentTextColor,headerIconTileBackgroundColor:i??e.headerIconTileBackgroundColor});if(!n||typeof n!=`object`||Array.isArray(n))return a({...pG});let o=n.fids;if(!o||typeof o!=`object`||Array.isArray(o))return a({...pG});let s=o.theme;return a(gG(s))}function vG(e){return`color-mix(in srgb, ${e.trim()} 18%, transparent)`}var yG={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`]},bG={prefix:`fas`,iconName:`bell`,icon:[448,512,[128276,61602],`f0f3`,`M224 0c-17.7 0-32 14.3-32 32l0 3.2C119 50 64 114.6 64 192l0 21.7c0 48.1-16.4 94.8-46.4 132.4L7.8 358.3C2.7 364.6 0 372.4 0 380.5 0 400.1 15.9 416 35.5 416l376.9 0c19.6 0 35.5-15.9 35.5-35.5 0-8.1-2.7-15.9-7.8-22.2l-9.8-12.2C400.4 308.5 384 261.8 384 213.7l0-21.7c0-77.4-55-142-128-156.8l0-3.2c0-17.7-14.3-32-32-32zM162 464c7.1 27.6 32.2 48 62 48s54.9-20.4 62-48l-124 0z`]},xG={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`]};function SG(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 CG(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 wG(e){let{gate:t,terminal:n}=SG(e);return t.length>0||n.length>0}function TG(e,t){let n=t.trim().toUpperCase(),r=e.departure,i=e.arrival,a=CG(r,n),o=CG(i,n),s=!!(r?.airport&&i?.airport);if(e.direction===`departure`){if(a)return wG(r)?r:o&&wG(i)?i:r;if(!a&&o&&wG(i))return i;if(!s||!a&&!o&&!(r?.airport&&i?.airport)){if(wG(r))return r;if(wG(i))return i}return r??i}if(e.direction===`arrival`){if(o)return wG(i)?i:a&&wG(r)?r:i;if(!o&&a&&wG(r))return r;if(!s||!a&&!o&&!(r?.airport&&i?.airport)){if(wG(i))return i;if(wG(r))return r}return i??r}}function EG(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)}function DG(e){let t=e?.utc?.trim()||e?.local?.trim();return t?EG(t):null}function OG(e){return e?DG(e.published)??DG(e.scheduled):null}function kG(e){let t=e.departure?.gateTime,n=e.arrival?.gateTime;if(!t||!n)return null;let r=OG(t),i=OG(n);if(!r||!i)return null;let a=i.getTime()-r.getTime();return a>=0?a:null}function AG(e){let t=e.departure?.gateTime?.actual,n=e.arrival?.gateTime?.actual;if(!t||!n)return null;let r=DG(t),i=DG(n);if(!r||!i)return null;let a=i.getTime()-r.getTime();return a>=0?a:null}function jG(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`}function MG(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}}var NG={kind:`on-time`};function PG(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 FG(e){let t=e?.utc?.trim()||e?.local?.trim();if(!t)return null;let n=EG(t);return n?n.getTime():null}function IG(e){if(!e)return NG;let t=FG(e.estimated),n=FG(e.actual);if(t===null||n===null)return NG;let r=Math.round((n-t)/6e4);return Math.abs(r)<=15?NG:r>0?{kind:`delayed`,minutesDelta:r}:{kind:`early`,minutesDelta:-r}}function LG(e){return e.departureGatePunctuality??NG}function RG(e){return e.arrivalGatePunctuality??NG}function zG(e){if(e.kind===`on-time`)return`On-time`;let t=PG(e.minutesDelta);return e.kind===`early`?`${t} early`:`${t} late`}function BG(e){let t=e.direction===`departure`?LG(e):RG(e),n=t.kind===`on-time`?`on-time`:t.kind===`early`?`early`:`delayed`;return{text:zG(t),tone:n}}function VG(e,t){return e.kind===`on-time`?t.mutedTextColor:e.kind===`early`?`rgb(74, 222, 128)`:`rgb(251, 146, 60)`}function HG(e,t){return e===`on-time`?t.mutedTextColor:e===`early`?`rgb(74, 222, 128)`:e===`delayed`?`rgb(251, 146, 60)`:t.accentTextColor}function UG(e,t){return new Intl.DateTimeFormat(`en-CA`,{year:`numeric`,month:`2-digit`,day:`2-digit`,...t?{timeZone:t}:{}}).format(e)}function WG(e,t){return new Intl.DateTimeFormat(`en-US`,{year:`numeric`,...t?{timeZone:t}:{}}).format(e)}function GG(e,t){if(!e)return`—`;try{let n=EG(e);if(!n)return e;let r=t?.trim()||void 0,i=new Date;if(UG(n,r)===UG(i,r))return n.toLocaleTimeString(void 0,{hour:`numeric`,minute:`2-digit`,...r?{timeZone:r}:{}});let a={month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`,...r?{timeZone:r}:{}};return WG(n,r)!==WG(i,r)&&(a.year=`numeric`),n.toLocaleString(void 0,a)}catch{return e}}function KG(e){return!!(e?.utc?.trim()||e?.local?.trim())}function qG(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 JG(e){if(e)return e.actual?.utc?.trim()||e.actual?.local?.trim()||e.estimated?.utc?.trim()||e.estimated?.local?.trim()||void 0}function YG(e,t){if(e)return GG(e,t)}function XG(e,t){let n=e.departure,r=e.arrival;if(!n&&!r)return null;let i=n?.airport?.iata??n?.airport?.fs??`—`,a=r?.airport?.iata??r?.airport?.fs??`—`,o=t[i.trim().toUpperCase()]?.timezoneRegionName?.trim()||void 0,s=t[a.trim().toUpperCase()]?.timezoneRegionName?.trim()||void 0,c=KG(n?.gateTime?.actual),l=KG(n?.runwayTime?.actual),u=KG(r?.runwayTime?.actual),d=KG(r?.gateTime?.actual),f=e.status?.toUpperCase()??``;f===`ACTIVE`&&(c=!0,l=!0),f===`LANDED`&&(c=!0,l=!0,u=!0);let p=null;return!c&&(KG(n?.gateTime?.estimated)||KG(n?.gateTime?.scheduled))?p=0:!l&&c&&KG(n?.runwayTime?.estimated)?p=1:!u&&l&&KG(r?.runwayTime?.estimated)?p=2:!d&&u&&KG(r?.gateTime?.estimated)&&(p=3),f===`ACTIVE`&&!u&&(p=2),f===`LANDED`&&u&&!d&&(p=3),[{key:`dep-gate`,title:`Gate out`,airport:i,complete:c,current:p===0,timeStr:YG(qG(n?.gateTime),o),punctuality:LG(e)},{key:`dep-rwy`,title:`Takeoff`,airport:i,complete:l,current:p===1,timeStr:YG(JG(n?.runwayTime),o),punctuality:IG(n?.runwayTime)},{key:`arr-rwy`,title:`Landing`,airport:a,complete:u,current:p===2,timeStr:YG(JG(r?.runwayTime),s),punctuality:IG(r?.runwayTime)},{key:`arr-gate`,title:`Gate in`,airport:a,complete:d,current:p===3,timeStr:YG(qG(r?.gateTime),s),punctuality:RG(e)}]}var ZG={gridTemplateColumns:`repeat(4, minmax(0, 1fr))`,columnGap:6},QG=`aone:h-[3px] aone:min-w-0 aone:rounded-sm aone:self-center`,$G=22;function eK({row:e,theme:t,airports:n={}}){let r=XG(e,n);if(!r)return null;let i=r,a=t.accentTextColor,o=vG(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:$G},children:[e===0?(0,q.jsx)(`div`,{className:`aone:min-w-0 aone:flex-1`,"aria-hidden":!0}):(0,q.jsx)(`div`,{className:QG,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:QG,style:{flex:1,minWidth:0,backgroundColor:i[e].complete?a:o,opacity:i[e].complete?1:.45}})]},`track-${t.key}`)}function l(e){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?(0,q.jsx)(`div`,{className:`aone:mt-1.5 aone:text-sm aone:tabular-nums aone:whitespace-nowrap`,style:{color:s},children:e.timeStr}):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:VG(e.punctuality,t),overflowWrap:`break-word`,wordBreak:`normal`},children:zG(e.punctuality)})]})}function u(e){let n=e.key===`dep-rwy`?xG:e.key===`arr-rwy`?yG: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:$G,height:$G,backgroundColor:e.complete?a:`transparent`,border:r},"aria-hidden":!0,children:(0,q.jsx)(TL,{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:$G,height:$G,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:ZG,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:ZG,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 tK(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 nK=[`published`,`scheduled`,`estimated`,`actual`],rK=[`estimated`,`actual`];function iK(e,t){let n=EG(e);if(!n)return e;let r=t?.trim()||void 0;return n.toLocaleString(void 0,{month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`,...r?{timeZone:r}:{}})}function aK(e,t){let n=e?.trim().toUpperCase();if(n)return t[n]?.timezoneRegionName?.trim()||void 0}function oK(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 nK){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 sK(e){if(!e)return!1;let t=e.gateTime,n=e.runwayTime,r=t&&nK.some(e=>t[e]?.utc||t[e]?.local),i=n&&rK.some(e=>n[e]?.utc||n[e]?.local);return!!(r||i)}function cK({phaseLabel:e,pair:t,theme:n,timeZone:r}){if(!t||!t.utc&&!t.local)return null;let i=t.local?.trim(),a=i&&i.length>0&&i!==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?iK(t.utc,r):`—`,a?(0,q.jsxs)(`span`,{style:{color:n.mutedTextColor},children:[` · `,i]}):null]})]})}function lK({title:e,leg:t,theme:n,timeZone:r}){if(!t)return null;let i=t.gateTime,a=t.runwayTime,o=i&&nK.some(e=>i[e]?.utc||i[e]?.local),s=a&&rK.some(e=>a[e]?.utc||a[e]?.local);return!o&&!s?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}),o?(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:nK.map(e=>(0,q.jsx)(cK,{phaseLabel:e.charAt(0).toUpperCase()+e.slice(1),pair:i?.[e],theme:n,timeZone:r},e))})]}):null,s?(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:rK.map(e=>(0,q.jsx)(cK,{phaseLabel:e.charAt(0).toUpperCase()+e.slice(1),pair:a?.[e],theme:n,timeZone:r},e))})]}):null]})}function uK(e,t){let n=t.trim();return n?`${e} · ${n}`:e}function dK({row:e,theme:t}){let n=kG(e),r=AG(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:jG(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:jG(r)})]})]})]})}function fK({row:e,airports:t,theme:n,operatingCarrierName:r}){let i=e.departure?.airport?.iata??e.departure?.airport?.fs??``,a=e.arrival?.airport?.iata??e.arrival?.airport?.fs??``,o=sK(e.departure),s=sK(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:n.primaryTextColor},children:[(0,q.jsx)(`span`,{style:{color:n.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:n.primaryTextColor},children:[(0,q.jsxs)(`span`,{style:{color:n.mutedTextColor},children:[`Operating carrier`,` `]}),r?`${r} (${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:n.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:n.mutedTextColor},children:`Departure · `}),(0,q.jsx)(`span`,{style:{color:VG(LG(e),n),wordBreak:`break-word`,overflowWrap:`break-word`},children:zG(LG(e))})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`span`,{style:{color:n.mutedTextColor},children:`Arrival · `}),(0,q.jsx)(`span`,{style:{color:VG(RG(e),n),wordBreak:`break-word`,overflowWrap:`break-word`},children:zG(RG(e))})]})]})]}),(0,q.jsx)(dK,{row:e,theme:n}),(0,q.jsx)(eK,{row:e,theme:n,airports:t}),(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)(lK,{title:uK(`Departure`,i),leg:e.departure,theme:n,timeZone:aK(i,t)}),(0,q.jsx)(lK,{title:uK(`Arrival`,a),leg:e.arrival,theme:n,timeZone:aK(a,t)})]})]})}function pK(e){let t=e.marketingCarrier??e.operatingCarrier;return t?.iata?t.iata:t?.fs?t.fs:``}function mK(e){let t=pK(e),n=e.flightNumber?.trim();return t&&n?`${t} ${n}`:n||e.flightId}function hK(e){let t=e.marketingCarrier??e.operatingCarrier;return t?.iata?.trim().toUpperCase()||(t?.fs?.trim().toUpperCase()??``)}function gK(e){return e?.iata?.trim().toUpperCase()||(e?.fs?.trim().toUpperCase()??``)}function _K(e,t){let n=hK(e);return n&&t[n]?.name?.trim()||null}function vK(e,t){let n=hK(e);return n&&t[n]?.iconUrl?.trim()||null}function yK(e,t){let n=gK(e);return n&&t[n]?.name?.trim()||null}function bK(e){let t=e.arrival?.baggage?.trim();return t&&t.length>0?t:`—`}function xK(e){return typeof e==`string`?e.trim():typeof e==`number`&&Number.isFinite(e)?String(e):``}function SK(e,t){let n=TG(e,t);return{gate:xK(n?.gate)||`—`,terminal:xK(n?.terminal)||`—`}}function CK(e,t){return xK(TG(e,t)?.terminal).length>0}function wK(e){return e.direction===`arrival`?e.arrival?.gateTime?.scheduled?.utc:e.departure?.gateTime?.scheduled?.utc}function TK(e){let t=e.direction===`departure`?e.departure:e.arrival;return t?.gateTime?.published?.utc??t?.gateTime?.scheduled?.utc}function EK(e){let t=e.direction===`departure`?e.departure:e.arrival;return t?.gateTime?.actual?.utc??t?.gateTime?.estimated?.utc}function DK(e){if(e)return e.replace(/\s+(?:[A-Z]{2,5}|GMT[+-]\d{1,2}(?::?\d{2})?)$/u,``).trim()}function OK(e,t,n){if(e.displayTime){let n=HG(e.displayTime.punctuality,t);return{timeLabel:DK(e.displayTime.label)??e.displayTime.label,scheduledLabel:DK(e.displayTime.scheduledLabel),statusText:e.displayTime.statusLabel,punctualityColor:n}}let r=BG(e),i=GG(TK(e),n),a=GG(EK(e),n);return r.tone!==`on-time`&&i!==`—`&&a!==`—`&&i!==a?{timeLabel:a,scheduledLabel:i,statusText:r.text,punctualityColor:HG(r.tone,t)}:{timeLabel:GG(wK(e),n),statusText:r.text,punctualityColor:HG(r.tone,t)}}function kK(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:`In Flight`,dotStyle:{backgroundColor:`#34d399`},textStyle:{color:a}};case`SCHEDULED`:return{label:`On-time`,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 AK(e){let t=e.trim(),n=t.match(/^#([0-9a-f]{3}|[0-9a-f]{6})$/i),r=t.match(/^rgba?\(\s*(\d{1,3})[\s,]+(\d{1,3})[\s,]+(\d{1,3})/i),i,a,o;if(n){let e=n[1];if(!e)return`#ffffff`;let t=e.length===3?e.split(``).map(e=>`${e}${e}`).join(``):e;i=parseInt(t.slice(0,2),16),a=parseInt(t.slice(2,4),16),o=parseInt(t.slice(4,6),16)}else if(r){let[,e,t,n]=r;if(!e||!t||!n)return`#ffffff`;i=Number(e),a=Number(t),o=Number(n)}else return`#ffffff`;return(.2126*i+.7152*a+.0722*o)/255>.56?`#0f172a`:`#ffffff`}function jK(e,t){let n=e.trim();if(n)return t[n]?.timezoneRegionName?.trim()||t[n.toUpperCase()]?.timezoneRegionName?.trim()||t[n.toLowerCase()]?.timezoneRegionName?.trim()||void 0}function MK(e,t){let n={hour:`numeric`,minute:`2-digit`};t&&(n.timeZone=t);try{return e.toLocaleTimeString(void 0,n)}catch{return e.toLocaleTimeString(void 0,{hour:`numeric`,minute:`2-digit`})}}function NK(e,t){let n=Math.max(e.dueAtMs-e.intervalStartMs,1);return Math.min(Math.max(t-e.intervalStartMs,0),n)/n*100}function PK({title:e,headerPlaneIcon:t,theme:n,dataRefreshSchedule:r,timezoneRegionName:i,timezoneLabel:a}){let o=r===null?``:`${r.intervalStartMs}-${r.dueAtMs}`,[s,c]=(0,K.useState)(()=>new Date);(0,K.useEffect)(()=>{let e=o?250:15e3,t=globalThis.setInterval(()=>c(new Date),e);return()=>globalThis.clearInterval(t)},[o]);let l=s.getTime(),u=MK(s,i),d=r===null?null:NK(r,l);return(0,q.jsxs)(`header`,{part:`fids-board-header`,style:{display:`flex`,alignItems:`flex-start`,justifyContent:`space-between`,gap:12,paddingLeft:20,paddingRight:20,paddingTop:20,paddingBottom:16,boxSizing:`border-box`,width:`100%`},children:[(0,q.jsxs)(`div`,{part:`fids-board-meta`,style:{display:`flex`,alignItems:`center`,gap:16,minWidth:0,flex:1},children:[(0,q.jsx)(`div`,{style:{width:44,height:44,flexShrink:0,display:`flex`,alignItems:`center`,justifyContent:`center`,borderRadius:8,backgroundColor:n.headerIconTileBackgroundColor},"aria-hidden":!0,children:(0,q.jsx)(TL,{icon:t===`departure`?xG:yG,style:{width:22,height:22,color:`#ffffff`}})}),(0,q.jsx)(`h2`,{part:`fids-board-title`,className:`aone:text-xl aone:font-bold aone:leading-tight aone:tracking-tight`,style:{color:n.accentTextColor,margin:0,minWidth:0},children:e})]}),(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:n.accentTextColor,lineHeight:1},children:u}),d===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(d)),"aria-label":`Progress until flights refresh`,style:{width:`100%`,maxWidth:96,height:3,borderRadius:2,backgroundColor:vG(n.primaryTextColor),overflow:`hidden`},children:(0,q.jsx)(`div`,{style:{width:`${d}%`,height:`100%`,borderRadius:2,backgroundColor:n.accentTextColor}})}),a?(0,q.jsxs)(`p`,{part:`fids-board-timezone`,style:{margin:0,fontSize:`0.75rem`,fontWeight:700,color:n.mutedTextColor,letterSpacing:`0.05em`,lineHeight:1},children:[`Time Zone: `,a]}):null]})]})}function FK({rows:e,airlines:t,airports:n,theme:r,boardAirportIata:i,tableSection:a}){let o=vG(r.primaryTextColor),s=(0,K.useRef)(null),[c]=(0,K.useState)(()=>new Set),[l,u]=(0,K.useState)(null),[d,f]=(0,K.useState)(!1),p=(0,K.useRef)(!1);(0,K.useEffect)(()=>{let e=s.current;if(!e)return;let t=()=>{let t=e.getBoundingClientRect().width,n=p.current,r=n;n?t>=784&&(r=!1):t<760&&(r=!0),r!==n&&(p.current=r,f(r))};if(t(),typeof ResizeObserver>`u`)return globalThis.addEventListener(`resize`,t),()=>globalThis.removeEventListener(`resize`,t);let n=new ResizeObserver(()=>{t()});return n.observe(e),()=>n.disconnect()},[]);let m={width:`100%`,maxWidth:`100%`,minWidth:0,paddingLeft:d?12:20,paddingRight:d?12:20,paddingBottom:16,boxSizing:`border-box`},h={display:`grid`,gridTemplateColumns:d?`34px minmax(0, 1fr)`:`38px minmax(0, 1.35fr) minmax(0, 2fr) minmax(0, auto)`,alignItems:`center`,gap:d?`14px 10px`:18,width:`100%`,maxWidth:`100%`,minWidth:0,boxSizing:`border-box`,overflow:`hidden`,padding:d?`14px`:`16px 18px`,borderRadius:18,backgroundColor:r.panelBackgroundColor,borderWidth:1,borderStyle:`solid`,borderColor:o,boxShadow:`none`,transition:`box-shadow 160ms ease, border-color 160ms ease, transform 160ms ease`},g=a===`arrivals`,_=e.some(e=>CK(e,i)),v=+!!_+1+ +!!g,y=a===`arrivals`?`Arrival`:`Departs`,b={color:r.mutedTextColor,fontSize:`0.67rem`,fontWeight:700,letterSpacing:`0.05em`,textTransform:`uppercase`,whiteSpace:`nowrap`};return(0,q.jsx)(`div`,{ref:s,part:`fids-board-card-list`,style:{width:`100%`,maxWidth:`100%`,minWidth:0,boxSizing:`border-box`},children:(0,q.jsx)(`div`,{style:m,children:e.length===0?(0,q.jsx)(`div`,{part:`fids-board-empty`,className:`aone:py-8 aone:text-center`,style:{color:r.mutedTextColor},children:`No flights in this view.`}):(0,q.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:12},children:e.map(e=>{let a=e.flightId,s=kK(e.status,r),f=_K(e,t),p=vK(e,t),m=e.callsign?.trim()??``,x=yK(e.operatingCarrier,t),S=oK(e),C=c.has(a),w=OK(e,r,aK(i,n)),T=SK(e,i),E=String(s.dotStyle.backgroundColor??r.accentTextColor),D=l===a;return(0,q.jsxs)(K.Fragment,{children:[(0,q.jsxs)(`article`,{part:`fids-board-row-card`,onMouseEnter:()=>u(a),onMouseLeave:()=>u(null),onFocus:()=>u(a),onBlur:()=>u(null),style:{...h,...D?{borderColor:r.accentTextColor,boxShadow:`0 6px 14px rgba(15, 23, 42, 0.06)`,transform:`translateY(-1px)`}:{}},children:[(0,q.jsx)(`span`,{part:`fids-board-row-airline-icon`,"aria-hidden":!p,style:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,width:34,height:34,overflow:`hidden`,...d?{gridColumn:1,gridRow:1,alignSelf:`center`}:{}},children:p?(0,q.jsx)(`img`,{src:p,alt:f?`${f} icon`:``,style:{display:`block`,maxWidth:`100%`,maxHeight:`100%`,width:`auto`,height:`auto`,objectFit:`contain`},loading:`lazy`,decoding:`async`}):null}),(0,q.jsxs)(`div`,{style:{minWidth:0,color:r.primaryTextColor,...d?{gridColumn:`2 / -1`,gridRow:1,alignSelf:`center`,display:`flex`,flexDirection:`column`,justifyContent:`center`}:{}},children:[(0,q.jsx)(`div`,{part:`fids-board-row-endpoint`,style:{fontSize:`1.05rem`,fontWeight:700,lineHeight:1.15,overflowWrap:`break-word`},children:__(e,n)}),(0,q.jsxs)(`div`,{part:`fids-board-row-airline-line`,style:{display:`flex`,flexWrap:`wrap`,alignItems:`baseline`,columnGap:6,rowGap:2,marginTop:4,fontSize:`0.78rem`,lineHeight:1.2,color:r.mutedTextColor},children:[f?(0,q.jsx)(`span`,{style:{fontWeight:700},children:f}):null,(0,q.jsx)(`span`,{className:`aone:tabular-nums`,children:mK(e)}),m?(0,q.jsx)(`span`,{part:`fids-board-row-callsign-inline`,className:`aone:tabular-nums`,title:`Callsign`,children:m}):null]})]}),(0,q.jsxs)(`div`,{part:`fids-board-row-facts`,style:{display:`grid`,gridColumn:d?`1 / -1`:void 0,gridRow:d?2:void 0,gridTemplateColumns:`repeat(${v+1}, minmax(0, 1fr))`,justifyItems:d?`center`:void 0,gap:12,minWidth:0},children:[(0,q.jsx)(LK,{label:y,scheduledLabel:w.scheduledLabel,timeLabel:w.timeLabel,theme:r,labelStyle:b}),_?(0,q.jsx)(IK,{label:`Terminal`,value:T.terminal,theme:r}):null,(0,q.jsx)(IK,{label:`Gate`,value:T.gate,theme:r}),g?(0,q.jsx)(IK,{label:`Baggage`,value:bK(e),theme:r}):null]}),(0,q.jsxs)(`div`,{style:{display:`grid`,gridColumn:d?`1 / -1`:void 0,gridRow:d?3:void 0,gridTemplateColumns:`minmax(0, 1fr) auto`,alignItems:`center`,gap:12,minWidth:0,maxWidth:`100%`,width:`100%`,boxSizing:`border-box`},children:[(0,q.jsx)(`div`,{part:`fids-board-row-status`,style:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,minWidth:0,maxWidth:`100%`,minHeight:28,padding:`5px 14px`,borderRadius:999,color:AK(E),backgroundColor:E,fontSize:`0.75rem`,fontWeight:800,lineHeight:1,textTransform:`uppercase`,whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`},children:s.label}),(0,q.jsxs)(`span`,{part:`fids-board-row-notifications`,"aria-label":`Alerts`,title:`Alerts`,style:{display:`inline-flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,gap:6,flexShrink:0,width:72,maxWidth:72,minWidth:0,boxSizing:`border-box`},children:[(0,q.jsx)(`span`,{style:{color:r.mutedTextColor,fontSize:`0.67rem`,fontWeight:700,letterSpacing:`0.05em`,lineHeight:1,textTransform:`uppercase`,whiteSpace:`nowrap`,maxWidth:`100%`,overflow:`hidden`,textOverflow:`ellipsis`},children:`Alerts`}),(0,q.jsx)(`span`,{style:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,color:r.headerIconTileBackgroundColor},children:(0,q.jsx)(`span`,{"aria-label":`Flight alerts`,title:`Flight alerts`,style:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,width:24,height:24},children:(0,q.jsx)(TL,{icon:bG,style:{width:14,height:14}})})})]})]})]}),S&&C?(0,q.jsx)(`div`,{part:`fids-board-row-detail`,id:`fids-detail-${a}`,role:`region`,"aria-labelledby":`fids-expand-${a}`,style:{paddingTop:12,paddingBottom:16,paddingLeft:16,paddingRight:16,borderWidth:1,borderStyle:`solid`,borderColor:o,borderLeftWidth:3,borderLeftColor:r.accentTextColor,borderRadius:14,backgroundColor:vG(r.primaryTextColor)},children:(0,q.jsx)(fK,{row:e,airports:n,theme:r,operatingCarrierName:x})}):null]},a)})})})})}function IK({label:e,value:t,theme:n}){return(0,q.jsxs)(`div`,{style:{minWidth:0},children:[(0,q.jsx)(`div`,{style:{marginBottom:6,color:n.mutedTextColor,fontSize:`0.67rem`,fontWeight:700,letterSpacing:`0.05em`,textTransform:`uppercase`,whiteSpace:`nowrap`},children:e}),(0,q.jsx)(`div`,{style:{display:`inline-flex`,maxWidth:`100%`,minHeight:24,alignItems:`center`,justifyContent:`center`,padding:`4px 9px`,borderRadius:6,backgroundColor:vG(n.primaryTextColor),color:n.primaryTextColor,fontSize:`0.78rem`,fontWeight:800,lineHeight:1,overflowWrap:`anywhere`},children:t})]})}function LK({label:e,scheduledLabel:t,timeLabel:n,theme:r,labelStyle:i}){return(0,q.jsxs)(`div`,{part:`fids-board-row-time`,style:{minWidth:0},children:[(0,q.jsx)(`div`,{part:`fids-board-row-time-label`,style:{...i,marginBottom:6},children:e}),(0,q.jsxs)(`div`,{className:`aone:tabular-nums`,style:{display:`flex`,flexDirection:`column`,gap:2,color:r.primaryTextColor,fontWeight:700,fontSize:`1.05rem`,lineHeight:1.1},children:[t?(0,q.jsx)(`span`,{style:{color:r.mutedTextColor,fontSize:`0.9rem`,fontWeight:500,textDecorationLine:`line-through`},children:t}):null,(0,q.jsx)(`span`,{children:n})]})]})}function RK({modeLabel:e,headerPlaneIcon:t,rows:n,airlines:r,airports:i,theme:a,dataRefreshSchedule:o,boardAirportIata:s,timezoneRegionName:c,timezoneLabel: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:a.panelBackgroundColor,boxShadow:`inset 0 1px 0 rgba(255,255,255,0.06)`},children:[(0,q.jsx)(PK,{title:e,headerPlaneIcon:t,theme:a,dataRefreshSchedule:o,timezoneRegionName:c,timezoneLabel:l}),(0,q.jsx)(FK,{rows:n,airlines:r,airports:i,theme:a,boardAirportIata:s,tableSection:t===`arrival`?`arrivals`:`departures`})]})}function zK({payload:e,loading:t,error:n,consentAnalytics:r,theme:i=pG,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:vG(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.airlines,u=e.airports??{},d=jK(e.iata,u),f=MG(d);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)(RK,{modeLabel:`Flight Departures`,headerPlaneIcon:`departure`,rows:e.departures,airlines:l,airports:u,theme:i,dataRefreshSchedule:a,boardAirportIata:e.iata,timezoneRegionName:d,timezoneLabel:f}),s&&(0,q.jsx)(RK,{modeLabel:`Flight Arrivals`,headerPlaneIcon:`arrival`,rows:e.arrivals,airlines:l,airports:u,theme:i,dataRefreshSchedule:a,boardAirportIata:e.iata,timezoneRegionName:d,timezoneLabel:f}),(0,q.jsxs)(`p`,{part:`fids-board-updated`,className:`aone:mt-3 aone:text-center aone:text-xs`,style:{color:i.mutedTextColor},children:[`Updated `,tK(e.asOfUtc),` · `,e.iata]})]})}function BK(e){return(0,q.jsx)(zK,{...e})}var VK=[`consent-analytics`,`consent-advertising`,`consent-functional`,K_,`id`],HK=12e4,UK=3e4;function WK(e){let t=e?.trim().toLowerCase();if(t===`true`)return!0;if(t===`false`)return!1}function GK(e){let t=e?.variables?.preview;if(!t?.variableOverridesEnabled||!t.variableOverrideValues)return{};let n=t.variableOverrideValues;return{consentAnalytics:WK(n.consentAnalytics),consentAdvertising:WK(n.consentAdvertising),consentFunctional:WK(n.consentFunctional)}}var KK=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=pG;_publicConsentAnalytics;static get observedAttributes(){return Array.from(VK)}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.width=`100%`,this.style.maxWidth=`100%`,this.style.minWidth=`0`,this.style.boxSizing=`border-box`,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=HK+Math.floor(Math.random()*UK),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=gv(this);if(!e||e!==this._activeInstanceId)return;let t=await fG(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=gv(this),t=Sv(),n=uG(),r=window[rm],i={primaryColor:typeof r?.primaryColor==`string`?r.primaryColor:void 0,secondaryColor:typeof r?.secondaryColor==`string`?r.secondaryColor:void 0};e!==this._activeInstanceId&&(this._clearPoll(),this._activeInstanceId=e,this._flightsCache=null,this._flightsLoading=!0,this._flightsError=!1,this._resolvedTheme=_G(null,i)),this._paint();let a=null,o={attempted:!1,durationMs:0},s;if(e&&t){let t=await Cv(e);o=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),s=`widget_type_mismatch`,n=null),a=n,this._resolvedTheme=_G(a,i),o.attempted&&a===null&&s===void 0&&o.failureKind&&(s=o.failureKind)}else this._resolvedTheme=_G(null,i);if(!this.isConnected)return;let c=GK(a);this._publicConsentAnalytics=c.consentAnalytics;let l=mv(this,`consent-analytics`,c.consentAnalytics),u=!o.attempted&&(!t||!e)?t?`no_instance_id`:`no_api_base`:void 0;if(l){let n=o.attempted?`attempt:${t}|${e}|${a===null?`fail`:`ok`}|${s??``}`:`skip:${u??`none`}`;n!==this._lastPublicConfigTelemetryKey&&(this._lastPublicConfigTelemetryKey=n,Ay(!0,{widget_runtime:`fids-board`,attempted:o.attempted,duration_ms:o.durationMs,ok:o.attempted?a!==null:!1,error_kind:o.attempted&&a===null?s:void 0,skip_reason:u}))}if(a===null&&e&&t&&console.warn(`${vv}: fids-board — managed instance config not applied or wrong type.`),e&&n){let t=await fG(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(),l&&!this._mountTelemetrySent&&(this._mountTelemetrySent=!0,jy(!0,{widget_runtime:`fids-board`,public_config_unavailable:a===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=gx,e.appendChild(t),this._shadowStylesInjected=!0}let t=this._mount??=document.createElement(`span`);t.style.display=`block`,t.style.width=`100%`,t.style.maxWidth=`100%`,t.style.minWidth=`0`,t.style.boxSizing=`border-box`,t.parentNode!==e&&e.appendChild(t);let n=mv(this,`consent-analytics`,this._publicConsentAnalytics);(this._reactRoot??=dv.createRoot(t)).render((0,q.jsx)(BK,{payload:this._flightsCache,loading:this._flightsLoading,error:this._flightsError,consentAnalytics:n,theme:this._resolvedTheme,dataRefreshSchedule:this._dataRefreshSchedule}))}};customElements.get(`fma-fids-board`)||customElements.define(`fma-fids-board`,KK);var qK=[`plane`,`plane-departure`,`compass`,`earth-americas`,`location-dot`,`suitcase`];function JK(e){if(typeof e!=`string`)return;let t=e.trim().toUpperCase();return/^[A-Z]{3}$/.test(t)?t:void 0}function YK(e){let t=e?.trim().toLowerCase();if(t===`true`)return!0;if(t===`false`)return!1}function XK(e){let t=e?.trim().toLowerCase();if(t===`middle-right`)return`middle-right`;if(t===`bottom-right`)return`bottom-right`}function ZK(e){let t=e?.trim().toLowerCase();if(t===`floating`||t===`attached`)return t}function QK(e){if(typeof e!=`string`)return;let t=e.trim();return/^#[0-9a-fA-F]{6}$/.test(t)?t:void 0}function $K(e){if(typeof e!=`string`)return;let t=e.trim();return t.length>0?t:void 0}function eq(e){let t=e?.trim().toLowerCase();if(t===`text`||t===`icon`||t===`both`)return t}function tq(e){let t=e?.trim().toLowerCase();if(t)return qK.includes(t)?t:void 0}function nq(e){if(!e||e.widgetType!==`flymyairport-fab`)return{};let t={},n=JK(e.iata);n&&(t.iata=n);let r=e.variables?.preview;if(r?.variableOverridesEnabled&&r.variableOverrideValues){let e=r.variableOverrideValues,n=JK(e.iata)??JK(e.sourceIata);n&&(t.iata=n);let i=YK(e.consentAnalytics);i!==void 0&&(t.consentAnalytics=i);let a=YK(e.consentAdvertising);a!==void 0&&(t.consentAdvertising=a);let o=YK(e.consentFunctional);o!==void 0&&(t.consentFunctional=o);let s=$K(e.label);s&&(t.label=s);let c=YK(e.enableCars);c!==void 0&&(t.enableCars=c);let l=YK(e.enableHotels);l!==void 0&&(t.enableHotels=l);let u=YK(e.enablePackages);u!==void 0&&(t.enablePackages=u);let d=XK(e.position);d&&(t.position=d);let f=ZK(e.edgeStyle)??ZK(e[`edge-style`]);f&&(t.edgeStyle=f);let p=QK(e.primaryColor);p&&(t.primaryColor=p);let m=QK(e.secondaryColor);m&&(t.secondaryColor=m);let h=$K(e.airfareSearchWidgetInstanceId)??$K(e[`airfare-search-widget-instance-id`]);h&&(t.airfareSearchWidgetInstanceId=h);let g=eq(e.primaryButtonContent)??eq(e[`primary-button-content`]);g&&(t.primaryButtonContent=g);let _=eq(e.secondaryButtonContent)??eq(e[`secondary-button-content`]);_&&(t.secondaryButtonContent=_);let v=tq(e.primaryIcon)??tq(e[`primary-icon`]);v&&(t.primaryIcon=v)}return r?.stylesEnabled&&r.customStyles?.trim()&&(t.userStyleBlock=r.customStyles),t}function rq(e){return JK(e.sourceIataAttribute)??JK(e.publicIata)??JK(e.globalIata??void 0)}function iq(e){return YK(e.consentAttribute??void 0)??e.publicConsent??!0}function aq(e){return $K(e.labelAttribute)??$K(e.publicLabel)??`Plan your trip`}function oq(e){return YK(e.rawAttribute??void 0)??e.publicToggle??!0}function sq(e){return $K(e.rawAttribute)??$K(e.publicAirfareSearchWidgetInstanceId)}function cq(e){return XK(e.rawAttribute)??e.publicPosition??`bottom-right`}function lq(e){return ZK(e.rawAttribute)??e.publicEdgeStyle??`floating`}function uq(e){return eq(e.rawAttribute)??e.publicMode??`both`}function dq(e){return tq(e.rawAttribute)??e.publicIcon??`plane`}function fq(e){return QK(e.primaryColorAttribute)??QK(e.publicPrimaryColor)??QK(e.globalPrimaryColor)??`#b91c1c`}function pq(e){return QK(e.secondaryColorAttribute)??QK(e.publicSecondaryColor)??QK(e.globalSecondaryColor)??`#b91c1c`}function mq(e,t){let n=JK(e);if(!n)throw Error(`Invalid IATA code for vertical URL`);return`https://flymyairport.com/from/${encodeURIComponent(n)}/${t}`}function hq(e,t,n){if(!e||typeof window>`u`)return;let r=window.consentedAnalytics;try{r?.track?.(t,n)}catch{}}var gq=Nk(`aone:inline-flex aone:shrink-0 aone:items-center aone:justify-center aone:gap-2 aone:rounded-md aone:text-sm aone:font-medium aone:whitespace-nowrap aone:transition-all aone:outline-none aone:focus-visible:border-ring aone:focus-visible:ring-[3px] aone:focus-visible:ring-ring/50 aone:disabled:pointer-events-none aone:disabled:opacity-50 aone:aria-invalid:border-destructive aone:aria-invalid:ring-destructive/20 aone:dark:aria-invalid:ring-destructive/40 aone:[&_svg]:pointer-events-none aone:[&_svg]:shrink-0 aone:[&_svg:not([class*=size-])]:size-4`,{variants:{variant:{default:`aone:bg-primary aone:text-primary-foreground aone:hover:bg-primary/90`,destructive:`aone:bg-destructive aone:text-white aone:hover:bg-destructive/90 aone:focus-visible:ring-destructive/20 aone:dark:bg-destructive/60 aone:dark:focus-visible:ring-destructive/40`,outline:`aone:border aone:bg-background aone:shadow-xs aone:hover:bg-accent aone:hover:text-accent-foreground aone:dark:border-input aone:dark:bg-input/30 aone:dark:hover:bg-input/50`,secondary:`aone:bg-secondary aone:text-secondary-foreground aone:hover:bg-secondary/80`,ghost:`aone:hover:bg-accent aone:hover:text-accent-foreground aone:dark:hover:bg-accent/50`,link:`aone:text-primary aone:underline-offset-4 aone:hover:underline`,save:`aone:bg-save aone:text-save-foreground aone:hover:bg-save/90`,success:`aone:bg-success aone:text-success-foreground aone:hover:bg-success/90`},size:{default:`aone:h-9 aone:px-4 aone:py-2 aone:has-[>svg]:px-3`,xs:`aone:h-6 aone:gap-1 aone:rounded-md aone:px-2 aone:text-xs aone:has-[>svg]:px-1.5 aone:[&_svg:not([class*=size-])]:size-3`,sm:`aone:h-8 aone:gap-1.5 aone:rounded-md aone:px-3 aone:has-[>svg]:px-2.5`,lg:`aone:h-10 aone:rounded-md aone:px-6 aone:has-[>svg]:px-4`,icon:`aone:size-9`,"icon-xs":`aone:size-6 aone:rounded-md aone:[&_svg:not([class*=size-])]:size-3`,"icon-sm":`aone:size-8`,"icon-lg":`aone:size-10`}},defaultVariants:{variant:`default`,size:`default`}});function _q({className:e,variant:t=`default`,size:n=`default`,asChild:r=!1,...i}){return(0,q.jsx)(r?GS:`button`,{"data-slot":`button`,"data-variant":t,"data-size":n,className:oj(gq({variant:t,size:n,className:e})),...i})}var vq={plane:kj,"plane-departure":Tj,compass:Mj,"earth-americas":Ej,"location-dot":Nj,suitcase:Dj};function yq({iata:e,consentAnalytics:t,consentAdvertising:n,consentFunctional:r,label:i,enableCars:a,enableHotels:o,enablePackages:s,primaryColor:c,secondaryColor:l,position:u,edgeStyle:d=`floating`,airfareSearchWidgetInstanceId:f,primaryButtonContent:p=`both`,secondaryButtonContent:m=`both`,primaryIcon:h=`plane`,dialogPortalContainer:g,layoutContained:_=!1}){let[v,y]=(0,K.useState)(!1),[b,x]=(0,K.useState)(!1),S=(0,K.useCallback)(()=>{y(!1),hq(t,`Widget FYF Closed`,{iata:e??null})},[t,e]),C=(0,K.useCallback)(()=>{y(!0),hq(t,`Widget FYF Opened`,{iata:e??null})},[t,e]),w=(0,K.useCallback)(()=>{v?S():C()},[S,v,C]);(0,K.useEffect)(()=>{if(!v||b)return;let e=e=>{e.key===`Escape`&&(e.stopPropagation(),S())};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[S,v,b]);let T=n=>{e&&(hq(t,`Widget FYF Vertical Clicked`,{iata:e,vertical:n}),S())},E=()=>{e&&(x(!0),y(!1),hq(t,`Widget FYF Flight Modal Opened`,{iata:e}))},D=[{vertical:`cars`,label:`Cars`,Icon:IS},{vertical:`packages`,label:`Packages`,Icon:zS},{vertical:`hotels`,label:`Hotels`,Icon:FS}].filter(({vertical:e})=>e===`cars`?a:e===`hotels`?o:s),O=p!==`text`,k=p!==`icon`,A=m!==`text`,j=m!==`icon`,M=O&&k?`aone:gap-1.5 aone:sm:gap-2 aone:px-2.5 aone:sm:px-5`:O&&!k?`aone:gap-0 aone:justify-center aone:px-2 aone:sm:px-3`:`aone:gap-0 aone:justify-center aone:px-2.5 aone:sm:px-5`,N=d===`attached`?`aone:right-0`:`aone:right-4`,P=d===`attached`?`aone:rounded-l-full aone:rounded-r-none`:`aone:rounded-full`,ee=A&&j?`aone:justify-start aone:gap-2`:`aone:justify-center aone:gap-0`,F=u===`bottom-right`?`aone:top-auto aone:bottom-4`:`aone:top-0 aone:bottom-0`,te=u===`bottom-right`?`aone:flex aone:flex-col aone:items-end aone:gap-3`:`aone:flex aone:flex-row aone:items-center aone:gap-3`,ne=_?`aone:absolute`:`aone:fixed`,re=(0,K.useMemo)(()=>({right:d===`attached`?`0px`:`var(--fyf-fab-shell-right, 1rem)`,bottom:`var(--fyf-fab-shell-bottom, 1rem)`}),[d]),I=e=>{let t=[`aone:delay-0`,`aone:delay-75`,`aone:delay-100`,`aone:delay-150`,`aone:delay-200`];return[`aone:animate-in`,`aone:fade-in-0`,u===`bottom-right`?`aone:slide-in-from-bottom-4`:`aone:slide-in-from-right-4`,`aone:zoom-in-95`,`aone:duration-250`,`aone:ease-out`,`aone:fill-mode-both`,t[Math.min(e,t.length-1)]??`aone:delay-200`].join(` `)},ie=(0,q.jsxs)(q.Fragment,{children:[v?(0,q.jsx)(`div`,{"aria-hidden":!0,className:`aone:pointer-events-auto ${ne} aone:inset-0 aone:z-90 aone:bg-black/5 aone:animate-in aone:fade-in-0 aone:duration-300 aone:ease-out`,onClick:S,onKeyDown:e=>{e.key===`Escape`&&S()}}):null,(0,q.jsxs)(`div`,{className:`aone:pointer-events-none ${ne} ${F} ${N} ${te} ${b?`aone:z-40`:`aone:z-100`}`,"data-fyf-speed-dial":!0,part:`fab-shell`,style:re,children:[v?(0,q.jsx)(`div`,{className:`aone:pointer-events-auto aone:flex aone:w-max aone:min-w-0 aone:flex-col aone:items-stretch aone:gap-2`,part:`fab-travel-menu`,role:`menu`,"aria-label":`Travel options`,children:e?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(_q,{"aria-label":j?void 0:`Flights`,className:`aone:h-11 aone:w-full aone:rounded-full aone:border-0 aone:px-4 aone:text-sm aone:text-white aone:sm:text-base aone:shadow-md aone:focus-visible:ring-offset-2 ${ee} ${I(0)}`,onClick:E,part:`fab-menu-item`,role:`menuitem`,style:{backgroundColor:l},type:`button`,variant:`default`,children:[A?(0,q.jsx)(RS,{"aria-hidden":!0,className:`aone:size-4 aone:shrink-0 aone:sm:size-5 aone:lg:size-6`}):null,j?`Flights`:null]}),D.map(({vertical:t,label:n,Icon:r},i)=>(0,q.jsx)(_q,{asChild:!0,className:`aone:h-11 aone:w-full aone:rounded-full aone:border-0 aone:px-4 aone:text-sm aone:text-white aone:sm:text-base aone:shadow-md aone:focus-visible:ring-offset-2 ${ee} ${I(i+1)}`,part:`fab-menu-item`,role:`menuitem`,style:{backgroundColor:l},variant:`default`,children:(0,q.jsxs)(`a`,{"aria-label":j?void 0:n,href:mq(e,t),onClick:()=>T(t),rel:`noopener noreferrer`,target:`_blank`,children:[A?(0,q.jsx)(r,{"aria-hidden":!0,className:`aone:size-4 aone:shrink-0 aone:sm:size-5 aone:lg:size-6`}):null,j?n:null]})},t))]}):(0,q.jsxs)(`div`,{className:`aone:w-full aone:max-w-[min(100vw-6rem,20rem)] aone:rounded-full aone:border aone:border-amber-200 aone:bg-amber-50 aone:px-4 aone:py-3 aone:text-sm aone:sm:text-base aone:text-amber-950 aone:shadow-md ${I(0)}`,role:`status`,children:[`Add a valid managed instance id or`,` `,(0,q.jsx)(`code`,{className:`aone:rounded aone:bg-white/80 aone:px-1`,children:`source-iata`}),`.`]})}):null,(0,q.jsxs)(_q,{"aria-expanded":v,"aria-haspopup":`menu`,"aria-label":v?`Close Plan your trip menu`:`Open Plan your trip menu`,className:`aone:pointer-events-auto aone:h-10 aone:sm:h-12 ${P} aone:border-0 aone:bg-[#b91c1c] aone:text-sm aone:text-white aone:sm:text-base aone:shadow-lg aone:transition-[transform,box-shadow] aone:duration-200 aone:ease-out aone:hover:bg-[#991b1b] aone:focus-visible:ring-[#b91c1c] ${M} ${v?`aone:scale-105 aone:shadow-xl`:`aone:scale-100`}`,onClick:w,part:`fab-toggle`,style:{backgroundColor:c},type:`button`,variant:`default`,children:[O?v?(0,q.jsx)(TL,{"aria-hidden":!0,className:`aone:size-4 aone:shrink-0 aone:sm:size-5 aone:lg:size-6`,icon:Oj}):(0,q.jsx)(TL,{"aria-hidden":!0,className:`aone:size-4 aone:shrink-0 aone:sm:size-5 aone:lg:size-6`,icon:vq[h]}):null,k?(0,q.jsx)(`span`,{className:`aone:max-w-38 aone:truncate aone:text-sm aone:font-semibold aone:lg:text-base aone:sm:max-w-44`,children:v?`Close`:i}):null]})]}),(0,q.jsx)(_W,{onOpenChange:n=>{x(n),n||hq(t,`Widget FYF Flight Modal Closed`,{iata:e??null})},open:b,children:(0,q.jsxs)(bW,{"aria-describedby":void 0,className:`a1-visual-viewport-modal aone:top-0 aone:right-0 aone:bottom-0 aone:left-0 aone:m-auto aone:h-fit aone:w-[min(95vw,90rem)] aone:max-w-[min(95vw,90rem)] aone:translate-none aone:gap-0 aone:p-0 aone:sm:max-w-[min(95vw,90rem)]`,overlayClassName:`aone:backdrop-blur-md aone:bg-black/40`,portalContainer:g,children:[(0,q.jsx)(xW,{className:`aone:sr-only`,children:`Find Your Flight`}),(0,q.jsx)(`div`,{className:`aone:p-4`,children:e?(0,K.createElement)(`fma-airfare-search`,{key:`fyf-embed-airfare-${e}`,className:`aone:block aone:w-full`,"consent-analytics":String(t),"consent-advertising":String(n),"consent-functional":String(r),...f?{"data-widget-instance-id":f}:{origin:e}}):(0,q.jsx)(`p`,{className:`aone:p-4 aone:text-sm aone:sm:text-base aone:text-muted-foreground`,children:`Airport code unavailable; cannot load flights.`})})]})})]});return _?(0,q.jsx)(`div`,{className:`aone:relative aone:isolate aone:min-h-[min(20rem,50vh)] aone:w-full`,children:ie}):ie}function bq({shadowRoot:e,userStyleBlock:t,...n}){return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`style`,{children:gx}),t?(0,q.jsx)(`style`,{children:t}):null,(0,q.jsx)(yq,{dialogPortalContainer:e,...n})]})}var xq=[`source-iata`,`primary-color`,`secondary-color`,`consent-analytics`,`consent-advertising`,`consent-functional`,`label`,`enable-cars`,`enable-hotels`,`enable-packages`,`airfare-search-widget-instance-id`,`position`,`edge-style`,`primary-button-content`,`secondary-button-content`,`primary-icon`,K_,`id`,`data-preview-contained`],Sq=`--fyf-fab-shell-bottom`,Cq=`--fyf-fab-shell-right`,wq=`fma-fab`;function Tq(e){if(typeof e!=`string`)return null;let t=e.trim();return t?/^-?\d+(\.\d+)?$/.test(t)?`${t}px`:/^-?\d+(\.\d+)?(px|rem|em|vh|vw|%)$/.test(t)?t:null:null}function Eq(e){if(typeof e!=`string`)return;let t=e.trim();if(t)return t.split(wq).join(`:host`)}var Dq=class extends HTMLElement{_shadowRoot;_mountPoint;_reactRoot;_renderInProgress=!1;_renderQueued=!1;_renderScheduled=!1;static get observedAttributes(){return Array.from(xq)}attributeChangedCallback(e,t,n){t===n||!this.isConnected||this._scheduleRender()}connectedCallback(){this.style.position=`relative`,this.style.display=`contents`,this._scheduleRender()}disconnectedCallback(){this._reactRoot&&=(this._reactRoot.unmount(),void 0)}_scheduleRender(){this._renderScheduled||(this._renderScheduled=!0,queueMicrotask(()=>{this._renderScheduled=!1,this.isConnected&&this._renderAsync()}))}_resolveInstanceId(){return this.getAttribute(K_)?.trim()||this.id?.trim()||null}async _renderAsync(){if(this._renderInProgress){this._renderQueued=!0;return}this._renderInProgress=!0;try{let e=this._resolveInstanceId(),t=Sv(),n=null,r={attempted:!1,durationMs:0};if(e&&t){let t=await Cv(e);r=t.metrics,n=t.config}n?.widgetType&&n.widgetType!==`flymyairport-fab`&&(console.warn(`[airport-one-widgets] Widget instance type does not match flymyairport-fab:`,n.widgetType),n=null);let i=n?.variables?.preview?.stylesEnabled===!0?n.variables.preview.styleVariableValues:void 0,a=Tq(i?.shellBottom),o=Tq(i?.shellRight);a?this.style.setProperty(Sq,a):this.style.removeProperty(Sq),o?this.style.setProperty(Cq,o):this.style.removeProperty(Cq);let s=window[rm],c=nq(n),l=Eq(c.userStyleBlock),u=typeof s?.iata==`string`?s.iata:null,d=typeof s?.primaryColor==`string`?s.primaryColor:null,f=typeof s?.secondaryColor==`string`?s.secondaryColor:null,p=rq({sourceIataAttribute:this.getAttribute(`source-iata`),publicIata:c.iata,globalIata:u}),m=iq({consentAttribute:this.getAttribute(`consent-analytics`),publicConsent:c.consentAnalytics}),h=iq({consentAttribute:this.getAttribute(`consent-advertising`),publicConsent:c.consentAdvertising}),g=iq({consentAttribute:this.getAttribute(`consent-functional`),publicConsent:c.consentFunctional}),_=aq({labelAttribute:this.getAttribute(`label`),publicLabel:c.label}),v=oq({rawAttribute:this.getAttribute(`enable-cars`),publicToggle:c.enableCars}),y=oq({rawAttribute:this.getAttribute(`enable-hotels`),publicToggle:c.enableHotels}),b=oq({rawAttribute:this.getAttribute(`enable-packages`),publicToggle:c.enablePackages}),x=cq({rawAttribute:this.getAttribute(`position`),publicPosition:c.position}),S=lq({rawAttribute:this.getAttribute(`edge-style`),publicEdgeStyle:c.edgeStyle}),C=fq({primaryColorAttribute:this.getAttribute(`primary-color`),publicPrimaryColor:c.primaryColor,globalPrimaryColor:d}),w=pq({secondaryColorAttribute:this.getAttribute(`secondary-color`),publicSecondaryColor:c.secondaryColor,globalSecondaryColor:f}),T=sq({rawAttribute:this.getAttribute(`airfare-search-widget-instance-id`),publicAirfareSearchWidgetInstanceId:c.airfareSearchWidgetInstanceId}),E=uq({rawAttribute:this.getAttribute(`primary-button-content`),publicMode:c.primaryButtonContent}),D=uq({rawAttribute:this.getAttribute(`secondary-button-content`),publicMode:c.secondaryButtonContent}),O=dq({rawAttribute:this.getAttribute(`primary-icon`),publicIcon:c.primaryIcon});if(!r.attempted&&(!e||!t)&&n===null&&console.warn(`${vv}: flymyairport-fab — managed config fetch skipped; using element attributes only.`),r.attempted&&n===null&&console.warn(`${vv}: flymyairport-fab — managed config unavailable; using element attributes fallback.`),!this.isConnected)return;this._paint({iata:p,consentAnalytics:m,consentAdvertising:h,consentFunctional:g,label:_,enableCars:v,enableHotels:y,enablePackages:b,position:x,edgeStyle:S,primaryColor:C,secondaryColor:w,airfareSearchWidgetInstanceId:T,primaryButtonContent:E,secondaryButtonContent:D,primaryIcon:O,userStyleBlock:l,layoutContained:this.hasAttribute(`data-preview-contained`)})}finally{this._renderInProgress=!1,this._renderQueued&&(this._renderQueued=!1,queueMicrotask(()=>{this.isConnected&&this._renderAsync()}))}}_paint(e){let t=this._shadowRoot??=this.attachShadow({mode:`closed`}),n=this._mountPoint??=document.createElement(`span`);n.parentNode!==t&&t.appendChild(n),(this._reactRoot??=dv.createRoot(n)).render((0,q.jsx)(bq,{consentAnalytics:e.consentAnalytics,consentAdvertising:e.consentAdvertising,consentFunctional:e.consentFunctional,enableCars:e.enableCars,enableHotels:e.enableHotels,enablePackages:e.enablePackages,airfareSearchWidgetInstanceId:e.airfareSearchWidgetInstanceId,iata:e.iata,label:e.label,layoutContained:e.layoutContained,position:e.position,edgeStyle:e.edgeStyle,primaryColor:e.primaryColor,secondaryColor:e.secondaryColor,primaryButtonContent:e.primaryButtonContent,secondaryButtonContent:e.secondaryButtonContent,primaryIcon:e.primaryIcon,userStyleBlock:e.userStyleBlock,shadowRoot:t}))}};return customElements.get(`fma-fab`)||customElements.define(`fma-fab`,Dq),e.AirfareContent=wS,e.AirfareSearch=eG,e.CarfareSearch=UV,e.FidsBoardElement=KK,e.FlyMyAirportFabElement=Dq,e})({});
|