1import{D as R,L as u}from"./react-router-fLl7IFGh.js";import{d as l,j as t}from"./react-vendor-Del8TnYI.js";import{i as U}from"./ArrowUpRight-5U8DwmEb.js";import{B as F}from"./blog-layout-DDonSTVq.js";import{H as M}from"./hub-page-header-Bv1VfZtn.js";import{d as P}from"./marketing-page-Dpy0bO_D.js";import{S as L}from"./section-container-hW2-EGoM.js";import{f as B,a as K}from"./public-footer-Bzllobks.js";import{S as G}from"./sidebar-group-C3vqbiip.js";import{C as I}from"./content-grid-DQckFjy-.js";import{S as z}from"./search-input-BdsgSWVY.js";import{S as q}from"./segmented-control-pRduJLKK.js";import{B as S}from"./badges-y_UPMYsC.js";import{L as Y}from"./link-button-CjCG17JT.js";import{C as D}from"./control-role-C7OFs9y7.js";import{t as Q,M as W}from"./metrika-goals-DzYl5nYi.js";import{u as V}from"./use-focus-hotkey-DUi0U1tM.js";import{b as $}from"./context-D7T3x9UK.js";import{j as J,U as h,b as X,c as Z,i as y,h as w}from"./catalog-BVKfeuW-.js";import{p as ee}from"./paths--AoUyOw6.js";import{u as p}from"./seo-DES_RiXY.js";import{a as te}from"./search-match-D6zIgjk4.js";import{c as k}from"./cx-DxSaHyOm.js";import{P as re}from"./rhythm-BbnII8hl.js";import"./commonjs-helpers-Cpj98o6Y.js";import"./public-layout-C-brnJDO.js";import"./market-BKJDZsKG.js";import"./motion-DtKChkO9.js";import"./cta-BlVN8VsG.js";import"./use-escape-request-B3ghpFl-.js";import"./use-event-callback-Cym1haAM.js";import"./use-isomorphic-layout-effect-DAF_4S8o.js";import"./is-typing-target-D1VvNJY6.js";import"./use-signup-cta-_KPrV4MH.js";import"./use-stored-auth-XFiFuedV.js";import"./auth-DBaz5F8g.js";import"./runtime-Cj2WhF53.js";import"./desktop.generated-CbvD7df-.js";import"./event-BUbcYf6B.js";import"./storage-BzugOlb1.js";import"./format-DRjt5h7k.js";import"./translations-D1gGEQWl.js";import"./app-lock-D2__kowp.js";import"./auth-BMtzfX8f.js";import"./useBaseQuery-0HNU6J2Q.js";import"./QueryErrorResetBoundary-BLf2YkpE.js";import"./client-env-report-lazy-C3KhegyP.js";import"./sessions-CnpIplDR.js";import"./query-B0JtQz_g.js";import"./organizations-CHObBmTt.js";import"./notifications-DjJedv-_.js";import"./subscription-state-sfabCkpe.js";import"./desktop-telemetry-D8W3ZYr4.js";import"./client-env-C95USYxk.js";import"./boot-watch-DkV9_v0Y.js";import"./lazy-with-retry-r9ekVKRq.js";import"./samreshuuu-logo-DGxEOhaQ.js";import"./framer-motion-CeSEj7-U.js";import"./proxy-Cz1O17Rh.js";import"./filter-props-fIrdzBwX.js";import"./visit-tracker-BBDIrv4e.js";import"./disclosure-chevron-Cx5bpSlr.js";import"./ChevronDown-I3MTP0eH.js";import"./ChevronRight-Dpe_PVM3.js";import"./telegram-DWl95WZP.js";import"./max-messenger-bZmmW8Fb.js";import"./integration-icon-canvas-Aw_hqDF4.js";import"./Globe01-D53N5CMb.js";import"./menu-row-BAbnO44h.js";import"./Check-D20FmNVV.js";import"./language-names-CJ-o8lWH.js";import"./PuzzlePiece01-DTu3J_di.js";import"./Database01-KfuIaE-T.js";import"./BookOpen01-BDUX9Ak4.js";import"./Calendar-CviAlNIa.js";import"./Cube01-BeOzFzGM.js";import"./Download01-DpwY6IYz.js";import"./FileCheck02-BBVO1aUj.js";import"./FileSearch02-DcjbyHtg.js";import"./Grid01-QQRPA8pv.js";import"./HelpCircle-DbLw5AJV.js";import"./MessageChatCircle-C68yVBYL.js";import"./Stars01-B_wNlYBS.js";import"./ShoppingBag03-3LolDTYI.js";import"./TrendUp02-BAIBSMLR.js";import"./Zap-DikwVcES.js";import"./sidebar-rail-B0Pltf4t.js";import"./SearchLg-CRf6K3xe.js";import"./SearchSm-B_iDDsGK.js";import"./XClose-CzjCBUb9.js";import"./react-aria-CmS8kmSo.js";import"./compact-badge-CnnTg3R2.js";import"./is-react-component-D5_79d-4.js";import"./button-BkSohQNG.js";import"./yandex-metrika-CCDmDgOR.js";import"./keep-focus-BanblnN5.js";import"./use-breakpoint-DXCJWHcm.js";import"./use-media-query-CL6WhhjX.js";import"./bitrix24-BSd-R6SQ.js";import"./onec-C5FA9JkZ.js";import"./amocrm-DaJ9si6E.js";import"./integration-icon-image-kpVlCskn.js";import"./ozon-DteAHNj3.js";import"./wildberries-Dattnh0K.js";import"./yandex-direct-WUyLM4oD.js";import"./google-sheets-C9t3JOoa.js";import"./diadoc-CpuYKpT9.js";import"./telegram-QKoO9C0s.js";import"./sbis-DF3jf-mu.js";import"./email-DIsGC60j.js";import"./tochka-cBrPbaFP.js";import"./yandex-metrica-DXyAYZrx.js";import"./vk-BRdkFJck.js";import"./unisender-ChPx0TxX.js";import"./mpstats-C0AcTzLE.js";import"./google-docs-CmP5dUSn.js";import"./yandex-tracker-hJ0DQ7qA.js";import"./kaiten-1RKZIybi.js";import"./moysklad-Cu36UoEG.js";import"./avito-B86Sb0t0.js";import"./marketing-facts-Lyw-Mt34.js";import"./_facts.generated-DDWl1_1U.js";const{meta:jr,links:gr}=P({path:"/use-cases"}),se=Object.keys(h),m="all",_={department:m,cluster:m,task:m},f={department:r=>[r.category],cluster:r=>r.clusters??[],task:r=>[r.taskType]},b=Object.keys(f),T=(r,i,c)=>b.every(o=>o===c||i[o]===m||f[o](r).includes(i[o])),ie=()=>{const r=$(),[i,c]=l.useState(_),[o,x]=l.useState(""),j=l.useRef(null);V(j);const A=o.trim().length>0||Object.values(i).some(e=>e!==m),n=l.useMemo(()=>J.filter(e=>te(o,[{text:p(e.titleKey),weight:1},{text:p(e.subtitleKey),weight:.5}])),[o]),g=l.useMemo(()=>n.filter(e=>T(e,i)),[n,i]),C=l.useMemo(()=>{const e=Object.fromEntries(b.map(s=>[s,new Map]));for(const s of n)for(const a of b){if(!T(s,i,a))continue;const d=e[a];d.set(m,(d.get(m)??0)+1);for(const v of f[a](s))d.set(v,(d.get(v)??0)+1)}return e},[n,i]),N=l.useMemo(()=>[{key:"department",label:r("ucFacetDepartment"),options:se.map(e=>({id:e,label:r(h[e])}))},{key:"cluster",label:r("ucFacetCluster"),options:X.map(e=>({id:e,label:p(Z[e])}))},{key:"task",label:r("ucFacetTaskType"),options:Object.keys(y).map(e=>({id:e,label:r(y[e])}))}].map(e=>({...e,options:[{id:m,label:r("ucFilterAll")},...e.options].map(s=>({...s,count:C[e.key].get(s.id)??0}))})),[r,C]),E=(e,s)=>c(a=>({...a,[e]:s})),H=B(r),O=K(r);return t.jsxs(F,{children:[t.jsx("section",{className:k(re,"bg-primary"),children:t.jsx(L,{wide:!0,children:t.jsx(M,{eyebrow:r("useCasesHubEyebrow"),title:r("useCasesHubTitle"),lead:r("useCasesHubLead")})})}),t.jsx(L,{wide:!0,className:"pb-20 sm:pb-28",children:t.jsxs("div",{className:"lg:grid lg:grid-cols-[220px_minmax(0,1fr)] lg:gap-10",children:[t.jsx("aside",{className:"hidden lg:block",children:t.jsxs("div",{className:"sticky top-[96px] flex flex-col gap-4",children:[A?t.jsx("button",{type:"button",onClick:()=>{c(_),x("")},className:"self-start rounded-md px-1 text-sm text-brand-secondary transition-colors hover:text-brand-secondary_hover focus-ring",children:r("ucFacetReset")}):null,N.map(e=>t.jsx(G,{label:e.label,inset:"md",children:e.options.map(s=>t.jsx("li",{children:t.jsxs("button",{type:"button","aria-pressed":i[e.key]===s.id,disabled:s.count===0,onClick:()=>E(e.key,s.id),className:k("flex w-full items-center justify-between gap-2 rounded-md px-3 py-1.5 text-left text-sm transition-colors focus-ring",i[e.key]===s.id?"bg-secondary font-medium text-primary":"text-tertiary hover:text-primary",s.count===0&&"opacity-40"),children:[t.jsx("span",{className:"truncate",children:s.label}),t.jsx("span",{className:"tabular-nums text-xs text-quaternary",children:s.count})]})},s.id))},e.key))]})}),t.jsxs("div",{className:"flex flex-col gap-5",children:[t.jsx(z,{value:o,onChange:x,onEscape:()=>
1x(""),inputRef:j,size:D.catalogSearch,placeholder:r("ucHubSearchPlaceholder"),"aria-label":r("ucHubSearchPlaceholder")}),t.jsx("div",{className:"flex flex-col gap-2 lg:hidden",children:N.map(e=>t.jsx("div",{className:"scrollbar-hide -mx-6 overflow-x-auto px-6",children:t.jsx(q,{"aria-label":e.label,options:e.options.map(s=>({id:s.id,label:s.label,count:s.count})),active:i[e.key],onChange:s=>E(e.key,s)})},e.key))}),g.length===0?t.jsx("p",{className:"rounded-xl border border-secondary bg-primary p-6 text-sm text-tertiary",children:r("ucHubEmpty")}):t.jsx(I,{variant:"standard",children:g.map(e=>t.jsxs("article",{className:"group relative flex flex-col gap-3 rounded-xl border border-secondary bg-primary p-5 transition-colors hover:bg-secondary",children:[t.jsx("div",{className:"flex items-center gap-1.5",children:e.connectors.map(({icon:s,label:a})=>t.jsx("span",{title:a,className:"flex size-7 items-center justify-center rounded-md border border-secondary bg-secondary",children:t.jsx(s,{className:"size-4"})},a))}),t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx(u,{to:`/use-cases/${e.slug}`,className:"stretched-link text-md font-semibold text-primary after:rounded-xl",children:p(e.titleKey)}),t.jsx("p",{className:"line-clamp-1 font-mono text-xs leading-relaxed text-quaternary",children:r(e.promptKey)}),t.jsxs("p",{className:"text-xs text-quaternary",children:[r("ucMinutes",{count:e.minutes})," ·"," ",r(w[e.frequency])]})]}),t.jsxs("div",{className:"mt-auto flex flex-wrap items-center gap-2 pt-1",children:[t.jsx(S,{type:"pill-color",color:"brand",size:"sm",children:r(h[e.category])}),t.jsx(S,{type:"pill-color",color:"gray",size:"sm",children:r(y[e.taskType])}),t.jsx(Y,{to:ee.homePrompt(r(e.promptKey)),size:"sm",color:"link-color",className:"relative ml-auto",iconTrailing:U,onClick:()=>Q(W.useCasePromptLaunched,{slug:e.slug,surface:"hub"}),children:r("ucOpenInChat")})]})]},e.slug))}),t.jsxs("div",{className:"flex flex-col gap-3 border-t border-secondary pt-6 text-sm",children:[t.jsxs("div",{className:"flex flex-wrap items-baseline gap-x-3 gap-y-1",children:[t.jsx("span",{className:"text-tertiary",children:r("useCasesHubCollections")}),H.map(({to:e,label:s})=>t.jsx(u,{to:e,className:"text-secondary transition-colors hover:text-primary",children:s},e))]}),t.jsxs("div",{className:"flex flex-wrap items-baseline gap-x-3 gap-y-1",children:[t.jsx("span",{className:"text-tertiary",children:p("ucClusterHubHeading")}),O.map(({to:e,label:s})=>t.jsx(u,{to:e,className:"text-secondary transition-colors hover:text-primary",children:s},e))]})]})]})]})})]})},Cr=R(ie);export{Cr as default,gr as links,jr as meta};
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.