PageSourceSearch

https://digg.com/_next/static/chunks/3mjxbufvfglg-.js?dpl=dpl_BCkysMdZZwk7kkBB6YQxtWwbPCPf

js digg.com collected 2026-10-01 07:23:49 UTC 46,262 bytes, 6 lines download raw bytes

1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._posthogChunkIds=e._posthogChunkIds||{},e._posthogChunkIds[n]="01a0f533-45c5-7613-8abd-31f5c332412c")}catch(e){}}();;!function(){try { var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&((e._debugIds|| (e._debugIds={}))[n]="b804a50f-daba-2896-4d8d-d29d708fa255")}catch(e){}}();
2(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,549837,515848,e=>{"use strict";var t=e.i(947500),r=e.i(294237),i=e.i(78829),n=e.i(237355),a=e.i(543836),s=e.i(657941),o=e.i(822566),l=Object.defineProperty,u=n.forwardRef(l(function(e,r){let{pressed:i,defaultPressed:n,onPressedChange:l,...u}=e,[d,c]=(0,s.useControllableState)({prop:i,onChange:l,defaultProp:n??!1,caller:"Toggle"});return(0,t.jsx)(o.Primitive.button,{type:"button","aria-pressed":d,"data-state":d?"on":"off","data-disabled":e.disabled?"":void 0,...u,ref:r,onClick:(0,a.composeEventHandlers)(e.onClick,()=>{e.disabled||c(!d)})})},"name",{value:"Toggle",configurable:!0}));e.s(["Root",0,u,"Toggle",0,u],515848);var d=e.i(515848),d=d;let c=(0,r.cva)("group/toggle inline-flex items-center justify-center gap-1 rounded-4xl text-sm font-medium whitespace-nowrap transition-colors outline-none hover:bg-muted hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-pressed:bg-muted dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent hover:bg-muted"},size:{default:"h-9 min-w-9 px-3 has-data-[icon=inline-end]:pr-2.5 has-data-[icon=inline-start]:pl-2.5",sm:"h-8 min-w-8 px-3 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",lg:"h-10 min-w-10 px-4 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3"}},defaultVariants:{variant:"default",size:"default"}});e.s(["Toggle",0,({className:e,variant:r="default",size:n="default",...a})=>(0,t.jsx)(d.Root,{"data-slot":"toggle",className:(0,i.cn)(c({variant:r,size:n,className:e})),...a}),"toggleVariants",0,c],549837)},807103,e=>{"use strict";var t=e.i(947500),r=e.i(237355),i=e.i(78829),n=e.i(711926),a=e.i(822566),s=e.i(670555),o=e.i(515848),l=e.i(657941),u=e.i(524916),d=Object.defineProperty,c=(e,t)=>d(e,"name",{value:t,configurable:!0}),p="ToggleGroup",[g,f]=(0,n.createContextScope)(p,[s.createRovingFocusGroupScope]),h=(0,s.createRovingFocusGroupScope)(),m=r.forwardRef(c(function(e,r){let{type:i,...n}=e;if("single"===i)return(0,t.jsx)(b,{role:"radiogroup",...n,ref:r});if("multiple"===i)return(0,t.jsx)(w,{role:"toolbar",...n,ref:r});throw Error(`Missing prop \`type\` expected on \`${p}\``)},"ToggleGroup")),[v,y]=g(p),b=r.forwardRef(c(function(e,i){let{value:n,defaultValue:a,onValueChange:s=c(()=>{},"onValueChange"),...o}=e,[u,d]=(0,l.useControllableState)({prop:n,defaultProp:a??"",onChange:s,caller:p});return(0,t.jsx)(v,{scope:e.__scopeToggleGroup,type:"single",value:r.useMemo(()=>u?[u]:[],[u]),onItemActivate:d,onItemDeactivate:r.useCallback(()=>d(""),[d]),children:(0,t.jsx)(C,{...o,ref:i}
2)})},"ToggleGroupImplSingle")),w=r.forwardRef(c(function(e,i){let{value:n,defaultValue:a,onValueChange:s=c(()=>{},"onValueChange"),...o}=e,[u,d]=(0,l.useControllableState)({prop:n,defaultProp:a??[],onChange:s,caller:p}),g=r.useCallback(e=>d((t=[])=>[...t,e]),[d]),f=r.useCallback(e=>d((t=[])=>t.filter(t=>t!==e)),[d]);return(0,t.jsx)(v,{scope:e.__scopeToggleGroup,type:"multiple",value:u,onItemActivate:g,onItemDeactivate:f,children:(0,t.jsx)(C,{...o,ref:i})})},"ToggleGroupImplMultiple")),[x,I]=g(p),C=r.forwardRef(c(function(e,r){let{__scopeToggleGroup:i,disabled:n=!1,rovingFocus:o=!0,orientation:l,dir:d,loop:c=!0,...p}=e,g=h(i),f=(0,u.useDirection)(d),m={dir:f,...p};return(0,t.jsx)(x,{scope:i,rovingFocus:o,disabled:n,children:o?(0,t.jsx)(s.Root,{asChild:!0,...g,orientation:l,dir:f,loop:c,children:(0,t.jsx)(a.Primitive.div,{...m,ref:r})}):(0,t.jsx)(a.Primitive.div,{...m,ref:r})})},"ToggleGroupImpl")),k="ToggleGroupItem",R=r.forwardRef(c(function(e,i){let n=y(k,e.__scopeToggleGroup),a=I(k,e.__scopeToggleGroup),o=h(e.__scopeToggleGroup),l=n.value.includes(e.value),u=a.disabled||e.disabled,d={...e,pressed:l,disabled:u},c=r.useRef(null);return a.rovingFocus?(0,t.jsx)(s.Item,{asChild:!0,...o,focusable:!u,active:l,ref:c,children:(0,t.jsx)(S,{...d,ref:i})}):(0,t.jsx)(S,{...d,ref:i})},"ToggleGroupItem")),S=r.forwardRef(c(function(e,r){let{__scopeToggleGroup:i,value:n,...a}=e,s=y(k,i),l={role:"radio","aria-checked":e.pressed,"aria-pressed":void 0},u="single"===s.type?l:void 0;return(0,t.jsx)(o.Toggle,{...u,...a,ref:r,onPressedChange:e=>{e?s.onItemActivate(n):s.onItemDeactivate(n)}})},"ToggleGroupItemImpl"));e.s(["Item",0,R,"Root",0,m,"ToggleGroup",0,m,"ToggleGroupItem",0,R,"createToggleGroupScope",0,f],759680);var j=e.i(759680),j=j,P=e.i(549837);let E=r.createContext({size:"default",variant:"default",spacing:2,orientation:"horizontal"});e.s(["ToggleGroup",0,({className:e,variant:r,size:n,spacing:a=2,orientation:s="horizontal",children:o,...l})=>(0,t.jsx)(j.Root,{"data-slot":"toggle-group","data-variant":r,"data-size":n,"data-spacing":a,"data-orientation":s,style:{"--gap":a},className:(0,i.cn)("group/toggle-group flex w-fit flex-row items-center gap-[--spacing(var(--gap))] data-[spacing=0]:data-[variant=outline]:rounded-4xl data-vertical:flex-col data-vertical:items-stretch",e),...l,children:(0,t.jsx)(E.Provider,{value:{variant:r,size:n,spacing:a,orientation:s},children:o})}),"ToggleGroupItem",0,({className:e,children:n,variant:a="default",size:s="default",...o})=>{let l=r.useContext(E);return(0,t.jsx)(j.Item,{"data-slot":"toggle-group-item","data-variant":l.variant||a,"data-size":l.size||s,"data-spacing":l.spacing,className:(0,i.cn)("shrink-0 group-data-[spacing=0]/toggle-group:rounded-none group-data-[spacing=0]/toggle-group:px-3 group-data-[spacing=0]/toggle-group:shadow-none focus:z-10 focus-visible:z-10 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-end]:pr-2.5 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-start]:pl-2.5 group-data-horizontal/toggle-group:data-[spacing=0]:first:rounded-l-3xl group-data-vertical/toggle-group:data-[spacing=0]:first:rounded-t-3xl group-data-horizontal/toggle-group:data-[spacing=0]:last:rounded-r-3xl group-data-vertical/toggle-group:data-[spacing=0]:last:rounded-b-3xl data-[state=on]:bg-muted group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:border-l-0 group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:border-t-0 group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-l group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-t",(0,P.toggleVariants)({variant:l.variant||a,size:l.size||s}),e),...o,children:n})}],807103)},767841,e=>{"use strict";var t=e.i(947500),r=e.i(78829),i=e.i(237355),n=e.i(543836),a=e.i(165542),s=e.i(711926),o=e.i(822566),l=e.i(670555),u=e.i(657941),d=e.i(524916),c=e.i(980325),p=e.i(983164),g=Object.defineProperty,f=(e,t)=>g(e,"name",{value:t,configurable:!0}),h="Radio",[m,v]=(0,s.createContextScope)(h),[y,b]=m(h);function w(e){let{__scopeRadio:r,checked:n=!1,children:a,disabled:s,form:o,name:l,onCheck:u,required:d,value:c="on",internal_do_not_use_render:p}=e,[g,h]=i.useState(null),[m,v]=i.useState(null),b=i.useRef(!1),[w,x]=i.useReducer(e=>e+1,0),I=!g||!!o||!!g.closest("form"),C={checked:n,disabled:s,required:d,name:l,form:o,value:c,control:g,setControl:h,hasConsumerStoppedPropagationRef:b,userInteractionCount:w,onUserInteraction:x,isFormControl:I,bubbleInput:m,setBubbleInput:v,onCheck:f(()=>u?.(),"onCheck")};
2return(0,t.jsx)(y,{scope:r,...C,children:k(p)?p(C):a})}f(w,"RadioProvider");var x=i.forwardRef(f(function({__scopeRadio:e,onClick:r,...i},s){let{checked:l,disabled:u,value:d,setControl:c,onCheck:p,hasConsumerStoppedPropagationRef:g,onUserInteraction:f,isFormControl:h,bubbleInput:m}=b("RadioTrigger",e),v=(0,a.useComposedRefs)(s,c);return(0,t.jsx)(o.Primitive.button,{type:"button",role:"radio","aria-checked":l,"data-state":R(l),"data-disabled":u?"":void 0,disabled:u,value:d,...i,ref:v,onClick:(0,n.composeEventHandlers)(r,e=>{l||(f(),p()),m&&h&&(g.current=e.isPropagationStopped(),g.current||e.stopPropagation())})})},"RadioTrigger")),I=i.forwardRef(f(function(e,r){let{__scopeRadio:i,forceMount:n,...a}=e,s=b("RadioIndicator",i);return(0,t.jsx)(p.Presence,{present:n||s.checked,children:(0,t.jsx)(o.Primitive.span,{"data-state":R(s.checked),"data-disabled":s.disabled?"":void 0,...a,ref:r})})},"RadioIndicator")),C=i.forwardRef(f(function({__scopeRadio:e,onClick:r,...s},l){let{control:u,checked:d,required:p,disabled:g,name:f,value:h,form:m,bubbleInput:v,setBubbleInput:y,hasConsumerStoppedPropagationRef:w,userInteractionCount:x}=b("RadioBubbleInput",e),I=(0,a.useComposedRefs)(l,y),C=(0,c.useSize)(u),k=i.useRef(!1),R=i.useRef(d),S=i.useRef(x);i.useEffect(()=>{if(!v)return;let e=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set,t=x!==S.current;S.current=x;let r=R.current!==d;R.current=d;let i=!(t&&w.current);if(r&&e){k.current=!t;let r=new Event("click",{bubbles:i});e.call(v,d),v.dispatchEvent(r),k.current=!1}},[v,d,w,x]);let j=i.useRef(d);return(0,t.jsx)(o.Primitive.input,{type:"radio","aria-hidden":!0,defaultChecked:j.current,required:p,disabled:g,name:f,value:h,form:m,...s,tabIndex:-1,ref:I,onClick:(0,n.composeEventHandlers)(r,e=>{k.current&&e.stopPropagation()}),style:{...s.style,...C,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"RadioBubbleInput"));function k(e){return"function"==typeof e}function R(e){return e?"checked":"unchecked"}f(k,"isFunction"),f(R,"getState");var S=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],j="RadioGroup",[P,E]=(0,s.createContextScope)(j,[l.createRovingFocusGroupScope,v]),M=(0,l.createRovingFocusGroupScope)(),T=v(),[_,D]=P(j),F=i.forwardRef(f(function(e,r){let{__scopeRadioGroup:n,name:s,form:c,defaultValue:p,value:g,required:h=!1,disabled:m=!1,orientation:v,dir:y,loop:b=!0,onValueChange:w,...x}=e,I=M(n),C=(0,d.useDirection)(y),[k,R]=(0,u.useControllableState)({prop:g,defaultProp:p??null,onChange:w,caller:j}),[S,P]=i.useState(null),E=(0,a.useComposedRefs)(r,P),T=i.useRef(k);return i.useEffect(()=>{let e=c?S?.ownerDocument.getElementById(c):S?.closest("form");if(e instanceof HTMLFormElement){let t=f(()=>R(T.current),"reset");return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}},[S,c,R]),(0,t.jsx)(_,{scope:n,name:s,form:c,required:h,disabled:m,value:k,onValueChange:R,children:(0,t.jsx)(l.Root,{asChild:!0,...I,orientation:v,dir:C,loop:b,children:(0,t.jsx)(o.Primitive.div,{role:"radiogroup","aria-required":h,"aria-orientation":v,"data-disabled":m?"":void 0,dir:C,...x,ref:E})})})},"RadioGroup"));function O(e){let{__scopeRadioGroup:r,value:i,disabled:n,children:a,internal_do_not_use_render:s}=e,o=D("RadioGroupItemProvider",r),l=T(r),u=o.disabled||n;return(0,t.jsx)(w,{...l,checked:o.value===i,disabled:u,required:o.required,name:o.name,form:o.form,value:i,onCheck:()=>o.onValueChange(i),internal_do_not_use_render:s,children:a})}f(O,"RadioGroupItemProvider");var A=i.forwardRef(f(function(e,r){let{__scopeRadioGroup:s,...o}=e,u=M(s),d=T(s),{checked:c,disabled:p}=b("RadioGroupItemTrigger",d.__scopeRadio),g=i.useRef(null),h=(0,a.useComposedRefs)(r,g),m=i.useRef(!1);return i.useEffect(()=>{let e=f(e=>{S.includes(e.key)&&(m.current=!0)},"handleKeyDown"),t=f(()=>m.current=!1,"handleKeyUp");return document.addEventListener("keydown",e),document.addEventListener("keyup",t),()=>{document.removeEventListener("keydown",e),document.removeEventListener("keyup",t)}},[]),(0,t.jsx)(l.Item,{asChild:!0,...u,focusable:!p,active:c,children:(0,t.jsx)(x,{...d,...o,ref:h,onKeyDown:(0,n.composeEventHandlers)(o.onKeyDown,e=>{"Enter"===e.key&&e.preventDefault()}),onFocus:(0,n.composeEventHandlers)(o.onFocus,()=>{m.current&&g.current?.click()})})})},"RadioGroupItemTrigger")),L=i.forwardRef(f(function(e,r){let{__scopeRadioGroup:i,value:n,disabled:a,...s}=e;return(0,t.jsx)(O,{__scopeRadioGroup:i,value:n,disabled:a,internal_do_not_use_render:({isFormControl:e})=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(A,{...s,ref:r,__scopeRadioGroup:i}),e&&(0,t.jsx)(G,{__scopeRadioGroup:i})]})})},"RadioGroupItem")),G=i.forwardRef(f(function(e,r){let{__scopeRadioGroup:i,...n}=e,a=T(i);return(0,t.jsx)(C,{...a,...n,ref:r})},"RadioGroupItemBubbleInput")),z=i.forwardRef(f(function(e,r){let{__scopeRadioGroup:i,...n}=e,a=T(i);return(0,t.jsx)(I,{...a,...n,ref:r})},"RadioGroupIndicator"));e.s(["Indicator",0,z,"Item",0,L,"RadioGroup",0,F,"RadioGroupIndicator",0,z,"RadioGroupItem",0,L,"Root",0,F,"createRadioGroupScope",0,E,"unstable_ItemBubbleInput",0,G,"unstable_ItemProvider",0,O,"unstable_ItemTrigger",0,A,"unstable_RadioGroupItemBubbleInput",0,G,"unstable_RadioGroupItemProvider",0,O,"unstable_RadioGroupItemTrigger",0,A],331359);var N=e.i(331359),N=N;e.s(["RadioGroup",0,({className:e,...i})=>(0,t.jsx)(N.Root,{"data-slot":"radio-group",className:(0,r.cn)("grid w-full gap-3",e),...i}),"RadioGroupItem",0,({className:e,...i})=>(0,t.jsx)(N.Item,{"data-slot":"radio-group-item",className:(0,r.cn)("group/radio-group-item peer relative flex aspect-square size-4 shrink-0 rounded-full border border-input outline-none group-has-[:focus-visible]/field-label:ring-0 group-has-[:focus-visible]/field-label:not-data-checked:border-input after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground group-has-[:focus-visible]/field-label:data-checked:border-primary dark:data-checked:bg-primary",e),...i,children:(0,t.jsx)(N.Indicator,{"data-slot":"radio-group-indicator",className:"flex size-4 items-center justify-center",children:(0,t.jsx)("span",{className:"absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2 roun
2ded-full bg-primary-foreground"})})})],767841)},784995,439414,e=>{"use strict";e.i(452824);var t=e.i(947500),r=e.i(648646),i=e.i(430986),n=e.i(534792),a=e.i(78829);let s=({className:e,count:i})=>(0,t.jsxs)("div",{className:(0,a.cn)("mt-2 flex min-w-0 items-center gap-2",e),"data-slot":"post-skeleton-contributors",children:[(0,t.jsx)(r.AvatarStackSkeleton,{count:i,className:"shrink-0 [&_[data-slot=skeleton]]:animate-none [&_[data-slot=skeleton]]:bg-muted"}),(0,t.jsx)(n.Skeleton,{className:(0,a.cn)("h-2.5",2===i?"w-20":"w-28"),"data-slot":"post-skeleton-meta"})]});e.s(["PostSkeleton",0,({hasImage:e=!1,hero:r=!1,size:a="default",...o})=>{let l="sm"===a,u=e&&r&&!l;return(0,t.jsxs)(i.Item,{...o,"aria-hidden":"true","data-post-skeleton":!0,"data-has-image":e||void 0,"data-hero":u||void 0,size:l?"sm":"default",children:[(0,t.jsxs)(i.ItemContent,{children:[(0,t.jsx)(n.Skeleton,{className:"h-4 w-3/4","data-slot":"post-skeleton-title"}),u?null:(0,t.jsx)(s,{count:l?2:3})]}),u?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(i.ItemFooter,{children:(0,t.jsx)(i.ItemMedia,{variant:"image",className:"h-auto w-full",children:(0,t.jsx)(n.Skeleton,{className:"aspect-video w-full","data-slot":"post-skeleton-media"})})}),(0,t.jsx)(i.ItemContent,{children:(0,t.jsx)(s,{count:3,className:"mt-0"})})]}):null,!e||u||l?null:(0,t.jsx)(i.ItemMedia,{variant:"image",className:"lg"===a?"aspect-[4/3] h-auto w-16 sm:h-28 sm:w-auto":"aspect-[4/3] h-auto w-16 sm:h-20 sm:w-auto",children:(0,t.jsx)(n.Skeleton,{className:"size-full","data-slot":"post-skeleton-media"})})]})}],439414),e.s([],784995)},723165,128251,e=>{"use strict";var t=e.i(947500),r=e.i(368606),i=e.i(237355),n=e.i(948587),a=e.i(466691),s=e.i(430986);function o(e){let t=new Map;for(let r of e)for(let e of r.posts)t.set(e.clusterId,r);return t}function l(e,t){if(0===t.length)return e.map(e=>({post:e,type:"post"}));let r=o(t),i=new Map(e.map(e=>[e.clusterId,e])),n=new Set,a=[];for(let t of e){let e=r.get(t.clusterId);if(!e){a.push({post:t,type:"post"});continue}n.has(e.id)||(n.add(e.id),a.push({group:{...e,posts:e.posts.map(e=>i.get(e.clusterId)??e)},type:"group"}))}return a}e.s(["FeedGroup",0,({actionsFor:e,diggFor:o,groupId:l,hrefFor:u,lead:d,related:c})=>{let[p,g]=(0,i.useState)(!1),f=(0,i.useId)(),h=[...c].sort((e,t)=>(t.diggScore??0)-(e.diggScore??0)),m=p?h:h.slice(0,4),v=65+(Math.max(1,...c.map(e=>String(Math.max(0,e.diggScore??0)).length))-1)*7,y=h.length-m.length,b=h.length>4;return(0,t.jsxs)("div",{className:"flex flex-col pb-4","data-group-id":l,children:[d,c.length>0?(0,t.jsxs)("div",{className:"pl-4",children:[(0,t.jsx)("div",{"data-tldr-rule":!0,className:"py-2 pr-6 pl-3.5",children:(0,t.jsx)(s.ItemGroup,{"aria-label":"Related stories",id:f,children:m.map((i,a)=>{let l=o(i),d=e?.(i,a+1),c=i.summary.description?.trim();return(0,t.jsxs)(s.Item,{className:"p-2",role:"listitem","data-post-linked-item":!0,children:[(0,t.jsx)(s.ItemContent,{children:(0,t.jsxs)("div",{className:"flex min-w-0 items-center gap-2.5",children:[null==l?null:(0,t.jsx)("div",{"data-post-accessory":!0,className:"flex shrink-0 empty:hidden",style:{width:v},children:l}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[(0,t.jsx)(s.ItemTitle,{children:(0,t.jsx)(r.default,{href:u(i),prefetch:!1,"data-item-link":"stretched",children:i.summary.title})}),c?(0,t.jsx)(s.ItemDescription,{className:"line-clamp-1",children:c}):null]})]})}),i.image?.src?(0,t.jsx)(s.ItemMedia,{variant:"image",className:"aspect-[4/3] h-10 w-auto",children:(0,t.jsx)("div",{className:"relative size-full",children:(0,t.jsx)(n.ClusterPostThumbnailImage,{src:i.image.src,alt:i.image.alt??"",sizes:"56px"})})}):null,d?(0,t.jsx)(s.ItemActions,{"data-post-accessory":!0,children:d}):null]},i.clusterId)})})}),b?(0,t.jsx)("div",{"data-tldr-rule-more":!0,className:"flex",children:(0,t.jsx)(a.Button,{type:"button",variant:"link",size:"sm","aria-controls":f,"aria-expanded":p,onClick:()=>g(e=>!e),children:p?"View less":`View ${y} more`})}):null]}):null]})}],723165),e.s(["feedPlaceCount",0,function(e,t){return l(e,t).length},"feedPostsForPlaces",0,function(e,t,r){if(0===t.length)return e.slice(0,r);let i=o(t),n=new Set,a=0,s=0;for(let t of e){let e=i.get(t.clusterId);if(!e||!n.has(e.id)){if(a===r)break;a+=1,e&&n.add(e.id)}s+=1}return e.slice(0,s)},"groupFeedPosts",0,l],128251)},750351,e=>{"use strict";var t=e.i(237355),r=e.i(525738),i=e.i(10070),n=e.i(208009),a=e.i(504701),s=class extends n.Subscribable{#e;#t=void 0;#r;#i;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#n()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),(0,a.shallowEqualObjects)(this.options,t)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#r,observer:this}),t?.mutationKey&&this.options.mutationKey&&(0,a.hashKey)(t.mutationKey)!==(0,a.hashKey)(this.options.mutationKey)?this.reset():this.#r?.state.status==="pending"&&this.#r.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#r?.removeObserver(this)}onMutationUpdate(e){this.#n(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#r?.removeObserver(this),this.#r=void 0,this.#n(),this.#a()}mutate(e,t){return this.#i=t,this.#r?.removeObserver(this),this.#r=this.#e.getMutationCache().build(this.#e,this.options),this.#r.addObserver(this),this.#r.execute(e)}#n(){let e=this.#r?.state??(0,r.getDefaultState)();this.#t={...e,isPending:"pending"===e.status,isSuccess:"success"===e.status,isError:"error"===e.status,isIdle:"idle"===e.status,mutate:this.mutate,reset:this.reset}}#a(e){i.notifyManager.batch(()=>
2{if(this.#i&&this.hasListeners()){let t=this.#t.variables,r=this.#t.context,i={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type==="success"){try{this.#i.onSuccess?.(e.data,t,r,i)}catch(e){Promise.reject(e)}try{this.#i.onSettled?.(e.data,null,t,r,i)}catch(e){Promise.reject(e)}}else if(e?.type==="error"){try{this.#i.onError?.(e.error,t,r,i)}catch(e){Promise.reject(e)}try{this.#i.onSettled?.(void 0,e.error,t,r,i)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},o=e.i(888352),l=e.i(479069),u=e.i(360112),d=e.i(177917);let c=(0,d.createServerReference)("40b8e2561bafebcc9266f981440222e4406c46be61",d.callServer,void 0,d.findSourceMapURL,"setStoryBreaking");e.s(["useBreakingStories",0,function(e,r=!0,n){var d;let p=(0,o.useQueryClient)(),g=(0,l.useQuery)({queryKey:["breaking-stories",e],enabled:r,initialData:n,staleTime:15e3,refetchInterval:!!n&&3e4,queryFn:async({signal:t})=>{let r=await fetch(`/api/breaking?${new URLSearchParams({topic:e})}`,{signal:t,cache:"no-store"});if(!r.ok)throw Error("Breaking stories are unavailable.");return await r.json()}}),[f,h]=(0,t.useState)(0),m=g.data?g.data.nowMs+Math.max(0,f-g.dataUpdatedAt):0,v=(d=g.data?.stories??[],d.filter(e=>Date.parse(e.expiresAt)>m).toSorted((e,t)=>Date.parse(t.markedAt)-Date.parse(e.markedAt))),y=v.length?Math.min(...v.map(e=>Date.parse(e.expiresAt))):null;(0,t.useEffect)(()=>{if(null===y)return;let e=window.setTimeout(()=>{h(Date.now())},Math.max(0,y-m));return()=>{window.clearTimeout(e)}},[y,m]);let b=function(e){let r=(0,o.useQueryClient)(void 0),[n]=t.useState(()=>new s(r,e));t.useEffect(()=>{n.setOptions(e)},[n,e]);let l=t.useSyncExternalStore(t.useCallback(e=>n.subscribe(i.notifyManager.batchCalls(e)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),u=t.useCallback((e,t)=>{n.mutate(e,t).catch(a.noop)},[n]);if(l.error&&(0,a.shouldThrowError)(n.options.throwOnError,[l.error]))throw l.error;return{...l,mutate:u,mutateAsync:l.mutate}}({mutationFn:async t=>{let r=await c({...t,topic:e,operationKey:crypto.randomUUID()});if(!r.ok)throw Error(r.message);return t},onSuccess:async t=>{await p.invalidateQueries({queryKey:["breaking-stories",e]}),u.toast.success(t.active?"Marked as breaking for 3 hours.":"Removed from Breaking.")},onError:e=>u.toast.error(e.message)});return{stories:v,ready:g.isSuccess,pendingId:b.isPending?b.variables.clusterPostId:null,setBreaking:b.mutate}}],750351)},653955,e=>{"use strict";var t=e.i(947500),r=e.i(359780),i=e.i(571272),n=e.i(237355),a=e.i(348565),s=e.i(723165),o=e.i(128251),l=e.i(430986),u=e.i(96222),d=e.i(479069),c=e.i(177917);let p=(0,c.createServerReference)("401d0b5afe9bca548f5c57d3165bb2d2937c58cbda",c.callServer,void 0,c.findSourceMapURL,"readClustersWithArticleBody"),g=new Set;var f=e.i(750351);let h={posts:[],status:"idle"};var m=e.i(823400),v=e.i(78829),y=e.i(983390),b=e.i(165971),w=e.i(66170),x=e.i(170769);e.i(784995);var I=e.i(452824),C=e.i(439414),k=e.i(292965);let R=({canMarkBreakingForPost:e,accessoryForPost:d,leadingAccessoryForPost:c,metaAccessoryForPost:p,adminLinksForPost:g,imageLinkForPost:f,onPromoteToTop:v,onRemoveFromTopic:b,promotionAvailableForPost:w,promotionDisabledForPost:x,promotionPendingForPost:k,insertions:R,nowMs:j,posts:P,groups:E,renderVersion:M,showActivityRows:T,postSize:_,heroImages:D,showSeparators:F,topic:O,storyBasePath:A,refreshSkeletons:L,expandableClusterPosts:G,articleBodyClusters:z,breaking:N})=>{let U=(0,y.useStoryImages)(),[$,B]=(0,n.useState)(new Set),K=function(){let[e,t]=(0,n.useState)({}),r=(0,n.useRef)(e),i=(0,n.useRef)(new Map);return r.current=e,(0,n.useEffect)(()=>{let e=i.current;return()=>{for(let t of e.values())t.abort();e.clear()}},[]),{entries:e,idleEntry:h,load:(0,n.useCallback)(async e=>{let n=r.current[e.clusterId];if(n?.status==="loading"||n?.status==="ready")return;let a=new AbortController;i.current.get(e.clusterId)?.abort(),i.current.set(e.clusterId,a);let s={posts:n?.posts??[],status:"loading"};r.current={...r.current,[e.clusterId]:s},t(r.current);try{let n=new URLSearchParams({mode:"source",topic:e.topic}),s=await fetch(`/api/stories/${encodeURIComponent(e.clusterUrlId)}/activity-posts?${n.toString()}`,{signal:a.signal});if(!s.ok)throw Error(`HTTP ${s.status}`);let o=await s.json();if(a.signal.aborted||i.current.get(e.clusterId)!==a)return;let l={posts:Array.isArray(o.posts)?o.posts:[],status:"ready"};r.current={...r.current,[e.clusterId]:l},t(r.current)}catch(n){var o;if(a.signal.aborted||(o=n)instanceof Error&&"AbortError"===o.name)return;let i={posts:r.current[e.clusterId]?.posts??[],status:"error"};r.current={...r.current,[e.clusterId]:i},t(r.current)}finally{i.current.get(e.clusterId)===a&&i.current.delete(e.clusterId)}},[])}}(),V=new Map;for(let e of R??[]){let t=V.get(e.afterRank)??[];t.push(e),V.set(e.afterRank,t)}let H=e=>{let t=U?.get(e.clusterId);return t?{...e,image:t.image}:e},q=new Map;for(let e of(0,o.groupFeedPosts)(P,E??[]))if("group"===e.type)for(let t of e.group.posts)q.set(t.clusterId,e.group);let Q=new Set,W=[];P.forEach((e,t)=>{let r=q.get(e.clusterId);if(r){if(!Q.has(r.id)){Q.add(r.id);let[e,...i]=r.posts.map(H);e&&W.push({id:r.id,lead:e,postIndex:t+1,related:i,type:"group"})}}else W.push({id:e.clusterId,post:H(e),postIndex:t+1,type:"post"});for(let t of V.get(e.rank)??[])W.push({id:t.id,node:t.node,type:"insertion",wrapperClassName:t.wrapperClassName})});let X=e=>(0,i.isLargePostImage)(e.image),J=e=>_??(X(e)?"lg":"default"),Y=e=>{let t=e.clusterUrlId??e.clusterId,i=e.topicSlug?(0,m.topicFeedPath)(e.topicSlug):A;return i?`${i.replace(/\/+$/u,"")}/${encodeURIComponent(t)}`:(0,r.getTopicClusterPath)(O,t)},Z=(r,i,n)=>{var s,o;return(0,t.jsx)(u.Collapsible,{asChild:!0,onOpenChange:e=>{G&&(B(t=>{let i=new Set(t);return e?i.add(r.clusterId):i.delete(r.clusterId),i}),e&&K.load({clusterId:r.clusterId,clusterUrlId:r.clusterUrlId??r.clusterId,topic:O}))},open:!0===G&&$.has(r.clusterId),children:(0,t.jsx)(I.Post,{role:n,"data-newsletter-modal-trigger":10===i?"true":void 0,"data-feed-refresh-row-id":r.clusterId,refreshSkeleton:L?(0,t.jsx)(C.PostSkeleton,{hasImage:!!r.image,hero:D&&X(r),size:J(r)}):null,post:r,size:J(r),hero:D&&X(r),ageLabel:(s=r.createdAt,o=j,s?S(o-Date.parse(s)):null),updatedLabel:function(e,t){if(!e.lastSourcePostAt||!e.createdAt)return null;let r=Date.parse(e.lastSourcePostAt),i=Date.parse(e.createdAt);return Number.isFinite(r)&&Number.isFinite(i)&&r>i?S(t-r):null}(r,j),topic:O,storyBasePath:A,showActivityRows:T,accessory:d?.(r),leadingAccessory:c?.(r),metaAccessory:p?.(r),metaTrailingAccessory:G?(0,t.jsx)(a.ClusterSourcePostsTrigger,{open:$.has(r.clusterId),panelId:`cluster-source-posts-${r.clusterId}`,postCount:r.sourcePostCount??r.postCount,title:r.summary.title}):null,adminLinksFor:g?.(r),imageLinkFor:f?.(r),onPromoteToTop:v&&w?.(r)!==!1?()=>v(r):void 0,onSetBreaking:N?.ready&&(e?.(r)??!0)?()=>N.setBreaking({clusterPostId:r.clusterId,active:!N?.stories.some(e=>e.post.clusterId===r.clusterId)}):void 0,breakingActive:N?.stories.some(e=>e.post.clusterId===r.clusterId),breakingPending:N?.pendingId===r.clusterId,hasArticleBody:z?.has(r.clusterId)??!1,onRemoveFromTopic:b?()=>b(r):void 0,promotionDisabled:x?.(r),promotionPending:k?.(r),children:G&&$.has(r.clusterId)?(0,t.jsx)(a.ClusterSourcePostsContent,{entry:K.entries[r.clusterId]??K.idleEntry,onRetry:()=>{K.load({clusterId:r.clusterId,clusterUrlId:r.clusterUrlId??r.clusterId,topic:O})},panelId:`cluster-source-posts-${r.clusterId}`}):null})})};return(0,t.jsx)(l.ItemGroup,{"data-feed-posts":!0,"data-render-version":M,children:W.map((e,r)=>(0,t.jsxs)(n.Fragment,{children:[F&&r>0&&"insertion"!==e.type?(0,t.jsx)(l.ItemSeparator,{}):null,"post"===e.type?Z(e.post,e.postIndex,"listitem"):"group"===e.type?(0,t.jsx)("div",{role:"listitem","data-feed-group":!0,children:(0,t.jsx)(s.FeedGroup,{diggFor:e=>p?.(e)??null,groupId:e.id,hrefFor:Y,lead:Z(e.lead,e.postIndex),related:e.related})}):(0,t.jsxs)("div",{className:e.wrapperClassName,"data-feed-insertion":!0,role:"listitem",children:[F&&r>0?(0,t.jsx)(l.ItemSeparator,{}):null,e.node]})]},`${e.type}-${e.id}`))})};function S(e){if(e<0)return"0s";let t=Math.floor(e/1e3);if(t<60)return`${t}s`;let r=Math.floor(t/60);if(r<60)return`${r}m`;let i=Math.floor(r/60);return i<24?`${i}h`:`${Math.floor(i/24)}d`}let j=e=>{let r=(0,f.useBreakingStories)(e.topic);return(0,t.jsx)(R,{...e,breaking:r})};e.s(["Feed",0,({allowFeedRemoval:e=!0,canMarkBreakingForPost:r,date:i,posts:n,groups:a,topic:s,storyBasePath:o,nowMs:l,renderVersion:u,header:c,headingId:f,bodyState:h,insertions:m,leadingAccessoryForPost:y,metaAccessoryForPost:I,accessoryForPost:C,onPromoteToTop:S,onRemoveFromTopic:P,promotionAvailableForPost:E,promotionDisabledForPost:M,promotionPendingForPost:T,showSeparators:_=!0,showActivityRows:D=!0,postSize:F,heroImages:O=!0,id:A,className:L,headerClassName:G,surface:z,refreshSkeletons:N=!1,expandableClusterPosts:U=!1})=>{var $,B;let K,V=(0,b.useFeedRemoval)(),H=(0,k.useOptionalFeedAdminAccess)(),q=(0,w.usePathname)(),Q=(e,t)=>o?.replace(/\/+$/u,"").endsWith("-preview")?new URL(e,"https://digg.com").href:`https://digg.com/${t.topicSlug??s}/${t.clusterUrlId??t.clusterId}`,W=e&&H.isResolved?H.storyLinks:null,X=W?e=>t=>W.menu.map(r=>(0,x.fillAdminRouteLink)(r,Q(t,e),(0,x.currentPagePath)(q))):void 0,J=W?.image?e=>t=>W.image?(0,x.fillAdminRouteLink)(W.image,Q(t,e),(0,x.currentPagePath)(q)):null:void 0,Y=e=>!V.removed.has(`${e.topicSlug??s}:${e.clusterId}`),Z=n.filter(Y),ee=(a??[]).flatMap(e=>{let t=e.posts.filter(Y);return t.length>=2?[{...e,posts:t}]:[]}),et=($=[...Z,...ee.flatMap(e=>e.posts)].map(e=>e.clusterId),B=H.isResolved&&H.isAdmin,K=[...new Set($)].toSorted(),(0,d.useQuery)({queryKey:["article-body-clusters",K],enabled:B&&K.length>0,staleTime:6e4,queryFn:async()=>new Set(await p(K))}).data??g),er=e&&V.onRemove?e=>V.onRemove?.({clusterId:e.clusterId,title:e.summary.title,topic:e.topicSlug??s}):void 0,ei=e&&H.isAdmin&&H.isResolved&&["tech","ai","gaming"].includes(s)?j:R,en=null!=h;return(0,t.jsxs)("section",{id:A,"aria-busy":N||void 0,"aria-labelledby":f,className:(0,v.cn)("min-w-0",L),"data-feed-date":i||void 0,"data-post-surface":z,"data-render-version":u,children:[(0,t.jsx)("div",{className:(0,v.cn)("min-w-0",G),"data-feed-header":!0,children:c}),en?h:(0,t.jsx)(ei,{accessoryForPost:C,canMarkBreakingForPost:r,leadingAccessoryForPost:y,metaAccessoryForPost:I,adminLinksForPost:X,articleBodyClusters:et,imageLinkForPost:J,onPromoteToTop:S,onRemoveFromTopic:P??er,promotionAvailableForPost:E,promotionDisabledForPost:M,promotionPendingForPost:T,insertions:m,nowMs:l,posts:Z,groups:ee,renderVersion:u,showActivityRows:D,postSize:F,heroImages:O,showSeparators:_,topic:s,storyBasePath:o,refreshSkeletons:N,expandableClusterPosts:U})]})}],653955)},860974,e=>{"use strict";let t=(0,e.i(540796).default)("image-off",[["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}],["path",{d:"M10.41 10.41a2 2 0 1 1-2.83-2.83",key:"1bzlo9"}],["line",{x1:"13.5",x2:"6",y1:"13.5",y2:"21",key:"1q0aeu"}],["line",{x1:"18",x2:"21",y1:"12",y2:"15",key:"5mozeu"}],["path",{d:"M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59",key:"mmje98"}],["path",{d:"M21 15V5a2 2 0 0 0-2-2H9",key:"43el77"}]]);e.s(["ImageOffIcon",0,t],860974)},84818,e=>{"use strict";var t=e.i(947500),r=e.i(237355),i=e.i(300033);let n=(0,r.createContext)(null);e.s(["Select",0,({children:e,...a})=>{let s=(0,r.useRef)(null);return(0,t.jsx)(n,{value:s,children:(0,t.jsx)(i.Select,{...a,children:e})})},"SelectContent",0,({onCloseAutoFocus:e,onKeyDownCapture:a,onPointerDownCapture:s,onPointerDownOutside:o,...l})=>{let u=(0,r.useContext)(n);return(0,t.jsx)(i.SelectContent,{...l,onCloseAutoFocus:t=>{let r=u?.current==="pointer";u&&(u.current=null),e?.(t),r&&!t.defaultPrevented&&t.preventDefault()},onKeyDownCapture:e=>{u&&(u.current="keyboard"),a?.(e)},onPointerDownCapture:e=>{u&&(u.current="pointer"),s?.(e)},onPointerDownOutside:e=>{u&&(u.current="pointer"),o?.(e)}})},"SelectTrigger",0,({onKeyDownCapture:e,onPointerDownCapture:a,...s})=>{let o=(0,r.useContext)(n);return(0,t.jsx)(i.SelectTrigger,{...s,onKeyDownCapture:t=>{o&&(o.current="keyboard"),e?.(t)},onPointerDownCapture:e=>{o&&(o.current="pointer"),a?.(e)}})}])},373364,e=>{"use strict";var t=e.i(377627),r=e.i(571272),i=e.i(237355),n=e.i(517550);let a="published-v1";function s(e){return!!e&&"object"==typeof e&&("ready"===e.state||"terminus"===e.state)&&("terminus"===e.state||"string"==typeof e.pacificDay&&"string"==typeof e.dayLabel)&&Array.isArray(e.posts)&&Array.isArray(e.unavailablePosts)&&Array.isArray(e.publishedClusterIds)&&(null===e.nextCursor||"string"==typeof e.nextCursor)&&"boolean"==typeof e.hasMoreInDay&&"boolean"==typeof e.updatesAvailable}var o=e.i(128251);let l=[],u={kind:"idle"},d="Feed is temporarily unavailable";
2class c extends Error{capturedByServer;restart;constructor(e,t,r=!1){super(e),this.name="ContinuousFeedPageError",this.capturedByServer=t,this.restart=r}}async function p({cursor:e,range:t,publishedOnly:r,signal:i,topic:n,view:a}){let s=new URLSearchParams({topic:n,view:a});"top"===a&&t&&s.set("range",t),e&&s.set("cursor",e),s.set("published",r?"1":"0");let o=await fetch(`/api/feed/continuous?${s.toString()}`,{cache:"no-store",signal:i}),l=await o.json().catch(()=>null);if(!o.ok)throw new c(l&&"error"in l&&"string"==typeof l.error?l.error:d,!!(l&&"captured"in l&&!0===l.captured),!!("trending"===a&&400===o.status&&l&&"restart"in l&&!0===l.restart));return l}function g(e,t){let r=new Set(e.map(e=>e.clusterId));return[...e,...t.filter(e=>!r.has(e.clusterId)&&(r.add(e.clusterId),!0))]}function f(e){let t=window.matchMedia("(prefers-reduced-motion: reduce)").matches;e.current?.scrollIntoView({behavior:t?"auto":"smooth",block:"start"})}function h(e){return e instanceof Error?e.message:d}function m(e,t){let i="top"===e.view,n=t&&i&&"today"===e.range;return{activity:u,visibleCount:r.TOP_FEED_POST_LIMIT,visibleDayCounts:{},dateCursor:n?(0,r.pacificDayForOffset)(new Date(e.nowMs),1):null,nextCursor:e.nextCursor,nowMs:e.nowMs,posts:e.posts,publishedClusterIds:e.publishedClusterIds,publishedOnly:e.publishedOnly,range:e.range,sections:[],view:e.view}}function v(e,t,r){if("u"<typeof IntersectionObserver)return;let i=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&r()},{rootMargin:t});return i.observe(e),()=>{i.disconnect()}}e.s(["useContinuousFeed",0,function({basePath:e,completedDates:y=!1,defaultView:b=r.DEFAULT_FEED_VIEW,feedStartRef:w,groups:x=l,initialPage:I,topic:C}){let[k,R]=(0,i.useState)(()=>m(I,y)),S=(0,i.useRef)({view:I.view,range:I.range,publishedOnly:I.publishedOnly}),j=(0,i.useRef)(I.range??r.DEFAULT_TOP_FEED_RANGE),P=(0,i.useRef)(null),E=(0,i.useRef)(0),M=(0,i.useRef)(!1),T=(0,i.useRef)(null),_=(0,i.useRef)(0),D=(0,i.useRef)(null),F=(0,i.useRef)(null),O=(0,i.useCallback)(()=>{P.current?.abort();let e=new AbortController;P.current=e,M.current=!0;let t=E.current+1;return E.current=t,{controller:e,generation:t}},[]),A=(0,i.useCallback)(async(e,t,i)=>{S.current={view:e,range:t,publishedOnly:i};let{controller:n,generation:a}=O();R(n=>({...n,activity:{action:"initial",kind:"loading"},dateCursor:null,nextCursor:null,posts:[],publishedClusterIds:[],publishedOnly:i,range:t,sections:[],visibleCount:r.TOP_FEED_POST_LIMIT,visibleDayCounts:{},view:e}));try{let r=await p({publishedOnly:i,range:t,signal:n.signal,topic:C,view:e});if(E.current!==a)return;_.current=0,R(m(r,y))}catch(e){if(n.signal.aborted||E.current!==a)return;R(t=>({...t,activity:{action:"initial",kind:"error",message:h(e)}}))}finally{E.current===a&&(M.current=!1)}},[O,y,C]),L=(0,i.useCallback)(t=>{let i=(0,r.normalizeFeedView)(t,b);if(i===k.view)return;let a="top"===i?j.current:null;(0,n.recordProductEvent)("feed_view_changed",{control:"view",previous_range:k.range,previous_view:k.view,range:a,surface:"continuous_feed",topic:C,view:i}),window.history.pushState(null,"",(0,r.continuousFeedSelectionHref)(e,i,a,null)),f(w),A(i,a,k.publishedOnly)},[e,b,w,A,k.publishedOnly,k.range,k.view,C]),G=(0,i.useCallback)(t=>{let i=(0,r.normalizeTopFeedRange)(t);"top"===k.view&&i!==k.range&&(j.current=i,(0,n.recordProductEvent)("feed_view_changed",{control:"range",previous_range:k.range,previous_view:k.view,range:i,surface:"continuous_feed",topic:C,view:"top"}),window.history.pushState(null,"",(0,r.continuousFeedSelectionHref)(e,"top",i,null)),f(w),A("top",i,k.publishedOnly))},[e,w,A,k.publishedOnly,k.range,k.view,C]),z=(0,i.useCallback)(e=>{f(w),A(k.view,k.range,e)},[w,A,k.range,k.view]),N=(0,i.useCallback)(async(e,r=!0)=>{if(M.current||"idle"!==k.activity.kind&&!e)return;if(r&&"top"===k.view&&k.posts.length>k.visibleCount)return void R(e=>({...e,visibleCount:Math.min(e.visibleCount,e.posts.length)+10}));if(!k.nextCursor)return;let i=performance.now(),{controller:a,generation:s}=O();R(e=>({...e,activity:{action:"continuation",kind:"loading"}}));try{let e=await p({cursor:k.nextCursor,publishedOnly:k.publishedOnly,range:k.range,signal:a.signal,topic:C,view:k.view});if(E.current!==s)return;(0,n.recordProductEvent)("feed_continuation_load_finished",{duration_ms:Math.max(0,Math.round(performance.now()-i)),outcome:"success",range:k.range,result_count:e.posts.length,retry_count:_.current,surface:"continuous_feed",topic:C,view:k.view}),_.current=0,R(t=>
2({...t,activity:u,nextCursor:e.nextCursor,nowMs:e.nowMs,posts:g(t.posts,e.posts),visibleCount:r&&"top"===t.view?Math.min(t.visibleCount,t.posts.length)+10:t.visibleCount,publishedClusterIds:[...new Set([...t.publishedClusterIds,...e.publishedClusterIds])]}))}catch(e){if(a.signal.aborted||E.current!==s)return void(0,n.recordProductEvent)("feed_continuation_load_finished",{duration_ms:Math.max(0,Math.round(performance.now()-i)),outcome:"cancelled",range:k.range,result_count:0,retry_count:_.current,surface:"continuous_feed",topic:C,view:k.view});(0,n.recordProductEvent)("feed_continuation_load_finished",{duration_ms:Math.max(0,Math.round(performance.now()-i)),outcome:"failure",range:k.range,result_count:0,retry_count:_.current,surface:"continuous_feed",topic:C,view:k.view}),e instanceof c&&(e.capturedByServer||e.restart)||t.captureException(e,{fingerprint:["continuous-feed-continuation-load"],tags:{route:"feed_continuous",surface:"continuous_feed",topic:C,view:k.view}}),R(t=>({...t,activity:{action:e instanceof c&&e.restart?"initial":"continuation",kind:"error",message:h(e)}}))}finally{E.current===s&&(M.current=!1)}},[O,k.activity.kind,k.nextCursor,k.posts.length,k.visibleCount,k.publishedOnly,k.range,k.view,C]),U=(0,i.useCallback)(async e=>{let i=k.dateCursor;if(!i||M.current||"idle"!==k.activity.kind&&!e||T.current?.cursor===i)return;let{controller:n,generation:o}=O();T.current={controller:n,cursor:i},R(e=>({...e,activity:{action:"date",kind:"loading"}}));let l=!1;try{let e=new URLSearchParams({topic:C,cursor:i,version:a}),t=await fetch(`/api/feed/day?${e}`,{signal:n.signal});if(!t.ok)throw l=!0,Error(`HTTP ${t.status} from published Feed history`);let d=await t.json();if(n.signal.aborted||E.current!==o)return;if(!s(d))throw TypeError("Invalid published Feed history response");let c=function(e,t){if("terminus"===t.state)return{nextCursor:null,sections:[...e]};if(!t.pacificDay||!t.dayLabel)throw TypeError("Published history response has no date");let i=e.at(-1);if(i&&i.pacificDay<=t.pacificDay)throw TypeError("Published history continuation changed date order");let n=new Set(e.flatMap(e=>e.publishedClusterIds)),a={...t,dayLabel:t.dayLabel,pacificDay:t.pacificDay,posts:t.posts.filter(e=>!n.has(e.clusterId)),state:"ready"};return{nextCursor:t.hasMoreInDay?(0,r.addPacificDays)(t.pacificDay,-1):t.nextCursor,sections:[...e,a]}}(k.sections,d);R(e=>({...e,activity:u,dateCursor:c.nextCursor,sections:c.sections}))}catch(e){if(n.signal.aborted||E.current!==o)return;l||t.captureException(e,{fingerprint:["published-feed-history-client"],tags:{topic:C,route:"feed_history"}}),R(t=>({...t,activity:{action:"date",kind:"error",message:h(e)}}))}finally{E.current===o&&(M.current=!1),T.current?.controller===n&&(T.current=null)}},[O,k.activity.kind,k.dateCursor,k.sections,C]),$=(0,i.useCallback)(async(e,t=!1)=>{if(M.current||"idle"!==k.activity.kind&&!t)return;let i=k.sections.find(t=>t.pacificDay===e);if(!i)return;let n=Math.min(k.visibleDayCounts[e]??r.TOP_FEED_POST_LIMIT,i.posts.length);if(i.posts.length>n)return void R(t=>({...t,visibleDayCounts:{...t.visibleDayCounts,[e]:n+10}}));if(!i.hasMoreInDay||!i.nextCursor)return;let{controller:o,generation:l}=O();R(t=>({...t,activity:{action:"date-expansion",day:e,kind:"loading"}}));try{let t=new URLSearchParams({topic:C,cursor:i.nextCursor,version:a}),r=await fetch(`/api/feed/day?${t}`,{signal:o.signal});if(!r.ok)throw Error(d);let c=await r.json();if(o.signal.aborted||E.current!==l)return;if(!s(c)||c.pacificDay!==e||"ready"!==c.state)throw TypeError("Invalid published Feed date continuation");R(t=>({...t,activity:u,visibleDayCounts:{...t.visibleDayCounts,[e]:n+10},sections:t.sections.map(t=>t.pacificDay!==e?t:{...t,hasMoreInDay:c.hasMoreInDay,nextCursor:c.nextCursor,posts:g(t.posts,c.posts),publishedClusterIds:[...new Set([...t.publishedClusterIds,...c.publishedClusterIds])]})}))}catch(t){if(o.signal.aborted||E.current!==l)return;R(r=>({...r,activity:{action:"date-expansion",day:e,kind:"error",message:h(t)}}))}finally{E.current===l&&(M.current=!1)}},[O,k.activity.kind,k.sections,k.visibleDayCounts,C]),B=(0,i.useCallback)(async()=>{k.nextCursor||"top"===k.view&&k.posts.length>k.visibleCount?await N(!1):await U(!1)},[U,N,k.nextCursor,k.posts.length,k.view,k.visibleCount]),K=(0,i.useCallback)(()=>{let e=S.current;e&&e.view===k.view&&e.range===k.range&&e.publishedOnly===k.publishedOnly&&A(k.view,k.range,k.publishedOnly)},[A,k.publishedOnly,k.range,k.view]),V=(0,i.useCallback)(()=>{let e="error"===k.activity.kind?k.activity.action:null;"date-expansion"===e&&"error"===k.activity.kind&&k.activity.day?$(k.activity.day,!0):"date"===e?U(!0):(_.current+=1,"continuation"===e)?N(!0):A(k.view,k.range,k.publishedOnly)},[$,A,U,N,k.activity,k.publishedOnly,k.range,k.view]),{activity:H}=k,q="loading"===H.kind?"initial"===H.action?"initial-loading":"continuation"===H.action?"loading-more":"ready":"error"===H.kind&&"date"!==H.action&&"date-expansion"!==H.action?"error":"ready",Q="error"===H.kind&&"date"!==H.action&&"date-expansion"!==H.action?H.message:null,W=y&&"top"===k.view&&"today"===k.range&&("idle"===H.kind||"initial"!==H.action),X="idle"!==H.kind&&"date"===H.action?"loading"===H.kind?"loading":"error":k.dateCursor?"idle":"terminus";(0,i.useEffect)(()=>{let t=new URLSearchParams(window.location.search);if(!(t.has("view")||t.has("range"))&&"ready"===q){if("hot"===k.view){"hot"!==b&&window.history.replaceState(null,"",(0,r.continuousFeedSelectionHref)(e,"hot",null,null));return}"top"!==k.view||new Set(k.posts.map(e=>e.clusterId)).size>=r.MIN_DEFAULT_FEED_CLUSTERS||(window.history.replaceState(null,"",(0,r.continuousFeedSelectionHref)(e,"hot",null,null)),A("hot",null,k.publishedOnly))}},[e,b,A,k.posts,k.publishedOnly,k.view,q]),(0,i.useEffect)(()=>
2{if("top"!==k.view||"today"!==k.range)return;let e=(0,r.pacificDayOf)(new Date(k.nowMs)),t=(0,r.pacificDayWindow)(e).endUtc.getTime(),i=!1,n=()=>{i||Date.now()<t||(i=!0,A("top","today",k.publishedOnly))},a=window.setTimeout(n,Math.max(0,t-Date.now()));return window.addEventListener("focus",n),document.addEventListener("visibilitychange",n),()=>{window.clearTimeout(a),window.removeEventListener("focus",n),document.removeEventListener("visibilitychange",n)}},[A,k.nowMs,k.publishedOnly,k.range,k.view]),(0,i.useEffect)(()=>{let t=()=>{let t,i,n,a,s,o,l=(i=(t=new URLSearchParams(window.location.search)).getAll("view"),n=t.getAll("range"),s={range:"top"===(a=(0,r.normalizeFeedView)(1===i.length?i[0]:null,n.length>0?"top":b))?(0,r.normalizeTopFeedRange)(1===n.length?n[0]:null):null,view:a},o=(0,r.continuousFeedSelectionHref)(e,s.view,s.range,t.has("view")||t.has("range")?null:b),`${window.location.pathname}${window.location.search}`!==o&&window.history.replaceState(null,"",o),s);l.range&&(j.current=l.range),f(w),A(l.view,l.range,k.publishedOnly)};return window.addEventListener("popstate",t),()=>{window.removeEventListener("popstate",t)}},[e,b,w,A,k.publishedOnly]);let J="top"===k.view?(0,o.feedPostsForPlaces)(k.posts,x,k.visibleCount):[],Y="top"===k.view?(0,o.feedPlaceCount)(J,x):0,Z="top"===k.view&&"idle"===H.kind&&!!k.nextCursor&&J.length===k.posts.length&&J.length>Y&&Y<k.visibleCount;return(0,i.useEffect)(()=>{Z&&N(!1,!1)},[N,Z]),(0,i.useEffect)(()=>{let e=D.current;if(e&&"top"!==k.view&&k.nextCursor&&"ready"===q)return v(e,"600px 0px",()=>void B())},[B,k.nextCursor,k.view,q]),(0,i.useEffect)(()=>{let e=F.current;if(e&&W&&"idle"===X&&"idle"===H.kind)return v(e,"300px",()=>void U(!1))},[H.kind,W,X,U]),(0,i.useEffect)(()=>()=>{P.current?.abort(),E.current+=1},[]),{completedDates:{enabled:W,sections:k.sections.map(e=>({...e,posts:e.posts.slice(0,k.visibleDayCounts[e.pacificDay]??r.TOP_FEED_POST_LIMIT)})),canExpand:e=>{let t=k.sections.find(t=>t.pacificDay===e);return!!(t&&(t.hasMoreInDay||t.posts.length>(k.visibleDayCounts[e]??r.TOP_FEED_POST_LIMIT)))},onExpand:e=>void $(e),onLoadMore:()=>void U(!1),expandingDay:"loading"===H.kind&&"date-expansion"===H.action?H.day:null,failedDay:"error"===H.kind&&"date-expansion"===H.action?H.day:null,busy:"loading"===H.kind,sentinelRef:F,status:X},errorMessage:Q,canShowMore:"top"===k.view&&(!!k.nextCursor||k.posts.length>J.length),nextCursor:k.nextCursor,nowMs:k.nowMs,onLoadMore:()=>void B(),onPublishedOnlyChange:z,onRangeChange:G,onRefresh:K,onRetry:V,onViewChange:L,posts:"top"===k.view?J:k.posts,publishedClusterIds:k.publishedClusterIds,publishedOnly:k.publishedOnly,range:k.range,sentinelRef:D,status:q,view:k.view}}],373364)}]);
3
4//# debugId=b804a50f-daba-2896-4d8d-d29d708fa255
5//# sourceMappingURL=19nf8x4jgqcq2.js.map
6//# chunkId=01a0f533-45c5-7613-8abd-31f5c332412c

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.