PageSourceSearch

https://www.thomascook.com/jan/chunk-YCPLA737.js

js thomascook.com collected 2026-09-27 21:39:06 UTC 86,192 bytes, 1 lines download raw bytes

1import{a as ui,b as fi,c as gi}from"./chunk-M4MS52G7.js";import{a as Ci}from"./chunk-MCBWE424.js";import{a as He,e as ii,f as ni,i as li}from"./chunk-UYA3IDM2.js";import"./chunk-NIEWYKLB.js";import{a as di}from"./chunk-4NBGPUQ2.js";import{a as mi}from"./chunk-ALUVFOOK.js";import{a as qe,b as ke,e as J,f as E,i as fe,j as H,k as hi,m as A,p as R,q as We,s as Qe}from"./chunk-BN7QZEK4.js";import{c as ci}from"./chunk-I3T4K6UN.js";import"./chunk-OLJ2ABGX.js";import{a as oi}from"./chunk-3W3G7NEK.js";import"./chunk-V5YGBLEJ.js";import"./chunk-6A774HWC.js";import{a as ai}from"./chunk-ZXBHKINM.js";import"./chunk-2AU7QBEB.js";import{a as si}from"./chunk-NAGZIUVD.js";import{a as pi}from"./chunk-JNZZ6ZCT.js";import"./chunk-3SJ4NFPR.js";import"./chunk-APASHIFL.js";import"./chunk-6GZNPSWW.js";import"./chunk-K4MSM4WG.js";import{b as ei}from"./chunk-7BJ25C4F.js";import{c as Yt}from"./chunk-RPI4WXQ5.js";import"./chunk-EOROI5BA.js";import{c as X,e as ri}from"./chunk-YLPQ3MWF.js";import"./chunk-HR755263.js";import{c as ti}from"./chunk-F37DFTGE.js";import"./chunk-CWIJHORJ.js";import{d as Jt}from"./chunk-HMIVF3GU.js";import{a as zt}from"./chunk-4MM3CUEM.js";import{b as Wt}from"./chunk-F35KXY5G.js";import"./chunk-QASTAEA3.js";import{D as Ve,J as $t,K as Kt,q as Gt}from"./chunk-JU3DEOWY.js";import"./chunk-7GKGBSIZ.js";import"./chunk-4T7RNU6K.js";import"./chunk-AIS5XO32.js";import"./chunk-4CQGKORS.js";import"./chunk-B4AWG7CY.js";import{o as Xt,p as Zt}from"./chunk-MEJXHMSO.js";import"./chunk-PWHZ4ZYG.js";import"./chunk-B4QWCRYA.js";import"./chunk-HOADZ3FF.js";import"./chunk-RCXLAM2A.js";import"./chunk-IDETHVUV.js";import"./chunk-U2JUGXNZ.js";import{k as Qt}from"./chunk-2ZF4NK4V.js";import"./chunk-ZLSKFZ2T.js";import"./chunk-2ZTVM3T3.js";import"./chunk-VCYJHWMW.js";import"./chunk-6JNU4IBW.js";import{c as Ut}from"./chunk-7VZYK2YZ.js";import"./chunk-5FLWDBMW.js";import"./chunk-KR3UX24N.js";import{a as jt,b as Vt,c as Ht,d as qt}from"./chunk-RTLFFRP4.js";import"./chunk-TA36SRWX.js";import"./chunk-FTRRFH75.js";import"./chunk-MCCK5EV2.js";import"./chunk-TFQKSA7T.js";import"./chunk-42MVB2UK.js";import"./chunk-PHDKZSMJ.js";import"./chunk-D4OFLXGC.js";import{k as Ce,n as ve}from"./chunk-DOEEZE2M.js";import"./chunk-6IXNIOVL.js";import"./chunk-IK6LHSP5.js";import"./chunk-H6VFWK3E.js";import{a as se}from"./chunk-QRQOT74E.js";import"./chunk-NMX7IUTQ.js";import"./chunk-DJOTXU3T.js";import"./chunk-LLKRHPEX.js";import"./chunk-HNOGK4DG.js";import"./chunk-7EI7SIPR.js";import"./chunk-TF7JCSPS.js";import"./chunk-LSR6WPFV.js";import"./chunk-WNU6RZIW.js";import{d as Me}from"./chunk-XSFQIBNG.js";import"./chunk-HEKKPLNE.js";import{b as le,e as Nt}from"./chunk-W37FCTIR.js";import"./chunk-23MQK2BR.js";import"./chunk-A4Z26JBV.js";import"./chunk-AA7Y7LIM.js";import{b as Y}from"./chunk-YW2BWIT4.js";import{a as ae}from"./chunk-F2FRKFAZ.js";import"./chunk-UYDYKDGR.js";import"./chunk-QGSHHFP7.js";import"./chunk-HQJOTQQO.js";import"./chunk-FNTJHQ4C.js";import"./chunk-MJKZM7FH.js";import"./chunk-3QFCW5XA.js";import"./chunk-BHMXNJKB.js";import"./chunk-TPHK7BBA.js";import"./chunk-F7WTWR5H.js";import"./chunk-O2QZHS76.js";import{c as V,e as Se,g as be}from"./chunk-IE3SAPII.js";import"./chunk-6J6FKHGZ.js";import"./chunk-OEASEAUF.js";import{d as Bt}from"./chunk-HDTXC5QX.js";import"./chunk-RIBOCQZ7.js";import"./chunk-65NKH7ED.js";import"./chunk-LKRSUA5O.js";import{a as Pe,o as _}from"./chunk-USFBPPJI.js";import{d as Rt}from"./chunk-464T4VHX.js";import{a as L,d as rt,j as oe,k as _e}from"./chunk-XFC72DIV.js";import"./chunk-UATFBOYT.js";import{d as Lt}from"./chunk-I5DD43AY.js";import"./chunk-RR4EYFQD.js";import{a as je}from"./chunk-WTYCPADN.js";import"./chunk-XWDUDBGP.js";import"./chunk-3VUGGK7I.js";import{C as Et,s as At,u as Ft}from"./chunk-WKUF5PZ6.js";import{$c as ie,Ab as Le,Ba as k,Bd as re,C as Ct,Ca as T,Cd as U,Dc as q,Dd as Dt,Fa as Mt,Fd as I,Gb as bt,Gd as F,Hd as xe,I as Oe,Ka as Pt,Kb as N,Kc as y,L as vt,Mc as C,Na as z,Nb as Re,O as me,Pa as $,Uc as Be,Va as he,Vc as ze,Yc as K,Za as _t,_c as j,ad as ue,cd as yt,fd as wt,gd as Ot,hd as xt,ia as Ee,id as kt,jd as Tt,kd as It,lc as O,md as W,nc as x,pa as g,pb as St,q as it,sc as v,sd as D,tc as u,td as G,u as nt,ua as l,uc as f,ud as Ne,vb as m,vc as b,vd as ne,w as de,x as we}from"./chunk-HYQSEJCS.js";import{a as Q,b as te,j as P}from"./chunk-AX2SH2D2.js";var vi=(()=>
1{let r=class r{constructor(){this.i18n=l(Se)}transform(e){return e===1?this.i18n.translate("Price_description_1","offer-price-info"):e<=4?this.i18n.translate("Price_description_2_4","offer-price-info",{duration:e}):this.i18n.translate("Price_description_5","offer-price-info",{duration:e})}};r.\u0275fac=function(t){return new(t||r)},r.\u0275pipe=Re({name:"nightsTranslation",type:r,pure:!0});let a=r;return a})();var Mi=(()=>{let r=class r{constructor(){this.i18n=l(Se)}transform(e){return this.i18n.translate(`dates_month_short_${e}`,"portfolio-search-map")}};r.\u0275fac=function(t){return new(t||r)},r.\u0275pipe=Re({name:"monthShortTranslation",type:r,pure:!0});let a=r;return a})();function Ii(a,r){if(a&1){let d=q();u(0,"jan-wishlist-heart",12),y("wishlistToggle",function(t){k(d);let i=C();return T(i.onWishlistToggle(t))}),f()}if(a&2){C();let d=It(2);v("wishlistItemId",d.itemId)("isWishlisted",d.isWishlisted)}}function Di(a,r){if(a&1&&b(0,"le-stars",7),a&2){let d=C();v("value",d.data().stars)("maxValue",d.data().stars)("size",12)}}function Ai(a,r){if(a&1&&b(0,"lew-tripadvisor",8),a&2){let d=C();v("tripAdvisor",d.data().tripadvisor)}}function Fi(a,r){a&1&&(j(0),D(1,"i18n")),a&2&&ue(" ",ne(1,1,"price_per_pax",void 0,"variants-map")," ")}function Ei(a,r){a&1&&(j(0),D(1,"i18n")),a&2&&ue(" ",ne(1,1,"for_all",void 0,"portfolio")," ")}var Ge=(()=>{let r=class r{constructor(){this.data=F.required(),this.closeCard=I(),this.cardClick=I(),this.wishlistToggle=I(),this.store=l(_),this.pricePresentationMode=this.store.selectSignal(X.mode)}onCardClick(e){this.cardClick.emit({metaCode:this.data().metaCode,ctrlOrMetaKey:e.ctrlKey||e.metaKey})}onCloseClick(e){e.stopPropagation(),e.preventDefault(),this.closeCard.emit()}onWishlistToggle(e){this.wishlistToggle.emit(e)}};r.\u0275fac=function(t){return new(t||r)},r.\u0275cmp=N({type:r,selectors:[["jan-map-hotel-card"]],hostBindings:function(t,i){t&1&&y("click",function(o){return i.onCardClick(o)})},inputs:{data:[1,"data"]},outputs:{closeCard:"closeCard",cardClick:"cardClick",wishlistToggle:"wishlistToggle"},features:[W([],[{provide:V,useValue:"portfolio-search-map"}])],decls:32,vars:33,consts:[[3,"images"],["lewGalleryThumbnailAboveAfter","",1,"actions"],[3,"wishlistItemId","isWishlisted"],["le-button","","size","small","color","neutral","variant","outline",3,"click","iconOnly"],["name","pi-ic-s-cross","size","20"],[1,"hotel-card"],[1,"hotel-card__top"],[3,"value","maxValue","size"],[1,"hotel-card__tripadvisor",3,"tripAdvisor"],[1,"hotel-card__info"],[1,"hotel-card__bottom"],[1,"hotel-card__price",3,"price","rounded"],[3,"wishlistToggle","wishlistItemId","isWishlisted"]],template:function(t,i){if(t&1&&(u(0,"lew-gallery-thumbnail",0)(1,"div",1),kt(2),O(3,Ii,1,2,"jan-wishlist-heart",2),u(4,"button",3),y("click",function(o){return i.onCloseClick(o)}),b(5,"le-icon",4),f()()(),u(6,"div",5)(7,"div",6)(8,"h2"),j(9),f(),O(10,Di,1,3,"le-stars",7),f(),O(11,Ai,1,1,"lew-tripadvisor",8),u(12,"div",9)(13,"span"),j(14),D(15,"date"),D(16,"date"),D(17,"date"),D(18,"monthShortTranslation"),f(),u(19,"span"),j(20),D(21,"nightsTranslation"),f(),u(22,"span"),j(23),f(),u(24,"span"),j(25),D(26,"i18n"),f()(),u(27,"div",10),b(28,"workspace-price-formatter",11),u(29,"span"),O(30,Fi,2,5)(31,Ei,2,5),f()()()),t&2){v("images",i.data().images),m(2);let n=Tt(i.data().wishlist());m(),x(n.status==="AVAILABLE"?3:-1),m(),v("iconOnly",!0),m(5),ie(i.data().title),m(),x(i.data().stars?10:-1),m(),x(i.data().tripadvisor?11:-1),m(3),yt(" ",Ne(15,16,i.data().checkInDate,"d")," - ",Ne(16,19,i.data().checkOutDate,"d")," ",G(18,25,+Ne(17,22,i.data().checkOutDate,"M"))),m(6),ie(G(21,27,i.data().nights)),m(3),ie(i.data().mealPlan.name),m(2),ie(ne(26,29,"Flight_included_in_price",void 0,"stay-variants")),m(3),v("price",i.data().price)("rounded",!0),m(2),x(i.pricePresentationMode()==="perpax"?30:31)}},dependencies:[oi,Me,ae,Y,mi,Xt,Zt,di,be,vi,Ft,Mi],styles:['@charset "UTF-8";@keyframes _ngcontent-%COMP%_le-shimmer{to{transform:translate(100%)}}[_nghost-%COMP%]{display:flex;max-width:480px;width:100%;margin:auto;flex-direction:column;align-items:center;border:.0625rem solid var(--pi-color-neutral-200);border-radius:2rem;overflow:hidden;background-color:var(--pi-color-white);box-shadow:0 0 20px #0000001f;position:relative;cursor:pointer}
1[_nghost-%COMP%]   lew-gallery-thumbnail[_ngcontent-%COMP%]{height:148px}[_nghost-%COMP%]   .hotel-card[_ngcontent-%COMP%]{display:flex;flex-direction:column;width:100%;padding:.75rem 1.5rem 1.25rem;gap:.5rem}[_nghost-%COMP%]   .hotel-card__top[_ngcontent-%COMP%]{display:flex;flex-direction:row;align-items:center;gap:.5rem}[_nghost-%COMP%]   .hotel-card__top[_ngcontent-%COMP%]   h2[_ngcontent-%COMP%]{font-size:.9375rem;line-height:1.25rem;letter-spacing:.0046875rem;font-weight:800;color:var(--pi-color-neutral-900);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}[_nghost-%COMP%]   .hotel-card__info[_ngcontent-%COMP%]{display:inline-flex;white-space:initial;flex-wrap:wrap;row-gap:.25rem}[_nghost-%COMP%]   .hotel-card__info[_ngcontent-%COMP%]   span[_ngcontent-%COMP%]{font-size:.8125rem;line-height:1rem;font-weight:600;color:var(--pi-color-neutral-500);white-space:nowrap;display:inline-block}[_nghost-%COMP%]   .hotel-card__info[_ngcontent-%COMP%]   span[_ngcontent-%COMP%]:not(:last-child):after{content:"\\b7";color:var(--pi-color-neutral-500);padding:0 .25rem;display:inline;white-space:pre-wrap}[_nghost-%COMP%]   .hotel-card__bottom[_ngcontent-%COMP%]{display:flex;align-items:baseline;gap:.25rem;align-self:stretch;margin-top:-.25rem}[_nghost-%COMP%]   .hotel-card__bottom[_ngcontent-%COMP%]   span[_ngcontent-%COMP%]{font-size:.8125rem;line-height:1.25rem;letter-spacing:.008125rem;font-weight:600;color:var(--pi-color-neutral-500)}[_nghost-%COMP%]   .hotel-card__price[_ngcontent-%COMP%]{font-size:.9375rem;line-height:1.5rem;letter-spacing:.0046875rem;font-weight:800;color:var(--pi-color-neutral-900)}[_nghost-%COMP%]   .actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}@media screen and (min-width:772px){[_nghost-%COMP%]{width:320px;max-width:320px}[_nghost-%COMP%]   lew-gallery-thumbnail[_ngcontent-%COMP%]{height:180px}}'],changeDetection:0});let a=r;return a})();var Pi={disableDefaultUI:!0,clickableIcons:!1,streetViewControl:!1,mapTypeControl:!1,fullscreenControl:!1,scrollwheel:!0,gestureHandling:"greedy",scaleControl:!0,zoom:5};var ce={dimensions:{QSFData:rt(),EventSource:L.String,EventSourceCategory:L.String,EventSourceComponent:L.String,EventSourceLandingPageType:L.String,SortType:L.String,Filters:rt(),PageLabel:L.String},measures:{}};var Li=_e(ce,{dimensions:{MetaCode:L.Int,PricePerPax:L.String,TotalPrice:L.String},measures:{}}),_i=oe({eventName:"PO_M_HotelCardClick",schema:Li});var Ri=ce,Si=oe({eventName:"PO_M_Enter",schema:Ri});var Bi=_e(ce,{dimensions:{MetaCode:L.Int,PricePerPax:L.String,TotalPrice:L.String},measures:{}}),bi=oe({eventName:"PO_M_PinClick",schema:Bi});var zi=_e(ce,{dimensions:{MapType:L.String},measures:{}}),yi=oe({eventName:"PO_M_MapTypeToggle",schema:zi});var Te=(()=>{let r=class r{constructor(){this.patalystService=l(Bt),this.store=l(_),this.commonAnalytics=l(jt),this.qsfDataResolver=l(Wt),this.eventSourceResolver=l(Vt),this.eventSourceTrackerService=l(qt)}sendMapEnterEvent(){we([this.getMapAnalyticsData(),this.eventSourceResolver.attribution$]).pipe(me(1),Ee(([{common:e,searchCommonData:t,qsfData:i},n])=>{let o=this.eventSourceTrackerService.resolve(n,Ht.AUTOMATIC);this.patalystService.sendAnalyticsEvent(Si({QSFData:i,EventSource:o.eventSource,EventSourceCategory:o.eventSourceCategory,EventSourceComponent:e.eventSourceComponent,EventSourceLandingPageType:e.eventSourceLandingPageType,SortType:t.sort,Filters:t.filters,PageLabel:e.pageLabel}))})).subscribe()}sendPinClickEvent(e){this.sendOfferEvent(e,(t,i)=>bi(Q(te(Q({},this.createBaseEventData(t)),{MetaCode:e.toString()}),this.createPriceData(i))))}sendHotelCardClickEvent(e){this.sendOfferEvent(e,(t,i)=>_i(Q(te(Q({},this.createBaseEventData(t)),{MetaCode:e.toString()}),this.createPriceData(i))))}sendMapTypeToggleEvent(e){this.getMapAnalyticsData().pipe(me(1),Ee(({common:t,searchCommonData:i,qsfData:n})=>{this.patalystService.sendAnalyticsEvent(yi({QSFData:n,EventSource:t.eventSource,EventSourceCategory:t.eventSourceCategory,EventSourceComponent:t.eventSourceComponent,EventSourceLandingPageType:t.eventSourceLandingPageType,SortType:i.sort,Filters:i.filters,MapType:e,PageLabel:t.pageLabel}))})).subscribe()}sendOfferEvent(e,t){this.getMapAnalyticsDataWithOffer(e).pipe(me(1),Ee(({common:i,searchCommonData:n,qsfData:o,offer:s}
1)=>{this.patalystService.sendAnalyticsEvent(t({common:i,searchCommonData:n,qsfData:o},s))})).subscribe()}createBaseEventData(e){return{QSFData:e.qsfData,EventSource:e.common.eventSource,EventSourceCategory:e.common.eventSourceCategory,EventSourceComponent:e.common.eventSourceComponent,EventSourceLandingPageType:e.common.eventSourceLandingPageType,SortType:e.searchCommonData.sort,Filters:e.searchCommonData.filters,PageLabel:e.common.pageLabel}}createPriceData(e){let t=e.items[0];return{PricePerPax:t.pricePerPax.amount.toString(),TotalPrice:t.priceForAll.amount.toString()}}getMapAnalyticsData(){return we([this.commonAnalytics.common$,this.getMapSearchCommonData(),this.qsfDataResolver.resolveQsfDataFromUrl$]).pipe(de(([e,t,i])=>({common:e,searchCommonData:t,qsfData:i})))}getMapAnalyticsDataWithOffer(e){return we([this.commonAnalytics.common$,this.getMapSearchCommonData(),this.qsfDataResolver.resolveQsfDataFromUrl$,this.store.select(J.state)]).pipe(de(([t,i,n,o])=>{let s=o.status==="LOADED"||o.status==="LOADING"||o.status==="ERROR"&&o.offers?o.offers:[];return{common:t,searchCommonData:i,qsfData:n,offer:s.find(c=>c.metaCode===e)}}))}getMapSearchCommonData(){return we([this.store.select(Qt.queryParams),this.store.select(J.state).pipe(Oe(e=>e.status==="LOADED"),de(e=>e.status==="LOADED"?e:null),Oe(e=>e!==null))]).pipe(de(([e,t])=>{var s,c,p,h;if(!t||t.status!=="LOADED")return{searchId:"",filters:{},sort:"",priceCurrency:""};let i=t.lastResponse.sorting,n=t.lastResponse.searchToken,o=Gt(e);return{searchId:n,filters:((s=o.filters)==null?void 0:s.groups.reduce((w,{key:M,value:B})=>te(Q({},w),{[M]:B}),{}))??{},sort:`${i.sortBy}_${i.sortDirection}`,priceCurrency:(h=(p=(c=t.lastResponse.offers[0])==null?void 0:c.items[0])==null?void 0:p.pricePerPax)==null?void 0:h.currency}}))}};r.\u0275fac=function(t){return new(t||r)},r.\u0275prov=g({token:r,factory:r.\u0275fac});let a=r;return a})();var Ie=(()=>{let r=class r{constructor(){this.activatedRoute=l(Ce),this.router=l(ve),this.store=l(_),this.isMapInitializing=this.store.selectSignal(fe.isInitializing),this.queryParams=Lt(this.activatedRoute.queryParams,{initialValue:{}}),this.boundsFromQueryParams=U(()=>{let e=this.queryParams(),t=e["geoBoundingBox[nw][latitude]"],i=e["geoBoundingBox[nw][longitude]"],n=e["geoBoundingBox[se][latitude]"],o=e["geoBoundingBox[se][longitude]"];return t&&i&&n&&o?{nw:{lat:parseFloat(t),lng:parseFloat(i)},se:{lat:parseFloat(n),lng:parseFloat(o)}}:null}),this.centerCoordinates=U(()=>{let e=this.boundsFromQueryParams();return e?{lat:(e.nw.lat+e.se.lat)/2,lng:(e.nw.lng+e.se.lng)/2}:{lat:50,lng:15}})}convertToMapBounds(e){return{nw:{latitude:e.nw.lat,longitude:e.nw.lng},se:{latitude:e.se.lat,longitude:e.se.lng}}}convertGoogleBoundsToMapBounds(e){let t=e.getNorthEast(),i=e.getSouthWest
1();return{nw:{latitude:t.lat(),longitude:i.lng()},se:{latitude:i.lat(),longitude:t.lng()}}}updateQueryParamsWithBounds(e){let t=Q(Q({},this.filterOutArrivalParams(this.activatedRoute.snapshot.queryParams)),this.createBoundsQueryParams(e));this.router.navigate([],{relativeTo:this.activatedRoute,queryParams:t,replaceUrl:!0})}triggerMapSearch(e){if(this.isMapInitializing())return;let t=e.getBounds();t&&(this.updateQueryParamsWithBounds(t),this.store.dispatch(E.setMapAreaSearchActive({isActive:!0})),this.store.dispatch(E.setBounds({bounds:this.convertGoogleBoundsToMapBounds(t)})))}setBoundsWithoutSearch(e){this.store.dispatch(E.setBoundsWithoutSearch({bounds:e}))}dispatchMapBoundsChanged(e){this.store.dispatch(E.setBounds({bounds:e}))}filterOutArrivalParams(e){return qe(e)}createBoundsQueryParams(e){let t=e.getNorthEast(),i=e.getSouthWest();return{"geoBoundingBox[nw][latitude]":t.lat().toFixed(6),"geoBoundingBox[nw][longitude]":i.lng().toFixed(6),"geoBoundingBox[se][latitude]":i.lat().toFixed(6),"geoBoundingBox[se][longitude]":t.lng().toFixed(6)}}};r.\u0275fac=function(t){return new(t||r)},r.\u0275prov=g({token:r,factory:r.\u0275fac});let a=r;return a})();var Z=16,ot=(()=>{let r=class r{constructor(){this.windowRef=l(je),this.gsapService=l(se)}calculateOptimalPosition(e,t){return P(this,null,function*(){let i=yield this.gsapService.get();this.resetCardPosition(e),i.set(t,{xPercent:-50,x:0,y:0}),this.forceReflow(t);let n=this.adjustVerticalPosition(i,e,t);(n==="top"||n==="bottom")&&(i.set(t,{xPercent:-50,x:0,y:0}),this.forceReflow(t));let o=t.getBoundingClientRect(),s=this.calculateHorizontalOffset(o,n),c=this.calculateVerticalOffset(e,t,n);return{position:n,horizontalOffset:s,verticalOffset:c}})}resetCardPosition(e){e.removeAttribute("data-card-position")}forceReflow(e){e.offsetHeight}adjustVerticalPosition(e,t,i){e.set(i,{clearProps:"transform"}),this.forceReflow(i);let n=i.getBoundingClientRect();return n.top>=Z?"top":(t.setAttribute("data-card-position","bottom"),this.forceReflow(i),n=i.getBoundingClientRect(),n.bottom<=this.windowRef.nativeWindow.innerHeight-Z?"bottom":this.positionCardOnSide(e,t,i))}positionCardOnSide(e,t,i){e.set(i,{xPercent:0,x:0,y:0}),t.setAttribute("data-card-position","right"),this.forceReflow(i);let n=this.calculateVerticalOffset(t,i,"right");e.set(i,{y:n}),this.forceReflow(i);let o=i.getBoundingClientRect();if(o.right<=this.windowRef.nativeWindow.innerWidth-Z&&o.top>=Z&&o.bottom<=this.windowRef.nativeWindow.innerHeight-Z)return"right";t.setAttribute("data-card-position","left"),this.forceReflow(i);let c=this.calculateVerticalOffset(t,i,"left");return e.set(i,{y:c}),this.forceReflow(i),o=i.getBoundingClientRect(),o.left>=Z&&o.top>=Z&&o.bottom<=this.windowRef.nativeWindow.innerHeight-Z?"left":(t.setAttribute("data-card-position","top"),e.set(i,{xPercent:-50,x:0,y:0}),this.forceReflow(i),"top")}calculateHorizontalOffset(e,t){if(t==="left"||t==="right")return 0;let i=e.width,n=e.left+i/2;return e.left<Z?Z+i/2-n:e.right>this.windowRef.nativeWindow.innerWidth-Z?this.windowRef.nativeWindow.innerWidth-Z-i/2-n:0}calculateVerticalOffset(e,t,i){if(i==="left"||i==="right"){let n=e.querySelector(".price-bubble");if(!n)return 0;let o=t.offsetHeight,c=n.offsetHeight/2,p=o/2;return c-p}return 0}};r.\u0275fac=function(t){return new(t||r)},r.\u0275prov=g({token:r,factory:r.\u0275fac});let a=r;return a})();var Ue=.3,Xe=20,at=(()=>{let r=class r{constructor(){this.gsapService=l(se)}animateCardAppearance(e,t,i,n){return P(this,null,function*(){let o=yield this.gsapService.get();if(n==="left"||n==="right"){let s=n==="right"?Xe:-Xe;o.set(e,{opacity:0,x:s,y:i,xPercent:0}),o.to(e,{opacity:1,x:0,y:i,xPercent:0,duration:Ue,ease:"power2.out"})}else o.set(e,{x:t,xPercent:-50}),o.fromTo(e,{opacity:0,y:Xe},{opacity:1,y:0,duration:Ue,ease:"power2.out"})})}animateCardDisappearance(e,t){return P(this,null,function*(){(yield this.gsapService.get()).to(e,{opacity:0,y:Xe,duration:Ue,ease:"power2.in",onComplete:t})})}updateCardTransform(e,t,i,n){return P(this,null,function*(){let o=yield this.gsapService.get();n==="left"||n==="right"?o.set(e,{x:0,y:t,xPercent:0}):o.set(e,{x:i,y:t,xPercent:-50})})}getAnimationDuration(){return Ue*1e3}};r.\u0275fac=function(t){return new(t||r)},r.\u0275prov=g({token:r,factory:r.\u0275fac});let a=r;return a})();var st=(()=>
1{let r=class r{constructor(){this.windowRef=l(je),this.positionCheckTimeout=null,this.animationFrameId=null,this.isInitializing=!1,this.lastPinRect=null,this.POSITION_THRESHOLD=1}startTracking(e,t,i){this.isInitializing=i,this.stopTracking(),this.lastPinRect=null;let n=()=>{if(this.isInitializing){this.animationFrameId=requestAnimationFrame(n);return}if(!this.isPinVisible(e)){t.onPinOutOfView();return}this.hasPinMoved(e)&&(t.onCheckPosition(),this.lastPinRect=e.getBoundingClientRect()),this.animationFrameId=requestAnimationFrame(n)};this.animationFrameId=requestAnimationFrame(n)}stopTracking(){this.animationFrameId!==null&&(cancelAnimationFrame(this.animationFrameId),this.animationFrameId=null),this.lastPinRect=null}clearPositionCheckTimeout(){this.positionCheckTimeout!==null&&(clearTimeout(this.positionCheckTimeout),this.positionCheckTimeout=null)}setInitializingComplete(){this.isInitializing=!1}cleanup(){this.stopTracking(),this.clearPositionCheckTimeout()}isPinVisible(e){let t=e.getBoundingClientRect();return t.bottom>0&&t.right>0&&t.top<this.windowRef.nativeWindow.innerHeight&&t.left<this.windowRef.nativeWindow.innerWidth}hasPinMoved(e){let t=e.getBoundingClientRect();if(!this.lastPinRect)return!0;let i=Math.abs(t.left-this.lastPinRect.left),n=Math.abs(t.top-this.lastPinRect.top);return i>this.POSITION_THRESHOLD||n>this.POSITION_THRESHOLD}};r.\u0275fac=function(t){return new(t||r)},r.\u0275prov=g({token:r,factory:r.\u0275fac});let a=r;return a})();var lt=(()=>{let r=class r{};r.\u0275fac=function(t){return new(t||r)},r.\u0275cmp=N({type:r,selectors:[["jan-wishlist-heart-badge"]],decls:1,vars:0,consts:[["size","16","name","pi-ic-s-heart-solid"]],template:function(t,i){t&1&&b(0,"le-icon",0)},dependencies:[Y],styles:["@keyframes _ngcontent-%COMP%_le-shimmer{to{transform:translate(100%)}}[_nghost-%COMP%]{display:contents}le-icon[_ngcontent-%COMP%]{color:var(--jan-wishlist-heart-filled-color, var(--pi-color-accent-2-500))}"],changeDetection:0});let a=r;return a})();function Ni(a,r){if(a&1){let d=q();u(0,"div",1)(1,"jan-map-hotel-card",5),y("closeCard",function(){k(d);let t=C();return T(t.onCloseCard())})("cardClick",function(t){k(d);let i=C();return T(i.cardClick.emit(t))})("wishlistToggle",function(t){k(d);let i=C();return T(i.onWishlistToggle(t))}),f()()}if(a&2){let d=C();m(),v("data",d.hotelCardData())}}function ji(a,r){a&1&&b(0,"jan-wishlist-heart-badge")}var De=(()=>{let r=class r{constructor(){this.price=F.required(),this.wishlist=F.required(),this.active=F(!1),this.selected=F(!1),this.hotelCardData=F(null),this.closeCard=I(),this.pinOutOfView=I(),this.cardClick=I(),this.pinClick=I(),this.pinHoverChange=I(),this.wishlistToggle=I(),this.elementRef=l(he),this.breakpointObserver=l(le),this.cardPositioning=l(ot),this.cardAnimation=l(at),this.visibilityTracker=l(st),this.currentCardElement=null,this.isAnimatingOut=!1,this.isInitializing=!1,this.isMobile=this.breakpointObserver.observe("max-xxs"),$(()=>{this.handleCardVisibilityChange()})}ngOnDestroy(){this.visibilityTracker.cleanup()}onCloseCard(){this.closeCard.emit()}onWishlistToggle(e){this.wishlistToggle.emit(e)}onPinClick(){this.pinClick.emit()}onMouseEnter(){this.pinHoverChange.emit(!0)}onMouseLeave(){this.pinHoverChange.emit(!1)}handleCardVisibilityChange(){let e=this.active(),t=this.hotelCardData();this.visibilityTracker.clearPositionCheckTimeout(),e&&t&&!this.isMobile()?(this.isAnimatingOut=!1,this.isInitializing=!0,requestAnimationFrame(()=>{this.checkCardPosition(),setTimeout(()=>{this.isInitializing=!1,this.visibilityTracker.setInitializingComplete(),this.active()&&this.hotelCardData()&&this.startPositionTracking()},this.cardAnimation.getAnimationDuration()+50)})):(this.isAnimatingOut=!1,this.isInitializing=!1,this.animateCardDisappearance(),this.visibilityTracker.stopTracking())}startPositionTracking(){let e=this.elementRef.nativeElement;this.visibilityTracker.startTracking(e,{onPinOutOfView:()=>this.pinOutOfView.emit(),onCheckPosition:()=>{this.checkCardPosition()}},this.isInitializing)}checkCardPosition(){return P(this,null,function*(){let e=this.elementRef.nativeElement,t=e.querySelector(".hotel-card-wrapper");if(!t)return;
1let n=parseFloat(getComputedStyle(t).opacity)===0&&!this.isAnimatingOut,{position:o,horizontalOffset:s,verticalOffset:c}=yield this.cardPositioning.calculateOptimalPosition(e,t);n?(this.currentCardElement=t,this.cardAnimation.animateCardAppearance(t,s,c,o)):this.currentCardElement===t&&this.cardAnimation.updateCardTransform(t,c,s,o)})}animateCardDisappearance(){if(!this.currentCardElement||this.isAnimatingOut)return;this.isAnimatingOut=!0;let e=this.currentCardElement;this.cardAnimation.animateCardDisappearance(e,()=>{this.isAnimatingOut=!1,this.currentCardElement=null})}};r.\u0275fac=function(t){return new(t||r)},r.\u0275cmp=N({type:r,selectors:[["jan-map-pin-with-price"]],hostVars:4,hostBindings:function(t,i){t&2&&K("active",i.active())("selected",i.selected())},inputs:{price:[1,"price"],wishlist:[1,"wishlist"],active:[1,"active"],selected:[1,"selected"],hotelCardData:[1,"hotelCardData"]},outputs:{closeCard:"closeCard",pinOutOfView:"pinOutOfView",cardClick:"cardClick",pinClick:"pinClick",pinHoverChange:"pinHoverChange",wishlistToggle:"wishlistToggle"},features:[W([{provide:V,useValue:"variants-map"},ot,at,st])],decls:6,vars:4,consts:[[1,"pin-wrapper"],[1,"hotel-card-wrapper"],[1,"price-bubble",3,"click","mouseenter","mouseleave"],["data-testid","hotel-variant-option-price","translate","no",3,"price","rounded"],[1,"pin-dot",3,"click","mouseenter","mouseleave"],[3,"closeCard","cardClick","wishlistToggle","data"]],template:function(t,i){if(t&1&&(u(0,"div",0),O(1,Ni,2,1,"div",1),u(2,"span",2),y("click",function(){return i.onPinClick()})("mouseenter",function(){return i.onMouseEnter()})("mouseleave",function(){return i.onMouseLeave()}),O(3,ji,1,0,"jan-wishlist-heart-badge"),b(4,"workspace-price-formatter",3),f(),u(5,"div",4),y("click",function(){return i.onPinClick()})("mouseenter",function(){return i.onMouseEnter()})("mouseleave",function(){return i.onMouseLeave()}),f()()),t&2){m(),x(i.active()&&i.hotelCardData()&&!i.isMobile()?1:-1);let n=i.wishlist()();m(2),x(n.status==="AVAILABLE"&&n.isWishlisted?3:-1),m(),v("price",i.price())("rounded",!0)}},dependencies:[Me,Ge,lt],styles:[`@keyframes _ngcontent-%COMP%_le-shimmer{to{transform:translate(100%)}}[_nghost-%COMP%]{--map-pin-active-color: var(--pi-color-accent-1-500);--map-pin-selected-color: var(--pi-color-accent-1-800);--map-pin-dot-background-color: var(--pi-color-accent-1-500);--map-pin-dot-outline-color: var(--pi-color-accent-1-300);position:absolute;pointer-events:none}[_nghost-%COMP%]   .pin-wrapper[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;position:relative;transform:translate(-50%,-100%);pointer-events:none}[_nghost-%COMP%]   .hotel-card-wrapper[_ngcontent-%COMP%]{backface-visibility:hidden;display:none}[_nghost-%COMP%]   le-icon[_ngcontent-%COMP%]{--le-icon-size: 16px}[_nghost-%COMP%]   .price-bubble[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.25rem;box-shadow:0 0 20px #0000001f;font-size:.8125rem;line-height:1rem;font-weight:800;color:var(--pi-color-neutral-800);position:relative;background:var(--pi-color-white);padding:.5rem .75rem;border-radius:9999px;outline:.0625rem solid var(--pi-color-neutral-300);outline-offset:-.0625rem;white-space:nowrap;pointer-events:auto;cursor:pointer;transition:all .25s ease}[_nghost-%COMP%]   .price-bubble[_ngcontent-%COMP%]:hover{box-shadow:0 0 12px #0000002e}[_nghost-%COMP%]   .price-bubble[_ngcontent-%COMP%]:before, [_nghost-%COMP%]   .price-bubble[_ngcontent-%COMP%]:after{content:"";position:absolute;left:50%;transform:translate(-50%);width:0;height:0;pointer-events:none;transition:all .25s ease}[_nghost-%COMP%]   .price-bubble[_ngcontent-%COMP%]:before{bottom:-7px;width:11px;height:6px;background:var(--pi-color-neutral-300);mask-image:url("data:image/svg+xml,%3Csvg width='11' height='6' viewBox='0 0 11 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0 L3.5 4.5 Q5.5 6.5 7.5 4.5 L11 0 Z' fill='black'/%3E%3C/svg%3E");mask-size:contain;mask-repeat:no-repeat;-webkit-mask-image:url("data:image/svg+xml,%3Csvg width='11' height='6' viewBox='0 0 11 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0 L3.5 4.5 Q5.5 6.5 7.5 4.5 L11 0 Z' fill='black'/%3E%3C/svg%3E");-webkit-mask-size:contain;-webkit-mask-repeat:no-repeat}[_nghost-%COMP%]   .price-bubble[_ngcontent-%COMP%]:after{bottom:-6px;width:10px;height:7px;background:#fff;mask-image:url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0 L3 4.5 Q5 6.5 7 4.5 L10 0 Z' fill='black'/%3E%3C/svg%3E");mask-size:contain;mask-repeat:no-repeat;-webkit-mask-image:url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0 L3 4.5 Q5 6.5 7 4.5 L10 0 Z' fill='black'/%3E%3C/svg%3E");-webkit-mask-size:contain;-webkit-mask-repeat:no-repeat}[_nghost-%COMP%]   .pin-dot[_ngcontent-%COMP%]{display:flex;flex-direction:row;margin:.625rem .25rem .25rem;background:var(--map-pin-dot-background-color);border-radius:9999px;width:8px;height:8px;outline:1px solid var(--map-pin-dot-outline-color);transition:all .25s ease;pointer-events:auto;cursor:pointer}.active[_nghost-%COMP%]{z-index:999999!important}.active[_nghost-%COMP%]   .price-bubble[_ngcontent-%COMP%]{background:var(--map-pin-active-color);color:var(--pi-color-white);outline-color:var(--map-pin-active-color)}.active[_nghost-%COMP%]   .price-bubble[_ngcontent-%COMP%]:before{background:var(--map-pin-active-color)}.active[_nghost-%COMP%]   .price-bubble[_ngcontent-%COMP%]:after{background:var(--map-pin-active-color)}.selected[_nghost-%COMP%]   .price-bubble[_ngcontent-%COMP%]{background:var(--map-pin-selected-color);color:var(--pi-color-white);outline-color:var(--map-pin-selected-color)}.selected[_nghost-%COMP%]   .price-bubble[_ngcontent-%COMP%]:before{background:var(--map-pin-selected-color)}.selected[_nghost-%COMP%]   .price-bubble[_ngcontent-%COMP%]:after{background:var(--map-pin-selected-color)}.selected[_nghost-%COMP%]   .pin-dot[_ngcontent-%COMP%]{background:var(--map-pin-selected-color)}[_nghost-%COMP%]:hover   .price-bubble[_ngcontent-%COMP%]{box-shadow:0 0 12px #0000002e}[_nghost-%COMP%]:hover   .pin-dot[_ngcontent-%COMP%]{background:var(--map-pin-selected-color)}@media screen and (min-width:772px){[_nghost-%COMP%]   .hotel-card-wrapper[_ngcontent-%COMP%]{display:block;position:absolute;bottom:100%;left:50%;margin-bottom:.75rem;pointer-events:auto;z-index:1000;opacity:0}
1[data-card-position=bottom][_nghost-%COMP%]   .hotel-card-wrapper[_ngcontent-%COMP%]{bottom:auto;top:100%;margin-bottom:0;margin-top:.75rem}[data-card-position=left][_nghost-%COMP%]   .hotel-card-wrapper[_ngcontent-%COMP%]{bottom:auto;top:0;left:auto;right:calc(100% + .75rem);margin:0}[data-card-position=right][_nghost-%COMP%]   .hotel-card-wrapper[_ngcontent-%COMP%]{bottom:auto;top:0;left:calc(100% + .75rem);right:auto;margin:0}}`],changeDetection:0});let a=r;return a})();function Vi(a,r){if(a&1&&b(0,"workspace-price-formatter",1),a&2){let d=C();v("price",d.price())("rounded",!0)}}var Ae=(()=>{let r=class r{constructor(){this.active=F(!1),this.selected=F(!1),this.price=F(null),this.pinClick=I(),this.pinMouseEnter=I(),this.pinMouseLeave=I()}onPinClick(){this.pinClick.emit()}onPinMouseEnter(){this.pinMouseEnter.emit()}onPinMouseLeave(){this.pinMouseLeave.emit()}};r.\u0275fac=function(t){return new(t||r)},r.\u0275cmp=N({type:r,selectors:[["jan-map-pill"]],hostVars:4,hostBindings:function(t,i){t&1&&y("click",function(){return i.onPinClick()})("mouseenter",function(){return i.onPinMouseEnter()})("mouseleave",function(){return i.onPinMouseLeave()}),t&2&&K("active",i.active())("selected",i.selected())},inputs:{active:[1,"active"],selected:[1,"selected"],price:[1,"price"]},outputs:{pinClick:"pinClick",pinMouseEnter:"pinMouseEnter",pinMouseLeave:"pinMouseLeave"},features:[W([{provide:V,useValue:"variants-map"}])],decls:2,vars:1,consts:[[1,"pill-container"],["translate","no",1,"price",3,"price","rounded"]],template:function(t,i){t&1&&(u(0,"div",0),O(1,Vi,1,2,"workspace-price-formatter",1),f()),t&2&&(m(),x(i.price()?1:-1))},dependencies:[Me],styles:["@keyframes _ngcontent-%COMP%_le-shimmer{to{transform:translate(100%)}}[_nghost-%COMP%]{--map-pin-active-color: var(--pi-color-accent-1-500);--map-pin-selected-color: var(--pi-color-accent-1-800);display:inline-flex;position:relative;justify-content:center;align-items:center;flex-shrink:0;pointer-events:auto;cursor:pointer}.pill-container[_ngcontent-%COMP%]{box-shadow:0 0 20px #0000001f;font-size:.8125rem;line-height:1rem;font-weight:800;color:var(--pi-color-neutral-800);background:var(--pi-color-white);padding:.5rem .75rem;border-radius:9999px;outline:.0625rem solid var(--pi-color-neutral-300);outline-offset:-.0625rem;white-space:nowrap;pointer-events:auto;cursor:pointer;display:flex;min-width:32px;min-height:16px;align-items:center;justify-content:center}.pill-container[_ngcontent-%COMP%]   .price[_ngcontent-%COMP%]{font-size:.8125rem;line-height:1rem;font-weight:800;color:var(--pi-color-neutral-800);white-space:nowrap;font-size:0;line-height:0;overflow:hidden;max-width:0;transition:font-size .15s cubic-bezier(.4,0,.2,1),line-height .15s cubic-bezier(.4,0,.2,1),max-width .15s cubic-bezier(.4,0,.2,1)}.active[_nghost-%COMP%]   .pill-container[_ngcontent-%COMP%]{background:var(--map-pin-active-color);outline:.0625rem solid var(--map-pin-active-color)}.active[_nghost-%COMP%]   .pill-container[_ngcontent-%COMP%]   .price[_ngcontent-%COMP%]{color:var(--pi-color-white)}.selected[_nghost-%COMP%]   .pill-container[_ngcontent-%COMP%]{background:var(--map-pin-selected-color);outline:.0625rem solid var(--map-pin-selected-color)}.selected[_nghost-%COMP%]   .pill-container[_ngcontent-%COMP%]   .price[_ngcontent-%COMP%]{color:var(--pi-color-white)}[_nghost-%COMP%]:hover   .pill-container[_ngcontent-%COMP%]   .price[_ngcontent-%COMP%]{font-size:13px;line-height:normal;max-width:200px}"],changeDetection:0});let a=r;return a})();var pe=(()=>{let r=class r{createProjectionContext(e){let t=e.getProjection(),i=e.getCenter(),n=e.getDiv();if(!t||!i||!n)return null;let o=t.fromLatLngToPoint(i);return o?{projection:t,scale:Math.pow(2,e.getZoom()??0),centerWorldPoint:o,mapWidth:n.offsetWidth,mapHeight:n.offsetHeight}:null}latLngToPixelWithContext(e,t){let i=t.projection.fromLatLngToPoint(new google.maps.LatLng(e.lat,e.lng));return i?{x:(i.x-t.centerWorldPoint.x)*t.scale+t.mapWidth/2,y:(i.y-t.centerWorldPoint.y)*t.scale+t.mapHeight/2}:null}calculatePixelDistanceSquared(e,t){let i=e.x-t.x,n=e.y-t.y;return i*i+n*n}calculateZIndex(e,t,i){return t?i.ACTIVE_MARKER_Z_INDEX:Math.floor((i.LATITUDE_OFFSET-e.lat)*i.Z_INDEX_MULTIPLIER)}isMapProjectionReady(e){let t=e.getProjection(),i=e.getCenter();return!!(t&&i)}};r.\u0275fac=function(t){return new(t||r)},r.\u0275prov=g({token:r,factory:r.\u0275fac});let a=r;return a})();var Ze=(()=>
1{let r=class r{constructor(){this.geometryService=l(pe)}filterOffersByProximity(e,t,i,n,o){let s=this.geometryService.createProjectionContext(i);if(!s)return e;let c=n*n,p=this.extractMarkerPositions(t,s),h=[];return e.forEach(w=>{let M=this.geometryService.latLngToPixelWithContext(this.extractOfferPosition(w),s);if(o(w.metaCode)){h.push(w),M&&p.push(M);return}!M||this.isTooClose(M,p,c)||(h.push(w),p.push(M))}),h}filterMarkersByProximity(e,t,i,n){let o=this.geometryService.createProjectionContext(t);if(!o)return{filteredMarkers:e,removedMarkers:[]};let s=i*i,c=[],p=[],h=[];return e.forEach(w=>{let M=w.marker.position,B=M?this.geometryService.latLngToPixelWithContext(M,o):null;if(n(w.metaCode)){p.push(w),B&&c.push(B);return}if(!B){p.push(w);return}this.isTooClose(B,c,s)?h.push(w):(p.push(w),c.push(B))}),{filteredMarkers:p,removedMarkers:h}}extractMarkerPositions(e,t){return e.map(({marker:i})=>{let n=i.position;return n?this.geometryService.latLngToPixelWithContext(n,t):null}).filter(i=>i!==null)}isTooClose(e,t,i){return t.some(n=>this.geometryService.calculatePixelDistanceSquared(e,n)<i)}extractOfferPosition(e){return{lat:e.hotel.location.coordinates.latitude,lng:e.hotel.location.coordinates.longitude}}};r.\u0275fac=function(t){return new(t||r)},r.\u0275prov=g({token:r,factory:r.\u0275fac});let a=r;return a})();var $e=(()=>{let r=class r{constructor(){this.store=l(_),this.geometryService=l(pe),this.pillPinMetaCodesSignal=this.store.selectSignal(R.pillPinMetaCodesSet)}selectPillPinsForNewOffers(e,t,i,n,o){let s=this.getNewOffers(e,t);if(s.length===0||!this.geometryService.isMapProjectionReady(i))return new Set;let c=t.length+s.length,p=this.calculateAvailableSlots(c,t,n);return p<=0?new Set:this.selectRandomPillPins(s,p,o)}getNewOffers(e,t){let i=new Set(t.map(n=>n.metaCode));return e.filter(n=>!i.has(n.metaCode))}calculateAvailableSlots(e,t,i){if(e<=i.minThreshold)return 0;let n=Math.max(0,Math.min(i.maxPillPins,e-i.minThreshold)),o=this.pillPinMetaCodesSignal(),s=Array.from(o).filter(c=>t.some(p=>p.metaCode===c)).length;return n-s}selectRandomPillPins(e,t,i){let n=e.filter(h=>!i(h.metaCode)),o=Math.min(t,n.length),c=[...n].sort(()=>Math.random()-.5).slice(0,o),p=new Set(c.map(h=>h.metaCode));return p.forEach(h=>{this.store.dispatch(A.addPillPinMetaCode({metaCode:h}))}),p}reRandomizePillPins(e,t,i,n){if(!this.geometryService.isMapProjectionReady(t))return{markersToTransformToPill:[],markersToTransformToFull:[]};let o=this.calculateTargetPillPinsCount(e.length,i);if(o===0){let h=this.pillPinMetaCodesSignal();this.clearAllPillPins();let w=e.filter(M=>h.has(M.metaCode)&&!n(M.metaCode)).map(M=>M.metaCode);return{markersToTransformToPill:[],markersToTransformToFull:w}}let s=e.filter(h=>!n(h.metaCode));if(s.length===0)return{markersToTransformToPill:[],markersToTransformToFull:[]};let c=this.pillPinMetaCodesSignal(),p=this.selectNewPillPins(s,o);return this.determineTransformations(e,c,p,n)}calculateTargetPillPinsCount(e,t){return e<=t.minThreshold?0:Math.max(0,Math.min(t.maxPillPins,e-t.minThreshold))}selectNewPillPins(e,t){let o=[...e].sort(()=>Math.random()-.5).slice(0,Math.min(t,e.length)).map(s=>s.metaCode);return this.store.dispatch(A.setPillPinMetaCodes({metaCodes:o})),o}determineTransformations(e,t,i,n){let o=[],s=[];return e.forEach(c=>{let p=t.has(c.metaCode),h=i.includes(c.metaCode);n(c.metaCode)||(!p&&h?o.push(c.metaCode):p&&!h&&s.push(c.metaCode))}),{markersToTransformToPill:o,markersToTransformToFull:s}}clearAllPillPins(){this.store.dispatch(A.clearPillPinMetaCodes())}isPillPin(e){return this.pillPinMetaCodesSignal().has(e)}};r.\u0275fac=function(t){return new(t||r)},r.\u0275prov=g({token:r,factory:r.\u0275fac});let a=r;return a})();var Ke=(()=>{let r=class r{constructor(){this.gsapService=l(se)}animatePillToFullTransformation(e,t,i,n,o){return P(this,null,function*(){let s=yield this.gsapService.get();s.set(t,{opacity:0,scale:.7,y:15}),s.timeline({onStart:i,onComplete:()=>{s.set(t,{clearProps:"all"}),t.style.pointerEvents="",n()}}).to(e,{opacity:0,scale:.7,y:-15,duration:o*.7,ease:"power2.inOut",pointerEvents:"none"},0).to(t,{opacity:1,scale:1,y:0,duration:o*.7,ease:"back.out(1.4)"},0)})}animateFullToPillTransformation(e,t,i,n,o){return P(this,null,function*(){let s=yield this.gsapService.get();s.set(t,{opacity:0,scale:1.3,y:-15}),s.timeline({onStart:i,onComplete:()=>{s.set(t,{clearProps:"all"}),t.style.pointerEvents="",n()}}).to(e,{opacity:0,scale:1.3,y:15,duration:o,ease:"power2.inOut",pointerEvents:"none"},0).to(t,{opacity:1,scale:1,y:0,duration:o,ease:"back.out(1.4)"},0)})}};r.\u0275fac=function(t){return new(t||r)},r.\u0275prov=g({token:r,factory:r.\u0275fac});let a=r;return a})();var ye=(()=>
1{let r=class r{constructor(){this.store=l(_),this.globalConfig=l(Pe)}getWishlistStatus(e){if(!this.globalConfig.features.portfolio.isWishlistEnabled)return z({status:"UNAVAILABLE"});let t=e.items[0].wishlist;return t.itemState==="UNAVAILABLE"?z({status:"UNAVAILABLE"}):U(()=>({status:"AVAILABLE",isWishlisted:this.store.selectSignal(Jt.isItemSelected(t.itemId))(),itemId:t.itemId}))}};r.\u0275fac=function(t){return new(t||r)},r.\u0275prov=g({token:r,factory:r.\u0275fac});let a=r;return a})();var Ye=(()=>{let r=class r{constructor(){this.store=l(_),this.mapWishlistFacade=l(ye),this.viewContainerRef=l(bt)}createPinComponent(e,t,i,n,o,s){if(n&&!o){let c=this.extractPriceFromOffer(e);return this.createBasicPinComponent(t,i,o,s,c)}return this.createFullPinComponent(e,t,i,o,s)}createFullPinComponent(e,t,i,n,o){let s=this.viewContainerRef.createComponent(De),c=this.extractPriceFromOffer(e),p=this.mapWishlistFacade.getWishlistStatus(e);return s.setInput("price",c),s.setInput("active",n),s.setInput("selected",o),s.setInput("wishlist",p),this.setupFullPinEventHandlers(s,t,i),s.changeDetectorRef.detectChanges(),s}createBasicPinComponent(e,t,i,n,o){let s=this.viewContainerRef.createComponent(Ae);return s.setInput("active",i),s.setInput("selected",n),o&&s.setInput("price",o),this.setupBasicPinEventHandlers(s,e,t),s.changeDetectorRef.detectChanges(),s}createAdvancedMarker(e){let t=e.componentRef.location.nativeElement;t.style.zIndex=e.zIndex.toString();let i=new e.AdvancedMarkerElement({map:e.googleMap,position:e.position,content:t,zIndex:e.zIndex,gmpClickable:!0});return i.addListener("click",n=>{n.stop()}),i}extractPriceFromOffer(e){let t=this.store.selectSignal(X.mode)(),i=e.items[0];if(!i)return{amount:0,currency:"PLN"};let n=t==="perpax"?i.pricePerPax:i.priceForAll;return{amount:n.amount??0,currency:n.currency??"PLN"}}extractPosition(e){return{lat:e.hotel.location.coordinates.latitude,lng:e.hotel.location.coordinates.longitude}}setupBasicPinEventHandlers(e,t,i){e.instance.pinClick.subscribe(()=>{var n;(n=i.onPinClick)==null||n.call(i,t)})}setupFullPinEventHandlers(e,t,i){e.instance.closeCard.subscribe(()=>{var n;(n=i.onCloseCard)==null||n.call(i)}),e.instance.pinOutOfView.subscribe(()=>{var n;(n=i.onPinOutOfView)==null||n.call(i,t)}),e.instance.cardClick.subscribe(n=>{var o;(o=i.onCardClick)==null||o.call(i,n)}),e.instance.pinClick.subscribe(()=>{var n;(n=i.onPinClick)==null||n.call(i,t)}),e.instance.pinHoverChange.subscribe(n=>{var o;(o=i.onPinHoverChange)==null||o.call(i,t,n)}),e.instance.wishlistToggle.subscribe(n=>{var o;(o=i.onWishlistToggle)==null||o.call(i,n,t)})}};r.\u0275fac=function(t){return new(t||r)},r.\u0275prov=g({token:r,factory:r.\u0275fac});let a=r;return a})();var ee=(()=>{let r=class r{constructor(){this.store=l(_),this.geometryService=l(pe),this.proximityFilterService=l(Ze),this.pillPinManager=l($e),this.animationService=l(Ke),this.markerFactory=l(Ye),this.markers=z([]),this.requiredPinMetaCode=z(null),this.hiddenMarkers=z([]),this.persistedOffersSignal=this.store.selectSignal(R.persistedOffers),this.activePinMetaCodeSignal=this.store.selectSignal(R.activePinMetaCode),this.selectedPinMetaCodesSignal=this.store.selectSignal(R.selectedPinMetaCodesSet),this.currentCallbacks={},this.currentGoogleMap=null,this.pendingVisibilityRecalculation=null,this.isActive=e=>this.activePinMetaCodeSignal()===e,this.isRequiredPin=e=>this.isActive(e)||this.requiredPinMetaCode()===e,this.isSelected=e=>this.selectedPinMetaCodesSignal().has(e),this.shouldKeepMarker=(e,t)=>t.has(e)||this.isRequiredPin(e)}syncMapMarkers(e,t,i){return P(this,null,function*(){if(!t)return;this.currentGoogleMap=t,this.currentCallbacks=i;let n=new Map(e.map(c=>[c.metaCode,c]));this.handlePersistentOffers(n),this.cleanupMarkers(n,t,i.onMarkerRemoved);let o=[...this.markers(),...this.hiddenMarkers()],s=this.getNewOffers(o,n);s.length>0&&(yield this.addNewMarkers(s,t,i)),this.updateMarkerPrices(n),this.reRandomizePillPins(t,n)})}addNewMarkers(e,t,i){return P(this,null,function*(){if(!t)return;if(!this.geometryService.isMapProjectionReady(t)){let B=t.addListener("idle",()=>{this.addNewMarkers(e,t,i),google.maps.event.removeListener(B)});return}this.currentCallbacks=i,this.currentGoogleMap=t;let{AdvancedMarkerElement:n}=yield google.maps.importLibrary("marker"),o=this.markers(),s=[...o,...this.hiddenMarkers()],c=this.proximityFilterService.filterOffersByProximity(e,s,t,H.MIN_PIN_DISTANCE_PX,this.isRequiredPin),p=new Set(s.map(B=>B.metaCode)),h=this.limitOffers(c,s.length,p,H.MAX_FILTERED_PINS),w=this.pillPinManager.selectPillPinsForNewOffers(
1h,s,t,{maxPillPins:H.MAX_PILL_PINS_COUNT,minThreshold:H.PILL_PINS_MIN_THRESHOLD},this.isActive),M=h.map(B=>{let ge=B.metaCode,ut=w.has(ge),tt=this.isActive(ge),ki=this.isSelected(ge)&&!tt,ft=this.markerFactory.createPinComponent(B,ge,i,ut,tt,ki),gt=this.markerFactory.extractPosition(B),Ti=this.geometryService.calculateZIndex(gt,tt,H);return this.store.dispatch(A.persistOffer({metaCode:ge,offer:B})),{marker:this.markerFactory.createAdvancedMarker({googleMap:t,componentRef:ft,position:gt,zIndex:Ti,AdvancedMarkerElement:n}),componentRef:ft,metaCode:ge,isPill:ut}});this.markers.set([...o,...M])})}saveOfferForSelectedPin(e,t){let i=this.persistedOffersSignal(),n=t.find(o=>o.metaCode===e)??i[e];n&&this.store.dispatch(A.persistOffer({metaCode:e,offer:n}))}updateMarkerZIndex(e,t){let i=this.markers().find(c=>c.metaCode===e);if(!i)return;let n=i.marker.position,o=this.geometryService.calculateZIndex(n,t,H);i.marker.zIndex=o;let s=i.marker.content;s&&(s.style.zIndex=o.toString())}updateMarkerZIndexOnHover(e,t){let i=this.markers().find(o=>o.metaCode===e);if(!i)return;if(t){i.marker.zIndex=H.ACTIVE_MARKER_Z_INDEX;let o=i.marker.content;o&&(o.style.zIndex=String(H.ACTIVE_MARKER_Z_INDEX));return}let n=this.isActive(e);this.updateMarkerZIndex(e,n)}updateMarkerState(e,t){let i=this.pillPinManager.isPillPin(e.metaCode),n=e.componentRef.instance instanceof Ae;if(n&&t.isActive){this.transformPillToFullPin(e,t);return}if(i&&!n&&!t.isActive){this.transformFullPinToPill(e,t);return}this.updateComponentInputs(e,t),this.updateMarkerZIndex(e.metaCode,t.isActive)}recalculateVisibility(e){this.pendingVisibilityRecalculation!==null&&cancelAnimationFrame(this.pendingVisibilityRecalculation),this.pendingVisibilityRecalculation=requestAnimationFrame(()=>{this.pendingVisibilityRecalculation=null,this.performVisibilityRecalculation(e)})}updateComponentInputs(e,t){e.componentRef.setInput("active",t.isActive),e.componentRef.setInput("selected",t.isSelected),e.componentRef.instance instanceof De&&e.componentRef.setInput("hotelCardData",t.hotelCardData),e.componentRef.changeDetectorRef.detectChanges()}updateMarkerPrices(e){[...this.markers(),...this.hiddenMarkers()].forEach(({componentRef:i,metaCode:n})=>{let o=e.get(n);if(!o)return;let s=this.markerFactory.extractPriceFromOffer(o);if(i.instance instanceof De){let{amount:c,currency:p}=i.instance.price();(c!==s.amount||p!==s.currency)&&i.setInput("price",s);let h=i.instance.hotelCardData();h&&i.setInput("hotelCardData",this.updateHotelCardPrice(h,o))}else if(i.instance instanceof Ae){let c=i.instance.price();(!c||c.amount!==s.amount||c.currency!==s.currency)&&i.setInput("price",s)}})}updateHotelCardPrice(e,t){let i=this.store.selectSignal(X.mode)(),{pricePerPax:n,priceForAll:o}=t.items[0],s=i==="perpax"?n:o;return te(Q({},e),{price:{amount:s.amount,currency:s.currency}})}handlePersistentOffers(e){let t=this.markers().reduce((i,{metaCode:n})=>((this.isSelected(n)||this.isActive(n))&&e.has(n)&&(i[n]=e.get(n)),i),{});Object.keys(t).length>0&&this.store.dispatch(A.persistOffers({offers:t})),Object.entries(this.persistedOffersSignal()).forEach(([i,n])=>{let o=Number(i);this.isActive(o)&&!e.has(o)&&e.set(o,n)})}cleanupMarkers(e,t,i){let n=this.markers(),o=this.hiddenMarkers(),s=[...n,...o],c=s.filter(M=>!this.shouldKeepMarker(M.metaCode,e));this.removeMarkersPermanently(c,i);let p=s.filter(M=>this.shouldKeepMarker(M.metaCode,e)),{filteredMarkers:h,removedMarkers:w}=this.proximityFilterService.filterMarkersByProximity(p,t,H.MIN_PIN_DISTANCE_PX,this.isRequiredPin);this.hideMarkers(w),this.showMarkers(h),this.markers.set(h),this.hiddenMarkers.set(w)}performVisibilityRecalculation(e){if(!this.geometryService.isMapProjectionReady(e))return;let t=this.markers(),i=this.hiddenMarkers(),n=[...t,...i];if(n.length===0)return;let{filteredMarkers:o,removedMarkers:s}=this.proximityFilterService.filterMarkersByProximity(n,e,H.MIN_PIN_DISTANCE_PX,this.isRequiredPin),c=o.length!==t.length,p=s.length!==i.length;!c&&!p||(this.hideMarkers(s),this.showMarkers(o),this.markers.set(o),this.hiddenMarkers.set(s))}hideMarkers(e){e.forEach(({marker:t})=>{t.map!==null&&(t.map=null)})}showMarkers(e){this.currentGoogleMap&&e.forEach(({marker:t})=>{t.map===null&&(t.map=this.currentGoogleMap)})}removeMarkersPermanently(e,t){if(e.length===0)return;let i=e.map(({marker:n,metaCode:o})=>(n.map=null,this.isActive(o)&&(this.store.dispatch(A.removePinFromActive({metaCode:o})),t==null||t(o)),o));this.store.dispatch(A.removePersistedOffers({metaCodes:i}
1)),i.forEach(n=>{this.store.dispatch(A.removePillPinMetaCode({metaCode:n}))})}getNewOffers(e,t){let i=new Set(e.map(n=>n.metaCode));return Array.from(t.values()).filter(n=>!i.has(n.metaCode))}limitOffers(e,t,i,n){let o=e.filter(M=>!i.has(M.metaCode)),s=o.filter(M=>this.isRequiredPin(M.metaCode)),c=n-t;if(c<=0)return s;if(o.length<=c)return e;let p=o.slice(0,c),h=e.filter(M=>i.has(M.metaCode)),w=s.filter(M=>!p.includes(M));return[...h,...p,...w]}reRandomizePillPins(e,t){let{markersToTransformToPill:i,markersToTransformToFull:n}=this.pillPinManager.reRandomizePillPins(this.markers(),e,{maxPillPins:H.MAX_PILL_PINS_COUNT,minThreshold:H.PILL_PINS_MIN_THRESHOLD},this.isActive),o=this.persistedOffersSignal();this.transformMarkers(i,(s,c)=>{let p=o[c]||t.get(c);p&&this.store.dispatch(A.persistOffer({metaCode:c,offer:p})),this.transformFullPinToPill(s,{isActive:!1,isSelected:this.isSelected(c),hotelCardData:null})}),this.transformMarkers(n,(s,c)=>{let p=o[c]||t.get(c);p&&(this.store.dispatch(A.persistOffer({metaCode:c,offer:p})),this.transformPillToFullPin(s,{isActive:!1,isSelected:this.isSelected(c),hotelCardData:null}))})}transformMarkers(e,t){let i=[...this.markers(),...this.hiddenMarkers()];e.forEach(n=>{let o=i.find(s=>s.metaCode===n);o&&t(o,n)})}transformPillToFullPin(e,t){let i=this.persistedOffersSignal()[e.metaCode];if(!i)return;let n=this.markerFactory.createFullPinComponent(i,e.metaCode,this.currentCallbacks,t.isActive,t.isSelected);t.hotelCardData&&n.setInput("hotelCardData",t.hotelCardData),n.changeDetectorRef.detectChanges(),this.performMarkerTransformation(e,n,t.isActive,(o,s,c,p)=>this.animationService.animatePillToFullTransformation(o,s,c,p,H.PIN_TRANSITION_DURATION))}transformFullPinToPill(e,t){let i=this.persistedOffersSignal()[e.metaCode],n=i?this.markerFactory.extractPriceFromOffer(i):void 0,o=this.markerFactory.createBasicPinComponent(e.metaCode,this.currentCallbacks,t.isActive,t.isSelected,n);this.performMarkerTransformation(e,o,t.isActive,(s,c,p,h)=>this.animationService.animateFullToPillTransformation(s,c,p,h,H.PIN_TRANSITION_DURATION))}performMarkerTransformation(e,t,i,n){let o=e.marker.content,s=e.componentRef,c=t.location.nativeElement;e.componentRef=t,o.style.pointerEvents="none",n(o,c,()=>{e.marker.content=c},()=>{s.destroy()}),this.updateMarkerZIndex(e.metaCode,i)}};r.\u0275fac=function(t){return new(t||r)},r.\u0275prov=g({token:r,factory:r.\u0275fac});let a=r;return a})();var Fe=(()=>{let r=class r{constructor(){this.store=l(_),this.markersManager=l(ee),this.mapWishlistFacade=l(ye),this.selectedHotelCardData=z(null)}handlePinClick(e,t,i){let n=this.store.selectSignal(R.activePinMetaCode)();this.store.dispatch(A.setActivePin({metaCode:e})),n&&n!==e&&this.transitionPinToSelected(n,i,t);let o=this.store.selectSignal(R.persistedOffers)(),s=t.find(h=>h.metaCode===e)??o[e];if(!s){console.warn(`No offer found for metaCode ${e}`);return}let c=this.prepareHotelCardData(s),p=i.find(h=>h.metaCode===e);if(!p)throw new Error("There is no marker with metaCode "+e);this.store.dispatch(A.persistOffer({metaCode:e,offer:s})),this.markersManager.updateMarkerState(p,{isActive:!0,isSelected:!1,hotelCardData:c}),this.selectedHotelCardData.set(c)}closeHotelCard(e,t){let i=this.store.selectSignal(R.activePinMetaCode)();this.store.dispatch(A.addToSelected()),this.store.dispatch(A.clearActivePin()),i&&this.transitionPinToSelected(i,e,t),this.selectedHotelCardData.set(null)}handlePinOutOfView(e,t,i){this.store.selectSignal(R.isActive(e))()&&(this.selectedHotelCardData.set(null),this.store.dispatch(A.addToSelected()),this.store.dispatch(A.clearActivePin()),this.transitionPinToSelected(e,t,i))}transitionPinToSelected(e,t,i){this.markersManager.saveOfferForSelectedPin(e,i);let n=t.find(o=>o.metaCode===e);n&&this.markersManager.updateMarkerState(n,{isActive:!1,isSelected:!0,hotelCardData:null})}prepareHotelCardData(e){let t=e.items[0],n=this.store.selectSignal(X.mode)()==="perpax"?t.pricePerPax:t.priceForAll;return{title:e.hotel.details.name,checkInDate:t.flight.destinationFlightDepartureDateTime,checkOutDate:t.flight.returnFlightArrivalDateTime,nights:t.stayInformation.nights,mealPlan:t.mealPlan,tripadvisor:e.hotel.details.tripAdvisorRating,images:e.hotel.details.images.map(o=>({src:o,alt:e.hotel.details.name})),price:{amount:n.amount,currency:n.currency},stars:e.hotel.details.category,metaCode:e.metaCode,wishlist:this.mapWishlistFacade.getWishlistStatus(e)}}};r.\u0275fac=function(t){return new(t||r)},r.\u0275prov=g({token:r,factory:r.\u0275fac});let a=r;return a})();var Je=(()=>{let r=class r{addOneTimeListener(e,t,i){let n=e.addListener(t,()=>{i(),google.maps.event.removeListener(n)});return n}addListener(e,t,i){return e.addListener(t,i)}removeListener(e){google.maps.event.removeListener(e)}};r.\u0275fac=function(t){return new(t||r)},r.\u0275prov=g({token:r,factory:r.\u0275fac});let a=r;return a})();function Hi(a,r){return r.length>0?r:a}var ct=(()=>
1{let r=class r{constructor(){this.store=l(_),this.boundsService=l(Ie),this.markersManager=l(ee),this.listenerService=l(Je),this.isMapInitialized=this.store.selectSignal(fe.isInitialized),this.isMapInitializing=this.store.selectSignal(fe.isInitializing)}initializeMap(e,t,i,n){return P(this,null,function*(){if(this.isMapInitialized())return;this.store.dispatch(E.setInitialized({isInitialized:!0})),this.store.dispatch(E.setInitializing({isInitializing:!0})),e.setCenter(this.boundsService.centerCoordinates()),yield this.markersManager.addNewMarkers(t,e,i);let o=this.store.selectSignal(Ve.state)();this.hasSearchDataWithResponse(o)?yield this.initializeWithSearchData(e,o.lastRequest,o.lastResponse,t,n):yield this.initializeWithBoundsFromUrl(e)})}fitMapToOffers(e,t,i=!1){return P(this,null,function*(){if(t.length===0)return;let n=this.createBoundsFromOffers(t);this.store.dispatch(E.setInitializing({isInitializing:!0})),yield new Promise(o=>{e.fitBounds(n,50),this.listenerService.addOneTimeListener(e,"idle",()=>{this.updateBoundsAfterFit(e,i),this.store.dispatch(E.setInitializing({isInitializing:!1})),o()})})})}hasSearchDataWithResponse(e){return Ut(e,["LOADED","AWAITING_FINAL_FIRST_PAGE_RESULTS","LOADING_MORE"])}initializeWithSearchData(e,t,i,n,o){return P(this,null,function*(){this.store.dispatch(ke.initializeWithSearchData({request:t,response:i}));let s=Hi(n,i.offers);if(s.length===0){this.setDefaultBoundsAndUpdateUrl(e),this.store.dispatch(E.setInitializing({isInitializing:!1}));return}yield this.fitMapToOffers(e,s,!0),o&&e.setCenter({lat:o.hotel.location.coordinates.latitude,lng:o.hotel.location.coordinates.longitude}),this.store.dispatch(E.setInitializing({isInitializing:!1}))})}createBoundsFromOffers(e){let t=new google.maps.LatLngBounds;return e.forEach(i=>{t.extend({lat:i.hotel.location.coordinates.latitude,lng:i.hotel.location.coordinates.longitude})}),t}updateBoundsAfterFit(e,t){let i=e.getBounds();if(i){this.boundsService.updateQueryParamsWithBounds(i);let n=this.boundsService.convertGoogleBoundsToMapBounds(i);if(t){this.activateMapAreaSearch(n);return}this.boundsService.setBoundsWithoutSearch(n)}}initializeWithBoundsFromUrl(e){return P(this,null,function*(){let t=this.boundsService.boundsFromQueryParams();if(!t){this.setDefaultBoundsAndUpdateUrl(e),this.store.dispatch(E.setInitializing({isInitializing:!1}));return}let i=new google.maps.LatLngBounds({lat:t.se.lat,lng:t.nw.lng},{lat:t.nw.lat,lng:t.se.lng});e.fitBounds(i,0);let n=this.boundsService.convertToMapBounds(t);this.activateMapAreaSearch(n),this.listenerService.addOneTimeListener(e,"idle",()=>{this.store.dispatch(E.setInitializing({isInitializing:!1}))})})}setDefaultBoundsAndUpdateUrl(e){this.activateCurrentBoundsSearch(e)||this.listenerService.addOneTimeListener(e,"idle",()=>{this.activateCurrentBoundsSearch(e)})}activateMapAreaSearch(e){this.store.dispatch(E.setMapAreaSearchActive({isActive:!0})),this.boundsService.dispatchMapBoundsChanged(e)}activateCurrentBoundsSearch(e){let t=e.getBounds();return t?(this.boundsService.updateQueryParamsWithBounds(t),this.activateMapAreaSearch(this.boundsService.convertGoogleBoundsToMapBounds(t)),!0):!1}};r.\u0275fac=function(t){return new(t||r)},r.\u0275prov=g({token:r,factory:r.\u0275fac});let a=r;return a})();var et=(()=>{let r=class r{constructor(){this.store=l(_),this.router=l(ve),this.route=l(Ce),this.config=l(Pe),this.openExternalPageFeature=l(pi),this.variantUrlPipe=l(li),this.isMinS=l(le).observe("min-s")}selectMapOffer(e,t=!1){let i=this.store.selectSignal(J.state)(),n=i.status==="LOADED"||i.status==="LOADING"||i.status==="ERROR"&&i.offers?i.offers:[],o=this.store.selectSignal(R.persistedOffers)(),s=n.find(h=>h.metaCode===e)??o[e];if(!s){console.warn(`Cannot select offer: No offer found for metaCode ${e}`);return}let c=this.getContextId(i),p=ti(this.buildLinkOptions(s,c),this.route.snapshot.queryParamMap);this.shouldOpenInNewTab(t)?(p.queryParams.eventSource="packages.search.results.map",this.openExternalPageFeature.handle(this.variantUrlPipe.transform(p))):this.router.navigate(p.commands,p)}getContextId(e){if(e.status==="LOADED")return e.lastResponse.contextId;if(e.status==="LOADING")return e.lastRequest.contextId}buildLinkOptions(e,t){var s,c;let i=e.items[0],n=this.store.selectSignal(X.mode)(),o=this.route.
1snapshot.queryParams;return{commands:["portfolio","details","select-room"],queryParamsHandling:"merge",queryParams:{packageId:i.packageId,flightOptionId:i.flightOptionId,departureCode:(s=i.flight)==null?void 0:s.outboundAirportCode,arrivalCode:(c=i.flight)==null?void 0:c.inboundAirportCode,checkInDate:i.stayInformation.checkInDate,checkOutDate:i.stayInformation.checkOutDate,destinationDepartureDate:i.flight.destinationFlightDepartureDateTime,destinationArrivalDate:i.flight.destinationFlightArrivalDateTime,returnDepartureDate:i.flight.returnFlightDepartureDateTime,returnArrivalDate:i.flight.returnFlightArrivalDateTime,metaCode:si(e.metaCode),pricePresentation:n,selectedDeparturePlaces:o.departurePlaces,context:t,noCalendar:i.hasCalendar?void 0:"true",selectedMealPlan:null},relativeTo:null}}shouldOpenInNewTab(e){return e?!0:this.isMinS()?this.config.features.packages.openMapCardInNewTabDesktop:this.config.features.packages.openMapCardInNewTabMobile}};r.\u0275fac=function(t){return new(t||r)},r.\u0275prov=g({token:r,factory:r.\u0275fac});let a=r;return a})();var pt=(()=>{let r=class r{constructor(){this.store=l(_),this.analyticsService=l(Te),this.hotelCardFacade=l(Fe),this.markersManager=l(ee),this.offerSelectionService=l(et)}createCallbacks(e,t){return{onPinClick:i=>this.handlePinClick(i,e),onCloseCard:()=>this.handleCloseCard(e),onPinOutOfView:i=>this.handlePinOutOfView(i,e),onCardClick:i=>this.handleCardClick(i),onMarkerRemoved:t,onPinHoverChange:(i,n)=>this.handlePinHoverChange(i,n),onWishlistToggle:(i,n)=>this.handleWishlistToggle(i,n)}}handlePinClick(e,t){this.analyticsService.sendPinClickEvent(e),this.hotelCardFacade.handlePinClick(e,t(),this.markersManager.markers())}handleCloseCard(e){this.hotelCardFacade.closeHotelCard(this.markersManager.markers(),e())}handlePinOutOfView(e,t){this.hotelCardFacade.handlePinOutOfView(e,this.markersManager.markers(),t())}handleCardClick(e){this.analyticsService.sendHotelCardClickEvent(e.metaCode),this.offerSelectionService.selectMapOffer(e.metaCode,e.ctrlOrMetaKey)}handlePinHoverChange(e,t){this.markersManager.updateMarkerZIndexOnHover(e,t)}handleWishlistToggle(e,t){let n=this.store.selectSignal(R.persistedOffers)()[t];if(!n)throw new Error(`No offer found for metaCode ${t}`);this.store.dispatch(We.toggleWishlistItem({offer:n,triggerElementId:e.wishlistElementTriggerId}))}};r.\u0275fac=function(t){return new(t||r)},r.\u0275prov=g({token:r,factory:r.\u0275fac});let a=r;return a})();var qi=["sidebar"],dt=368,mt=(()=>{let r=class r{constructor(){this.mapSearchState=l(Qe),this.store=l(_),this.hostElement=l(he),this.gsapService=l(se),this.isVisible=F.required(),this.closeSidebar=I(),this.sidebarElement=xe("sidebar"),this.filterGroups=this.mapSearchState.filterGroups,this.resultsCount=this.mapSearchState.filteredOffersCount,this.activeFiltersCount=this.mapSearchState.activeFiltersCount,this.isCollapsed=z(!1),this.sorters=this.mapSearchState.sorters,this.selectedSorter=Dt({source:this.sorters,computation:e=>e==null?void 0:e.find(t=>t.selected)}),$(()=>{let e=this.selectedSorter();!e||re(()=>{var t,i;return((i=(t=this.sorters())==null?void 0:t.find(n=>n.selected))==null?void 0:i.id)===e.id})||this.store.dispatch(Kt.changeSort(e))}),Le(()=>P(this,null,function*(){var i;let e=(i=this.sidebarElement())==null?void 0:i.nativeElement,t=this.hostElement.nativeElement;if(e&&t){let n=yield this.gsapService.get();n.set(e,{x:-dt}),n.set(t,{width:0})}})),$(()=>{let e=this.isVisible();re(()=>{this.animate(e)})})}onCloseSidebar(){this.closeSidebar.emit()}animate(e){return P(this,null,function*(){var p;let t=(p=this.sidebarElement())==null?void 0:p.nativeElement,i=this.hostElement.nativeElement;if(!t||!i)return;let n=e?dt:0,o=e?0:-dt,s=e?"power2.out":"power2.in",c=yield this.gsapService.get();c.to(i,{width:n,duration:.3,ease:s}),c.to(t,{x:o,duration:.3,ease:s})})}};r.\u0275fac=function(t){return new(t||r)},r.\u0275cmp=N({type:r,selectors:[["jan-map-filters-sidebar"]],viewQuery:function(t,i){t&1&&Be(i.sidebarElement,qi,5),t&2&&ze()},inputs:{isVisible:[1,"isVisible"]},outputs:{closeSidebar:"closeSidebar"},features:[W([{provide:V,useValue:"filters"}])],decls:18,vars:23,consts:[["sidebar",""],[1,"sidebar-header"],[1,"sidebar-title"],["le-button","",3,"click","variant","palette","size","iconOnly"],["name","pi-ic-s-arrow-left",3,"size"],[1,"sidebar-content"],[3,"innerHTML"],[1,"sorter-section"],[1,"sorter-title"],[3,"selectedSorterChange","sorters","selectedSorter"],["stroke","bottom",3,"showClearFiltersChip","filterGroups","activeFiltersCount"]],template:function(t,i){if(t&1){let n=q();u(0,"div",null,0)(2,"div",1)(3,"h2",2),j(4),D(5,"i18n"),f(),u(6,"button",3),y("click",function(){return i.onCloseSidebar()}),b(7,"le-icon",4),f()(),u(8,"div",5)(9,"jan-price-switch-search"),b(10,"span",6),D(11,"i18n"),f(),u(12,"div",7)(13,"h3",8),j(14),D(15,"i18n"),f(),u(16,"jan-sorter-selection-list",9),xt("selectedSorterChange",function(s){return k(n),Ot(i.selectedSorter,s)||(i.selectedSorter=s),T(s)}),f()(),b(17,"jan-filters",10),f()()}t&2&&(m(4),ie(G(5,15,"Filters_and_sorting")),m(2),v("variant","outline")("palette","neutral")("size","small")("iconOnly",!0),m(),v("size",24),m(),K("collapsed",i.isCollapsed()),m(2),v("innerHTML",G(11,17,"show_price_for_all"),St),m(4),ie(ne(15,19,"Sort_by",void 0,"sorters")),m(2),v("sorters",
1i.sorters()),wt("selectedSorter",i.selectedSorter),m(),v("showClearFiltersChip",!0)("filterGroups",i.filterGroups())("activeFiltersCount",i.activeFiltersCount()))},dependencies:[ci,ri,Y,ae,ai,be],styles:["@keyframes _ngcontent-%COMP%_le-shimmer{to{transform:translate(100%)}}[_nghost-%COMP%]{display:block;width:0;height:100dvh;z-index:2;overflow:hidden;flex-shrink:0}[_nghost-%COMP%] > div[_ngcontent-%COMP%]{display:flex;flex-direction:column;width:368px;height:100%;background-color:var(--pi-color-white);box-shadow:0 0 20px #0000001f;padding:1.25rem}.sidebar-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;background-color:var(--pi-color-white);flex-shrink:0;padding-bottom:.75rem}.sidebar-title[_ngcontent-%COMP%]{font-size:1rem;line-height:1.5rem;letter-spacing:.005rem;font-weight:800;margin:0;color:var(--pi-color-neutral-800)}.header-controls[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.75rem}.sorter-section[_ngcontent-%COMP%]{display:flex;flex-direction:column}.sorter-title[_ngcontent-%COMP%]{font-size:1rem;line-height:1.5rem;letter-spacing:.005rem;font-weight:800;color:var(--pi-color-neutral-900);margin-bottom:1rem}.sidebar-content[_ngcontent-%COMP%]{display:flex;flex-direction:column;flex:1;gap:.75rem;overflow-y:auto;margin-right:-.625rem;padding-right:.625rem;overflow:auto}@supports (scrollbar-gutter: stable){.sidebar-content[_ngcontent-%COMP%]{scrollbar-gutter:stable}@media(hover:hover)and (pointer:fine){.sidebar-content[_ngcontent-%COMP%]{overflow:hidden}.sidebar-content[_ngcontent-%COMP%]:hover{overflow:auto}}@media(hover:none){.sidebar-content[_ngcontent-%COMP%]{overflow:auto}}}.sidebar-content[_ngcontent-%COMP%]::-webkit-scrollbar{width:.375rem;height:.375rem}.sidebar-content[_ngcontent-%COMP%]::-webkit-scrollbar-track{background:transparent}.sidebar-content[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background:var(--pi-color-neutral-200);border-radius:6px}.sidebar-content[_ngcontent-%COMP%]::-webkit-scrollbar-thumb:hover{background:var(--pi-color-neutral-300)}.sidebar-content[_ngcontent-%COMP%]   jan-price-switch-search[_ngcontent-%COMP%]{padding-bottom:.75rem;width:min-content}.sidebar-content[_ngcontent-%COMP%]   jan-filters[_ngcontent-%COMP%]{display:flex;flex-direction:column}"],changeDetection:0});let a=r;return a})();var Wi=["searchFormElement"];function Qi(a,r){a&1&&b(0,"le-icon",9),a&2&&v("size",24)}function Gi(a,r){if(a&1&&j(0),a&2){let d=C(2);ue(" (",d.activeFiltersCount(),") ")}}function Ui(a,r){a&1&&b(0,"le-icon",10),a&2&&v("size",24)}function Xi(a,r){if(a&1){let d=q();u(0,"button",8),y("click",function(){k(d);let t=C();return T(t.onOpenFilters())}),O(1,Qi,1,1,"le-icon",9),j(2),D(3,"i18n"),D(4,"capitalize"),O(5,Gi,1,1),O(6,Ui,1,1,"le-icon",10),f()}if(a&2){let d=C();m(),x(d.isMaxXxs()?1:-1),m(),ue(" ",G(4,8,ne(3,4,"Filters_and_sorting",void 0,"filters"))," "),m(3),x(d.activeFiltersCount()>0?5:-1),m(),x(d.isMaxXxs()?-1:6)}}function Zi(a,r){a&1&&(j(0),D(1,"i18n"),D(2,"capitalize")),a&2&&ue(" ",G(2,3,G(1,1,"Close"))," ")}function $i(a,r){if(a&1){let d=q();u(0,"button",11),y("click",function(){k(d);let t=C();return T(t.onClose())}),O(1,Zi,3,5),b(2,"le-icon",12),f()}if(a&2){let d=C();v("size",d.isMaxXxs()?"large":"small")("iconOnly",d.isMaxXxs()),m(),x(d.isMaxXxs()?-1:1),m(),v("size",24)}}function Ki(a,r){if(a&1){let d=q();u(0,"div",13),y("click",function(t){k(d);let i=C();return T(i.onOverlayClick(t))}),f()}}var ht=(()=>{let r=class r{constructor(){this.closeModal=I(),this.openFilters=I(),this.search=I(),this.isDesktop=F(!1),this.isSidebarVisible=F(!1),this.activeFiltersCount=F(0),this.isMapAreaActive=F(!1),this.isSearchFormExpanded=z(!1),this.webInterfaceDetector=l(zt),this.portfolioSearchForm=xe(He),this.searchFormElement=xe("searchFormElement",{read:he}),this.translationService=l(Se),this.translationContext=l(V),this.platformId=l(_t),this.ngZone=l(Pt),this.breakpointObserver=l(le),this.mapAreaArrivalLabel=this.translationService.translate("map_area",this.translationContext),this.showCloseButton=!this.webInterfaceDetector.webViewDisplayMode,this.isMaxXxs=this.breakpointObserver.observe("max-xxs"),this.isMinXs=this.breakpointObserver.observe("min-xs"),this.isMaxS=this.breakpointObserver.observe("max-s"),this.show
1FiltersButton=this.breakpointObserver.observe("max-xs"),this.showSidebarTrigger=U(()=>this.isDesktop()&&!this.isSidebarVisible()),this.isInSmallDesktopRange=U(()=>this.isMinXs()&&this.isMaxS()),this.isSmallDesktop=U(()=>this.isSidebarVisible()&&this.isInSmallDesktopRange()),Et(this.platformId)&&$(()=>{var t;let e=(t=this.searchFormElement())==null?void 0:t.nativeElement;e&&this.observeSearchFormExpandedState(e)})}ngOnDestroy(){var e;(e=this.mutationObserver)==null||e.disconnect()}onClose(){this.closeModal.emit()}onOpenFilters(){this.openFilters.emit()}onSearch(e){e.preventDefault(),this.search.emit(e.detail)}onOverlayClick(e){var t,i;e.stopPropagation(),!((t=this.portfolioSearchForm())!=null&&t.closeOpenedPopover())&&((i=this.portfolioSearchForm())==null||i.collapseSearchForm())}observeSearchFormExpandedState(e){var t;(t=this.mutationObserver)==null||t.disconnect(),this.updateSearchFormExpandedState(e),this.ngZone.runOutsideAngular(()=>{this.mutationObserver=new MutationObserver(()=>{let i=this.isExpandedInline(e);this.ngZone.run(()=>{this.isSearchFormExpanded.set(i)})}),this.mutationObserver.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["class"]})})}updateSearchFormExpandedState(e){this.isSearchFormExpanded.set(this.isExpandedInline(e))}isExpandedInline(e){return[e,e.querySelector("qsf-portfolio-search-form")].filter(i=>i instanceof HTMLElement).some(i=>["collapsible","expanded","inlineExpanded"].every(n=>i.classList.contains(n)))}};r.\u0275fac=function(t){return new(t||r)},r.\u0275cmp=N({type:r,selectors:[["jan-map-header"]],viewQuery:function(t,i){t&1&&Be(i.portfolioSearchForm,He,5)(i.searchFormElement,Wi,5,he),t&2&&ze(2)},inputs:{isDesktop:[1,"isDesktop"],isSidebarVisible:[1,"isSidebarVisible"],activeFiltersCount:[1,"activeFiltersCount"],isMapAreaActive:[1,"isMapAreaActive"]},outputs:{closeModal:"closeModal",openFilters:"openFilters",search:"search"},features:[W([{provide:V,useValue:"variants-map"}])],decls:8,vars:11,consts:[["searchFormElement",""],[1,"map-header__content"],["le-button","","variant","outline","color","neutral","size","small","data-testid","open-map-filters-sidebar-button",1,"filters-trigger"],[1,"map-header__qsf-wrapper"],[1,"map-header__qsf"],["janPortfolioQsfAnalytics","","janPortfolioQsfInteractionAnalytics","","janPortfolioQsfSearch","",3,"piQSFFiltersClick","piQSFSearch","collapsible","arrivalLabelOverride","smallDesktop","showFiltersButton","expandOnFiltersClick","showSearchButtonInSummary"],["data-testid","close-map-modal-button","variant","outline","palette","neutral","le-button","",1,"close-button",3,"size","iconOnly"],[1,"overlay"],["le-button","","variant","outline","color","neutral","size","small","data-testid","open-map-filters-sidebar-button",1,"filters-trigger",3,"click"],["name","pi-ic-s-filters",3,"size"],["name","pi-ic-s-arrow-right",3,"size"],["data-testid","close-map-modal-button","variant","outline","palette","neutral","le-button","",1,"close-button",3,"click","size","iconOnly"],["name","pi-ic-s-cross",3,"size"],[1,"overlay",3,"click"]],template:function(t,i){t&1&&(u(0,"div",1),O(1,Xi,7,10,"button",2),u(2,"div",3)(3,"div",4)(4,"esky-portfolio-search-form",5,0),y("piQSFFiltersClick",function(){return i.onOpenFilters()})("piQSFSearch",function(o){return i.onSearch(o)}),f()()(),O(6,$i,3,4,"button",6),f(),O(7,Ki,1,0,"div",7)),t&2&&(m(),x(i.showSidebarTrigger()?1:-1),m(),K("map-header__qsf-wrapper--expanded",i.isSearchFormExpanded()),m(2),v("collapsible",!0)("arrivalLabelOverride",i.isMapAreaActive()?i.mapAreaArrivalLabel:null)("smallDesktop",i.isSmallDesktop())("showFiltersButton",i.showFiltersButton())("expandOnFiltersClick",!1)("showSearchButtonInSummary",!1),m(2),x(i.showCloseButton?6:-1),m(),x(i.isSearchFormExpanded()?7:-1))},dependencies:[He,ii,ni,Yt,ae,Y,be,Ci],styles:["@keyframes _ngcontent-%COMP%_le-shimmer{to{transform:translate(100%)}}[_nghost-%COMP%]{position:absolute;top:1rem;left:1rem;right:1rem;z-index:11;display:block;--close-button-space: 56px;pointer-events:none}.map-header__content[_ngcontent-%COMP%]{position:relative}.map-header__qsf[_ngcontent-%COMP%]{width:100%;max-width:360px;margin-inline:auto;min-width:0;pointer-events:auto}.map-header__qsf-wrapper[_ngcontent-%COMP%]{position:absolute;top:0;width:100%;z-index:1}.map-header__qsf-wrapper--expanded[_ngcontent-%COMP%]{z-index:3}.map-header__qsf-wrapper--expanded[_ngcontent-%COMP%]   .map-header__qsf[_ng
1content-%COMP%]{max-width:min(100%,1240px)}@media screen and (max-width:771px){.map-header__qsf-wrapper[_ngcontent-%COMP%]{width:calc(100% - var(--close-button-space) - .25rem)}}.map-header__content[_ngcontent-%COMP%]:has(.map-header__qsf-wrapper--expanded) > .filters-trigger[_ngcontent-%COMP%], .map-header__content[_ngcontent-%COMP%]:has(.map-header__qsf-wrapper--expanded) > .close-button[_ngcontent-%COMP%], .map-header__content[_ngcontent-%COMP%]:has(.qsf-opened) > .close-button[_ngcontent-%COMP%]{z-index:0}.filters-trigger[_ngcontent-%COMP%]{display:none;pointer-events:auto;position:relative;z-index:2}.close-button[_ngcontent-%COMP%]{position:absolute;top:0;right:0;pointer-events:auto;z-index:2}.overlay[_ngcontent-%COMP%]{display:none;position:fixed;inset:0;z-index:0;background:#0000007a;pointer-events:auto}@media screen and (min-width:772px){.overlay[_ngcontent-%COMP%]{display:block}}@media screen and (min-width:1090px){.filters-trigger[_ngcontent-%COMP%]{display:flex}}[_nghost-%COMP%]     qsf-portfolio-search-form.collapsible .formWrapper{width:100%!important;max-width:100%!important;min-height:auto!important;display:flex!important;justify-content:center}[_nghost-%COMP%]     qsf-portfolio-search-form.collapsible .formWrapper .summaryAnimWrapper{display:flex;justify-content:center!important}[_nghost-%COMP%]     qsf-search-form-summary .summaryShell{padding:var(--pi-size-spacing-8) var(--pi-size-spacing-16)!important}[_nghost-%COMP%]     qsf-search-form-summary .container.force-mobile-appearance{min-width:160px;margin:0 var(--pi-size-spacing-4)}[_nghost-%COMP%]     qsf-search-form-summary .container.force-mobile-appearance .summary{min-width:0}[_nghost-%COMP%]     esky-portfolio-search-form{display:block;width:100%}@media screen and (min-width:772px){[_nghost-%COMP%]{top:2rem;left:2rem;right:2rem;--close-button-space: 128px}.map-header__qsf-wrapper[_ngcontent-%COMP%]{top:-12px}.map-header__qsf[_ngcontent-%COMP%]{max-width:min(100%,1240px)}[_nghost-%COMP%]     qsf-portfolio-search-form.collapsible .formWrapper{display:flex;justify-content:center}}@media screen and (min-width:1090px){[_nghost-%COMP%]{top:2.5rem;left:2.5rem;right:2.5rem}[_nghost-%COMP%]   .map-header__qsf-wrapper--expanded[_ngcontent-%COMP%]{top:-20px}}"],changeDetection:0});let a=r;return a})();function wi(a,r,d){if(!a)return;let e=r.find(t=>t.metaCode===a);return e||((d==null?void 0:d.metaCode)===a?d:void 0)}function Oi(a,r){return!r||a.some(d=>d.metaCode===r.metaCode)?a:[...a,r]}function Yi(a,r){if(a&1){let d=q();u(0,"jan-map-filters-sidebar",8),y("closeSidebar",function(){k(d);let t=C();return T(t.closeSidebar())}),f()}if(a&2){let d=C();v("isVisible",d.isSidebarVisible())}}function Ji(a,r){if(a&1){let d=q();u(0,"google-map",9),y("mapInitialized",function(t){k(d);let i=C();return T(i.mapInitialized(t))})("mapDragstart",function(){k(d);let t=C();return T(t.onMapDragStart())})("mapDragend",function(){k(d);let t=C();return T(t.onMapDragEnd())})("zoomChanged",function(){k(d);let t=C();return T(t.onMapZoomChanged())})("mapClick",function(){k(d);let t=C();return T(t.onMapClick())}),f()}if(a&2){let d=C();v("options",d.MAP_OPTIONS)}}function en(a,r){if(a&1&&(u(0,"button",10),b(1,"le-icon",11),f()),a&2){let d=C();K("roadmap",!d.isSatellite()),m(),v("size",24)}}function tn(a,r){if(a&1){let d=q();u(0,"div",7)(1,"jan-map-hotel-card",12),y("closeCard",function(){k(d);let t=C();return T(t.onCloseHotelCard())})("cardClick",function(t){k(d);let i=C();return T(i.onCardClick(t))})("wishlistToggle",function(t){k(d);let i=C();return T(i.onWishlistToggle(t))}),f()()}a&2&&(m(),v("data",r))}var xi=(()=>{let r=class r{constructor(){this.mapId=l(Pe).features.portfolio.variants.mapId,this.store=l(_),this.activatedRoute=l(Ce),this.router=l(ve),this.googleMapLoader=l(ei),this.userAgentService=l(Rt),this.mapBoundsService=l(Ie),this.mapHotelCardFacade=l(Fe),this.mapMarkersManagerService=l(ee),this.mapInitializationService=l(ct),this.mapCallbacksService=l(pt),this.mapAnalyticsService=l(Te),this.breakpointObserver=l(le),this.dialog=l(Nt),this.injector=l(Mt),this.mapSearchStateQuery=l(Qe),this.mapSearchRequestResolver=l(hi),this.MAP_OPTIONS=te(Q({},Pi),{mapId:this.mapId}),this.mapSearchState=this.store.selectSignal(J.state),this.portfolioOffersToDisplay=this.store.selectSignal(Ve.offersToDisplay),this.preselectedPackage=this.store.selectSignal($t.preselectedPackage),this.selectedPortfolioOffer=U(()=>wi(this.initialSelectedMetaCode,this.portfolioOffersToDisplay(),this.preselectedPackage())),this.mapDisplayOffers=U(()=>{let e=this.mapSearchState(),t=e.status==="LOADED"||e.status==="LOADING"||e.status==="ERROR"&&e.offers?e.offers:[];return Oi(t,this.selectedPortfolioOffer())}),this.isLoading=this.store.selectSignal(J.isLoading),this.selectedHotelCardData=this.mapHotelCardFacade.selectedHotelCardData,this.activeFiltersCount=this.mapSearchStateQuery.activeFiltersCount,this.isMapAreaActive=this.store.selectSignal(fe.isMapAreaSearchActive),this.isMaxXxs=this.breakpointObserver.observe("max-xxs"),this.isDesktop=this.breakpointObserver.observe("min-s"),this.googleMap=null,this.isDragging=!1,this.isSatellite=z(!1),this.isSidebarVisible=z(!1),this.initialSelectedMetaCode=Number(this.activatedRoute.snapshot.queryParams.selectedMetaCode)||null,this.hasAppliedInitialSelection=!1,this.apiLoaded$=Ct(()=>this.userAgentService.isBot()?it(!1):this.googleMapLoader.loadLibraries$.pipe(de(()=>!0),vt(()=>it(!1)))),this.mapMarkersManagerService.requiredPinMetaCode.set(this.initialSelectedMetaCode),$(()=>{this.mapDisplayOffers(),re(()=>this.syncMarkers())}),$(()=>{this.store.selectSignal(X.mode)(),re(()=>this.syncMarkers())}),$(()=>{let e=this.initialSelectedMetaCode;if(!e||this.hasAppliedInitialSelection)return;let t=this.mapMarkersManagerService.markers();t.find(n=>n.metaCode===e)&&(this.hasAppliedInitialSelection=!0,re(()=>this.mapHotelCardFacade.handlePinClick(e,this.mapDisplayOffers(),t)))}),Le(()=>{this.mapAnalyticsService.sendMapEnterEvent()})}ngOnDestroy(){this.store.dispatch(E.resetState())}mapInitialized(e){return P(this,null,function*(){this.googleMap=e;let t=this.mapCallbacksService.createCallbacks(()=>this.mapDisplayOffers());yield this.mapInitializationService.initializeMap(this.googleMap,this.mapDisplayOffers(),t,this.selectedPortfolioOffer())})}zoomIn(){var e;(e=this.googleMap)==null||e.setZoom(this.googleMap.getZoom()+1)}zoomOut(){var e;(e=this.googleMap)==null||e.setZoom(this.googleMap.getZoom()-1)}
1toggleMapType(){if(!this.googleMap)return;let e=!this.isSatellite();this.isSatellite.set(e),this.googleMap.setMapTypeId(e?google.maps.MapTypeId.HYBRID:google.maps.MapTypeId.ROADMAP),this.mapAnalyticsService.sendMapTypeToggleEvent(e?"satellite":"roadmap")}close(){this.store.dispatch(ke.cancelSearch()),this.store.dispatch(E.closeMap())}openFilters(){if(this.isDesktop()&&!this.isSidebarVisible()){this.openSidebar();return}this.openFiltersDialog()}openFiltersDialog(){return P(this,null,function*(){let[{MapFiltersDialogComponent:e},{LeXlDialogContainerComponent:t}]=yield Promise.all([import("./chunk-2DK6VY2P.js"),import("./chunk-INV3ADTX.js")]);this.dialog.open(e,{container:t,parentInjector:this.injector})})}closeSidebar(){this.isSidebarVisible.set(!1)}openSidebar(){this.isSidebarVisible.set(!0)}onSearch(e){return P(this,null,function*(){this.selectedHotelCardData()&&this.onCloseHotelCard(),this.store.dispatch(E.clearBounds()),yield this.updateQueryParamsForSearch(e.searchUrl);let t=yield nt(this.mapSearchRequestResolver.getRequestParam
1sForBounds().pipe(me(1)));this.store.dispatch(ke.requestSearchForBounds({request:t})),!((yield nt(this.store.select(J.state).pipe(Oe(n=>this.isSearchCompleted(n,t)),me(1)))).status!=="LOADED"||!this.googleMap)&&(yield this.mapInitializationService.fitMapToOffers(this.googleMap,this.mapDisplayOffers()))})}onMapDragStart(){this.isDragging=!0}onMapDragEnd(){this.isDragging=!1,this.googleMap&&this.mapBoundsService.triggerMapSearch(this.googleMap)}onMapZoomChanged(){this.googleMap&&(this.mapMarkersManagerService.recalculateVisibility(this.googleMap),this.mapBoundsService.triggerMapSearch(this.googleMap))}onMapClick(){this.isDragging||this.selectedHotelCardData()&&this.onCloseHotelCard()}onCloseHotelCard(){re(()=>{this.mapHotelCardFacade.closeHotelCard(this.mapMarkersManagerService.markers(),this.mapDisplayOffers())})}onWishlistToggle(e){let t=this.selectedHotelCardData();if(!t)return;let n=this.store.selectSignal(R.persistedOffers)()[t.metaCode];if(!n)throw new Error(`No offer found for metaCode ${t.metaCode}`);this.store.dispatch(We.toggleWishlistItem({offer:n,triggerElementId:e.wishlistElementTriggerId}))}onCardClick(e){var t,i;this.mapAnalyticsService.sendHotelCardClickEvent(e.metaCode),(i=(t=this.mapCallbacksService.createCallbacks(()=>this.mapDisplayOffers())).onCardClick)==null||i.call(t,e)}syncMarkers(){if(this.googleMap&&this.mapInitializationService.isMapInitialized()){let e=this.mapCallbacksService.createCallbacks(()=>this.mapDisplayOffers(),()=>this.selectedHotelCardData.set(null));this.mapMarkersManagerService.syncMapMarkers(this.mapDisplayOffers(),this.googleMap,e)}}isSearchCompleted(e,t){return e.status==="LOADED"&&e.lastRequest===t||e.status==="ERROR"}updateQueryParamsForSearch(e){return P(this,null,function*(){yield this.router.navigate([],{relativeTo:this.activatedRoute,queryParams:this.buildSearchQueryParams(e),replaceUrl:!0})})}buildSearchQueryParams(e){let t=qe(Object.fromEntries(new URL(e).searchParams.entries()));return delete t["geoBoundingBox[nw][latitude]"],delete t["geoBoundingBox[nw][longitude]"],delete t["geoBoundingBox[se][latitude]"],delete t["geoBoundingBox[se][longitude]"],t}};r.\u0275fac=function(t){return new(t||r)},r.\u0275cmp=N({type:r,selectors:[["jan-search-map"]],features:[W([Te,Ie,Fe,ee,ct,Je,et,pe,Ze,$e,Ke,Ye,pt,ye],[{provide:V,useValue:"portfolio-search-map"}])],decls:9,vars:11,consts:[[3,"isVisible"],[1,"map-container"],[3,"openFilters","search","closeModal","isDesktop","isSidebarVisible","activeFiltersCount","isMapAreaActive"],["height","100%","width","100%",3,"options"],["jan-map-satellite-button","",1,"satellite-button",3,"click","isSatellite"],[3,"zoomIn","zoomOut"],["variant","outline","color","neutral","le-button","","tabindex","-1","size","large",1,"loading-button",3,"roadmap"],[1,"hotel-card-container"],[3,"closeSidebar","isVisible"],["height","100%","width","100%",3,"mapInitialized","mapDragstart","mapDragend","zoomChanged","mapClick","options"],["variant","outline","color","neutral","le-button","","tabindex","-1","size","large",1,"loading-button"],["name","pi-ic-s-no-full-circle",1,"spinning-icon",3,"size"],[3,"closeCard","cardClick","wishlistToggle","data"]],template:function(t,i){if(t&1&&(O(0,Yi,1,1,"jan-map-filters-sidebar",0),u(1,"div",1)(2,"jan-map-header",2),y("openFilters",function(){return i.openFilters()})("search",function(o){return i.onSearch(o)})("closeModal",function(){return i.close()}),f(),O(3,Ji,1,1,"google-map",3),D(4,"async"),u(5,"button",4),y("click",function(){return i.toggleMapType()}),f(),u(6,"jan-map-zoom-controls",5),y("zoomIn",function(){return i.zoomIn()})("zoomOut",function(){return i.zoomOut()}),f(),O(7,en,2,3,"button",6),O(8,tn,2,1,"div",7),f()),t&2){let n;x(i.isDesktop()?0:-1),m(2),v("isDesktop",i.isDesktop())("isSidebarVisible",i.isSidebarVisible())("activeFiltersCount",i.activeFiltersCount())("isMapAreaActive",i.isMapAreaActive()),m(),x(G(4,9,i.apiLoaded$)?3:-1),m(2),v("isSatellite",i.isSatellite()),m(2),x(i.isLoading()?7:-1),m(),x((n=i.isMaxXxs()&&i.selectedHotelCardData())?8:-1,n)}},dependencies:[ui,fi,gi,ht,ae,Y,Ge,mt,At],styles:['@keyframes _ngcontent-%COMP%_le-shimmer{to{transform:translate(100%)}}[_nghost-%COMP%]{display:flex;flex-direction:row;width:100%;height:100dvh}.map-container[_ngcontent-%COMP%]{flex:1;position:relative;height:100%}google-map[_ngcontent-%COMP%]{width:100%;height:100%}.loading-button[_ngcontent-%COMP%]{position:absolute;top:5rem;left:50%;transform:translate(-50%);z-index:10;pointer-events:none;transition:background-color .3s ease,border-color .3s ease,box-shadow .3s ease}.loading-button[_ngcontent-%COMP%]   le-icon[_ngcontent-%COMP%]{transition:color .3s ease}.loading-button.roadmap[_ngcontent-%COMP%]{background-color:var(--pi-color-neutral-800);border-color:var(--pi-color-neutral-800);box-shadow:0 0 20px #0000001f}.loading-button.roadmap[_ngcontent-%COMP%]   le-icon[_ngcontent-%COMP%]{color:var(--pi-color-white)}.spinning-icon[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_spin 1s linear infinite}@keyframes _ngcontent-%COMP%_spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.satellite-button[_ngcontent-%COMP%]{position:absolute;bottom:1.75rem;right:1.25rem;z-index:1}.hotel-card-container[_ngcontent-%COMP%]{position:absolute;bottom:1.75rem;left:50%;transform:translate(-50%);z-index:10;width:calc(100% - 2.5rem);max-width:480px;pointer-events:auto}
1@media screen and (max-width:771px){[_nghost-%COMP%]     .collapsibleModalBody{width:initial!important}}[_nghost-%COMP%]     .hotel-card-wrapper{font-family:var(--jan-font-family, --pi-font-family, --eui-font-family, "Manrope", "Manrope fallback", "Ubuntu")}[_nghost-%COMP%]     .hotel-card-wrapper jan-map-hotel-card{font-family:inherit}[_nghost-%COMP%]     .hotel-card-wrapper jan-map-hotel-card *, [_nghost-%COMP%]     .hotel-card-wrapper jan-map-hotel-card *:before, [_nghost-%COMP%]     .hotel-card-wrapper jan-map-hotel-card *:after{font-family:inherit;box-sizing:border-box}@media screen and (min-width:772px){jan-map-zoom-controls[_ngcontent-%COMP%]{display:flex;bottom:2rem;right:2rem}.satellite-button[_ngcontent-%COMP%]{bottom:calc(2.5rem + 124px);right:2rem}.loading-button[_ngcontent-%COMP%]{top:6rem}}'],changeDetection:0});let a=r;return a})();var ml=(()=>{let r=class r{};r.\u0275fac=function(t){return new(t||r)},r.\u0275cmp=N({type:r,selectors:[["jan-portfolio-search-map"]],features:[W([],[{provide:V,useValue:"portfolio-search-map"}])],decls:1,vars:0,template:function(t,i){t&1&&b(0,"jan-search-map")},dependencies:[xi],encapsulation:2,changeDetection:0});let a=r;return a})();export{ml as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.