1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[421],{66316:(e,t,r)=>{"use strict";r.d(t,{ImpactExperience:()=>eE});var a=r(95155),n=r(12115),l=r(26497),o=r(37068);let i="org.hypercerts.context.attachment",s="org.simocracy.feed.post";function c(e){return[...d(e.contributors).map(e=>e.replace(/^@/,"")).filter(Boolean).map(e=>"https://bsky.app/profile/".concat(e)),...d(e.url)]}function d(e){return e?e.split(/[\s,]+/).map(e=>e.trim()).filter(Boolean):[]}async function u(e,t,r){var a;let n=r.title.trim(),l=r.description.trim();if(!n)throw Error("Evidence needs a title.");if(!l)throw Error("Evidence needs a description.");let o=[{$type:"org.hypercerts.defs#uri",uri:t.subjectUri}];for(let e of c(r))try{new URL(e),o.push({$type:"org.hypercerts.defs#uri",uri:e})}catch(t){throw Error("Not a valid URL: ".concat(e))}let s={$type:i,title:n,contentType:r.kind,content:o,description:{$type:"org.hypercerts.defs#descriptionString",value:l},createdAt:(a=r.date)&&/^\d{4}-\d{2}-\d{2}$/.test(a)?"".concat(a,"T12:00:00.000Z"):new Date().toISOString()};t.claim&&(s.subjects=[{$type:"com.atproto.repo.strongRef",uri:t.claim.uri,cid:t.claim.cid}]);let d=await e.com.atproto.repo.createRecord({repo:e.assertDid,collection:i,record:s});return{uri:d.data.uri,cid:d.data.cid}}async function p(e,t,r){let a=r.trim();if(!a)throw Error("Comment cannot be empty.");if([...a].length>240)throw Error("Comments are capped at ".concat(240," characters."));let n="".concat(a,"\n\n").concat(t.subjectUri),l=new TextEncoder,o=l.encode("".concat(a,"\n\n")).length,i=o+l.encode(t.subjectUri).length,c={$type:s,text:n,facets:[{index:{byteStart:o,byteEnd:i},features:[{$type:"app.bsky.richtext.facet#link",uri:t.subjectUri}]}],createdAt:new Date().toISOString()};if(t.claim){let e={$type:"com.atproto.repo.strongRef",uri:t.claim.uri,cid:t.claim.cid};c.reply={root:e,parent:e}}let d=await e.com.atproto.repo.createRecord({repo:e.assertDid,collection:s,record:c});return{uri:d.data.uri,cid:d.data.cid}}async function m(e,t){let r=t.match(/^at:\/\/([^/]+)\/([^/]+)\/([^/]+)$/);if(!r)throw Error("Not an AT-URI: ".concat(t));let[,a,n,l]=r;if(a!==e.assertDid)throw Error("Can only delete your own records.");await e.com.atproto.repo.deleteRecord({repo:a,collection:n,rkey:l})}let h=new Set([s,"org.impactindexer.review.comment"]),x="https://constellation.microcosm.blue";async function f(e){try{let t=await fetch(e);if(!t.ok)return null;return await t.json()}catch(e){return null}}async function g(e){var t;let r=await f("".concat(x,"/links/all?target=").concat(encodeURIComponent(e))),a=[];for(let[e,n]of Object.entries(null!=(t=null==r?void 0:r.links)?t:{}))for(let[t,r]of Object.entries(n))r.records>0&&a.push({collection:e,path:t});return a}async function v(e,t,r){var a;let n=await f("".concat(x,"/links?target=").concat(encodeURIComponent(e),"&collection=").concat(encodeURIComponent(t),"&path=").concat(encodeURIComponent(r)));return null!=(a=null==n?void 0:n.linking_records)?a:[]}let b=new Map;function y(e){let t=b.get(e);if(t)return t;let r=(async()=>{var t,r;let a;if(e.startsWith("did:plc:"))a="https://plc.directory/".concat(e);else{if(!e.startsWith("did:web:"))return null;a="https://".concat(e.slice(8).split(":").join("/"),"/.well-known/did.json")}let n=await f(a),l=null==n||null==(t=n.service)?void 0:t.find(e=>"#atproto_pds"===e.id||"AtprotoPersonalDataServer"===e.type);return null!=(r=null==l?void 0:l.serviceEndpoint)?r:null})();return b.set(e,r),r}async function k(e){var t;let r=await y(e.did);if(!r)return null;let a=await f("".concat(r,"/xrpc/com.atproto.repo.getRecord?repo=").concat(encodeURIComponent(e.did),"&collection=").concat(encodeURIComponent(e.collection),"&rkey=").concat(encodeURIComponent(e.rkey)));return null!=(t=null==a?void 0:a.value)?t:null}async function w(e){let t=new Map,r=[...new Set(e)];for(let e of r)t.set(e,{did:e,handle:null,displayName:null,avatar:null});for(let e=0;e<r.length;e+=25){var a,n,l,o;let i=r.slice(e,e+25).map(e=>"actors=".concat(encodeURIComponent(e))).join("&"),s=await f("https://public.api.bsky.app/xrpc/app.bsky.actor.getProfiles?".concat(i));for(let e of null!=(a=null==s?void 0:s.profiles)?a:[])t.set(e.did,{did:e.did,handle:null!=(n=e.handle)?n:null,displayName:null!=(l=e.displayName)?l:null,avatar:null!=(o=e.avatar)?o:null})}return t}async function j(e){var t;let r=null!=(t=e[0])?t:"",a=new Map;await Promise.all(e.map(async e=>{let t=(await g(e)).filter(e=>e.collection===i||h.has(e.collection));await Promise.all(t.map(async t=>{let{collection:r,path:n}=t;
1for(let t of(await v(e,r,n)))a.set("at://".concat(t.did,"/").concat(t.collection,"/").concat(t.rkey),t)}))}));let n=[...a.values()],l=await Promise.all(n.map(async e=>({ref:e,value:await k(e)}))),o=[],s=[];for(let{ref:e,value:t}of l)if(t)if(e.collection===i){let a=function(e,t,r){var a;let n="string"==typeof t.title?t.title:"",l="string"==typeof t.createdAt?t.createdAt:"";if(!n||!l)return null;let o=[];if(Array.isArray(t.content))for(let e of t.content){let t=e.uri;"string"==typeof t&&t!==r&&o.push(t)}return{uri:"at://".concat(e.did,"/").concat(e.collection,"/").concat(e.rkey),did:e.did,title:n,kind:"string"==typeof t.contentType?t.contentType:"evidence",description:(a=t.description)&&"object"==typeof a?"string"==typeof a.value?a.value:Array.isArray(a.blocks)?a.blocks.map(e=>{var t;let r=e.block;return null!=(t=null==r?void 0:r.plaintext)?t:""}).filter(Boolean).join("\n\n"):"":"",links:o,createdAt:l}}(e,t,r);a&&o.push(a)}else{let a=function(e,t,r){let a="string"==typeof t.text?t.text:"",n="string"==typeof t.createdAt?t.createdAt:"";return a&&n&&(r&&a.endsWith(r)&&(a=a.slice(0,-r.length).trimEnd()),a)?{uri:"at://".concat(e.did,"/").concat(e.collection,"/").concat(e.rkey),did:e.did,text:a,createdAt:n}:null}(e,t,r);a&&s.push(a)}let c=await w([...o.map(e=>e.did),...s.map(e=>e.did)]),d=e=>{var t;return null!=(t=c.get(e))?t:{did:e,handle:null,displayName:null,avatar:null}},u=(e,t)=>e.createdAt.localeCompare(t.createdAt);return{evidence:o.map(e=>({...e,author:d(e.did)})).sort(u),comments:s.map(e=>({...e,author:d(e.did)})).sort(u)}}async function N(e){try{let t=await fetch(e);if(!t.ok)return null;return await t.json()}catch(e){return null}}function C(e){let t=e.match(/^at:\/\/([^/]+)\/([^/]+)\/([^/]+)$/);return t?{did:t[1],collection:t[2],rkey:t[3]}:null}async function S(e){var t;let r=C(e);if(!r)return null;let a=await y(r.did);if(!a)return null;let n=await N("".concat(a,"/xrpc/com.atproto.repo.getRecord?repo=").concat(encodeURIComponent(r.did),"&collection=").concat(encodeURIComponent(r.collection),"&rkey=").concat(encodeURIComponent(r.rkey)));return null!=(t=null==n?void 0:n.value)?t:null}async function A(e){var t,r,a;let n=await N("https://public.api.bsky.app/xrpc/app.bsky.actor.getProfile?actor=".concat(encodeURIComponent(e)));return n?{did:n.did,handle:null!=(t=n.handle)?t:null,displayName:null!=(r=n.displayName)?r:null,avatar:null!=(a=n.avatar)?a:null}:null}function P(e,t){if(!e)return t;let r=e.match(/^\d{4}-\d{2}-\d{2}/);return r?r[0]:t}async function E(e){let t=[...new Set(e.map(e=>{var t;return e.claim?null==(t=C(e.claim.uri))?void 0:t.did:void 0}).filter(e=>!!e))],[r,a]=await Promise.all([Promise.all(e.map(e=>e.claim?S(e.claim.uri):null)),Promise.all(t.map(A))]),n=new Map(t.map((e,t)=>[e,a[t]]));return e.map((e,t)=>{var a,l,o,i,s,c,d,u,p,m,h,x;let f=r[t],g=e.claim?null==(a=C(e.claim.uri))?void 0:a.did:void 0,v=g&&null!=(l=n.get(g))?l:void 0;if(!f)return v?{...e,creator:v}:e;return{...e,title:null!=(o=f.title)?o:e.title,shortDescription:null!=(i=f.shortDescription)?i:e.shortDescription,description:(p=f.description,m=e.description,"string"==typeof p&&p?p:p&&"object"==typeof p&&"string"==typeof p.value&&p.value?p.value:m),startDate:P(f.startDate,e.startDate),endDate:P(f.endDate,e.endDate),workScope:(s=f.workScope,c=e.workScope,"string"==typeof s&&s?s.split(",").map(e=>e.trim()).filter(Boolean):c),contributors:(d=f.contributors,u=e.contributors,(null==d?void 0:d.length)?d.map((e,t)=>{var r,a,n,l,o,i;let s=e.contributorIdentity;return{name:"string"==typeof s&&s?s:null!=(l=null!=(n=null==s?void 0:s.identity)?n:null==(r=u[t])?void 0:r.name)?l:"Contributor",role:null!=(i=null!=(o=e.contributionDetails)?o:null==(a=u[t])?void 0:a.role)?i:""}}):u),image:(h=f.image,x=e.image,h&&"object"==typeof h&&"string"==typeof h.uri&&h.uri.startsWith("https://")?h.uri:x),published:!0,...v?{creator:v}:{}}})}var I=r(22039),M=r(53127),D=r(94416);function U(e){let t=(0,D.M)(()=>(0,I.OQ)(e)),{isStatic:r}=(0,n.useContext)(M.Q);if(r){let[,r]=(0,n.useState)(e);(0,n.useEffect)(()=>t.on("change",r),[])}return t}var R=r(33182),T=r(49752),z=r(73934);function F(e){return"number"==typeof e?e:parseFloat(e)}var L=r(16706),O=r(46436);function B(e,t){let r=U(t()),a=()=>r.set(t());return a(),(0,O.E)(()=>{let t=()=>z.Gt.preRender(a,!1,!0),r=e.map(e=>e.on("change",t));return()=>
1{r.forEach(e=>e()),(0,z.WG)(a)}}),r}function W(e,t){let r=(0,D.M)(()=>[]);return B(e,()=>{r.length=0;let a=e.length;for(let t=0;t<a;t++)r[t]=e[t].get();return t(r)})}function $(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{isStatic:r}=(0,n.useContext)(M.Q),a=()=>(0,R.S)(e)?e.get():e;if(r)return function e(t,r,a,n){if("function"==typeof t){I.bt.current=[],t();let e=B(I.bt.current,t);return I.bt.current=void 0,e}if(void 0!==a&&!Array.isArray(a)&&"function"!=typeof r){var l=t,o=r,i=a,s=n;let c=(0,D.M)(()=>Object.keys(i)),d=(0,D.M)(()=>({}));for(let t of c)d[t]=e(l,o,i[t],s);return d}let c="function"==typeof r?r:function(...e){let t=!Array.isArray(e[0]),r=t?0:-1,a=e[0+r],n=e[1+r],l=e[2+r],o=e[3+r],i=(0,L.G)(n,l,o);return t?i(a):i}(r,a,n),d=Array.isArray(t)?W(t,c):W([t],e=>{let[t]=e;return c(t)}),u=Array.isArray(t)?void 0:t.accelerate;return u&&!u.isTransformed&&"function"!=typeof r&&Array.isArray(a)&&(null==n?void 0:n.clamp)!==!1&&(d.accelerate={...u,times:r,keyframes:a,isTransformed:!0,...(null==n?void 0:n.ease)?{ease:n.ease}:{}}),d}(a);let l=U(a());return(0,n.useInsertionEffect)(()=>(function(e,t,r={}){let a,n=e.get(),l=null,o=n,i="string"==typeof n?n.replace(/[\d.-]/g,""):void 0,s=()=>{l&&(l.stop(),l=null),e.animation=void 0},c=()=>{(()=>{let t=F(e.get()),n=F(o);if(t===n)return s();let i=l?l.getGeneratorVelocity():e.getVelocity();s(),l=new T.s({keyframes:[t,n],velocity:i,type:"spring",restDelta:.001,restSpeed:.01,...r,onUpdate:a})})(),e.animation=l??void 0,e.events.animationStart?.notify(),l?.then(()=>{e.animation=void 0,e.events.animationComplete?.notify()})};if(e.attach((e,t)=>{o=e,a=e=>{var r,a;return t((r=e,(a=i)?r+a:r))},z.Gt.postRender(c)},s),(0,R.S)(t)){let a=!0===r.skipInitialAnimation,n=t.on("change",t=>{var r,n,l,o;a?(a=!1,e.jump((r=t,(n=i)?r+n:r),!1)):e.set((l=t,(o=i)?l+o:l))}),l=e.on("destroy",n);return()=>{n(),l()}}return s})(l,e,t),[l,JSON.stringify(t)]),l}(e,{type:"spring",...t})}var _=r(39026);function X(){var e,t;let r=(e=["radial-gradient(360px circle at ","% ","%, rgba(255,255,255,0.20), rgba(255,255,255,0.05) 42%, transparent 70%)"],t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}})));return X=function(){return r},r}let G={card:[{height:"68%",blur:3,fadeStop:"32%"},{height:"58%",blur:8,fadeStop:"38%"},{height:"48%",blur:16,fadeStop:"42%"},{height:"36%",blur:26,fadeStop:"48%"}],hero:[{height:"42%",blur:2,fadeStop:"40%"},{height:"34%",blur:5,fadeStop:"46%"},{height:"26%",blur:10,fadeStop:"52%"},{height:"18%",blur:16,fadeStop:"58%"}]};function Y(e){let{tint:t,variant:r="card"}=e,n=G[r];return(0,a.jsxs)(a.Fragment,{children:[n.map((e,t)=>{let r="linear-gradient(to bottom, transparent 0%, black ".concat(e.fadeStop,", black 100%)");return(0,a.jsx)("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-x-0 bottom-0",style:{height:e.height,backdropFilter:"blur(".concat(e.blur,"px)"),WebkitBackdropFilter:"blur(".concat(e.blur,"px)"),maskImage:r,WebkitMaskImage:r}},t)}),(0,a.jsx)("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-x-0 bottom-0",style:{height:n[0].height,background:t}})]})}let Z={stiffness:160,damping:18,mass:.6},K={upcoming:"Upcoming"};function H(e){var t,r,l;let{cert:o,onSelect:i,isActive:s=!0,frozen:c=!1,width:d,layoutDependency:u}=e,p=(0,n.useRef)(null),m=U(0),h=U(0),x=U(50),f=U(35),g=$(m,Z),v=$(h,Z),b=$(x,{stiffness:120,damping:20}),y=$(f,{stiffness:120,damping:20}),k=function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),a=1;a<t;a++)r[a-1]=arguments[a];let n=e.length;return B(r.filter(R.S),function(){let t="";for(let a=0;a<n;a++){t+=e[a];let n=r[a];n&&(t+=(0,R.S)(n)?n.get():n)}return t})}(X(),b,y);function w(){m.set(0),h.set(0),x.set(50),f.set(35)}return(0,n.useEffect)(()=>{c&&w()},[c]),(0,a.jsx)("div",{style:{perspective:1400},children:(0,a.jsxs)(_.P.button,{ref:p,type:"button",onClick:i,onPointerMove:function(e){let t=p.current;if(!t||!s||c)return;let r=t.getBoundingClientRect(),a=(e.clientX-r.left)/r.width-.5,n=(e.clientY-r.top)/r.height-.5;h.set(14*a),m.set(-(12*n)),x.set((a+.5)*100),f.set((n+.5)*100)},onPointerLeave:w,whileHover:s&&!c?{scale:1.02}:void 0,whileTap:s&&!c?{scale:.99}:void 0,transition:{type:"spring",...Z},"aria-label":"Open impact claim: ".concat(o.title),tabIndex:s?0:-1,"aria-hidden":!s,className:"group relative block aspect-[5/8] cursor-pointer rounded-[26px] text-left",style:{width:null!=d?d:"min(72vw, 280px)",rotateX:g,rotateY:v,transformStyle:"preserve-3d",boxShadow:"0 40px 80px -30px rgba(0,0,0,0.55), 0 16px 32px -18px rgba(0,0,0,0.4)"},children:[(0,a.jsxs)(_.P.div,{layoutId:"cert-media-".concat(o.rkey),layoutDependency:u,className:"absolute inset-0 overflow-hidden rounded-[26px]",style:{borderRadius:26},children:[(0,a.jsx)("img",{src:o.image,alt:o.imageAlt,className:"absolute inset-0 h-full w-full object-cover ".concat(c?"":"transition-transform duration-700 ease-out group-hover:scale-[1.06]")}),(0,a.jsx)(Y,{tint:"linear-gradient(to bottom, transparent 0%, rgba(16,20,12,0.10) 34%, rgba(16,20,12,0.34) 68%, rgba(16,20,12,0.52) 100%)"}
1),(0,a.jsx)("div",{"aria-hidden":!0,className:"absolute inset-0 rounded-[26px]",style:{boxShadow:"inset 0 1px 0 rgba(255,255,255,0.25), inset 0 0 0 1px rgba(255,255,255,0.08)"}})]}),(0,a.jsx)(_.P.div,{"aria-hidden":!0,className:"pointer-events-none absolute inset-0 rounded-[26px] opacity-0 transition-opacity duration-300 ".concat(c?"":"group-hover:opacity-100"),style:{background:k}}),(0,a.jsxs)("div",{className:"absolute inset-0 flex flex-col justify-between p-5",style:{transform:"translateZ(40px)",transformStyle:"preserve-3d"},children:[(0,a.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,a.jsxs)("span",{className:"inline-flex items-center gap-1.5 rounded-full border border-white/20 bg-black/30 px-2.5 py-1 font-mono text-[8.5px] uppercase tracking-[0.18em] text-white/90 backdrop-blur-md",children:[(null==(t=o.creator)?void 0:t.avatar)?(0,a.jsx)("img",{src:o.creator.avatar,alt:null!=(r=o.creator.handle)?r:"claim creator",title:"Claimed by @".concat(null!=(l=o.creator.handle)?l:o.creator.did),className:"h-3.5 w-3.5 rounded-full object-cover ring-1 ring-white/40"}):(0,a.jsx)("span",{"aria-hidden":!0,className:"block h-1.5 w-1.5 rounded-full anim-pulse-dot",style:{background:"upcoming"===o.status?"#7BC98A":"#E8B73A"}}),"upcoming"===o.status?K.upcoming:"Hypercert"]}),(0,a.jsx)("span",{className:"whitespace-nowrap rounded-full border border-white/20 bg-black/30 px-2.5 py-1 font-mono text-[8.5px] uppercase tracking-[0.14em] text-white/80 backdrop-blur-md",children:o.dateLabel.replace(/,\s*\d{4}$/,"")})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"mb-1.5 font-mono text-[9px] uppercase tracking-[0.2em] text-white/60",children:o.location}),(0,a.jsx)("h3",{className:"font-serif text-[22px] leading-[1.1] tracking-tight text-white",children:o.title}),(0,a.jsx)("p",{className:"mt-2 line-clamp-3 text-[12.5px] leading-relaxed text-white/75",children:o.shortDescription}),(0,a.jsx)("div",{className:"mt-3 flex flex-wrap gap-1.5",children:o.stats.slice(0,2).map(e=>(0,a.jsxs)("span",{className:"rounded-full border border-white/15 bg-white/10 px-2.5 py-1 font-mono text-[9.5px] tracking-wide text-white/90 backdrop-blur-md",children:[(0,a.jsx)("span",{className:"text-white",children:e.value}),(0,a.jsxs)("span",{className:"text-white/60",children:["\xa0",e.label]})]},e.label))}),(0,a.jsx)("div",{className:"mt-4 block w-full rounded-full bg-white py-3 text-center text-[13px] font-medium tracking-wide text-[#10140C] transition group-hover:bg-white/90",children:"upcoming"===o.status?"Preview claim":"View impact claim"})]})]})]})})}var J=r(18481),V=r(69319),Q=r(19016);let q={evidence:[],comments:[]};function ee(e){return e.displayName||(e.handle?"@".concat(e.handle):null)||"".concat(e.did.slice(0,24),"â¦")}function et(e){var t;let{author:r,size:n=24}=e;return r.avatar?(0,a.jsx)("img",{src:r.avatar,alt:"",className:"shrink-0 rounded-full object-cover",style:{width:n,height:n}}):(0,a.jsx)("span",{"aria-hidden":!0,className:"grid shrink-0 place-items-center rounded-full font-mono uppercase",style:{width:n,height:n,fontSize:Math.max(8,Math.round(.38*n)),background:"var(--foil-haze)",color:"var(--foil)"},children:(null!=(t=r.handle)?t:r.did.replace("did:plc:","")).slice(0,2)})}let er=/^https:\/\/bsky\.app\/profile\/([^/?#]+)\/?$/;function ea(e){let t=e.match(er);return t?t[1]:null}let en=new Map,el="w-full rounded-lg border bg-transparent px-3 py-2 text-[14px] text-[color:var(--ink-on-cloth)] outline-none transition placeholder:text-[color:var(--ink-ghost)] focus:border-[color:var(--foil)]",eo={borderColor:"var(--rule-strong)"},ei="rounded-full px-4 py-2 font-mono text-[10.5px] uppercase tracking-[0.18em] transition disabled:cursor-not-allowed disabled:opacity-40";function es(e){let{returnTo:t}=e,{ready:r,did:l,handle:o,signIn:i,signInEmail:s,signOut:c}
1=(0,Q.A)(),[d,u]=(0,n.useState)(!1),[p,m]=(0,n.useState)("handle"),[h,x]=(0,n.useState)(""),[f,g]=(0,n.useState)(!1),[v,b]=(0,n.useState)(null);if(!r)return(0,a.jsx)("span",{className:"font-mono text-[9.5px] uppercase tracking-[0.2em] text-[color:var(--ink-ghost)]",children:"Checking sessionâ¦"});if(l)return(0,a.jsxs)("span",{className:"inline-flex flex-wrap items-center gap-2",children:[(0,a.jsx)("span",{className:"rounded-full px-2.5 py-1 font-mono text-[9.5px] tracking-wide text-[color:var(--foil)]",style:{border:"1px solid var(--rule-strong)"},children:o?"@".concat(o):"".concat(l.slice(0,20),"â¦")}),(0,a.jsx)("button",{type:"button",onClick:()=>void c(),className:"font-mono text-[9.5px] uppercase tracking-[0.2em] text-[color:var(--ink-faint)] transition hover:text-[color:var(--foil)]",children:"Sign out"})]});if(!d)return(0,a.jsx)("button",{type:"button",onClick:()=>u(!0),className:ei,style:{border:"1px solid var(--rule-strong)",color:"var(--foil)"},children:"Sign in with ATProto"});let y=async()=>{if(h.trim()&&!f){g(!0),b(null);try{"email"===p?await s(h,t):await i(h,t)}catch(e){console.error("[sign-in] failed:",e),b("email"===p?"Could not start email sign-in.":"Could not start sign-in for that handle."),g(!1)}}};return(0,a.jsxs)("span",{className:"inline-flex flex-col items-end gap-1.5",children:[(0,a.jsxs)("span",{className:"inline-flex items-center gap-2",children:[(0,a.jsx)("input",{autoFocus:!0,t
1ype:"email"===p?"email":"text",value:h,onChange:e=>x(e.target.value),onKeyDown:e=>"Enter"===e.key&&void y(),placeholder:"email"===p?"[email protected]":"you.bsky.social",className:el,style:{...eo,width:200},"aria-label":"email"===p?"Your email address":"Your ATProto handle"}),(0,a.jsx)("button",{type:"button",onClick:()=>void y(),disabled:f||!h.trim(),className:ei,style:{background:"var(--foil)",color:"var(--cloth)"},children:f?"â¦":"Sign in"})]}),(0,a.jsx)("button",{type:"button",onClick:()=>{m(e=>"email"===e?"handle":"email"),x(""),b(null)},className:"font-mono text-[9px] uppercase tracking-[0.16em] text-[color:var(--ink-faint)] transition hover:text-[color:var(--foil)]",children:"email"===p?"Use handle instead":"Use email instead"}),v&&(0,a.jsx)("span",{className:"font-mono text-[9.5px] tracking-wide text-red-600",children:v})]})}let ec=["milestone","session","publication","artifact","release","other"];function ed(e){let{cert:t,onCreated:r}=e,{agent:l,did:o,handle:i}=(0,Q.A)(),[s,d]=(0,n.useState)(!1),[p,m]=(0,n.useState)({title:"",kind:"milestone",description:"",url:"",contributors:"",date:""}),[h,x]=(0,n.useState)(!1),[f,g]=(0,n.useState)(null);if(!o||!l)return(0,a.jsxs)("p",{className:"text-[13px] leading-relaxed text-[color:var(--ink-faint)]",children:["Sign in with ATProto above to add evidence to this timeline. Your entry is saved to your own PDS as an"," ",(0,a.jsx)("code",{className:"font-mono text-[0.85em]",children:"org.hypercerts.context.attachment"})," ","record."]});if(!s)return(0,a.jsx)("button",{type:"button",onClick:()=>d(!0),className:ei,style:{background:"var(--foil)",color:"var(--cloth)"},children:"+ Add evidence"});let v=async()=>{if(!h){x(!0),g(null);try{let e=await u(l,t,p);r({uri:e.uri,did:o,title:p.title.trim(),kind:p.kind,description:p.description.trim(),links:c(p),createdAt:p.date&&/^\d{4}-\d{2}-\d{2}$/.test(p.date)?"".concat(p.date,"T12:00:00.000Z"):new Date().toISOString(),author:{did:o,handle:i,displayName:null,avatar:null}}),m({title:"",kind:"milestone",description:"",url:"",contributors:"",date:""}),d(!1)}catch(e){g(e instanceof Error?e.message:"Failed to publish evidence.")}finally{x(!1)}}};return(0,a.jsxs)("div",{className:"rounded-2xl border p-5",style:{borderColor:"var(--rule-strong)",background:"var(--cloth-2)"},children:[(0,a.jsx)("p",{className:"mb-4 font-mono text-[9.5px] uppercase tracking-[0.22em] text-[color:var(--foil)]",children:"New evidence entry"}),(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsx)("input",{value:p.title,onChange:e=>m(t=>({...t,title:e.target.value})),placeholder:"What happened?",className:el,style:eo,maxLength:256}),(0,a.jsx)("div",{className:"flex flex-wrap gap-1.5",children:ec.map(e=>(0,a.jsx)("button",{type:"button",onClick:()=>m(t=>({...t,kind:e})),className:"rounded-full px-2.5 py-1 font-mono text-[9.5px] uppercase tracking-[0.14em] transition",style:p.kind===e?{background:"var(--foil)",color:"var(--cloth)"}:{border:"1px solid var(--rule-strong)",color:"var(--ink-dim)"},children:e},e))}),(0,a.jsx)("textarea",{value:p.description,onChange:e=>m(t=>({...t,description:e.target.value})),placeholder:"Describe the evidence: outcomes, numbers, links to follow-on work",rows:4,className:el,style:eo}),(0,a.jsx)("input",{value:p.contributors,onChange:e=>m(t=>({...t,contributors:e.target.value})),placeholder:"Contributors (optional): handles like sharfyae.bsky.social, shown with avatars",className:el,style:eo}),(0,a.jsx)("input",{value:p.url,onChange:e=>m(t=>({...t,url:e.target.value})),placeholder:"Supporting links (optional, separate with spaces)",className:el,style:eo}),(0,a.jsxs)("label",{className:"flex items-center gap-3",children:[(0,a.jsx)("span",{className:"font-mono text-[9px] uppercase tracking-[0.18em] text-[color:var(--ink-faint)]",children:"When it happened"}),(0,a.jsx)("input",{type:"date",value:p.date,onChange:e=>m(t=>({...t,date:e.target.value})),className:el,style:{...eo,width:180}})]}),f&&(0,a.jsx)("p",{className:"font-mono text-[10px] tracking-wide text-red-600",children:f}),(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("button",{type:"button",onClick:()=>void v(),disabled:h||!p.title.trim()||!p.description.trim(),className:ei,style:{background:"var(--foil)",color:"var(--cloth)"},children:h?"Publishingâ¦":"Publish to my PDS"}),(0,a.jsx)("button",{type:"button",onClick:()=>d(!1),className:"font-mono text-[9.5px] uppercase tracking-[0.2em] text-[color:var(--ink-faint)] transition hover:text-[color:var(--foil)]",children:"Cancel"})]})]})]})}function eu(e){let{cert:t,activity:r,loading:l,onPosted:o,onDeleted:i}=e,{agent:s,did:c,handle:d}
1=(0,Q.A)(),[u,h]=(0,n.useState)(""),[x,f]=(0,n.useState)(!1),[g,v]=(0,n.useState)(null),b=async()=>{if(s&&c&&!x&&u.trim()){f(!0),v(null);try{let e=await p(s,t,u);o({uri:e.uri,did:c,text:u.trim(),createdAt:new Date().toISOString(),author:{did:c,handle:d,displayName:null,avatar:null}}),h("")}catch(e){v(e instanceof Error?e.message:"Failed to post comment.")}finally{f(!1)}}},y=async e=>{if(s)try{await m(s,e),i(e)}catch(e){}};return(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"mb-6 flex items-baseline justify-between gap-3",children:[(0,a.jsx)("h2",{className:"font-serif text-[clamp(20px,2.4vw,30px)] leading-tight tracking-tight text-[color:var(--ink-on-cloth)]",children:"Comments"}),(0,a.jsx)("span",{className:"font-mono text-[9.5px] uppercase tracking-[0.2em] text-[color:var(--ink-faint)]",children:l?"loadingâ¦":"".concat(r.comments.length," on the network")})]}),0===r.comments.length&&!l&&(0,a.jsxs)("p",{className:"mb-6 text-[13.5px] leading-relaxed text-[color:var(--ink-faint)]",children:["No comments yet. Yours would be the first. Each comment is an"," ",(0,a.jsx)("code",{className:"font-mono text-[0.85em]",children:"org.simocracy.feed.post"})," ","record in your own PDS that links this claim, so it shows up here and in the Simocracy feed."]}),(0,a.jsx)("div",{className:"flex flex-col gap-4",children:r.comments.map(e=>(0,a.jsxs)("article",{className:"rounded-2xl border p-4",style:{borderColor:"var(--rule)",background:"var(--cloth-2)"},children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(et,{author:e.author}),(0,a.jsx)("span",{className:"text-[13px] font-medium text-[color:var(--ink-on-cloth)]",children:ee(e.author)}),(0,a.jsx)("span",{className:"font-mono text-[9px] uppercase tracking-[0.16em] text-[color:var(--ink-ghost)]",children:new Date(e.createdAt).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}),c===e.did&&(0,a.jsx)("button",{type:"button",onClick:()=>void y(e.uri),className:"ml-auto font-mono text-[9px] uppercase tracking-[0.16em] text-[color:var(--ink-ghost)] transition hover:text-red-600",children:"Delete"})]}),(0,a.jsx)("p",{className:"mt-2 whitespace-pre-wrap text-[14px] leading-relaxed text-[color:var(--ink-dim)]",children:e.text})]},e.uri))}),(0,a.jsx)("div",{className:"mt-6",children:s?(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("textarea",{value:u,onChange:e=>h(e.target.value),placeholder:"Share your experience of ".concat(t.title.split(" \xb7 ")[0],"â¦"),rows:3,maxLength:240,className:el,style:eo}),g&&(0,a.jsx)("p",{className:"font-mono text-[10px] tracking-wide text-red-600",children:g}),(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("button",{type:"button",onClick:()=>void b(),disabled:x||!u.trim(),className:ei,style:{background:"var(--foil)",color:"var(--cloth)"},children:x?"Postingâ¦":"Post comment"}),(0,a.jsxs)("span",{className:"font-mono text-[9px] uppercase tracking-[0.16em] text-[color:var(--ink-ghost)]",children:[[...u].length,"/",240]})]})]}):(0,a.jsx)("p",{className:"text-[13px] leading-relaxed text-[color:var(--ink-faint)]",children:"Sign in with ATProto above to join the conversation."})})]})}let ep={milestone:"Milestone",session:"Working session",publication:"Publication",artifact:"Artifact",release:"Release",other:"Other"},em={milestone:"â",session:"â",publication:"â",artifact:"â",release:"⤴",other:"â"};function eh(e){var t;return null!=(t=ep[e])?t:e}function ex(e){var t;return null!=(t=em[e])?t:"â"}let ef={hidden:{opacity:0,y:14},show:e=>({opacity:1,y:0,transition:{delay:.12+.05*e,duration:.4,ease:[.25,.1,.25,1]}})};function eg(e){let{entry:t,index:r}=e,[l,o]=(0,n.useState)(0===r);return(0,a.jsxs)(_.P.article,{custom:r+2,variants:ef,initial:"hidden",animate:"show",className:"relative border-l pl-6",style:{borderColor:"var(--rule-strong)"},children:[(0,a.jsx)("span",{"aria-hidden":!0,className:"absolute -left-[6.5px] top-1 grid h-3 w-3 place-items-center rounded-full text-[7px]",style:{background:"var(--foil)",color:"var(--cloth)"},children:ex(t.kind)}),(0,a.jsxs)("button",{type:"button",onClick:()=>o(e=>!e),"aria-expanded":l,className:"block w-full pb-6 text-left",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)("span",{className:"font-mono text-[9.5px] uppercase tracking-[0.2em] text-[color:var(--foil)]",children:eh(t.kind)}),t.badge&&(0,a.jsx)("span",{className:"rounded-full px-2 py-0.5 font-mono text-[9.5px] tracking-wide text-[color:var(--foil)]",style:{border:"1px solid var(--rule-strong)"},children:t.badge}),(0,a.jsx)("span",{className:"font-mono text-[9.5px] uppercase tracking-[0.18em] text-[color:var(--ink-faint)]",children:t.dateLabel}),t.influence&&(0,a.jsx)(ev,{influence:t.influence,label:t.title})]}),(0,a.jsx)("h4",{className:"mt-1.5 font-serif text-[18px] leading-snug tracking-tight text-[color:var(--ink-on-cloth)]",children:t.title}),(0,a.jsx)(_.P.div,{initial:!1,animate:{height:l?"auto":0,opacity:+!!l},transition:{duration:.3,ease:[.25,.1,.25,1]},className:"overflow-hidden",children:(0,a.jsx)("p",{className:"mt-2 max-w-xl text-[14px] leading-relaxed text-[color:var(--ink-dim)]",children:t.description})})]})]})}function ev(e){let{influence:t,label:r}=e,n=t.share>=.1?Math.round(100*t.share):(100*t.share).toFixed(1),l=e=>{e.stopPropagation(),e.preventDefault(),(0,J.JU)('Why does "'.concat(null!=r?r:"this evidence",'" carry ').concat(n,"% (â").concat(ew(t.amountUsd),") of the documented grant return? Explain the Shapley reasoning briefly."))};return(0,a.jsxs)("span",{role:"button",tabIndex:0,onClick:l,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&l(e)},className:"inline-flex cursor-pointer items-center gap-1 rounded-full px-2 py-0.5 font-mono text-[9.5px] tracking-wide text-[color:var(--foil)] transition hover:brightness-110",style:{background:"var(--foil-haze)",border:"1px solid transparent"},onMouseEnter:e=>e.currentTarget.style.borderColor="var(--foil-ghost)",onMouseLeave:e=>e.currentTarget.style.borderColor="transparent",title:"Estimated Shapley influence on the documented grant return: ".concat(n,"% â ").concat(ew(t.amountUsd),". Click and Molly explains why."),children:[(0,a.jsx)("span",{"aria-hidden":!0,
1className:"h-1.5 rounded-full",style:{width:4+Math.round(40*t.share),background:"var(--foil)"}}),n,"% \xb7 â",ew(t.amountUsd)]})}function eb(e){let{entry:t,influence:r,onDelete:l}=e,[o,i]=(0,n.useState)(!1),s=new Date(t.createdAt),c=Number.isNaN(s.getTime())?t.createdAt:s.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"}),d=t.links.map(ea).filter(e=>null!==e),u=t.links.filter(e=>null===ea(e)),p=function(e){let t=e.join(","),[r,a]=(0,n.useState)(()=>new Map);return(0,n.useEffect)(()=>{if(!t)return;let e=t.split(",").filter(Boolean),r=e.filter(e=>!en.has(e)),n=!1,l=()=>{n||a(new Map(e.filter(e=>en.has(e)).map(e=>[e,en.get(e)])))};if(0===r.length)return void l();let o=r.map(e=>"actors=".concat(encodeURIComponent(e))).join("&");return fetch("https://public.api.bsky.app/xrpc/app.bsky.actor.getProfiles?".concat(o)).then(e=>e.ok?e.json():null).then(e=>{for(let l of r){var t,a,n,o,i;let r=null==e||null==(t=e.profiles)?void 0:t.find(e=>e.handle===l||e.did===l);en.set(l,{actor:l,did:null!=(a=null==r?void 0:r.did)?a:null,handle:null!=(n=null==r?void 0:r.handle)?n:l.includes(".")?l:null,displayName:null!=(o=null==r?void 0:r.displayName)?o:null,avatar:null!=(i=null==r?void 0:r.avatar)?i:null})}l()}).catch(()=>l()),()=>{n=!0}},[t]),r}(d);return(0,a.jsxs)("article",{className:"relative border-l pl-6",style:{borderColor:"var(--rule-strong)"},children:[(0,a.jsx)("span",{"aria-hidden":!0,className:"absolute -left-[6.5px] top-1 grid h-3 w-3 place-items-center rounded-full text-[7px]",style:{background:"var(--cloth)",color:"var(--foil)",border:"1px solid var(--foil)"},children:ex(t.kind)}),(0,a.jsxs)("div",{className:"pb-6",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>i(e=>!e),"aria-expanded":o,className:"block w-full text-left",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)("span",{className:"font-mono text-[9.5px] uppercase tracking-[0.2em] text-[color:var(--foil)]",children:eh(t.kind)}),(0,a.jsxs)("span",{className:"inline-flex items-center gap-1.5 rounded-full py-0.5 pl-1 pr-2 font-mono text-[9.5px] tracking-wide text-[color:var(--foil)]",style:{border:"1px solid var(--rule-strong)"},children:[(0,a.jsx)(et,{author:t.author,size:16}),"community \xb7 ",ee(t.author)]}),(0,a.jsx)("span",{className:"font-mono text-[9.5px] uppercase tracking-[0.18em] text-[color:var(--ink-faint)]",children:c}),r&&(0,a.jsx)(ev,{influence:r,label:t.title})]}),(0,a.jsx)("h4",{className:"mt-1.5 font-serif text-[18px] leading-snug tracking-tight text-[color:var(--ink-on-cloth)]",children:t.title})]}),(0,a.jsxs)(_.P.div,{initial:!1,animate:{height:o?"auto":0,opacity:+!!o},transition:{duration:.3,ease:[.25,.1,.25,1]},className:"overflow-hidden",children:[t.description&&(0,a.jsx)("p",{className:"mt-2 max-w-xl whitespace-pre-wrap text-[14px] leading-relaxed text-[color:var(--ink-dim)]",children:t.description}),d.length>0&&(0,a.jsx)("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:d.map(e=>{var t,r,n,l;let o=p.get(e),i=(null==o?void 0:o.displayName)||(null==o?void 0:o.handle)||e;return(0,a.jsxs)("a",{href:"https://bsky.app/profile/".concat(e),target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 rounded-full py-1 pl-1 pr-2.5 text-[12px] text-[color:var(--ink-on-cloth)] transition hover:border-[color:var(--foil)]",style:{border:"1px solid var(--rule-strong)"},children:[(0,a.jsx)(et,{author:{did:null!=(t=null==o?void 0:o.did)?t:e,handle:null!=(r=null==o?void 0:o.handle)?r:e,displayName:null!=(n=null==o?void 0:o.displayName)?n:null,avatar:null!=(l=null==o?void 0:o.avatar)?l:null},size:20}),i]},e)})}),u.length>0&&(0,a.jsx)("div",{className:"mt-2 flex flex-col gap-1",children:u.map(e=>(0,a.jsxs)("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"break-all font-mono text-[11px] text-[color:var(--foil)] hover:underline",children:[e," â"]},e))}),(0,a.jsxs)("div",{className:"mt-2 flex items-center gap-4",children:[(0,a.jsx)("a",{href:"https://pdsls.dev/".concat(t.uri),target:"_blank",rel:"noopener noreferrer",className:"font-mono text-[9px] uppercase tracking-[0.16em] text-[color:var(--ink-ghost)] transition hover:text-[color:var(--foil)]",children:"View ATProto record â"}),l&&(0,a.jsx)("button",{type:"button",onClick:l,className:"font-mono text-[9px] uppercase tracking-[0.16em] text-[color:var(--ink-ghost)] transition hover:text-red-600",children:"Delete my entry"})]})]})]})]})}let ey=["#E8B73A","#C99C2E","#A67F24","#84651C","#E7D9A8"],ek=["#7BC98A","#5FAF70","#458F56","#2F6B3F"];function ew(e){return e>=1e6?"$".concat((e/1e6).toFixed(1),"M"):"$".concat(Math.round(e/1e3),"k")}function ej(e){return e>=.1?"".concat(Math.round(100*e),"%"):"".concat((100*e).toFixed(1),"%")}function eN(e,t,r){let a=t/r,n=1;for(let t of e){let e=t.area/a,r=Math.max(e/a,a/e);r>n&&(n=r)}return n}function eC(e){let{items:t,costUsd:r,roiLabel:l}=e,{rects:o,total:i,groupStats:s}=(0,n.useMemo)(()=>{let e=t.reduce((e,t)=>
1e+t.amountUsd,0),r=["retreat","community"].map(e=>({g:e,members:t.map((e,t)=>({item:e,index:t})).filter(t=>t.item.group===e)})).filter(e=>e.members.length>0),a=[],n=680-5*(r.length-1),l=0,o=r.map(t=>{let r=t.members.reduce((e,t)=>e+t.item.amountUsd,0),o=r/e*n,i=[...t.members].sort((e,t)=>t.item.amountUsd-e.item.amountUsd),s=168*o/r;return!function(e,t,r,a,n,l){let o=e,i=t,s=0,c=a,d=168;for(;o.length>0&&c>.5&&d>.5;){let e=Math.min(c,d),t=[o[0]],r=o[0].area,a=eN(t,r,e),n=1;for(;n<o.length;){let l=r+o[n].area,i=eN([...t,o[n]],l,e);if(i>a)break;t.push(o[n]),r=l,a=i,n+=1}let u=r/e,p=0;for(let e of t){let t=e.area/u;c>=d?l.push({index:e.index,x:i,y:s+p,w:u,h:t}):l.push({index:e.index,x:i+p,y:s,w:t,h:u}),p+=t}c>=d?(i+=u,c-=u):(s+=u,d-=u),o=o.slice(t.length)}}(i.map(e=>({index:e.index,area:e.item.amountUsd*s})),l,0,o,0,a),l+=o+5,{g:t.g,share:r/e,amountUsd:r}});return{rects:a,total:e,groupStats:o}},[t]);return(0,a.jsxs)("div",{className:"mt-6 border-t pt-5",style:{borderColor:"var(--rule)"},children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-baseline justify-between gap-2",children:[(0,a.jsx)("p",{className:"font-mono text-[9.5px] uppercase tracking-[0.22em] text-[color:var(--ink-faint)]",children:"Where the grant return comes from"}),(0,a.jsx)("p",{className:"font-mono text-[9.5px] uppercase tracking-[0.22em] text-[color:var(--ink-ghost)]",children:"Shapley attribution \xb7 est."})]}),(0,a.jsx)("div",{className:"relative mt-3 w-full",style:{height:168},children:o.map((e,r)=>{let n=t[e.index],l=function(e,t){let r=e[t],a="retreat"===r.group?ey:ek;return a[e.slice(0,t).filter(e=>e.group===r.group).length%a.length]}(t,e.index),o=e.w>105&&e.h>46,i=e.w>52&&e.h>26;return(0,a.jsxs)(_.P.button,{type:"button",onClick:()=>(0,J.JU)('Why does "'.concat(n.label,'" carry ').concat(ej(n.share)," (â").concat(ew(n.amountUsd),") of the documented grant return? Explain the Shapley reasoning briefly.")),title:"".concat(n.label," â ").concat(ej(n.share)," \xb7 â").concat(ew(n.amountUsd),". Click and Molly explains why."),className:"absolute flex flex-col items-start justify-end overflow-hidden rounded-[6px] p-1.5 text-left transition-[filter] hover:z-10 hover:brightness-110 focus-visible:z-10 focus-visible:outline focus-visible:outline-2 focus-visible:outline-[color:var(--foil)]",style:{left:"".concat(e.x/680*100,"%"),top:"".concat(e.y/168*100,"%"),width:"".concat(e.w/680*100,"%"),height:"".concat(e.h/168*100,"%"),background:l,color:function(e){let t=parseInt(e.slice(1,3),16);return .299*t+.587*parseInt(e.slice(3,5),16)+.114*parseInt(e.slice(5,7),16)>140?"rgba(20, 20, 19, 0.84)":"rgba(252, 247, 235, 0.94)"}(l),border:"1.5px solid var(--cloth-2)",cursor:"pointer"},initial:{opacity:0,scale:.94},animate:{opacity:1,scale:1},transition:{delay:.08+.045*r,duration:.35,ease:[.25,.1,.25,1]},children:[o&&(0,a.jsx)("span",{className:"line-clamp-2 w-full text-[11px] leading-[1.25]",children:n.label}),i&&(0,a.jsxs)("span",{className:"mt-0.5 font-mono text-[8.5px] tracking-tight opacity-80",children:[ej(n.share)," \xb7 ",ew(n.amountUsd)]})]},n.label)})}),(0,a.jsxs)("div",{className:"mt-2.5 flex flex-wrap items-baseline gap-x-4 gap-y-1 font-mono text-[8.5px] uppercase tracking-[0.14em] text-[color:var(--ink-faint)]",children:[s.map(e=>(0,a.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,a.jsx)("span",{"aria-hidden":!0,className:"h-2 w-2 rounded-[2px]",style:{background:"retreat"===e.g?"#E8B73A":"#5FAF70"}}),"retreat"===e.g?"Retreat chain":"Community outcomes"," ",Math.round(100*e.share),"% \xb7 â",ew(e.amountUsd)]},e.g)),(0,a.jsxs)("span",{className:"ml-auto text-[color:var(--ink-ghost)]",children:["â",ew(i)," catalyzed from ",ew(r)," \xb7 ",l," â click a tile, Molly explains"]})]}),(0,a.jsx)("p",{className:"mt-3 max-w-2xl text-[10.5px] leading-relaxed text-[color:var(--ink-ghost)]",children:"Exact Shapley decomposition over a counterfactual model with outcome-specific causal channels: every documented outcome is causally downstream of the retreat â the 22 works are the thinking pieces the GG24 forum drew on, and the IERR artifact plus the Berlin redesign workshop that followed Iceland pushed the Hypercerts v2 deploy. Execution entries are discounted because documentation is not causation and some work predates the retreat. Shares sum to the documented social return."})]})}function eS(e){let{label:t,children:r}=e;return(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-mono text-[9.5px] uppercase tracking-[0.22em] text-[color:var(--ink-faint)]",children:t}),(0,a.jsx)("p",{className:"mt-1 text-[14px] leading-relaxed text-[color:var(--ink-on-cloth)]",children:r})]})}function eA(e){var t,r,l,o,i;let{cert:s,onClose:c}=e,{agent:d,did:u}=(0,Q.A)(),{data:p,loading:h,addLocalComment:x,addLocalEvidence:f,removeLocal:g}
1=function(e){let[t,r]=(0,n.useState)(q),[a,l]=(0,n.useState)(q),[o,i]=(0,n.useState)(new Set),[s,c]=(0,n.useState)(!0),d=(0,n.useRef)(null),u=(0,n.useCallback)(async()=>{let t=[e.subjectUri,...e.claim?[e.claim.uri]:[]];try{let e=await j(t);r(e),l(t=>({evidence:t.evidence.filter(t=>!e.evidence.some(e=>e.uri===t.uri)),comments:t.comments.filter(t=>!e.comments.some(e=>e.uri===t.uri))}))}finally{c(!1)}},[e.subjectUri,e.claim]);(0,n.useEffect)(()=>(c(!0),u(),()=>{d.current&&clearTimeout(d.current)}),[u]);let p=(0,n.useCallback)(()=>{d.current&&clearTimeout(d.current),d.current=setTimeout(()=>void u(),1e4)},[u]),m=(0,n.useCallback)(e=>{l(t=>({...t,comments:[...t.comments,e]})),p()},[p]),h=(0,n.useCallback)(e=>{l(t=>({...t,evidence:[...t.evidence,e]})),p()},[p]),x=(0,n.useCallback)(e=>{i(t=>new Set(t).add(e)),l(t=>({evidence:t.evidence.filter(t=>t.uri!==e),comments:t.comments.filter(t=>t.uri!==e)}))},[]);return{data:(0,n.useMemo)(()=>{let e=(e,t)=>e.createdAt.localeCompare(t.createdAt);return{evidence:[...t.evidence,...a.evidence].filter(e=>!o.has(e.uri)).sort(e),comments:[...t.comments,...a.comments].filter(e=>!o.has(e.uri)).sort(e)}},[t,a,o]),loading:s,refresh:u,addLocalComment:m,addLocalEvidence:h,removeLocal:x}}(s);(0,n.useEffect)(()=>{let e=document.body.style.overflow;document.body.style.overflow="hidden";let t=e=>"Escape"===e.key&&c();return window.addEventListener("keydown",t),()=>{document.body.style.overflow=e,window.removeEventListener("keydown",t)}},[c]);let v=[...s.evidence.map(e=>({date:e.date,type:"static",entry:e})),...p.evidence.map(e=>({date:e.createdAt.slice(0,10),type:"live",entry:e}))].sort((e,t)=>e.date.localeCompare(t.date));return(0,a.jsx)(_.P.div,{className:"fixed inset-0 z-50 overflow-y-auto",style:{background:"var(--cloth)"},initial:{opacity:0}
1,animate:{opacity:1},exit:{opacity:0},transition:{duration:.25},children:(0,a.jsxs)("div",{className:"mx-auto max-w-5xl px-6 pb-24 pt-6 lg:px-10",children:[(0,a.jsxs)(_.P.div,{initial:{opacity:0},animate:{opacity:1,transition:{delay:.15}},exit:{opacity:0},className:"mb-5 flex flex-wrap items-center justify-between gap-3",children:[(0,a.jsxs)("button",{type:"button",onClick:c,className:"inline-flex items-center gap-2 font-mono text-[10.5px] uppercase tracking-[0.24em] text-[color:var(--ink-dim)] transition hover:text-[color:var(--foil)]",children:[(0,a.jsx)("span",{"aria-hidden":!0,children:"â"})," Back to impact"]}),(0,a.jsx)(es,{returnTo:"/impact/#".concat(s.rkey)})]}),(0,a.jsxs)(_.P.div,{layoutId:"cert-media-".concat(s.rkey),layoutDependency:s.rkey,className:"relative overflow-hidden",style:{borderRadius:26,aspectRatio:"16 / 9"},children:[(0,a.jsx)("img",{src:s.image,alt:s.imageAlt,className:"absolute inset-0 h-full w-full object-cover"}),(0,a.jsx)(Y,{variant:"hero",tint:"linear-gradient(to bottom, transparent 0%, rgba(16,20,12,0.12) 45%, rgba(16,20,12,0.38) 78%, rgba(16,20,12,0.55) 100%)"}),(0,a.jsxs)("div",{className:"absolute inset-x-0 bottom-0 p-6 lg:p-8",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsxs)("span",{className:"inline-flex items-center gap-1.5 rounded-full border border-white/20 bg-black/30 px-2.5 py-1 font-mono text-[8.5px] uppercase tracking-[0.18em] text-white/90 backdrop-blur-md",children:[(0,a.jsx)("span",{"aria-hidden":!0,className:"block h-1.5 w-1.5 rounded-full",style:{background:"#E8B73A"}}),"Hypercert \xb7 ",s.dateLabel]}),"upcoming"===s.status&&(0,a.jsx)("span",{className:"rounded-full border border-white/20 bg-black/30 px-2.5 py-1 font-mono text-[8.5px] uppercase tracking-[0.18em] text-white/80 backdrop-blur-md",children:"In planning"}),s.creator&&(0,a.jsxs)("a",{href:"https://bsky.app/profile/".concat(null!=(r=s.creator.handle)?r:s.creator.did),target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 rounded-full border border-white/20 bg-black/30 py-1 pl-1 pr-2.5 font-mono text-[8.5px] uppercase tracking-[0.18em] text-white/90 backdrop-blur-md transition hover:border-white/50",children:[s.creator.avatar?(0,a.jsx)("img",{src:s.creator.avatar,alt:"",className:"h-4 w-4 rounded-full object-cover ring-1 ring-white/40"}):(0,a.jsx)("span",{"aria-hidden":!0,className:"block h-4 w-4 rounded-full bg-white/30"}),"Claimed by ",null!=(l=s.creator.handle)?l:"".concat(s.creator.did.slice(0,16),"â¦")]})]}),(0,a.jsx)("h1",{className:"mt-3 max-w-2xl font-serif text-[clamp(24px,3.4vw,40px)] leading-[1.06] tracking-tight text-white",children:s.title}),(0,a.jsx)("p",{className:"mt-1.5 font-mono text-[10px] uppercase tracking-[0.2em] text-white/70",children:s.location})]})]}),(0,a.jsxs)(_.P.div,{custom:0,variants:ef,initial:"hidden",animate:"show",className:"mt-8 grid grid-cols-1 gap-8 lg:grid-cols-[1.15fr_0.85fr]",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-[15.5px] leading-relaxed text-[color:var(--ink-dim)]",children:s.description}),(0,a.jsx)("div",{className:"mt-6 flex flex-wrap gap-2",children:[...s.workScope,...s.impactScope].map(e=>(0,a.jsx)("span",{className:"px-2.5 py-1 font-mono text-[10px] uppercase tracking-[0.14em] text-[color:var(--foil)]",style:{border:"1px solid var(--rule-strong)"},children:e},e))})]}),(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-5 border-t pt-6 lg:border-l lg:border-t-0 lg:pl-8 lg:pt-0",style:{borderColor:"var(--rule)"},children:[(0,a.jsx)(eS,{label:"Record",children:(0,a.jsx)("span",{className:"break-all font-mono text-[11px]",children:s.collection})}),(0,a.jsx)(eS,{label:"Timeframe",children:(0,a.jsxs)("span",{className:"font-mono text-[12px]",children:[s.startDate," â ",s.endDate]})}),(0,a.jsx)(eS,{label:"Claimed by",children:s.creator?(0,a.jsxs)("a",{href:"https://bsky.app/profile/".concat(null!=(o=s.creator.handle)?o:s.creator.did),target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 text-[color:var(--foil)] hover:underline",children:[s.creator.avatar&&(0,a.jsx)("img",{src:s.creator.avatar,alt:"",className:"h-4 w-4 roun
1ded-full object-cover"}),"@",null!=(i=s.creator.handle)?i:s.creator.did.slice(0,16)]}):(0,a.jsx)("span",{className:"text-[color:var(--ink-dim)]",children:"plrd.org"})}),(0,a.jsx)(eS,{label:"Rights",children:s.rights}),(0,a.jsx)(eS,{label:"Retreat",children:(0,a.jsx)("a",{href:s.href,className:"text-[color:var(--foil)] hover:underline",children:"See event â"})}),(0,a.jsx)("div",{className:"col-span-2",children:(0,a.jsx)(eS,{label:"Contributors",children:(0,a.jsx)("span",{className:"text-[color:var(--ink-dim)]",children:s.contributors.map(e=>e.name).join(" \xb7 ")})})})]})]}),s.funding&&(0,a.jsxs)(_.P.div,{custom:1,variants:ef,initial:"hidden",animate:"show",className:"mt-10 rounded-2xl border p-6 lg:p-8",style:{borderColor:"var(--rule-strong)",background:"var(--cloth-2)"},children:[(0,a.jsx)("p",{className:"font-mono text-[9.5px] uppercase tracking-[0.22em] text-[color:var(--foil)]",children:"Return on investment"}),(0,a.jsxs)("div",{className:"mt-4 flex flex-wrap items-end gap-x-10 gap-y-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-serif text-[clamp(34px,4.5vw,52px)] leading-none tracking-tight text-[color:var(--ink-on-cloth)]",children:s.funding.roiLabel}),(0,a.jsx)("p",{className:"mt-1.5 font-mono text-[9.5px] uppercase tracking-[0.2em] text-[color:var(--ink-faint)]",children:"Grant RoI \xb7 documented"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-serif text-[clamp(34px,4.5vw,52px)] leading-none tracking-tight text-[color:var(--ink-on-cloth)]",children:s.funding.costLabel}),(0,a.jsx)("p",{className:"mt-1.5 font-mono text-[9.5px] uppercase tracking-[0.2em] text-[color:var(--ink-faint)]",children:"USD invested"})]}),(()=>{let e=(0,V.N2)(s.rkey);return e?(0,a.jsxs)("button",{type:"button",onClick:()=>(0,J.JU)("Give me the Fermi estimate of the social return of ".concat(s.title,".")),className:"group/soc text-left",title:"Independent Fermi estimate of social value created â click and Molly draws the chart",children:[(0,a.jsxs)("p",{className:"font-serif text-[clamp(34px,4.5vw,52px)] leading-none tracking-tight text-[color:var(--ink-on-cloth)] transition group-hover/soc:text-[color:var(--foil)]",children:["â",ew(e.total.base)]}),(0,a.jsx)("p",{className:"mt-1.5 font-mono text-[9.5px] uppercase tracking-[0.2em] text-[color:var(--ink-faint)] transition group-hover/soc:text-[color:var(--foil)]",children:"Social return \xb7 est.ââ ask Molly"})]}):null})(),(0,a.jsx)("p",{className:"max-w-md flex-1 basis-64 text-[13.5px] leading-relaxed text-[color:var(--ink-dim)]",children:s.funding.roiNote})]}),s.funding.attribution&&(0,a.jsx)(eC,{items:s.funding.attribution,costUsd:s.funding.costUsd,roiLabel:s.funding.roiLabel})]}),(0,a.jsxs)(_.P.div,{custom:2,variants:ef,initial:"hidden",animate:"show",className:"mt-14",children:[(0,a.jsxs)("div",{className:"mb-6 flex items-baseline justify-between gap-3",children:[(0,a.jsxs)("h2",{className:"font-serif text-[clamp(20px,2.4vw,30px)] leading-tight tracking-tight text-[color:var(--ink-on-cloth)]",children:["Evidence"," ",(0,a.jsx)("span",{className:"text-[color:var(--foil)]",style:{fontFamily:"var(--font-italic)",fontStyle:"italic"},children:"timeline"})]}),(0,a.jsxs)("span",{className:"font-mono text-[9.5px] uppercase tracking-[0.2em] text-[color:var(--ink-faint)]",children:[v.length," entries",h?" \xb7 syncingâ¦":""]})]}),(0,a.jsx)("div",{className:"flex flex-col",children:v.map((e,t)=>{var r,n;return"static"===e.type?(0,a.jsx)(eg,{entry:e.entry,index:t},"s-".concat(e.entry.date,"-").concat(e.entry.title)):(0,a.jsx)(eb,{entry:e.entry,influence:(r=e.entry.title,null==(n=s.liveInfluence)?void 0:n.find(e=>r.toLowerCase().includes(e.match.toLowerCase()))),onDelete:d&&u===e.entry.did?()=>void m(d,e.entry.uri).then(()=>g(e.entry.uri)):void 0},e.entry.uri)})}),(0,a.jsxs)("p",{className:"mt-6 max-w-2xl text-[12px] leading-relaxed text-[color:var(--ink-ghost)]",children:["The"," ",(0,a.jsx)("code",{className:"font-mono text-[0.9em]",children:"org.hypercerts.claim.activity"})," ","record for this retreat is"," ",s.claim?(0,a.jsx)("a",{href:"https://pdsls.dev/".concat(s.claim.uri),target:"_blank",rel:"noopener noreferrer",className:"text-[color:var(--foil)] hover:underline",children:"published on the ATProto network â"}):(0,a.jsx)(a.Fragment,{children:"not yet published to the network"}),(null==(t=s.creator)?void 0:t.handle)?" by @".concat(s.creator.handle):""," â the claim fields above are read straight from that record, the same source plrd.org renders. Curated entries come from this site. Entries labeled"," ",(0,a.jsx)("span",{className:"font-mono text-[0.9em] uppercase tracking-wide text-[color:var(--foil)]",children:"community"})," ","are real"," ",(0,a.jsx)("code",{className:"font-mono text-[0.9em]",children:"org.hypercerts.context.attachment"})," ","records that live on their authors' own PDSs. We find them through the Constellation backlink index."]}),(0,a.jsx)("div",{className:"mt-4",children:(0,a.jsx)(ed,{cert:s,onCreated:f})})]}),(0,a.jsx)(_.P.div,{custom:3,variants:ef,initial:"hidden",animate:"show",className:"mt-14 border-t pt-10",style:{borderColor:"var(--rule)"},children:(0,a.jsx)(eu,{cert:s,activity:p,loading:h,onPosted:x,onDeleted:g})})]})})}
1let eP=[{x:0,rot:0,z:0,scale:1,opacity:1},{x:62,rot:25,z:-160,scale:.85,opacity:.65},{x:112,rot:35,z:-260,scale:.7,opacity:.35},{x:150,rot:40,z:-340,scale:.6,opacity:0}];function eE(){var e;let[t,r]=(0,n.useState)(0),[i,s]=(0,n.useState)(null),c=(0,n.useRef)(null),[d,u]=(0,n.useState)(280),p=(0,n.useRef)(null),m=(0,n.useRef)(!1),[h,x]=(0,n.useState)(0),[f,g]=(0,n.useState)(!1),[v,b]=(0,n.useState)(o.K);(0,n.useEffect)(()=>{let e=!1;return E(o.K).then(t=>{e||b(t)}),()=>{e=!0}},[]);let y=null!=(e=v.find(e=>e.rkey===i))?e:null;(0,n.useEffect)(()=>{let e=window.location.hash.slice(1);if(!e)return;let t=o.K.findIndex(t=>t.rkey===e);t>=0&&(r(t),s(e))},[]),(0,n.useEffect)(()=>{let e=c.current;if(!e)return;let t=()=>{let t=e.clientWidth;t<=0||u(Math.max(210,Math.min(280,Math.floor((t-(window.innerWidth>=640?88:16))/1.7))))};t();let r=new ResizeObserver(t);return r.observe(e),window.addEventListener("resize",t),()=>{r.disconnect(),window.removeEventListener("resize",t)}},[]);let k=Math.round(1.6*d)+24,w=Math.min(Math.max(t,0),v.length-1),j=.62*d,N=f?-h/j:0;{let e=v.length-1,t=w+N;t<0?t*=.25:t>e&&(t=e+(t-e)*.25),N=t-w}let C=e=>{r(Math.max(0,Math.min(v.length-1,e)))},S=e=>{let t=p.current;if(!t||t.pointerId!==e.pointerId||(p.current=null,!t.dragging))return;let r=-(e.clientX-t.startX)/j,a=Math.round(r);0===a&&Math.abs(r)>.15&&(a=Math.sign(r)),C(w+a),g(!1),x(0),setTimeout(()=>m.current=!1,0)},A="absolute top-1/2 -translate-y-1/2 z-10 hidden sm:grid h-11 w-11 shrink-0 cursor-pointer place-items-center rounded-full border font-mono text-[15px] text-[color:var(--ink-dim)] transition hover:border-[color:var(--foil)] hover:text-[color:var(--foil)] disabled:cursor-not-allowed disabled:opacity-30";return(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("div",{ref:c,children:(0,a.jsxs)("div",{className:"relative w-full touch-pan-y overflow-hidden outline-none ".concat(f?"cursor-grabbing":"cursor-grab"),style:{perspective:"1300px",height:k},tabIndex:0,onKeyDown:e=>{"ArrowLeft"===e.key?C(w-1):"ArrowRight"===e.key&&C(w+1)},onPointerDown:e=>{("mouse"!==e.pointerType||0===e.button)&&(p.current={pointerId:e.pointerId,startX:e.clientX,dragging:!1})},onPointerMove:e=>{let t=p.current;if(!t||t.pointerId!==e.pointerId)return;let r=e.clientX-t.startX;if(!t.dragging){if(6>Math.abs(r))return;t.dragging=!0,m.current=!0,g(!0);try{e.currentTarget.setPointerCapture(e.pointerId)}catch(e){}}x(r)},onPointerUp:S,onPointerCancel:S,onClickCapture:e=>{m.current&&(e.preventDefault(),e.stopPropagation(),m.current=!1)},"aria-label":"Hypercert carousel â drag or use the arrows / dots to navigate",children:[(0,a.jsx)("button",{type:"button",onClick:()=>C(w-1),disabled:w<=0,"aria-label":"Previous hypercert",className:"".concat(A," left-0 ml-1"),style:{borderColor:"var(--rule-strong)",background:"var(--cloth)"},children:"â"}),(0,a.jsx)("button",{type:"button",onClick:()=>C(w+1),disabled:w>=v.length-1,"aria-label":"Next hypercert",className:"".concat(A," right-0 mr-1"),style:{borderColor:"var(--rule-strong)",background:"var(--cloth)"},children:"â"}),(0,a.jsx)("div",{className:"relative h-full w-full",style:{transformStyle:"preserve-3d"},children:v.map((e,t)=>{let r=t-w,n=function(e){var t,r,a,n,l;let o=Math.abs(e);if(o>=3)return{translateX:"0%",rotateY:0,translateZ:0,scale:1,opacity:0,zIndex:0,hidden:!0};let i=e<0?-1:1,s=Math.min(Math.floor(o),eP.length-2),c=o-s,d=eP[s],u=eP[s+1];return{translateX:"".concat(i*(t=d.x,t+(u.x-t)*c),"%"),rotateY:-i*(r=d.rot,r+(u.rot-r)*c),translateZ:(a=d.z,a+(u.z-a)*c),scale:(n=d.scale,n+(u.scale-n)*c),opacity:(l=d.opacity,l+(u.opacity-l)*c),zIndex:5-Math.round(o),hidden:!1}}(r-N);return(0,a.jsx)("div",{className:"absolute left-1/2 top-1/2 ".concat(f?"":"transition-all duration-500 ease-out"),style:{width:d,transform:"translateX(-50%) translateY(-50%) translateX(".concat(n.translateX,") rotateY(").concat(n.rotateY,"deg) translateZ(").concat(n.translateZ,"px) scale(").concat(n.scale,")"),opacity:n.opacity,zIndex:n.zIndex,pointerEvents:0===r?"auto":"none",display:n.hidden?"none":"block"},children:(0,a.jsx)(H,{cert:e,isActive:0===r,frozen:f,width:d,layoutDependency:"".concat(w,"|").concat(null!=i?i:""),onSelect:()=>s(e.rkey)})},e.rkey)})})]})}),(0,a.jsx)("div",{className:"mt-8 flex items-center justify-center gap-2.5",children:v.map((e,t)=>(0,a.jsx)("button",{type:"button",onClick:()=>C(t),"aria-label":"Go to ".concat(e.title),className:"relative h-1.5 rounded-full transition-all",style:{width:t===w?26:8,background:t===w?"var(--foil)":"var(--rule-strong)"}
1,children:(0,a.jsx)("span",{"aria-hidden":!0,className:"absolute inset-0 -mx-1 -my-3"})},e.rkey))}),(0,a.jsx)("p",{className:"mt-5 text-center font-mono text-[10px] uppercase tracking-[0.24em] text-[color:var(--ink-ghost)]",children:"Drag to browse past & upcoming editions \xb7 click a card to open its impact claim"}),(0,a.jsx)(l.N,{children:y&&(0,a.jsx)(eA,{cert:y,onClose:()=>s(null)},y.rkey)})]})}},82237:(e,t,r)=>{Promise.resolve().then(r.t.bind(r,52619,23)),Promise.resolve().then(r.bind(r,66316)),Promise.resolve().then(r.bind(r,21364))}},e=>{e.O(0,[887,714,942,315,311,364,108,481,441,255,358],()=>e(e.s=82237)),_N_E=e.O()}]);
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.