PageSourceSearch

https://twelveearths.com/assets/chunks/chunk-ab9dfbfe.js

js twelveearths.com collected 2026-10-06 16:18:50 UTC 5,882 bytes, 1 lines download raw bytes

1import{r as l,x as C,j as a,c as E,$ as M,y as k,T as $,C as I,I as B,F as O,g as j,V as H,a as P}from"./chunk-7c95c149.js";import{u as W,I as z}from"./chunk-bd799850.js";function F(e,i){var t=l.useRef(null),n=l.useRef(null);n.current=i;var s=l.useRef(null);l.useEffect(function(){c()});var c=l.useCallback(function(){var r=s.current,u=n.current,o=r||(u?u instanceof Element?u:u.current:null);t.current&&t.current.element===o&&t.current.subscriber===e||(t.current&&t.current.cleanup&&t.current.cleanup(),t.current={element:o,subscriber:e,cleanup:o?e(o):void 0})},[e]);return l.useEffect(function(){return function(){t.current&&t.current.cleanup&&(t.current.cleanup(),t.current=null)}},[]),l.useCallback(function(r){s.current=r,c()},[c])}function N(e,i,t){return e[i]?e[i][0]?e[i][0][t]:e[i][t]:i==="contentBoxSize"?e.contentRect[t==="inlineSize"?"width":"height"]:void 0}function _(e){e===void 0&&(e={});var i=e.onResize,t=l.useRef(void 0);t.current=i;var n=e.round||Math.round,s=l.useRef(),c=l.useState({width:void 0,height:void 0}),r=c[0],u=c[1],o=l.useRef(!1);l.useEffect(function(){return o.current=!1,function(){o.current=!0}},[]);var h=l.useRef({width:void 0,height:void 0}),x=F(l.useCallback(function(m){return(!s.current||s.current.box!==e.box||s.current.round!==n)&&(s.current={box:e.box,round:n,instance:new ResizeObserver(function(b){var g=b[0],v=e.box==="border-box"?"borderBoxSize":e.box==="device-pixel-content-box"?"devicePixelContentBoxSize":"contentBoxSize",w=N(g,v,"inlineSize"),p=N(g,v,"blockSize"),d=w?n(w):void 0,f=p?n(p):void 0;if(h.current.width!==d||h.current.height!==f){var R={width:d,height:f};h.current.width=d,h.current.height=f,t.current?t.current(R):o.current||u(R)}})}),s.current.instance.observe(m,{box:e.box}),function(){s.current&&s.current.instance.unobserve(m)}},[e.box,n]),e.ref);return l.useMemo(function(){return{ref:x,width:r.width,height:r.height}},[x,r.width,r.height])}function q({aspectRatio:e,initialWidth:i,initialHeight:t}){let{ref:n,width:s=i??0,height:c=t??0}=_(),r,u;return s/c>e?(u=c,r=c*e):(r=s,u=s/e),{ref:n,dimensions:{width:r,height:u}}}function T({tags:e}){const{urlParsed:i,urlPathname:t}=C(),{search:n}=i,s=n.q||"",c=t.startsWith("/research/search");return a.jsx("div",{className:"font-mono text-sm text-foreground/50",children:e.map((r,u)=>a.jsxs(l.Fragment,{children:[a.jsxs("a",{className:E("hover:text-foreground/100",c&&s==r&&"text-accent"),href:`/research/search?q=${r}`,children:[r,u!==e.length-1&&","]})," "]},r))})}const S=l.createContext(void 0);function U(e){const i=l.useContext(S);if(!i)throw new Error("Missing ResearchModalContext.Provider in the tree");return i(e)}function D({entry:e}){var o,h,x,m,b,g,v,w,p,d,f;const{width:i,height:t}=W(),n=Math.min(t*.75,((o=e==null?void 0:e.image)==null?void 0:o.height)??1/0),s=i/(((h=e==null?void 0:e.image)==null?void 0:h.ratio)??1),c=Math.min(n,s),{dimensions:r,ref:u}=q({aspectRatio:((x=e==null?void 0:e.image)==null?void 0:x.ratio)??1});return a.jsx("div",{ref:u,className:"w-full h-full portrait:h-[var(--height)]",style:{"--height":`${c}px`},children:a.jsx("div",{className:"w-[var(--width)] h-[var(--height)] portrait:mx-auto",style:{"--width":`${r.width}px`,"--height":`${r.height}px`},children:e&&a.jsx(O,{flipId:e.slug,children:a.jsxs("div",{className:"w-full h-full relative max-w-[var(--max-width)] max-h-[var(--max-height)] portrait:mx-auto",style:{"--max-width":`${(m=e==null?void 0:e.image)==null?void 0:m.width}px`,"--max-height":`${(b=e==null?void 0:e.image)==null?void 0:b.height}px`},children:[a.jsx(z,{className:"absolute inset-0",src:j(e.image.url),layout:"constrained",sizes:"30vh",alt:(g=e.image)==null?void 0:g.alt,width:(v=e.image)==null?void 0:v.width,height:(w=e.image)==null?void 0:w.height,lazyload:!1}),a.jsx(z,{className:"absolute inset-0",src:j(e.image.url),layout:"constrained",sizes:"50vw",alt:(p=e.image)==null?void 0:p.alt,width:(d=e.image)==null?void 0:d.width,height:(f=e.image)==null?void 0:f.height,lazyload:!1})]})})})})}function L(){const e=l.useRef(null),{close:i,active:t}=U(c=>c),n=!!t;M({isDisabled:!n});const s=l.useCallback(c=>{var r,u;c?(e.current=c,e.current.on("hide",i),n?(r=e.current)==null||r.show():(u=e.current)==null||u.hide()):e.current&&e.current.off("hide",i)},[i,e]);return l.useEffect(()=>{var c,r;return n?(c=e.current)==null||c.show():(r=e.current)==null||r.hide(),()=>{var u;(u=e.current)==null||u.hide()}},[n]),a.jsx(k,{dialogRef:s,id:"research-modal",title:"Research Modal",classNames:{container:"fixed inset-0 z-30 flex aria-hidden:invisible",overlay:"fixed inset-0 bg-white",dialog:"fixed inset-0 z-30",closeButton:"hidden",title:"hidden"},children:a.jsxs($,{className:"relative w-full h-full font-mono text-sm text-foreground overflow-y-auto",updateBody:!1,children:[a.jsx("div",{className:"fixed inset-0 grid grid-cols-2 gap-x-8 gap-y-4 portrait:relative portrait:block portrait:h-auto portrait:w-full bg-white",children:a.jsx("div",{className:"w-full h-full portrait:h-auto",children:a.jsx(D,{entry:t})})}),a.jsx(I,{className:"relative grid grid-cols-2 gap-8 py-6 portrait:py-4 portrait:block animate-fadein",children:a.jsxs("div",{className:"col-start-2 space-y-4",children:[a.jsx("h3",{className:"uppercase",children:t==null?void 0:t.t
1itle}),(t==null?void 0:t.text)&&a.jsx("div",{className:"space-y-4",dangerouslySetInnerHTML:{__html:t==null?void 0:t.text}}),t&&a.jsx(T,{tags:t.tags})]})},t==null?void 0:t.slug),a.jsx("div",{className:"fixed top-0 right-0 px-4 py-2 mix-blend-difference text-white z-10",children:a.jsx("button",{onClick:i,className:"-m-4 p-4",children:a.jsx(B,{className:"w-6 h-6 lg:w-12 lg:h-12 stroke-[1.25] lg:stroke-[0.75]",name:"x"})})})]})})}L.Provider=({children:e})=>{const i=H(n=>n.flip),[t]=l.useState(()=>P()(n=>({open:s=>{n({active:s}),i()},close:()=>{n({active:void 0}),i()}})));return a.jsx(S.Provider,{value:t,children:e})};export{L as R,T as a,_ as b,U as u};

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.