@cleartrip/ct-platform-hotel-recommendations 1.14.1-beta.0 → 1.14.1-beta.10

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.
@@ -4,7 +4,7 @@ export declare const LOADER_GIFT_ICON = "https://rukmini-ct.flixcart.com/f_auto,
4
4
  export declare const CARD_PLACEHOLDER_SRC = "https://rukmini-ct.flixcart.com/f_auto,q_auto/offermgmt-prod/offermgmt/images/banner/Image-placholder-1.jpg";
5
5
  export declare const CARDS_MIN_COUNT = 2;
6
6
  export declare const CARDS_MAX_COUNT = 5;
7
- export declare const CARD_IMG_BASE = "https://fastui.cltpstatic.com/image/upload/t_h_seo_srp/hotels/places/hotels/";
7
+ export declare const CARD_IMG_BASE = "https://rukmini-ct.flixcart.com/f_auto,q_auto/ct-hotel-images/places/hotels/";
8
8
  export declare const FALLBACK_BANNER = "https://rukmini-ct.flixcart.com/f_auto,q_auto,w_274,h_360,dpr_4/offermgmt-prod/offermgmt/images/banner/hotel_Xsell_fallback_2.png";
9
9
  export declare const DEFAULT_CTA_TITLE = "View all hotels";
10
10
  //# sourceMappingURL=constants.d.ts.map
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("tslib"),i=require("react/jsx-runtime"),a=require("react"),o=require("@cleartrip/ct-platform-utils"),n=require("@cleartrip/ct-design-button"),r=require("@cleartrip/ct-platform-io-hoc"),t=require("@cleartrip/ct-design-typography"),d=require("@cleartrip/ct-platform-assets"),l=require("uuid"),c=require("@cleartrip/ct-design-theme"),s="https://rukmini-ct.flixcart.com/f_auto,q_auto,w_20,h_20,dpr_4/offermgmt-prod/offermgmt/images/banner/LoadingGiftIcon.png",_="https://rukmini-ct.flixcart.com/f_auto,q_auto/offermgmt-prod/offermgmt/images/banner/Image-placholder-1.jpg";function p(e,i){void 0===i&&(i={});var a=i.insertAt;if(e&&"undefined"!=typeof document){var o=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===a&&o.firstChild?o.insertBefore(n,o.firstChild):o.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}}var u="index-module_hRecoBanner__CyUB8",h="index-module_hRecoBannerIcon__cFmbk",x="index-module_hRecoBannerTextsWrapper__0P-pK",m="index-module_hRecoBannerTextRow__qbE8k",g="index-module_hRecoBannerImg__eC0hA";p(".index-module_hRecoBanner__CyUB8{aspect-ratio:304/180;background:#fff;border-radius:16px;box-shadow:0 4px 16px 0 rgba(26,26,26,.08);display:flex;height:180px;margin:0 16px 24px 44px;overflow:hidden;width:calc(100% - 60px)}.index-module_hRecoBannerIcon__cFmbk{margin-right:8px;min-width:16px;padding-top:1px}.index-module_hRecoBannerTextsWrapper__0P-pK{display:flex;flex-direction:column;justify-content:center;padding:18px 8px 18px 12px}.index-module_hRecoBannerTextRow__qbE8k{display:flex;padding-bottom:16px}.index-module_hRecoBannerTextRow__qbE8k:last-of-type{padding-bottom:0}.index-module_hRecoBannerImg__eC0hA{height:100%}");var f=function(){return i.jsxs("div",e.__assign({className:u},{children:[i.jsxs("div",e.__assign({className:x},{children:[i.jsxs("div",e.__assign({className:m},{children:[i.jsx(d.CheckIcon,{className:h}),i.jsx(t.Typography,e.__assign({variant:t.TypographyVariant.P3},{children:"Free cancellation till check-in time"}))]})),i.jsxs("div",e.__assign({className:m},{children:[i.jsx(d.CheckIcon,{className:h}),i.jsx(t.Typography,e.__assign({variant:t.TypographyVariant.P3},{children:"Exclusive member discount for Flipkart & Myntra"}))]})),i.jsxs("div",e.__assign({className:m},{children:[i.jsx(d.CheckIcon,{className:h}),i.jsx(t.Typography,e.__assign({variant:t.TypographyVariant.P3},{children:"Earn and redeem SuperCoins"}))]}))]})),i.jsx("img",{src:"https://rukmini-ct.flixcart.com/f_auto,q_auto,w_274,h_360,dpr_4/offermgmt-prod/offermgmt/images/banner/hotel_Xsell_fallback_2.png",className:g})]}))},v="index-module_hRecoCardWrapper__FhtJN",y="index-module_hRecoInfoWrapper__4EAyB",R="index-module_hRecoTitleRow__97dd5",b="index-module_hRecoTitle__3Uxkj",C="index-module_hRecoRatingWrapper__mGwia",j="index-module_hRecoDiscountAndPriceWrapper__3NzaV",k="index-module_hRecoPriceWrapper__49o5u",N="index-module_hRecoDiscountWrapper__Kd9Gv",w="index-module_hRecoLoaderWrapper__KXG-6",T="index-module_hidden__CdBrr",L="index-module_hRecoLoaderGradient__c7400",P="index-module_hRecoLoaderTitleRow__cWktU",W="index-module_hRecoLoaderTitle__-Onou",B="index-module_hRecoLoaderRating__Qy5b-",V="index-module_hRecoLoaderSubtitle__l1X3H",O="index-module_hRecoLoaderPricingRow__42VqB",S="index-module_hRecoLoaderDiscount__stqHY",I="index-module_hRecoLoaderPricing__KsQ-o";p(".index-module_hRecoCardWrapper__FhtJN{background:#fff;border-radius:16px;display:flex;flex-direction:column;height:180px;overflow:hidden;width:216px}.index-module_hRecoInfoWrapper__4EAyB{padding:8px 8px 0}.index-module_hRecoTitleRow__97dd5{display:flex;justify-content:space-between}.index-module_hRecoTitle__3Uxkj{padding-right:4px}.index-module_hRecoRatingWrapper__mGwia{align-items:center;background-color:#ecf3ff;border-radius:4px;box-sizing:border-box;display:flex;justify-content:center;margin-left:4px;min-width:28px;padding:0 4px}.index-module_hRecoDiscountAndPriceWrapper__3NzaV{align-items:baseline;display:flex;justify-content:space-between;padding:4px 8px 8px}.index-module_hRecoPriceWrapper__49o5u{align-items:baseline;display:flex;max-width:139px}.index-module_hRecoDiscountWrapper__Kd9Gv{align-items:center;background-color:#11a670;border-radius:4px;box-sizing:border-box;display:flex;justify-content:right;min-width:20px;padding:4px}.index-module_hRecoLoaderWrapper__KXG-6{opacity:1;pointer-events:none;position:absolute;top:0;transition:opacity .15s ease-in-out}.index-module_hRecoLoaderWrapper__KXG-6.index-module_hidden__CdBrr{opacity:0}.index-module_hRecoLoaderGradient__c7400{background:linear-gradient(90deg,#f1efef -24.18%,#f9f8f8 50.26%,#e7e5e5 114.84%)}.index-module_hRecoLoaderTitleRow__cWktU{align-items:center;display:flex;margin-bottom:8px}.index-module_hRecoLoaderTitle__-Onou{border-radius:6px;height:16px;width:168px}.index-module_hRecoLoaderRating__Qy5b-{border-radius:6px;height:16px;margin-left:8px;width:19px}.index-module_hRecoLoaderSubtitle__l1X3H{border-radius:6px;height:12px;margin-bottom:6px;width:124px}.index-module_hRecoLoaderPricingRow__42VqB{align-items:center;display:flex}.index-module_hRecoLoaderDiscount__stqHY{border-radius:6px;height:18px;margin-left:16px;width:45px}.index-module_hRecoLoaderPricing__KsQ-o{border-radius:6px;height:18px;width:139px}");var H=function(a){var o=a.loading,n=a.priority,r=void 0===n?"low":n;return i.jsxs("div",e.__assign({className:"".concat(v," ").concat(w," ").concat(o?"":T)},{children:[i.jsx("img",{width:216,height:104,fetchPriority:r,src:_,alt:"Hotel recommendation placeholder"}),i.jsxs("div",e.__assign({className:y},{children:[i.jsxs("div",e.__assign({className:P},{children:[i.jsx("div",{className:"".concat(W," ").concat(L)}),i.jsx("div",{className:"".concat(B," ").concat(L)})]})),i.jsx("div",{className:"".concat(V," ").concat(L)}),i.jsxs("div",e.__assign({className:O},{children:[i.jsx("div",{className:"".concat(I," ").concat(L)}),i.jsx("div",{className:"".concat(S," ").concat(L)})]}))]}))]}))},D=function(n){var d,l=n.rank,c=n.coupon,s=n.tripId,p=n.hotelId,u=n.vertical,h=n.location,x=n.pageName,m=n.abVariant,g=n.heroImage,f=n.staticData,w=n.pricingData,T=n.imgPriority,L=n.departureDate,P=n.hotelLandingUrl,W=n.onRecoCardClick,B=n.loyaltyType,V=n.arrivalDate,O=a.useRef(!1),S=a.useState("".concat("https://fastui.cltpstatic.com/image/upload/t_h_seo_srp/hotels/places/hotels/").concat(null==g?void 0:g.mediaUrl)),I=S[0],H=S[1],D=a.useCallback((function(){null==W||W(),o.ravenSDKTrigger("u_ui_action",{vertical:u,a_trip_id:s,h_hotel_rank:l,h_hotel_id:p,page_name:x,ab_variant:m,child_product:"hotel",a_destination:h,ct_coupon_applied:c,transaction_id_ca:s,onward_date:L,search_destination:h,a_departure_date:L,object_name:null==f?void 0:f.hotelName,h_hotel_name:null==f?void 0:f.hotelName,h_total_discount_percent:null==w?void 0:w.discountPercentage,h_star_category:null==f?void 0:f.starRating,h_user_rating:null==f?void 0:f.userRating,loyalty_type:B,action_type:"click",action_name:"hotel_cross_sell_click",personalised_callout:"hotel_card_click",h_dx:V?o.getNoOfDaysFromToday(V):""}),P&&(window.location.href=P)}),[P]),q=a.useCallback((function(){O.current||(O.current=!0,H(_))}),[]),F=a.useCallback((function(){o.batchRavenEvent("u_impression",{vertical:u,a_trip_id:s,h_hotel_rank:l,h_hotel_id:p,page_name:x,ab_variant:m,child_product:"hotel",a_destination:h,ct_coupon_applied:c,transaction_id_ca:s,onward_date:L,search_destination:h,a_departure_date:L,object_name:null==f?void 0:f.hotelName,h_hotel_name:null==f?void 0:f.hotelName,h_total_discount_percent:null==w?void 0:w.discountPercentage,h_star_category:null==f?void 0:f.starRating,h_user_rating:null==f?void 0:f.userRating,loyalty_type:B,h_dx:V?o.getNoOfDaysFromToday(V):"",action_name:"hotel_cross_sell_impression",personalised_callout:"hotel_card_impression"})}),[p]);return i.jsx(r.IntersectionObserverHOC,e.__assign({onIntersection:F},{children:i.jsxs("div",e.__assign({className:v,onClick:D},{children:[i.jsx("img",{width:216,height:104,src:I,onError:q,fetchPriority:T}),i.jsxs("div",e.__assign({className:y},{children:[i.jsxs("div",e.__assign({className:R},{children:[i.jsx(t.Typography,e.__assign({lineClamp:1,className:b,variant:t.TypographyVariant.B2},{children:null==f?void 0:f.hotelName})),(null==f?void 0:f.userRating)&&i.jsx("div",e.__assign({className:C},{children:i.jsx(t.Typography,e.__assign({color:"link",variant:t.TypographyVariant.B3},{children:null===(d=null==f?void 0:f.userRating)||void 0===d?void 0:d.toFixed(1)}))}))]})),i.jsxs(t.Typography,e.__assign({variant:t.TypographyVariant.P3,lineClamp:1,color:"subheading"},{children:[null==f?void 0:f.starRating," star hotel in"," ",null==f?void 0:f.locality]}))]})),i.jsxs("div",e.__assign({className:j},{children:[i.jsxs("div",e.__assign({className:k},{children:[(null==w?void 0:w.perNightPrice)&&i.jsxs(t.Typography,e.__assign({variant:t.TypographyVariant.HM4},{children:[o.formatCurrency(w.perNightPrice)," "]})),(null==w?void 0:w.slashedPrice)&&i.jsx(t.Typography,e.__assign({isStriked:!0,color:"subheading",variant:t.TypographyVariant.B4},{children:o.formatCurrency(w.slashedPrice,!1)})),i.jsx(t.Typography,e.__assign({variant:t.TypographyVariant.B4,color:"subheading"},{children:" / night"}))]})),(null==w?void 0:w.discountPercentage)&&(null==w?void 0:w.discountPercentage)>0&&i.jsxs("div",e.__assign({className:N},{children:[i.jsxs(t.Typography,e.__assign({color:"neutral",variant:t.TypographyVariant.B4CAPS},{children:[null==w?void 0:w.discountPercentage,"%"]})),i.jsx(t.Typography,e.__assign({color:"neutral",variant:t.TypographyVariant.B4CAPS,style:{marginLeft:"4px"}},{children:"OFF"}))]}))]}))]}))}))},q={hRecoWrapper:"index-module_hRecoWrapper__AeUoH",hRecoLoaderWrapper:"index-module_hRecoLoaderWrapper__sAARu",hRecoHeader:"index-module_hRecoHeader__5xuYV",hRecoContent:"index-module_hRecoContent__0kDhm",hRecoSidebar:"index-module_hRecoSidebar__UjWWx",connectedLine:"index-module_connectedLine__Z9VpQ",colorConnectedLine:"index-module_colorConnectedLine__KjVo0",loaderConnectedLine:"index-module_loaderConnectedLine__Zhoj6",dottedLine:"index-module_dottedLine__6K0LJ",hRecoCardsWrapper:"index-module_hRecoCardsWrapper__tc4sW",hRecoCardWrapper:"index-module_hRecoCardWrapper__5lhlY",hRecoOfferCallout:"index-module_hRecoOfferCallout__FBOgY",hRecoCouponCalloutRow:"index-module_hRecoCouponCalloutRow__PTCVd",hRecoBookingCallout:"index-module_hRecoBookingCallout__GGryo",exploreButton:"index-module_exploreButton__--vcq",sidebarCircle:"index-module_sidebarCircle__-dZZH",loaderSidebarCircle:"index-module_loaderSidebarCircle__BCXhT",hRecoHeaderTextLoader:"index-module_hRecoHeaderTextLoader__tyYPe"};p(".index-module_hRecoWrapper__AeUoH{background:linear-gradient(219.82deg,rgba(17,166,112,.2),rgba(17,166,112,0) 53.44%);display:flex;position:relative}.index-module_hRecoLoaderWrapper__sAARu{background:linear-gradient(219.82deg,hsla(0,0%,80%,.2),hsla(0,0%,100%,0) 53.44%);display:flex;position:relative}.index-module_hRecoHeader__5xuYV{left:12px;margin-top:24px;position:relative}.index-module_hRecoContent__0kDhm{left:0;position:absolute;width:100%}.index-module_hRecoSidebar__UjWWx{align-items:center;display:flex;flex-direction:column;padding-left:12px}.index-module_connectedLine__Z9VpQ{border-left:1px solid grey;height:20px;left:-.5px;opacity:.3;position:relative}.index-module_colorConnectedLine__KjVo0{border-image:linear-gradient(180deg,#fff 16.49%,#ff4f17);border-image-slice:1;border-left:1px solid;height:24px;margin-left:-.5px;opacity:.3;position:relative}.index-module_loaderConnectedLine__Zhoj6{border-image:linear-gradient(180deg,#fff 16.49%,#f3f3f3);border-image-slice:1;border-left:1px solid;height:24px;margin-left:-.5px;opacity:.3;position:relative}.index-module_dottedLine__6K0LJ{border-left:1px dotted grey;height:266px;left:-.5px;opacity:.5;position:relative}.index-module_hRecoCardsWrapper__tc4sW{-ms-overflow-style:none;box-sizing:content-box;display:flex;height:180px;overflow:auto;padding:0 16px 24px 44px;scrollbar-width:none;width:calc(100% - 60px)}.index-module_hRecoCardWrapper__5lhlY{border-radius:16px;box-shadow:0 4px 16px 0 rgba(26,26,26,.08);margin-right:12px;min-width:216px;position:relative}.index-module_hRecoCardWrapper__5lhlY:last-child{margin-right:0}.index-module_hRecoCardsWrapper__tc4sW::-webkit-scrollbar{display:none}.index-module_hRecoOfferCallout__FBOgY{border-radius:24px;padding:8px 0 0}.index-module_hRecoCouponCalloutRow__PTCVd{display:flex;padding:8px 0 16px}.index-module_hRecoBookingCallout__GGryo{padding-bottom:16px;padding-top:4px}.index-module_exploreButton__--vcq{left:40px;margin-left:4px;position:relative;width:calc(100% - 60px)}.index-module_sidebarCircle__-dZZH{background:#ecf3ff;border:1px solid #1a1a1a;border-radius:50%;height:8px;width:8px}.index-module_loaderSidebarCircle__BCXhT{background:#ecf3ff;border:1px solid #f3f3f3;border-radius:50%;height:8px;width:8px}.index-module_hRecoHeaderTextLoader__tyYPe{background:linear-gradient(90deg,#f1efef -24.18%,#f9f8f8 50.26%,#e7e5e5 114.84%);border-radius:6px}");var F=function(d){var l=d.data,c=d.tripId,_=d.loading,p=d.pageName,u=d.vertical,h=d.location,x=d.abVariant,m=d.maxCardsCount,g=d.departureDate,v=d.destroyLoaders,y=d.fallbackPageLandingURL,R=d.ctaTitle,b=void 0===R?"View all hotels":R,C=d.triggerViewTransitionOnClick,j=d.loyaltyType,k=d.arrivalDate,N=a.useState(!1),w=N[0],T=N[1],L=a.useMemo((function(){return o.formatFullDateString(g)}),[g]),P=a.useMemo((function(){var a,o,n=null!==(o=null===(a=null==l?void 0:l.recommendations)||void 0===a?void 0:a.length)&&void 0!==o?o:0,r=Array.from({length:m},(function(e,i){return i+1}));return _||n>=2?i.jsx("div",e.__assign({className:q.hRecoCardsWrapper},{children:r.map((function(a,o){var n,r,t;return _||!v||(null===(n=null==l?void 0:l.recommendations)||void 0===n?void 0:n[o])?i.jsxs("div",e.__assign({className:q.hRecoCardWrapper},{children:[(null===(r=null==l?void 0:l.recommendations)||void 0===r?void 0:r[o])&&i.jsx(D,e.__assign({tripId:c,rank:o+1,location:h,pageName:p,vertical:u,abVariant:x,coupon:null==l?void 0:l.couponCode,departureDate:L},null===(t=null==l?void 0:l.recommendations)||void 0===t?void 0:t[o],{imgPriority:0===o?"high":"auto",onRecoCardClick:C,loyaltyType:j,arrivalDate:k})),!v&&i.jsx(H,{loading:_,priority:0===o?"high":"auto"})]}),a):i.jsx(i.Fragment,{})}))})):i.jsx(f,{})}),[l,_,v]),W=a.useCallback((function(){T(!0)}),[]),B=a.useCallback((function(){var e,i,a;null==C||C();var n=null!==(i=null===(e=null==l?void 0:l.recommendations)||void 0===e?void 0:e.length)&&void 0!==i?i:0;o.ravenSDKTrigger("u_ui_action",{vertical:u,a_trip_id:c,page_name:p,action_type:"click",ab_variant:x,child_product:"hotel",a_destination:h,transaction_id_ca:c,onward_date:L,search_destination:h,a_departure_date:L,action_name:"hotel_cross_sell_click",loyalty_type:j,h_dx:k?o.getNoOfDaysFromToday(k):"",personalised_callout:"Book hotel now",result_count:n<m?n:m});var r=null!==(a=null==l?void 0:l.pageLandingUrl)&&void 0!==a?a:y;r&&(window.location.href=r)}),[l]);return a.useEffect((function(){var e,i;if(w&&!_){var a=null!==(i=null===(e=null==l?void 0:l.recommendations)||void 0===e?void 0:e.length)&&void 0!==i?i:0;o.batchRavenEvent("u_impression",{vertical:u,a_trip_id:c,page_name:p,ab_variant:x,child_product:"hotel",a_destination:h,transaction_id_ca:c,onward_date:L,search_destination:h,a_departure_date:L,action_name:"hotel_cross_sell_impression",callout_value_xsell:"".concat(null==l?void 0:l.couponCallOutPrefix," ").concat(null==l?void 0:l.couponCallOutSuffix),loyalty_type:j,h_dx:k?o.getNoOfDaysFromToday(k):"",result_count:a<m?a:m})}}),[_,l,w]),i.jsx(r.IntersectionObserverHOC,e.__assign({onIntersection:W},{children:i.jsxs("div",e.__assign({className:"".concat(_?q.hRecoLoaderWrapper:q.hRecoWrapper)},{children:[i.jsx("div",e.__assign({className:q.hRecoSidebar},{children:_?i.jsxs(i.Fragment,{children:[i.jsx("div",{className:q.loaderConnectedLine}),i.jsx("img",{width:20,height:20,src:s,fetchPriority:"low"}),i.jsx("div",{className:q.connectedLine}),i.jsx("img",{width:20,height:20,src:s,fetchPriority:"low"}),i.jsx("div",{className:q.dottedLine}),i.jsx("div",{className:q.loaderSidebarCircle})]}):i.jsxs(i.Fragment,{children:[i.jsx("div",{className:q.colorConnectedLine}),i.jsx("img",{width:20,height:20,src:"https://rukmini-ct.flixcart.com/f_auto,q_auto,w_20,h_20,dpr_4/offermgmt-prod/offermgmt/images/banner/NewGiftIcon.png",fetchPriority:"low"}),i.jsx("div",{className:q.connectedLine}),i.jsx("img",{width:20,height:20,src:"https://rukmini-ct.flixcart.com/f_auto,q_auto,w_20,h_20,dpr_4/offermgmt-prod/offermgmt/images/banner/Xsell_offers.png",fetchPriority:"low"}),i.jsx("div",{className:q.dottedLine}),i.jsx("div",{className:q.sidebarCircle})]})})),i.jsxs("div",e.__assign({className:q.hRecoMainWrapper},{children:[i.jsxs("div",e.__assign({className:q.hRecoHeader},{children:[_?i.jsx("div",e.__assign({style:{padding:"4px 0 0",marginBottom:"16px"}},{children:i.jsx("div",{className:q.hRecoHeaderTextLoader,style:{height:"16px",width:"150px"}})})):i.jsx(t.Typography,e.__assign({variant:t.TypographyVariant.B3,colorCode:"#808080",className:q.hRecoBookingCallout},{children:null==l?void 0:l.bookingCallOut})),_?i.jsx("div",e.__assign({style:{padding:"8px 0 0 0"}},{children:i.jsx("div",{className:q.hRecoHeaderTextLoader,style:{height:"16px",width:"254px"}})})):i.jsx("div",e.__assign({className:q.hRecoOfferCallout},{children:i.jsx(t.Typography,e.__assign({variant:t.TypographyVariant.B3},{children:null==l?void 0:l.offerCallOut}))})),_?i.jsx("div",e.__assign({style:{padding:"8px 0 16px"}},{children:i.jsx("div",{className:q.hRecoHeaderTextLoader,style:{height:"22px",width:"184px"}})})):i.jsxs("div",e.__assign({className:q.hRecoCouponCalloutRow},{children:[i.jsx(t.Typography,e.__assign({variant:t.TypographyVariant.P1,colorCode:"#FF4F17",style:{fontWeight:"600"}},{children:null==l?void 0:l.couponCallOutPrefix})),(null==l?void 0:l.couponCallOutPrefix)?i.jsx(t.Typography,e.__assign({variant:t.TypographyVariant.P1,style:{fontWeight:"600",marginLeft:"4px"}},{children:null==l?void 0:l.couponCallOutSuffix})):null]}))]})),i.jsxs("div",e.__assign({className:q.hRecoContent},{children:[P,_?i.jsx("div",{className:"".concat(q.hRecoHeaderTextLoader," ").concat(q.exploreButton),style:{height:"40px"}}):i.jsx(n.Button,e.__assign({onClick:B,variant:n.ButtonVariant.OUTLINE,className:q.exploreButton},{children:b}))]}))]}))]}))}))};exports.HotelRecoPlaceholderImg=_,exports.HotelRecommendationContainer=function(n){var r=n.location,t=n.pageName,d=n.abVariant,s=n.cutoff,_=void 0===s?450:s,p=n.vertical,u=void 0===p?"AIR":p,h=n.fallbackPageLandingURL,x=n.maxCardsCount,m=void 0===x?5:x,g=n.triggerViewTransition,f=e.__rest(n,["location","pageName","abVariant","cutoff","vertical","fallbackPageLandingURL","maxCardsCount","triggerViewTransition"]),v=a.useState(!0),y=v[0],R=v[1],b=a.useState(!1),C=b[0],j=b[1],k=a.useState(),N=k[0],w=k[1],T=a.useCallback((function(i){var a;return e.__assign(e.__assign({},i),{bookingCallOut:r?"Since you are flying to ".concat(r,"!"):"Since you are flying with us!",recommendations:null!==(a=i.recommendations)&&void 0!==a?a:[]})}),[]);return a.useEffect((function(){var e,i=h||"",a=o.extractQueryParamsAsObj(i),n=a.locationCode,r=void 0===n?"":n,t=a.baseLocation,d=void 0===t?"":t,c=a.chk_in,s=void 0===c?"":c,p=a.chk_out,x=void 0===p?"":p,m={destinationCode:r||(null===(e=d.split("-"))||void 0===e?void 0:e[1])||"",hotelId:"",checkInDate:s,checkOutDate:x,paxInfo:[{adults:{count:2,metadata:[]},children:{count:0,metadata:[]}}]};o.setCookie({cookieName:"hotel_search_criteria",cookieValue:JSON.stringify(m),expiryInDay:1}),o.setCookie({cookieName:"x-lineage-id",cookieValue:l.v4(),expiryInDay:1}),o.getHotelCrossSellRecos(u,h,_,null==f?void 0:f.couponCallOutPrefix,null==f?void 0:f.couponCallOutSuffix,null==f?void 0:f.offerCallOut,null==f?void 0:f.additionalHeaders,null==f?void 0:f.additionalParams).then((function(e){var i=T(e);w(i),setTimeout((function(){R(!1)}),10),setTimeout((function(){j(!0)}),180)}))}),[]),i.jsx(c.ThemeProvider,{children:i.jsx(F,e.__assign({data:N,loading:y,pageName:t,vertical:u,location:r,abVariant:d,maxCardsCount:m,destroyLoaders:C,fallbackPageLandingURL:h,triggerViewTransitionOnClick:g},f))})},exports.HotelRecommendationsWidget=F;
1
+ "use strict";var e=require("tslib"),i=require("react/jsx-runtime"),a=require("react"),o=require("@cleartrip/ct-platform-utils"),n=require("@cleartrip/ct-design-button"),r=require("@cleartrip/ct-platform-io-hoc"),t=require("@cleartrip/ct-design-typography"),d=require("@cleartrip/ct-platform-assets"),l=require("uuid"),c=require("@cleartrip/ct-design-theme"),s="https://rukmini-ct.flixcart.com/f_auto,q_auto,w_20,h_20,dpr_4/offermgmt-prod/offermgmt/images/banner/LoadingGiftIcon.png",_="https://rukmini-ct.flixcart.com/f_auto,q_auto/offermgmt-prod/offermgmt/images/banner/Image-placholder-1.jpg";function p(e,i){void 0===i&&(i={});var a=i.insertAt;if(e&&"undefined"!=typeof document){var o=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===a&&o.firstChild?o.insertBefore(n,o.firstChild):o.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}}var u="index-module_hRecoBanner__CyUB8",h="index-module_hRecoBannerIcon__cFmbk",x="index-module_hRecoBannerTextsWrapper__0P-pK",m="index-module_hRecoBannerTextRow__qbE8k",g="index-module_hRecoBannerImg__eC0hA";p(".index-module_hRecoBanner__CyUB8{aspect-ratio:304/180;background:#fff;border-radius:16px;box-shadow:0 4px 16px 0 rgba(26,26,26,.08);display:flex;height:180px;margin:0 16px 24px 44px;overflow:hidden;width:calc(100% - 60px)}.index-module_hRecoBannerIcon__cFmbk{margin-right:8px;min-width:16px;padding-top:1px}.index-module_hRecoBannerTextsWrapper__0P-pK{display:flex;flex-direction:column;justify-content:center;padding:18px 8px 18px 12px}.index-module_hRecoBannerTextRow__qbE8k{display:flex;padding-bottom:16px}.index-module_hRecoBannerTextRow__qbE8k:last-of-type{padding-bottom:0}.index-module_hRecoBannerImg__eC0hA{height:100%}");var f=function(){return i.jsxs("div",e.__assign({className:u},{children:[i.jsxs("div",e.__assign({className:x},{children:[i.jsxs("div",e.__assign({className:m},{children:[i.jsx(d.CheckIcon,{className:h}),i.jsx(t.Typography,e.__assign({variant:t.TypographyVariant.P3},{children:"Free cancellation till check-in time"}))]})),i.jsxs("div",e.__assign({className:m},{children:[i.jsx(d.CheckIcon,{className:h}),i.jsx(t.Typography,e.__assign({variant:t.TypographyVariant.P3},{children:"Exclusive member discount for Flipkart & Myntra"}))]})),i.jsxs("div",e.__assign({className:m},{children:[i.jsx(d.CheckIcon,{className:h}),i.jsx(t.Typography,e.__assign({variant:t.TypographyVariant.P3},{children:"Earn and redeem SuperCoins"}))]}))]})),i.jsx("img",{src:"https://rukmini-ct.flixcart.com/f_auto,q_auto,w_274,h_360,dpr_4/offermgmt-prod/offermgmt/images/banner/hotel_Xsell_fallback_2.png",className:g})]}))},v="index-module_hRecoCardWrapper__FhtJN",y="index-module_hRecoInfoWrapper__4EAyB",R="index-module_hRecoTitleRow__97dd5",b="index-module_hRecoTitle__3Uxkj",C="index-module_hRecoRatingWrapper__mGwia",j="index-module_hRecoDiscountAndPriceWrapper__3NzaV",k="index-module_hRecoPriceWrapper__49o5u",N="index-module_hRecoDiscountWrapper__Kd9Gv",w="index-module_hRecoLoaderWrapper__KXG-6",T="index-module_hidden__CdBrr",L="index-module_hRecoLoaderGradient__c7400",P="index-module_hRecoLoaderTitleRow__cWktU",W="index-module_hRecoLoaderTitle__-Onou",B="index-module_hRecoLoaderRating__Qy5b-",V="index-module_hRecoLoaderSubtitle__l1X3H",O="index-module_hRecoLoaderPricingRow__42VqB",S="index-module_hRecoLoaderDiscount__stqHY",I="index-module_hRecoLoaderPricing__KsQ-o";p(".index-module_hRecoCardWrapper__FhtJN{background:#fff;border-radius:16px;display:flex;flex-direction:column;height:180px;overflow:hidden;width:216px}.index-module_hRecoInfoWrapper__4EAyB{padding:8px 8px 0}.index-module_hRecoTitleRow__97dd5{display:flex;justify-content:space-between}.index-module_hRecoTitle__3Uxkj{padding-right:4px}.index-module_hRecoRatingWrapper__mGwia{align-items:center;background-color:#ecf3ff;border-radius:4px;box-sizing:border-box;display:flex;justify-content:center;margin-left:4px;min-width:28px;padding:0 4px}.index-module_hRecoDiscountAndPriceWrapper__3NzaV{align-items:baseline;display:flex;justify-content:space-between;padding:4px 8px 8px}.index-module_hRecoPriceWrapper__49o5u{align-items:baseline;display:flex;max-width:139px}.index-module_hRecoDiscountWrapper__Kd9Gv{align-items:center;background-color:#11a670;border-radius:4px;box-sizing:border-box;display:flex;justify-content:right;min-width:20px;padding:4px}.index-module_hRecoLoaderWrapper__KXG-6{opacity:1;pointer-events:none;position:absolute;top:0;transition:opacity .15s ease-in-out}.index-module_hRecoLoaderWrapper__KXG-6.index-module_hidden__CdBrr{opacity:0}.index-module_hRecoLoaderGradient__c7400{background:linear-gradient(90deg,#f1efef -24.18%,#f9f8f8 50.26%,#e7e5e5 114.84%)}.index-module_hRecoLoaderTitleRow__cWktU{align-items:center;display:flex;margin-bottom:8px}.index-module_hRecoLoaderTitle__-Onou{border-radius:6px;height:16px;width:168px}.index-module_hRecoLoaderRating__Qy5b-{border-radius:6px;height:16px;margin-left:8px;width:19px}.index-module_hRecoLoaderSubtitle__l1X3H{border-radius:6px;height:12px;margin-bottom:6px;width:124px}.index-module_hRecoLoaderPricingRow__42VqB{align-items:center;display:flex}.index-module_hRecoLoaderDiscount__stqHY{border-radius:6px;height:18px;margin-left:16px;width:45px}.index-module_hRecoLoaderPricing__KsQ-o{border-radius:6px;height:18px;width:139px}");var H=function(a){var o=a.loading,n=a.priority,r=void 0===n?"low":n;return i.jsxs("div",e.__assign({className:"".concat(v," ").concat(w," ").concat(o?"":T)},{children:[i.jsx("img",{width:216,height:104,fetchPriority:r,src:_,alt:"Hotel recommendation placeholder"}),i.jsxs("div",e.__assign({className:y},{children:[i.jsxs("div",e.__assign({className:P},{children:[i.jsx("div",{className:"".concat(W," ").concat(L)}),i.jsx("div",{className:"".concat(B," ").concat(L)})]})),i.jsx("div",{className:"".concat(V," ").concat(L)}),i.jsxs("div",e.__assign({className:O},{children:[i.jsx("div",{className:"".concat(I," ").concat(L)}),i.jsx("div",{className:"".concat(S," ").concat(L)})]}))]}))]}))},D=function(n){var d,l=n.rank,c=n.coupon,s=n.tripId,p=n.hotelId,u=n.vertical,h=n.location,x=n.pageName,m=n.abVariant,g=n.heroImage,f=n.staticData,w=n.pricingData,T=n.imgPriority,L=n.departureDate,P=n.hotelLandingUrl,W=n.onRecoCardClick,B=n.loyaltyType,V=n.arrivalDate,O=a.useRef(!1),S=a.useState("".concat("https://rukmini-ct.flixcart.com/f_auto,q_auto/ct-hotel-images/places/hotels/").concat(null==g?void 0:g.mediaUrl)),I=S[0],H=S[1],D=a.useCallback((function(){null==W||W(),o.ravenSDKTrigger("u_ui_action",{vertical:u,a_trip_id:s,h_hotel_rank:l,h_hotel_id:p,page_name:x,ab_variant:m,child_product:"hotel",a_destination:h,ct_coupon_applied:c,transaction_id_ca:s,onward_date:L,search_destination:h,a_departure_date:L,object_name:null==f?void 0:f.hotelName,h_hotel_name:null==f?void 0:f.hotelName,h_total_discount_percent:null==w?void 0:w.discountPercentage,h_star_category:null==f?void 0:f.starRating,h_user_rating:null==f?void 0:f.userRating,loyalty_type:B,action_type:"click",action_name:"hotel_cross_sell_click",personalised_callout:"hotel_card_click",h_dx:V?o.getNoOfDaysFromToday(V):""}),P&&(window.location.href=P)}),[P]),q=a.useCallback((function(){O.current||(O.current=!0,H(_))}),[]),F=a.useCallback((function(){o.batchRavenEvent("u_impression",{vertical:u,a_trip_id:s,h_hotel_rank:l,h_hotel_id:p,page_name:x,ab_variant:m,child_product:"hotel",a_destination:h,ct_coupon_applied:c,transaction_id_ca:s,onward_date:L,search_destination:h,a_departure_date:L,object_name:null==f?void 0:f.hotelName,h_hotel_name:null==f?void 0:f.hotelName,h_total_discount_percent:null==w?void 0:w.discountPercentage,h_star_category:null==f?void 0:f.starRating,h_user_rating:null==f?void 0:f.userRating,loyalty_type:B,h_dx:V?o.getNoOfDaysFromToday(V):"",action_name:"hotel_cross_sell_impression",personalised_callout:"hotel_card_impression"})}),[p]);return i.jsx(r.IntersectionObserverHOC,e.__assign({onIntersection:F},{children:i.jsxs("div",e.__assign({className:v,onClick:D},{children:[i.jsx("img",{width:216,height:104,src:I,onError:q,fetchPriority:T}),i.jsxs("div",e.__assign({className:y},{children:[i.jsxs("div",e.__assign({className:R},{children:[i.jsx(t.Typography,e.__assign({lineClamp:1,className:b,variant:t.TypographyVariant.B2},{children:null==f?void 0:f.hotelName})),(null==f?void 0:f.userRating)&&i.jsx("div",e.__assign({className:C},{children:i.jsx(t.Typography,e.__assign({color:"link",variant:t.TypographyVariant.B3},{children:null===(d=null==f?void 0:f.userRating)||void 0===d?void 0:d.toFixed(1)}))}))]})),i.jsxs(t.Typography,e.__assign({variant:t.TypographyVariant.P3,lineClamp:1,color:"subheading"},{children:[null==f?void 0:f.starRating," star hotel in"," ",null==f?void 0:f.locality]}))]})),i.jsxs("div",e.__assign({className:j},{children:[i.jsxs("div",e.__assign({className:k},{children:[(null==w?void 0:w.perNightPrice)&&i.jsxs(t.Typography,e.__assign({variant:t.TypographyVariant.HM4},{children:[o.formatCurrency(w.perNightPrice)," "]})),(null==w?void 0:w.slashedPrice)&&i.jsx(t.Typography,e.__assign({isStriked:!0,color:"subheading",variant:t.TypographyVariant.B4},{children:o.formatCurrency(w.slashedPrice,!1)})),i.jsx(t.Typography,e.__assign({variant:t.TypographyVariant.B4,color:"subheading"},{children:" / night"}))]})),(null==w?void 0:w.discountPercentage)&&(null==w?void 0:w.discountPercentage)>0&&i.jsxs("div",e.__assign({className:N},{children:[i.jsxs(t.Typography,e.__assign({color:"neutral",variant:t.TypographyVariant.B4CAPS},{children:[null==w?void 0:w.discountPercentage,"%"]})),i.jsx(t.Typography,e.__assign({color:"neutral",variant:t.TypographyVariant.B4CAPS,style:{marginLeft:"4px"}},{children:"OFF"}))]}))]}))]}))}))},q={hRecoWrapper:"index-module_hRecoWrapper__AeUoH",hRecoLoaderWrapper:"index-module_hRecoLoaderWrapper__sAARu",hRecoHeader:"index-module_hRecoHeader__5xuYV",hRecoContent:"index-module_hRecoContent__0kDhm",hRecoSidebar:"index-module_hRecoSidebar__UjWWx",connectedLine:"index-module_connectedLine__Z9VpQ",colorConnectedLine:"index-module_colorConnectedLine__KjVo0",loaderConnectedLine:"index-module_loaderConnectedLine__Zhoj6",dottedLine:"index-module_dottedLine__6K0LJ",hRecoCardsWrapper:"index-module_hRecoCardsWrapper__tc4sW",hRecoCardWrapper:"index-module_hRecoCardWrapper__5lhlY",hRecoOfferCallout:"index-module_hRecoOfferCallout__FBOgY",hRecoCouponCalloutRow:"index-module_hRecoCouponCalloutRow__PTCVd",hRecoBookingCallout:"index-module_hRecoBookingCallout__GGryo",exploreButton:"index-module_exploreButton__--vcq",sidebarCircle:"index-module_sidebarCircle__-dZZH",loaderSidebarCircle:"index-module_loaderSidebarCircle__BCXhT",hRecoHeaderTextLoader:"index-module_hRecoHeaderTextLoader__tyYPe"};p(".index-module_hRecoWrapper__AeUoH{background:linear-gradient(219.82deg,rgba(17,166,112,.2),rgba(17,166,112,0) 53.44%);display:flex;position:relative}.index-module_hRecoLoaderWrapper__sAARu{background:linear-gradient(219.82deg,hsla(0,0%,80%,.2),hsla(0,0%,100%,0) 53.44%);display:flex;position:relative}.index-module_hRecoHeader__5xuYV{left:12px;margin-top:24px;position:relative}.index-module_hRecoContent__0kDhm{left:0;position:absolute;width:100%}.index-module_hRecoSidebar__UjWWx{align-items:center;display:flex;flex-direction:column;padding-left:12px}.index-module_connectedLine__Z9VpQ{border-left:1px solid grey;height:20px;left:-.5px;opacity:.3;position:relative}.index-module_colorConnectedLine__KjVo0{border-image:linear-gradient(180deg,#fff 16.49%,#ff4f17);border-image-slice:1;border-left:1px solid;height:24px;margin-left:-.5px;opacity:.3;position:relative}.index-module_loaderConnectedLine__Zhoj6{border-image:linear-gradient(180deg,#fff 16.49%,#f3f3f3);border-image-slice:1;border-left:1px solid;height:24px;margin-left:-.5px;opacity:.3;position:relative}.index-module_dottedLine__6K0LJ{border-left:1px dotted grey;height:266px;left:-.5px;opacity:.5;position:relative}.index-module_hRecoCardsWrapper__tc4sW{-ms-overflow-style:none;box-sizing:content-box;display:flex;height:180px;overflow:auto;padding:0 16px 24px 44px;scrollbar-width:none;width:calc(100% - 60px)}.index-module_hRecoCardWrapper__5lhlY{border-radius:16px;box-shadow:0 4px 16px 0 rgba(26,26,26,.08);margin-right:12px;min-width:216px;position:relative}.index-module_hRecoCardWrapper__5lhlY:last-child{margin-right:0}.index-module_hRecoCardsWrapper__tc4sW::-webkit-scrollbar{display:none}.index-module_hRecoOfferCallout__FBOgY{border-radius:24px;padding:8px 0 0}.index-module_hRecoCouponCalloutRow__PTCVd{display:flex;padding:8px 0 16px}.index-module_hRecoBookingCallout__GGryo{padding-bottom:16px;padding-top:4px}.index-module_exploreButton__--vcq{left:40px;margin-left:4px;position:relative;width:calc(100% - 60px)}.index-module_sidebarCircle__-dZZH{background:#ecf3ff;border:1px solid #1a1a1a;border-radius:50%;height:8px;width:8px}.index-module_loaderSidebarCircle__BCXhT{background:#ecf3ff;border:1px solid #f3f3f3;border-radius:50%;height:8px;width:8px}.index-module_hRecoHeaderTextLoader__tyYPe{background:linear-gradient(90deg,#f1efef -24.18%,#f9f8f8 50.26%,#e7e5e5 114.84%);border-radius:6px}");var F=function(d){var l=d.data,c=d.tripId,_=d.loading,p=d.pageName,u=d.vertical,h=d.location,x=d.abVariant,m=d.maxCardsCount,g=d.departureDate,v=d.destroyLoaders,y=d.fallbackPageLandingURL,R=d.ctaTitle,b=void 0===R?"View all hotels":R,C=d.triggerViewTransitionOnClick,j=d.loyaltyType,k=d.arrivalDate,N=a.useState(!1),w=N[0],T=N[1],L=a.useMemo((function(){return o.formatFullDateString(g)}),[g]),P=a.useMemo((function(){var a,o,n=null!==(o=null===(a=null==l?void 0:l.recommendations)||void 0===a?void 0:a.length)&&void 0!==o?o:0,r=Array.from({length:m},(function(e,i){return i+1}));return _||n>=2?i.jsx("div",e.__assign({className:q.hRecoCardsWrapper},{children:r.map((function(a,o){var n,r,t;return _||!v||(null===(n=null==l?void 0:l.recommendations)||void 0===n?void 0:n[o])?i.jsxs("div",e.__assign({className:q.hRecoCardWrapper},{children:[(null===(r=null==l?void 0:l.recommendations)||void 0===r?void 0:r[o])&&i.jsx(D,e.__assign({tripId:c,rank:o+1,location:h,pageName:p,vertical:u,abVariant:x,coupon:null==l?void 0:l.couponCode,departureDate:L},null===(t=null==l?void 0:l.recommendations)||void 0===t?void 0:t[o],{imgPriority:0===o?"high":"auto",onRecoCardClick:C,loyaltyType:j,arrivalDate:k})),!v&&i.jsx(H,{loading:_,priority:0===o?"high":"auto"})]}),a):i.jsx(i.Fragment,{})}))})):i.jsx(f,{})}),[l,_,v]),W=a.useCallback((function(){T(!0)}),[]),B=a.useCallback((function(){var e,i,a;null==C||C();var n=null!==(i=null===(e=null==l?void 0:l.recommendations)||void 0===e?void 0:e.length)&&void 0!==i?i:0;o.ravenSDKTrigger("u_ui_action",{vertical:u,a_trip_id:c,page_name:p,action_type:"click",ab_variant:x,child_product:"hotel",a_destination:h,transaction_id_ca:c,onward_date:L,search_destination:h,a_departure_date:L,action_name:"hotel_cross_sell_click",loyalty_type:j,h_dx:k?o.getNoOfDaysFromToday(k):"",personalised_callout:"Book hotel now",result_count:n<m?n:m});var r=null!==(a=null==l?void 0:l.pageLandingUrl)&&void 0!==a?a:y;r&&(window.location.href=r)}),[l]);return a.useEffect((function(){var e,i;if(w&&!_){var a=null!==(i=null===(e=null==l?void 0:l.recommendations)||void 0===e?void 0:e.length)&&void 0!==i?i:0;o.batchRavenEvent("u_impression",{vertical:u,a_trip_id:c,page_name:p,ab_variant:x,child_product:"hotel",a_destination:h,transaction_id_ca:c,onward_date:L,search_destination:h,a_departure_date:L,action_name:"hotel_cross_sell_impression",callout_value_xsell:"".concat(null==l?void 0:l.couponCallOutPrefix," ").concat(null==l?void 0:l.couponCallOutSuffix),loyalty_type:j,h_dx:k?o.getNoOfDaysFromToday(k):"",result_count:a<m?a:m})}}),[_,l,w]),i.jsx(r.IntersectionObserverHOC,e.__assign({onIntersection:W},{children:i.jsxs("div",e.__assign({className:"".concat(_?q.hRecoLoaderWrapper:q.hRecoWrapper)},{children:[i.jsx("div",e.__assign({className:q.hRecoSidebar},{children:_?i.jsxs(i.Fragment,{children:[i.jsx("div",{className:q.loaderConnectedLine}),i.jsx("img",{width:20,height:20,src:s,fetchPriority:"low"}),i.jsx("div",{className:q.connectedLine}),i.jsx("img",{width:20,height:20,src:s,fetchPriority:"low"}),i.jsx("div",{className:q.dottedLine}),i.jsx("div",{className:q.loaderSidebarCircle})]}):i.jsxs(i.Fragment,{children:[i.jsx("div",{className:q.colorConnectedLine}),i.jsx("img",{width:20,height:20,src:"https://rukmini-ct.flixcart.com/f_auto,q_auto,w_20,h_20,dpr_4/offermgmt-prod/offermgmt/images/banner/NewGiftIcon.png",fetchPriority:"low"}),i.jsx("div",{className:q.connectedLine}),i.jsx("img",{width:20,height:20,src:"https://rukmini-ct.flixcart.com/f_auto,q_auto,w_20,h_20,dpr_4/offermgmt-prod/offermgmt/images/banner/Xsell_offers.png",fetchPriority:"low"}),i.jsx("div",{className:q.dottedLine}),i.jsx("div",{className:q.sidebarCircle})]})})),i.jsxs("div",e.__assign({className:q.hRecoMainWrapper},{children:[i.jsxs("div",e.__assign({className:q.hRecoHeader},{children:[_?i.jsx("div",e.__assign({style:{padding:"4px 0 0",marginBottom:"16px"}},{children:i.jsx("div",{className:q.hRecoHeaderTextLoader,style:{height:"16px",width:"150px"}})})):i.jsx(t.Typography,e.__assign({variant:t.TypographyVariant.B3,colorCode:"#808080",className:q.hRecoBookingCallout},{children:null==l?void 0:l.bookingCallOut})),_?i.jsx("div",e.__assign({style:{padding:"8px 0 0 0"}},{children:i.jsx("div",{className:q.hRecoHeaderTextLoader,style:{height:"16px",width:"254px"}})})):i.jsx("div",e.__assign({className:q.hRecoOfferCallout},{children:i.jsx(t.Typography,e.__assign({variant:t.TypographyVariant.B3},{children:null==l?void 0:l.offerCallOut}))})),_?i.jsx("div",e.__assign({style:{padding:"8px 0 16px"}},{children:i.jsx("div",{className:q.hRecoHeaderTextLoader,style:{height:"22px",width:"184px"}})})):i.jsxs("div",e.__assign({className:q.hRecoCouponCalloutRow},{children:[i.jsx(t.Typography,e.__assign({variant:t.TypographyVariant.P1,colorCode:"#FF4F17",style:{fontWeight:"600"}},{children:null==l?void 0:l.couponCallOutPrefix})),(null==l?void 0:l.couponCallOutPrefix)?i.jsx(t.Typography,e.__assign({variant:t.TypographyVariant.P1,style:{fontWeight:"600",marginLeft:"4px"}},{children:null==l?void 0:l.couponCallOutSuffix})):null]}))]})),i.jsxs("div",e.__assign({className:q.hRecoContent},{children:[P,_?i.jsx("div",{className:"".concat(q.hRecoHeaderTextLoader," ").concat(q.exploreButton),style:{height:"40px"}}):i.jsx(n.Button,e.__assign({onClick:B,variant:n.ButtonVariant.OUTLINE,className:q.exploreButton},{children:b}))]}))]}))]}))}))};exports.HotelRecoPlaceholderImg=_,exports.HotelRecommendationContainer=function(n){var r=n.location,t=n.pageName,d=n.abVariant,s=n.cutoff,_=void 0===s?450:s,p=n.vertical,u=void 0===p?"AIR":p,h=n.fallbackPageLandingURL,x=n.maxCardsCount,m=void 0===x?5:x,g=n.triggerViewTransition,f=e.__rest(n,["location","pageName","abVariant","cutoff","vertical","fallbackPageLandingURL","maxCardsCount","triggerViewTransition"]),v=a.useState(!0),y=v[0],R=v[1],b=a.useState(!1),C=b[0],j=b[1],k=a.useState(),N=k[0],w=k[1],T=a.useCallback((function(i){var a;return e.__assign(e.__assign({},i),{bookingCallOut:r?"Since you are flying to ".concat(r,"!"):"Since you are flying with us!",recommendations:null!==(a=i.recommendations)&&void 0!==a?a:[]})}),[]);return a.useEffect((function(){var e,i=h||"",a=o.extractQueryParamsAsObj(i),n=a.locationCode,r=void 0===n?"":n,t=a.baseLocation,d=void 0===t?"":t,c=a.chk_in,s=void 0===c?"":c,p=a.chk_out,x=void 0===p?"":p,m={destinationCode:r||(null===(e=d.split("-"))||void 0===e?void 0:e[1])||"",hotelId:"",checkInDate:s,checkOutDate:x,paxInfo:[{adults:{count:2,metadata:[]},children:{count:0,metadata:[]}}]};o.setCookie({cookieName:"hotel_search_criteria",cookieValue:JSON.stringify(m),expiryInDay:1}),o.setCookie({cookieName:"x-lineage-id",cookieValue:l.v4(),expiryInDay:1}),o.getHotelCrossSellRecos(u,h,_,null==f?void 0:f.couponCallOutPrefix,null==f?void 0:f.couponCallOutSuffix,null==f?void 0:f.offerCallOut,null==f?void 0:f.additionalHeaders,null==f?void 0:f.additionalParams).then((function(e){var i=T(e);w(i),setTimeout((function(){R(!1)}),10),setTimeout((function(){j(!0)}),180)}))}),[]),i.jsx(c.ThemeProvider,{children:i.jsx(F,e.__assign({data:N,loading:y,pageName:t,vertical:u,location:r,abVariant:d,maxCardsCount:m,destroyLoaders:C,fallbackPageLandingURL:h,triggerViewTransitionOnClick:g},f))})},exports.HotelRecommendationsWidget=F;
2
2
  //# sourceMappingURL=ct-platform-hotel-recommendations.cjs.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as e,__rest as i}from"tslib";import{jsxs as o,jsx as a,Fragment as n}from"react/jsx-runtime";import{useRef as d,useState as t,useCallback as r,useMemo as l,useEffect as c}from"react";import{ravenSDKTrigger as _,getNoOfDaysFromToday as p,batchRavenEvent as s,formatCurrency as u,formatFullDateString as h,extractQueryParamsAsObj as m,setCookie as x,getHotelCrossSellRecos as g}from"@cleartrip/ct-platform-utils";import{Button as f,ButtonVariant as v}from"@cleartrip/ct-design-button";import{IntersectionObserverHOC as R}from"@cleartrip/ct-platform-io-hoc";import{Typography as b,TypographyVariant as y}from"@cleartrip/ct-design-typography";import{CheckIcon as C}from"@cleartrip/ct-platform-assets";import{v4 as w}from"uuid";import{ThemeProvider as N}from"@cleartrip/ct-design-theme";var L="https://rukmini-ct.flixcart.com/f_auto,q_auto,w_20,h_20,dpr_4/offermgmt-prod/offermgmt/images/banner/LoadingGiftIcon.png",k="https://rukmini-ct.flixcart.com/f_auto,q_auto/offermgmt-prod/offermgmt/images/banner/Image-placholder-1.jpg";function P(e,i){void 0===i&&(i={});var o=i.insertAt;if(e&&"undefined"!=typeof document){var a=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===o&&a.firstChild?a.insertBefore(n,a.firstChild):a.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}}var W="index-module_hRecoBanner__CyUB8",B="index-module_hRecoBannerIcon__cFmbk",T="index-module_hRecoBannerTextsWrapper__0P-pK",H="index-module_hRecoBannerTextRow__qbE8k",O="index-module_hRecoBannerImg__eC0hA";P(".index-module_hRecoBanner__CyUB8{aspect-ratio:304/180;background:#fff;border-radius:16px;box-shadow:0 4px 16px 0 rgba(26,26,26,.08);display:flex;height:180px;margin:0 16px 24px 44px;overflow:hidden;width:calc(100% - 60px)}.index-module_hRecoBannerIcon__cFmbk{margin-right:8px;min-width:16px;padding-top:1px}.index-module_hRecoBannerTextsWrapper__0P-pK{display:flex;flex-direction:column;justify-content:center;padding:18px 8px 18px 12px}.index-module_hRecoBannerTextRow__qbE8k{display:flex;padding-bottom:16px}.index-module_hRecoBannerTextRow__qbE8k:last-of-type{padding-bottom:0}.index-module_hRecoBannerImg__eC0hA{height:100%}");var V=function(){return o("div",e({className:W},{children:[o("div",e({className:T},{children:[o("div",e({className:H},{children:[a(C,{className:B}),a(b,e({variant:y.P3},{children:"Free cancellation till check-in time"}))]})),o("div",e({className:H},{children:[a(C,{className:B}),a(b,e({variant:y.P3},{children:"Exclusive member discount for Flipkart & Myntra"}))]})),o("div",e({className:H},{children:[a(C,{className:B}),a(b,e({variant:y.P3},{children:"Earn and redeem SuperCoins"}))]}))]})),a("img",{src:"https://rukmini-ct.flixcart.com/f_auto,q_auto,w_274,h_360,dpr_4/offermgmt-prod/offermgmt/images/banner/hotel_Xsell_fallback_2.png",className:O})]}))},I="index-module_hRecoCardWrapper__FhtJN",S="index-module_hRecoInfoWrapper__4EAyB",D="index-module_hRecoTitleRow__97dd5",U="index-module_hRecoTitle__3Uxkj",j="index-module_hRecoRatingWrapper__mGwia",A="index-module_hRecoDiscountAndPriceWrapper__3NzaV",G="index-module_hRecoPriceWrapper__49o5u",q="index-module_hRecoDiscountWrapper__Kd9Gv",F="index-module_hRecoLoaderWrapper__KXG-6",K="index-module_hidden__CdBrr",E="index-module_hRecoLoaderGradient__c7400",Y="index-module_hRecoLoaderTitleRow__cWktU",X="index-module_hRecoLoaderTitle__-Onou",Z="index-module_hRecoLoaderRating__Qy5b-",Q="index-module_hRecoLoaderSubtitle__l1X3H",z="index-module_hRecoLoaderPricingRow__42VqB",J="index-module_hRecoLoaderDiscount__stqHY",M="index-module_hRecoLoaderPricing__KsQ-o";P(".index-module_hRecoCardWrapper__FhtJN{background:#fff;border-radius:16px;display:flex;flex-direction:column;height:180px;overflow:hidden;width:216px}.index-module_hRecoInfoWrapper__4EAyB{padding:8px 8px 0}.index-module_hRecoTitleRow__97dd5{display:flex;justify-content:space-between}.index-module_hRecoTitle__3Uxkj{padding-right:4px}.index-module_hRecoRatingWrapper__mGwia{align-items:center;background-color:#ecf3ff;border-radius:4px;box-sizing:border-box;display:flex;justify-content:center;margin-left:4px;min-width:28px;padding:0 4px}.index-module_hRecoDiscountAndPriceWrapper__3NzaV{align-items:baseline;display:flex;justify-content:space-between;padding:4px 8px 8px}.index-module_hRecoPriceWrapper__49o5u{align-items:baseline;display:flex;max-width:139px}.index-module_hRecoDiscountWrapper__Kd9Gv{align-items:center;background-color:#11a670;border-radius:4px;box-sizing:border-box;display:flex;justify-content:right;min-width:20px;padding:4px}.index-module_hRecoLoaderWrapper__KXG-6{opacity:1;pointer-events:none;position:absolute;top:0;transition:opacity .15s ease-in-out}.index-module_hRecoLoaderWrapper__KXG-6.index-module_hidden__CdBrr{opacity:0}.index-module_hRecoLoaderGradient__c7400{background:linear-gradient(90deg,#f1efef -24.18%,#f9f8f8 50.26%,#e7e5e5 114.84%)}.index-module_hRecoLoaderTitleRow__cWktU{align-items:center;display:flex;margin-bottom:8px}.index-module_hRecoLoaderTitle__-Onou{border-radius:6px;height:16px;width:168px}.index-module_hRecoLoaderRating__Qy5b-{border-radius:6px;height:16px;margin-left:8px;width:19px}.index-module_hRecoLoaderSubtitle__l1X3H{border-radius:6px;height:12px;margin-bottom:6px;width:124px}.index-module_hRecoLoaderPricingRow__42VqB{align-items:center;display:flex}.index-module_hRecoLoaderDiscount__stqHY{border-radius:6px;height:18px;margin-left:16px;width:45px}.index-module_hRecoLoaderPricing__KsQ-o{border-radius:6px;height:18px;width:139px}");var $=function(i){var n=i.loading,d=i.priority,t=void 0===d?"low":d;return o("div",e({className:"".concat(I," ").concat(F," ").concat(n?"":K)},{children:[a("img",{width:216,height:104,fetchPriority:t,src:k,alt:"Hotel recommendation placeholder"}),o("div",e({className:S},{children:[o("div",e({className:Y},{children:[a("div",{className:"".concat(X," ").concat(E)}),a("div",{className:"".concat(Z," ").concat(E)})]})),a("div",{className:"".concat(Q," ").concat(E)}),o("div",e({className:z},{children:[a("div",{className:"".concat(M," ").concat(E)}),a("div",{className:"".concat(J," ").concat(E)})]}))]}))]}))},ee=function(i){var n,l=i.rank,c=i.coupon,h=i.tripId,m=i.hotelId,x=i.vertical,g=i.location,f=i.pageName,v=i.abVariant,C=i.heroImage,w=i.staticData,N=i.pricingData,L=i.imgPriority,P=i.departureDate,W=i.hotelLandingUrl,B=i.onRecoCardClick,T=i.loyaltyType,H=i.arrivalDate,O=d(!1),V=t("".concat("https://fastui.cltpstatic.com/image/upload/t_h_seo_srp/hotels/places/hotels/").concat(null==C?void 0:C.mediaUrl)),F=V[0],K=V[1],E=r((function(){null==B||B(),_("u_ui_action",{vertical:x,a_trip_id:h,h_hotel_rank:l,h_hotel_id:m,page_name:f,ab_variant:v,child_product:"hotel",a_destination:g,ct_coupon_applied:c,transaction_id_ca:h,onward_date:P,search_destination:g,a_departure_date:P,object_name:null==w?void 0:w.hotelName,h_hotel_name:null==w?void 0:w.hotelName,h_total_discount_percent:null==N?void 0:N.discountPercentage,h_star_category:null==w?void 0:w.starRating,h_user_rating:null==w?void 0:w.userRating,loyalty_type:T,action_type:"click",action_name:"hotel_cross_sell_click",personalised_callout:"hotel_card_click",h_dx:H?p(H):""}),W&&(window.location.href=W)}),[W]),Y=r((function(){O.current||(O.current=!0,K(k))}),[]),X=r((function(){s("u_impression",{vertical:x,a_trip_id:h,h_hotel_rank:l,h_hotel_id:m,page_name:f,ab_variant:v,child_product:"hotel",a_destination:g,ct_coupon_applied:c,transaction_id_ca:h,onward_date:P,search_destination:g,a_departure_date:P,object_name:null==w?void 0:w.hotelName,h_hotel_name:null==w?void 0:w.hotelName,h_total_discount_percent:null==N?void 0:N.discountPercentage,h_star_category:null==w?void 0:w.starRating,h_user_rating:null==w?void 0:w.userRating,loyalty_type:T,h_dx:H?p(H):"",action_name:"hotel_cross_sell_impression",personalised_callout:"hotel_card_impression"})}),[m]);return a(R,e({onIntersection:X},{children:o("div",e({className:I,onClick:E},{children:[a("img",{width:216,height:104,src:F,onError:Y,fetchPriority:L}),o("div",e({className:S},{children:[o("div",e({className:D},{children:[a(b,e({lineClamp:1,className:U,variant:y.B2},{children:null==w?void 0:w.hotelName})),(null==w?void 0:w.userRating)&&a("div",e({className:j},{children:a(b,e({color:"link",variant:y.B3},{children:null===(n=null==w?void 0:w.userRating)||void 0===n?void 0:n.toFixed(1)}))}))]})),o(b,e({variant:y.P3,lineClamp:1,color:"subheading"},{children:[null==w?void 0:w.starRating," star hotel in"," ",null==w?void 0:w.locality]}))]})),o("div",e({className:A},{children:[o("div",e({className:G},{children:[(null==N?void 0:N.perNightPrice)&&o(b,e({variant:y.HM4},{children:[u(N.perNightPrice)," "]})),(null==N?void 0:N.slashedPrice)&&a(b,e({isStriked:!0,color:"subheading",variant:y.B4},{children:u(N.slashedPrice,!1)})),a(b,e({variant:y.B4,color:"subheading"},{children:" / night"}))]})),(null==N?void 0:N.discountPercentage)&&(null==N?void 0:N.discountPercentage)>0&&o("div",e({className:q},{children:[o(b,e({color:"neutral",variant:y.B4CAPS},{children:[null==N?void 0:N.discountPercentage,"%"]})),a(b,e({color:"neutral",variant:y.B4CAPS,style:{marginLeft:"4px"}},{children:"OFF"}))]}))]}))]}))}))},ie={hRecoWrapper:"index-module_hRecoWrapper__AeUoH",hRecoLoaderWrapper:"index-module_hRecoLoaderWrapper__sAARu",hRecoHeader:"index-module_hRecoHeader__5xuYV",hRecoContent:"index-module_hRecoContent__0kDhm",hRecoSidebar:"index-module_hRecoSidebar__UjWWx",connectedLine:"index-module_connectedLine__Z9VpQ",colorConnectedLine:"index-module_colorConnectedLine__KjVo0",loaderConnectedLine:"index-module_loaderConnectedLine__Zhoj6",dottedLine:"index-module_dottedLine__6K0LJ",hRecoCardsWrapper:"index-module_hRecoCardsWrapper__tc4sW",hRecoCardWrapper:"index-module_hRecoCardWrapper__5lhlY",hRecoOfferCallout:"index-module_hRecoOfferCallout__FBOgY",hRecoCouponCalloutRow:"index-module_hRecoCouponCalloutRow__PTCVd",hRecoBookingCallout:"index-module_hRecoBookingCallout__GGryo",exploreButton:"index-module_exploreButton__--vcq",sidebarCircle:"index-module_sidebarCircle__-dZZH",loaderSidebarCircle:"index-module_loaderSidebarCircle__BCXhT",hRecoHeaderTextLoader:"index-module_hRecoHeaderTextLoader__tyYPe"};P(".index-module_hRecoWrapper__AeUoH{background:linear-gradient(219.82deg,rgba(17,166,112,.2),rgba(17,166,112,0) 53.44%);display:flex;position:relative}.index-module_hRecoLoaderWrapper__sAARu{background:linear-gradient(219.82deg,hsla(0,0%,80%,.2),hsla(0,0%,100%,0) 53.44%);display:flex;position:relative}.index-module_hRecoHeader__5xuYV{left:12px;margin-top:24px;position:relative}.index-module_hRecoContent__0kDhm{left:0;position:absolute;width:100%}.index-module_hRecoSidebar__UjWWx{align-items:center;display:flex;flex-direction:column;padding-left:12px}.index-module_connectedLine__Z9VpQ{border-left:1px solid grey;height:20px;left:-.5px;opacity:.3;position:relative}.index-module_colorConnectedLine__KjVo0{border-image:linear-gradient(180deg,#fff 16.49%,#ff4f17);border-image-slice:1;border-left:1px solid;height:24px;margin-left:-.5px;opacity:.3;position:relative}.index-module_loaderConnectedLine__Zhoj6{border-image:linear-gradient(180deg,#fff 16.49%,#f3f3f3);border-image-slice:1;border-left:1px solid;height:24px;margin-left:-.5px;opacity:.3;position:relative}.index-module_dottedLine__6K0LJ{border-left:1px dotted grey;height:266px;left:-.5px;opacity:.5;position:relative}.index-module_hRecoCardsWrapper__tc4sW{-ms-overflow-style:none;box-sizing:content-box;display:flex;height:180px;overflow:auto;padding:0 16px 24px 44px;scrollbar-width:none;width:calc(100% - 60px)}.index-module_hRecoCardWrapper__5lhlY{border-radius:16px;box-shadow:0 4px 16px 0 rgba(26,26,26,.08);margin-right:12px;min-width:216px;position:relative}.index-module_hRecoCardWrapper__5lhlY:last-child{margin-right:0}.index-module_hRecoCardsWrapper__tc4sW::-webkit-scrollbar{display:none}.index-module_hRecoOfferCallout__FBOgY{border-radius:24px;padding:8px 0 0}.index-module_hRecoCouponCalloutRow__PTCVd{display:flex;padding:8px 0 16px}.index-module_hRecoBookingCallout__GGryo{padding-bottom:16px;padding-top:4px}.index-module_exploreButton__--vcq{left:40px;margin-left:4px;position:relative;width:calc(100% - 60px)}.index-module_sidebarCircle__-dZZH{background:#ecf3ff;border:1px solid #1a1a1a;border-radius:50%;height:8px;width:8px}.index-module_loaderSidebarCircle__BCXhT{background:#ecf3ff;border:1px solid #f3f3f3;border-radius:50%;height:8px;width:8px}.index-module_hRecoHeaderTextLoader__tyYPe{background:linear-gradient(90deg,#f1efef -24.18%,#f9f8f8 50.26%,#e7e5e5 114.84%);border-radius:6px}");var oe=function(i){var d=i.data,u=i.tripId,m=i.loading,x=i.pageName,g=i.vertical,C=i.location,w=i.abVariant,N=i.maxCardsCount,k=i.departureDate,P=i.destroyLoaders,W=i.fallbackPageLandingURL,B=i.ctaTitle,T=void 0===B?"View all hotels":B,H=i.triggerViewTransitionOnClick,O=i.loyaltyType,I=i.arrivalDate,S=t(!1),D=S[0],U=S[1],j=l((function(){return h(k)}),[k]),A=l((function(){var i,t,r=null!==(t=null===(i=null==d?void 0:d.recommendations)||void 0===i?void 0:i.length)&&void 0!==t?t:0,l=Array.from({length:N},(function(e,i){return i+1}));return m||r>=2?a("div",e({className:ie.hRecoCardsWrapper},{children:l.map((function(i,t){var r,l,c;return m||!P||(null===(r=null==d?void 0:d.recommendations)||void 0===r?void 0:r[t])?o("div",e({className:ie.hRecoCardWrapper},{children:[(null===(l=null==d?void 0:d.recommendations)||void 0===l?void 0:l[t])&&a(ee,e({tripId:u,rank:t+1,location:C,pageName:x,vertical:g,abVariant:w,coupon:null==d?void 0:d.couponCode,departureDate:j},null===(c=null==d?void 0:d.recommendations)||void 0===c?void 0:c[t],{imgPriority:0===t?"high":"auto",onRecoCardClick:H,loyaltyType:O,arrivalDate:I})),!P&&a($,{loading:m,priority:0===t?"high":"auto"})]}),i):a(n,{})}))})):a(V,{})}),[d,m,P]),G=r((function(){U(!0)}),[]),q=r((function(){var e,i,o;null==H||H();var a=null!==(i=null===(e=null==d?void 0:d.recommendations)||void 0===e?void 0:e.length)&&void 0!==i?i:0;_("u_ui_action",{vertical:g,a_trip_id:u,page_name:x,action_type:"click",ab_variant:w,child_product:"hotel",a_destination:C,transaction_id_ca:u,onward_date:j,search_destination:C,a_departure_date:j,action_name:"hotel_cross_sell_click",loyalty_type:O,h_dx:I?p(I):"",personalised_callout:"Book hotel now",result_count:a<N?a:N});var n=null!==(o=null==d?void 0:d.pageLandingUrl)&&void 0!==o?o:W;n&&(window.location.href=n)}),[d]);return c((function(){var e,i;if(D&&!m){var o=null!==(i=null===(e=null==d?void 0:d.recommendations)||void 0===e?void 0:e.length)&&void 0!==i?i:0;s("u_impression",{vertical:g,a_trip_id:u,page_name:x,ab_variant:w,child_product:"hotel",a_destination:C,transaction_id_ca:u,onward_date:j,search_destination:C,a_departure_date:j,action_name:"hotel_cross_sell_impression",callout_value_xsell:"".concat(null==d?void 0:d.couponCallOutPrefix," ").concat(null==d?void 0:d.couponCallOutSuffix),loyalty_type:O,h_dx:I?p(I):"",result_count:o<N?o:N})}}),[m,d,D]),a(R,e({onIntersection:G},{children:o("div",e({className:"".concat(m?ie.hRecoLoaderWrapper:ie.hRecoWrapper)},{children:[a("div",e({className:ie.hRecoSidebar},{children:o(n,m?{children:[a("div",{className:ie.loaderConnectedLine}),a("img",{width:20,height:20,src:L,fetchPriority:"low"}),a("div",{className:ie.connectedLine}),a("img",{width:20,height:20,src:L,fetchPriority:"low"}),a("div",{className:ie.dottedLine}),a("div",{className:ie.loaderSidebarCircle})]}:{children:[a("div",{className:ie.colorConnectedLine}),a("img",{width:20,height:20,src:"https://rukmini-ct.flixcart.com/f_auto,q_auto,w_20,h_20,dpr_4/offermgmt-prod/offermgmt/images/banner/NewGiftIcon.png",fetchPriority:"low"}),a("div",{className:ie.connectedLine}),a("img",{width:20,height:20,src:"https://rukmini-ct.flixcart.com/f_auto,q_auto,w_20,h_20,dpr_4/offermgmt-prod/offermgmt/images/banner/Xsell_offers.png",fetchPriority:"low"}),a("div",{className:ie.dottedLine}),a("div",{className:ie.sidebarCircle})]})})),o("div",e({className:ie.hRecoMainWrapper},{children:[o("div",e({className:ie.hRecoHeader},{children:[m?a("div",e({style:{padding:"4px 0 0",marginBottom:"16px"}},{children:a("div",{className:ie.hRecoHeaderTextLoader,style:{height:"16px",width:"150px"}})})):a(b,e({variant:y.B3,colorCode:"#808080",className:ie.hRecoBookingCallout},{children:null==d?void 0:d.bookingCallOut})),a("div",m?e({style:{padding:"8px 0 0 0"}},{children:a("div",{className:ie.hRecoHeaderTextLoader,style:{height:"16px",width:"254px"}})}):e({className:ie.hRecoOfferCallout},{children:a(b,e({variant:y.B3},{children:null==d?void 0:d.offerCallOut}))})),m?a("div",e({style:{padding:"8px 0 16px"}},{children:a("div",{className:ie.hRecoHeaderTextLoader,style:{height:"22px",width:"184px"}})})):o("div",e({className:ie.hRecoCouponCalloutRow},{children:[a(b,e({variant:y.P1,colorCode:"#FF4F17",style:{fontWeight:"600"}},{children:null==d?void 0:d.couponCallOutPrefix})),(null==d?void 0:d.couponCallOutPrefix)?a(b,e({variant:y.P1,style:{fontWeight:"600",marginLeft:"4px"}},{children:null==d?void 0:d.couponCallOutSuffix})):null]}))]})),o("div",e({className:ie.hRecoContent},{children:[A,m?a("div",{className:"".concat(ie.hRecoHeaderTextLoader," ").concat(ie.exploreButton),style:{height:"40px"}}):a(f,e({onClick:q,variant:v.OUTLINE,className:ie.exploreButton},{children:T}))]}))]}))]}))}))},ae=function(o){var n=o.location,d=o.pageName,l=o.abVariant,_=o.cutoff,p=void 0===_?450:_,s=o.vertical,u=void 0===s?"AIR":s,h=o.fallbackPageLandingURL,f=o.maxCardsCount,v=void 0===f?5:f,R=o.triggerViewTransition,b=i(o,["location","pageName","abVariant","cutoff","vertical","fallbackPageLandingURL","maxCardsCount","triggerViewTransition"]),y=t(!0),C=y[0],L=y[1],k=t(!1),P=k[0],W=k[1],B=t(),T=B[0],H=B[1],O=r((function(i){var o;return e(e({},i),{bookingCallOut:n?"Since you are flying to ".concat(n,"!"):"Since you are flying with us!",recommendations:null!==(o=i.recommendations)&&void 0!==o?o:[]})}),[]);return c((function(){var e,i=m(h||""),o=i.locationCode,a=void 0===o?"":o,n=i.baseLocation,d=void 0===n?"":n,t=i.chk_in,r=void 0===t?"":t,l=i.chk_out,c=void 0===l?"":l,_={destinationCode:a||(null===(e=d.split("-"))||void 0===e?void 0:e[1])||"",hotelId:"",checkInDate:r,checkOutDate:c,paxInfo:[{adults:{count:2,metadata:[]},children:{count:0,metadata:[]}}]};x({cookieName:"hotel_search_criteria",cookieValue:JSON.stringify(_),expiryInDay:1}),x({cookieName:"x-lineage-id",cookieValue:w(),expiryInDay:1}),g(u,h,p,null==b?void 0:b.couponCallOutPrefix,null==b?void 0:b.couponCallOutSuffix,null==b?void 0:b.offerCallOut,null==b?void 0:b.additionalHeaders,null==b?void 0:b.additionalParams).then((function(e){var i=O(e);H(i),setTimeout((function(){L(!1)}),10),setTimeout((function(){W(!0)}),180)}))}),[]),a(N,{children:a(oe,e({data:T,loading:C,pageName:d,vertical:u,location:n,abVariant:l,maxCardsCount:v,destroyLoaders:P,fallbackPageLandingURL:h,triggerViewTransitionOnClick:R},b))})};export{k as HotelRecoPlaceholderImg,ae as HotelRecommendationContainer,oe as HotelRecommendationsWidget};
