1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9475],{9475:(e,t,l)=>{l.r(t),l.d(t,{WishlistView:()=>_});var s=l(95155),a=l(12115),i=l(5772),r=l(94290),n=l(52530),o=l(24538),c=l(42869),d=l(7686),x=l(84980),h=l(49387),p=l(92564),m=l(57420),u=l(33210),f=l(86901),w=l(80642),b=l(55181),g=l(45249),y=l(110),j=l(45105),N=l(11622);function k(e,t){if(!(e&&"object"==typeof e&&!Array.isArray(e)))return null;let l=e[t];return"string"==typeof l?l:null}let v="kdoc-wishlist-v2",A="kdoc-wishlist";function S(e){N.A.set(v,JSON.stringify(e)),N.A.set(A,JSON.stringify(e.map(e=>e.id)))}function _({nav:e,events:t=[],procedures:l=[],doctors:T=[],currentHospital:C}){let{t:F}=(0,y.ok)(),E=(0,y.zJ)(),P=(e,t)=>k(F.chat,e)??k(F,e)??t,[I,M]=(0,a.useState)([]),[D,$]=(0,a.useState)([]),[O,J]=(0,a.useState)(!0),[R,z]=(0,a.useState)("all"),[H,L]=(0,a.useState)(null),[W,Y]=(0,a.useState)("");(0,a.useEffect)(()=>{K()},[C?.id,t.length,l.length,T.length]);let K=async()=>{J(!0);let e=function(){let e=N.A.get(v);if(e)try{return JSON.parse(e)}catch{}let t=N.A.get(A);if(t)try{return JSON.parse(t).map(e=>({id:e,savedAt:Date.now()}))}catch{}return[]}();$(e);let s=e.map(e=>e.id);if(0===s.length){M([]),J(!1);return}M([...t.map(e=>({...e,_wishType:"event"})),...l.map(e=>({...e,_wishType:"procedure"})),...C?[{...C,_wishType:"hospital"}]:[],...T.map(e=>({...e,_wishType:"doctor"}))].filter(e=>s.includes(String(e.id)))),J(!1)},V=e=>{let t=D.map(t=>t.id===e?{...t,memo:W||void 0}:t);$(t),S(t),L(null),Y("")},B=(0,a.useMemo)(()=>"all"===R?I:I.filter(e=>e._wishType===R),[I,R]),G=(0,a.useMemo)(()=>({all:I.length,procedure:I.filter(e=>"procedure"===e._wishType).length,event:I.filter(e=>"event"===e._wishType).length,hospital:I.filter(e=>"hospital"===e._wishType).length,doctor:I.filter(e=>"doctor"===e._wishType).length}),[I]),U=e=>"object"==typeof e.hospital&&e.hospital?String(E(e.hospital,"name",{rawFallback:e.hospital.name,allowSourceIdentifierFallback:!0})||""):"",q=e=>{let t=Number(e);return t>0?t.toLocaleString()+P("exploreCurrency","KRW"):""},Q=[{key:"all",label:P("wishlistAll","All"),icon:null},{key:"procedure",label:P("wishlistProcedure","Procedure"),icon:(0,s.jsx)(r.A,{className:"w-3 h-3"})},{key:"event",label:P("wishlistEvent","Event"),icon:(0,s.jsx)(n.A,{className:"w-3 h-3"})},{key:"hospital",label:P("wishlistHospital","Hospital"),icon:(0,s.jsx)(o.A,{className:"w-3 h-3"})},{key:"doctor",label:P("wishlistDoctor","Doctor"),icon:(0,s.jsx)(c.A,{className:"w-3 h-3"})}];return O?(0,s.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,s.jsx)("div",{className:"animate-pulse text-slate-400 text-sm",children:"Loading..."})}):(0,s.jsx)("div",{className:"pt-6 pb-24 min-h-screen",children:(0,s.jsxs)("div",{className:"w-full space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{className:"text-xl font-bold text-slate-800 dark:text-slate-100",children:F.wishlist?.title||"Wishlist"}),I.length>0&&(0,s.jsx)("p",{className:"text-xs text-slate-400 mt-0.5",children:P("wishlistCount","{count} saved").replace("{count}",String(I.length))})]}),I.length>0&&(0,s.jsx)("div",{className:"flex gap-2 overflow-x-auto [&::-webkit-scrollbar]:hidden",children:Q.filter(e=>"all"===e.key||G[e.key]>0).map(e=>(0,s.jsxs)("button",{onClick:()=>z(e.key),className:(0,g.cn)("flex items-center gap-1.5 px-3 py-1.5 rounded-full text-xs font-bold whitespace-nowrap shrink-0 transition-all",R===e.key?"bg-blue-50 text-blue-600 shadow-sm ring-1 ring-blue-100":"kd-patient-glass-chip text-slate-600"),children:[e.icon," ",e.label," ",(0,s.jsx)("span",{className:(0,g.cn)("text-xs",R===e.key?"text-white/70":"text-slate-400"),children:G[e.key]})]},e.key))}),0===I.length&&(0,s.jsxs)("div",{className:"flex flex-col items-center justify-center py-20 text-center space-y-4",children:[(0,s.jsx)("div",{className:"w-20 h-20 rounded-full bg-white/40 dark:bg-white/10 border border-slate-200/70 dark:border-white/10 shadow-[0_18px_48px_rgba(15,23,42,0.08)] kd-backdrop-xl flex items-center justify-center",children:(0,s.jsx)(d.A,{className:"w-10 h-10 text-blue-500"})}),(0,s.jsx)("h2",{className:"text-lg font-bold text-slate-700 dark:text-slate-300",children:F.wishlist?.emptyTitle||"No saved items"}),(0,s.jsx)("button",{onClick:()=>e("home"),className:"mt-4 px-6 py-3 bg-slate-900 text-white rounded-2xl font-bold text-sm shadow-[0_14px_32px_rgba(15,23,42,0.16)] hover:bg-slate-800 transition-all",children:F.wishlist?.explore||P("wishlistExplore","Explore")})]}),(0,s.jsx)(w.N,{mode:"popLayout",children:(0,s.jsx)("div",{className:"space-y-3",children:B.map(t=>{let l=String(t.id),a=D.find(e=>e.id===l),n="hospital"===t._wishType,f="doctor"===t._wishType,y="event"===t._wishType,N=function(...e){for(let t of e)if("string"==typeof t&&t.trim())return t;return""}(t.img,t.image_url,t.cover_image,t.thumbnail_url),k=String(E(t,"name",{rawFallback:t.name,allowSourceIdentifierFallback:!0})||E(t,"title",{rawFallback:t.title,allowSourceIdentifierFallback:!0})||""),v=U(t),A=q(t.price||t.event_price),_=q(t.origin_price||t.originPrice),T=Number(t.discount_rate)||0,C=Number(t.rating||t.rate)||0,F=y?(e=>{if(!e)return null;let t=Math.ceil((new Date(String(e)).getTime()-Date.now())/864e5);return t>0?t:0===t?0:-1})(t.end_date):null,I=null!==F&&F<0;return(0,s.jsxs)(b.PY1.div,{layout:!0,initial:{opacity:0,y:10}
1,animate:{opacity:1,y:0},exit:{opacity:0,x:-100},className:(0,g.cn)("kd-surface-card overflow-hidden transition-all",I&&"opacity-50"),children:[(0,s.jsxs)("button",{onClick:()=>{e(y?"event-detail":n?"hospital":f?"doctor-detail":"procedure",t)},className:"w-full text-left flex group",children:[(0,s.jsxs)("div",{className:"relative w-28 h-28 shrink-0 overflow-hidden",children:[N?(0,s.jsx)(i.default,{src:(0,j.AE)(String(N)),fill:!0,sizes:"112px",alt:k,className:"object-cover"}):(0,s.jsx)("div",{className:"w-full h-full bg-gradient-to-br from-slate-100 to-slate-50 dark:from-zinc-800 dark:to-zinc-900 flex items-center justify-center",children:n?(0,s.jsx)(o.A,{className:"w-6 h-6 text-slate-300"}):f?(0,s.jsx)(c.A,{className:"w-6 h-6 text-slate-300"}):(0,s.jsx)(d.A,{className:"w-6 h-6 text-slate-300"})}),(0,s.jsx)("span",{className:(0,g.cn)("absolute top-1.5 left-1.5 px-1.5 py-0.5 rounded text-[8px] font-bold uppercase",y?"bg-teal-500 text-white":n?"bg-emerald-500 text-white":f?"bg-cyan-500 text-white":"bg-teal-500 text-white"),children:y?"EVENT":n?"HOSPITAL":f?"DOCTOR":"PROCEDURE"}),null!==F&&F>=0&&(0,s.jsxs)("span",{className:(0,g.cn)("absolute bottom-1.5 left-1.5 px-1.5 py-0.5 rounded text-[11px] font-bold flex items-center gap-0.5",F<=3?"bg-teal-500 text-white animate-pulse":F<=7?"bg-amber-500 text-white":"bg-black/50 text-white kd-backdrop-sm"),children:[(0,s.jsx)(x.A,{className:"w-2.5 h-2.5"})," D-",F]}),I&&(0,s.jsx)("span",{className:"absolute bottom-1.5 left-1.5 px-1.5 py-0.5 rounded bg-slate-500 text-white text-[11px] font-bold",children:P("wishlistExpired","Ended")})]}),(0,s.jsxs)("div",{className:"flex-1 min-w-0 p-3 flex flex-col",children:[(0,s.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,s.jsx)("p",{className:"text-sm font-bold text-slate-800 dark:text-slate-200 line-clamp-1 group-hover:text-teal-500 transition-colors",children:k}),a&&(0,s.jsx)("span",{className:"text-[11px] text-slate-400 whitespace-nowrap shrink-0 mt-0.5",children:(e=>{let t=Math.floor((Date.now()-e)/6e4);if(t<60)return P("wishlistJustNow","Just now");let l=Math.floor(t/60);if(l<24)return`${l}${P("wishlistHoursAgo","h ago")}`;let s=Math.floor(l/24);return s<30?`${s}${P("wishlistDaysAgo","d ago")}`:`${Math.floor(s/30)}${P("wishlistMonthsAgo","mo ago")}`})(a.savedAt)})]}),v&&(0,s.jsxs)("p",{className:"text-xs text-slate-400 mt-0.5 flex items-center gap-0.5",children:[(0,s.jsx)(o.A,{className:"w-2.5 h-2.5"}),v]}),n&&!!t.location&&(0,s.jsxs)("p",{className:"text-xs text-slate-400 mt-0.5 flex items-center gap-0.5",children:[(0,s.jsx)(o.A,{className:"w-2.5 h-2.5"}),String(E(t,"location",{rawFallback:t.location}))]}),f&&(0,s.jsx)("p",{className:"text-xs text-cyan-500 font-semibold mt-0.5",children:String(E(t,"department",{rawFallback:t.department,allowSourceIdentifierFallback:!0})||E(t,"position",{rawFallback:t.position,allowSourceIdentifierFallback:!0})||"")}),a?.memo&&H!==l&&(0,s.jsxs)("p",{className:"text-xs text-teal-500 mt-1 flex items-center gap-1 italic",children:[(0,s.jsx)(h.A,{className:"w-2.5 h-2.5"})," ",a.memo]}),(0,s.jsx)("div",{className:"flex items-end justify-between mt-auto pt-1",children:(0,s.jsxs)("div",{className:"flex items-baseline gap-1.5",children:[A&&(0,s.jsx)("span",{className:"font-bold text-sm text-slate-800 dark:text-slate-200",children:A}),_&&A!==_&&(0,s.jsx)("span",{className:"text-xs text-slate-400 line-through",children:_}),T>0&&(0,s.jsxs)("span",{className:"text-xs font-bold text-teal-500",children:[T,"%"]}),C>0&&(0,s.jsxs)("span",{className:"inline-flex items-center gap-0.5 text-xs text-amber-500 font-bold",children:[(0,s.jsx)(r.A,{className:"w-2.5 h-2.5 fill-amber-400 text-amber-400"}),C.toFixed(1)]})]})})]})]}),(0,s.jsxs)("div",{className:"flex items-center border-t border-slate-100 dark:border-white/5",children:[(0,s.jsxs)("button",{onClick:l=>{let s,a;return l.stopPropagation(),s=String(E(t,"name",{rawFallback:t.name,allowSourceIdentifierFallback:!0})||E(t,"title",{rawFallback:t.title,allowSourceIdentifierFallback:!0})||""),void e("chat",{initialMessage:(a=U(t))?`${s} (${a}
1)ì ëí´ ìì¸í ìë ¤ì£¼ì¸ì`:`${s}ì ëí´ ìì¸í ìë ¤ì£¼ì¸ì`})},className:"flex-1 flex items-center justify-center gap-1.5 py-2.5 text-[11px] font-bold text-teal-500 hover:bg-teal-50 dark:hover:bg-teal-500/10 transition-colors",children:[(0,s.jsx)(p.A,{className:"w-3.5 h-3.5"})," ",P("wishlistConsult","Consult")]}),(0,s.jsx)("div",{className:"w-px h-5 bg-slate-100 dark:bg-white/5"}),("procedure"===t._wishType||"event"===t._wishType)&&!I&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("button",{onClick:l=>{l.stopPropagation(),e("reservation",t)},className:"flex-1 flex items-center justify-center gap-1.5 py-2.5 text-[11px] font-bold text-emerald-500 hover:bg-emerald-50 dark:hover:bg-emerald-500/10 transition-colors",children:[(0,s.jsx)(m.A,{className:"w-3.5 h-3.5"})," ",P("wishlistReserve","Book")]}),(0,s.jsx)("div",{className:"w-px h-5 bg-slate-100 dark:bg-white/5"})]}),(0,s.jsx)("button",{onClick:e=>{e.stopPropagation(),L(H===l?null:l),Y(a?.memo||"")},className:"flex items-center justify-center gap-1.5 px-4 py-2.5 text-[11px] font-bold text-slate-400 hover:bg-slate-50 dark:hover:bg-white/5 transition-colors",children:(0,s.jsx)(h.A,{className:"w-3 h-3"})}),(0,s.jsx)("div",{className:"w-px h-5 bg-slate-100 dark:bg-white/5"}),(0,s.jsx)("button",{onClick:e=>{let t;return e.stopPropagation(),void($(t=D.filter(e=>e.id!==l)),S(t),M(e=>e.filter(e=>String(e.id)!==l)))},className:"flex items-center justify-center gap-1.5 px-4 py-2.5 text-[11px] font-bold text-teal-400 hover:bg-teal-50 dark:hover:bg-teal-500/10 transition-colors",children:(0,s.jsx)(d.A,{className:"w-3 h-3 fill-current"})})]}),(0,s.jsx)(w.N,{children:H===l&&(0,s.jsx)(b.PY1.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},className:"overflow-hidden border-t border-slate-100 dark:border-white/5",children:(0,s.jsxs)("div",{className:"p-3 flex gap-2",children:[(0,s.jsx)("input",{type:"text",value:W,onChange:e=>Y(e.target.value),placeholder:P("wishlistMemoPlaceholder","Add a note (e.g. friend recommendation)"),className:"flex-1 px-3 py-2 bg-white/50 dark:bg-white/5 border border-slate-200/50 dark:border-white/10 rounded-xl text-xs text-slate-700 dark:text-slate-300 placeholder:text-slate-400 focus:outline-none focus:ring-2 focus:ring-teal-500/30",autoFocus:!0,onKeyDown:e=>{"Enter"===e.key&&V(l)}}),(0,s.jsx)("button",{onClick:()=>V(l),className:"px-3 py-2 bg-teal-500 text-white rounded-xl text-xs font-bold",children:P("wishlistMemoSave","Save")}),(0,s.jsx)("button",{onClick:()=>L(null),className:"px-2 py-2 text-slate-400 hover:text-slate-600",children:(0,s.jsx)(u.A,{className:"w-4 h-4"})})]})})})]},l)})})}),I.filter(e=>"procedure"===e._wishType||"event"===e._wishType).length>=2&&(0,s.jsxs)(b.PY1.button,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},onClick:()=>{let t=I.filter(e=>"procedure"===e._wishType||"event"===e._wishType).map(e=>String(E(e,"name",{rawFallback:e.name,allowSourceIdentifierFallback:!0})||E(e,"title",{rawFallback:e.title,allowSourceIdentifierFallback:!0})||"")).slice(0,3).join(", ");e("chat",{initialMessage:`Please compare these procedures: ${t}`})},className:"w-full bg-gradient-to-r from-teal-500/10 to-cyan-500/10 border border-teal-200/50 dark:border-teal-500/20 rounded-2xl p-4 flex items-center gap-3 text-left hover:shadow-md transition-all group",children:[(0,s.jsx)("div",{className:"w-10 h-10 rounded-full bg-teal-100 dark:bg-teal-500/20 flex items-center justify-center shrink-0",children:(0,s.jsx)(f.A,{className:"w-5 h-5 text-teal-500"})}),(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsx)("p",{className:"text-sm font-bold text-teal-600 dark:text-teal-400",children:P("wishlistAiCompare","Compare with AI")}),(0,s.jsx)("p",{className:"text-xs text-slate-400",children:P("wishlistAiCompareSub","Get an AI-powered comparison of your saved procedures")})]})]})]})})}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.