1import{j as t,r as $}from"./react-vendor-P5XnYvWb.js";import{G,y as q}from"./movie-card-runtime-BsWugIRi.js";import{V as L,S as J,j as S,W as M,p as Q}from"./main-CtyeVlnq.js";import{c as i}from"./assistant-ui-primitives-Bn9nn9-n.js";import{m as X,a as Y,e as Z,c as P,f as U,g as I,h as A,b as D,s as O,i as z,j as C,k as ee,d as te,l as ae}from"./movie-card-helpers-BB50UVXO.js";import{L as se}from"./lazy-image-Cjskc6Tx.js";import{M as le,a as re}from"./movie-card-actions-7BpEG_pz.js";import{y as ie,g as B}from"./icons-C3gyKvVD.js";const E=[{test:e=>e==="because_recent_watch",label:"å ä¸ºä½ æè¿å¨çåç±»å
容"},{test:e=>e==="item2item_similar",label:"ä¸ä½ æè¿ææ¾çå½±çç¸ä¼¼"},{test:e=>e==="preference_personalized",label:"å¹é
ä½ çå
容ç»å"},{test:e=>e==="user_preference_profile",label:"æ ¹æ®ä½ çè§çå好æåº"},{test:e=>e.startsWith("profile_"),label:"符åä½ çé¦é¡µå好"},{test:e=>e.startsWith("hot_list:"),label:"æ¥èªçæ¦"},{test:e=>/heat|playback|freshness/u.test(e),label:"è¿æç度æ´é«"}];function ne(e){var m,u;const a=e.tags??[],s=a.map(oe).find(Boolean);if(s)return s;for(const{test:x,label:p}of E)if(a.some(x))return p;const c=a.find(ce);if(c)return c.trim();const n=(u=(m=e.facts)==null?void 0:m.intentPhrases)==null?void 0:u.find(x=>x.trim());return n==null?void 0:n.trim()}function oe(e){const a="section_reason:";if(!e.startsWith(a))return;const s=e.slice(a.length).trim();if(!/^[a-z0-9_.:-]+$/iu.test(s))return s||void 0}function ce(e){const a=e.trim();return!a||/^[a-z0-9_-]+(?::[a-z0-9_-]+)?$/iu.test(a)?!1:!E.some(({test:s})=>s(a))}function R({src:e,title:a,className:s,imageClassName:c,priority:n}){return t.jsx(se,{alt:"",className:s??"",imageClassName:i("object-cover",c),loading:n?"eager":"lazy","aria-label":a,...e?{src:e}:{}})}function H({movie:e}){const a=X(e);return a?t.jsx("span",{className:"movie-poster-label min-w-0 max-w-full truncate rounded px-1.5 py-0.5 text-[11px] font-medium leading-4 sm:text-xs",title:a,children:a}):null}function xe({movie:e}){const a=e.heatValue;return typeof a!="number"||!Number.isFinite(a)||a<=100?null:t.jsxs("span",{className:"ml-auto shrink-0 rounded border border-amber-200/30 bg-black/58 px-1.5 py-0.5 text-[11px] font-medium leading-4 text-amber-100 backdrop-blur",children:["ç度 ",Y(a)]})}function K({movie:e}){const a=Z();return a.length===0?null:t.jsx("div",{className:"flex min-w-0 flex-wrap gap-1",children:a.map(s=>t.jsx("span",{className:"rounded border border-cyan-100/28 bg-black/62 px-1.5 py-0.5 text-[10px] font-semibold leading-4 text-cyan-50 backdrop-blur",children:s},s))})}function T({movie:e,overlay:a=!1}){const s=ne(e);return s?t.jsx("p",{className:i("mt-1 min-w-0 truncate text-[11px] font-medium leading-4",a?"text-cyan-50/76":"text-[var(--movie-primary)]"),title:s,children:s}):null}function de({movie:e,priority:a,href:s,showRecommendationReason:c,showStatusBadge:n=!0,onOpen:m}){const u=P(e),x=U(e),p=I(e),f=A(e),b=t.jsxs(t.Fragment,{children:[t.jsx(R,{src:e.posterUrl,title:e.title,className:"h-full w-full",imageClassName:"transition-transform duration-500 group-hover:scale-105",priority:a}),t.jsx("div",{className:"movie-poster-shade absolute inset-0"}),t.jsxs("div",{className:"absolute inset-x-1.5 top-1.5 z-10 flex min-w-0 items-start justify-between gap-1",children:[n?t.jsxs("div",{className:"flex min-w-0 flex-1 items-start gap-1 overflow-hidden",children:[t.jsx(H,{movie:e}),t.jsx(K,{movie:e})]}):null,t.jsx(xe,{movie:e})]}),t.jsxs("div",{className:"movie-poster-text absolute inset-x-2 bottom-2 z-10",children:[t.jsx("h3",{className:"movie-text-fit-single movie-mobile-readable-title text-[15px] font-semibold leading-5 text-white sm:text-base",children:e.title}),t.jsxs("p",{className:"movie-text-fit-single movie-mobile-readable-chip text-[12px] leading-5 text-white/62 sm:text-[13px]",children:[e.year," · ",D(e,2).join(" / ")]}),c?t.jsx(T,{movie:e,overlay:!0}):null,!u&&x?t.jsx("p",{className:"mt-1 line-clamp-2 text-[11px] font-medium leading-4 text-cyan-50/78",children:x}):null,!u&&p?f?t.jsx(L,{href:f,browserTitle:e.title,browserSource:"mov
1ie_poster_action",onClick:d=>d.stopPropagation(),className:"mt-1 inline-flex rounded border border-cyan-100/24 bg-cyan-100/14 px-1.5 py-0.5 text-[11px] font-semibold leading-4 text-cyan-50",children:p}):t.jsx("span",{className:"mt-1 inline-flex rounded border border-cyan-100/20 bg-cyan-100/10 px-1.5 py-0.5 text-[11px] font-semibold leading-4 text-cyan-50/80",children:p}):null]})]});return s?t.jsx(J,{href:s,onClick:d=>{if(d.stopPropagation(),S(e)){d.preventDefault();return}m==null||m(e)},className:"absolute inset-0 block","aria-label":`æå¼ææ¾å¨ï¼${e.title}`,children:b}):b}function je({movie:e,compact:a=!1,dense:s=!1,onPlay:c,onPreview:n,posterOnly:m=!1,priority:u=!1,href:x,className:p,showRecommendationReason:f=!0,showStatusBadge:b=!0,onOpen:d}){var _;const r=P(e),[N,y]=$.useState(!1),k=A(e),h=I(e),w=U(e),V=G(e.contentKind??e.type,e.type==="series"?"å§é":"çµå½±"),W=()=>y(!0),g=l=>{if(!r)return;const o=l?ae(e,l):e;S(o)||(d?d(o):j(o,"result_click"),c==null||c(o))},F=()=>{if(r){if(n){j(e,"detail_open"),n(e);return}g()}},v=()=>{if(r){g();return}W()};if(m){const l=!r||!x;return t.jsxs("article",{role:l?"button":void 0,tabIndex:l?0:void 0,onClick:l?v:void 0,onKeyDown:o=>{l&&(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),v())},className:i("movie-poster-card movie-card-glow-hover group relative aspect-[2/3] w-[9.25rem] shrink-0 overflow-hidden rounded-md border border-[var(--movie-border)] bg-[var(--movie-bg-elevated)] shadow-sm shadow-black/30 sm:w-40 md:w-44",r?"cursor-pointer":"",r?"":"opacity-88",p),children:[r?null:t.jsx(M,{movie:e,open:N,onOpenChange:y}),t.jsx(de,{movie:e,priority:u,href:r?x:void 0,showRecommendationReason:f,showStatusBadge:b,onOpen:o=>{d?d(o):j(o,"result_click")}})]})}return t.jsxs("article",{role:a||!r?"button":void 0,tabIndex:a||!r?0:void 0,onClick:a||!r?v:void 0,onKeyDown:l=>{!a&&r||(l.key==="Enter"||l.key===" ")&&(l.preventDefault(),v())},className:i("movie-surface movie-card-glow-hover group overflow-hidden rounded-md border shadow-sm shadow-black/20",a||!r?"cursor-pointer":"",a&&s?"grid min-h-[180px] grid-cols-[120px_minmax(0,1fr)] sm:min-h-[192px] sm:grid-cols-[128px_minmax(0,1fr)]":a?"grid min-h-[168px] grid-cols-[112px_minmax(0,1fr)] sm:min-h-[186px] sm:grid-cols-[124px_minmax(0,1fr)]":"flex min-w-[180px] flex-col",p),children:[r?null:t.jsx(M,{movie:e,open:N,onOpenChange:y}),t.jsxs("div",{className:i("relative overflow-hidden bg-[var(--movie-bg-elevated)]",a&&s?"h-full min-h-[180px] w-[120px] sm:min-h-[192px] sm:w-[128px]":a?"h-full min-h-[168px] w-[112px] sm:min-h-[186px] sm:w-[124px]":"aspect-[2/3]"),children:[t.jsx(R,{src:e.posterUrl,title:e.title,className:i(a?"absolute inset-0 size-full":"h-full w-full"),priority:u}),t.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/76 via-transparent to-black/10"}),t.jsx("div",{className:"absolute left-2 right-2 top-2 z-10",children:t.jsx(K,{movie:e})}),t.jsx("div",{className:"absolute bottom-2 left-2 right-2 flex justify-start",children:t.jsx(H,{movie:e})})]}),t.jsxs("div",{className:i("flex min-w-0 flex-1 flex-col",s?"p-2":"p-3"),children:[t.jsxs("div",{className:"flex items-start justify-between gap-2",children:[t.jsxs("div",{className:"min-w-0",children:[t.jsx("h3",{className:i("movie-text-fit-single font-semibold text-[var(--movie-text)]",s?"text-sm leading-5":"text-[15px]"),children:e.title}),t.jsx("p",{className:i("movie-text-fit-single text-[var(--movie-text-muted)]",s?"text-xs leading-5":"text-[13px]"),children:[O(e),e.year,V].filter(Boolean).join(" · ")}),a&&!s&&f?t.jsx(T,{movie:e}):null]}),a&&r?t.jsx("button",{type:"button","aria-label":`æ¥ç详æ
ï¼${e.title}`,title:"æ¥ç详æ
",onClick:l=>{l.preventDefault(),l.stopPropagation(),F()},className:"mt-0.5 flex size-8 shrink-0 items-center justify-center rounded-full border border-transparent bg-transparent text-[var(--movie-text-muted)] transition hover:border-cyan-200/35 hover:bg-[var(--movie-surface)] hover:text-[var(--movie-text)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--movie-primary-strong)]",children:t.jsx(ie,{className:"size-4"})}):t.jsx(B,{className:"mt-0.5 size-4 shrink-0 text-cyan-200/80"})]}),t.jsx(le,{movie:e,dense:s,onSelect:g}
1),t.jsx("div",{className:i("flex min-w-0 flex-wrap gap-1",s?"mt-1.5":"mt-2"),children:D(e,s?2:a?3:2).map(l=>t.jsx("span",{className:"movie-chip max-w-full whitespace-normal break-words rounded border px-1.5 py-0.5 text-left text-[11px] leading-4",title:l,children:l},l))}),a&&z(e)?t.jsx("p",{className:i("text-[var(--movie-text-muted)]",s?"mt-1 line-clamp-1 text-xs leading-5":"mt-2 line-clamp-2 text-[13px] leading-5"),children:z(e)}):a&&C(e)?t.jsx("p",{className:i("text-[var(--movie-text-muted)]",s?"mt-1 line-clamp-1 text-xs leading-5":"mt-2 line-clamp-2 text-[13px] leading-5"),children:C(e)}):null,t.jsx("div",{className:i("mt-auto flex min-w-0 flex-wrap gap-1",s?"pt-1.5":"pt-3"),children:([e.remarks,e.area,e.language].filter(Boolean).length?[e.remarks,e.area,e.language]:e.platforms).filter(l=>!!l).filter(l=>!ee(l)).slice(0,s?2:a?3:2).map(l=>t.jsx("span",{className:"movie-meta-chip max-w-full whitespace-normal break-words rounded border px-1.5 py-0.5 text-left text-[11px] leading-4",title:l,children:l},l))}),a&&n&&r?t.jsxs("div",{className:i("flex gap-2",s?"mt-2":"mt-3"),children:[t.jsx(re,{movie:e,variant:"action",className:i("min-w-0 flex-1 rounded border",s?"h-7":"h-8"),onSaved:l=>j(l,"save")}),t.jsxs("button",{type:"button",disabled:!r,onClick:l=>{l.preventDefault(),l.stopPropagation(),g()},className:i("movie-button-primary inline-flex min-w-0 flex-1 items-center justify-center gap-1 rounded border px-2 text-xs font-semibold transition disabled:opacity-40",s?"h-7":"h-8"),children:[t.jsx(B,{className:"size-3.5"}),r?"ææ¾":((_=e.availability)==null?void 0:_.label)??"æä¸å¯æ"]})]}):null,!r&&(w||h)?t.jsxs("div",{className:i("mt-2 text-xs leading-5 text-[var(--movie-text-muted)]",s&&"mt-1"),children:[w?t.jsx("p",{className:"line-clamp-2",children:w}):null,h?k?t.jsx(L,{href:k,browserTitle:e.title,browserSource:"movie_availability",onClick:l=>l.stopPropagation(),className:"mt-1 inline-flex font-semibold text-[var(--movie-primary)] hover:text-[var(--movie-text)]",children:h}):t.jsx("span",{className:"mt-1 inline-flex font-semibold text-[var(--movie-primary)]",children:h}):null]}):null]})]})}function j(e,a){e.responseId&&q({type:a,response_id:e.responseId,variant_id:Q(e),surface:"search_results",rank_position:e.rankPosition??0,metadata:te(e)})}export{je as M};
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.