PageSourceSearch

https://ugo-hk.com/assets/_next/static/chunks/7655.eac8a68b875ff768.js

js ugo-hk.com collected 2026-10-02 18:41:35 UTC 27,786 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7655],{15516:(e,t,s)=>{s.d(t,{A:()=>u});var a=s(95155),r=s(34435),l=s(25016),i=s(15239),n=s(52619),c=s.n(n),o=s(12115),d=s(52827),p=s(42107);let x=[{text:"人氣好去處",colorClass:"border-[#5ab0f5] [.selected]:text-[#5ab0f5]"},{text:"熱門演唱會",colorClass:"border-[#a85fea] [.selected]:text-[#a85fea]"}],m=e=>{let{posIcon:t,href:s,position:n,title:o,suffixIcon:d,onItemClick:p}=e;return(0,a.jsxs)(c(),{className:"mx-[21px] pb-[7.5px] desktop:py-2 border-b-1 last:border-b-0 desktop:border-b-0  flex items-center gap-2",href:s,prefetch:!1,onClick:()=>{p&&p(),(0,l.QX)(o),(0,r.rz)({event_name:"place_ranking_tap",section:"人氣好去處",clickurl:s,text:o,position:"search_bar"})},children:[(0,a.jsx)(i.default,{className:"-ml-[21px] desktop:w-6 desktop:h-6",src:t,alt:"Position Icon",width:30,height:30}),(0,a.jsx)("div",{className:"grow truncate text-foreground desktop:text-sm leading-[45px] desktop:leading-5 ".concat(1===n?"font-semibold":"font-medium"),children:o}),d&&(0,a.jsx)(i.default,{className:"-mr-[12px]",src:d,alt:"Suffix Icon",width:16,height:16})]})},h=e=>{let{artistName:t,imageLink:s,href:n,position:o,posIcon:d,onItemClick:p}=e;return(0,a.jsxs)(c(),{className:"mx-[21px] pb-[7.5px] desktop:py-0 border-b-1 last:border-b-0 desktop:border-b-0  flex items-center gap-2",href:n,prefetch:!1,onClick:()=>{p&&p(),(0,l.QX)(t),(0,r.rz)({event_name:"place_search_input",text:t,section:"熱門演唱會",position:"search_bar"})},children:[d&&(0,a.jsx)(i.default,{className:"-ml-[21px] desktop:w-[22px] desktop:h-6 object-cover",src:d,alt:"Position Icon",width:30,height:30}),(0,a.jsx)(i.default,{src:s,alt:t,width:40,height:40,className:"rounded-xs object-cover w-10 h-10"}),(0,a.jsx)("div",{className:"grow truncate text-foreground desktop:text-sm leading-[45px] desktop:leading-5 ".concat(1===o?"font-semibold":"font-medium"),children:t})]})},u=e=>{let{onItemClick:t}=e,s=(0,d.Ub)({maxWidth:1079}),[r,i]=(0,o.useState)(x[0].text),[n,c]=(0,o.useState)([]),[u,f]=(0,o.useState)([]),[g,j]=(0,o.useState)([]),[v,b]=(0,o.useState)(!1),[N,y]=(0,o.useState)(!1),[w,k]=(0,o.useState)(!0);(0,o.useEffect)(()=>{s?(k(!0),"人氣好去處"===r?fetch("".concat("https://app07.ulifestyle.com.hk/api/v1/appranking","?channel=place")).then(e=>{if(!e.ok)throw Error("Failed to fetch ranking data");return e.json()}).then(e=>{"ok"===e.status&&e.data.items?j(e.data.items):j([])}).catch(()=>j([])).finally(()=>k(!1)):"熱門演唱會"===r&&fetch("".concat("https://app07.ulifestyle.com.hk/api/v1/artist","/getListingArtist?sortby=modifieddate&order=desc")).then(e=>{if(!e.ok)throw Error("Failed to fetch artist data");return e.json()}).then(e=>{"ok"===e.status&&e.payload?j(e.payload):j([])}).catch(()=>j([])).finally(()=>k(!1))):(k(!0),b(!0),y(!0),Promise.all([fetch("".concat("https://app07.ulifestyle.com.hk/api/v1/appranking","?channel=place")).then(e=>e.ok?e.json():Promise.reject()).then(e=>{"ok"===e.status&&e.data.items?c(e.data.items):c([])}).catch(()=>c([])).finally(()=>b(!1)),fetch("".concat("https://app07.ulifestyle.com.hk/api/v1/artist","/getListingArtist?sortby=modifieddate&order=desc")).then(e=>e.ok?e.json():Promise.reject()).then(e=>{"ok"===e.status&&e.payload?f(e.payload):f([])}).catch(()=>f([])).finally(()=>y(!1))]).finally(()=>k(!1)))},[s,r]);let _=()=>(0,a.jsxs)("div",{className:"pb-[7.5px] mx-[21px] border-b border-gray-300 animate-pulse flex items-center gap-2",children:[(0,a.jsx)("div",{className:"-ml-[21px] w-[30px] h-[30px] bg-secondary rounded"}),(0,a.jsx)("div",{className:"grow h-[45px] bg-secondary rounded"}),(0,a.jsx)("div",{className:"-mr-[12px] w-[16px] h-[16px] bg-secondary rounded"})]}),A=()=>(0,a.jsxs)("div",{className:"pb-[7.5px] mx-[21px] border-b border-secondary animate-pulse flex items-center gap-2",children:[(0,a.jsx)("div",{className:"-ml-[21px] w-[30px] h-[30px] bg-secondary rounded"}),(0,a.jsx)("div",{className:"w-10 h-10 bg-secondary rounded-sm"}),(0,a.jsx)("div",{className:"h-[45px] bg-secondary rounded w-[120px]"})]});return s?(0,a.jsxs)("div",{className:"mt-[30px] space-y-2",children:[(0,a.jsx)("div",{className:"flex items-center gap-[30px]",children:x.map(e=>{let{text:t,colorClass:s}=e;return(0,a.jsx)(p.A,{text:t,selected:r===t,onClick:()=>i(t),className:"\n              w-[40px] mb-2 mx-[25px] leading-[22px]\n              text-lg text-muted-light-foreground\n              hover:bg-background\n              font-normal pb-1.5 px-0 [.selected]:font-semibold ".concat(s,"\n            ")},t)})}),(0,a.jsx)("div",{className:"space-y-[7px]",children:w?"人氣好去處"===r?Array.from({length:5}).map((e,t)=>(0,a.jsx)(_,{},t)):Array.from({length:5}).map((e,t)=>(0,a.jsx)(A,{},t)):0===g.length?(0,a.jsx)("p",{className:"text-muted-light-foreground",children:"No items found"}):g.slice(0,5).map((e,s)=>"postId"in e?(0,a.jsx)(m,{posIcon:e.posIcon,href:e.webLink,position:e.position,title:e.shortTitle,suffixIcon:e.icon,onItemClick:t},e.postId):(0,a.jsx)(h,{position:s+1,posIcon:e.posIcon,artistName:e.artistName,imageLink:e.imageLink,href:(0,l.U7)({q:e.artistName}),onItemClick:t},e.artistName))})]}):(0,a.jsxs)("div",{className:"mt-[30px] flex gap-4",children:[(0,a.jsxs)("div",{className:"w-[276px] mb-3.5 p-3 bg-[#fafafa] rounded-xl space-y-4",children:[(0,a.jsx)("h3",{className:"text-base text-[#5ab0f5] font-semibold leading-[22px]",children:"人氣好去處"}),v?Array.from({length:5}).map((e,t)=>(0,a.jsx)(_,{},t)):0===n.length?(0,a.jsx)("p",{children:"No places found"}):n.slice(0,5).map(e=>(0,a.jsx)(m,{posIcon:e.posIcon,href:e.webLink,position:e.position,title:e.shortTitle,suffixIcon:e.icon,onItemClick:t},e.postId))]}),(0,a.jsxs)("div",{className:"w-[276px] mb-3.5 p-3 bg-[#fafafa] rounded-xl space-y-4",children:[(0,a.jsx)("h3",{className:"text-base text-[#a85fea] font-semibold leading-[22px]",children:"熱門演唱會"}),N?Array.from({length:5}).map((e,t)=>(0,a.jsx)(A,{},t)):0===u.length?(0,a.jsx)("p",{children:"No artists found"}):u.slice(0,5).map((e,s)=>(0,a.jsx)(h,{position:s+1,posIcon:e.posIcon,artistName:e.artistName,imageLink:e.imageLink,href:(0,l.U7)({q:e.artistName}),onItemClick:t},e.artistName))]})]})}},18926:(e,t,s)=>{s.d(t,{A:()=>k});var a=s(95155),r=s(15239),l=s(12115),i=s(25016),n=s(20063),c=s(52827),o=s(14202);let d=l.forwardRef((e,t)=>
1{let{imgSrc:s,name:l,selected:i,loading:n,...c}=e;return(0,a.jsxs)("div",{ref:t,className:"min-w-0 desktop:basis-1/2 py-2.5 pl-3 pr-2 rounded-[20px] bg-white  basis-[calc(50%-2.5px)] cursor-pointer flex items-center gap-1",...c,children:[(0,a.jsx)(r.default,{src:s,alt:l,width:15,height:15}),(0,a.jsx)("div",{className:"text-[#0f294d] text-sm desktop:text-sm font-medium truncate",children:i.length?i.join("、"):l}),n?(0,a.jsx)(o.E,{className:"ml-auto w-4 h-4"}):(0,a.jsx)(r.default,{className:"ml-auto",src:n?"/images/icons/spinner.gif":"/images/icons/arrow-down.svg",alt:"Open the Filter",width:10,height:15})]})});d.displayName="SearchFilter";var p=s(33174),x=s(52171),m=s(87964),h=s(82058),u=s(34435);let f="任何",g=(0,l.forwardRef)((e,t)=>{let{selected:s,loading:r,...l}=e;return(0,a.jsx)(d,{ref:t,imgSrc:"/images/icons/event-v2.png",name:"活動分類",selected:s,loading:r,...l})});g.displayName="TriggerButton";let j=e=>{let{categories:t,selectedCategories:s,setSelectedCategories:o,onSubmit:d}=e,j=(0,n.useRouter)(),v=(0,c.Ub)({maxWidth:1079}),[b,N]=(0,l.useState)(!1),[y,w]=(0,l.useState)(!1),[k,_]=(0,l.useState)(s);(0,l.useEffect)(()=>{b&&_(s)},[b,s]),(0,l.useEffect)(()=>w(!0),[]);let A=()=>{o(k),N(!1),d&&d(),j.push((0,i.U7)({categories:k.join(",")})),(0,u.rz)({event_name:"place_search_filter",text:k.join(","),function:"category",position:"search_bar"})};if(!y||!t.length)return(0,a.jsx)(g,{selected:[],loading:!0});let C=()=>(0,a.jsx)("div",{className:"py-2.5 px-4 desktop:p-[25px] flex flex-wrap gap-1.5 desktop:gap-2",children:t.map(e=>(0,a.jsx)(p.A,{selected:k.includes(e),onClick:()=>(e=>_(t=>e!==f&&t.includes(f)?[e]:t.includes(e)?t.filter(t=>t!==e):e===f?[f]:[...t,e]))(e),className:"h-7 desktop:h-7.5",children:e},e))}),S=()=>(0,a.jsxs)("div",{className:"pt-2 pb-10 desktop:pb-6 px-4 desktop:px-[25px] grid grid-cols-2 gap-2 desktop:gap-4",children:[(0,a.jsx)(x.$,{className:"rounded-lg border border-[#3087d9] text-base text-[#3087d9] hover:text-[#3087d9] cursor-pointer",variant:"outline",onClick:()=>_([]),children:"重設"}),(0,a.jsx)(x.$,{className:"rounded-lg bg-[#3087d9] text-base text-white font-medium cursor-pointer",onClick:A,children:"確定"})]});return v?(0,a.jsxs)(m._s,{open:b,onOpenChange:N,children:[(0,a.jsx)(m.Uz,{asChild:!0,children:(0,a.jsx)(g,{selected:s})}),(0,a.jsx)(m.QP,{}),(0,a.jsxs)(m.zj,{children:[(0,a.jsxs)(m.BE,{className:"pb-2.5",children:[(0,a.jsxs)(m.gk,{className:"flex justify-center items-center gap-1",children:[(0,a.jsx)(r.default,{src:"/images/icons/event-v2.png",alt:"活動分類",width:18,height:18}),(0,a.jsx)("span",{className:"text-[17px] text-foreground font-medium",children:"活動分類"})]}),(0,a.jsx)(m.I6,{className:"hidden"})]}),C(),S(),(0,a.jsx)(m.cp,{className:"absolute top-4 right-4 cursor-pointer",children:(0,a.jsx)(r.default,{src:"/images/icons/close-circled.svg",alt:"Close the Drawer",width:18,height:18})})]})]}):(0,a.jsxs)(h.AM,{open:b,onOpenChange:N,children:[(0,a.jsx)(h.Wv,{asChild:!0,children:(0,a.jsx)(g,{selected:s})}),(0,a.jsxs)(h.hl,{className:"w-[562px] p-0 rounded-3xl shadow-[0_1px_4px_0_rgba(0,0,0,0.04),0_4px_32px_0px_rgba(0,0,0,0.1)]",align:"start",children:[C(),S()]})]})};var v=s(38313);let b=(e,t)=>{let s=new URLSearchParams(location.search);e.length?s.set("location",e.join(",")):s.delete("location"),window.history.pushState(null,"","".concat(location.pathname,"?").concat(s.toString().replaceAll("%2C",","))),(0,u.rz)({event_name:"place_search_filter",position:t?"top":"side_bar",text:e.length?e.toString():void 0,function:"district"})},N=e=>{let{mainDistrict:{sub_district_name:t,districts:s},selected:r,setSelected:l,isSearchPage:n,isMobile:c,className:o}=e,d=s.some(e=>r.includes(e.district_name));return(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsxs)("div",{className:"flex justify-between items-center gap-0.5",children:[(0,a.jsx)("span",{className:"text-primary text-2xl text-nowrap font-semibold",children:t}),(0,a.jsx)(v.A,{checked:d,handleSelected:()=>{let e=new Set(s.map(e=>e.district_name));l(t=>{let s=d?t.filter(t=>!e.has(t)):Array.from(new Set([...t,...e]));return n&&!c&&setTimeout(()=>b(s,!1),0),s})}})]}),(0,a.jsx)("div",{className:"flex flex-wrap items-center gap-1.5",children:s.map(e=>{let{district_name:t}=e;return(0,a.jsx)(p.A,{selected:r.includes(t),onClick:()=>(e=>{l(t=>{let s=r.includes(e)?t.filter(t=>t!==e):[...t,e];return n&&!c&&setTimeout(()=>b(s,!1),0),s})})(t),className:(0,i.cn)("desktop:text-[13px] desktop:px-2.5",o),children:t},t)})})]})},y=(0,l.forwardRef)((e,t)=>{let{selected:s,loading:r,...l}=e;return(0,a.jsx)(d,{ref:t,imgSrc:"/images/icons/address.svg",name:"地區",selected:s,loading:r,...l})});y.displayName="TriggerButton";let w=e=>{let{mainDistricts:t,selectedDistrictNames:s,setSelectedDistrictNames:o,onSubmit:d}=e,p=(0,n.useRouter)(),f=(0,c.Ub)({maxWidth:1079}),[g,j]=(0,l.useState)(!1),[v,b]=(0,l.useState)(!1),[w,k]=(0,l.useState)(s);(0,l.useEffect)(()=>{v&&k(s)},[v,s]),(0,l.useEffect)(()=>j(!0),[]);let _=()=>{o(w),b(!1),d&&d(),p.push((0,i.U7)({districtNames:w.join(",")})),(0,u.rz)({event_name:"place_search_filter",text:w.join(","),function:"district",position:"search_bar"})};if(!g||!t.length)return(0,a.jsx)(y,{selected:[],loading:!0});let A=()=>(0,a.jsx)("div",{className:"overflow-y-auto max-h-[430px] pt-[11px] desktop:pt-[25px] pb-16 desktop:pb-8  px-4 desktop:px-[25px]  grid grid-cols-2 desktop:grid-cols-3 gap-x-[17px] desktop:gap-x-5 gap-y-6",children:t.map(e=>(0,a.jsx)(N,{mainDistrict:e,selected:w,setSelected:k,className:"h-6.5"},e.sub_district_name))}),C=()=>(0,a.jsxs)("div",{className:"pt-2 pb-10 desktop:pb-6 px-4 desktop:px-[25px] grid grid-cols-2 gap-2 desktop:gap-4",children:[(0,a.jsx)(x.$,{className:"rounded-lg border border-[#3087d9] text-base text-[#3087d9] hover:text-[#3087d9] cursor-pointer",variant:"outline",onClick:()=>k([]),children:"重設所有"}),(0,a.jsx)(x.$,{className:"rounded-lg bg-[#3087d9] text-base text-white font-medium cursor-pointer",onClick:_,children:"確å
1®š"})]});return f?(0,a.jsxs)(m._s,{open:v,onOpenChange:b,children:[(0,a.jsx)(m.Uz,{asChild:!0,children:(0,a.jsx)(y,{selected:s})}),(0,a.jsx)(m.QP,{}),(0,a.jsxs)(m.zj,{children:[(0,a.jsxs)(m.BE,{className:"pb-2.5",children:[(0,a.jsxs)(m.gk,{className:"flex justify-center items-center gap-1",children:[(0,a.jsx)(r.default,{src:"/images/icons/address.svg",alt:"地區",width:20,height:20}),(0,a.jsx)("span",{className:"text-[17px] text-[#333] font-medium",children:"地區"})]}),(0,a.jsx)(m.I6,{className:"hidden"})]}),A(),C(),(0,a.jsx)(m.cp,{className:"absolute top-4 right-4 cursor-pointer",children:(0,a.jsx)(r.default,{src:"/images/icons/close-circled.svg",alt:"Close the Drawer",width:18,height:18})})]})]}):(0,a.jsxs)(h.AM,{open:v,onOpenChange:b,children:[(0,a.jsx)(h.Wv,{asChild:!0,children:(0,a.jsx)(y,{selected:s})}),(0,a.jsxs)(h.hl,{className:"w-[582px] p-0 rounded-3xl shadow-[0_1px_4px_0_rgba(0,0,0,0.04),0_4px_32px_0px_rgba(0,0,0,0.1)]",align:"end",children:[A(),C()]})]})},k=e=>{let{onSubmit:t}=e,[s,i]=(0,l.useState)([]),[n,c]=(0,l.useState)([]),[o,d]=(0,l.useState)([]),[p,x]=(0,l.useState)([]);return(0,l.useEffect)(()=>{(async()=>{try{let[e,t]=await Promise.all([fetch("https://app08.ulifestyle.com.hk/place/search/categories").then(e=>e.json()),fetch("https://app07.ulifestyle.com.hk/api/v1/place/getAppDistrictListing?show=webv2").then(e=>e.json())]);i(e.data),c(t.payload.main_district)}catch(e){console.error("Error fetching data:",e)}})()},[]),(0,a.jsxs)("div",{className:"mt-4 bg-[#e4f7ff] pt-[13px] pb-[11px] px-4 rounded-xl  flex flex-col desktop:flex-row gap-2 desktop:gap-5",children:[(0,a.jsxs)("div",{className:"shrink-0 flex items-center gap-2 desktop:gap-1.5",children:[(0,a.jsx)(r.default,{src:"/images/icons/ugo.png",alt:"探索好去處",width:20,height:20}),(0,a.jsx)("div",{className:"text-lg desktop:text-base text-foreground font-semibold leading-[25px] desktop:leading-[22px]",children:"探索好去處"})]}),(0,a.jsxs)("div",{className:"w-full flex gap-[5px] desktop:gap-2",children:[(0,a.jsx)(j,{categories:s,selectedCategories:o,setSelectedCategories:d,onSubmit:t}),(0,a.jsx)(w,{mainDistricts:n,selectedDistrictNames:p,setSelectedDistrictNames:x,onSubmit:t})]})]})}},24374:(e,t,s)=>{s.d(t,{A:()=>m});var a=s(95155),r=s(25016),l=s(15239),i=s(20063),n=s(12115),c=s(52827),o=s(31448),d=s(32964),p=s(52171),x=s(34435);let m=e=>{let{onItemClick:t,searchType:s}=e,m=(0,i.useRouter)(),h=(0,c.Ub)({maxWidth:1079}),[u,f]=(0,n.useState)([]),[g,j]=(0,n.useState)(!1),[v,b]=(0,n.useState)(!0),N=h?4:8;(0,n.useEffect)(()=>{(async()=>{b(!0);try{let e=await fetch("/api/search/history");if(e.ok){let t=await e.json();f(t)}else console.error("Failed to clear cookie")}catch(e){console.error("Error clearing cookie:",e)}finally{b(!1)}})()},[]);let y=async()=>{try{(await fetch("/api/search/history",{method:"DELETE"})).ok?(f([]),j(!1)):console.error("Failed to clear cookie")}catch(e){console.error("Error clearing cookie:",e)}},w=g?u.slice(0,h?10:20):u.slice(0,N);return v?(0,a.jsxs)("div",{className:"mt-5 flex flex-col gap-4",children:[(0,a.jsx)("div",{className:"text-lg text-[#384047] font-semibold leading-[25px]",children:"最近搜尋"}),(0,a.jsx)("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-3",children:Array.from({length:N}).map((e,t)=>(0,a.jsx)("div",{className:"h-[30px] w-[60px] rounded-full bg-secondary animate-pulse"},t))})]}):0===u.length?null:(0,a.jsxs)("div",{className:"mt-5 flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex justify-between",children:[(0,a.jsx)("div",{className:"text-lg text-[#384047] font-semibold leading-[25px]",children:"最近搜尋"}),(0,a.jsxs)(o.Lt,{children:[(0,a.jsx)(o.tv,{asChild:!0,children:(0,a.jsx)(p.$,{className:"h-auto p-0 cursor-pointer",variant:"ghost",children:(0,a.jsx)(l.default,{src:"/images/icons/remove.png",width:16,height:18,alt:"remove history"})})}),(0,a.jsxs)(o.EO,{children:[(0,a.jsxs)(o.wd,{children:[(0,a.jsx)(o.r7,{children:"確認清除最近搜索?"}),(0,a.jsx)(o.$v,{className:"hidden"})]}),(0,a.jsxs)(o.ck,{children:[(0,a.jsx)(o.Zr,{className:"cursor-pointer",children:"取消"}),(0,a.jsx)(o.Rx,{className:"cursor-pointer",onClick:y,children:"確認"})]})]})]})]}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-3",children:[w.map((e,l)=>(0,a.jsx)(d.E,{variant:"search",onClick:()=>(e=>{t&&t(),m.push((0,r.U7)({q:e,type:s})),(0,x.rz)({event_name:"place_search_input",text:e,section:"最近搜尋",position:"search_bar"})})(e),children:e},l)),!g&&u.length>N&&(0,a.jsx)(p.$,{className:"h-[25px] w-[25px] p-0 bg-secondary rounded-full cursor-pointer",variant:"ghost",onClick:()=>j(!0),children:(0,a.jsx)(l.default,{src:"/images/icons/arrow-down-thin.svg",alt:"展開更多",width:12,height:12})})]})]})}},31448:(e,t,s)=>{s.d(t,{$v:()=>f,EO:()=>x,Lt:()=>c,Rx:()=>g,Zr:()=>j,ck:()=>h,r7:()=>u,tv:()=>o,wd:()=>m});var a=s(95155),r=s(12115),l=s(69722),i=s(25016),n=s(52171);let c=l.bL,o=l.l9,d=l.ZL,p=r.forwardRef((e,t)=>
1{let{className:s,...r}=e;return(0,a.jsx)(l.hJ,{className:(0,i.cn)("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",s),...r,ref:t})});p.displayName=l.hJ.displayName;let x=r.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsxs)(d,{children:[(0,a.jsx)(p,{}),(0,a.jsx)(l.UC,{ref:t,className:(0,i.cn)("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 sm:rounded-lg",s),...r})]})});x.displayName=l.UC.displayName;let m=e=>{let{className:t,...s}=e;return(0,a.jsx)("div",{className:(0,i.cn)("flex flex-col space-y-2 text-center sm:text-left",t),...s})};m.displayName="AlertDialogHeader";let h=e=>{let{className:t,...s}=e;return(0,a.jsx)("div",{className:(0,i.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...s})};h.displayName="AlertDialogFooter";let u=r.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)(l.hE,{ref:t,className:(0,i.cn)("text-lg font-semibold",s),...r})});u.displayName=l.hE.displayName;let f=r.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)(l.VY,{ref:t,className:(0,i.cn)("text-sm text-muted-foreground",s),...r})});f.displayName=l.VY.displayName;let g=r.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)(l.rc,{ref:t,className:(0,i.cn)((0,n.r)(),s),...r})});g.displayName=l.rc.displayName;let j=r.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)(l.ZD,{ref:t,className:(0,i.cn)((0,n.r)({variant:"outline"}),"mt-2 sm:mt-0",s),...r})});j.displayName=l.ZD.displayName},69722:(e,t,s)=>{s.d(t,{rc:()=>z,ZD:()=>T,UC:()=>L,VY:()=>F,hJ:()=>U,ZL:()=>R,bL:()=>D,hE:()=>O,l9:()=>I});var a=s(12115),r=s(3468),l=s(94446),i=s(30491);"undefined"!=typeof window&&window.document&&window.document.createElement;var n=s(32467),c=s(95155),o="AlertDialog",[d,p]=(0,r.A)(o,[i.Hs]),x=(0,i.Hs)(),m=e=>{let{__scopeAlertDialog:t,...s}=e,a=x(t);return(0,c.jsx)(i.bL,{...a,...s,modal:!0})};m.displayName=o;var h=a.forwardRef((e,t)=>{let{__scopeAlertDialog:s,...a}=e,r=x(s);return(0,c.jsx)(i.l9,{...r,...a,ref:t})});h.displayName="AlertDialogTrigger";var u=e=>{let{__scopeAlertDialog:t,...s}=e,a=x(t);return(0,c.jsx)(i.ZL,{...a,...s})};u.displayName="AlertDialogPortal";var f=a.forwardRef((e,t)=>{let{__scopeAlertDialog:s,...a}=e,r=x(s);return(0,c.jsx)(i.hJ,{...r,...a,ref:t})});f.displayName="AlertDialogOverlay";var g="AlertDialogContent",[j,v]=d(g),b=(0,n.Dc)("AlertDialogContent"),N=a.forwardRef((e,t)=>{let{__scopeAlertDialog:s,children:r,...n}=e,o=x(s),d=a.useRef(null),p=(0,l.s)(t,d),m=a.useRef(null);return(0,c.jsx)(i.G$,{contentName:g,titleName:y,docsSlug:"alert-dialog",children:(0,c.jsx)(j,{scope:s,cancelRef:m,children:(0,c.jsxs)(i.UC,{role:"alertdialog",...o,...n,ref:p,onOpenAutoFocus:function(e,t,{checkForDefaultPrevented:s=!0}={}){return function(a){if(e?.(a),!1===s||!a.defaultPrevented)return t?.(a)}}(n.onOpenAutoFocus,e=>{var t;e.preventDefault(),null==(t=m.current)||t.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:[(0,c.jsx)(b,{children:r}),(0,c.jsx)(E,{contentRef:d})]})})})});N.displayName=g;var y="AlertDialogTitle",w=a.forwardRef((e,t)=>{let{__scopeAlertDialog:s,...a}=e,r=x(s);return(0,c.jsx)(i.hE,{...r,...a,ref:t})});w.displayName=y;var k="AlertDialogDescription",_=a.forwardRef((e,t)=>{let{__scopeAlertDialog:s,...a}=e,r=x(s);return(0,c.jsx)(i.VY,{...r,...a,ref:t})});_.displayName=k;var A=a.forwardRef((e,t)=>{let{__scopeAlertDialog:s,...a}=e,r=x(s);return(0,c.jsx)(i.bm,{...r,...a,ref:t})});A.displayName="AlertDialogAction";var C="AlertDialogCancel",S=a.forwardRef((e,t)=>{let{__scopeAlertDialog:s,...a}=e,{cancelRef:r}=v(C,s),n=x(s),o=(0,l.s)(t,r);return(0,c.jsx)(i.bm,{...n,...a,ref:o})});S.displayName=C;var E=e=>{let{contentRef:t}=e,s="`".concat(g,"` requires a description for the component to be accessible for screen reader users.\n\nYou can add a de
1scription to the `").concat(g,"` by passing a `").concat(k,"` component as a child, which also benefits sighted users by adding visible context to the dialog.\n\nAlternatively, you can use your own component as a description by assigning it an `id` and passing the same value to the `aria-describedby` prop in `").concat(g,"`. If the description is confusing or duplicative for sighted users, you can use the `@radix-ui/react-visually-hidden` primitive as a wrapper around your description component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/alert-dialog");return a.useEffect(()=>{var e;document.getElementById(null==(e=t.current)?void 0:e.getAttribute("aria-describedby"))||console.warn(s)},[s,t]),null},D=m,I=h,R=u,U=f,L=N,z=A,T=S,O=w,F=_},75880:(e,t,s)=>{s.d(t,{A:()=>C});var a=s(95155),r=s(34435),l=s(25016),i=s(33476),n=s(62308);let c=function(){return n.A.Date.now()};var o=/\s/;let d=function(e){for(var t=e.length;t--&&o.test(e.charAt(t)););return t};var p=/^\s+/,x=s(59027),m=0/0,h=/^[-+]0x[0-9a-f]+$/i,u=/^0b[01]+$/i,f=/^0o[0-7]+$/i,g=parseInt;let j=function(e){if("number"==typeof e)return e;if((0,x.A)(e))return m;if((0,i.A)(e)){var t,s="function"==typeof e.valueOf?e.valueOf():e;e=(0,i.A)(s)?s+"":s}if("string"!=typeof e)return 0===e?e:+e;e=(t=e)?t.slice(0,d(t)+1).replace(p,""):t;var a=u.test(e);return a||f.test(e)?g(e.slice(2),a?2:8):h.test(e)?m:+e};var v=Math.max,b=Math.min;let N=function(e,t,s){var a,r,l,n,o,d,p=0,x=!1,m=!1,h=!0;if("function"!=typeof e)throw TypeError("Expected a function");function u(t){var s=a,l=r;return a=r=void 0,p=t,n=e.apply(l,s)}function f(e){var s=e-d,a=e-p;return void 0===d||s>=t||s<0||m&&a>=l}function g(){var e,s,a,r=c();if(f(r))return N(r);o=setTimeout(g,(e=r-d,s=r-p,a=t-e,m?b(a,l-s):a))}function N(e){return(o=void 0,h&&a)?u(e):(a=r=void 0,n)}function y(){var e,s=c(),l=f(s);if(a=arguments,r=this,d=s,l){if(void 0===o)return p=e=d,o=setTimeout(g,t),x?u(e):n;if(m)return clearTimeout(o),o=setTimeout(g,t),u(d)}return void 0===o&&(o=setTimeout(g,t)),n}return t=j(t)||0,(0,i.A)(s)&&(x=!!s.leading,l=(m="maxWait"in s)?v(j(s.maxWait)||0,t):l,h="trailing"in s?!!s.trailing:h),y.cancel=function(){void 0!==o&&clearTimeout(o),p=0,a=d=r=o=void 0},y.flush=function(){return void 0===o?n:N(c())},y};var y=s(15239),w=s(52619),k=s.n(w),_=s(12115),A=s(27199);let C=e=>{let{keyword:t,onItemClick:s,searchType:i}=e,[n,c]=(0,_.useState)([]),[o,d]=(0,_.useState)(!1),p="buffetSearch"===i,x=(0,_.useMemo)(()=>N(async e=>{if(!e){c([]),d(!1);return}d(!0);try{let t=await fetch("".concat("https://app07.ulifestyle.com.hk/api/v1/place/getSearchSuggestion","?keyword=").concat(encodeURIComponent(e),"&page=1&size=10").concat(p?"&mode=buffet":""));if(!t.ok)throw Error("Failed to fetch tags: ".concat(t.statusText));let{payload:s}=await t.json();c(s)}catch(e){console.error("Fetch error:",e),c([])}finally{d(!1)}},500),[p]);(0,_.useEffect)(()=>(x(t),()=>{x.cancel()}),[x,t]);let m=()=>{s&&s(),(0,r.rz)({event_name:"place_search_input",text:t,section:"搜尋建議",position:"search_bar"})};return(0,a.jsxs)("div",{className:"pt-4 px-4",children:[o&&(0,a.jsx)(A.A,{}),!o&&0===n.length&&t&&(0,a.jsx)("h3",{className:"text-lg font-medium",children:"搜尋建議"}),!o&&n.length>0&&(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)("h3",{className:"text-lg font-medium",children:"搜尋建議"}),(0,a.jsx)("ul",{className:"space-y-2",children:n.map((e,t)=>(0,a.jsx)("li",{className:"pb-2 border-b last:border-b-0 ",children:(0,a.jsxs)(k(),{className:"flex items-center gap-1",href:(0,l.U7)({q:e,type:i}),onClick:m,children:[(0,a.jsx)(y.default,{src:"/images/icons/search.svg",alt:"搜尋建議",width:15,height:15}),(0,a.jsx)("div",{children:e})]})},t))})]})]})}},98059:(e,t,s)=>{s.d(t,{A:()=>m});var a=s(95155),r=s(34435),l=s(25016),i=s(15239),n=s(20063),c=s(12115),o=s(52827),d=s(32964);let p=()=>(0,a.jsxs)("div",{className:"h-[32.5px] flex items-start gap-0.5 animate-pulse",children:[(0,a.jsx)("div",{className:"h-4 w-4 rounded bg-secondary"}),(0,a.jsx)("div",{className:"w-full h-[22px] bg-secondary rounded"})]}),x=()=>(0,a.jsx)("div",{className:"flex items-center gap-1 animate-pulse bg-secondary rounded-[15p
1x] px-3 py-1 w-14 h-[28px] ww-max"}),m=e=>{let{onItemClick:t}=e,s=(0,n.useRouter)(),m=(0,o.Ub)({maxWidth:1079}),[h,u]=(0,c.useState)([]),[f,g]=(0,c.useState)(!0);(0,c.useEffect)(()=>{g(!0),fetch("".concat("https://app07.ulifestyle.com.hk/api/v1/place","/getPlaceCustomSearch")).then(e=>{if(!e.ok)throw Error("Failed to fetch ranking data");return e.json()}).then(e=>{"ok"===e.status&&e.payload?u(e.payload):u([])}).catch(()=>u([])).finally(()=>g(!1))},[]);let j=async e=>{t&&t(),s.push((0,l.U7)({q:e})),(0,l.QX)(e),(0,r.rz)({event_name:"place_search_input",text:e,section:"大家都在搜尋",position:"search_bar"})};return(0,a.jsxs)("div",{className:"mt-6 flex flex-col gap-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)("div",{className:"w-[18px] h-5 flex items-center justify-center",children:(0,a.jsx)("span",{className:"text-lg desktop:text-base leading-5",children:"\uD83D\uDD25"})}),(0,a.jsx)("div",{className:"text-lg desktop:text-base text-[#384047] font-semibold leading-[25px]",children:"大家都在搜尋"})]}),f&&m&&(0,a.jsx)("div",{className:"flex flex-col gap-[10.5px]",children:Array.from({length:5}).map((e,t)=>(0,a.jsx)(p,{},t))}),f&&!m&&(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:Array.from({length:8}).map((e,t)=>(0,a.jsx)(x,{},t))}),!f&&m&&(0,a.jsx)("div",{className:"flex flex-col gap-[10.5px]",children:h.map((e,t)=>(0,a.jsxs)("div",{className:"flex items-start gap-0.5 cursor-pointer",onClick:()=>j(e.search_text),children:[(0,a.jsx)(i.default,{className:"mt-[3px]",src:"/images/icons/search-black.svg",alt:"搜尋",width:16,height:16}),(0,a.jsx)("div",{className:(0,l.cn)("w-full mr-4.5 pl-1.5 pb-[9.5px] border-b-1 text-base text-foreground leading-[22px]",{"pb-0 border-b-0":t===h.length-1}),children:e.search_text})]},t))}),!f&&!m&&(0,a.jsx)("div",{className:"flex flex-wrap items-center gap-2",children:h.map((e,t)=>(0,a.jsxs)(d.E,{className:"gap-1",variant:"search",onClick:()=>j(e.search_text),children:[(0,a.jsx)(i.default,{src:"/images/icons/search-black.svg",alt:"搜尋",width:16,height:16}),e.search_text]},t))})]})}}}]);

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.