"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5238],{MyPT:function(e,t,r){r.d(t,{CT:function(){return fetchEmbeddingDoctorsForSession},oQ:function(){return h},pA:function(){return shouldFetchRemainingEmbeddingDoctors}});var o=r("TYy9"),l=r.n(o),i=r("xweI"),a=r.n(i),n=r("09QT"),s=r("/tR3"),c=r("J3uC"),d=r("oQBk");let h=4,mapTopServiceDoctors=e=>{var t;let r=null==e?void 0:null===(t=e._data)||void 0===t?void 0:t.top_services;return r?a()(l()((0,c.PE)(r).serviceList.map(e=>e.services)),["position"],"asc"):[]},mapSearchCareDoctors=e=>{var t;return a()(((null==e?void 0:null===(t=e._data)||void 0===t?void 0:t.searches)||[]).map(s.XR),["position"],"asc")},getSearchCareParams=(e,t)=>{let{embebIds:r,typeEmbedding:o,allDoctors:l}=e;return t?{type:"doctor",skipBooking:1,page:1,perPage:t,..."doctors"===o&&{doctorIds:r.join(",")},..."specialties"===o&&r.length>0&&{specialtyId:r.join(",")}}:l?{type:"doctor",skipBooking:1,..."doctors"===o&&{doctorIds:r.join(",")},..."specialties"===o&&r.length>0&&{specialtyId:r.join(",")}}:{type:"doctor",skipBooking:1,page:1,perPage:12,..."doctors"===o&&{doctorIds:r.join(",")},..."specialties"===o&&r.length>0&&{specialtyId:r.join(",")}}},fetchEmbeddingDoctorsForSession=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{embebIds:r,typeEmbedding:o}=e,{limit:l}=t;if(0===(r||[]).length)return[];if("top_service"===o){let e=await (0,n.d)(d.y.CARE.GET_TOP_SERVICES,{params:{categoryIds:r.join(",")}},"care"),t=mapTopServiceDoctors(e);return l?t.slice(0,l):t}if("doctors"===o||"specialties"===o){let t=await (0,n.d)(d.y.CARE.GET_SEARCH_CARE,{params:getSearchCareParams(e,l)},"careV2"),r=mapSearchCareDoctors(t);return l?r.slice(0,l):r}return[]},shouldFetchRemainingEmbeddingDoctors=e=>e===h},gJqh:function(e,t,r){r.d(t,{Z:function(){return eF}});var o=r("BGKE"),l=r("q1tI"),i=r("2451"),a=r("/kWL"),n=r("r9m4"),s=r("8vDj"),c=r("Eso5"),d=r("mYVa"),h=r("OAL+"),u=r("SPK5"),p=r("dDsW"),g=r("gHFm"),m=r("iv2E"),f=r("hXNO"),v=r("P5LW"),x=r("rIrU"),b=r("TaKJ"),C=r("TfUb"),y=r("m42D"),w=r("0e15"),S=r("pUA5"),Z=r("vaps"),k=r("ChHM");let getCarePathDoctorListFilterInteractiveStyles=(e,t)=>{let r=(null==t?void 0:t.filterColor)?"transparent":e.colors.neutral[2],o=(null==t?void 0:t.filterColor)?"rgba(255, 255, 255, 0.65)":e.colors.blue[3],l=(null==t?void 0:t.filterColor)?"0 0 6px 1px rgba(255, 255, 255, 0.35)":"0 0 6px 1px ".concat(e.fn.rgba(e.colors.blue[5],.3)),i=(null==t?void 0:t.filterColor)?"0 0 0 1px rgba(255, 255, 255, 0.55), 0 0 12px 3px ".concat(e.fn.rgba(e.white,.3)):"0 0 0 1px ".concat(e.fn.rgba(e.colors.blue[4],.45),", 0 0 12px 4px ").concat(e.fn.rgba(e.colors.blue[5],.35));return{transition:"box-shadow 200ms ease, border-color 200ms ease","&:hover:not(:focus):not(:focus-visible)":{borderColor:r,boxShadow:l},"&:focus":{borderColor:o,outline:"none",boxShadow:i},"&:focus-visible":{borderColor:o,outline:"none",boxShadow:i}}},getCarePathDoctorListDefaultFilterWidthSx=e=>({width:"100%",[e.fn.largerThan("sm")]:{width:(0,d.h)(250),flexShrink:0}}),P={display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,width:(0,d.h)(32),height:(0,d.h)(32),borderRadius:9999,backgroundColor:C.t.neutral[0],overflow:"hidden",lineHeight:0},renderOptionIcon=e=>{if(!e)return null;if("string"==typeof e)return(0,o.tZ)(c.x,{sx:P,children:(0,o.tZ)(c.x,{component:"img",src:e,alt:"",sx:{width:(0,d.h)(20),height:(0,d.h)(20),objectFit:"contain"}})});if((0,l.isValidElement)(e)){var t;return(0,o.tZ)(c.x,{sx:P,children:(0,l.cloneElement)(e,{size:null!==(t=e.props.size)&&void 0!==t?t:20})})}return(0,o.tZ)(c.x,{sx:P,children:(0,o.tZ)(e,{size:20,color:"#111111"})})},D=(0,l.forwardRef)((e,t)=>{let{value:r,onChange:i,filterOpts:n,filterColor:h,filterIcon:g=w.Z,layout:m="default",placeholder:f,optionDataEventCategory:v,optionDataEventAction:x}=e,{formatMessage:b}=(0,p.Z)(),[P,D]=(0,l.useState)(!1),T=(0,s.rZ)(),L=(0,k.O)(()=>D(!1)),I="iconOnly"===m,B=null!==r&&"all"!==r,F=I&&B?"#111":h?"#fff":"#111",A=null!=f?f:b({id:"carePathDoctorList.placeholderSearchCity"}),E=(0,l.useMemo)(()=>{var e;return null===(e=n.find(e=>e.value===r))||void 0===e?void 0:e.label},[n,r]),M=E||A;return(0,l.useImperativeHandle)(t,()=>({openFilter:()=>D(!0)})),(0,o.BX)(c.x,{ref:L,sx:{position:"relative",userSelect:"none",width:I?"auto":"100%"},children:[(0,o.tZ)(u.k,{align:"center",justify:I?"center":"space-between",onClick:()=>D(e=>!e),sx:e=>({position:"relative",boxSizing:"border-box",padding:I?0:"0 ".concat((0,d.h)(12)),backgroundColor:"#fff",borderRadius:8,border:"1px solid ".concat(h?"transparent":e.colors.neutral[2]),cursor:"pointer",gap:8,...getCarePathDoctorListFilterInteractiveStyles(e,{filterColor:h}),...I?{width:(0,d.h)(48),height:(0,d.h)(48),flexShrink:0}:{width:"100%",height:(0,d.h)(48)},...h&&{backgroundColor:h,color:"#fff"},...I&&B&&{backgroundColor:"#E4E8EC"}}),"aria-label":I?M:void 0,children:I?(0,o.BX)(o.HY,{children:[(0,o.tZ)(g,{size:20,color:F}),B&&(0,o.tZ)(c.x,{"aria-hidden":!0,sx:{position:"absolute",top:(0,d.h)(6),right:(0,d.h)(6),width:(0,d.h)(8),height:(0,d.h)(8),borderRadius:"50%",backgroundColor:C.t.red[6],pointerEvents:"none"}})]}):(0,o.BX)(o.HY,{children:[(0,o.BX)(u.k,{gap:(0,d.h)(8),align:"center",children:[(0,o.tZ)(g,{size:24,color:F}),(0,o.tZ)(a.T,{size:"p2",variant:"primary",children:M})]}),(0,o.tZ)(S.Z,{size:24,color:h?"#fff":"#111"})]})}),(0,o.tZ)(c.x,{sx:{display:P?"block":"none",position:"absolute",top:"calc(100% + ".concat((0,d.h)(4),")"),right:I?0:void 0,zIndex:1,minWidth:250},children:(0,o.tZ)(c.x,{sx:e=>({width:"100%",background:"#fff",border:"1px solid ".concat(e.colors.gray[1]),borderRadius:8,padding:(0,d.h)(2),boxShadow:"0px 0px 1px 0px #0000000A, 0px 4px 8px 0px #0000000A, 0px 16px 24px 0px #0000000A, 0px 24px 32px 0px #0000000A"}),children:(0,o.tZ)(Z.x.Autosize,{mah:320,type:"auto",scrollbarSize:8,sx:{thumb:{backgroundColor:T.colors.gray[2]}},children:n.map((e,t)=>{let l=e.value===r;return(0,o.BX)(u.k,{justify:"space-between",...v&&x?{"data-event-category":v,"data-event-action":x,"data-event-label":e.label}:{},sx:t=>({padding:e.icon?8:"".concat((0,d.h)(8)," ").concat((0,d.h)(16)),"&:hover":{background:t.colors.gray[1]},...l?{"&,&:hover":{backgroundColor:"#d5f1f1"}}:{cursor:"pointer"}}),onClick:()=>{i(e.value),D(!1)},children:[(0,o.BX)(u.k,{align:"center",gap:(0,d.h)(8),sx:{minWidth:0},children:[renderOptionIcon(e.icon),(0,o.tZ)(a.T,{size:"p2",children:e.label})]}),l&&(0,o.tZ)(y.Z,{size:18,color:T.colors.blue[6]})]},String(t))})})})})]})}),getDoctorHospital=e=>{if("hospital"in e)return e.hospital},getDoctorCityId=e=>{var t;let r=null===(t=getDoctorHospital(e))||void 0===t?void 0:t.cityId;return null==r?null:String(r)},getDoctorCityName=e=>{var t;let r=null===(t=getDoctorHospital(e))||void 0===t?void 0:t.cityName.trim();return r||null},groupDoctorsByCityId=e=>{let t=new Map;return e.forEach(e=>{let r=getDoctorCityId(e);if(!r)return;let o=getDoctorCityName(e),l=t.get(r);if(l){l.doctors.push(e),!l.group.name&&o&&(l.group.name=o);return}t.set(r,{group:{id:r,name:o||r},doctors:[e]})}),Array.from(t.values())},filterCarePathDoctorListByCity=(e,t)=>{let r=null===t||"all"===t;if(r)return e;let o=groupDoctorsByCityId(e);return o.filter(e=>e.group.id===t).reduce((e,t)=>e.concat(t.doctors),[])},T=(0,l.memo)((0,l.forwardRef)((e,t)=>{let{listingAll:r,selectedFilterId:i,filterColor:a,onFilterChange:n}=e,{formatMessage:s}=(0,p.Z)(),c=(0,f.d)(),d=(0,l.useRef)(null),[h,u]=(0,l.useState)(null!=i?i:null);(0,l.useEffect)(()=>{u(null!=i?i:null)},[i]);let g=(0,l.useMemo)(()=>groupDoctorsByCityId(r),[r]);(0,l.useImperativeHandle)(t,()=>({setDoctorsSelectedFilterId:e=>u(e),openFilter:()=>{var e;return null===(e=d.current)||void 0===e?void 0:e.openFilter()}})),(0,l.useEffect)(()=>{let e=null===h||"all"===h;n({filterValue:h,isAllCitiesSelected:e})},[h,n]);let m=(0,l.useMemo)(()=>[{label:s({id:"keyword.all"}),value:"all"},...g.map(e=>({label:e.group.name,value:e.group.id}))],[s,g]);return m.length<=1?null:(0,o.tZ)(D,{ref:d,value:h,onChange:u,filterOpts:m,filterColor:a,filterIcon:b.Z,layout:c?"iconOnly":"default",optionDataEventCategory:"Service Connection",optionDataEventAction:"Filter Location Click"})}));var L=r("FNss"),I=r("q9DY"),B=r("lSJj"),F=r("c9pU");let normalizeForSearch=e=>(0,F.T)(e).replace(/-/g," ").replace(/\s+/g," ").trim(),textIncludesKeyword=(e,t)=>null!=e&&!!e.trim()&&!!t&&normalizeForSearch(e).includes(t),itemMatchesKeyword=(e,t)=>{var r;if("name"in e&&textIncludesKeyword(e.name,t))return!0;if("hospital"in e&&e.hospital){let r=e.hospital,o="object"==typeof r&&"name"in r?r.name:"string"==typeof r?r:"";if(textIncludesKeyword(o,t))return!0}return!!("specialtiesTransform"in e&&(null===(r=e.specialtiesTransform)||void 0===r?void 0:r.some(e=>textIncludesKeyword(e.slug,t))))},filterCarePathDoctorListByKeyword=(e,t)=>{let r=normalizeForSearch(t);return r?e.filter(e=>itemMatchesKeyword(e,r)):e},A=(0,l.memo)(e=>{let{value:t,onChange:r,className:l,filterColor:i}=e,{formatMessage:a}=(0,p.Z)(),n=(0,s.rZ)(),c=t.trim().length>0,h=i?"#fff":"#111",u=i?"transparent":n.colors.neutral[2];return(0,o.tZ)(L.I,{className:l,value:t,onChange:r,placeholder:a({id:"carePathDoctorList.placeholderSearchDoctor"}),icon:(0,o.tZ)(w.Z,{size:20,color:h}),rightSection:c?(0,o.tZ)(B.k,{type:"button",onClick:()=>r(""),"aria-label":a({id:"carePathDoctorList.search.clear",defaultMessage:"X\xf3a từ kh\xf3a"}),sx:{display:"flex",alignItems:"center",justifyContent:"center",width:(0,d.h)(28),height:(0,d.h)(28)},children:(0,o.tZ)(I.Z,{size:16,color:h})}):void 0,rightSectionWidth:c?(0,d.h)(36):void 0,sx:{width:"100%"},styles:{rightSection:{pointerEvents:"auto"},input:{boxSizing:"border-box",padding:"0 ".concat((0,d.h)(12)),paddingLeft:(0,d.h)(36),...c&&{paddingRight:(0,d.h)(36)},backgroundColor:i||"#fff",borderRadius:8,border:"1px solid ".concat(u),height:"".concat((0,d.h)(48)," !important"),color:i?"#fff":"#111",fontSize:(0,d.h)(15),lineHeight:(0,d.h)(24),outline:"none","&::placeholder":{color:i?"#fff":"#8c8c8c"},...getCarePathDoctorListFilterInteractiveStyles(n,{filterColor:i})}}})});var E=r("YgWB"),M=r("oDhC");let isCareDoctor=e=>"specialtiesTransform"in e,groupDoctorsBySpecialtyId=e=>{let t=new Map;return e.forEach(e=>{var r;isCareDoctor(e)&&(null===(r=e.specialtiesTransform)||void 0===r||r.forEach(r=>{let o=r.id?String(r.id):"";if(!o)return;let l=t.get(o),i=r.name||r.slug||"";if(l){l.doctors.some(t=>t.id===e.id)||l.doctors.push(e),l.group.name||(l.group.name=i);return}t.set(o,{group:{id:o,name:i,thumbnail:r.thumbnail},doctors:[e]})}))}),Array.from(t.values())},doctorMatchesSpecialty=(e,t)=>{var r,o;return!!isCareDoctor(e)&&null!==(o=null===(r=e.specialtiesTransform)||void 0===r?void 0:r.some(e=>String(e.id)===t))&&void 0!==o&&o},filterCarePathDoctorListBySpecialty=(e,t)=>{let r=null===t||"all"===t;return r?e:e.filter(e=>doctorMatchesSpecialty(e,t))},N=(0,l.memo)((0,l.forwardRef)((e,t)=>{let{listingAll:r,selectedFilterId:i,filterColor:a,onFilterChange:n}=e,{formatMessage:s}=(0,p.Z)(),c=(0,l.useRef)(null),[d,h]=(0,l.useState)(null!=i?i:null);(0,l.useEffect)(()=>{h(null!=i?i:null)},[i]);let u=(0,l.useMemo)(()=>groupDoctorsBySpecialtyId(r),[r]);(0,l.useImperativeHandle)(t,()=>({setSpecialtySelectedFilterId:e=>h(e),openFilter:()=>{var e;return null===(e=c.current)||void 0===e?void 0:e.openFilter()}})),(0,l.useEffect)(()=>{let e=null===d||"all"===d;n({filterValue:d,isAllSpecialtiesSelected:e})},[d,n]);let g=(0,l.useMemo)(()=>[{label:s({id:"keyword.all"}),value:"all",icon:(0,o.tZ)(E.Z,{color:C.t.neutral[5]})},...u.map(e=>({label:e.group.name,value:e.group.id,icon:e.group.thumbnail}))],[s,u]);return g.length<=1?null:(0,o.tZ)(D,{ref:c,value:d,onChange:h,filterOpts:g,filterColor:a,layout:"iconOnly",filterIcon:M.Z,optionDataEventCategory:"Service Connection",optionDataEventAction:"Filter Specialty Click"})})),applyCarePathDoctorListFilters=(e,t)=>{let{keyword:r,cityFilterId:o,specialtyFilterId:l}=t,i=filterCarePathDoctorListByKeyword(e,r),a=filterCarePathDoctorListByCity(i,o);return filterCarePathDoctorListBySpecialty(a,l)},Circle=e=>{let{color:t,...r}=e;return(0,o.tZ)("svg",{width:"327",height:"168",viewBox:"0 0 327 168",fill:"none",...r,children:(0,o.tZ)("path",{d:"M127 168C237.457 168 327 78.4569 327 -32C327 -142.457 237.457 -232 127 -232C16.5431 -232 -73 -142.457 -73 -32C-73 78.4569 16.5431 168 127 168Z",fill:t})})};var R=r("g8xC"),z=r("nnl3"),W=r("sEfC"),X=r.n(W),O=r("raAP");let pushCarePathDoctorListSearchResultsEvent=(e,t)=>{let r=e.trim();r&&(window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"view_search_results",event_category:"Service Connection",event_action:"Search - Care Booking",event_label:t,search_term:r}))},isCarePathDoctorListFilterActive=e=>null!==e&&"all"!==e,getCarePathDoctorListCityFilterLabel=(e,t)=>{if(!isCarePathDoctorListFilterActive(t))return null;for(let i of e){var r,o,l;if(!("hospital"in i))continue;let e=null===(r=i.hospital)||void 0===r?void 0:r.cityId;if(null==e||String(e)!==t)continue;let a=null===(l=i.hospital)||void 0===l?void 0:null===(o=l.cityName)||void 0===o?void 0:o.trim();return a||t}return t},getCarePathDoctorListSpecialtyFilterLabel=(e,t)=>{if(!isCarePathDoctorListFilterActive(t))return null;for(let o of e){var r;if(!("specialtiesTransform"in o))continue;let e=null===(r=o.specialtiesTransform)||void 0===r?void 0:r.find(e=>String(e.id)===t);if(e)return e.name||e.slug||t}return t},buildCarePathDoctorListResetEventLabel=e=>{let{searchKeyword:t,cityFilterId:r,specialtyFilterId:o,listingAll:l}=e,i=[],a=t.trim();a&&i.push(a);let n=getCarePathDoctorListCityFilterLabel(l,r);n&&i.push(n);let s=getCarePathDoctorListSpecialtyFilterLabel(l,o);return s&&i.push(s),i.join("^")},hasCarePathDoctorListActiveFilters=e=>{let{searchKeyword:t,cityFilterId:r,specialtyFilterId:o}=e;return!!t.trim()||isCarePathDoctorListFilterActive(r)||isCarePathDoctorListFilterActive(o)},H=(0,l.memo)(e=>{let{onClick:t,eventLabel:r,disabled:l=!1}=e,{formatMessage:i}=(0,p.Z)();return(0,o.tZ)(R.B,{variant:"secondary",color:"#fff",onClick:t,disabled:l,leftIcon:(0,o.tZ)(z.Z,{size:24,color:"currentColor"}),"data-event-category":"Service Connection","data-event-action":"Reset search and filter click","data-event-label":r,sx:e=>({fontWeight:"normal",flexShrink:0,borderColor:"transparent",height:"".concat((0,d.h)(48)," !important"),fontSize:(0,d.h)(15),lineHeight:(0,d.h)(24),letterSpacing:(0,d.h)(-.3),"&:hover":{backgroundColor:"transparent",borderColor:"transparent"},"&[data-disabled]":{backgroundColor:"transparent",color:"#fff"},[e.fn.smallerThan("sm")]:{paddingRight:0},[e.fn.largerThan("sm")]:{"&:not([data-disabled])":{"&:hover":{backgroundColor:"transparent",borderColor:"#fff"}}}}),children:i({id:"reset.title",defaultMessage:"Đặt lại"})})}),keywordSearchWrapperSx=e=>({flex:1,minWidth:0,[e.fn.largerThan("sm")]:{flex:"unset",width:(0,d.h)(250),flexShrink:0}}),doctorsFilterWrapperSx=e=>({flexShrink:0,[e.fn.largerThan("sm")]:{width:(0,d.h)(250)}}),doctorListFilterBarSx=e=>({gap:(0,d.h)(8),flexDirection:"column",alignItems:"stretch",width:"100%",[e.fn.largerThan("sm")]:{flexDirection:"row",alignItems:"center",justifyContent:"flex-end",width:"auto"}}),doctorListFilterRowSx=e=>({gap:(0,d.h)(8),flexDirection:"row",alignItems:"center",flexWrap:"nowrap",width:"100%",[e.fn.largerThan("sm")]:{width:"auto"}}),_=(0,l.memo)(e=>{let{listingAll:t,searchKeyword:r,cityFilterId:i,specialtyFilterId:a,filterColor:n,doctorsFilterRef:d,specialtiesFilterRef:h,onSearchKeywordChange:p,onDoctorsFilterChange:g,onSpecialtiesFilterChange:m,onResetFilters:f,showResetButton:v=!0}=e,x=(0,s.rZ)(),b=(0,O.U)(),C=(0,l.useMemo)(()=>X()((e,t)=>{pushCarePathDoctorListSearchResultsEvent(e,t)},300),[]);(0,l.useEffect)(()=>()=>{C.cancel()},[C]),(0,l.useEffect)(()=>{let e=r.trim();if(!e){C.cancel();return}C(e,b)},[r,b,C]);let y=(0,l.useMemo)(()=>buildCarePathDoctorListResetEventLabel({searchKeyword:r,cityFilterId:i,specialtyFilterId:a,listingAll:t}),[r,i,a,t]),w=(0,l.useMemo)(()=>!hasCarePathDoctorListActiveFilters({searchKeyword:r,cityFilterId:i,specialtyFilterId:a}),[r,i,a]);return(0,o.BX)(u.k,{sx:doctorListFilterBarSx(x),children:[(0,o.BX)(u.k,{sx:doctorListFilterRowSx(x),children:[(0,o.tZ)(c.x,{sx:keywordSearchWrapperSx(x),children:(0,o.tZ)(A,{value:r,onChange:p,filterColor:n})}),(0,o.tZ)(c.x,{sx:doctorsFilterWrapperSx(x),children:(0,o.tZ)(T,{ref:d,listingAll:t,selectedFilterId:i,filterColor:n,onFilterChange:g})}),(0,o.tZ)(c.x,{sx:{flexShrink:0},children:(0,o.tZ)(N,{ref:h,listingAll:t,selectedFilterId:a,filterColor:n,onFilterChange:m})})]}),v&&(0,o.tZ)(H,{onClick:f,eventLabel:y,disabled:w})]})});var K=r("owZr");let isSameCardItem=(e,t)=>e.id===t.id&&e.avatar===t.avatar&&e.name===t.name&&e.rating===t.rating&&e.price===t.price&&e.hospital===t.hospital&&e.hospitalLogo===t.hospitalLogo,buildStableDoctorSlides=(e,t,r,o)=>{if(!e.length)return o.current.clear(),[];let l=new Set,i=e.map(e=>{let i=r(e,t),a=String(i.id);l.add(a);let n=o.current.get(a),s=n&&isSameCardItem(n,i)?n:i;return o.current.set(a,s),{id:a,item:s}});return o.current.forEach((e,t)=>{l.has(t)||o.current.delete(t)}),i};var j=r("0D4Z");let DoctorCardSkeleton=e=>{let{display:t,className:r,...l}=e,i=(0,s.rZ)(),a={display:"flex",flexDirection:"column",flex:1,height:"100%",minHeight:"vertical"===t?(0,d.h)(280):(0,d.h)(200),backgroundColor:i.white,borderRadius:(0,d.h)(16),overflow:"hidden",boxShadow:"0px 0px 1px 0px rgba(0, 0, 0, 0.06), 0px 2px 8px 0px rgba(0, 0, 0, 0.08)"},n={marginTop:"auto",flexShrink:0,padding:"vertical"===t?"".concat((0,d.h)(8)," ").concat((0,d.h)(16)):(0,d.h)(16),backgroundColor:i.colors.neutral[0]},p=(0,o.BX)(o.HY,{children:[(0,o.BX)(u.k,{align:"flex-start",gap:"vertical"===t?(0,d.h)(12):(0,d.h)(4),children:[(0,o.tZ)(j.O,{height:64,circle:!0,sx:{flexShrink:0}}),(0,o.BX)(h.K,{spacing:(0,d.h)(8),sx:{flex:1,minWidth:0},children:[(0,o.tZ)(j.O,{height:(0,d.h)(18),width:"85%",radius:"sm"}),(0,o.tZ)(j.O,{height:(0,d.h)(12),width:"100%",radius:"sm"}),(0,o.tZ)(j.O,{height:(0,d.h)(12),width:"70%",radius:"sm"})]})]}),(0,o.BX)(u.k,{gap:(0,d.h)(4),wrap:"wrap",children:[(0,o.tZ)(j.O,{height:(0,d.h)(26),width:(0,d.h)(120),radius:(0,d.h)(34)}),(0,o.tZ)(j.O,{height:(0,d.h)(26),width:(0,d.h)(120),radius:(0,d.h)(34)})]}),(0,o.tZ)(j.O,{height:(0,d.h)(14),width:"55%",radius:"sm"})]}),g=(0,o.BX)(u.k,{align:"center",gap:(0,d.h)(12),sx:{flex:1,minWidth:0},children:[(0,o.tZ)(j.O,{height:40,circle:!0,sx:{flexShrink:0}}),(0,o.BX)(h.K,{spacing:(0,d.h)(4),sx:{flex:1,minWidth:0},children:[(0,o.tZ)(j.O,{height:(0,d.h)(14),width:"75%",radius:"sm"}),(0,o.tZ)(j.O,{height:(0,d.h)(12),width:"95%",radius:"sm"})]})]});return"vertical"===t?(0,o.BX)(c.x,{className:r,sx:a,...l,children:[(0,o.tZ)(h.K,{spacing:(0,d.h)(12),sx:{padding:(0,d.h)(16)},children:p}),(0,o.tZ)(c.x,{sx:n,children:(0,o.BX)(h.K,{spacing:(0,d.h)(12),children:[g,(0,o.tZ)(j.O,{height:(0,d.h)(40),radius:"md"})]})})]}):(0,o.BX)(c.x,{className:r,sx:a,...l,children:[(0,o.tZ)(h.K,{spacing:(0,d.h)(4),sx:{padding:(0,d.h)(16)},children:p}),(0,o.BX)(u.k,{sx:n,align:"center",gap:(0,d.h)(16),children:[g,(0,o.tZ)(j.O,{height:(0,d.h)(36),width:(0,d.h)(140),radius:"md",sx:{flexShrink:0}})]})]})};var V=r("rPIz"),G=r("GqLv"),Y=r("CJtR"),U=r("/npG"),q=(0,U.k)((e,t)=>{let{display:r}=t;return{root:{display:"flex",flex:1,background:"white",borderRadius:(0,d.h)(16),boxShadow:"0px 0px 1px 0px rgba(0, 0, 0, 0.06), 0px 2px 8px 0px rgba(0, 0, 0, 0.08)",overflow:"hidden",flexDirection:"column",alignItems:"stretch",..."vertical"===r&&{justifyContent:"space-between",gap:(0,d.h)(0)}},verticalInner:{width:"100%",flex:1,display:"flex",flexDirection:"column"},verticalTop:{padding:(0,d.h)(16),flex:1},verticalFooter:{marginTop:"auto",flexShrink:0,padding:"".concat((0,d.h)(8)," ").concat((0,d.h)(16)),backgroundColor:e.colors.neutral[0],transition:"background-color 0.2s ease","&:has(button:hover, a:hover)":{backgroundColor:e.colors.blue[0]}},horizonInner:{width:"100%",flex:1,display:"flex",flexDirection:"column"},horizonTop:{padding:(0,d.h)(16),flex:1},horizonFooter:{marginTop:"auto",flexShrink:0,padding:(0,d.h)(16),backgroundColor:e.colors.neutral[0],transition:"background-color 0.2s ease","&:has(button:hover, a:hover)":{backgroundColor:e.colors.blue[0]}},btn:{..."vertical"===r?{width:"100%"}:{flexShrink:0}}}}),Q=r("Gi6Z"),J=r("S3OL"),$=(0,U.k)(e=>({doctorAvatar:{width:(0,d.h)(64),height:(0,d.h)(64),borderRadius:"50%",overflow:"hidden",backgroundColor:e.colors.gray[1]},doctorAvatarImg:{width:"100%",height:"100%",objectFit:"cover",display:"block"},doctorAvatarWrapOverlay:{position:"relative",paddingBottom:(0,d.h)(10)},ratingPill:{gap:(0,d.h)(4),align:"center",backgroundColor:e.colors.yellow[0],borderRadius:(0,d.h)(32),padding:"".concat((0,d.h)(3)," ").concat((0,d.h)(10))},ratingPillOverlay:{position:"absolute",left:"50%",bottom:0,transform:"translate(-50%, 0)",flexShrink:0,whiteSpace:"nowrap"},hospitalAvatarWrap:{width:(0,d.h)(40),height:(0,d.h)(40),flexShrink:0,borderRadius:"50%",border:"1px solid ".concat(e.colors.neutral[1]),overflow:"hidden",backgroundColor:e.colors.gray[1],backgroundSize:"cover",backgroundPosition:"center",backgroundRepeat:"no-repeat"}}));let ee=(0,l.memo)(function(e){let{rating:t,className:r,sx:l}=e,i=(0,s.rZ)(),{classes:n,cx:c}=$(),d=Math.floor(Number(t));return d<=0?null:(0,o.BX)(u.k,{className:c(n.ratingPill,r),sx:l,children:[(0,o.tZ)(Q.Z,{size:16,color:i.colors.yellow[8]}),(0,o.BX)(a.T,{size:"s5",weight:"semiBold",children:[parseFloat(t),"/5"]})]})}),et=(0,l.memo)(function(e){let{src:t,alt:r,hrefProps:l,rating:i,ratingPlacement:a="inline",className:n,...s}=e,{classes:d}=$(),h=(0,o.tZ)(c.x,{className:d.doctorAvatar,children:(0,o.tZ)(J.R,{src:t,alt:r,width:100,height:100,loading:"lazy",style:{width:"100%",height:"100%",objectFit:"cover"}})}),u="overlay"===a?(0,o.BX)(c.x,{className:d.doctorAvatarWrapOverlay,children:[h,i&&(0,o.tZ)(ee,{rating:i,className:d.ratingPillOverlay})]}):h;return l?(0,o.tZ)("a",{...l,style:{flexShrink:0,...l.style},children:u}):(0,o.tZ)(c.x,{className:n,sx:{flexShrink:0},...s,children:u})}),er=(0,l.memo)(function(e){let{name:t,hrefProps:r}=e,l=(0,o.tZ)(a.T,{size:"title2",weight:"semiBold",variant:"primary",lineClamp:3,children:t}),i=r?(0,o.tZ)("a",{...r,children:l}):l;return i}),eo=(0,l.memo)(function(e){let{text:t}=e;return t?(0,o.tZ)(a.T,{size:"n1",color:"gray.6",lineClamp:3,children:t}):null}),el=(0,l.memo)(function(e){let{cityName:t}=e;return t?(0,o.BX)(u.k,{align:"center",gap:4,children:[(0,o.tZ)(c.x,{children:(0,o.tZ)("img",{src:"/svg/location-outline.svg",loading:"lazy",style:{width:16,display:"block"},alt:""})}),(0,o.tZ)(a.T,{size:"n1",color:"gray.6",children:t})]}):null}),ei=(0,l.memo)(function(e){let{hospital:t,hospitalLogo:r,hospitalAddress:l,addressLineClamp:i=2}=e,{classes:n}=$();return t||l||r?(0,o.BX)(u.k,{align:"center",gap:12,sx:{flex:1,minWidth:0},children:[r&&(0,o.tZ)(c.x,{className:n.hospitalAvatarWrap,children:(0,o.tZ)(J.R,{src:r,alt:t||"Hospital logo",width:100,height:100,loading:"lazy",style:{width:"100%",height:"100%",objectFit:"contain"}})}),(0,o.BX)(c.x,{sx:{flex:1,minWidth:0},children:[t&&(0,o.tZ)(a.T,{size:"p3",weight:"semiBold",variant:"primary",lineClamp:1,children:t}),l&&(0,o.tZ)(a.T,{size:"c1",color:"gray.6",lineClamp:i,children:l})]})]}):null},(e,t)=>e.hospital===t.hospital&&e.hospitalLogo===t.hospitalLogo&&e.hospitalAddress===t.hospitalAddress&&e.addressLineClamp===t.addressLineClamp),ea=(0,l.memo)(function(e){let{variant:t,footerClassName:r,hospital:l,hospitalLogo:i,hospitalAddress:a,button:n,...s}=e,c=(0,o.tZ)(ei,{hospital:l,hospitalLogo:i,hospitalAddress:a,addressLineClamp:"vertical"===t?2:1});return"vertical"===t?(0,o.BX)(h.K,{className:r,spacing:(0,d.h)(12),children:[c,n]}):(0,o.BX)(u.k,{className:r,align:"center",gap:(0,d.h)(16),...s,children:[c,n]})});var en=r("Iblh"),es=r("IDes");let ec=(0,U.k)(e=>({root:{},popoperDropdown:{padding:(0,d.h)(8),border:0,backgroundColor:e.colors.gray[8]},popoperArrow:{backgroundColor:e.colors.gray[8],borderColor:e.colors.gray[8]},text:{color:"#fff"},email:{color:e.colors.blue[3]}})),PromotionTag=e=>{var t,r,l,i;let{label:n,color:s="blue",textColor:h,styles:u,className:g,classNames:m,hasTooltip:v}=e,{formatMessage:x}=(0,p.Z)(),b=(0,f.d)(),[C,{close:y,open:w}]=(0,en.q)(!1),{classes:S,theme:Z,cx:k}=ec(void 0,{name:"PromotionTag",styles:u,classNames:m}),P=h||(null===(r=Z.colors)||void 0===r?void 0:null===(t=r[s])||void 0===t?void 0:t[6]),D=(0,o.tZ)(c.x,{className:k(S.root,g),sx:{background:s.startsWith("#")?s:null===(i=Z.colors)||void 0===i?void 0:null===(l=i[s])||void 0===l?void 0:l[0],borderRadius:(0,d.h)(4),padding:"5px 12px 5px 4px"},children:(0,o.BX)(a.T,{size:"p4",color:P,sx:{display:"flex",gap:(0,d.h)(4),".icon":{marginTop:(0,d.h)(2)}},children:[(0,o.tZ)(es.Z,{size:16,color:P,className:"icon"}),(0,o.tZ)("span",{children:n})]})});return!b&&(b||v)?(0,o.BX)(L.o,{withArrow:!0,shadow:"md",opened:C,width:300,classNames:{dropdown:S.popoperDropdown,arrow:S.popoperArrow},children:[(0,o.tZ)(L.o.Target,{children:(0,o.tZ)(c.x,{onMouseEnter:w,onMouseLeave:y,sx:{cursor:"pointer"},children:D})}),(0,o.tZ)(L.o.Dropdown,{onMouseEnter:w,onMouseLeave:y,children:(0,o.tZ)(a.T,{size:"p4",className:S.text,children:x({id:"doctorCard.promotionTag.popoverContent",defaultMessage:"Vui l\xf2ng li\xean hệ hotline 02871096118 hoặc email {email} để nhận ngay voucher ưu đ\xe3i."},{email:(0,o.tZ)(c.x,{component:"a",className:S.email,href:"mailto:Hotro@hellobacsi.com",children:"Hotro@hellobacsi.com"})})})})]}):D};var ed=r("zwQ/"),eh=r("xGJE");let tag_Tag=e=>{let{title:t,colorShade:r,icon:i}=e,n=(0,s.rZ)(),c=(0,l.useMemo)(()=>r.split(".")[0],[]),h=(0,l.useMemo)(()=>Number(r.split(".")[1]),[]);return(0,o.BX)(u.k,{align:"center",gap:(0,d.h)(4),sx:()=>({border:"1px solid ".concat(n.colors[c][h]),backgroundColor:n.colors[c][h-1],borderRadius:(0,d.h)(34),padding:" ".concat((0,d.h)(3)," ").concat((0,d.h)(12)," ").concat((0,d.h)(3)," ").concat((0,d.h)(8))}),children:[l.cloneElement(i,{size:16,color:n.colors[c][9]}),(0,o.tZ)(a.T,{size:"n1",children:t})]})},Tags=e=>{let{hasOutpatient:t,hasTelemedicine:r,...l}=e,{formatMessage:i}=(0,p.Z)();return t||r?(0,o.BX)(u.k,{wrap:"wrap",gap:(0,d.h)(4),...l,children:[t&&(0,o.tZ)(tag_Tag,{title:i({id:"carePathEmbedDoctor.outPatient",defaultMessage:"Out patient"}),icon:(0,o.tZ)(ed.Z,{}),colorShade:"blue.1"}),r&&(0,o.tZ)(tag_Tag,{title:i({id:"carePathEmbedDoctor.telemedicine",defaultMessage:"Telemedicine"}),icon:(0,o.tZ)(eh.Z,{}),colorShade:"orange.1"})]}):null},eu=(0,l.memo)(e=>{let{item:t,className:r,classNames:i,display:n="vertical",styles:s,isService:g,showConfirmCityPopup:f=!1,onCancel:b,showPromotionEvent:C,campaign:y={name:"",source:""},...w}=e,{name:S,validOutpatient:Z,validTelemedicine:k,rating:P,slug:D,id:T,cityName:L,doctorWebsite:I,avatar:B,doctorSpecialties:F=[],hospital:A,hospitalLogo:E,hospitalAddress:M}=t,{formatMessage:N}=(0,p.Z)(),{locale:z}=(0,v.h)(),{classes:W,cx:X}=q({display:n},{name:"DoctorCard",classNames:i,styles:s}),[O,H]=(0,l.useState)(null),_=(0,l.useMemo)(()=>F.map(e=>"string"==typeof e?e:e.name).filter(Boolean).join(", "),[F]),K=(0,l.useMemo)(()=>g?N({id:"articlePage.careEmbedding.bookService"}):N({id:"articleAuthor.button",defaultMessage:"Book now"}),[N,g]),j=(0,l.useMemo)(()=>{var e;let t="".concat((0,Y.UC)(z),"/care/").concat(null===(e=x.a8[z])||void 0===e?void 0:e[g?"SERVICE":"DOCTOR"],"/").concat(D,"-").concat(T,"/"),r=I||t;try{let e=new URL(r,(0,Y.UC)(z));return y.name&&e.searchParams.set("utm_campaign",y.name),y.source&&e.searchParams.set("utm_source",y.source),e.toString()}catch(e){return t}},[I,z,g,D,T,y.name,y.source]),U=(0,l.useMemo)(()=>({"data-event-category":"Service Connection","data-event-action":"Book Doctor","data-event-label":I||"https://".concat(m.domainLocales[z]).concat(j)}),[I,z,j]),Q=(0,l.useCallback)(e=>{if(f){e.preventDefault(),H({cityName:L,url:j});return}e.currentTarget instanceof HTMLAnchorElement||window.open(j,"_blank","noopener,noreferrer")},[f,L,j]),J=(0,l.useMemo)(()=>({href:j,target:"_blank",style:{display:"block",borderRadius:"inherit"},className:"pointer-event-child-none",onClick:Q,...U}),[j,Q,U]),$=(0,l.useMemo)(()=>f?(0,o.tZ)(R.B,{h:36,size:"md",className:W.btn,onClick:Q,...U,children:K}):(0,o.tZ)(R.B,{h:36,size:"md",className:W.btn,...{component:"a",href:j,target:"_blank",rel:"noopener noreferrer",onClick:Q,...U},children:K}),[W.btn,Q,U,K,f,j]),ei=(0,l.useMemo)(()=>C?(0,o.BX)(h.K,{spacing:(0,d.h)(4),align:"flex-start",children:[(0,o.tZ)(PromotionTag,{color:"yellow",textColor:"yellow.9",hasTooltip:!0,label:(0,o.tZ)(o.HY,{children:N({id:"doctorCard.promotionTag.canUseVoucher",defaultMessage:"C\xf3 thể \xe1p dụng voucher"})})}),(0,o.tZ)(PromotionTag,{color:"#FDF1F6",textColor:"#A50064",label:(0,o.tZ)(o.HY,{children:N({id:"doctorCard.promotionTag.discount",defaultMessage:"Thẻ qu\xe0 tặng giảm th\xeam {price}"},{price:(0,o.tZ)("strong",{children:"100.000 đ"})})})}),(0,o.tZ)(PromotionTag,{color:"#FDF1F6",textColor:"#A50064",label:(0,o.tZ)(o.HY,{children:N({id:"doctorCard.promotionTag.discount1",defaultMessage:"Cơ hội nhận qu\xe0 trị gi\xe1 {price}"},{price:(0,o.tZ)("strong",{children:"300.000 đ"})})})})]}):null,[C,N]),en=(0,l.useMemo)(()=>(0,o.tZ)(Tags,{hasOutpatient:Z,hasTelemedicine:k}),[Z,k]),es=(0,l.useMemo)(()=>(0,o.tZ)(ea,{variant:n,footerClassName:"vertical"===n?W.verticalFooter:W.horizonFooter,hospital:A,hospitalLogo:E,hospitalAddress:M,button:$}),[n,W.verticalFooter,W.horizonFooter,A,E,M,$]);return(0,o.BX)(o.HY,{children:[(0,o.tZ)(c.x,{className:X(W.root,r),...w,children:"vertical"===n?(0,o.BX)(h.K,{spacing:0,className:W.verticalInner,children:[(0,o.BX)(h.K,{className:W.verticalTop,spacing:(0,d.h)(12),children:[(0,o.BX)(u.k,{align:"flex-start",gap:12,children:[(0,o.tZ)(et,{src:B,alt:S,hrefProps:J,rating:P,ratingPlacement:"overlay"}),(0,o.BX)(c.x,{sx:{flex:1,minWidth:0},children:[(0,o.tZ)(er,{name:S,hrefProps:J}),(0,o.tZ)(eo,{text:_})]})]}),en,(0,o.tZ)(el,{cityName:L}),ei]}),es]}):(0,o.BX)(h.K,{spacing:12,className:W.horizonInner,children:[(0,o.BX)(h.K,{className:W.horizonTop,spacing:4,children:[(0,o.BX)(u.k,{align:g?"center":"flex-start",gap:12,children:[(0,o.tZ)(et,{src:B,alt:S,hrefProps:J}),(0,o.BX)(h.K,{spacing:4,sx:{flex:1,minWidth:0,minHeight:64,justifyContent:"center"},children:[(0,o.BX)(u.k,{align:g?"center":"flex-start",justify:"space-between",gap:(0,d.h)(8),children:[(0,o.tZ)(er,{name:S,hrefProps:J}),(0,o.tZ)(ee,{rating:P,sx:{flexShrink:0}})]}),(0,o.tZ)(eo,{text:_}),en,(0,o.tZ)(el,{cityName:L})]})]}),ei]}),es]})}),f&&O&&(0,o.tZ)(G.M,{size:(0,d.h)(408),target:x.Hh,opened:!!O,withCloseButton:!0,styles:e=>({header:{position:"absolute",right:0,top:0,border:0,paddingLeft:0},body:{padding:0},heading:{[e.fn.smallerThan("sm")]:{}}}),onClose:()=>H(null),children:(0,o.BX)(h.K,{sx:e=>({padding:(0,d.h)(16),gap:(0,d.h)(16),[e.fn.largerThan("sm")]:{padding:(0,d.h)(32),gap:(0,d.h)(32)}}),children:[(0,o.BX)(h.K,{spacing:8,sx:{textAlign:"center"},children:[(0,o.tZ)(V.H,{tag:"h4",children:N({id:"doctorCard.confirmCityPopup.heading"})}),(0,o.tZ)(a.T,{size:"p2",children:N({id:"doctorCard.confirmCityPopup.content"},{location:(0,o.tZ)("strong",{children:null==O?void 0:O.cityName})})})]}),(0,o.BX)(u.k,{gap:12,sx:{button:{flex:1}},children:[(0,o.tZ)(R.B,{variant:"tertiary",onClick:()=>{H(null),null==b||b()},children:N({id:"carePathDoctorList.confirmLocModal.cancel"})}),(0,o.tZ)(R.B,{onClick:()=>{(null==O?void 0:O.url)&&window.open(null==O?void 0:O.url),H(null)},children:N({id:"confirm"})})]})]})})]})},(e,t)=>{var r,o,l,i;return e.item.id===t.item.id&&e.item.avatar===t.item.avatar&&e.item.name===t.item.name&&e.item.rating===t.item.rating&&e.item.price===t.item.price&&e.item.hospital===t.item.hospital&&e.item.hospitalLogo===t.item.hospitalLogo&&e.display===t.display&&e.isService===t.isService&&e.hidePrice===t.hidePrice&&e.showConfirmCityPopup===t.showConfirmCityPopup&&e.showPromotionEvent===t.showPromotionEvent&&(null===(r=e.campaign)||void 0===r?void 0:r.name)===(null===(o=t.campaign)||void 0===o?void 0:o.name)&&(null===(l=e.campaign)||void 0===l?void 0:l.source)===(null===(i=t.campaign)||void 0===i?void 0:i.source)}),carePathDoctorListActionBtnSx=e=>({width:e?"100%":"auto"}),CarePathDoctorListActionButton=e=>{let{fullWidth:t=!1,sx:r,children:l,...i}=e;return(0,o.tZ)(R.B,{h:48,size:"lg",fullWidth:t,variant:"white",sx:{...carePathDoctorListActionBtnSx(t),...r},...i,children:l})},ExpandCollapseBtn=e=>{let{isExpanded:t,fullWidth:r=!0,onClick:l}=e,{formatMessage:i}=(0,p.Z)();return(0,o.tZ)(CarePathDoctorListActionButton,{fullWidth:r,onClick:l,variant:"secondary",color:"#fff",sx:{"&:hover":{backgroundColor:"transparent"}},children:i(t?{id:"experts.seeLess",defaultMessage:"Thu gọn"}:{id:"articlePage.careEmbedding.seeMore",defaultMessage:"Xem th\xeam"})})},getNativeScrollItemFlex=(e,t)=>{let r=(e-1)*t;return"0 0 calc((100cqi - ".concat(r,"px) / ").concat(e,")")},getNativeScrollPageFlex=()=>"0 0 100cqi",chunkSlidesForViewport=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:4,r=[];for(let o=0;o1&&void 0!==arguments[1]?arguments[1]:{},n=getNativeScrollItemFlex(t,r),s=getNativeScrollPageFlex();return{cardWrapper:{padding:(0,d.h)(4),width:"100%",minWidth:0,display:"flex",flexDirection:"column",alignItems:"stretch"},mobileCardWrapper:{width:"100%",minWidth:0},mobileExpandBtnWrapper:{paddingTop:(0,d.h)(16)},mobileViewAllBtnWrapper:{paddingTop:(0,d.h)(8)},mobileViewAllBtnWrapperOnly:{paddingTop:(0,d.h)(16)},nativeScrollRoot:{position:"relative"},nativeScrollViewport:{containerType:"inline-size",display:"flex",alignItems:"stretch",overflowX:a?"auto":"hidden",scrollSnapType:a?"x mandatory":"none",scrollBehavior:"smooth",WebkitOverflowScrolling:"touch",touchAction:a?"pan-x":"auto",cursor:a?"grab":"default",scrollbarWidth:"none",msOverflowStyle:"none","&::-webkit-scrollbar":{display:"none"}},nativeScrollPageStatic:{flex:"0 0 100%",boxSizing:"border-box"},nativeScrollItemFull:{flex:"1 1 100%",minWidth:0,display:"flex",flexDirection:"column",boxSizing:"border-box"},nativeScrollDragging:{cursor:"grabbing",scrollSnapType:"none",scrollBehavior:"auto",userSelect:"none"},nativeScrollItem:{flex:n,display:"flex",flexDirection:"column",alignSelf:"stretch",scrollSnapAlign:"start",scrollSnapStop:"always",minWidth:0,boxSizing:"border-box"},nativeScrollPage:{flex:s,alignSelf:"stretch",scrollSnapAlign:"start",scrollSnapStop:"always",minWidth:0,boxSizing:"border-box"},nativeScrollHorizonGrid:{display:"grid",gridTemplateColumns:"repeat(".concat(l,", 1fr)"),gridTemplateRows:i>1?"repeat(".concat(i,", 1fr)"):"1fr",gap:(0,d.h)(r),height:"100%",alignItems:"stretch"},nativeScrollGridCell:{minWidth:0,minHeight:0,display:"flex",flexDirection:"column"},nativeScrollArrow:{position:"absolute",top:"50%",transform:"translateY(-50%)",zIndex:2,width:(0,d.h)(40),height:(0,d.h)(40),borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",background:e.white,cursor:"pointer",transition:"all .2s ease",userSelect:"none",opacity:.85,boxShadow:"1px 4px 8px 1px rgba(0, 0, 0, 0.1)",...o?{border:"1px solid ".concat(o),"&:hover":{backgroundColor:e.fn.lighten(o,.9)}}:{"&:hover":{backgroundColor:e.colors.neutral100,borderColor:e.colors.neutral100}},"&.disabled":{opacity:0,cursor:"inherit",pointerEvents:"none"}},nativeScrollArrowIcon:{transition:"all .2s ease",...o&&{color:o}},nativeScrollArrowPrev:{left:0,[e.fn.largerThan("sm")]:{left:(0,d.h)(-60)}},nativeScrollArrowNext:{right:0,[e.fn.largerThan("sm")]:{right:(0,d.h)(-60)}}}});let eg=(0,l.memo)(e=>{let{slides:t,filterKey:r,cardCommonProps:i}=e,{classes:a}=ep({}),[n,s]=(0,l.useState)(!1),d=(0,l.useRef)(null),u=(0,l.useMemo)(()=>t.map(e=>e.id).join("\x00"),[t]);(0,l.useEffect)(()=>{s(!1),d.current=null},[u,r]);let p=t.length>4,g=(0,l.useMemo)(()=>!p||n?t:t.slice(0,4),[t,p,n]),m=(0,l.useCallback)(()=>{s(e=>{let t=!e;return t&&p&&(d.current=window.scrollY,document.activeElement instanceof HTMLElement&&document.activeElement.blur()),t})},[p]);return(0,l.useLayoutEffect)(()=>{if(!n||null===d.current)return;let e=d.current;d.current=null,window.scrollTo({top:e,left:0})},[n,g.length]),(0,o.BX)(h.K,{spacing:16,children:[g.map(e=>{let{id:t,item:r}=e;return(0,o.tZ)(c.x,{className:a.mobileCardWrapper,children:(0,o.tZ)(eu,{...i,item:r})},t)}),p?(0,o.tZ)(c.x,{className:a.mobileExpandBtnWrapper,children:(0,o.tZ)(ExpandCollapseBtn,{isExpanded:n,onClick:m})}):null]})});var em=r("5Q4Z"),ef=r("iZ8j");let isNativeScrollInteractiveTarget=e=>e instanceof Element&&!!e.closest('button, a, input, textarea, select, [role="button"], [data-no-drag]'),ev=(0,l.memo)(e=>{let{slides:t,cardCommonProps:r,desktopLayout:i,cardWrapperClassName:a,gap:n,arrowColor:s}=e,{layoutType:h,columns:u,rows:p,itemsPerViewport:g,useGrid:m,enableScroll:f}=i,{classes:v,cx:x}=ep({nativeScrollVisibleCount:g,nativeScrollGap:n,arrowColor:s,gridColumns:u,gridRows:p,enableScroll:f},{name:"CarePathDoctorList"}),b=(0,l.useMemo)(()=>"scroll-pages"===h?chunkSlidesForViewport(t,g):null,[h,t,g]),C=(0,l.useRef)(null),y=(0,l.useRef)(null),w=(0,l.useRef)(null),S=(0,l.useRef)({prev:!1,next:!1}),Z=(0,l.useRef)({active:!1,pointerId:-1,startX:0,startScrollLeft:0,hasMoved:!1}),[k,P]=(0,l.useState)(!1),D=(0,l.useCallback)(()=>{var e,t;if(!f)return;let r=C.current;if(!r)return;let o=r.scrollWidth-r.clientWidth,l=r.scrollLeft>4,i=r.scrollLeft{if(!f)return;let t=C.current;t&&t.scrollBy({left:e*t.clientWidth,behavior:"smooth"})},[f]),L=(0,l.useCallback)(e=>{let t=C.current;Z.current.active&&t&&(Z.current.active=!1,P(!1),t.hasPointerCapture(e)&&t.releasePointerCapture(e),D())},[D]),I=(0,l.useCallback)(e=>{if(!f||0!==e.button||"touch"===e.pointerType||isNativeScrollInteractiveTarget(e.target))return;let t=C.current;t&&(Z.current={active:!0,pointerId:e.pointerId,startX:e.clientX,startScrollLeft:t.scrollLeft,hasMoved:!1},P(!0),t.setPointerCapture(e.pointerId))},[f]),B=(0,l.useCallback)(e=>{if(!Z.current.active)return;let t=C.current;if(!t)return;let r=e.clientX-Z.current.startX;Math.abs(r)>5&&(Z.current.hasMoved=!0),t.scrollLeft=Z.current.startScrollLeft-r,e.preventDefault()},[]),F=(0,l.useCallback)(e=>{L(e.pointerId)},[L]),A=(0,l.useCallback)(e=>{L(e.pointerId)},[L]),E=(0,l.useCallback)(e=>{Z.current.hasMoved&&(e.preventDefault(),e.stopPropagation(),Z.current.hasMoved=!1)},[]);(0,l.useEffect)(()=>{if(!f)return;D();let e=C.current;if(!e||"undefined"==typeof ResizeObserver)return;let t=0,r=new ResizeObserver(()=>{cancelAnimationFrame(t),t=requestAnimationFrame(D)});return r.observe(e),()=>{cancelAnimationFrame(t),r.disconnect()}},[f,t.length,null==b?void 0:b.length,D]);let renderCard=(e,t,l)=>(0,o.tZ)(c.x,{className:x(l?v.nativeScrollGridCell:v.nativeScrollItem,"single-full"===h&&v.nativeScrollItemFull,!l&&"single-full"!==h&&a),children:(0,o.tZ)(eu,{...r,item:t})},e),renderGrid=e=>(0,o.tZ)(c.x,{className:v.nativeScrollHorizonGrid,children:e.map(e=>{let{id:t,item:r}=e;return renderCard(t,r,!0)})});return(0,o.BX)(c.x,{className:v.nativeScrollRoot,children:[f&&(0,o.tZ)(c.x,{ref:y,className:x(v.nativeScrollArrow,v.nativeScrollArrowPrev,"disabled"),onClick:()=>S.current.prev&&T(-1),children:(0,o.tZ)(em.Z,{className:v.nativeScrollArrowIcon,size:18,useCurrentColor:!0})}),(0,o.tZ)(c.x,{ref:C,className:x(v.nativeScrollViewport,k&&v.nativeScrollDragging),sx:{gap:(0,d.h)(n)},onScroll:D,onPointerDown:I,onPointerMove:B,onPointerUp:F,onPointerCancel:A,onClickCapture:E,children:(()=>{if("single-full"===h&&t[0]){let{id:e,item:r}=t[0];return(0,o.tZ)(c.x,{className:x(v.nativeScrollPage,v.nativeScrollPageStatic,a),children:renderCard(e,r,!1)})}return"static-grid"===h&&m?(0,o.tZ)(c.x,{className:x(v.nativeScrollPage,v.nativeScrollPageStatic,a),children:renderGrid(t)}):"scroll-pages"===h&&b?b.map((e,t)=>(0,o.tZ)(c.x,{className:x(v.nativeScrollPage,a),children:renderGrid(e)},"page-".concat(t))):t.map(e=>{let{id:t,item:r}=e;return renderCard(t,r,!1)})})()}),f&&(0,o.tZ)(c.x,{ref:w,className:x(v.nativeScrollArrow,v.nativeScrollArrowNext),onClick:()=>S.current.next&&T(1),children:(0,o.tZ)(ef.Z,{className:v.nativeScrollArrowIcon,size:18,useCurrentColor:!0})})]})}),ex=(0,l.memo)(e=>{let{slides:t,cardCommonProps:r,desktopLayout:l,cardWrapperClassName:i,gap:a}=e,{layoutType:n,columns:s,rows:h}=l;return"single-full"===n&&t[0]?(0,o.tZ)(c.x,{className:i,children:(0,o.tZ)(eu,{...r,item:t[0].item})}):(0,o.tZ)(c.x,{sx:{display:"grid",gridTemplateColumns:"repeat(".concat(s,", minmax(0, 1fr))"),gridTemplateRows:h>1?"repeat(".concat(h,", auto)"):"auto",gap:(0,d.h)(a),alignItems:"stretch"},children:t.map(e=>{let{id:t,item:l}=e;return(0,o.tZ)(c.x,{className:i,sx:{minWidth:0,display:"flex",flexDirection:"column"},children:(0,o.tZ)(eu,{...r,item:l})},t)})})}),eb=K.C.getAssetPath("carePath/doctor-not-found.svg"),eC=Array.from({length:4},(e,t)=>"skeleton-".concat(t)),usePreloadCarePathDoctorNotFoundImage=()=>{(0,l.useEffect)(()=>{let e=new Image;e.src=eb},[])},ey=(0,l.memo)(e=>{var t;let{displayDoctors:r,isLoading:i,isMobile:n,listingGapDesktop:s,desktopListLayout:g,arrowColor:m,mobileListFilterKey:f,cardWrapperClassName:v,typeEmbedding:x,formatCardItem:b,cardCommonProps:C}=e,{formatMessage:y}=(0,p.Z)(),w=(0,l.useRef)(new Map);usePreloadCarePathDoctorNotFoundImage();let S=null!==(t=C.display)&&void 0!==t?t:"vertical",{layoutType:Z,columns:k,rows:P,itemsPerViewport:D,useGrid:T,enableScroll:L}=g,I=getNativeScrollItemFlex(D,s),B=(0,l.useMemo)(()=>"single-full"===Z?1:"static-grid"===Z?k*P:D,[Z,k,P,D]),F=(0,l.useMemo)(()=>buildStableDoctorSlides(r,x,b,w),[r,x,b]);return i?n?(0,o.tZ)(h.K,{spacing:16,children:eC.map(e=>(0,o.tZ)(DoctorCardSkeleton,{display:"vertical"},e))}):"single-full"===Z?(0,o.tZ)(c.x,{sx:{containerType:"inline-size",overflow:"hidden"},children:(0,o.tZ)(c.x,{className:v,children:(0,o.tZ)(DoctorCardSkeleton,{display:S})})}):T?(0,o.tZ)(c.x,{sx:{containerType:"inline-size",overflow:"hidden"},children:(0,o.tZ)(c.x,{className:v,children:(0,o.tZ)(c.x,{sx:{display:"grid",gridTemplateColumns:"repeat(".concat(k,", 1fr)"),gridTemplateRows:P>1?"repeat(".concat(P,", 1fr)"):"1fr",gap:(0,d.h)(s)},children:Array.from({length:B},(e,t)=>(0,o.tZ)(c.x,{sx:{minWidth:0,display:"flex",flexDirection:"column"},children:(0,o.tZ)(DoctorCardSkeleton,{display:S,sx:{height:"100%",flex:1,minHeight:0}})},"desktop-skeleton-".concat(t)))})})}):(0,o.tZ)(u.k,{gap:s,sx:{containerType:"inline-size",overflow:"hidden",alignItems:"stretch"},children:Array.from({length:B},(e,t)=>(0,o.tZ)(c.x,{sx:{flex:I,minWidth:0,display:"flex",flexDirection:"column",alignSelf:"stretch",boxSizing:"border-box"},className:v,children:(0,o.tZ)(DoctorCardSkeleton,{display:S,sx:{height:"100%",flex:1,minHeight:0}})},"desktop-skeleton-".concat(t)))}):r.length?n?(0,o.tZ)(eg,{slides:F,filterKey:f,cardCommonProps:C}):L?(0,o.tZ)(ev,{slides:F,cardCommonProps:C,desktopLayout:g,cardWrapperClassName:v,gap:s,arrowColor:m}):(0,o.tZ)(ex,{slides:F,cardCommonProps:C,desktopLayout:g,cardWrapperClassName:v,gap:s}):(0,o.tZ)(c.x,{sx:{display:"flex",alignItems:"center",justifyContent:"center",padding:(0,d.h)(24)},children:(0,o.BX)(h.K,{align:"center",spacing:16,sx:{maxWidth:456},children:[(0,o.tZ)(c.x,{component:"img",src:eb,alt:"",loading:"eager",fetchPriority:"high",width:120,height:120,sx:{width:(0,d.h)(120),aspectRatio:"1 / 1",objectFit:"contain"}}),(0,o.tZ)(a.T,{size:"p2",color:"#fff",align:"center",children:y({id:"carePathDoctorList.notFoundDesc",defaultMessage:"Kh\xf4ng t\xecm thấy b\xe1c sĩ"})})]})})},(e,t)=>e.isLoading===t.isLoading&&e.isMobile===t.isMobile&&e.displayDoctors===t.displayDoctors&&e.cardCommonProps===t.cardCommonProps&&e.mobileListFilterKey===t.mobileListFilterKey&&e.listingGapDesktop===t.listingGapDesktop&&e.arrowColor===t.arrowColor&&e.cardWrapperClassName===t.cardWrapperClassName&&e.typeEmbedding===t.typeEmbedding&&e.formatCardItem===t.formatCardItem&&e.desktopListLayout===t.desktopListLayout);var ew=r("MyPT");let HalfCircle=e=>{let{color:t,...r}=e;return(0,o.tZ)("svg",{width:"204",height:"132",viewBox:"0 0 204 132",fill:"none",...r,children:(0,o.tZ)("path",{d:"M131 0.54982L0 0.549797L-2.29048e-05 131.55C-3.55404e-05 203.817 58.6115 262.55 131 262.55C203.267 262.55 262 203.938 262 131.55C261.879 59.1614 203.268 0.549833 131 0.54982Z",fill:t})})},resolveDesktopDoctorListLayout=(e,t,r)=>{var o;let l=null!==(o=null==r?void 0:r.useScrollLayoutFromFour)&&void 0!==o&&o;return e<=0?{layoutType:"static-grid",columns:1,rows:1,itemsPerViewport:1,useGrid:!0,enableScroll:!1}:1===e?{layoutType:"single-full",columns:1,rows:1,itemsPerViewport:1,useGrid:!1,enableScroll:!1}:2===e?{layoutType:"static-grid",columns:2,rows:1,itemsPerViewport:2,useGrid:!0,enableScroll:!1}:3===e?t?{layoutType:"static-grid",columns:2,rows:2,itemsPerViewport:3,useGrid:!0,enableScroll:!1}:{layoutType:"static-grid",columns:3,rows:1,itemsPerViewport:3,useGrid:!0,enableScroll:!1}:4!==e||l?t?{layoutType:"scroll-pages",columns:2,rows:2,itemsPerViewport:4,useGrid:!0,enableScroll:!0}:{layoutType:"scroll-row",columns:4,rows:1,itemsPerViewport:4,useGrid:!1,enableScroll:!0}:t?{layoutType:"static-grid",columns:2,rows:2,itemsPerViewport:4,useGrid:!0,enableScroll:!1}:{layoutType:"static-grid",columns:4,rows:1,itemsPerViewport:4,useGrid:!0,enableScroll:!1}},resolveDoctorCardDisplay=e=>{let{isMobile:t,itemCount:r,horizontalLayout:o,layoutConfig:l}=e;if(t)return"vertical";if(r>0&&r<=2)return"horizon";let i=null==l?void 0:l[r];return i||(o?"horizon":"vertical")},Shape=e=>{let{color:t,...r}=e;return(0,o.tZ)("svg",{width:"122",height:"122",viewBox:"0 0 122 122",fill:"none",...r,children:(0,o.tZ)("path",{d:"M61 0H122V61C122 94.6513 94.7076 122 61 122C27.3487 122 0 94.7076 0 61C0.0562668 27.2924 27.3487 0 61 0Z",fill:t})})};var eS=r("TYy9"),eZ=r.n(eS),ek=r("xweI"),eP=r.n(ek),eD=r("09QT"),eT=r("J3uC"),eL=r("oQBk");let eI=(0,l.forwardRef)((e,t)=>{let{categoryIds:r,listingAll:i,selectedFilterId:a,filterColor:n,filterLayout:s,onFilterChange:c}=e,{formatMessage:d}=(0,p.Z)(),h=(0,l.useRef)(null),[u,g]=(0,l.useState)([]),[m,f]=(0,l.useState)(null);(0,l.useImperativeHandle)(t,()=>({setTopServiceSelectedFilterId:e=>f(e),openFilter:()=>{var e;return null===(e=h.current)||void 0===e?void 0:e.openFilter()}})),(0,l.useEffect)(()=>{r.length&&(async()=>{var e,t;let o=await (0,eD.d)(eL.y.CARE.GET_TOP_SERVICES,{params:{showDistrict:1,categoryIds:r.join(",")}},"care");g(eZ()(((null==o?void 0:null===(t=o._data)||void 0===t?void 0:null===(e=t.top_services)||void 0===e?void 0:e.city_list)||[]).map(e=>{var t,r,o;return{group:{id:String(null!==(o=null===(t=e.city)||void 0===t?void 0:t.id)&&void 0!==o?o:""),name:(null===(r=e.city)||void 0===r?void 0:r.name)||""},doctors:eP()(eZ()((0,eT.PE)(e).serviceList.map(e=>e.services)),["position"],"asc")}})))})()},[r]),(0,l.useEffect)(()=>{a&&f(a)},[a]),(0,l.useEffect)(()=>{let e=null===m||"all"===m,t=e?i:eZ()(u.filter(e=>{var t;return(null===(t=e.group)||void 0===t?void 0:t.id)==m}).map(e=>e.doctors));c({doctors:t,filterValue:m,isAllCitiesSelected:e})},[m,u,i,c]);let v=(0,l.useMemo)(()=>[{label:d({id:"keyword.all"}),value:"all"},...u.map(e=>{var t,r;return{label:null===(t=e.group)||void 0===t?void 0:t.name,value:String(null===(r=e.group)||void 0===r?void 0:r.id)}})],[d,u]);return(0,o.tZ)(D,{ref:h,value:m,onChange:f,filterOpts:v,filterColor:n,layout:s})}),getListingItemKey=(e,t)=>{if("id"in e)return String(e.id);if("categoryId"in e){let t=e.services.map(e=>"id"in e?String(e.id):"").join(",");return"".concat(e.categoryId,":").concat(t)}return String(t)},useEmbeddingDoctorsListing=(e,t)=>{let[r,o]=(0,l.useState)(e),[i,a]=(0,l.useState)(!1),n=(0,l.useRef)(!1),[,s]=(0,l.useTransition)(),c=(0,l.useMemo)(()=>e.map(getListingItemKey).join("\x00"),[e]),d=(0,l.useRef)(c);return(0,l.useEffect)(()=>{d.current!==c&&(d.current=c,o(e),n.current=!1,a(!1))},[e,c]),(0,l.useEffect)(()=>{if(n.current||!(0,ew.pA)(e.length))return;n.current=!0,a(!0);let r=!1;return(async()=>{try{let e=await (0,ew.CT)(t);r||s(()=>{o(e)})}catch(e){console.error("Failed to fetch remaining embedding doctors",e)}finally{r||a(!1)}})(),()=>{r=!0}},[t.typeEmbedding,t.allDoctors,t.embebIds.join(","),e.length]),{listingAll:r,isFetchingRemaining:i,initialFetchCount:ew.oQ}},ViewAllBtn=e=>{let{fullWidth:t=!1,target:r="_blank",rel:l="noopener noreferrer",style:i,sx:a,...n}=e,{formatMessage:c}=(0,p.Z)(),d=(0,s.rZ)(),h={target:r,rel:l,...n};return(0,o.tZ)(R.B,{component:"a",size:"lg",variant:"white",fullWidth:t,sx:{width:t?"100%":"auto",display:t?void 0:"inline-flex",textDecoration:"none",backgroundColor:d.white,color:d.colors.blue[6],transition:"background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease","&:hover":{backgroundColor:d.colors.blue[6],color:d.white,borderColor:d.colors.blue[6]},...a&&"object"==typeof a&&!Array.isArray(a)?a:{}},style:i,...h,children:c({id:"categoryPage.seeAll"})})},formatProps=(e,t)=>{var r,o;return"top_service"===t?{name:e.name,validOutpatient:!1,validTelemedicine:!1,rating:e.hospital.rating||"",doctorSpecialties:[],hospital:e.hospital.name||"",hospitalLogo:e.hospital.logo||"",hospitalAddress:e.hospital.address||"",slug:e.slug,id:e.id,avatar:e.image||"",price:e.price||"",priceUnit:e.priceUnit||"",originalPrice:e.originalPrice||"",cityName:(null===(r=e.hospital.city)||void 0===r?void 0:r.name)||""}:{name:e.name,validOutpatient:e.validOutpatient,validTelemedicine:e.validTelemedicine,rating:e.rating,doctorSpecialties:e.doctorSpecialties,hospital:e.hospital.name||"",hospitalLogo:e.hospital.logo||"",hospitalAddress:e.hospital.address||"",slug:e.slug,id:e.id,avatar:e.avatar,price:e.price||"",priceUnit:e.priceUnit||"",originalPrice:e.originalPrice||"",cityName:(null===(o=e.hospital.city)||void 0===o?void 0:o.name)||"",doctorWebsite:e.doctorWebsite||""}},eB={[n.L.Vietnam]:"tat-ca",[n.L.Indonesia]:"semua"},getListingItemId=e=>{var t;return String(null!==(t=e.id)&&void 0!==t?t:"")};var eF=(0,l.memo)((0,l.forwardRef)((e,t)=>{var r,n;let{defaultColor:b,sessionProps:C,hidePrice:y,hideViewAll:w,hideBgPattern:S,listingAll:Z=[],selectedFilterId:k,filterColor:P,styles:D,showConfirmCityPopup:T,viewAllUrl:L,layoutConfig:I,showPromotionEvent:B,carouselListProps:F,applyH1:A,campaign:E,...M}=e,{locale:N}=(0,v.h)(),R=!!(D&&Object.keys(D).length>0),{classes:z}=ep({},{name:"CarePathDoctorList",...R?{styles:D}:{}}),{formatMessage:W}=(0,p.Z)(),X=(0,l.useRef)(null),O=(0,l.useRef)(null),K=(0,l.useRef)(null),[j,V]=(0,l.useState)(!0),{title:G,description:Y,typeEmbedding:U,embebIds:q,allDoctors:Q,horizontalLayout:J,backgroundColor:$}=C,[ee,et]=(0,l.useState)(()=>"top_service"===C.typeEmbedding&&Z.length>0?Z:null),{listingAll:er,isFetchingRemaining:eo}=useEmbeddingDoctorsListing(Z,C),el=$||b,ei=(0,s.rZ)(),ea=(0,f.d)(),en=(0,l.useMemo)(()=>"top_service"===U,[U]),es=(0,l.useMemo)(()=>"doctors"===U||"specialties"===U,[Q,U]),[ec,ed]=(0,l.useState)(""),[eh,eu]=(0,l.useState)(null),[eg,em]=(0,l.useState)(null),ef=(0,l.useMemo)(()=>({keyword:ec,cityFilterId:eh,specialtyFilterId:eg}),[ec,eh,eg]),[ev,ex]=(0,l.useState)(null),eb=(0,l.useMemo)(()=>es?applyCarePathDoctorListFilters(er,ef):en?null!=ee?ee:[]:er,[es,en,er,ef,ee]),eC=(0,l.useMemo)(()=>es?"doctors:".concat(ec,"|").concat(null!=eh?eh:"","|").concat(null!=eg?eg:""):en?"top_service:".concat(null!=ev?ev:"all"):"default",[es,en,ec,eh,eg,ev]),eS=(0,l.useCallback)((e,t)=>formatProps(e,t),[]),eZ=(0,l.useCallback)(()=>{var e,t;ed(""),eu(null),em(null),null===(e=O.current)||void 0===e||e.setDoctorsSelectedFilterId("all"),null===(t=K.current)||void 0===t||t.setSpecialtySelectedFilterId("all")},[]),ek=0===er.length&&(eo||en&&null===ee||!en&&!es&&null===ee),eP=null!==(r=null==eb?void 0:eb.length)&&void 0!==r?r:0,eD=er.length,eT=null!==(n=null==F?void 0:F.gapDesktop)&&void 0!==n?n:20,eL=P||b,eF=(0,l.useCallback)(e=>{let{doctors:t,isAllCitiesSelected:r,filterValue:o}=e;et(t),V(r),ex(o)},[]),eA=(0,l.useCallback)(e=>{let{filterValue:t,isAllCitiesSelected:r}=e;eu(r?null:t)},[]),eE=(0,l.useCallback)(e=>{let{filterValue:t,isAllSpecialtiesSelected:r}=e;em(r?null:t)},[]);(0,l.useImperativeHandle)(t,()=>({setSelectedFilterId:e=>{var t,r,o;null===(t=X.current)||void 0===t||t.setTopServiceSelectedFilterId(e),null===(r=O.current)||void 0===r||r.setDoctorsSelectedFilterId(e),null===(o=K.current)||void 0===o||o.setSpecialtySelectedFilterId(e)}})),(0,l.useEffect)(()=>{en||es||et(er)},[en,es,er]);let eM=(0,l.useMemo)(()=>(null===eh||"all"===eh)&&(null===eg||"all"===eg),[eh,eg]),eN=(0,l.useMemo)(()=>buildCarePathDoctorListResetEventLabel({searchKeyword:ec,cityFilterId:eh,specialtyFilterId:eg,listingAll:er}),[ec,eh,eg,er]),eR=(0,l.useMemo)(()=>!hasCarePathDoctorListActiveFilters({searchKeyword:ec,cityFilterId:eh,specialtyFilterId:eg}),[ec,eh,eg]),ez=(0,l.useMemo)(()=>es&&hasCarePathDoctorListActiveFilters({searchKeyword:ec,cityFilterId:eh,specialtyFilterId:eg}),[es,ec,eh,eg]),eW=(0,l.useMemo)(()=>en&&!!ev&&"all"!==ev,[en,ev]),eX=(0,l.useMemo)(()=>ez||eW?eD:eP,[ez,eW,eD,eP]),viewAllByType=e=>{var t;return"/care/".concat((null==eB?void 0:eB[N])||"all","/").concat(null===(t=x.a8[N])||void 0===t?void 0:t["top_service"===U?"SERVICE":"DOCTOR"],"/").concat(e?"?specialtyId=".concat(e):"")},eO=L||"https://".concat(m.domainLocales[N]).concat("specialties"===U&&1===q.length?viewAllByType(null==q?void 0:q[0]):viewAllByType()),eH={href:eO,target:"_blank","data-event-category":"Service Connection","data-event-action":"View All Doctor Click","data-event-label":eO},e_=!w&&!en&&!Q,eK=(0,l.useMemo)(()=>resolveDoctorCardDisplay({isMobile:ea,itemCount:eX,horizontalLayout:J,layoutConfig:I}),[ea,eX,J,I]),ej=(0,l.useMemo)(()=>resolveDesktopDoctorListLayout(eX,"horizon"===eK,{useScrollLayoutFromFour:eo&&eX===ew.oQ}),[eX,eK,eo]),eV=(0,l.useCallback)(()=>{var e,t;en?null===(e=X.current)||void 0===e||e.openFilter():es&&(null===(t=O.current)||void 0===t||t.openFilter())},[en,es]),eG=(0,l.useMemo)(()=>({className:"item",isService:"top_service"===U,hidePrice:y,display:eK,showPromotionEvent:B,showConfirmCityPopup:T&&(es?eM:j),campaign:E,onCancel:eV}),[U,y,eK,B,T,es,eM,j,E,eV]);return(0,o.tZ)(i.T,{variant:i.C.LEADGEN,children:(0,o.BX)(c.x,{sx:{position:"relative",background:el},...M,children:[!S&&(0,o.BX)(c.x,{sx:{position:"absolute",inset:0,overflow:"hidden",pointerEvents:"none"},children:[(0,o.tZ)(c.x,{sx:{position:"absolute",left:0,top:0},children:(0,o.tZ)(Circle,{color:ei.fn.darken(el,.08)})}),(0,o.BX)(c.x,{sx:{position:"absolute",right:0,bottom:0},children:[(0,o.tZ)(HalfCircle,{color:ei.fn.lighten(el,.08)}),(0,o.tZ)(c.x,{sx:{position:"absolute",left:(0,d.h)(44),top:0,transform:"translate(0, -75%)"},children:(0,o.tZ)(Shape,{color:ei.fn.darken(el,.08)})})]})]}),(0,o.tZ)(g.W,{style:{position:"relative"},children:(0,o.BX)(h.K,{sx:e=>({padding:"".concat((0,d.h)(24)," 0"),gap:8,[e.fn.largerThan("sm")]:{gap:24,padding:"".concat((0,d.h)(40)," 0")}}),children:[(0,o.BX)(u.k,{justify:"space-between",sx:e=>({gap:16,[e.fn.smallerThan("sm")]:{flexDirection:"column",gap:8}}),children:[(0,o.BX)(h.K,{sx:e=>({gap:(0,d.h)(8),[e.fn.largerThan("sm")]:{gap:(0,d.h)(12)}}),children:[G&&(0,o.tZ)(a.T,{size:"h2",as:A?"h1":"h2",color:"#fff",children:G}),Y&&(0,o.tZ)(a.T,{size:"s3",color:"#fff",weight:"semiBold",children:Y})]}),en?(0,o.tZ)(c.x,{sx:getCarePathDoctorListDefaultFilterWidthSx(ei),children:(0,o.tZ)(eI,{ref:X,categoryIds:q,listingAll:er,selectedFilterId:k,filterColor:P,onFilterChange:eF})}):es?(0,o.tZ)(c.x,{sx:e=>({width:"100%",[e.fn.largerThan("sm")]:{width:"auto"}}),children:(0,o.tZ)(_,{listingAll:er,searchKeyword:ec,cityFilterId:eh,specialtyFilterId:eg,filterColor:P,doctorsFilterRef:O,specialtiesFilterRef:K,onSearchKeywordChange:ed,onDoctorsFilterChange:eA,onSpecialtiesFilterChange:eE,onResetFilters:eZ,showResetButton:!ea})}):null]}),(0,o.BX)(u.k,{justify:"space-between",align:"center",sx:e=>({[e.fn.smallerThan("sm")]:{minHeight:48}}),children:[(0,o.tZ)(a.T,{size:"title1",color:"#fff",weight:"semiBold",children:W({id:en?"carePathDoctorList.totalSearchPerTotalService":"carePathDoctorList.totalSearchPerTotalDoctor",defaultMessage:en?"{search}/{total} services":"{search}/{total} doctors"},{search:eP,total:er.length})}),es&&ea&&(0,o.tZ)(H,{onClick:eZ,eventLabel:eN,disabled:eR}),e_&&!ea&&(0,o.tZ)(ViewAllBtn,{...eH})]}),(0,o.tZ)(ey,{displayDoctors:eb,isLoading:ek,typeEmbedding:U,isMobile:ea,listingGapDesktop:eT,desktopListLayout:ej,arrowColor:eL,mobileListFilterKey:eC,cardWrapperClassName:z.cardWrapper,formatCardItem:eS,cardCommonProps:eG}),e_&&ea&&(0,o.tZ)(c.x,{className:eP>4?z.mobileViewAllBtnWrapper:z.mobileViewAllBtnWrapperOnly,children:(0,o.tZ)(ViewAllBtn,{...eH,fullWidth:!0})})]})})]})})}),(e,t)=>{var r,o;let l=null!==(r=e.listingAll)&&void 0!==r?r:[],i=null!==(o=t.listingAll)&&void 0!==o?o:[];return!(l!==i&&(l.length!==i.length||l.some((e,t)=>getListingItemId(e)!==getListingItemId(i[t]))))&&e.defaultColor===t.defaultColor&&e.selectedFilterId===t.selectedFilterId&&e.hidePrice===t.hidePrice&&e.hideViewAll===t.hideViewAll&&e.hideBgPattern===t.hideBgPattern&&e.filterColor===t.filterColor&&e.showConfirmCityPopup===t.showConfirmCityPopup&&e.viewAllUrl===t.viewAllUrl&&e.layoutConfig===t.layoutConfig&&e.showPromotionEvent===t.showPromotionEvent&&e.applyH1===t.applyH1&&e.campaign===t.campaign&&e.sessionProps.title===t.sessionProps.title&&e.sessionProps.description===t.sessionProps.description&&e.sessionProps.typeEmbedding===t.sessionProps.typeEmbedding&&e.sessionProps.horizontalLayout===t.sessionProps.horizontalLayout&&e.sessionProps.backgroundColor===t.sessionProps.backgroundColor&&e.sessionProps.allDoctors===t.sessionProps.allDoctors&&e.sessionProps.embebIds===t.sessionProps.embebIds})},hhen:function(e,t,r){r.d(t,{f:function(){return CarePathProductWidgets}});var o=r("BGKE"),l=r("/kWL"),i=r("Eso5"),a=r("gHFm"),n=r("hXNO"),s=r("/npG"),c=r("mYVa"),d=(0,s.k)((e,t)=>{let{bgColor:r,productNumber:o}=t;return{root:{backgroundColor:r||e.colors.blue[0],paddingTop:(0,c.h)(80),paddingBottom:(0,c.h)(80),[e.fn.smallerThan("sm")]:{paddingTop:(0,c.h)(32),paddingBottom:(0,c.h)(32)}},inner:{display:"flex",flexDirection:"column",gap:(0,c.h)(16),[e.fn.largerThan("sm")]:{gap:(0,c.h)(40)}},heading:{color:"#fff"},widgets:{[e.fn.largerThan("sm")]:{...1===o?{background:"#fff"}:{padding:0,background:"transparent"}},[e.fn.smallerThan("sm")]:{background:"transparent",margin:"0 -16px"}},cardRoot:{[e.fn.largerThan("sm")]:{...2===o?{padding:(0,c.h)(16)}:{}}},cardThumbnail:{[e.fn.largerThan("sm")]:{...2===o?{width:(0,c.h)(164)}:{}}},progressBar:{},progressRoot:{background:"rgba(255,255,255,0.5)"}}}),h=r("yioo");let CarePathProductWidgets=e=>{let{title:t,products:r=[],styles:s,classNames:c,className:u,bgColor:p,applyH1:g}=e,m=(0,n.d)(),f=r.length,{classes:v,cx:x}=d({bgColor:p,productNumber:f},{name:"CarePathProductWidgets",styles:s,classNames:c});return r.length>0?(0,o.tZ)(i.x,{className:x(v.root,u),children:(0,o.tZ)(a.W,{children:(0,o.BX)(i.x,{className:v.inner,children:[t&&(0,o.tZ)(l.T,{size:"h2",as:g?"h1":"h3",className:v.heading,children:t}),(0,o.tZ)(h.ProductsWidget,{products:r,numberItemToSlideDesktop:6,numberItemToSlideMobile:2,cartBtnColor:p,layout:m?Array(f).fill("wide-horizon"):["wide-horizon","wide-horizon","horizon","vertical"],classNames:{root:v.widgets,progressBar:v.progressBar,progressRoot:v.progressRoot,cardRoot:v.cardRoot}})]})})}):null}},"/lrZ":function(e,t,r){r.d(t,{O:function(){return CarePathSelection}});var o=r("BGKE"),l=r("owZr"),i=r("/kWL"),a=r("mYVa"),n=r("Eso5"),s=r("OAL+"),c=r("0Tuv"),d=r("gHFm"),h=r("eO6u"),u=r("raAP"),p=r("hXNO"),g=r("/npG"),m=(0,g.k)((e,t)=>{let{unsetRatio:r,detectPage:{isSimilac:o}}=t,l=e.colors;return{root:{},container:{},wrapper:{gap:(0,a.h)(32),padding:"".concat((0,a.h)(24)," 0"),[e.fn.largerThan("sm")]:{gap:(0,a.h)(64),padding:(0,a.h)(80)}},heading:{},description:{color:e.colors.gray[8]},bannerImg:{[e.fn.largerThan("sm")]:{maxWidth:(0,a.h)(744)}},optionList:{display:"flex",[e.fn.smallerThan("sm")]:{flexDirection:"column",width:"100%",gap:(0,a.h)(12)},[e.fn.largerThan("sm")]:{justifyContent:"center",gap:(0,a.h)(24),".item":{width:(0,a.h)(264)}}},radioOptionRoot:{...o&&{backgroundColor:"#fff"},...!r&&{borderRadius:(0,a.h)(16),border:"2px solid transparent",boxShadow:"0px 0px 1px 0px rgba(0, 0, 0, 0.04), 0px 2px 8px 0px rgba(0, 0, 0, 0.04), 0px 16px 24px 0px rgba(0, 0, 0, 0.06)",transition:"all .1s ease",'&[data-checked="true"]':{borderColor:e.fn.primaryColor(),backgroundColor:l[e.primaryColor][0]}}},radioOptionLabel:{padding:0,cursor:"pointer"},radioOptionLabelWrapper:{width:"100%"},radioOptionInner:{display:"none"},optionRoot:{},optionWrapper:{},optionThumbnail:{},optionHeading:{}}});r("q1tI");var f=r("RZSM"),v=(0,g.k)(e=>({root:{},wrapper:{display:"flex",[e.fn.smallerThan("sm")]:{alignItems:"center",padding:(0,a.h)(8),gap:(0,a.h)(16),img:{width:(0,a.h)(48)}},[e.fn.largerThan("sm")]:{flexDirection:"column",alignItems:"center",padding:"".concat((0,a.h)(12)," ").concat((0,a.h)(12)," ").concat((0,a.h)(24)),gap:(0,a.h)(24)}},thumbnail:{borderRadius:(0,a.h)(16),[e.fn.smallerThan("sm")]:{width:(0,a.h)(120)}},heading:{textAlign:"center"}}));let CarePathOption=e=>{let{label:t,icon:r,className:l,classNames:a,styles:s,...c}=e,{classes:d,cx:h}=v(void 0,{name:"CarePathSelection__Option",styles:s,classNames:a});return(0,o.tZ)(n.x,{className:h(l,d.root),...c,children:(0,o.BX)(n.x,{className:d.wrapper,children:[(0,o.tZ)(f.o,{className:d.thumbnail,ratio:1.5,w:"100%",variant:"",children:(0,o.tZ)("img",{src:"".concat(r,"?w=300&q=90"),style:{borderRadius:"inherit"},alt:"",loading:"lazy"})}),(0,o.tZ)(i.T,{className:d.heading,size:"s3",weight:"semiBold",children:t})]})})};var x=r("DslX");let CarePathSelection=e=>{let{heading:t,description:r,unsetRatio:g,useCommonAssess:f,assessFolderName:v,options:b,onSelect:C,keyID:y="",styles:w,classNames:S,className:Z}=e,k=(0,u.U)(),P=(0,x.d)(y),{isNestle:D,isSimilac:T,isVinamilk:L}=P||{},I=(0,p.d)(),{classes:B,cx:F}=m({unsetRatio:g,detectPage:P},{name:"CarePathSelection",styles:w,classNames:S});return(0,o.tZ)(h.Yr,{className:"service-connection-page",style:{minHeight:(0,a.h)(610),marginBottom:0,...T&&{backgroundColor:"#E6FAF7"},...L&&{backgroundColor:"#CFFEC8",backgroundImage:"url(".concat(l.C.getAssetPath("vinamilk/selection-bg.png"),")")}},children:(0,o.tZ)(n.x,{className:F(B.root,Z),children:(0,o.tZ)(d.W,{className:B.container,children:(0,o.BX)(s.K,{className:B.wrapper,align:"stretch",children:[D?(0,o.tZ)(o.HY,{children:(0,o.tZ)(n.x,{sx:{textAlign:"center"},children:(0,o.tZ)("img",{src:l.C.getAssetPath(I?"nestle/selection_banner_mobile.png":"nestle/selection_banner_desktop.png"),loading:"lazy",alt:"Nestle",className:B.bannerImg})})}):(0,o.tZ)(o.HY,{children:(t||r)&&(0,o.BX)(s.K,{spacing:(0,a.h)(8),align:"center",sx:{textAlign:"center"},children:[t&&(0,o.tZ)(i.T,{size:"h1",className:B.heading,as:"div",children:(0,o.tZ)("h1",{dangerouslySetInnerHTML:{__html:t}})}),r&&(0,o.tZ)(i.T,{size:"p3",className:B.description,as:"div",children:(0,o.tZ)("div",{dangerouslySetInnerHTML:{__html:r}})})]})}),(0,o.tZ)(c.Y.Group,{unstyled:!0,onChange:e=>{null==C||C(b.filter(t=>t.groupId===e)[0]||{})},children:(0,o.tZ)(n.x,{className:B.optionList,children:b.map((e,t)=>(0,o.tZ)(c.Y,{classNames:{root:B.radioOptionRoot,label:B.radioOptionLabel,labelWrapper:B.radioOptionLabelWrapper,inner:B.radioOptionInner},value:e.groupId,label:g?(0,o.tZ)(n.x,{"data-event-category":"Service Connection","data-event-action":"Select Audience","data-event-label":k,"data-event-audience":e.label,className:"item pointer-event-child-none",children:(0,o.tZ)("img",{src:f?l.C.getAssetPath(I?"".concat(v,"/option").concat(t+1,"_mobile.png"):"".concat(v,"/option").concat(t+1,".png")):e.icon,loading:"lazy",alt:e.label})}):(0,o.tZ)(CarePathOption,{"data-event-category":"Service Connection","data-event-action":"Select Audience","data-event-label":k,"data-event-audience":e.label,className:"item pointer-event-child-none",classNames:{root:B.optionRoot,wrapper:B.optionWrapper,thumbnail:B.optionThumbnail,heading:B.optionHeading},...e},String(t))},String(t)))})})]})})})})}}}]);