1
+ import{__assign as e,__rest as i}from"tslib";import{jsxs as o,jsx as a,Fragment as n}from"react/jsx-runtime";import{useRef as d,useState as t,useCallback as r,useMemo as l,useEffect as c}from"react";import{ravenSDKTrigger as _,getNoOfDaysFromToday as p,batchRavenEvent as s,formatCurrency as u,formatFullDateString as h,extractQueryParamsAsObj as m,setCookie as x,getHotelCrossSellRecos as g}from"@cleartrip/ct-platform-utils";import{Button as f,ButtonVariant as v}from"@cleartrip/ct-design-button";import{IntersectionObserverHOC as R}from"@cleartrip/ct-platform-io-hoc";import{Typography as b,TypographyVariant as y}from"@cleartrip/ct-design-typography";import{CheckIcon as C}from"@cleartrip/ct-platform-assets";import{v4 as w}from"uuid";import{ThemeProvider as N}from"@cleartrip/ct-design-theme";var k="https://rukmini-ct.flixcart.com/f_auto,q_auto,w_20,h_20,dpr_4/offermgmt-prod/offermgmt/images/banner/LoadingGiftIcon.png",L="https://rukmini-ct.flixcart.com/f_auto,q_auto/offermgmt-prod/offermgmt/images/banner/Image-placholder-1.jpg";function P(e,i){void 0===i&&(i={});var o=i.insertAt;if(e&&"undefined"!=typeof document){var a=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===o&&a.firstChild?a.insertBefore(n,a.firstChild):a.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}}var W="index-module_hRecoBanner__CyUB8",B="index-module_hRecoBannerIcon__cFmbk",T="index-module_hRecoBannerTextsWrapper__0P-pK",H="index-module_hRecoBannerTextRow__qbE8k",O="index-module_hRecoBannerImg__eC0hA";P(".index-module_hRecoBanner__CyUB8{aspect-ratio:304/180;background:#fff;border-radius:16px;box-shadow:0 4px 16px 0 rgba(26,26,26,.08);display:flex;height:180px;margin:0 16px 24px 44px;overflow:hidden;width:calc(100% - 60px)}.index-module_hRecoBannerIcon__cFmbk{margin-right:8px;min-width:16px;padding-top:1px}.index-module_hRecoBannerTextsWrapper__0P-pK{display:flex;flex-direction:column;justify-content:center;padding:18px 8px 18px 12px}.index-module_hRecoBannerTextRow__qbE8k{display:flex;padding-bottom:16px}.index-module_hRecoBannerTextRow__qbE8k:last-of-type{padding-bottom:0}.index-module_hRecoBannerImg__eC0hA{height:100%}");var V=function(){return o("div",e({className:W},{children:[o("div",e({className:T},{children:[o("div",e({className:H},{children:[a(C,{className:B}),a(b,e({variant:y.P3},{children:"Free cancellation till check-in time"}))]})),o("div",e({className:H},{children:[a(C,{className:B}),a(b,e({variant:y.P3},{children:"Exclusive member discount for Flipkart & Myntra"}))]})),o("div",e({className:H},{children:[a(C,{className:B}),a(b,e({variant:y.P3},{children:"Earn and redeem SuperCoins"}))]}))]})),a("img",{src:"https://rukmini-ct.flixcart.com/f_auto,q_auto,w_274,h_360,dpr_4/offermgmt-prod/offermgmt/images/banner/hotel_Xsell_fallback_2.png",className:O})]}))},I="index-module_hRecoCardWrapper__FhtJN",S="index-module_hRecoInfoWrapper__4EAyB",D="index-module_hRecoTitleRow__97dd5",U="index-module_hRecoTitle__3Uxkj",j="index-module_hRecoRatingWrapper__mGwia",A="index-module_hRecoDiscountAndPriceWrapper__3NzaV",q="index-module_hRecoPriceWrapper__49o5u",G="index-module_hRecoDiscountWrapper__Kd9Gv",F="index-module_hRecoLoaderWrapper__KXG-6",K="index-module_hidden__CdBrr",E="index-module_hRecoLoaderGradient__c7400",Y="index-module_hRecoLoaderTitleRow__cWktU",X="index-module_hRecoLoaderTitle__-Onou",Z="index-module_hRecoLoaderRating__Qy5b-",Q="index-module_hRecoLoaderSubtitle__l1X3H",z="index-module_hRecoLoaderPricingRow__42VqB",J="index-module_hRecoLoaderDiscount__stqHY",M="index-module_hRecoLoaderPricing__KsQ-o";P(".index-module_hRecoCardWrapper__FhtJN{background:#fff;border-radius:16px;display:flex;flex-direction:column;height:180px;overflow:hidden;width:216px}.index-module_hRecoInfoWrapper__4EAyB{padding:8px 8px 0}.index-module_hRecoTitleRow__97dd5{display:flex;justify-content:space-between}.index-module_hRecoTitle__3Uxkj{padding-right:4px}.index-module_hRecoRatingWrapper__mGwia{align-items:center;background-color:#ecf3ff;border-radius:4px;box-sizing:border-box;display:flex;justify-content:center;margin-left:4px;min-width:28px;padding:0 4px}.index-module_hRecoDiscountAndPriceWrapper__3NzaV{align-items:baseline;display:flex;justify-content:space-between;padding:4px 8px 8px}.index-module_hRecoPriceWrapper__49o5u{align-items:baseline;display:flex;max-width:139px}.index-module_hRecoDiscountWrapper__Kd9Gv{align-items:center;background-color:#11a670;border-radius:4px;box-sizing:border-box;display:flex;justify-content:right;min-width:20px;padding:4px}.index-module_hRecoLoaderWrapper__KXG-6{opacity:1;pointer-events:none;position:absolute;top:0;transition:opacity .15s ease-in-out}.index-module_hRecoLoaderWrapper__KXG-6.index-module_hidden__CdBrr{opacity:0}.index-module_hRecoLoaderGradient__c7400{background:linear-gradient(90deg,#f1efef -24.18%,#f9f8f8 50.26%,#e7e5e5 114.84%)}.index-module_hRecoLoaderTitleRow__cWktU{align-items:center;display:flex;margin-bottom:8px}.index-module_hRecoLoaderTitle__-Onou{border-radius:6px;height:16px;width:168px}.index-module_hRecoLoaderRating__Qy5b-{border-radius:6px;height:16px;margin-left:8px;width:19px}.index-module_hRecoLoaderSubtitle__l1X3H{border-radius:6px;height:12px;margin-bottom:6px;width:124px}.index-module_hRecoLoaderPricingRow__42VqB{align-items:center;display:flex}.index-module_hRecoLoaderDiscount__stqHY{border-radius:6px;height:18px;margin-left:16px;width:45px}.index-module_hRecoLoaderPricing__KsQ-o{border-radius:6px;height:18px;width:139px}");var $=function(i){var n=i.loading,d=i.priority,t=void 0===d?"low":d;return o("div",e({className:"".concat(I," ").concat(F," ").concat(n?"":K)},{children:[a("img",{width:216,height:104,fetchPriority:t,src:L,alt:"Hotel recommendation placeholder"}),o("div",e({className:S},{children:[o("div",e({className:Y},{children:[a("div",{className:"".concat(X," ").concat(E)}),a("div",{className:"".concat(Z," ").concat(E)})]})),a("div",{className:"".concat(Q," ").concat(E)}),o("div",e({className:z},{children:[a("div",{className:"".concat(M," ").concat(E)}),a("div",{className:"".concat(J," ").concat(E)})]}))]}))]}))},ee=function(i){var n,l=i.rank,c=i.coupon,h=i.tripId,m=i.hotelId,x=i.vertical,g=i.location,f=i.pageName,v=i.abVariant,C=i.heroImage,w=i.staticData,N=i.pricingData,k=i.imgPriority,P=i.departureDate,W=i.hotelLandingUrl,B=i.onRecoCardClick,T=i.loyaltyType,H=i.arrivalDate,O=d(!1),V=t("".concat("https://rukmini-ct.flixcart.com/f_auto,q_auto/ct-hotel-images/places/hotels/").concat(null==C?void 0:C.mediaUrl)),F=V[0],K=V[1],E=r((function(){null==B||B(),_("u_ui_action",{vertical:x,a_trip_id:h,h_hotel_rank:l,h_hotel_id:m,page_name:f,ab_variant:v,child_product:"hotel",a_destination:g,ct_coupon_applied:c,transaction_id_ca:h,onward_date:P,search_destination:g,a_departure_date:P,object_name:null==w?void 0:w.hotelName,h_hotel_name:null==w?void 0:w.hotelName,h_total_discount_percent:null==N?void 0:N.discountPercentage,h_star_category:null==w?void 0:w.starRating,h_user_rating:null==w?void 0:w.userRating,loyalty_type:T,action_type:"click",action_name:"hotel_cross_sell_click",personalised_callout:"hotel_card_click",h_dx:H?p(H):""}),W&&(window.location.href=W)}),[W]),Y=r((function(){O.current||(O.current=!0,K(L))}),[]),X=r((function(){s("u_impression",{vertical:x,a_trip_id:h,h_hotel_rank:l,h_hotel_id:m,page_name:f,ab_variant:v,child_product:"hotel",a_destination:g,ct_coupon_applied:c,transaction_id_ca:h,onward_date:P,search_destination:g,a_departure_date:P,object_name:null==w?void 0:w.hotelName,h_hotel_name:null==w?void 0:w.hotelName,h_total_discount_percent:null==N?void 0:N.discountPercentage,h_star_category:null==w?void 0:w.starRating,h_user_rating:null==w?void 0:w.userRating,loyalty_type:T,h_dx:H?p(H):"",action_name:"hotel_cross_sell_impression",personalised_callout:"hotel_card_impression"})}),[m]);return a(R,e({onIntersection:X},{children:o("div",e({className:I,onClick:E},{children:[a("img",{width:216,height:104,src:F,onError:Y,fetchPriority:k}),o("div",e({className:S},{children:[o("div",e({className:D},{children:[a(b,e({lineClamp:1,className:U,variant:y.B2},{children:null==w?void 0:w.hotelName})),(null==w?void 0:w.userRating)&&a("div",e({className:j},{children:a(b,e({color:"link",variant:y.B3},{children:null===(n=null==w?void 0:w.userRating)||void 0===n?void 0:n.toFixed(1)}))}))]})),o(b,e({variant:y.P3,lineClamp:1,color:"subheading"},{children:[null==w?void 0:w.starRating," star hotel in"," ",null==w?void 0:w.locality]}))]})),o("div",e({className:A},{children:[o("div",e({className:q},{children:[(null==N?void 0:N.perNightPrice)&&o(b,e({variant:y.HM4},{children:[u(N.perNightPrice)," "]})),(null==N?void 0:N.slashedPrice)&&a(b,e({isStriked:!0,color:"subheading",variant:y.B4},{children:u(N.slashedPrice,!1)})),a(b,e({variant:y.B4,color:"subheading"},{children:" / night"}))]})),(null==N?void 0:N.discountPercentage)&&(null==N?void 0:N.discountPercentage)>0&&o("div",e({className:G},{children:[o(b,e({color:"neutral",variant:y.B4CAPS},{children:[null==N?void 0:N.discountPercentage,"%"]})),a(b,e({color:"neutral",variant:y.B4CAPS,style:{marginLeft:"4px"}},{children:"OFF"}))]}))]}))]}))}))},ie={hRecoWrapper:"index-module_hRecoWrapper__AeUoH",hRecoLoaderWrapper:"index-module_hRecoLoaderWrapper__sAARu",hRecoHeader:"index-module_hRecoHeader__5xuYV",hRecoContent:"index-module_hRecoContent__0kDhm",hRecoSidebar:"index-module_hRecoSidebar__UjWWx",connectedLine:"index-module_connectedLine__Z9VpQ",colorConnectedLine:"index-module_colorConnectedLine__KjVo0",loaderConnectedLine:"index-module_loaderConnectedLine__Zhoj6",dottedLine:"index-module_dottedLine__6K0LJ",hRecoCardsWrapper:"index-module_hRecoCardsWrapper__tc4sW",hRecoCardWrapper:"index-module_hRecoCardWrapper__5lhlY",hRecoOfferCallout:"index-module_hRecoOfferCallout__FBOgY",hRecoCouponCalloutRow:"index-module_hRecoCouponCalloutRow__PTCVd",hRecoBookingCallout:"index-module_hRecoBookingCallout__GGryo",exploreButton:"index-module_exploreButton__--vcq",sidebarCircle:"index-module_sidebarCircle__-dZZH",loaderSidebarCircle:"index-module_loaderSidebarCircle__BCXhT",hRecoHeaderTextLoader:"index-module_hRecoHeaderTextLoader__tyYPe"};P(".index-module_hRecoWrapper__AeUoH{background:linear-gradient(219.82deg,rgba(17,166,112,.2),rgba(17,166,112,0) 53.44%);display:flex;position:relative}.index-module_hRecoLoaderWrapper__sAARu{background:linear-gradient(219.82deg,hsla(0,0%,80%,.2),hsla(0,0%,100%,0) 53.44%);display:flex;position:relative}.index-module_hRecoHeader__5xuYV{left:12px;margin-top:24px;position:relative}.index-module_hRecoContent__0kDhm{left:0;position:absolute;width:100%}.index-module_hRecoSidebar__UjWWx{align-items:center;display:flex;flex-direction:column;padding-left:12px}.index-module_connectedLine__Z9VpQ{border-left:1px solid grey;height:20px;left:-.5px;opacity:.3;position:relative}.index-module_colorConnectedLine__KjVo0{border-image:linear-gradient(180deg,#fff 16.49%,#ff4f17);border-image-slice:1;border-left:1px solid;height:24px;margin-left:-.5px;opacity:.3;position:relative}.index-module_loaderConnectedLine__Zhoj6{border-image:linear-gradient(180deg,#fff 16.49%,#f3f3f3);border-image-slice:1;border-left:1px solid;height:24px;margin-left:-.5px;opacity:.3;position:relative}.index-module_dottedLine__6K0LJ{border-left:1px dotted grey;height:266px;left:-.5px;opacity:.5;position:relative}.index-module_hRecoCardsWrapper__tc4sW{-ms-overflow-style:none;box-sizing:content-box;display:flex;height:180px;overflow:auto;padding:0 16px 24px 44px;scrollbar-width:none;width:calc(100% - 60px)}.index-module_hRecoCardWrapper__5lhlY{border-radius:16px;box-shadow:0 4px 16px 0 rgba(26,26,26,.08);margin-right:12px;min-width:216px;position:relative}.index-module_hRecoCardWrapper__5lhlY:last-child{margin-right:0}.index-module_hRecoCardsWrapper__tc4sW::-webkit-scrollbar{display:none}.index-module_hRecoOfferCallout__FBOgY{border-radius:24px;padding:8px 0 0}.index-module_hRecoCouponCalloutRow__PTCVd{display:flex;padding:8px 0 16px}.index-module_hRecoBookingCallout__GGryo{padding-bottom:16px;padding-top:4px}.index-module_exploreButton__--vcq{left:40px;margin-left:4px;position:relative;width:calc(100% - 60px)}.index-module_sidebarCircle__-dZZH{background:#ecf3ff;border:1px solid #1a1a1a;border-radius:50%;height:8px;width:8px}.index-module_loaderSidebarCircle__BCXhT{background:#ecf3ff;border:1px solid #f3f3f3;border-radius:50%;height:8px;width:8px}.index-module_hRecoHeaderTextLoader__tyYPe{background:linear-gradient(90deg,#f1efef -24.18%,#f9f8f8 50.26%,#e7e5e5 114.84%);border-radius:6px}");var oe=function(i){var d=i.data,u=i.tripId,m=i.loading,x=i.pageName,g=i.vertical,C=i.location,w=i.abVariant,N=i.maxCardsCount,L=i.departureDate,P=i.destroyLoaders,W=i.fallbackPageLandingURL,B=i.ctaTitle,T=void 0===B?"View all hotels":B,H=i.triggerViewTransitionOnClick,O=i.loyaltyType,I=i.arrivalDate,S=t(!1),D=S[0],U=S[1],j=l((function(){return h(L)}),[L]),A=l((function(){var i,t,r=null!==(t=null===(i=null==d?void 0:d.recommendations)||void 0===i?void 0:i.length)&&void 0!==t?t:0,l=Array.from({length:N},(function(e,i){return i+1}));return m||r>=2?a("div",e({className:ie.hRecoCardsWrapper},{children:l.map((function(i,t){var r,l,c;return m||!P||(null===(r=null==d?void 0:d.recommendations)||void 0===r?void 0:r[t])?o("div",e({className:ie.hRecoCardWrapper},{children:[(null===(l=null==d?void 0:d.recommendations)||void 0===l?void 0:l[t])&&a(ee,e({tripId:u,rank:t+1,location:C,pageName:x,vertical:g,abVariant:w,coupon:null==d?void 0:d.couponCode,departureDate:j},null===(c=null==d?void 0:d.recommendations)||void 0===c?void 0:c[t],{imgPriority:0===t?"high":"auto",onRecoCardClick:H,loyaltyType:O,arrivalDate:I})),!P&&a($,{loading:m,priority:0===t?"high":"auto"})]}),i):a(n,{})}))})):a(V,{})}),[d,m,P]),q=r((function(){U(!0)}),[]),G=r((function(){var e,i,o;null==H||H();var a=null!==(i=null===(e=null==d?void 0:d.recommendations)||void 0===e?void 0:e.length)&&void 0!==i?i:0;_("u_ui_action",{vertical:g,a_trip_id:u,page_name:x,action_type:"click",ab_variant:w,child_product:"hotel",a_destination:C,transaction_id_ca:u,onward_date:j,search_destination:C,a_departure_date:j,action_name:"hotel_cross_sell_click",loyalty_type:O,h_dx:I?p(I):"",personalised_callout:"Book hotel now",result_count:a<N?a:N});var n=null!==(o=null==d?void 0:d.pageLandingUrl)&&void 0!==o?o:W;n&&(window.location.href=n)}),[d]);return c((function(){var e,i;if(D&&!m){var o=null!==(i=null===(e=null==d?void 0:d.recommendations)||void 0===e?void 0:e.length)&&void 0!==i?i:0;s("u_impression",{vertical:g,a_trip_id:u,page_name:x,ab_variant:w,child_product:"hotel",a_destination:C,transaction_id_ca:u,onward_date:j,search_destination:C,a_departure_date:j,action_name:"hotel_cross_sell_impression",callout_value_xsell:"".concat(null==d?void 0:d.couponCallOutPrefix," ").concat(null==d?void 0:d.couponCallOutSuffix),loyalty_type:O,h_dx:I?p(I):"",result_count:o<N?o:N})}}),[m,d,D]),a(R,e({onIntersection:q},{children:o("div",e({className:"".concat(m?ie.hRecoLoaderWrapper:ie.hRecoWrapper)},{children:[a("div",e({className:ie.hRecoSidebar},{children:o(n,m?{children:[a("div",{className:ie.loaderConnectedLine}),a("img",{width:20,height:20,src:k,fetchPriority:"low"}),a("div",{className:ie.connectedLine}),a("img",{width:20,height:20,src:k,fetchPriority:"low"}),a("div",{className:ie.dottedLine}),a("div",{className:ie.loaderSidebarCircle})]}:{children:[a("div",{className:ie.colorConnectedLine}),a("img",{width:20,height:20,src:"https://rukmini-ct.flixcart.com/f_auto,q_auto,w_20,h_20,dpr_4/offermgmt-prod/offermgmt/images/banner/NewGiftIcon.png",fetchPriority:"low"}),a("div",{className:ie.connectedLine}),a("img",{width:20,height:20,src:"https://rukmini-ct.flixcart.com/f_auto,q_auto,w_20,h_20,dpr_4/offermgmt-prod/offermgmt/images/banner/Xsell_offers.png",fetchPriority:"low"}),a("div",{className:ie.dottedLine}),a("div",{className:ie.sidebarCircle})]})})),o("div",e({className:ie.hRecoMainWrapper},{children:[o("div",e({className:ie.hRecoHeader},{children:[m?a("div",e({style:{padding:"4px 0 0",marginBottom:"16px"}},{children:a("div",{className:ie.hRecoHeaderTextLoader,style:{height:"16px",width:"150px"}})})):a(b,e({variant:y.B3,colorCode:"#808080",className:ie.hRecoBookingCallout},{children:null==d?void 0:d.bookingCallOut})),a("div",m?e({style:{padding:"8px 0 0 0"}},{children:a("div",{className:ie.hRecoHeaderTextLoader,style:{height:"16px",width:"254px"}})}):e({className:ie.hRecoOfferCallout},{children:a(b,e({variant:y.B3},{children:null==d?void 0:d.offerCallOut}))})),m?a("div",e({style:{padding:"8px 0 16px"}},{children:a("div",{className:ie.hRecoHeaderTextLoader,style:{height:"22px",width:"184px"}})})):o("div",e({className:ie.hRecoCouponCalloutRow},{children:[a(b,e({variant:y.P1,colorCode:"#FF4F17",style:{fontWeight:"600"}},{children:null==d?void 0:d.couponCallOutPrefix})),(null==d?void 0:d.couponCallOutPrefix)?a(b,e({variant:y.P1,style:{fontWeight:"600",marginLeft:"4px"}},{children:null==d?void 0:d.couponCallOutSuffix})):null]}))]})),o("div",e({className:ie.hRecoContent},{children:[A,m?a("div",{className:"".concat(ie.hRecoHeaderTextLoader," ").concat(ie.exploreButton),style:{height:"40px"}}):a(f,e({onClick:G,variant:v.OUTLINE,className:ie.exploreButton},{children:T}))]}))]}))]}))}))},ae=function(o){var n=o.location,d=o.pageName,l=o.abVariant,_=o.cutoff,p=void 0===_?450:_,s=o.vertical,u=void 0===s?"AIR":s,h=o.fallbackPageLandingURL,f=o.maxCardsCount,v=void 0===f?5:f,R=o.triggerViewTransition,b=i(o,["location","pageName","abVariant","cutoff","vertical","fallbackPageLandingURL","maxCardsCount","triggerViewTransition"]),y=t(!0),C=y[0],k=y[1],L=t(!1),P=L[0],W=L[1],B=t(),T=B[0],H=B[1],O=r((function(i){var o;return e(e({},i),{bookingCallOut:n?"Since you are flying to ".concat(n,"!"):"Since you are flying with us!",recommendations:null!==(o=i.recommendations)&&void 0!==o?o:[]})}),[]);return c((function(){var e,i=m(h||""),o=i.locationCode,a=void 0===o?"":o,n=i.baseLocation,d=void 0===n?"":n,t=i.chk_in,r=void 0===t?"":t,l=i.chk_out,c=void 0===l?"":l,_={destinationCode:a||(null===(e=d.split("-"))||void 0===e?void 0:e[1])||"",hotelId:"",checkInDate:r,checkOutDate:c,paxInfo:[{adults:{count:2,metadata:[]},children:{count:0,metadata:[]}}]};x({cookieName:"hotel_search_criteria",cookieValue:JSON.stringify(_),expiryInDay:1}),x({cookieName:"x-lineage-id",cookieValue:w(),expiryInDay:1}),g(u,h,p,null==b?void 0:b.couponCallOutPrefix,null==b?void 0:b.couponCallOutSuffix,null==b?void 0:b.offerCallOut,null==b?void 0:b.additionalHeaders,null==b?void 0:b.additionalParams).then((function(e){var i=O(e);H(i),setTimeout((function(){k(!1)}),10),setTimeout((function(){W(!0)}),180)}))}),[]),a(N,{children:a(oe,e({data:T,loading:C,pageName:d,vertical:u,location:n,abVariant:l,maxCardsCount:v,destroyLoaders:P,fallbackPageLandingURL:h,triggerViewTransitionOnClick:R},b))})};export{L as HotelRecoPlaceholderImg,ae as HotelRecommendationContainer,oe as HotelRecommendationsWidget};
2
2
  //# sourceMappingURL=ct-platform-hotel-recommendations.esm.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cleartrip/ct-platform-hotel-recommendations",
3
- "version": "1.14.1-beta.0",
3
+ "version": "1.14.1-beta.10",
4
4
  "description": "Hotel Recommendations Component",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/ct-platform-hotel-recommendations.cjs.js",
@@ -15,10 +15,10 @@
15
15
  "@cleartrip/ct-design-typography": "3.7.0",
16
16
  "classnames": "^2.5.1",
17
17
  "uuid": "^9.0.1",
18
- "@cleartrip/ct-platform-assets": "3.4.1-beta.0",
19
- "@cleartrip/ct-platform-io-hoc": "3.0.3-beta.10",
20
- "@cleartrip/ct-platform-utils": "3.17.1-beta.0",
21
- "@cleartrip/ct-platform-types": "3.5.1-beta.0"
18
+ "@cleartrip/ct-platform-assets": "3.4.1-beta.9",
19
+ "@cleartrip/ct-platform-utils": "3.18.1-beta.8",
20
+ "@cleartrip/ct-platform-io-hoc": "3.0.3-beta.19",
21
+ "@cleartrip/ct-platform-types": "3.5.1-beta.9"
22
22
  },
23
23
  "peerDependencies": {
24
24
  "react": ">=16.8.0",