@movmo_app/react-common 0.5.0 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js CHANGED
@@ -107,5 +107,5 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
107
107
  *
108
108
  * This source code is licensed under the MIT license found in the
109
109
  * LICENSE file in the root directory of this source tree.
110
- */var Jr;function tf(){return Jr||(Jr=1,process.env.NODE_ENV!=="production"&&function(){function e(v,I){return v===I&&(v!==0||1/v===1/I)||v!==v&&I!==I}function t(v,I){l||n.startTransition===void 0||(l=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var m=I();if(!d){var b=I();i(m,b)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),d=!0)}b=s({inst:{value:m,getSnapshot:I}});var h=b[0].inst,A=b[1];return a(function(){h.value=m,h.getSnapshot=I,r(h)&&A({inst:h})},[v,m,I]),u(function(){return r(h)&&A({inst:h}),v(function(){r(h)&&A({inst:h})})},[v]),c(m),m}function r(v){var I=v.getSnapshot;v=v.value;try{var m=I();return!i(v,m)}catch{return!0}}function o(v,I){return I()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var n=w,i=typeof Object.is=="function"?Object.is:e,s=n.useState,u=n.useEffect,a=n.useLayoutEffect,c=n.useDebugValue,l=!1,d=!1,p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?o:t;gn.useSyncExternalStore=n.useSyncExternalStore!==void 0?n.useSyncExternalStore:p,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),gn}process.env.NODE_ENV==="production"?Gn.exports=ef():Gn.exports=tf();var nf=Gn.exports;function rf(){return nf.useSyncExternalStore(of,()=>!0,()=>!1)}function of(){return()=>{}}var Jn="Avatar",[af,tg]=Hd(Jn),[sf,Gi]=af(Jn),Pi=g.forwardRef((e,t)=>{const{__scopeAvatar:r,...o}=e,[n,i]=g.useState("idle");return x.jsx(sf,{scope:r,imageLoadingStatus:n,onImageLoadingStatusChange:i,children:x.jsx(zn.span,{...o,ref:t})})});Pi.displayName=Jn;var Fi="AvatarImage",Ti=g.forwardRef((e,t)=>{const{__scopeAvatar:r,src:o,onLoadingStatusChange:n=()=>{},...i}=e,s=Gi(Fi,r),u=uf(o,i),a=wi(c=>{n(c),s.onImageLoadingStatusChange(c)});return tt(()=>{u!=="idle"&&a(u)},[u,a]),u==="loaded"?x.jsx(zn.img,{...i,ref:t,src:o}):null});Ti.displayName=Fi;var Ni="AvatarFallback",Vi=g.forwardRef((e,t)=>{const{__scopeAvatar:r,delayMs:o,...n}=e,i=Gi(Ni,r),[s,u]=g.useState(o===void 0);return g.useEffect(()=>{if(o!==void 0){const a=window.setTimeout(()=>u(!0),o);return()=>window.clearTimeout(a)}},[o]),s&&i.imageLoadingStatus!=="loaded"?x.jsx(zn.span,{...n,ref:t}):null});Vi.displayName=Ni;function _r(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function uf(e,{referrerPolicy:t,crossOrigin:r}){const o=rf(),n=g.useRef(null),i=o?(n.current||(n.current=new window.Image),n.current):null,[s,u]=g.useState(()=>_r(i,e));return tt(()=>{u(_r(i,e))},[i,e]),tt(()=>{const a=d=>()=>{u(d)};if(!i)return;const c=a("loaded"),l=a("error");return i.addEventListener("load",c),i.addEventListener("error",l),t&&(i.referrerPolicy=t),typeof r=="string"&&(i.crossOrigin=r),()=>{i.removeEventListener("load",c),i.removeEventListener("error",l)}},[i,r,t]),s}var cf=Pi,lf=Ti,df=Vi;const Bi=g.forwardRef(({size:e="md",className:t,...r},o)=>{const n={sm:"w-8 h-8",md:"w-10 h-10",lg:"w-12 h-12",xl:"w-16 h-16"};return x.jsx(cf,{ref:o,className:_("relative flex shrink-0 overflow-hidden rounded-full",n[e],t),...r})});Bi.displayName="Avatar";const Oi=g.forwardRef(({className:e,...t},r)=>x.jsx(lf,{ref:r,className:_("aspect-square h-full w-full object-cover",e),...t}));Oi.displayName="AvatarImage";const Mi=g.forwardRef(({className:e,...t},r)=>x.jsx(df,{ref:r,className:_("flex h-full w-full items-center justify-center rounded-full bg-grayWarm-100 text-grayWarm-600 font-semibold",e),...t}));Mi.displayName="AvatarFallback";function De(e,t,{checkForDefaultPrevented:r=!0}={}){return function(n){if(e==null||e(n),r===!1||!n.defaultPrevented)return t==null?void 0:t(n)}}function _t(e,t=[]){let r=[];function o(i,s){const u=g.createContext(s),a=r.length;r=[...r,s];const c=d=>{var h;const{scope:p,children:v,...I}=d,m=((h=p==null?void 0:p[e])==null?void 0:h[a])||u,b=g.useMemo(()=>I,Object.values(I));return x.jsx(m.Provider,{value:b,children:v})};c.displayName=i+"Provider";function l(d,p){var m;const v=((m=p==null?void 0:p[e])==null?void 0:m[a])||u,I=g.useContext(v);if(I)return I;if(s!==void 0)return s;throw new Error(`\`${d}\` must be used within \`${i}\``)}return[c,l]}const n=()=>{const i=r.map(s=>g.createContext(s));return function(u){const a=(u==null?void 0:u[e])||i;return g.useMemo(()=>({[`__scope${e}`]:{...u,[e]:a}}),[u,a])}};return n.scopeName=e,[o,ff(n,...t)]}function ff(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const o=e.map(n=>({useScope:n(),scopeName:n.scopeName}));return function(i){const s=o.reduce((u,{useScope:a,scopeName:c})=>{const d=a(i)[`__scope${c}`];return{...u,...d}},{});return g.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return r.scopeName=t.scopeName,r}var gf=g[" useInsertionEffect ".trim().toString()]||tt;function ht({prop:e,defaultProp:t,onChange:r=()=>{},caller:o}){const[n,i,s]=pf({defaultProp:t,onChange:r}),u=e!==void 0,a=u?e:n;{const l=g.useRef(e!==void 0);g.useEffect(()=>{const d=l.current;d!==u&&console.warn(`${o} is changing from ${d?"controlled":"uncontrolled"} to ${u?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),l.current=u},[u,o])}const c=g.useCallback(l=>{var d;if(u){const p=bf(l)?l(e):l;p!==e&&((d=s.current)==null||d.call(s,p))}else i(l)},[u,e,i,s]);return[a,c]}function pf({defaultProp:e,onChange:t}){const[r,o]=g.useState(e),n=g.useRef(r),i=g.useRef(t);return gf(()=>{i.current=t},[t]),g.useEffect(()=>{var s;n.current!==r&&((s=i.current)==null||s.call(i,r),n.current=r)},[r,n]),[r,o,i]}function bf(e){return typeof e=="function"}function mf(e){const t=g.useRef({value:e,previous:e});return g.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function vf(e){const[t,r]=g.useState(void 0);return tt(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const o=new ResizeObserver(n=>{if(!Array.isArray(n)||!n.length)return;const i=n[0];let s,u;if("borderBoxSize"in i){const a=i.borderBoxSize,c=Array.isArray(a)?a[0]:a;s=c.inlineSize,u=c.blockSize}else s=e.offsetWidth,u=e.offsetHeight;r({width:s,height:u})});return o.observe(e,{box:"border-box"}),()=>o.unobserve(e)}else r(void 0)},[e]),t}function Pn(e){const t=hf(e),r=g.forwardRef((o,n)=>{const{children:i,...s}=o,u=g.Children.toArray(i),a=u.find(Cf);if(a){const c=a.props.children,l=u.map(d=>d===a?g.Children.count(c)>1?g.Children.only(null):g.isValidElement(c)?c.props.children:null:d);return x.jsx(t,{...s,ref:n,children:g.isValidElement(c)?g.cloneElement(c,void 0,l):null})}return x.jsx(t,{...s,ref:n,children:i})});return r.displayName=`${e}.Slot`,r}function hf(e){const t=g.forwardRef((r,o)=>{const{children:n,...i}=r;if(g.isValidElement(n)){const s=xf(n),u=yf(i,n.props);return n.type!==g.Fragment&&(u.ref=o?Yn(o,s):s),g.cloneElement(n,u)}return g.Children.count(n)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var If=Symbol("radix.slottable");function Cf(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===If}function yf(e,t){const r={...t};for(const o in t){const n=e[o],i=t[o];/^on[A-Z]/.test(o)?n&&i?r[o]=(...u)=>{const a=i(...u);return n(...u),a}:n&&(r[o]=n):o==="style"?r[o]={...n,...i}:o==="className"&&(r[o]=[n,i].filter(Boolean).join(" "))}return{...e,...r}}function xf(e){var o,n;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(n=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Af=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Je=Af.reduce((e,t)=>{const r=Pn(`Primitive.${t}`),o=g.forwardRef((n,i)=>{const{asChild:s,...u}=n,a=s?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),x.jsx(a,{...u,ref:i})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{}),Ut="Switch",[Ef,ng]=_t(Ut),[Sf,wf]=Ef(Ut),Wi=g.forwardRef((e,t)=>{const{__scopeSwitch:r,name:o,checked:n,defaultChecked:i,required:s,disabled:u,value:a="on",onCheckedChange:c,form:l,...d}=e,[p,v]=g.useState(null),I=bt(t,y=>v(y)),m=g.useRef(!1),b=p?l||!!p.closest("form"):!0,[h,A]=ht({prop:n,defaultProp:i??!1,onChange:c,caller:Ut});return x.jsxs(Sf,{scope:r,checked:h,disabled:u,children:[x.jsx(Je.button,{type:"button",role:"switch","aria-checked":h,"aria-required":s,"data-state":Zi(h),"data-disabled":u?"":void 0,disabled:u,value:a,...d,ref:I,onClick:De(e.onClick,y=>{A(E=>!E),b&&(m.current=y.isPropagationStopped(),m.current||y.stopPropagation())})}),b&&x.jsx(Li,{control:p,bubbles:!m.current,name:o,value:a,checked:h,required:s,disabled:u,form:l,style:{transform:"translateX(-100%)"}})]})});Wi.displayName=Ut;var Xi="SwitchThumb",Di=g.forwardRef((e,t)=>{const{__scopeSwitch:r,...o}=e,n=wf(Xi,r);return x.jsx(Je.span,{"data-state":Zi(n.checked),"data-disabled":n.disabled?"":void 0,...o,ref:t})});Di.displayName=Xi;var Rf="SwitchBubbleInput",Li=g.forwardRef(({__scopeSwitch:e,control:t,checked:r,bubbles:o=!0,...n},i)=>{const s=g.useRef(null),u=bt(s,i),a=mf(r),c=vf(t);return g.useEffect(()=>{const l=s.current;if(!l)return;const d=window.HTMLInputElement.prototype,v=Object.getOwnPropertyDescriptor(d,"checked").set;if(a!==r&&v){const I=new Event("click",{bubbles:o});v.call(l,r),l.dispatchEvent(I)}},[a,r,o]),x.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...n,tabIndex:-1,ref:u,style:{...n.style,...c,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});Li.displayName=Rf;function Zi(e){return e?"checked":"unchecked"}var Gf=Wi,Pf=Di;const ki=g.forwardRef(({size:e="md",className:t,...r},o)=>{const n={sm:"w-9 h-5",md:"w-11 h-6"},i={sm:"w-4 h-4 data-[state=checked]:translate-x-4",md:"w-5 h-5 data-[state=checked]:translate-x-5"};return x.jsx(Gf,{ref:o,className:_("peer inline-flex shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-500 focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50","data-[state=checked]:bg-brand-500 data-[state=unchecked]:bg-grayWarm-200",n[e],t),...r,children:x.jsx(Pf,{className:_("pointer-events-none block rounded-full bg-white shadow-xs transition-transform data-[state=unchecked]:translate-x-0",i[e])})})});ki.displayName="Toggle";function Ff(e){const t=e+"CollectionProvider",[r,o]=_t(t),[n,i]=r(t,{collectionRef:{current:null},itemMap:new Map}),s=m=>{const{scope:b,children:h}=m,A=w.useRef(null),y=w.useRef(new Map).current;return x.jsx(n,{scope:b,itemMap:y,collectionRef:A,children:h})};s.displayName=t;const u=e+"CollectionSlot",a=Pn(u),c=w.forwardRef((m,b)=>{const{scope:h,children:A}=m,y=i(u,h),E=bt(b,y.collectionRef);return x.jsx(a,{ref:E,children:A})});c.displayName=u;const l=e+"CollectionItemSlot",d="data-radix-collection-item",p=Pn(l),v=w.forwardRef((m,b)=>{const{scope:h,children:A,...y}=m,E=w.useRef(null),C=bt(b,E),F=i(l,h);return w.useEffect(()=>(F.itemMap.set(E,{ref:E,...y}),()=>void F.itemMap.delete(E))),x.jsx(p,{[d]:"",ref:C,children:A})});v.displayName=l;function I(m){const b=i(e+"CollectionConsumer",m);return w.useCallback(()=>{const A=b.collectionRef.current;if(!A)return[];const y=Array.from(A.querySelectorAll(`[${d}]`));return Array.from(b.itemMap.values()).sort((F,R)=>y.indexOf(F.ref.current)-y.indexOf(R.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:s,Slot:c,ItemSlot:v},I,o]}var Tf=g[" useId ".trim().toString()]||(()=>{}),Nf=0;function Vf(e){const[t,r]=g.useState(Tf());return tt(()=>{r(o=>o??String(Nf++))},[e]),t?`radix-${t}`:""}var Bf=g.createContext(void 0);function Hi(e){const t=g.useContext(Bf);return e||t||"ltr"}var pn="rovingFocusGroup.onEntryFocus",Of={bubbles:!1,cancelable:!0},It="RovingFocusGroup",[Fn,ji,Mf]=Ff(It),[Wf,Yi]=_t(It,[Mf]),[Xf,Df]=Wf(It),zi=g.forwardRef((e,t)=>x.jsx(Fn.Provider,{scope:e.__scopeRovingFocusGroup,children:x.jsx(Fn.Slot,{scope:e.__scopeRovingFocusGroup,children:x.jsx(Lf,{...e,ref:t})})}));zi.displayName=It;var Lf=g.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:o,loop:n=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:u,onCurrentTabStopIdChange:a,onEntryFocus:c,preventScrollOnEntryFocus:l=!1,...d}=e,p=g.useRef(null),v=bt(t,p),I=Hi(i),[m,b]=ht({prop:s,defaultProp:u??null,onChange:a,caller:It}),[h,A]=g.useState(!1),y=wi(c),E=ji(r),C=g.useRef(!1),[F,R]=g.useState(0);return g.useEffect(()=>{const P=p.current;if(P)return P.addEventListener(pn,y),()=>P.removeEventListener(pn,y)},[y]),x.jsx(Xf,{scope:r,orientation:o,dir:I,loop:n,currentTabStopId:m,onItemFocus:g.useCallback(P=>b(P),[b]),onItemShiftTab:g.useCallback(()=>A(!0),[]),onFocusableItemAdd:g.useCallback(()=>R(P=>P+1),[]),onFocusableItemRemove:g.useCallback(()=>R(P=>P-1),[]),children:x.jsx(Je.div,{tabIndex:h||F===0?-1:0,"data-orientation":o,...d,ref:v,style:{outline:"none",...e.style},onMouseDown:De(e.onMouseDown,()=>{C.current=!0}),onFocus:De(e.onFocus,P=>{const Z=!C.current;if(P.target===P.currentTarget&&Z&&!h){const U=new CustomEvent(pn,Of);if(P.currentTarget.dispatchEvent(U),!U.defaultPrevented){const Q=E().filter(X=>X.focusable),O=Q.find(X=>X.active),K=Q.find(X=>X.id===m),k=[O,K,...Q].filter(Boolean).map(X=>X.ref.current);Ui(k,l)}}C.current=!1}),onBlur:De(e.onBlur,()=>A(!1))})})}),Ji="RovingFocusGroupItem",_i=g.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:o=!0,active:n=!1,tabStopId:i,children:s,...u}=e,a=Vf(),c=i||a,l=Df(Ji,r),d=l.currentTabStopId===c,p=ji(r),{onFocusableItemAdd:v,onFocusableItemRemove:I,currentTabStopId:m}=l;return g.useEffect(()=>{if(o)return v(),()=>I()},[o,v,I]),x.jsx(Fn.ItemSlot,{scope:r,id:c,focusable:o,active:n,children:x.jsx(Je.span,{tabIndex:d?0:-1,"data-orientation":l.orientation,...u,ref:t,onMouseDown:De(e.onMouseDown,b=>{o?l.onItemFocus(c):b.preventDefault()}),onFocus:De(e.onFocus,()=>l.onItemFocus(c)),onKeyDown:De(e.onKeyDown,b=>{if(b.key==="Tab"&&b.shiftKey){l.onItemShiftTab();return}if(b.target!==b.currentTarget)return;const h=Hf(b,l.orientation,l.dir);if(h!==void 0){if(b.metaKey||b.ctrlKey||b.altKey||b.shiftKey)return;b.preventDefault();let y=p().filter(E=>E.focusable).map(E=>E.ref.current);if(h==="last")y.reverse();else if(h==="prev"||h==="next"){h==="prev"&&y.reverse();const E=y.indexOf(b.currentTarget);y=l.loop?jf(y,E+1):y.slice(E+1)}setTimeout(()=>Ui(y))}}),children:typeof s=="function"?s({isCurrentTabStop:d,hasTabStop:m!=null}):s})})});_i.displayName=Ji;var Zf={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function kf(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Hf(e,t,r){const o=kf(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return Zf[o]}function Ui(e,t=!1){const r=document.activeElement;for(const o of e)if(o===r||(o.focus({preventScroll:t}),document.activeElement!==r))return}function jf(e,t){return e.map((r,o)=>e[(t+o)%e.length])}var Yf=zi,zf=_i,$i="Toggle",Qi=g.forwardRef((e,t)=>{const{pressed:r,defaultPressed:o,onPressedChange:n,...i}=e,[s,u]=ht({prop:r,onChange:n,defaultProp:o??!1,caller:$i});return x.jsx(Je.button,{type:"button","aria-pressed":s,"data-state":s?"on":"off","data-disabled":e.disabled?"":void 0,...i,ref:t,onClick:De(e.onClick,()=>{e.disabled||u(!s)})})});Qi.displayName=$i;var Ze="ToggleGroup",[Ki,rg]=_t(Ze,[Yi]),qi=Yi(),_n=w.forwardRef((e,t)=>{const{type:r,...o}=e;if(r==="single"){const n=o;return x.jsx(Jf,{...n,ref:t})}if(r==="multiple"){const n=o;return x.jsx(_f,{...n,ref:t})}throw new Error(`Missing prop \`type\` expected on \`${Ze}\``)});_n.displayName=Ze;var[ea,ta]=Ki(Ze),Jf=w.forwardRef((e,t)=>{const{value:r,defaultValue:o,onValueChange:n=()=>{},...i}=e,[s,u]=ht({prop:r,defaultProp:o??"",onChange:n,caller:Ze});return x.jsx(ea,{scope:e.__scopeToggleGroup,type:"single",value:w.useMemo(()=>s?[s]:[],[s]),onItemActivate:u,onItemDeactivate:w.useCallback(()=>u(""),[u]),children:x.jsx(na,{...i,ref:t})})}),_f=w.forwardRef((e,t)=>{const{value:r,defaultValue:o,onValueChange:n=()=>{},...i}=e,[s,u]=ht({prop:r,defaultProp:o??[],onChange:n,caller:Ze}),a=w.useCallback(l=>u((d=[])=>[...d,l]),[u]),c=w.useCallback(l=>u((d=[])=>d.filter(p=>p!==l)),[u]);return x.jsx(ea,{scope:e.__scopeToggleGroup,type:"multiple",value:s,onItemActivate:a,onItemDeactivate:c,children:x.jsx(na,{...i,ref:t})})});_n.displayName=Ze;var[Uf,$f]=Ki(Ze),na=w.forwardRef((e,t)=>{const{__scopeToggleGroup:r,disabled:o=!1,rovingFocus:n=!0,orientation:i,dir:s,loop:u=!0,...a}=e,c=qi(r),l=Hi(s),d={role:"group",dir:l,...a};return x.jsx(Uf,{scope:r,rovingFocus:n,disabled:o,children:n?x.jsx(Yf,{asChild:!0,...c,orientation:i,dir:l,loop:u,children:x.jsx(Je.div,{...d,ref:t})}):x.jsx(Je.div,{...d,ref:t})})}),kt="ToggleGroupItem",ra=w.forwardRef((e,t)=>{const r=ta(kt,e.__scopeToggleGroup),o=$f(kt,e.__scopeToggleGroup),n=qi(e.__scopeToggleGroup),i=r.value.includes(e.value),s=o.disabled||e.disabled,u={...e,pressed:i,disabled:s},a=w.useRef(null);return o.rovingFocus?x.jsx(zf,{asChild:!0,...n,focusable:!s,active:i,ref:a,children:x.jsx(Ur,{...u,ref:t})}):x.jsx(Ur,{...u,ref:t})});ra.displayName=kt;var Ur=w.forwardRef((e,t)=>{const{__scopeToggleGroup:r,value:o,...n}=e,i=ta(kt,r),s={role:"radio","aria-checked":e.pressed,"aria-pressed":void 0},u=i.type==="single"?s:void 0;return x.jsx(Qi,{...u,...n,ref:t,onPressedChange:a=>{a?i.onItemActivate(o):i.onItemDeactivate(o)}})}),Qf=_n,Kf=ra;const oa=g.forwardRef(({className:e,...t},r)=>x.jsx(Qf,{ref:r,className:_("inline-flex items-center rounded-lg border border-grayWarm-200 overflow-hidden",e),...t}));oa.displayName="ToggleGroup";const ia=g.forwardRef(({className:e,children:t,...r},o)=>x.jsx(Kf,{ref:o,className:_("inline-flex items-center justify-center px-4 py-2 text-sm font-semibold transition-colors","border-r border-grayWarm-200 last:border-r-0","data-[state=on]:bg-grayWarm-100 data-[state=on]:text-grayWarm-950","data-[state=off]:bg-white data-[state=off]:text-grayWarm-600 data-[state=off]:hover:bg-grayWarm-50","focus:outline-none focus-visible:ring-2 focus-visible:ring-brand-500",e),...r,children:t}));ia.displayName="ToggleGroupItem";const aa=g.forwardRef(({className:e,...t},r)=>x.jsx("textarea",{ref:r,className:_("flex min-h-[80px] w-full rounded-lg border border-grayWarm-200 bg-white px-3.5 py-2.5 text-base text-grayWarm-950","placeholder:text-grayWarm-400","focus:outline-none focus:ring-2 focus:ring-brand-500 focus:border-brand-500","disabled:cursor-not-allowed disabled:opacity-50","resize-vertical",e),...t}));aa.displayName="Textarea";const sa=({currentPage:e,totalPages:t,onPageChange:r,className:o})=>{const n=()=>{const i=[];if(t<=7){for(let a=1;a<=t;a++)i.push(a);return i}i.push(1),e>3&&i.push("...");const s=Math.max(2,e-1),u=Math.min(t-1,e+1);for(let a=s;a<=u;a++)i.push(a);return e<t-2&&i.push("..."),i.push(t),i};return x.jsxs("nav",{className:_("flex items-center justify-between",o),children:[x.jsxs("button",{onClick:()=>r(e-1),disabled:e<=1,className:_("inline-flex items-center gap-1.5 px-3 py-2 text-sm font-semibold rounded-lg transition-colors","text-grayWarm-600 hover:bg-grayWarm-50","disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:bg-transparent"),children:[x.jsx(Dd,{className:"w-4 h-4"}),"Previous"]}),x.jsx("div",{className:"flex items-center gap-0.5",children:n().map((i,s)=>i==="..."?x.jsx("span",{className:"w-10 h-10 flex items-center justify-center text-sm text-grayWarm-500",children:"..."},`ellipsis-${s}`):x.jsx("button",{onClick:()=>r(i),className:_("w-10 h-10 flex items-center justify-center text-sm font-medium rounded-lg transition-colors",i===e?"bg-grayWarm-100 text-grayWarm-950":"text-grayWarm-600 hover:bg-grayWarm-50"),children:i},i))}),x.jsxs("button",{onClick:()=>r(e+1),disabled:e>=t,className:_("inline-flex items-center gap-1.5 px-3 py-2 text-sm font-semibold rounded-lg transition-colors","text-grayWarm-600 hover:bg-grayWarm-50","disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:bg-transparent"),children:["Next",x.jsx(Ld,{className:"w-4 h-4"})]})]})};sa.displayName="Pagination";const ua=g.forwardRef(({className:e,...t},r)=>x.jsxs("div",{className:_("relative",e),children:[x.jsx(Zd,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-grayWarm-400"}),x.jsx("input",{ref:r,type:"search",className:_("w-full rounded-lg border border-grayWarm-200 bg-white pl-10 pr-3.5 py-2.5 text-base text-grayWarm-950","placeholder:text-grayWarm-400","focus:outline-none focus:ring-2 focus:ring-brand-500 focus:border-brand-500"),...t})]}));ua.displayName="SearchInput";const ca=g.forwardRef(({variant:e="default",onRemove:t,className:r,children:o,...n},i)=>{const s={default:"bg-white border-grayWarm-200 text-grayWarm-700",selected:"bg-brand-50 border-brand-300 text-brand-600"};return x.jsxs("span",{ref:i,className:_("inline-flex items-center gap-1.5 px-3 py-1 rounded-full border text-sm font-medium",s[e],r),...n,children:[o,t&&x.jsx("button",{onClick:t,className:"inline-flex items-center justify-center w-4 h-4 rounded-full hover:bg-grayWarm-200 transition-colors",children:x.jsx(kd,{className:"w-3 h-3"})})]})});ca.displayName="Chip";const la=({dateOfBirth:e,setDateOfBirth:t,travelerType:r,departureDate:o,uniqueId:n})=>{const i=["January","February","March","April","May","June","July","August","September","October","November","December"],s=new Date().getUTCFullYear(),u=w.useMemo(()=>Array.from({length:120},(y,E)=>s-E),[s]),[a,c]=w.useState(e?new Date(e).getUTCMonth():void 0),[l,d]=w.useState(e?new Date(e).getUTCDate():void 0),[p,v]=w.useState(e?new Date(e).getUTCFullYear():void 0),I=(y,E)=>new Date(Date.UTC(E,y+1,0)).getUTCDate(),m=w.useMemo(()=>a!==void 0&&p!==void 0?I(a,p):31,[a,p]);w.useEffect(()=>{if(e)try{const y=new Date(e);isNaN(y.getTime())||(c(y.getUTCMonth()),d(y.getUTCDate()),v(y.getUTCFullYear()))}catch(y){console.error("Invalid date format:",y)}},[e]),w.useEffect(()=>{l!==void 0&&l>m&&d(m)},[m,l]),w.useEffect(()=>{if(a!==void 0&&l!==void 0&&p!==void 0){const y=new Date(Date.UTC(p,a,l));t(y.toISOString())}},[a,l,p,t]);const b=y=>{y&&c(i.indexOf(y.value))},h=y=>{const E=parseInt(y,10);isNaN(E)||d(Math.min(E,m))},A=y=>{if(y){const E=parseInt(y.value,10);isNaN(E)||v(E)}};return x.jsxs("div",{className:"mt-7",children:[x.jsx("p",{className:"text-sm md:text-base font-semibold",children:"Date of Birth"}),x.jsxs("div",{className:"flex flex-row gap-4 mt-2",children:[x.jsx("div",{className:"relative w-full md:max-w-[140px]",children:x.jsx(Lt,{value:a!==void 0?{value:i[a],label:i[a]}:null,options:i.map(y=>({value:y,label:y})),placeholder:"Month*",onChange:b})}),x.jsx("div",{className:"relative w-full md:max-w-[80px]",children:x.jsx(Ye,{type:"text",required:!0,placeholder:"Day",value:l!==void 0?l:"",onChange:y=>h(y.target.value),disabled:a===void 0,max:m,min:1,className:"text-xs md:text-sm border-grayWarm-300 rounded-lg h-10",id:`date-of-birth-day-${n}`,name:"date-of-birth-day"})}),x.jsx("div",{className:"relative w-full md:max-w-[140px]",children:x.jsx(Lt,{value:p!==void 0?{value:p.toString(),label:p.toString()}:null,options:u.map(y=>({value:y.toString(),label:y.toString()})),placeholder:"Year*",onChange:A})})]})]})};var je={},$t={};Object.defineProperty($t,"__esModule",{value:!0});$t.Gender=void 0;var $r;(function(e){e.MALE="male",e.FEMALE="female",e.DEFAULT=""})($r||($t.Gender=$r={}));var Qt={};Object.defineProperty(Qt,"__esModule",{value:!0});Qt.CustomerResourceType=void 0;var Qr;(function(e){e.STORAGE="storage",e.HOSTING="hosting",e.DNS="dns",e.AUTHENTICATION="authentication",e.AUTHORIZATION="authorization"})(Qr||(Qt.CustomerResourceType=Qr={}));var da={};Object.defineProperty(da,"__esModule",{value:!0});var Le={};Object.defineProperty(Le,"__esModule",{value:!0});Le.TravelerType=Le.FlightOfferSegmentLegType=Le.FlightOfferDataSource=void 0;var Kr;(function(e){e.Amadeus="amadeus"})(Kr||(Le.FlightOfferDataSource=Kr={}));var qr;(function(e){e.Inbound="inbound",e.Outbound="outbound"})(qr||(Le.FlightOfferSegmentLegType=qr={}));var eo;(function(e){e.ADULT="adult",e.CHILD="child",e.SENIOR="senior",e.YOUNG="young",e.HELD_INFANT="held_infant",e.SEATED_INFANT="seated_infant"})(eo||(Le.TravelerType=eo={}));var Re={};Object.defineProperty(Re,"__esModule",{value:!0});Re.AuthenticationChallengeResponse=Re.AuthenticationChallengeName=Re.AuthenticationUserStatus=Re.AuthenticationUsernameType=void 0;var to;(function(e){e.EMAIL="email",e.PHONE_NUMBER="phoneNumber"})(to||(Re.AuthenticationUsernameType=to={}));var no;(function(e){e.CONFIRMED="CONFIRMED",e.UNCONFIRMED="UNCONFIRMED"})(no||(Re.AuthenticationUserStatus=no={}));var ro;(function(e){e.SMS_OTP="SMS_OTP",e.EMAIL_OTP="EMAIL_OTP"})(ro||(Re.AuthenticationChallengeName=ro={}));var oo;(function(e){e.SMS_OTP_CODE="SMS_OTP_CODE",e.EMAIL_OTP_CODE="EMAIL_OTP_CODE"})(oo||(Re.AuthenticationChallengeResponse=oo={}));(function(e){var t=yt&&yt.__createBinding||(Object.create?function(o,n,i,s){s===void 0&&(s=i);var u=Object.getOwnPropertyDescriptor(n,i);(!u||("get"in u?!n.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return n[i]}}),Object.defineProperty(o,s,u)}:function(o,n,i,s){s===void 0&&(s=i),o[s]=n[i]}),r=yt&&yt.__exportStar||function(o,n){for(var i in o)i!=="default"&&!Object.prototype.hasOwnProperty.call(n,i)&&t(n,o,i)};Object.defineProperty(e,"__esModule",{value:!0}),r($t,e),r(Qt,e),r(da,e),r(Le,e),r(Re,e)})(je);const qf=({firstName:e,setFirstName:t,middleName:r,setMiddleName:o,lastName:n,setLastName:i,gender:s,setGender:u,knownTravelerNumber:a,setKnownTravelerNumber:c,dateOfBirth:l,setDateOfBirth:d,travelerType:p,departureDate:v,uniqueId:I,ktnAdornment:m,additionalFields:b,errorState:h=!1,errorMessage:A})=>{const y=Object.values(je.Gender).filter(C=>C!==je.Gender.DEFAULT).map(C=>({value:C.toString(),label:C.charAt(0).toUpperCase()+C.slice(1)})),E=C=>{C&&(C.value===je.Gender.MALE?u(je.Gender.MALE):C.value===je.Gender.FEMALE&&u(je.Gender.FEMALE))};return x.jsxs("div",{children:[x.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3 place-content-center",children:[x.jsx("div",{className:"md:order-none order-1",children:x.jsx(Ye,{type:"text",required:!0,placeholder:"First name",value:e,onChange:C=>t(C.target.value),className:"text-xs md:text-sm",id:`passenger-first-name-${I}`,name:`passenger-first-name-${I}`})}),x.jsx("div",{className:"md:order-none order-2",children:x.jsx(Ye,{type:"text",required:!1,placeholder:"Middle name",value:r,onChange:C=>o(C.target.value),className:"text-xs md:text-sm",id:`passenger-middle-name-${I}`,name:`passenger-middle-name-${I}`})}),x.jsx("div",{className:"md:order-none order-3",children:x.jsx(Ye,{type:"text",required:!0,placeholder:"Last name",value:n,onChange:C=>i(C.target.value),className:"text-xs md:text-sm",id:`passenger-last-name-${I}`,name:`passenger-last-name-${I}`})})]}),x.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3 place-content-center mt-3",children:[x.jsx("div",{className:"md:order-none order-1",children:x.jsx(Lt,{value:y.find(C=>C.value===s)||null,placeholder:"Gender",options:y,onChange:E,"data-testid":"gender-dropdown"})}),x.jsxs("div",{className:"md:order-none order-2 relative",children:[x.jsx(Ye,{type:"text",placeholder:"Known traveler number",value:a,onChange:C=>c(C.target.value),className:"text-xs md:text-sm pr-10",id:`passenger-known-traveler-number-${I}`,name:`passenger-known-traveler-number-${I}`}),m]})]}),b,x.jsx(la,{dateOfBirth:l,setDateOfBirth:d,travelerType:p,departureDate:v,uniqueId:I}),h&&x.jsx("div",{className:"text-error-700 text-sm mt-3",children:A||"Error saving passenger. Please try again."})]})};exports.Avatar=Bi;exports.AvatarFallback=Mi;exports.AvatarImage=Oi;exports.Badge=Ei;exports.Button=fo;exports.Card=Io;exports.CardContent=Ao;exports.CardDescription=xo;exports.CardFooter=Eo;exports.CardHeader=Co;exports.CardTitle=yo;exports.Checkbox=Ai;exports.Chip=ca;exports.DateOfBirth=la;exports.IconButton=Si;exports.Input=Ye;exports.Pagination=sa;exports.PassengerForm=qf;exports.SearchInput=ua;exports.SelectDropdown=Lt;exports.Separator=ho;exports.Textarea=aa;exports.Toggle=ki;exports.ToggleGroup=oa;exports.ToggleGroupItem=ia;
110
+ */var Jr;function tf(){return Jr||(Jr=1,process.env.NODE_ENV!=="production"&&function(){function e(v,I){return v===I&&(v!==0||1/v===1/I)||v!==v&&I!==I}function t(v,I){l||n.startTransition===void 0||(l=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var m=I();if(!d){var b=I();i(m,b)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),d=!0)}b=s({inst:{value:m,getSnapshot:I}});var h=b[0].inst,A=b[1];return a(function(){h.value=m,h.getSnapshot=I,r(h)&&A({inst:h})},[v,m,I]),u(function(){return r(h)&&A({inst:h}),v(function(){r(h)&&A({inst:h})})},[v]),c(m),m}function r(v){var I=v.getSnapshot;v=v.value;try{var m=I();return!i(v,m)}catch{return!0}}function o(v,I){return I()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var n=w,i=typeof Object.is=="function"?Object.is:e,s=n.useState,u=n.useEffect,a=n.useLayoutEffect,c=n.useDebugValue,l=!1,d=!1,p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?o:t;gn.useSyncExternalStore=n.useSyncExternalStore!==void 0?n.useSyncExternalStore:p,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),gn}process.env.NODE_ENV==="production"?Gn.exports=ef():Gn.exports=tf();var nf=Gn.exports;function rf(){return nf.useSyncExternalStore(of,()=>!0,()=>!1)}function of(){return()=>{}}var Jn="Avatar",[af,tg]=Hd(Jn),[sf,Gi]=af(Jn),Pi=g.forwardRef((e,t)=>{const{__scopeAvatar:r,...o}=e,[n,i]=g.useState("idle");return x.jsx(sf,{scope:r,imageLoadingStatus:n,onImageLoadingStatusChange:i,children:x.jsx(zn.span,{...o,ref:t})})});Pi.displayName=Jn;var Fi="AvatarImage",Ti=g.forwardRef((e,t)=>{const{__scopeAvatar:r,src:o,onLoadingStatusChange:n=()=>{},...i}=e,s=Gi(Fi,r),u=uf(o,i),a=wi(c=>{n(c),s.onImageLoadingStatusChange(c)});return tt(()=>{u!=="idle"&&a(u)},[u,a]),u==="loaded"?x.jsx(zn.img,{...i,ref:t,src:o}):null});Ti.displayName=Fi;var Ni="AvatarFallback",Vi=g.forwardRef((e,t)=>{const{__scopeAvatar:r,delayMs:o,...n}=e,i=Gi(Ni,r),[s,u]=g.useState(o===void 0);return g.useEffect(()=>{if(o!==void 0){const a=window.setTimeout(()=>u(!0),o);return()=>window.clearTimeout(a)}},[o]),s&&i.imageLoadingStatus!=="loaded"?x.jsx(zn.span,{...n,ref:t}):null});Vi.displayName=Ni;function _r(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function uf(e,{referrerPolicy:t,crossOrigin:r}){const o=rf(),n=g.useRef(null),i=o?(n.current||(n.current=new window.Image),n.current):null,[s,u]=g.useState(()=>_r(i,e));return tt(()=>{u(_r(i,e))},[i,e]),tt(()=>{const a=d=>()=>{u(d)};if(!i)return;const c=a("loaded"),l=a("error");return i.addEventListener("load",c),i.addEventListener("error",l),t&&(i.referrerPolicy=t),typeof r=="string"&&(i.crossOrigin=r),()=>{i.removeEventListener("load",c),i.removeEventListener("error",l)}},[i,r,t]),s}var cf=Pi,lf=Ti,df=Vi;const Bi=g.forwardRef(({size:e="md",className:t,...r},o)=>{const n={sm:"w-8 h-8",md:"w-10 h-10",lg:"w-12 h-12",xl:"w-16 h-16"};return x.jsx(cf,{ref:o,className:_("relative flex shrink-0 overflow-hidden rounded-full",n[e],t),...r})});Bi.displayName="Avatar";const Oi=g.forwardRef(({className:e,...t},r)=>x.jsx(lf,{ref:r,className:_("aspect-square h-full w-full object-cover",e),...t}));Oi.displayName="AvatarImage";const Mi=g.forwardRef(({className:e,...t},r)=>x.jsx(df,{ref:r,className:_("flex h-full w-full items-center justify-center rounded-full bg-grayWarm-100 text-grayWarm-600 font-semibold",e),...t}));Mi.displayName="AvatarFallback";function De(e,t,{checkForDefaultPrevented:r=!0}={}){return function(n){if(e==null||e(n),r===!1||!n.defaultPrevented)return t==null?void 0:t(n)}}function _t(e,t=[]){let r=[];function o(i,s){const u=g.createContext(s),a=r.length;r=[...r,s];const c=d=>{var h;const{scope:p,children:v,...I}=d,m=((h=p==null?void 0:p[e])==null?void 0:h[a])||u,b=g.useMemo(()=>I,Object.values(I));return x.jsx(m.Provider,{value:b,children:v})};c.displayName=i+"Provider";function l(d,p){var m;const v=((m=p==null?void 0:p[e])==null?void 0:m[a])||u,I=g.useContext(v);if(I)return I;if(s!==void 0)return s;throw new Error(`\`${d}\` must be used within \`${i}\``)}return[c,l]}const n=()=>{const i=r.map(s=>g.createContext(s));return function(u){const a=(u==null?void 0:u[e])||i;return g.useMemo(()=>({[`__scope${e}`]:{...u,[e]:a}}),[u,a])}};return n.scopeName=e,[o,ff(n,...t)]}function ff(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const o=e.map(n=>({useScope:n(),scopeName:n.scopeName}));return function(i){const s=o.reduce((u,{useScope:a,scopeName:c})=>{const d=a(i)[`__scope${c}`];return{...u,...d}},{});return g.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return r.scopeName=t.scopeName,r}var gf=g[" useInsertionEffect ".trim().toString()]||tt;function ht({prop:e,defaultProp:t,onChange:r=()=>{},caller:o}){const[n,i,s]=pf({defaultProp:t,onChange:r}),u=e!==void 0,a=u?e:n;{const l=g.useRef(e!==void 0);g.useEffect(()=>{const d=l.current;d!==u&&console.warn(`${o} is changing from ${d?"controlled":"uncontrolled"} to ${u?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),l.current=u},[u,o])}const c=g.useCallback(l=>{var d;if(u){const p=bf(l)?l(e):l;p!==e&&((d=s.current)==null||d.call(s,p))}else i(l)},[u,e,i,s]);return[a,c]}function pf({defaultProp:e,onChange:t}){const[r,o]=g.useState(e),n=g.useRef(r),i=g.useRef(t);return gf(()=>{i.current=t},[t]),g.useEffect(()=>{var s;n.current!==r&&((s=i.current)==null||s.call(i,r),n.current=r)},[r,n]),[r,o,i]}function bf(e){return typeof e=="function"}function mf(e){const t=g.useRef({value:e,previous:e});return g.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function vf(e){const[t,r]=g.useState(void 0);return tt(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const o=new ResizeObserver(n=>{if(!Array.isArray(n)||!n.length)return;const i=n[0];let s,u;if("borderBoxSize"in i){const a=i.borderBoxSize,c=Array.isArray(a)?a[0]:a;s=c.inlineSize,u=c.blockSize}else s=e.offsetWidth,u=e.offsetHeight;r({width:s,height:u})});return o.observe(e,{box:"border-box"}),()=>o.unobserve(e)}else r(void 0)},[e]),t}function Pn(e){const t=hf(e),r=g.forwardRef((o,n)=>{const{children:i,...s}=o,u=g.Children.toArray(i),a=u.find(Cf);if(a){const c=a.props.children,l=u.map(d=>d===a?g.Children.count(c)>1?g.Children.only(null):g.isValidElement(c)?c.props.children:null:d);return x.jsx(t,{...s,ref:n,children:g.isValidElement(c)?g.cloneElement(c,void 0,l):null})}return x.jsx(t,{...s,ref:n,children:i})});return r.displayName=`${e}.Slot`,r}function hf(e){const t=g.forwardRef((r,o)=>{const{children:n,...i}=r;if(g.isValidElement(n)){const s=xf(n),u=yf(i,n.props);return n.type!==g.Fragment&&(u.ref=o?Yn(o,s):s),g.cloneElement(n,u)}return g.Children.count(n)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var If=Symbol("radix.slottable");function Cf(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===If}function yf(e,t){const r={...t};for(const o in t){const n=e[o],i=t[o];/^on[A-Z]/.test(o)?n&&i?r[o]=(...u)=>{const a=i(...u);return n(...u),a}:n&&(r[o]=n):o==="style"?r[o]={...n,...i}:o==="className"&&(r[o]=[n,i].filter(Boolean).join(" "))}return{...e,...r}}function xf(e){var o,n;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(n=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Af=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Je=Af.reduce((e,t)=>{const r=Pn(`Primitive.${t}`),o=g.forwardRef((n,i)=>{const{asChild:s,...u}=n,a=s?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),x.jsx(a,{...u,ref:i})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{}),Ut="Switch",[Ef,ng]=_t(Ut),[Sf,wf]=Ef(Ut),Wi=g.forwardRef((e,t)=>{const{__scopeSwitch:r,name:o,checked:n,defaultChecked:i,required:s,disabled:u,value:a="on",onCheckedChange:c,form:l,...d}=e,[p,v]=g.useState(null),I=bt(t,y=>v(y)),m=g.useRef(!1),b=p?l||!!p.closest("form"):!0,[h,A]=ht({prop:n,defaultProp:i??!1,onChange:c,caller:Ut});return x.jsxs(Sf,{scope:r,checked:h,disabled:u,children:[x.jsx(Je.button,{type:"button",role:"switch","aria-checked":h,"aria-required":s,"data-state":Zi(h),"data-disabled":u?"":void 0,disabled:u,value:a,...d,ref:I,onClick:De(e.onClick,y=>{A(E=>!E),b&&(m.current=y.isPropagationStopped(),m.current||y.stopPropagation())})}),b&&x.jsx(Li,{control:p,bubbles:!m.current,name:o,value:a,checked:h,required:s,disabled:u,form:l,style:{transform:"translateX(-100%)"}})]})});Wi.displayName=Ut;var Xi="SwitchThumb",Di=g.forwardRef((e,t)=>{const{__scopeSwitch:r,...o}=e,n=wf(Xi,r);return x.jsx(Je.span,{"data-state":Zi(n.checked),"data-disabled":n.disabled?"":void 0,...o,ref:t})});Di.displayName=Xi;var Rf="SwitchBubbleInput",Li=g.forwardRef(({__scopeSwitch:e,control:t,checked:r,bubbles:o=!0,...n},i)=>{const s=g.useRef(null),u=bt(s,i),a=mf(r),c=vf(t);return g.useEffect(()=>{const l=s.current;if(!l)return;const d=window.HTMLInputElement.prototype,v=Object.getOwnPropertyDescriptor(d,"checked").set;if(a!==r&&v){const I=new Event("click",{bubbles:o});v.call(l,r),l.dispatchEvent(I)}},[a,r,o]),x.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...n,tabIndex:-1,ref:u,style:{...n.style,...c,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});Li.displayName=Rf;function Zi(e){return e?"checked":"unchecked"}var Gf=Wi,Pf=Di;const ki=g.forwardRef(({size:e="md",className:t,...r},o)=>{const n={sm:"w-9 h-5",md:"w-11 h-6"},i={sm:"w-4 h-4 data-[state=checked]:translate-x-4",md:"w-5 h-5 data-[state=checked]:translate-x-5"};return x.jsx(Gf,{ref:o,className:_("peer inline-flex shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-500 focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50","data-[state=checked]:bg-brand-500 data-[state=unchecked]:bg-grayWarm-200",n[e],t),...r,children:x.jsx(Pf,{className:_("pointer-events-none block rounded-full bg-white shadow-xs transition-transform data-[state=unchecked]:translate-x-0",i[e])})})});ki.displayName="Toggle";function Ff(e){const t=e+"CollectionProvider",[r,o]=_t(t),[n,i]=r(t,{collectionRef:{current:null},itemMap:new Map}),s=m=>{const{scope:b,children:h}=m,A=w.useRef(null),y=w.useRef(new Map).current;return x.jsx(n,{scope:b,itemMap:y,collectionRef:A,children:h})};s.displayName=t;const u=e+"CollectionSlot",a=Pn(u),c=w.forwardRef((m,b)=>{const{scope:h,children:A}=m,y=i(u,h),E=bt(b,y.collectionRef);return x.jsx(a,{ref:E,children:A})});c.displayName=u;const l=e+"CollectionItemSlot",d="data-radix-collection-item",p=Pn(l),v=w.forwardRef((m,b)=>{const{scope:h,children:A,...y}=m,E=w.useRef(null),C=bt(b,E),F=i(l,h);return w.useEffect(()=>(F.itemMap.set(E,{ref:E,...y}),()=>void F.itemMap.delete(E))),x.jsx(p,{[d]:"",ref:C,children:A})});v.displayName=l;function I(m){const b=i(e+"CollectionConsumer",m);return w.useCallback(()=>{const A=b.collectionRef.current;if(!A)return[];const y=Array.from(A.querySelectorAll(`[${d}]`));return Array.from(b.itemMap.values()).sort((F,R)=>y.indexOf(F.ref.current)-y.indexOf(R.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:s,Slot:c,ItemSlot:v},I,o]}var Tf=g[" useId ".trim().toString()]||(()=>{}),Nf=0;function Vf(e){const[t,r]=g.useState(Tf());return tt(()=>{r(o=>o??String(Nf++))},[e]),t?`radix-${t}`:""}var Bf=g.createContext(void 0);function Hi(e){const t=g.useContext(Bf);return e||t||"ltr"}var pn="rovingFocusGroup.onEntryFocus",Of={bubbles:!1,cancelable:!0},It="RovingFocusGroup",[Fn,ji,Mf]=Ff(It),[Wf,Yi]=_t(It,[Mf]),[Xf,Df]=Wf(It),zi=g.forwardRef((e,t)=>x.jsx(Fn.Provider,{scope:e.__scopeRovingFocusGroup,children:x.jsx(Fn.Slot,{scope:e.__scopeRovingFocusGroup,children:x.jsx(Lf,{...e,ref:t})})}));zi.displayName=It;var Lf=g.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:o,loop:n=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:u,onCurrentTabStopIdChange:a,onEntryFocus:c,preventScrollOnEntryFocus:l=!1,...d}=e,p=g.useRef(null),v=bt(t,p),I=Hi(i),[m,b]=ht({prop:s,defaultProp:u??null,onChange:a,caller:It}),[h,A]=g.useState(!1),y=wi(c),E=ji(r),C=g.useRef(!1),[F,R]=g.useState(0);return g.useEffect(()=>{const P=p.current;if(P)return P.addEventListener(pn,y),()=>P.removeEventListener(pn,y)},[y]),x.jsx(Xf,{scope:r,orientation:o,dir:I,loop:n,currentTabStopId:m,onItemFocus:g.useCallback(P=>b(P),[b]),onItemShiftTab:g.useCallback(()=>A(!0),[]),onFocusableItemAdd:g.useCallback(()=>R(P=>P+1),[]),onFocusableItemRemove:g.useCallback(()=>R(P=>P-1),[]),children:x.jsx(Je.div,{tabIndex:h||F===0?-1:0,"data-orientation":o,...d,ref:v,style:{outline:"none",...e.style},onMouseDown:De(e.onMouseDown,()=>{C.current=!0}),onFocus:De(e.onFocus,P=>{const Z=!C.current;if(P.target===P.currentTarget&&Z&&!h){const U=new CustomEvent(pn,Of);if(P.currentTarget.dispatchEvent(U),!U.defaultPrevented){const Q=E().filter(X=>X.focusable),O=Q.find(X=>X.active),K=Q.find(X=>X.id===m),k=[O,K,...Q].filter(Boolean).map(X=>X.ref.current);Ui(k,l)}}C.current=!1}),onBlur:De(e.onBlur,()=>A(!1))})})}),Ji="RovingFocusGroupItem",_i=g.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:o=!0,active:n=!1,tabStopId:i,children:s,...u}=e,a=Vf(),c=i||a,l=Df(Ji,r),d=l.currentTabStopId===c,p=ji(r),{onFocusableItemAdd:v,onFocusableItemRemove:I,currentTabStopId:m}=l;return g.useEffect(()=>{if(o)return v(),()=>I()},[o,v,I]),x.jsx(Fn.ItemSlot,{scope:r,id:c,focusable:o,active:n,children:x.jsx(Je.span,{tabIndex:d?0:-1,"data-orientation":l.orientation,...u,ref:t,onMouseDown:De(e.onMouseDown,b=>{o?l.onItemFocus(c):b.preventDefault()}),onFocus:De(e.onFocus,()=>l.onItemFocus(c)),onKeyDown:De(e.onKeyDown,b=>{if(b.key==="Tab"&&b.shiftKey){l.onItemShiftTab();return}if(b.target!==b.currentTarget)return;const h=Hf(b,l.orientation,l.dir);if(h!==void 0){if(b.metaKey||b.ctrlKey||b.altKey||b.shiftKey)return;b.preventDefault();let y=p().filter(E=>E.focusable).map(E=>E.ref.current);if(h==="last")y.reverse();else if(h==="prev"||h==="next"){h==="prev"&&y.reverse();const E=y.indexOf(b.currentTarget);y=l.loop?jf(y,E+1):y.slice(E+1)}setTimeout(()=>Ui(y))}}),children:typeof s=="function"?s({isCurrentTabStop:d,hasTabStop:m!=null}):s})})});_i.displayName=Ji;var Zf={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function kf(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Hf(e,t,r){const o=kf(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return Zf[o]}function Ui(e,t=!1){const r=document.activeElement;for(const o of e)if(o===r||(o.focus({preventScroll:t}),document.activeElement!==r))return}function jf(e,t){return e.map((r,o)=>e[(t+o)%e.length])}var Yf=zi,zf=_i,$i="Toggle",Qi=g.forwardRef((e,t)=>{const{pressed:r,defaultPressed:o,onPressedChange:n,...i}=e,[s,u]=ht({prop:r,onChange:n,defaultProp:o??!1,caller:$i});return x.jsx(Je.button,{type:"button","aria-pressed":s,"data-state":s?"on":"off","data-disabled":e.disabled?"":void 0,...i,ref:t,onClick:De(e.onClick,()=>{e.disabled||u(!s)})})});Qi.displayName=$i;var Ze="ToggleGroup",[Ki,rg]=_t(Ze,[Yi]),qi=Yi(),_n=w.forwardRef((e,t)=>{const{type:r,...o}=e;if(r==="single"){const n=o;return x.jsx(Jf,{...n,ref:t})}if(r==="multiple"){const n=o;return x.jsx(_f,{...n,ref:t})}throw new Error(`Missing prop \`type\` expected on \`${Ze}\``)});_n.displayName=Ze;var[ea,ta]=Ki(Ze),Jf=w.forwardRef((e,t)=>{const{value:r,defaultValue:o,onValueChange:n=()=>{},...i}=e,[s,u]=ht({prop:r,defaultProp:o??"",onChange:n,caller:Ze});return x.jsx(ea,{scope:e.__scopeToggleGroup,type:"single",value:w.useMemo(()=>s?[s]:[],[s]),onItemActivate:u,onItemDeactivate:w.useCallback(()=>u(""),[u]),children:x.jsx(na,{...i,ref:t})})}),_f=w.forwardRef((e,t)=>{const{value:r,defaultValue:o,onValueChange:n=()=>{},...i}=e,[s,u]=ht({prop:r,defaultProp:o??[],onChange:n,caller:Ze}),a=w.useCallback(l=>u((d=[])=>[...d,l]),[u]),c=w.useCallback(l=>u((d=[])=>d.filter(p=>p!==l)),[u]);return x.jsx(ea,{scope:e.__scopeToggleGroup,type:"multiple",value:s,onItemActivate:a,onItemDeactivate:c,children:x.jsx(na,{...i,ref:t})})});_n.displayName=Ze;var[Uf,$f]=Ki(Ze),na=w.forwardRef((e,t)=>{const{__scopeToggleGroup:r,disabled:o=!1,rovingFocus:n=!0,orientation:i,dir:s,loop:u=!0,...a}=e,c=qi(r),l=Hi(s),d={role:"group",dir:l,...a};return x.jsx(Uf,{scope:r,rovingFocus:n,disabled:o,children:n?x.jsx(Yf,{asChild:!0,...c,orientation:i,dir:l,loop:u,children:x.jsx(Je.div,{...d,ref:t})}):x.jsx(Je.div,{...d,ref:t})})}),kt="ToggleGroupItem",ra=w.forwardRef((e,t)=>{const r=ta(kt,e.__scopeToggleGroup),o=$f(kt,e.__scopeToggleGroup),n=qi(e.__scopeToggleGroup),i=r.value.includes(e.value),s=o.disabled||e.disabled,u={...e,pressed:i,disabled:s},a=w.useRef(null);return o.rovingFocus?x.jsx(zf,{asChild:!0,...n,focusable:!s,active:i,ref:a,children:x.jsx(Ur,{...u,ref:t})}):x.jsx(Ur,{...u,ref:t})});ra.displayName=kt;var Ur=w.forwardRef((e,t)=>{const{__scopeToggleGroup:r,value:o,...n}=e,i=ta(kt,r),s={role:"radio","aria-checked":e.pressed,"aria-pressed":void 0},u=i.type==="single"?s:void 0;return x.jsx(Qi,{...u,...n,ref:t,onPressedChange:a=>{a?i.onItemActivate(o):i.onItemDeactivate(o)}})}),Qf=_n,Kf=ra;const oa=g.forwardRef(({className:e,...t},r)=>x.jsx(Qf,{ref:r,className:_("inline-flex items-center rounded-lg border border-grayWarm-200 overflow-hidden",e),...t}));oa.displayName="ToggleGroup";const ia=g.forwardRef(({className:e,children:t,...r},o)=>x.jsx(Kf,{ref:o,className:_("inline-flex items-center justify-center px-4 py-2 text-sm font-semibold transition-colors","border-r border-grayWarm-200 last:border-r-0","data-[state=on]:bg-grayWarm-100 data-[state=on]:text-grayWarm-950","data-[state=off]:bg-white data-[state=off]:text-grayWarm-600 data-[state=off]:hover:bg-grayWarm-50","focus:outline-none focus-visible:ring-2 focus-visible:ring-brand-500",e),...r,children:t}));ia.displayName="ToggleGroupItem";const aa=g.forwardRef(({className:e,...t},r)=>x.jsx("textarea",{ref:r,className:_("flex min-h-[80px] w-full rounded-lg border border-grayWarm-200 bg-white px-3.5 py-2.5 text-base text-grayWarm-950","placeholder:text-grayWarm-400","focus:outline-none focus:ring-2 focus:ring-brand-500 focus:border-brand-500","disabled:cursor-not-allowed disabled:opacity-50","resize-vertical",e),...t}));aa.displayName="Textarea";const sa=({currentPage:e,totalPages:t,onPageChange:r,className:o})=>{const n=()=>{const i=[];if(t<=7){for(let a=1;a<=t;a++)i.push(a);return i}i.push(1),e>3&&i.push("...");const s=Math.max(2,e-1),u=Math.min(t-1,e+1);for(let a=s;a<=u;a++)i.push(a);return e<t-2&&i.push("..."),i.push(t),i};return x.jsxs("nav",{className:_("flex items-center justify-between",o),children:[x.jsxs("button",{onClick:()=>r(e-1),disabled:e<=1,className:_("inline-flex items-center gap-1.5 px-3 py-2 text-sm font-semibold rounded-lg transition-colors","text-grayWarm-600 hover:bg-grayWarm-50","disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:bg-transparent"),children:[x.jsx(Dd,{className:"w-4 h-4"}),"Previous"]}),x.jsx("div",{className:"flex items-center gap-0.5",children:n().map((i,s)=>i==="..."?x.jsx("span",{className:"w-10 h-10 flex items-center justify-center text-sm text-grayWarm-500",children:"..."},`ellipsis-${s}`):x.jsx("button",{onClick:()=>r(i),className:_("w-10 h-10 flex items-center justify-center text-sm font-medium rounded-lg transition-colors",i===e?"bg-grayWarm-100 text-grayWarm-950":"text-grayWarm-600 hover:bg-grayWarm-50"),children:i},i))}),x.jsxs("button",{onClick:()=>r(e+1),disabled:e>=t,className:_("inline-flex items-center gap-1.5 px-3 py-2 text-sm font-semibold rounded-lg transition-colors","text-grayWarm-600 hover:bg-grayWarm-50","disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:bg-transparent"),children:["Next",x.jsx(Ld,{className:"w-4 h-4"})]})]})};sa.displayName="Pagination";const ua=g.forwardRef(({className:e,...t},r)=>x.jsxs("div",{className:_("relative",e),children:[x.jsx(Zd,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-grayWarm-400"}),x.jsx("input",{ref:r,type:"search",className:_("w-full rounded-lg border border-grayWarm-200 bg-white pl-10 pr-3.5 py-2.5 text-base text-grayWarm-950","placeholder:text-grayWarm-400","focus:outline-none focus:ring-2 focus:ring-brand-500 focus:border-brand-500"),...t})]}));ua.displayName="SearchInput";const ca=g.forwardRef(({variant:e="default",onRemove:t,className:r,children:o,...n},i)=>{const s={default:"bg-white border-grayWarm-200 text-grayWarm-700",selected:"bg-brand-50 border-brand-300 text-brand-600"};return x.jsxs("span",{ref:i,className:_("inline-flex items-center gap-1.5 px-3 py-1 rounded-full border text-sm font-medium",s[e],r),...n,children:[o,t&&x.jsx("button",{onClick:t,className:"inline-flex items-center justify-center w-4 h-4 rounded-full hover:bg-grayWarm-200 transition-colors",children:x.jsx(kd,{className:"w-3 h-3"})})]})});ca.displayName="Chip";const la=({dateOfBirth:e,setDateOfBirth:t,travelerType:r,departureDate:o,uniqueId:n})=>{const i=["January","February","March","April","May","June","July","August","September","October","November","December"],s=new Date().getUTCFullYear(),u=w.useMemo(()=>Array.from({length:120},(y,E)=>s-E),[s]),[a,c]=w.useState(e?new Date(e).getUTCMonth():void 0),[l,d]=w.useState(e?new Date(e).getUTCDate():void 0),[p,v]=w.useState(e?new Date(e).getUTCFullYear():void 0),I=(y,E)=>new Date(Date.UTC(E,y+1,0)).getUTCDate(),m=w.useMemo(()=>a!==void 0&&p!==void 0?I(a,p):31,[a,p]);w.useEffect(()=>{if(e)try{const y=new Date(e);isNaN(y.getTime())||(c(y.getUTCMonth()),d(y.getUTCDate()),v(y.getUTCFullYear()))}catch(y){console.error("Invalid date format:",y)}},[e]),w.useEffect(()=>{l!==void 0&&l>m&&d(m)},[m,l]),w.useEffect(()=>{if(a!==void 0&&l!==void 0&&p!==void 0){const y=new Date(Date.UTC(p,a,l));t(y.toISOString())}},[a,l,p]);const b=y=>{y&&c(i.indexOf(y.value))},h=y=>{const E=parseInt(y,10);isNaN(E)||d(Math.min(E,m))},A=y=>{if(y){const E=parseInt(y.value,10);isNaN(E)||v(E)}};return x.jsxs("div",{className:"mt-7",children:[x.jsx("p",{className:"text-sm md:text-base font-semibold",children:"Date of Birth"}),x.jsxs("div",{className:"flex flex-row gap-4 mt-2",children:[x.jsx("div",{className:"relative w-full md:max-w-[140px]",children:x.jsx(Lt,{value:a!==void 0?{value:i[a],label:i[a]}:null,options:i.map(y=>({value:y,label:y})),placeholder:"Month*",onChange:b})}),x.jsx("div",{className:"relative w-full md:max-w-[80px]",children:x.jsx(Ye,{type:"text",required:!0,placeholder:"Day",value:l!==void 0?l:"",onChange:y=>h(y.target.value),disabled:a===void 0,max:m,min:1,className:"text-xs md:text-sm border-grayWarm-300 rounded-lg h-10",id:`date-of-birth-day-${n}`,name:"date-of-birth-day"})}),x.jsx("div",{className:"relative w-full md:max-w-[140px]",children:x.jsx(Lt,{value:p!==void 0?{value:p.toString(),label:p.toString()}:null,options:u.map(y=>({value:y.toString(),label:y.toString()})),placeholder:"Year*",onChange:A})})]})]})};var je={},$t={};Object.defineProperty($t,"__esModule",{value:!0});$t.Gender=void 0;var $r;(function(e){e.MALE="male",e.FEMALE="female",e.DEFAULT=""})($r||($t.Gender=$r={}));var Qt={};Object.defineProperty(Qt,"__esModule",{value:!0});Qt.CustomerResourceType=void 0;var Qr;(function(e){e.STORAGE="storage",e.HOSTING="hosting",e.DNS="dns",e.AUTHENTICATION="authentication",e.AUTHORIZATION="authorization"})(Qr||(Qt.CustomerResourceType=Qr={}));var da={};Object.defineProperty(da,"__esModule",{value:!0});var Le={};Object.defineProperty(Le,"__esModule",{value:!0});Le.TravelerType=Le.FlightOfferSegmentLegType=Le.FlightOfferDataSource=void 0;var Kr;(function(e){e.Amadeus="amadeus"})(Kr||(Le.FlightOfferDataSource=Kr={}));var qr;(function(e){e.Inbound="inbound",e.Outbound="outbound"})(qr||(Le.FlightOfferSegmentLegType=qr={}));var eo;(function(e){e.ADULT="adult",e.CHILD="child",e.SENIOR="senior",e.YOUNG="young",e.HELD_INFANT="held_infant",e.SEATED_INFANT="seated_infant"})(eo||(Le.TravelerType=eo={}));var Re={};Object.defineProperty(Re,"__esModule",{value:!0});Re.AuthenticationChallengeResponse=Re.AuthenticationChallengeName=Re.AuthenticationUserStatus=Re.AuthenticationUsernameType=void 0;var to;(function(e){e.EMAIL="email",e.PHONE_NUMBER="phoneNumber"})(to||(Re.AuthenticationUsernameType=to={}));var no;(function(e){e.CONFIRMED="CONFIRMED",e.UNCONFIRMED="UNCONFIRMED"})(no||(Re.AuthenticationUserStatus=no={}));var ro;(function(e){e.SMS_OTP="SMS_OTP",e.EMAIL_OTP="EMAIL_OTP"})(ro||(Re.AuthenticationChallengeName=ro={}));var oo;(function(e){e.SMS_OTP_CODE="SMS_OTP_CODE",e.EMAIL_OTP_CODE="EMAIL_OTP_CODE"})(oo||(Re.AuthenticationChallengeResponse=oo={}));(function(e){var t=yt&&yt.__createBinding||(Object.create?function(o,n,i,s){s===void 0&&(s=i);var u=Object.getOwnPropertyDescriptor(n,i);(!u||("get"in u?!n.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return n[i]}}),Object.defineProperty(o,s,u)}:function(o,n,i,s){s===void 0&&(s=i),o[s]=n[i]}),r=yt&&yt.__exportStar||function(o,n){for(var i in o)i!=="default"&&!Object.prototype.hasOwnProperty.call(n,i)&&t(n,o,i)};Object.defineProperty(e,"__esModule",{value:!0}),r($t,e),r(Qt,e),r(da,e),r(Le,e),r(Re,e)})(je);const qf=({firstName:e,setFirstName:t,middleName:r,setMiddleName:o,lastName:n,setLastName:i,gender:s,setGender:u,knownTravelerNumber:a,setKnownTravelerNumber:c,dateOfBirth:l,setDateOfBirth:d,travelerType:p,departureDate:v,uniqueId:I,ktnAdornment:m,additionalFields:b,errorState:h=!1,errorMessage:A})=>{const y=Object.values(je.Gender).filter(C=>C!==je.Gender.DEFAULT).map(C=>({value:C.toString(),label:C.charAt(0).toUpperCase()+C.slice(1)})),E=C=>{C&&(C.value===je.Gender.MALE?u(je.Gender.MALE):C.value===je.Gender.FEMALE&&u(je.Gender.FEMALE))};return x.jsxs("div",{children:[x.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3 place-content-center",children:[x.jsx("div",{className:"md:order-none order-1",children:x.jsx(Ye,{type:"text",required:!0,placeholder:"First name",value:e,onChange:C=>t(C.target.value),className:"text-xs md:text-sm",id:`passenger-first-name-${I}`,name:`passenger-first-name-${I}`})}),x.jsx("div",{className:"md:order-none order-2",children:x.jsx(Ye,{type:"text",required:!1,placeholder:"Middle name",value:r,onChange:C=>o(C.target.value),className:"text-xs md:text-sm",id:`passenger-middle-name-${I}`,name:`passenger-middle-name-${I}`})}),x.jsx("div",{className:"md:order-none order-3",children:x.jsx(Ye,{type:"text",required:!0,placeholder:"Last name",value:n,onChange:C=>i(C.target.value),className:"text-xs md:text-sm",id:`passenger-last-name-${I}`,name:`passenger-last-name-${I}`})})]}),x.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3 place-content-center mt-3",children:[x.jsx("div",{className:"md:order-none order-1",children:x.jsx(Lt,{value:y.find(C=>C.value===s)||null,placeholder:"Gender",options:y,onChange:E,"data-testid":"gender-dropdown"})}),x.jsxs("div",{className:"md:order-none order-2 relative",children:[x.jsx(Ye,{type:"text",placeholder:"Known traveler number",value:a,onChange:C=>c(C.target.value),className:"text-xs md:text-sm pr-10",id:`passenger-known-traveler-number-${I}`,name:`passenger-known-traveler-number-${I}`}),m]})]}),b,x.jsx(la,{dateOfBirth:l,setDateOfBirth:d,travelerType:p,departureDate:v,uniqueId:I}),h&&x.jsx("div",{className:"text-error-700 text-sm mt-3",children:A||"Error saving passenger. Please try again."})]})};exports.Avatar=Bi;exports.AvatarFallback=Mi;exports.AvatarImage=Oi;exports.Badge=Ei;exports.Button=fo;exports.Card=Io;exports.CardContent=Ao;exports.CardDescription=xo;exports.CardFooter=Eo;exports.CardHeader=Co;exports.CardTitle=yo;exports.Checkbox=Ai;exports.Chip=ca;exports.DateOfBirth=la;exports.IconButton=Si;exports.Input=Ye;exports.Pagination=sa;exports.PassengerForm=qf;exports.SearchInput=ua;exports.SelectDropdown=Lt;exports.Separator=ho;exports.Textarea=aa;exports.Toggle=ki;exports.ToggleGroup=oa;exports.ToggleGroupItem=ia;
111
111
  //# sourceMappingURL=index.cjs.js.map