1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,533372,e=>{"use strict";var t=e.i(843476),a=e.i(682451);e.i(271645);var s=e.i(424848),r=e.i(143798),i=e.i(789549),n=e.i(314037),o=e.i(644662),l=e.i(257942),d=e.i(442948),c=e.i(298193),u=e.i(825436),h=e.i(321879),p={root:"m_77c9d27d",inner:"m_80f1301b",label:"m_811560b9",section:"m_a74036a",loader:"m_a25b86ee",group:"m_80d6d844",groupSection:"m_70be2a01"};let m={orientation:"horizontal"},f=(0,r.createVarsResolver)((e,{borderWidth:t})=>({group:{"--button-border-width":(0,a.rem)(t)}})),x=(0,h.factory)((e,a)=>{let s=(0,i.useProps)("ButtonGroup",m,e),{className:r,style:l,classNames:d,styles:c,unstyled:u,orientation:h,vars:x,borderWidth:g,variant:y,mod:b,...v}=(0,i.useProps)("ButtonGroup",m,e),w=(0,n.useStyles)({name:"ButtonGroup",props:s,classes:p,className:r,style:l,classNames:d,styles:c,unstyled:u,vars:x,varsResolver:f,rootSelector:"group"});return(0,t.jsx)(o.Box,{...w("group"),ref:a,variant:y,mod:[{"data-orientation":h},b],role:"group",...v})});x.classes=p,x.displayName="@mantine/core/ButtonGroup";let g={},y=(0,r.createVarsResolver)((e,{radius:t,color:a,gradient:r,variant:i,autoContrast:n,size:o})=>{let l=e.variantColorResolver({color:a||e.primaryColor,theme:e,gradient:r,variant:i||"filled",autoContrast:n});return{groupSection:{"--section-height":(0,s.getSize)(o,"section-height"),"--section-padding-x":(0,s.getSize)(o,"section-padding-x"),"--section-fz":o?.includes("compact")?(0,s.getFontSize)(o.replace("compact-","")):(0,s.getFontSize)(o),"--section-radius":void 0===t?void 0:(0,s.getRadius)(t),"--section-bg":a||i?l.background:void 0,"--section-color":l.color,"--section-bd":a||i?l.border:void 0}}}),b=(0,h.factory)((e,a)=>{let s=(0,i.useProps)("ButtonGroupSection",g,e),{className:r,style:l,classNames:d,styles:c,unstyled:u,vars:h,variant:m,gradient:f,radius:x,autoContrast:b,...v}=(0,i.useProps)("ButtonGroupSection",g,e),w=(0,n.useStyles)({name:"ButtonGroupSection",props:s,classes:p,className:r,style:l,classNames:d,styles:c,unstyled:u,vars:h,varsResolver:y,rootSelector:"groupSection"});return(0,t.jsx)(o.Box,{...w("groupSection"),ref:a,variant:m,...v})});b.classes=p,b.displayName="@mantine/core/ButtonGroupSection";let v={in:{opacity:1,transform:`translate(-50%, calc(-50% + ${(0,a.rem)(1)}))`},out:{opacity:0,transform:"translate(-50%, -200%)"},common:{transformOrigin:"center"},transitionProperty:"transform, opacity"},w={},j=(0,r.createVarsResolver)((e,{radius:t,color:a,gradient:r,variant:i,size:n,justify:o,autoContrast:l})=>{let d=e.variantColorResolver({color:a||e.primaryColor,theme:e,gradient:r,variant:i||"filled",autoContrast:l});return{root:{"--button-justify":o,"--button-height":(0,s.getSize)(n,"button-height"),"--button-padding-x":(0,s.getSize)(n,"button-padding-x"),"--button-fz":n?.includes("compact")?(0,s.getFontSize)(n.replace("compact-","")):(0,s.getFontSize)(n),"--button-radius":void 0===t?void 0:(0,s.getRadius)(t),"--button-bg":a||i?d.background:void 0,"--button-hover":a||i?d.hover:void 0,"--button-color":d.color,"--button-bd":a||i?d.border:void 0,"--button-hover-color":a||i?d.hoverColor:void 0}}}),k=(0,l.polymorphicFactory)((e,a)=>{let s=(0,i.useProps)("Button",w,e),{style:r,vars:l,className:h,color:m,disabled:f,children:x,leftSection:g,rightSection:y,fullWidth:b,variant:k,radius:S,loading:N,loaderProps:C,gradient:A,classNames:I,styles:E,unstyled:M,"data-disabled":R,autoContrast:P,mod:_,...D}=s,T=(0,n.useStyles)({name:"Button",props:s,classes:p,className:h,style:r,classNames:I,styles:E,unstyled:M,vars:l,varsResolver:j}),O=!!g,F=!!y;return(0,t.jsxs)(u.UnstyledButton,{ref:a,...T("root",{active:!f&&!N&&!R}),unstyled:M,variant:k,disabled:f||N,mod:[{disabled:f||R,loading:N,block:b,"with-left-section":O,"with-right-section":F},_],...D,children:[(0,t.jsx)(c.Transition,{mounted:!!N,transition:v,duration:150,children:e=>(0,t.jsx)(o.Box,{component:"span",...T("loader",{style:e}),"aria-hidden":!0,children:(0,t.jsx)(d.Loader,{color:"var(--button-color)",size:"calc(var(--button-height) / 1.8)",...C})})}),(0,t.jsxs)("span",{...T("inner"),children:[g&&(0,t.jsx)(o.Box,{component:"span",...T("section"),mod:{position:"left"},children:g}),(0,t.jsx)(o.Box,{component:"span",mod:{loading:N},...T("label"),children:x}),y&&(0,t.jsx)(o.Box,{component:"span",...T("section"),mod:{position:"right"},children:y})]})]})});k.classes=p,k.displayName="@mantine/core/Button",k.Group=x,k.GroupSection=b,e.s(["Button",0,k],533372)},183444,e=>{"use strict";let t=(0,e.i(33550).default)("outline","share","Share",[["path",{d:"M3 12a3 3 0 1 0 6 0a3 3 0 1 0 -6 0",key:"svg-0"}],["path",{d:"M15 6a3 3 0 1 0 6 0a3 3 0 1 0 -6 0",key:"svg-1"}],["path",{d:"M15 18a3 3 0 1 0 6 0a3 3 0 1 0 -6 0",key:"svg-2"}],["path",{d:"M8.7 10.7l6.6 -3.4",key:"svg-3"}],["path",{d:"M8.7 13.3l6.6 3.4",key:"svg-4"}]]);e.s(["IconShare",0,t],183444)},422510,e=>{"use strict";let t=(0,e.i(33550).default)("outline","history","History",[["path",{d:"M12 8l0 4l2 2",key:"svg-0"}],["path",{d:"M3.05 11a9 9 0 1 1 .5 4m-.5 5v-5h5",key:"svg-1"}]]);e.s(["IconHistory",0,t],422510)},617708,e=>{"use strict";let t=(0,e.i(33550).default)("outline","plus","Plus",[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M5 12l14 0",key:"svg-1"}]]);e.s(["IconPlus",0,t],617708)},217923,e=>{"use strict";let t=(0,e.i(475254).default)("chart-column",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);e.s(["BarChart3",0,t],217923)},248939,292270,e=>{"use strict";var t=e.i(475254);
1let a=(0,t.default)("clipboard",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}]]);e.s(["Clipboard",0,a],248939);let s=(0,t.default)("log-out",[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]]);e.s(["LogOut",0,s],292270)},73526,e=>{"use strict";let t=(0,e.i(475254).default)("map",[["path",{d:"M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z",key:"169xi5"}],["path",{d:"M15 5.764v15",key:"1pn4in"}],["path",{d:"M9 3.236v15",key:"1uimfh"}]]);e.s(["Map",0,t],73526)},78094,e=>{"use strict";let t=(0,e.i(475254).default)("network",[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]]);e.s(["Network",0,t],78094)},514764,54089,e=>{"use strict";let t=(0,e.i(475254).default)("send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);e.s(["default",0,t],54089),e.s(["Send",0,t],514764)},464837,e=>{"use strict";let t=(0,e.i(475254).default)("file-user",[["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M15 18a3 3 0 1 0-6 0",key:"16awa0"}],["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",key:"1mlx9k"}],["circle",{cx:"12",cy:"13",r:"2",key:"1c1ljs"}]]);e.s(["FileUser",0,t],464837)},39172,e=>{"use strict";let t=(0,e.i(475254).default)("user-search",[["circle",{cx:"10",cy:"7",r:"4",key:"e45bow"}],["path",{d:"M10.3 15H7a4 4 0 0 0-4 4v2",key:"3bnktk"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["path",{d:"m21 21-1.9-1.9",key:"1g2n9r"}]]);e.s(["UserSearch",0,t],39172)},836159,(e,t,a)=>{"use strict";function s(){return null}Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"default",{enumerable:!0,get:function(){return s}}),("function"==typeof a.default||"object"==typeof a.default&&null!==a.default)&&void 0===a.default.__esModule&&(Object.defineProperty(a.default,"__esModule",{value:!0}),Object.assign(a.default,a),t.exports=a.default)},524689,348239,e=>{"use strict";var t=e.i(33550);let a=(0,t.default)("outline","printer","Printer",[["path",{d:"M17 17h2a2 2 0 0 0 2 -2v-4a2 2 0 0 0 -2 -2h-14a2 2 0 0 0 -2 2v4a2 2 0 0 0 2 2h2",key:"svg-0"}],["path",{d:"M17 9v-4a2 2 0 0 0 -2 -2h-6a2 2 0 0 0 -2 2v4",key:"svg-1"}],["path",{d:"M7 15a2 2 0 0 1 2 -2h6a2 2 0 0 1 2 2v4a2 2 0 0 1 -2 2h-6a2 2 0 0 1 -2 -2l0 -4",key:"svg-2"}]]);e.s(["IconPrinter",0,a],524689);let s=(0,t.default)("outline","dots-vertical","DotsVertical",[["path",{d:"M11 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-0"}],["path",{d:"M11 19a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-1"}],["path",{d:"M11 5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-2"}]]);e.s(["IconDotsVertical",0,s],348239)},144492,e=>{"use strict";let t=(0,e.i(33550).default)("outline","download","Download",[["path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2",key:"svg-0"}],["path",{d:"M7 11l5 5l5 -5",key:"svg-1"}],["path",{d:"M12 4l0 12",key:"svg-2"}]]);e.s(["IconDownload",0,t],144492)},448992,284765,e=>{"use strict";let t=(0,e.i(33550).default)("outline","file-export","FileExport",[["path",{d:"M14 3v4a1 1 0 0 0 1 1h4",key:"svg-0"}],["path",{d:"M11.5 21h-4.5a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v5m-5 6h7m-3 -3l3 3l-3 3",key:"svg-1"}]]);e.s(["IconFileExport",0,t],448992);let a=(0,e.i(475254).default)("settings-2",[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]);e.s(["Settings2",0,a],284765)},118502,e=>{"use strict";e.s(["RESPONSIVE_ICON_BUTTON",0,"!h-11 !w-11 !min-w-11 !px-0 md:!h-[30px] md:!w-auto md:!min-w-0"])},553400,e=>{"use strict";let t=["brief","full","custom"];e.s(["DOSSIER_EXPORT_SETTLED",0,"dossier-export-settled","PRODUCE_REPORT_EVENT",0,"report-produce-preset","produceGate",0,(e,a)=>t.includes(e?.preset)&&Array.isArray(e?.sections)?a?"busy":"run":"ignore"])},809586,e=>{"use strict";var t=e.i(843476),a=e.i(533372),s=e.i(442948),r=e.i(184086),i=e.i(448992),n=e.i(440160),o=e.i(178583),l=e.i(158524),d=e.i(284765),c=e.i(271645),u=e.i(519455),h=e.i(257428),p=e.i(776639),m=e.i(755146),f=e.i(908406),x=e.i(975157),g=e.i(118502),y=e.i(553400),b=e.i(618209);
1let v=[{preset:"brief",label:"Executive brief",blurb:"For leadership. PDF only."},{preset:"full",label:"Full dossier",blurb:"PDF + every CSV, zipped."}];e.s(["default",0,function({onProduce:e,onShare:w,disabled:j,busy:k}){let[S,N]=c.default.useState(!1),[C,A]=c.default.useState(()=>new Set((0,b.presetSections)("full"))),[I,E]=c.default.useState(!1),M=I||!!k;c.default.useEffect(()=>{let e=()=>E(!1);return window.addEventListener(y.DOSSIER_EXPORT_SETTLED,e),()=>window.removeEventListener(y.DOSSIER_EXPORT_SETTLED,e)},[]),c.default.useEffect(()=>{if(!I)return;let e=setTimeout(()=>E(!1),12e4);return()=>clearTimeout(e)},[I]);let R=c.default.useRef(!1);c.default.useEffect(()=>{R.current&&!k&&E(!1),R.current=!!k},[k]);let P=t=>{!1!==e(t)&&(E(!0),(0,f.toast)({title:"Preparing your export",description:"brief"===t.preset?"A few seconds â your download starts automatically.":"This can take up to a minute for a full dossier â your download starts automatically."}))};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(m.DropdownMenu,{children:[(0,t.jsx)(r.Tooltip,{label:"Export",withArrow:!0,zIndex:500,children:(0,t.jsx)(m.DropdownMenuTrigger,{asChild:!0,children:(0,t.jsx)(a.Button,{variant:"outline",size:"xs",color:"primary",className:(0,x.cn)(g.RESPONSIVE_ICON_BUTTON,"md:!px-1.5"),"aria-label":"Export",disabled:j||M,children:M?(0,t.jsx)(s.Loader,{size:14}):(0,t.jsx)(i.IconFileExport,{size:14})})})}),(0,t.jsxs)(m.DropdownMenuContent,{align:"end",className:"z-[600] w-56",children:[v.map(e=>(0,t.jsxs)(m.DropdownMenuItem,{disabled:M,onSelect:()=>P({sections:(0,b.presetSections)(e.preset),preset:e.preset}),children:["brief"===e.preset?(0,t.jsx)(o.FileText,{className:"mr-2 h-4 w-4 shrink-0",strokeWidth:1.5}):(0,t.jsx)(n.Download,{className:"mr-2 h-4 w-4 shrink-0",strokeWidth:1.5}),(0,t.jsxs)("span",{className:"flex flex-col",children:[e.label,(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:e.blurb})]})]},e.preset)),(0,t.jsxs)(m.DropdownMenuItem,{disabled:M,onSelect:()=>{setTimeout(()=>N(!0),0)},children:[(0,t.jsx)(d.Settings2,{className:"mr-2 h-4 w-4 shrink-0",strokeWidth:1.5}),"Customâ¦"]}),(0,t.jsx)(m.DropdownMenuSeparator,{}),(0,t.jsxs)(m.DropdownMenuItem,{onSelect:w,children:[(0,t.jsx)(l.Link2,{className:"mr-2 h-4 w-4 shrink-0",strokeWidth:1.5}),"Share link"]})]})]}),(0,t.jsx)(p.Dialog,{open:S,onOpenChange:N,children:(0,t.jsxs)(p.DialogContent,{className:"z-[600] max-w-md",children:[(0,t.jsxs)(p.DialogHeader,{children:[(0,t.jsx)(p.DialogTitle,{children:"Choose sections"}),(0,t.jsx)(p.DialogDescription,{children:"The cover and methodology are always included. Downloads as a PDF with every table beside it."})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsxs)("label",{className:"flex items-center gap-2 text-sm text-gray-400",children:[(0,t.jsx)(h.Checkbox,{checked:!0,disabled:!0,"aria-label":"Cover"}),"Cover",(0,t.jsx)("span",{className:"text-xs text-gray-400",children:"(always)"})]}),b.DOSSIER_SECTIONS.map(e=>(0,t.jsxs)("label",{className:"flex items-center gap-2 text-sm",children:[(0,t.jsx)(h.Checkbox,{checked:C.has(e.id),onCheckedChange:()=>{let t;return t=e.id,A(e=>{let a=new Set(e);return a.has(t)?a.delete(t):a.add(t),a})},"aria-label":e.title}),e.title]},e.id)),(0,t.jsxs)("label",{className:"flex items-center gap-2 text-sm text-gray-400",children:[(0,t.jsx)(h.Checkbox,{checked:!0,disabled:!0,"aria-label":"Methodology"}),"Methodology",(0,t.jsx)("span",{className:"text-xs text-gray-400",children:"(always)"})]})]}),(0,t.jsxs)(p.DialogFooter,{children:[(0,t.jsx)(u.Button,{variant:"outline",onClick:()=>N(!1),children:"Cancel"}),(0,t.jsx)(u.Button,{disabled:0===C.size||M,onClick:()=>{N(!1),P({sections:b.DOSSIER_SECTIONS.filter(e=>C.has(e.id)).map(e=>e.id),preset:"custom"})},children:"Download"})]})]})})]})}])},568586,e=>{"use strict";var t=e.i(843476),a=e.i(271645);let s=a.default.createContext(null);function r(){return a.default.useContext(s)??{items:[],activeId:void 0,scrollTo:()=>{},publish:()=>{}}}e.s(["ReportContentsProvider",0,function({children:e}){let[r,i]=a.default.useState([]),[n,o]=a.default.useState(void 0);a.default.useEffect(()=>{o(r[0]?.id);let e=r.map(e=>document.getElementById(e.id)).filter(e=>null!=e);if(0===e.length)return;let t=new IntersectionObserver(e=>
1e.forEach(e=>{e.isIntersecting&&o(e.target.id)}),{rootMargin:"-15% 0px -70% 0px"});return e.forEach(e=>t.observe(e)),()=>t.disconnect()},[r]);let l=a.default.useMemo(()=>({items:r,activeId:n,scrollTo:e=>{let t=t=>()=>document.getElementById(e)?.scrollIntoView({behavior:t,block:"start"});t("smooth")(),setTimeout(t("smooth"),700),setTimeout(t("auto"),2e3),setTimeout(t("auto"),3600)},publish:i}),[r,n]);return(0,t.jsx)(s.Provider,{value:l,children:e})},"usePublishReportContents",0,function(e){let{publish:t}=r(),s=JSON.stringify(e),i=a.default.useRef(e);i.current=e,a.default.useEffect(()=>(t(i.current),()=>t([])),[s])},"useReportContents",0,r])},25773,e=>{"use strict";var t=e.i(380176);let a=e=>null!=e&&""!==e&&(e instanceof Date||(Array.isArray(e)?0!==e.length&&e.some(e=>a(e)):"object"!=typeof e||Object.values(e).some(a))),s=e=>{if(e instanceof Date)return e.toISOString();if(Array.isArray(e)){let t=e.map(e=>e instanceof Date?e.toISOString():e);return t.length>0&&t.every(e=>e&&"object"==typeof e&&"id"in e)?t.map(e=>e.id).sort():t.every(e=>"string"==typeof e)?[...t].sort():t.every(e=>"number"==typeof e)?[...t].sort((e,t)=>e-t):t.map(s)}return e&&"object"==typeof e?Object.fromEntries(Object.keys(e).sort().map(t=>[t,s(e[t])])):e};e.s(["canonicalizeFilters",0,e=>{if(!e)return"{}";let r={};return Object.keys(e).sort().forEach(i=>{let n=e[i];if(!a(n))return;let o=s(n),l=t.defaultFilterOptions[i];(void 0===l||JSON.stringify(o)!==JSON.stringify(s(l)))&&(r[i]=o)}),JSON.stringify(r)},"isMeaningfulFilterValue",0,a])},772018,e=>{"use strict";var t=e.i(25773);let a=["company","officer","office"],s=[{key:"companies",kind:"company"},{key:"officers",kind:"officer"},{key:"offices",kind:"office"},{key:"violation_codes",kind:"violationCode"}],r=[{key:"officers",label:"people"},{key:"violation_codes",label:"citation codes"},{key:"company_location",label:"company location"},{key:"office_location",label:"office location"},{key:"inspection_id",label:"inspection ID"}];e.s(["PROFILE_REQUIRED_NOTE",0,"This analysis needs a profile. Add a company, person or office to the search.","filterKeyFor",0,e=>s.find(t=>t.kind===e).key,"isSingular",0,(e,t)=>"singular"===e.shape&&e.anchors[0]?.kind===t,"resolveSubject",0,e=>{let i,n=s.flatMap(({key:t,kind:a})=>{let s=e[t];return Array.isArray(s)?s.filter(e=>e?.id!=null).map(e=>({kind:a,id:String(e.id),name:e.name?.trim()||"Unnamed"})):[]}),o=s.map(({kind:e})=>e).filter(e=>n.some(t=>t.kind===e)),l=(0,t.canonicalizeFilters)(e),d=!n.some(e=>a.includes(e.kind));return{shape:0===n.length?"population":1===n.length?"singular":1===o.length?"cohort":"intersection",anchors:n,anchorKinds:o,filters:e,signature:l,reach:{fdaOnly:(i=r.filter(({key:a})=>(0,t.isMeaningfulFilterValue)(e[a])).map(({label:e})=>e)).length>0,restrictedBy:i},requiresProfile:d,isEmpty:"{}"===l}}])},838637,e=>{"use strict";var t=e.i(772018);let a=[{id:"summary",title:"Summary",tools:()=>"AI-generated, grounded in the records below"},{id:"activity",title:"Activity record",tools:()=>"the enforcement ladder, then volume across every record type"},{id:"predictive",title:"Predictive",tools:e=>(0,t.isSingular)(e,"officer")?"the companies this investigator inspects, scored":(0,t.isSingular)(e,"company")?"this company and its facilities, scored":"the companies in this search, scored"},{id:"statistics",title:"Statistics",tools:()=>"where the matched records concentrate"},{id:"metadata",title:"Metadata",tools:()=>"observations, records and guidances, as source rows"},{id:"map",title:"Facility map",railLabel:"Map",tools:()=>"every matched facility on the map, listed beside it"},{id:"graph",title:"Knowledge graph",tools:()=>"the entities in scope and what connects them"},{id:"produce",title:"Export",tools:()=>"assemble the sections above into a document you can send"}],s=`s${String(a.length).padStart(2,"0")}`,r=`s${String(a.findIndex(e=>"predictive"===e.id)+1).padStart(2,"0")}`;e.s(["EXPORT_SECTION_HASH",0,s,"PREDICTIVE_SECTION_HASH",0,r,"sectionById",0,(e,t)=>e.find(e=>e.id===t),"sectionsFor",0,e=>a.map((t,a)=>{let s=String(a+1).padStart(2,"0");return{id:t.id,title:t.title,railLabel:t.railLabel??t.title,no:s,anchor:`s${s}`,note:t.tools?.(e)}})])},916336,e=>{"use strict";let t=(0,e.i(33550).default)("outline","scale","Scale",[["path",{d:"M7 20l10 0",key:"svg-0"}],["path",{d:"M6 6l6 -1l6 1",key:"svg-1"}],["path",{d:"M12 3l0 17",key:"svg-2"}],["path",{d:"M9 12l-3 -6l-3 6a3 3 0 0 0 6 0",key:"svg-3"}],["path",{d:"M21 12l-3 -6l-3 6a3 3 0 0 0 6 0",key:"svg-4"}]]);e.s(["IconScale",0,t],916336)},347354,e=>{"use strict";var t=e.i(843476),a=e.i(533372),s=e.i(442948),r=e.i(916336),i=e.i(618566),n=e.i(271645),o=e.i(209267),l=e.i(908406),d=e.i(161822);e.s(["default",0,function({entityType:e,entityId:c,entityName:u,feiNumber:h,className:p,showLabel:m=!0,label:f="Request",disabled:x=!1}
1){let[g,y]=(0,n.useState)(!1),{toast:b}=(0,l.useToast)(),v=(0,i.useRouter)(),w=(0,d.useAppSelector)(e=>e.user.user),j=async()=>{if(!w?.id){b({title:"Authentication Required",description:"Please sign in to create a FOIA request.",variant:"destructive"}),v.push("/auth/signin");return}if(!c||!u)return void b({title:"Missing Information",description:"Unable to create FOIA request. Entity information is missing.",variant:"destructive"});y(!0);try{let a=await o.foiaApi.user.createFromEntity({entityType:e,entityId:c,entityName:u,feiNumber:h?String(h):void 0,user_id:w.id});b({title:`A FOIA request for ${u} has been made`,description:"Add any details here to help our team process your request.",action:(0,t.jsxs)("div",{className:"mt-2 flex w-full gap-2",children:[(0,t.jsx)("button",{onClick:()=>v.push("/dashboard/foia"),className:"bg-primary hover:bg-primary/90 flex-1 rounded-md px-3 py-2 text-xs font-medium text-white transition-colors",children:"View Request"}),(0,t.jsx)("button",{onClick:()=>{v.push(`/dashboard/foia?edit=${a.id}`)},className:"border-primary text-primary-text hover:bg-primary/5 flex-1 rounded-md border px-3 py-2 text-xs font-medium transition-colors",children:"Add Details"})]}),duration:15e3})}catch(e){console.error("Error creating FOIA request:",e),b({title:"Error",description:e?.message||"Failed to create FOIA request. Please try again.",variant:"destructive"})}finally{y(!1)}};return m?(0,t.jsx)(a.Button,{onClick:j,disabled:g||x,variant:"outline",size:"xs",color:"primary",leftSection:g?(0,t.jsx)(s.Loader,{size:14}):(0,t.jsx)(r.IconScale,{size:14}),className:p,children:f}):(0,t.jsx)(a.Button,{onClick:j,disabled:g||x,variant:"outline",size:"xs",color:"primary",className:`px-1.5 ${p||""}`,children:g?(0,t.jsx)(s.Loader,{size:14}):(0,t.jsx)(r.IconScale,{size:14})})}])},948069,137346,e=>{"use strict";var t=e.i(271645);let a={keypedia:{label:"KeyPedia",external:null},chatgpt:{label:"ChatGPT",external:e=>`https://chatgpt.com/?q=${encodeURIComponent(e)}`},claude:{label:"Claude",external:e=>`https://claude.ai/new?q=${encodeURIComponent(e)}`},copilot:{label:"Copilot",external:e=>`https://copilot.microsoft.com/?q=${encodeURIComponent(e)}`},perplexity:{label:"Perplexity",external:e=>`https://www.perplexity.ai/search?q=${encodeURIComponent(e)}`}},s="ask-assistant-default",r=()=>{let e=window.localStorage.getItem(s);return e&&e in a?e:"keypedia"};e.s(["ASK_ASSISTANTS",0,a,"ASSISTANT_STORAGE_KEY",0,s,"readDefaultAssistant",0,r,"useDefaultAssistant",0,()=>{let[e,a]=(0,t.useState)("keypedia");return(0,t.useEffect)(()=>{let e=()=>a(r());return e(),window.addEventListener("storage",e),window.addEventListener("kp-assistant-changed",e),()=>{window.removeEventListener("storage",e),window.removeEventListener("kp-assistant-changed",e)}},[]),e}],948069);var i=e.i(843476),n=e.i(657688),o=e.i(388349);let l=({size:e})=>(0,i.jsx)("svg",{viewBox:"0 0 320 320",width:e,height:e,fill:"#10A37F","aria-hidden":!0,children:(0,i.jsx)("path",{d:"m297.
106 130.97c7.26-21.79 4.76-45.66-6.85-65.48-17.46-30.4-52.56-46.04-86.84-38.68-15.25-17.18-37.16-26.95-60.13-26.81-35.04-.08-66.13 22.48-76.91 55.82-22.51 4.61-41.94 18.7-53.31 38.67-17.59 30.32-13.58 68.54 9.92 94.54-7.26 21.79-4.76 45.66 6.85 65.48 17.46 30.4 52.56 46.04 86.84 38.68 15.24 17.18 37.16 26.95 60.13 26.8 35.06.09 66.16-22.49 76.94-55.86 22.51-4.61 41.94-18.7 53.31-38.67 17.57-30.32 13.55-68.51-9.94-94.51zm-120.28 168.11c-14.03.02-27.62-4.89-38.39-13.88.49-.26 1.34-.73 1.89-1.07l63.72-36.8c3.26-1.85 5.26-5.32 5.24-9.07v-89.83l26.93 15.55c.29.14.48.42.52.74v74.39c-.04 33.08-26.83 59.9-59.91 59.97zm-128.84-55.03c-7.03-12.14-9.56-26.37-7.15-40.18.47.28 1.3.79 1.89 1.13l63.72 36.8c3.23 1.89 7.23 1.89 10.47 0l77.79-44.92v31.1c.02.32-.13.63-.38.83l-64.41 37.19c-28.69 16.52-65.33 6.7-81.92-21.95zm-16.77-139.09c7-12.16 18.05-21.46 31.21-26.29 0 .55-.03 1.52-.03 2.2v73.61c-.02 3.74 1.98 7.21 5.23 9.06l77.79 44.91-26.93 15.55c-.27.18-.61.21-.91.08l-64.42-37.22c-28.63-16.58-38.45-53.21-21.95-81.89zm221.26 51.49-77.79-44.92 26.93-15.54c.27-.18.61-.21.91-.08l64.42 37.19c28.68 16.57 38.51 53.26 21.94 81.94-7.01 12.14-18.05 21.44-31.2 26.28v-75.81c.03-3.74-1.96-7.2-5.2-9.06zm26.8-40.34c-.47-.29-1.3-.79-1.89-1.13l-63.72-36.8c-3.23-1.89-7.23-1.89-10.47 0l-77.79 44.92v-31.1c-.02-.32.13-.63.38-.83l64.41-37.16c28.69-16.55 65.37-6.7 81.91 22 6.99 12.12 9.52 26.31 7.15 40.1zm-168.51 55.43-26.94-15.55c-.29-.14-.48-.42-.52-.74v-74.39c.02-33.12 26.89-59.96 60.01-59.94 14.01 0 27.57 4.92 38.34 13.88-.49.26-1.33.73-1.89 1.07l-63.72 36.8c-3.26 1.85-5.26 5.31-5.24 9.06l-.04 89.79zm14.63-31.54 34.65-20.01 34.65 20v40.01l-34.65 20-34.65-20z"})}),d=({size:e})=>(0,i.jsx)("svg",{viewBox:"0 0 24 24",width:e,height:e,fill:"#D97757","aria-hidden":!0,children:(0,i.jsx)("path",{d:"m4.7144 15.9555 4.7174-2.6471.079-.2307-.079-.1275h-.2307l-.7893-.0486-2.6956-.0729-2.3375-.0971-2.2646-.1214-.5707-.1215-.5343-.7042.0546-.3522.4797-.3218.686.0608 1.5179.1032 2.2767.1578 1.6514.0972 2.4468.255h.3886l.0546-.1579-.1336-.0971-.1032-.0972L6.973 9.8356l-2.55-1.6879-1.3356-.9714-.7225-.4918-.3643-.4614-.1578-1.0078.6557-.7225.8803.0607.2246.0607.8925.686 1.9064 1.4754 2.4893 1.8336.3643.3035.1457-.1032.0182-.0728-.164-.2733-1.3539-2.4467-1.445-2.4893-.6435-1.032-.17-.6194c-.0607-.255-.1032-.4674-.1032-.7285L6.287.1335 6.6997 0l.9957.1336.419.3642.6192 1.4147 1.0018 2.2282 1.5543 3.0296.4553.8985.2429.8318.091.255h.1579v-.1457l.1275-1.706.2368-2.0947.2307-2.6957.0789-.7589.3764-.9107.7468-.4918.5828.2793.4797.686-.0668.4433-.2853 1.8517-.5586 2.9021-.3643 1.9429h.2125l.2429-.2429.9835-1.3053 1.6514-2.0643.7286-.8196.85-.9046.5464-.4311h1.0321l.759 1.1293-.34 1.1657-1.0625 1.3478-.8804 1.1414-1.2628 1.7-.7893 1.36.0729.1093.1882-.0183 2.8535-.607 1.5421-.2794 1.8396-.3157.8318.3886.091.3946-.3278.8075-1.967.4857-2.3072.4614-3.4364.8136-.0425.0304.0486.0607 1.5482.1457.6618.0364h1.621l3.0175.2247.7892.522.4736.6376-.079.4857-1.2142.6193-1.6393-.3886-3.825-.9107-1.3113-.3279h-.1822v.1093l1.0929 1.0686 2.0035 1.8092 2.5075 2.3314.1275.5768-.3218.4554-.34-.0486-2.2039-1.6575-.85-.7468-1.9246-1.621h-.1275v.17l.4432.6496 2.3436 3.5214.1214 1.0807-.17.3521-.6071.2125-.6679-.1214-1.3721-1.9246L14.38 17.959l-1.1414-1.9428-.1397.079-.674 7.2552-.3156.3703-.7286.2793-.6071-.4614-.3218-.7468.3218-1.4753.3886-1.9246.3157-1.53.2853-1.9004.17-.6314-.0121-.0425-.1397.
10182-1.4328 1.9672-2.1796 2.9446-1.7243 1.8456-.4128.164-.7164-.3704.0667-.6618.4008-.5889 2.386-3.0357 1.4389-1.882.929-1.0868-.0062-.1579h-.0546l-6.3385 4.1164-1.1293.1457-.4857-.4554.0608-.7467.2307-.2429 1.9064-1.3114Z"})}),c=({size:e})=>(0,i.jsx)("svg",{viewBox:"0 0 1322.9 1147.5",width:e,height:e,fill:"#0078D4","aria-hidden":!0,children:(0,i.jsx)("path",{d:"m711.19 265.2c-27.333 0-46.933 3.07-58.8 9.33 27.067-80.267 47.6-210.13 168-210.13 114.93 0 108.4 138.27 157.87 200.8zm107.33 112.93c-35.467 125.2-70 251.2-110.13 375.33-12.133 36.4-45.733 61.6-84 61.6h-136.27c9.3333-14 16.8-28.933 21.467-45.733 35.467-125.07 70-251.07 110.13-375.33 12.133-36.4 45.733-61.6 84-61.6h136.27c-9.3333 14-16.8 28.934-21.467 45.734m-316.13 704.8c-114.93 0-108.4-138.13-157.87-200.67h267.07c27.467 0 47.067-3.07 58.8-9.33-27.067 80.266-47.6 210-168 210m777.47-758.93h0.93c-32.667-38.266-82.267-57.866-146.67-57.866h-36.4c-34.533-2.8-65.333-26.134-76.533-58.8l-36.4-103.6c-21.463-61.737-80.263-103.74-145.73-103.74h-475.07c-175.6 0-251.2 225.07-292.27 361.33-38.267 127.07-126 341.73-24.267 462.13 46.667 55.067 116.67 57.867 183.07 57.867 34.533 2.8 65.333 26.133 76.533 58.8l36.4 103.6c21.467 61.733 80.267 103.73 145.6 103.73h475.2c175.47 0 251.07-225.07 292.27-361.33 30.8-100.8 68.133-224.93 66.267-324.8 0-50.534-11.2-100-42.933-137.33"})}),u=({size:e})=>(0,i.jsx)("svg",{viewBox:"0 0 24 24",width:e,height:e,fill:"#1FB8CD","aria-hidden":!0,children:(0,i.jsx)("path",{d:"M22.3977 7.0896h-2.3106V.0676l-7.5094 6.3542V.1577h-1.1554v6.1966L4.4904 0v7.0896H1.6023v10.3976h2.8882V24l6.932-6.3591v6.2005h1.1554v-6.0469l6.9318 6.1807v-6.4879h2.8882V7.0896zm-3.4657-4.531v4.531h-5.355l5.355-4.531zm-13.2862.0676 4.8691 4.4634H5.6458V2.6262zM2.7576 16.332V8.245h7.8476l-6.1149 6.1147v1.9723H2.7576zm2.8882 5.0404v-3.8852h.0001v-2.6488l5.7763-5.7764v7.0111l-5.7764 5.2993zm12.7086.0248-5.7766-5.1509V9.0618l5.7766 5.7766v6.5588zm2.8882-5.0652h-1.733v-1.9723L13.3948 8.245h7.8478v8.087z"})});e.s(["default",0,function({assistant:e,size:t=14}){switch(e){case"keypedia":return(0,i.jsx)(n.default,{src:o.default,alt:"","aria-hidden":!0,style:{height:t,width:t}});case"chatgpt":return(0,i.jsx)(l,{size:t});case"claude":return(0,i.jsx)(d,{size:t});case"copilot":return(0,i.jsx)(c,{size:t});case"perplexity":return(0,i.jsx)(u,{size:t})}}],137346)},643028,e=>{"use strict";e.i(247167);var t=e.i(843476),a=e.i(533372),s=e.i(226200),r=e.i(442948),i=e.i(184086),n=e.i(857142),o=e.i(867228),l=e.i(183444),d=e.i(524689),c=e.i(102761),u=e.i(348239),h=e.i(144492),p=e.i(618566),m=e.i(271645),f=e.i(614677),x=e.i(954850),g=e.i(809586),y=e.i(553400),b=e.i(568586),v=e.i(838637),w=e.i(347354),j=e.i(639789),k=e.i(908406),S=e.i(161822),N=e.i(226109),C=e.i(699135),A=e.i(649828),I=e.i(261238),E=e.i(948069),M=e.i(137346);function R({profileData:e,dashboardData:s,disabled:i=!1,className:n="",onFetchData:o,condensed:l=!1}){let[d,c]=(0,m.useState)(!1),{toast:u}=(0,k.useToast)(),p=(0,S.useAppSelector)(e=>e.user.user),f=async()=>{if(!e&&!s&&!o)return void u({title:"No data available",description:"There is no data to export. Please load some data first.",variant:"destructive"});c(!0);try{let t=e;if(o)try{t=await o()}catch(e){throw console.error("Error fetching export data:",e),Error("Failed to fetch full report data")}let a="Dashboard Report";if(t){if("officer"===t.type&&t.officer){let e=t.officer.full_name||t.officer.fullName||"Unknown Individual";a=`${e} - Profile Report`}else if("company"===t.type&&t.company){let e=t.company.name||"Unknown Company";a=`${e} - Profile Report`}else if("violationCode"===t.type&&t.violationCode){let e=t.violationCode.name||"Unknown Code";a=`${e} - Profile Report`}}let r=await fetch("/api/dashboard/export-pdf",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({profileData:t,dashboardData:s,options:{title:a,includeTimestamp:!0,userUuid:p?.id}})});if(!r.ok){let e=await r.json().catch(()=>({}));throw Error(e.error||"Failed to generate report")}let i=r.headers.get("content-type");if(i?.includes("application/pdf")||i?.includes("text/html")){let e=await r.blob(),t=URL.createObjectURL(e),s=document.createElement("a");s.href=t;let n=i?.includes("application/pdf"),o=a.replace(/[^a-z0-9]/gi,"_").toLowerCase();s.download=`${o}-${Date.now()}.${n?"pdf":"html"}`,document.body.appendChild(s),s.click(),document.body.removeChild(s),URL.revokeObjectURL(t),u({title:"Report generated",description:`Your ${n?"PDF":"HTML"} report has been downloaded successfully.`})}else throw Error("Unexpected response format")}catch(e){console.error("Error exporting report:",e),u({title:"Export failed",description:e instanceof Error?e.message:"Failed to generate report. Please try again.",variant:"destructive"})}finally{c(!1)}};return l?(0,t.jsx)(a.Button,{onClick:f,disabled:i||d,variant:"outline",size:"xs",color:"primary",className:`px-1.5 ${n}
1`,children:d?(0,t.jsx)(r.Loader,{size:14}):(0,t.jsx)(h.IconDownload,{size:14})}):(0,t.jsx)(a.Button,{onClick:f,disabled:i||d,variant:"outline",size:"xs",color:"primary",leftSection:d?(0,t.jsx)(r.Loader,{size:14}):(0,t.jsx)(h.IconDownload,{size:14}),className:n,children:d?"Generating...":"Export Report"})}function P({icon:e,label:a,onClick:s,disabled:i,busy:n,active:o}){return(0,t.jsxs)("button",{type:"button",onClick:s,disabled:i,title:a,"aria-label":a,className:"group/act flex w-full items-center gap-2.5 rounded-[6px] px-2 py-2 text-left transition-colors hover:bg-[color:var(--n-panel)] disabled:opacity-40",style:{color:o?"var(--kp-light, var(--mantine-color-primary-7)) var(--kp-dark, #a09ff4)":"var(--n-strong)"},children:[(0,t.jsx)("span",{className:"grid size-[18px] shrink-0 place-items-center",style:{color:o?"var(--kp-light, var(--mantine-color-primary-7)) var(--kp-dark, #a09ff4)":"var(--kp-light, var(--mantine-color-primary-6)) var(--kp-dark, #a09ff4)"},children:n?(0,t.jsx)(r.Loader,{size:13}):e}),(0,t.jsx)("span",{className:"min-w-0 overflow-hidden text-[13px] font-medium whitespace-nowrap",children:a})]})}e.s(["default",0,function({viewType:e,entityId:_,entityName:D,feiNumber:T,externalIsSaved:O,onExternalSave:F,externalSaveLoading:B,onFetchData:L,profileData:z,dashboardData:K,layout:U="ribbon",exportToReportBuilder:$}){let{toast:V}=(0,k.useToast)(),H=(0,p.useRouter)(),q=(0,b.useReportContents)(),G=(0,S.useAppSelector)(e=>e.user.user),{tempFilters:W}=(0,x.useTempFilterState)(),[Y,Q]=(0,m.useState)(!1),[J,X]=(0,m.useState)(null),[Z,ee]=(0,m.useState)(!0),[et,ea]=(0,m.useState)(!1),[es,er]=(0,m.useState)(!0),[ei,en]=(0,m.useState)(!0);(0,m.useEffect)(()=>{let e=localStorage.getItem("show-print-report-button"),t=localStorage.getItem("show-export-report-button");null!==e&&er("true"===e),null!==t&&en("true"===t)},[]),(0,m.useEffect)(()=>{void 0!==O?ee(!1):(async()=>{if(!G?.id)return ee(!1);try{let e=(await (0,I.fetchData)("https://gksc-prod-backend-290557432249.us-east1.run.app/api/recent_queries/get_favorite_queries/","POST",{user_id:G.id,page:1,recordsPerPage:1e3})).favorite_queries||[],t=(0,C.compressFilterOptions)(W),a=e.find(e=>(0,C.compressFilterOptions)(e.filters||{})===t);a?X({id:a.id,nickname:a.nickname||"Unnamed Search",isMatch:!0}):X(null)}catch(e){console.error("Error checking saved queries:",e),X(null)}finally{ee(!1)}})()},[G?.id,W,O]);let eo=async()=>{if(F)return void F();if(!G?.id)return void V({title:"Authentication required",description:"Please sign in to save searches.",variant:"destructive"});if(ep&&J?.id){Q(!0);try{await (0,I.fetchData)("https://gksc-prod-backend-290557432249.us-east1.run.app/api/recent_queries/remove_favorite_query/","POST",{query_id:J.id,user_id:G.id}),X(null),V({title:"Search unsaved",description:"Your search has been removed from saved searches."})}catch(e){V({title:"Unsave failed",description:"Failed to unsave search. Please try again.",variant:"destructive"})}finally{Q(!1)}return}Q(!0);try{let t=await (0,I.fetchData)("https://gksc-prod-backend-290557432249.us-east1.run.app/api/recent_queries/insert_favorite_query/","POST",{user_id:G.id,filters:W,nickname:D?`${D} - ${e} view`:`Saved ${e} search`,ai_search_text:""});"success"===t.status&&(X({id:t.id,nickname:D?`${D} - ${e} view`:`Saved ${e} search`,isMatch:!0}),V({title:"Search saved",description:"Your search has been saved successfully."}))}catch(e){V({title:"Save failed",description:"Failed to save search. Please try again.",variant:"destructive"})}finally{Q(!1)}},el=async()=>{ea(!0);try{let t=j.urlConfig.baseUrl,a=`${t}${window.location.pathname}${window.location.search}`;if(D&&_){if("person"===e||"officer"===e){let e=(0,A.generatePersonUrl)(D,_);a=`${t}${e}`}else if("company"===e){let e=(0,A.generateCompanySlug)(D),s=(0,A.generateCompanyUrl)(e,_);a=`${t}${s}`}else if("office"===e){let e=(0,A.generateOfficeUrl)(D,_);a=`${t}${e}`}}await (0,N.copyTextToClipboard)(a),V({title:"Link copied",description:"Page link has been copied to clipboard."})}catch(e){console.error("Share error:",e),V({title:"Share failed",description:"Failed to copy link. Please try again or c
1opy the URL manually.",variant:"destructive"})}finally{ea(!1)}},ed=(0,E.useDefaultAssistant)(),ec=`Ask ${E.ASK_ASSISTANTS[ed].label}`,eu=()=>{let t;if(!(D&&""!==D.trim()&&"undefined"!==D&&"null"!==D))return void V({title:"Missing information",description:"Unable to generate KeyPedia query. Please ensure entity information is available.",variant:"destructive"});if("company"===e&&null!=T&&""!==T){let e=String(T).trim();t=`Give a summary of ${D.trim()} (FEI: ${e})`}else t=`Give a summary of ${D.trim()}`;let a=E.ASK_ASSISTANTS[ed];if(a.external)return void window.open(a.external(t),"_blank","noopener,noreferrer");let s=(0,f.v4)(),r=new URLSearchParams;r.set("query",t),H.push(`/keypedia/${s}?${r.toString()}`)},eh=()=>{window.print()},ep=void 0!==O?O:J?.isMatch||!1,em=B||Y,ef=(0,o.useMediaQuery)("(max-width: 768px)"),ex="company"===e||"officer"===e||"person"===e,eg=B||!1;return ef?(0,t.jsxs)(s.Group,{gap:4,align:"center",wrap:"nowrap",children:[(0,t.jsx)(i.Tooltip,{label:Y?"Saving...":ep?"Saved":"Save Search",withArrow:!0,zIndex:500,children:(0,t.jsx)(a.Button,{onClick:eo,disabled:em||!G?.id,variant:"outline",size:"xs",color:ep?"yellow":"primary",className:"px-1.5",style:ep?{borderColor:"#fbbf24",color:"var(--kp-light, #92400e) var(--kp-dark, #ece4df)"}:{}
1,children:Y?(0,t.jsx)(r.Loader,{size:14}):ep?(0,t.jsx)(c.IconStar,{size:14,fill:"#92400e"}):(0,t.jsx)(c.IconStar,{size:14})})}),(0,t.jsx)(i.Tooltip,{label:et?"Copying Link...":"Share Link",withArrow:!0,zIndex:500,children:(0,t.jsx)(a.Button,{onClick:el,disabled:et||eg,variant:"outline",size:"xs",color:"primary",className:"px-1.5",children:(0,t.jsx)(l.IconShare,{size:14})})}),(0,t.jsxs)(n.Popover,{width:220,position:"bottom-end",shadow:"md",children:[(0,t.jsx)(n.Popover.Target,{children:(0,t.jsx)(a.Button,{variant:"outline",size:"xs",color:"primary",className:"px-1.5",disabled:eg,children:(0,t.jsx)(u.IconDotsVertical,{size:14})})}),(0,t.jsx)(n.Popover.Dropdown,{className:"p-1",children:(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[ei&&($?(0,t.jsx)(a.Button,{onClick:()=>q.scrollTo(v.EXPORT_SECTION_HASH),variant:"subtle",size:"xs",color:"primary",leftSection:(0,t.jsx)(h.IconDownload,{size:14}),className:"justify-start",disabled:eg,children:"Export Report"}):(0,t.jsx)(R,{profileData:z,dashboardData:K,onFetchData:L,condensed:!1,disabled:eg})),es&&(0,t.jsx)(a.Button,{onClick:eh,variant:"subtle",size:"xs",color:"primary",leftSection:(0,t.jsx)(d.IconPrinter,{size:14}),className:"justify-start",disabled:eg,children:"Print Report"}),(0,t.jsx)(a.Button,{onClick:eu,variant:"subtle",size:"xs",color:"primary",leftSection:(0,t.jsx)(M.default,{assistant:ed}),className:"justify-start",disabled:eg,children:ec}),ex&&(0,t.jsx)(w.default,{entityType:"company"===e?"company":"officer",entityId:_,entityName:D,feiNumber:T,showLabel:!0,disabled:eg})]})})]})]}):"rail"===U?(0,t.jsxs)("nav",{"aria-label":"Actions",className:"flex flex-col gap-0.5",children:[(0,t.jsx)(P,{icon:(0,t.jsx)(c.IconStar,{size:15,fill:ep?"currentColor":"none"}),label:ep?"Saved":"Save search",onClick:eo,disabled:em||!G?.id,busy:Y,active:ep}),(0,t.jsx)(P,{icon:(0,t.jsx)(l.IconShare,{size:15}),label:et?"Copying link":"Share link",onClick:el,disabled:et||eg}),(0,t.jsx)(P,{icon:(0,t.jsx)(M.default,{assistant:ed,size:15}),label:ec,onClick:eu,disabled:eg}),ex&&(0,t.jsx)("div",{className:"group/act [&_.mantine-Button-section]:!text-[color:light-dark(var(--mantine-color-primary-6),_#a09ff4)] [&_button:hover]:!bg-[color:var(--n-panel)] [&_button]:!h-auto [&_button]:!w-full [&_.mantine-Button-inner]:!w-full [&_.mantine-Button-inner]:!justify-start [&_button]:!justify-start [&_button]:!gap-2.5 [&_button]:!rounded-[6px] [&_button]:!border-0 [&_button]:!bg-transparent [&_button]:!px-2 [&_button]:!py-2 [&_button]:!text-[13px] [&_button]:!font-medium [&_button]:!text-[color:var(--n-strong)] [&_.mantine-Button-section]:!mr-0 [&_.mantine-Button-section]:!w-[18px] [&_.mantine-Button-section]:!justify-center",children:(0,t.jsx)(w.default,{entityType:"company"===e?"company":"officer",entityId:_,entityName:D,feiNumber:T,showLabel:!0,label:"FOIA request",disabled:eg})})]}):(0,t.jsxs)(s.Group,{gap:4,align:"center",wrap:"nowrap",children:[(0,t.jsx)(i.Tooltip,{label:Y?"Saving...":ep?"Saved":"Save Search",withArrow:!0,zIndex:500,children:(0,t.jsx)(a.Button,{onClick:eo,disabled:em||!G?.id,variant:"outline",size:"xs",color:ep?"yellow":"primary",className:"px-1.5",style:ep?{borderColor:"#fbbf24",color:"var(--kp-light, #92400e) var(--kp-dark, #ece4df)"}:{}
1,children:Y?(0,t.jsx)(r.Loader,{size:14}):ep?(0,t.jsx)(c.IconStar,{size:14,fill:"#92400e"}):(0,t.jsx)(c.IconStar,{size:14})})}),ei&&($?(0,t.jsx)(g.default,{onProduce:e=>{window.dispatchEvent(new CustomEvent(y.PRODUCE_REPORT_EVENT,{detail:e}))},onShare:el,disabled:eg}):(0,t.jsx)(i.Tooltip,{label:"Export Report",withArrow:!0,zIndex:500,children:(0,t.jsx)("div",{children:(0,t.jsx)(R,{profileData:z,dashboardData:K,onFetchData:L,condensed:!0,disabled:eg})})})),es&&(0,t.jsx)(i.Tooltip,{label:"Print Report",withArrow:!0,zIndex:500,children:(0,t.jsx)(a.Button,{onClick:eh,variant:"outline",size:"xs",color:"primary",className:"px-1.5",disabled:eg,children:(0,t.jsx)(d.IconPrinter,{size:14})})}),(0,t.jsx)(i.Tooltip,{label:et?"Copying Link...":"Share Link",withArrow:!0,zIndex:500,children:(0,t.jsx)(a.Button,{onClick:el,disabled:et||eg,variant:"outline",size:"xs",color:"primary",className:"px-1.5",children:(0,t.jsx)(l.IconShare,{size:14})})}),(0,t.jsx)(i.Tooltip,{label:ec,withArrow:!0,zIndex:500,children:(0,t.jsx)(a.Button,{onClick:eu,variant:"outline",size:"xs",color:"primary",className:"px-1.5","aria-label":ec,disabled:eg,children:(0,t.jsx)(M.default,{assistant:ed})})}),ex&&(0,t.jsx)(i.Tooltip,{label:"FOIA Request",withArrow:!0,zIndex:500,children:(0,t.jsx)("div",{children:(0,t.jsx)(w.default,{entityType:"company"===e?"company":"officer",entityId:_,entityName:D,feiNumber:T,showLabel:!1,disabled:eg})})})]})}],643028)},914552,306916,e=>{"use strict";var t=e.i(33550);let a=(0,t.default)("outline","moon","Moon",[["path",{d:"M12 3c.132 0 .263 0 .393 0a7.5 7.5 0 0 0 7.92 12.446a9 9 0 1 1 -8.313 -12.454l0 .008",key:"svg-0"}]]);e.s(["IconMoon",0,a],914552);let s=(0,t.default)("outline","sun","Sun",[["path",{d:"M8 12a4 4 0 1 0 8 0a4 4 0 1 0 -8 0",key:"svg-0"}],["path",{d:"M3 12h1m8 -9v1m8 8h1m-9 8v1m-6.4 -15.4l.7 .7m12.1 -.7l-.7 .7m0 11.4l.7 .7m-12.1 -.7l-.7 .7",key:"svg-1"}]]);e.s(["IconSun",0,s],306916)},678976,e=>{"use strict";var t=e.i(843476),a=e.i(533372),s=e.i(184086),r=e.i(914552),i=e.i(306916),n=e.i(363178),o=e.i(271645),l=e.i(975157),d=e.i(118502),c=e.i(472158);e.s(["ThemeToggle",0,function({className:e,location:u="header",appearance:h="public"}){let{resolvedTheme:p,setTheme:m}=(0,n.useTheme)(),[f,x]=(0,o.useState)(!1);(0,o.useEffect)(()=>x(!0),[]);let g=f&&"dark"===p?"light":"dark",y=f?`Switch to ${g} mode`:"Switch colour theme",b=()=>{m(g),(0,c.trackPostHogEvent)("theme_switched",{theme:g,location:u})},v=e=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(i.IconSun,{size:e,"aria-hidden":"true",className:"dark:hidden"}),(0,t.jsx)(r.IconMoon,{size:e,"aria-hidden":"true",className:"hidden dark:block"})]});return"app"===h?(0,t.jsx)(s.Tooltip,{label:y,withArrow:!0,zIndex:500,children:(0,t.jsx)(a.Button,{onClick:b,variant:"outline",size:"xs",color:"primary","aria-label":y,"data-track-click":`theme_toggle_${u}`,className:(0,l.cn)(d.RESPONSIVE_ICON_BUTTON,"md:!px-1.5",e),children:v(14)})}):(0,t.jsx)("button",{type:"button",onClick:b,"aria-label":y,title:y,"data-track-click":`theme_toggle_${u}`,className:(0,l.cn)("inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-full","text-gray-600 transition-colors hover:bg-gray-100 hover:text-gray-900","focus-visible:ring-2 focus-visible:ring-brand focus-visible:ring-offset-2 focus-visible:ring-offset-background focus-visible:outline-none",e),children:v(18)})}])},13838,323012,e=>{"use strict";var t=e.i(843476),a=e.i(664659),s=e.i(618566),r=e.i(271645),i=e.i(975157);e.s(["ScrollableContent",0,function({children:e,className:n}){let o=(0,r.useRef)(null),l=(0,r.useRef)(null),[d,c]=(0,r.useState)(!1),[u,h]=(0,r.useState)(!1),p=(0,s.usePathname)(),m=(0,r.useCallback)(()=>{let e=o.current;!e||(c(e.scrollHeight>e.clientHeight+10),e.scrollTop>10&&h(!0))},[]);return(0,r.useEffect)(()=>{h(!1);let e=o.current;e&&(e.scrollTop=0)},[p]),(0,r.useEffect)(()=>{let e=o.current,t=l.current;if(!e)return;m(),e.addEventListener("scroll",m,{passive:!0});let a=new ResizeObserver(m);return a.observe(e),t&&a.observe(t),()=>{e.removeEventListener("scroll",m),a.disconnect()}},[m]),(0,t.jsxs)("div",{className:"relative min-h-0 flex-1",children:[(0,t.jsx)("div",{ref:o,className:(0,i.cn)("h-full overflow-auto gks-scrollable",n),children:(0,t.jsx)("div",{ref:l,children:e})}),d&&!u&&(0,t.jsx)("div",{className:"pointer-events-auto absolute bottom-3 left-1/2 z-10 -translate-x-1/2",children:(0,t.jsx)("button",{type:"button",onClick:()=>{let e=o.current;e&&e.scrollBy({top:200,behavior:"smooth"})},className:"gks-scroll-arrow","aria-label":"Scroll down for more content",children:(0,t.jsx)(a.ChevronDown,{className:"h-4 w-4","aria-hidden":!0})})})]})}],13838);let n=(0,e.i(475254).default)("panel-left",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);e.s(["PanelLeft",0,n],323012)},980376,e=>{"use strict";var t=e.i(843476),a=e.i(326999),s=e.i(225913),r=e.i(37727),i=e.i(271645),n=e.i(975157);let o=a.Root,l=a.Trigger;a.Close;let d=a.Portal,c=i.forwardRef(({className:e,...s},r)=>(0,t.jsx)(a.Overlay,{className:(0,n.cn)("fixed inset-0 z-[55] bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...s,ref:r}));c.displayName=a.Overlay.displayName;let u=(0,s.cva)("fixed z-[60] gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm [&[data-side=left]]:left-0",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),h=i.forwardRef(({side:e="right",className:s,children:i,...o},l)=>(0,t.jsxs)(d,{children:[(0,t.jsx)(c,{}),(0,t.jsxs)(a.Content,{ref:l,className:(0,n.cn)(u({side:e}),s),...o,children:[(0,t.jsxs)(a.Close,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:pointer-events-none",children:[(0,t.jsx)(r.X,{className:"h-4 w-4"}),(0,t.jsx)("span",{className:"sr-only",children:"Close"})]}),i]})]}));h.displayName=a.Content.displayName;let p=({className:e,...a})=>(0,t.jsx)("div",{className:(0,n.cn)("flex flex-col space-y-2 text-center sm:text-left",e),...a});p.displayName="SheetHeader";let m=i.forwardRef(({className:e,...s},r)=>(0,t.jsx)(a.Title,{ref:r,className:(0,n.cn)("text-lg font-semibold text-foreground",e),...s}));m.displayName=a.Title.displayName;let f=i.forwardRef(({className:e,...s},r)=>(0,t.jsx)(a.Description,{ref:r,className:(0,n.cn)("text-sm text-muted-foreground",e),...s}));f.displayName=a.Description.displayName,e.s(["Sheet",0,o,"SheetContent",0,h,"SheetDescription",0,f,"SheetHeader",0,p,"SheetTitle",0,m,"SheetTrigger",0,l])},530909,377855,542724,54340,502913,e=>{"use strict";var t=e.i(843476),a=e.i(991918),s=e.i(225913),r=e.i(323012),i=e.i(271645),n=e.i(519455),o=e.i(793479),l=e.i(772436),d=e.i(980376),c=e.i(302747),u=e.i(746798),h=e.i(414877),p=e.i(975157);let m="sidebar_state",f="gks_sidebar_width",x=i.createContext(null);function g(){let e=i.useContext(x);if(!e)throw Error("useSidebar must be used within a SidebarProvider.");return e}let y=i.forwardRef(({defaultOpen:e=!0,open:a,onOpenChange:s,className:r,style:n,children:o,...l},d)=>{let c=(0,h.useIsMobile)(),[g,y]=i.useState(!1),b=i.useCallback(()=>
1{if("u"<typeof document)return e;for(let e of document.cookie.split(";")){let[t,a]=e.trim().split("=");if(t===m)return"true"===a}return e},[e]),[v,w]=i.useState(()=>b()),j=a??v,k=i.useCallback(e=>{let t="function"==typeof e?e(j):e;s?s(t):w(t),document.cookie=`${m}=${t}; path=/; max-age=604800`},[s,j]),S=i.useCallback(()=>c?y(e=>!e):k(e=>!e),[c,k,y]);i.useEffect(()=>{if(c)return;let e=window.matchMedia("(max-width: 1024px)"),t=()=>{e.matches&&j&&w(!1)};return t(),e.addEventListener("change",t),()=>e.removeEventListener("change",t)},[c]),i.useEffect(()=>{let e=e=>{"b"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),S())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[S]);let N=j?"expanded":"collapsed",C=i.useMemo(()=>({state:N,open:j,setOpen:k,isMobile:c,openMobile:g,setOpenMobile:y,toggleSidebar:S}),[N,j,k,c,g,y,S]),[A,I]=i.useState(null);return i.useEffect(()=>{try{let e=window.localStorage.getItem(f);e&&I(e)}catch{}},[]),(0,t.jsx)(x.Provider,{value:C,children:(0,t.jsx)(u.TooltipProvider,{delayDuration:0,children:(0,t.jsx)("div",{style:{"--sidebar-width":A||"14rem","--sidebar-width-icon":"4rem",...n},className:(0,p.cn)("group/sidebar-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-sidebar",r),ref:d,...l,children:o})})})});y.displayName="SidebarProvider";let b=i.forwardRef(({side:e="left",variant:a="sidebar",collapsible:s="offcanvas",className:r,children:i,...n},o)=>{let{isMobile:l,state:c,openMobile:u,setOpenMobile:h}=g();return"none"===s?(0,t.jsx)("div",{className:(0,p.cn)("flex h-full w-[var(--sidebar-width)] flex-col bg-sidebar text-sidebar-foreground",r),ref:o,...n,children:i}):l?(0,t.jsx)(d.Sheet,{open:u,onOpenChange:h,...n,children:(0,t.jsxs)(d.SheetContent,{"data-sidebar":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-[var(--sidebar-width)] p-0 [&>button]:top-2 [&>button]:right-2 [&>button]:z-20 [&>button]:flex [&>button]:h-11 [&>button]:w-11 [&>button]:items-center [&>button]:justify-center [&>button]:rounded-md [&>button]:bg-sidebar-accent [&>button]:opacity-100",style:{"--sidebar-width":"min(20rem, 88vw)"},side:e,children:[(0,t.jsxs)(d.SheetHeader,{className:"sr-only",children:[(0,t.jsx)(d.SheetTitle,{children:"Sidebar"}),(0,t.jsx)(d.SheetDescription,{children:"Displays the mobile sidebar."})]}),(0,t.jsx)("div",{className:"flex h-full w-full flex-col",children:i})]})}):(0,t.jsxs)("div",{ref:o,className:"group peer text-sidebar-foreground hidden md:block","data-state":c,"data-collapsible":"collapsed"===c?s:"","data-variant":a,"data-side":e,children:[(0,t.jsx)("div",{className:(0,p.cn)("relative w-[var(--sidebar-width)] bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180","floating"===a||"inset"===a?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]":"group-data-[collapsible=icon]:w-[var(--sidebar-width-icon)]")}),(0,t.jsx)("div",{className:(0,p.cn)("fixed inset-y-0 z-10 hidden h-svh w-[var(--sidebar-width)] transition-[left,right,width] duration-200 ease-linear md:flex","left"===e?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]","floating"===a||"inset"===a?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]":"group-data-[collapsible=icon]:w-[var(--sidebar-width-icon)] group-data-[side=left]:border-r group-data-[side=right]:border-l",r),...n,children:(0,t.jsx)("div",{"data-sidebar":"sidebar",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow",children:i})})]})});b.displayName="Sidebar";let v=i.forwardRef(({className:e,onClick:a,...s},i)=>{let{toggleSidebar:o}=g();return(0,t.jsxs)(n.Button,{ref:i,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:(0,p.cn)("h-7 w-7",e),onClick:e=>{a?.(e),o()},...s,children:[(0,t.jsx)(r.PanelLeft,{}),(0,t.jsx)("span",{className:"sr-only",children:"Toggle Sidebar"})]})});v.displayName="SidebarTrigger";let w=i.forwardRef(({className:e,...a},s)=>{let{toggleSidebar:r}=g();return(0,t.jsx)("button",{ref:s,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:r,title:"Toggle Sidebar",className:(0,p.cn)("absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex","[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",e),...a})});w.displayName="SidebarRail";let j=i.forwardRef(({className:e,...a},s)=>(0,t.jsx)("main",{ref:s,className:(0,p.cn)("relative flex w-full flex-1 flex-col bg-background","md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow",e),...a}));j.displayName="SidebarInset",i.forwardRef(({className:e,...a},s)=>(0,t.jsx)(o.Input,{ref:s,"data-sidebar":"input",className:(0,p.cn)("h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",e),...a})).displayName="SidebarInput";let k=i.forwardRef(({className:e,...a},s)=>(0,t.jsx)("div",{ref:s,"data-sidebar":"header",className:(0,p.cn)("flex flex-col gap-2 p-2",e),...a}));k.displayName="SidebarHeader";let S=i.forwardRef(({className:e,...a},s)=>(0,t.jsx)("div",{ref:s,"data-sidebar":"footer",className:(0,p.cn)("flex min-h-0 flex-col gap-2 overflow-y-auto",e),...a}));S.displayName="SidebarFooter",i.forwardRef(({className:e,...a},s)=>(0,t.jsx)(l.Separator,{ref:s,"data-sidebar":"separator",className:(0,p.cn)("mx-2 w-auto bg-sidebar-border",e),...a})).displayName="SidebarSeparator";let N=i.forwardRef(({className:e,...a},s)=>(0,t.jsx)("div",{ref:s,"data-sidebar":"content",className:(0,p.cn)("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-x-hidden group-data-[collapsible=icon]:overflow-y-auto",e),...a}));N.displayName="SidebarContent";let C=i.forwardRef(({className:e,...a},s)=>(0,t.jsx)("div",{ref:s,"data-sidebar":"group",className:(0,p.cn)("relative flex w-full min-w-0 flex-col p-2",e),...a}));C.displayName="SidebarGroup",i.forwardRef(({className:e,asChild:s=!1,...r},i)=>{let n=s?a.Slot:"div";return(0,t.jsx)(n,{ref:i,"data-sidebar":"group-label",className:(0,p.cn)("flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground
1/70 outline-none ring-sidebar-ring transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",e),...r})}).displayName="SidebarGroupLabel",i.forwardRef(({className:e,asChild:s=!1,...r},i)=>{let n=s?a.Slot:"button";return(0,t.jsx)(n,{ref:i,"data-sidebar":"group-action",className:(0,p.cn)("absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","group-data-[collapsible=icon]:hidden",e),...r})}).displayName="SidebarGroupAction";let A=i.forwardRef(({className:e,...a},s)=>(0,t.jsx)("div",{ref:s,"data-sidebar":"group-content",className:(0,p.cn)("w-full text-sm",e),...a}));A.displayName="SidebarGroupContent";let I=i.forwardRef(({className:e,...a},s)=>(0,t.jsx)("ul",{ref:s,"data-sidebar":"menu",className:(0,p.cn)("flex w-full min-w-0 flex-col gap-1",e),...a}));I.displayName="SidebarMenu";let E=i.forwardRef(({className:e,...a},s)=>(0,t.jsx)("li",{ref:s,"data-sidebar":"menu-item",className:(0,p.cn)("group/menu-item relative",e),...a}));E.displayName="SidebarMenuItem";let M=(0,s.cva)("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-12 group-data-[collapsible=icon]:!p-3 [&>span:last-child]:truncate [&>svg]:size-6 [&>svg]:shrink-0 group-data-[collapsible=icon]:[&>svg]:size-6",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:!p-0"}},defaultVariants:{variant:"default",size:"default"}}),R=i.forwardRef(({asChild:e=!1,isActive:s=!1,variant:r="default",size:i="default",tooltip:n,className:o,...l},d)=>{let c=e?a.Slot:"button",{isMobile:h,state:m}=g(),f=(0,t.jsx)(c,{ref:d,"data-sidebar":"menu-button","data-size":i,"data-active":s,className:(0,p.cn)(M({variant:r,size:i}),o),...l});return n?("string"==typeof n&&(n={children:n}),(0,t.jsxs)(u.Tooltip,{children:[(0,t.jsx)(u.TooltipTrigger,{asChild:!0,children:f}),(0,t.jsx)(u.TooltipContent,{side:"right",align:"center",hidden:"collapsed"!==m||h,...n})]})):f});R.displayName="SidebarMenuButton";let P=i.forwardRef(({className:e,asChild:s=!1,showOnHover:r=!1,...i},n)=>{let o=s?a.Slot:"button";return(0,t.jsx)(o,{ref:n,"data-sidebar":"menu-action",className:(0,p.cn)("absolute right-1.5 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-sidebar-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",r&&"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0",e),...i})});P.displayName="SidebarMenuAction",i.forwardRef(({className:e,...a},s)=>(0,t.jsx)("div",{ref:s,"data-sidebar":"menu-badge",className:(0,p.cn)("pointer-events-none absolute right-1 flex h-5 min-w-5 select-none items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-sidebar-foreground","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",e),...a})).displayName="SidebarMenuBadge",i.forwardRef(({className:e,showIcon:a=!1,...s},r)=>{let n=i.useMemo(()=>`${Math.floor(40*Math.random())+50}%`,[]);return(0,t.jsxs)("div",{ref:r,"data-sidebar":"menu-skeleton",className:(0,p.cn)("flex h-8 items-center gap-2 rounded-md px-2",e),...s,children:[a&&(0,t.jsx)(c.Skeleton,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),(0,t.jsx)(c.Skeleton,{className:"h-4 max-w-[--skeleton-width] flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":n}})]})}).displayName="SidebarMenuSkeleton";let _=i.forwardRef(({className:e,...a},s)=>(0,t.jsx)("ul",{ref:s,"data-sidebar":"menu-sub",className:(0,p.cn)("mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",e),...a}));_.displayName="SidebarMenuSub";let D=i.forwardRef(({...e},a)=>(0,t.jsx)("li",{ref:a,...e}));D.displayName="SidebarMenuSubItem";let T=i.forwardRef(({asChild:e=!1,size:s="md",isActive:r,className:i,...n},o)=>{let l=e?a.Slot:"a";return(0,t.jsx)(l,{ref:o,"data-sidebar":"menu-sub-button","data-size":s,"data-active":r,className:(0,p.cn)("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-none ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground","sm"===s&&"text-xs","md"===s&&"text-sm","group-data-[collapsible=icon]:hidden",i),...n})});T.displayName="SidebarMenuSubButton",e.s(["SIDEBAR_WIDTH_MAX_REM",0,22,"SIDEBAR_WIDTH_MIN_REM",0,13,"SIDEBAR_WIDTH_STORAGE_KEY",0,f,"Sidebar",0,b,"SidebarContent",0,N,"SidebarFooter",0,S,"SidebarGroup",0,C,"SidebarGroupContent",0,A,"SidebarHeader",0,k,"SidebarInset",0,j,"
1SidebarMenu",0,I,"SidebarMenuAction",0,P,"SidebarMenuButton",0,R,"SidebarMenuItem",0,E,"SidebarMenuSub",0,_,"SidebarMenuSubButton",0,T,"SidebarMenuSubItem",0,D,"SidebarProvider",0,y,"SidebarRail",0,w,"SidebarTrigger",0,v,"useSidebar",0,g],530909);var O=e.i(174080),F=e.i(981140),B=e.i(820783),L=e.i(75830),z=e.i(30030),K=e.i(726330),U=e.i(774606),$=e.i(296626),V=e.i(248425),H=e.i(30207),q=e.i(369340),G=e.i(934620),W=e.i(959411),Y="ToastProvider",[Q,J,X]=(0,L.createCollection)("Toast"),[Z,ee]=(0,z.createContextScope)("Toast",[X]),[et,ea]=Z(Y),es=e=>{let{__scopeToast:a,label:s="Notification",duration:r=5e3,swipeDirection:n="right",swipeThreshold:o=50,children:l}=e,[d,c]=i.useState(null),[u,h]=i.useState(0),p=i.useRef(!1),m=i.useRef(!1);return s.trim()||console.error(`Invalid prop \`label\` supplied to \`${Y}\`. Expected non-empty \`string\`.`),(0,t.jsx)(Q.Provider,{scope:a,children:(0,t.jsx)(et,{scope:a,label:s,duration:r,swipeDirection:n,swipeThreshold:o,toastCount:u,viewport:d,onViewportChange:c,onToastAdd:i.useCallback(()=>h(e=>e+1),[]),onToastRemove:i.useCallback(()=>h(e=>e-1),[]),isFocusedToastEscapeKeyDownRef:p,isClosePausedRef:m,children:l})})};es.displayName=Y;var er="ToastViewport",ei=["F8"],en="toast.viewportPause",eo="toast.viewportResume",el=i.forwardRef((e,a)=>{let{__scopeToast:s,hotkey:r=ei,label:n="Notifications ({hotkey})",...o}=e,l=ea(er,s),d=J(s),c=i.useRef(null),u=i.useRef(null),h=i.useRef(null),p=i.useRef(null),m=(0,B.useComposedRefs)(a,p,l.onViewportChange),f=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),x=l.toastCount>0;i.useEffect(()=>{let e=e=>{0!==r.length&&r.every(t=>e[t]||e.code===t)&&p.current?.focus()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[r]),i.useEffect(()=>{let e=c.current,t=p.current;if(x&&e&&t){let a=()=>{if(!l.isClosePausedRef.current){let e=new CustomEvent(en);t.dispatchEvent(e),l.isClosePausedRef.current=!0}},s=()=>
1{if(l.isClosePausedRef.current){let e=new CustomEvent(eo);t.dispatchEvent(e),l.isClosePausedRef.current=!1}},r=t=>{e.contains(t.relatedTarget)||s()},i=()=>{e.contains(document.activeElement)||s()};return e.addEventListener("focusin",a),e.addEventListener("focusout",r),e.addEventListener("pointermove",a),e.addEventListener("pointerleave",i),window.addEventListener("blur",a),window.addEventListener("focus",s),()=>{e.removeEventListener("focusin",a),e.removeEventListener("focusout",r),e.removeEventListener("pointermove",a),e.removeEventListener("pointerleave",i),window.removeEventListener("blur",a),window.removeEventListener("focus",s)}}},[x,l.isClosePausedRef]);let g=i.useCallback(({tabbingDirection:e})=>{let t=d().map(t=>{let a=t.ref.current,s=[a,...function(e){let t=[],a=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;a.nextNode();)t.push(a.currentNode);return t}(a)];return"forwards"===e?s:s.reverse()});return("forwards"===e?t.reverse():t).flat()},[d]);return i.useEffect(()=>{let e=p.current;if(e){let t=t=>{let a=t.altKey||t.ctrlKey||t.metaKey;if("Tab"===t.key&&!a){let a=document.activeElement,s=t.shiftKey;if(t.target===e&&s)return void u.current?.focus();let r=g({tabbingDirection:s?"backwards":"forwards"}),i=r.findIndex(e=>e===a);eC(r.slice(i+1))?t.preventDefault():s?u.current?.focus():h.current?.focus()}};return e.addEventListener("keydown",t),()=>e.removeEventListener("keydown",t)}},[d,g]),(0,t.jsxs)(K.Branch,{ref:c,role:"region","aria-label":n.replace("{hotkey}",f),tabIndex:-1,style:{pointerEvents:x?void 0:"none"},children:[x&&(0,t.jsx)(ec,{ref:u,onFocusFromOutsideViewport:()=>{eC(g({tabbingDirection:"forwards"}))}}),(0,t.jsx)(Q.Slot,{scope:s,children:(0,t.jsx)(V.Primitive.ol,{tabIndex:-1,...o,ref:m})}),x&&(0,t.jsx)(ec,{ref:h,onFocusFromOutsideViewport:()=>{eC(g({tabbingDirection:"backwards"}))}})]})});el.displayName=er;var ed="ToastFocusProxy",ec=i.forwardRef((e,a)=>{let{__scopeToast:s,onFocusFromOutsideViewport:r,...i}=e,n=ea(ed,s);return(0,t.jsx)(W.VisuallyHidden,{tabIndex:0,...i,ref:a,style:{position:"fixed"},onFocus:e=>{let t=e.relatedTarget;n.viewport?.contains(t)||r()}})});ec.displayName=ed;var eu="Toast",eh=i.forwardRef((e,a)=>{let{forceMount:s,open:r,defaultOpen:i,onOpenChange:n,...o}=e,[l,d]=(0,q.useControllableState)({prop:r,defaultProp:i??!0,onChange:n,caller:eu});return(0,t.jsx)($.Presence,{present:s||l,children:(0,t.jsx)(ef,{open:l,...o,ref:a,onClose:()=>d(!1),onPause:(0,H.useCallbackRef)(e.onPause),onResume:(0,H.useCallbackRef)(e.onResume),onSwipeStart:(0,F.composeEventHandlers)(e.onSwipeStart,e=>{e.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:(0,F.composeEventHandlers)(e.onSwipeMove,e=>{let{x:t,y:a}=e.detail.delta;e.currentTarget.setAttribute("data-swipe","move"),e.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${t}px`),e.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${a}px`)}),onSwipeCancel:(0,F.composeEventHandlers)(e.onSwipeCancel,e=>{e.currentTarget.setAttribute("data-swipe","cancel"),e.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),e.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),e.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),e.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:(0,F.composeEventHandlers)(e.onSwipeEnd,e=>{let{x:t,y:a}=e.detail.delta;e.currentTarget.setAttribute("data-swipe","end"),e.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),e.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),e.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${t}px`),e.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${a}px`),d(!1)})})})});eh.displayName=eu;var[ep,em]=Z(eu,{onClose(){}}),ef=i.forwardRef((e,a)=>{let{__scopeToast:s,type:r="foreground",duration:n,open:o,onClose:l,onEscapeKeyDown:d,onPause:c,onResume:u,onSwipeStart:h,onSwipeMove:p,onSwipeCancel:m,onSwipeEnd:f,...x}=e,g=ea(eu,s),[y,b]=i.useState(null),v=(0,B.useComposedRefs)(a,e=>b(e)),w=i.useRef(null),j=i.useRef(null),k=n||g.duration,S=i.useRef(0),N=i.useRef(k),C=i.useRef(0),{onToastAdd:A,onToastRemove:I}=g,E=(0,H.useCallbackRef)(()=>{y?.contains(document.activeElement)&&g.viewport?.focus(),l()}),M=i.useCallback(e=>
1{e&&e!==1/0&&(window.clearTimeout(C.current),S.current=new Date().getTime(),C.current=window.setTimeout(E,e))},[E]);i.useEffect(()=>{let e=g.viewport;if(e){let t=()=>{M(N.current),u?.()},a=()=>{let e=new Date().getTime()-S.current;N.current=N.current-e,window.clearTimeout(C.current),c?.()};return e.addEventListener(en,a),e.addEventListener(eo,t),()=>{e.removeEventListener(en,a),e.removeEventListener(eo,t)}}},[g.viewport,k,c,u,M]),i.useEffect(()=>{o&&!g.isClosePausedRef.current&&M(k)},[o,k,g.isClosePausedRef,M]),i.useEffect(()=>(A(),()=>I()),[A,I]);let R=i.useMemo(()=>y?function e(t){let a=[];return Array.from(t.childNodes).forEach(t=>{var s;if(t.nodeType===t.TEXT_NODE&&t.textContent&&a.push(t.textContent),(s=t).nodeType===s.ELEMENT_NODE){let s=t.ariaHidden||t.hidden||"none"===t.style.display,r=""===t.dataset.radixToastAnnounceExclude;if(!s)if(r){let e=t.dataset.radixToastAnnounceAlt;e&&a.push(e)}else a.push(...e(t))}}),a}(y):null,[y]);return g.viewport?(0,t.jsxs)(t.Fragment,{children:[R&&(0,t.jsx)(ex,{__scopeToast:s,role:"status","aria-live":"foreground"===r?"assertive":"polite",children:R}),(0,t.jsx)(ep,{scope:s,onClose:E,children:O.createPortal((0,t.jsx)(Q.ItemSlot,{scope:s,children:(0,t.jsx)(K.Root,{asChild:!0,onEscapeKeyDown:(0,F.composeEventHandlers)(d,()=>{g.isFocusedToastEscapeKeyDownRef.current||E(),g.isFocusedToastEscapeKeyDownRef.current=!1}),children:(0,t.jsx)(V.Primitive.li,{tabIndex:0,"data-state":o?"open":"closed","data-swipe-direction":g.swipeDirection,...x,ref:v,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:(0,F.composeEventHandlers)(e.onKeyDown,e=>{"Escape"===e.key&&(d?.(e.nativeEvent),e.nativeEvent.defaultPrevented||(g.isFocusedToastEscapeKeyDownRef.current=!0,E()))}),onPointerDown:(0,F.composeEventHandlers)(e.onPointerDown,e=>{0===e.button&&(w.current={x:e.clientX,y:e.clientY})}),onPointerMove:(0,F.composeEventHandlers)(e.onPointerMove,e=>{if(!w.current)return;let t=e.clientX-w.current.x,a=e.clientY-w.current.y,s=!!j.current,r=["left","right"].includes(g.swipeDirection),i=["left","up"].includes(g.swipeDirection)?Math.min:Math.max,n=r?i(0,t):0,o=r?0:i(0,a),l="touch"===e.pointerType?10:2,d={x:n,y:o},c={originalEvent:e,delta:d};s?(j.current=d,eS("toast.swipeMove",p,c,{discrete:!1})):eN(d,g.swipeDirection,l)?(j.current=d,eS("toast.swipeStart",h,c,{discrete:!1}),e.target.setPointerCapture(e.pointerId)):(Math.abs(t)>l||Math.abs(a)>l)&&(w.current=null)}),onPointerUp:(0,F.composeEventHandlers)(e.onPointerUp,e=>{let t=j.current,a=e.target;if(a.hasPointerCapture(e.pointerId)&&a.releasePointerCapture(e.pointerId),j.current=null,w.current=null,t){let a=e.currentTarget,s={originalEvent:e,delta:t};eN(t,g.swipeDirection,g.swipeThreshold)?eS("toast.swipeEnd",f,s,{discrete:!0}):eS("toast.swipeCancel",m,s,{discrete:!0}),a.addEventListener("click",e=>e.preventDefault(),{once:!0})}})})})}),g.viewport)})]}):null}),ex=e=>{let{__scopeToast:a,children:s,...r}=e,n=ea(eu,a),[o,l]=i.useState(!1),[d,c]=i.useState(!1);return function(e=()=>{}){let t=(0,H.useCallbackRef)(e);(0,G.useLayoutEffect)(()=>{let e=0,a=0;return e=window.requestAnimationFrame(()=>a=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(e),window.cancelAnimationFrame(a)}},[t])}(()=>l(!0)),i.useEffect(()=>{let e=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(e)},[]),d?null:(0,t.jsx)(U.Portal,{asChild:!0,children:(0,t.jsx)(W.VisuallyHidden,{...r,children:o&&(0,t.jsxs)(t.Fragment,{children:[n.label," ",s]})})})},eg=i.forwardRef((e,a)=>{let{__scopeToast:s,...r}=e;return(0,t.jsx)(V.Primitive.div,{...r,ref:a})});eg.displayName="ToastTitle";var ey=i.forwardRef((e,a)=>{let{__scopeToast:s,...r}=e;return(0,t.jsx)(V.Primitive.div,{...r,ref:a})});ey.displayName="ToastDescription";var eb="ToastAction",ev=i.forwardRef((e,a)=>{let{altText:s,...r}=e;return s.trim()?(0,t.jsx)(ek,{altText:s,asChild:!0,children:(0,t.jsx)(ej,{...r,ref:a})}):(console.error(`Invalid prop \`altText\` supplied to \`${eb}\`. Expected non-empty \`string\`.`),null)});ev.displayName=eb;var ew="ToastClose",ej=i.forwardRef((e,a)=>{let{__scopeToast:s,...r}=e,i=em(ew,s);return(0,t.jsx)(ek,{asChild:!0,children:(0,t.jsx)(V.Primitive.button,{type:"button",...r,ref:a,onClick:(0,F.composeEventHandlers)(e.onClick,i.onClose)})})});ej.displayName=ew;var ek=i.forwardRef((e,a)=>{let{__scopeToast:s,altText:r,...i}=e;return(0,t.jsx)(V.Primitive.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...i,ref:a})});function eS(e,t,a,{discrete:s}){let r=a.originalEvent.currentTarget,i=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:a});t&&r.addEventListener(e,t,{once:!0}),s?(0,V.dispatchDiscreteCustomEvent)(r,i):r.dispatchEvent(i)}var eN=(e,t,a=0)=>{let s=Math.abs(e.x),r=Math.abs(e.y),i=s>r;return"left"===t||"right"===t?i&&s>a:!i&&r>a};function eC(e){let t=document.activeElement;return e.some(e=>e===t||(e.focus(),document.activeElement!==t))}var eA=e.i(37727);let eI=i.forwardRef(({className:e,...a},s)=>(0,t.jsx)(el,{ref:s,className:(0,p.cn)("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...a}));eI.displayName=el.displayName;let eE=(0,s.cva)("group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 pr-6 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),eM=i.forwardRef(({className:e,variant:a,...s},r)=>(0,t.jsx)(eh,{ref:r,className:(0,p.cn)(eE({variant:a}),e),...s}));eM.displayName=eh.displayName,i.forwardRef(({className:e,...a},s)=>(0,t.jsx)(ev,{ref:s,className:(0,p.cn)("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors hover:bg-secondary focus:outline-none focus:ring-1 focus:ring-ring disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...a})).displayName=ev.displayName;let eR=i.forwardRef(({className:e,...a},s)=>(0,t.jsx)(ej,{ref:s,className:(0,p.cn)("absolute right-1 top-1 rounded-md p-1 text-foreground
1/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-solid-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...a,children:(0,t.jsx)(eA.X,{className:"h-4 w-4"})}));eR.displayName=ej.displayName;let eP=i.forwardRef(({className:e,...a},s)=>(0,t.jsx)(eg,{ref:s,className:(0,p.cn)("text-sm font-semibold [&+div]:text-xs",e),...a}));eP.displayName=eg.displayName;let e_=i.forwardRef(({className:e,...a},s)=>(0,t.jsx)(ey,{ref:s,className:(0,p.cn)("text-sm opacity-90",e),...a}));e_.displayName=ey.displayName;var eD=e.i(908406);e.s(["Toaster",0,function(){let{toasts:e}=(0,eD.useToast)();return(0,t.jsxs)(es,{children:[e.map(function({id:e,title:a,description:s,action:r,...i}){return(0,t.jsxs)(eM,{...i,children:[(0,t.jsxs)("div",{className:"grid gap-1",children:[a&&(0,t.jsx)(eP,{children:a}),s&&(0,t.jsx)(e_,{children:s})]}),r,(0,t.jsx)(eR,{})]},e)}),(0,t.jsx)(eI,{})]})}],377855);var eT=e.i(618566),eO=e.i(557951),eF=e.i(161822);e.s(["useAuthCheck",0,(e=!0,t="/auth/signin")=>{let{user:a,loading:s}=(0,eO.useAuth)(),r=(0,eF.useAppSelector)(e=>e.user.user),n=(0,eT.useRouter)(),[o,l]=(0,i.useState)(!1),d=!!localStorage.getItem("firebaseIdToken"),c=!!(r&&r.uid),u=!!(a||c||d);return(0,i.useEffect)(()=>{if(!s)if(!e||u||o)u&&l(!0);else{let e=window.location.pathname;if(!e.includes("/auth")&&!e.startsWith("/media")&&"/"!==e){let a=function(e){let t=e.match(/^\/dashboard\/record\/([^/]+)\/([^/]+)\/([^/]+)\/?$/);if(t)return`/records/${t[1]}/${t[2]}/${t[3]}`;let a=e.match(/^\/dashboard\/company\/([^/]+)\/?$/);if(a)return`/companies/company/${a[1]}`;let s=e.match(/^\/dashboard\/office\/([^/]+)\/?$/);if(s)return`/offices/office/${s[1]}`;let r=e.match(/^\/dashboard\/(?:person|officer)\/([^/]+)\/?$/);return r?`/people/person/${r[1]}`:null}(e);if(a)n.replace(a);else{let a=encodeURIComponent(`${e}${window.location.search}`),s=t.includes("?")?"&":"?";n.replace(`${t}${s}redirect=${a}`)}}l(!0)}},[a,r,u,s,e,n,t,o]),{user:a||(c?r:null),loading:s,isAuthenticated:u}}],542724),e.s(["isBuyerEntitlementRoute",0,function(e){return!!e&&("/account/library"===e||e.startsWith("/account/library/")||e.startsWith("/dashboard/record/")||"/settings"===e||"/settings/connectors"===e)}],54340);let eB=(0,e.i(33550).default)("outline","message","Message",[["path",{d:"M8 9h8",key:"svg-0"}],["path",{d:"M8 13h6",key:"svg-1"}],["path",{d:"M18 4a3 3 0 0 1 3 3v8a3 3 0 0 1 -3 3h-5l-5 3v-3h-2a3 3 0 0 1 -3 -3v-8a3 3 0 0 1 3 -3h12",key:"svg-2"}]]);e.s(["IconMessage",0,eB],502913)},21218,e=>{"use strict";let t=(0,e.i(475254).default)("activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);e.s(["Activity",0,t],21218)},373264,e=>{"use strict";let t=(0,e.i(475254).default)("layout-grid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);e.s(["LayoutGrid",0,t],373264)},98919,e=>{"use strict";let t=(0,e.i(475254).default)("shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);e.s(["Shield",0,t],98919)},761911,e=>{"use strict";let t=(0,e.i(475254).default)("users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]]);e.s(["Users",0,t],761911)},248256,e=>{"use strict";let t=(0,e.i(475254).default)("globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);e.s(["Globe",0,t],248256)},694351,260289,707866,e=>{"use strict";var t=e.i(475254);let a=(0,t.default)("house",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]);e.s(["Home",0,a],694351);
1let s=(0,t.default)("layout-dashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);e.s(["LayoutDashboard",0,s],260289);let r=(0,t.default)("library",[["path",{d:"m16 6 4 14",key:"ji33uf"}],["path",{d:"M12 6v14",key:"1n7gus"}],["path",{d:"M8 8v12",key:"1gg7y9"}],["path",{d:"M4 4v16",key:"6qkkli"}]]);e.s(["Library",0,r],707866)},541071,e=>{"use strict";let t=(0,e.i(475254).default)("ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);e.s(["MoreHorizontal",0,t],541071)},68787,972518,799647,e=>{"use strict";var t=e.i(475254);let a=(0,t.default)("book-marked",[["path",{d:"M10 2v8l3-3 3 3V2",key:"sqw3rj"}],["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}]]);e.s(["BookMarked",0,a],68787);let s=(0,t.default)("panel-left-close",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]]);e.s(["PanelLeftClose",0,s],972518);let r=(0,t.default)("panel-left-open",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m14 9 3 3-3 3",key:"8010ee"}]]);e.s(["PanelLeftOpen",0,r],799647)},239616,e=>{"use strict";let t=(0,e.i(475254).default)("settings",[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);e.s(["Settings",0,t],239616)},824071,e=>{"use strict";let t=[{version:"V26.10.4",date:"October 7, 2026",items:[{description:"You can now create a KeyPedia account yourself with a work email and start right away.",subItems:["Sign up with Google, Microsoft or Okta, or with an email and password once you confirm your address.","New accounts can buy documents and manage their profile and settings from day one.","Personal email addresses such as Gmail can no longer be used to create a new account. Existing accounts are not affected."]},{description:"Connected apps under Settings no longer reports an expired session when you open it.",minor:!0}]},{version:"V26.10.3",date:"October 7, 2026",items:[{description:"KeyPedia now has a dark mode.",subItems:["It follows your device: a device set to dark mode opens KeyPedia in dark.","Switch any time with the sun and moon button at the top right.","Choose Light, Dark or Match my device under Settings â Appearance."]},{description:"Monitor the regulator sources your organization relies on.",subItems:["Paste an agency link or type a source name in the dashboard search bar, then choose Monitor.","Your monitored sources appear on Home and on the new Data sources page in the dashboard.","Request a source KeyPedia does not cover yet, and follow its status there.","Organization admins can choose whether members see each other's FOIA requests and saved searches."]},{description:"A question mark next to KRA, Search Risk and the risk tiers now explains what each score means, wherever they appear."},{description:'The "Ask a question in plain English" option is now first in the search dropdown.',minor:!0},{description:"Cleared filters stay cleared after a refresh or going back, and filters stay usable while results load.",minor:!0},{description:"Clicking the Risk Score box on the dashboard now opens the risk section of Analytics for your search, instead of a blank page.",minor:!0},{description:"Saving a search from Analytics confirms right away.",minor:!0},{description:"Signing up is simpler, with a note when you use a personal email address instead of a work one.",minor:!0},{description:"The privacy policy now covers the KeyPedia connector for AI assistants.",minor:!0}]},{version:"V26.10.2",date:"October 6, 2026",items:[{description:"Asking search a question in plain English now applies the matching filters for you.",subItems:['Type a question like "483s from Sanofi in 2025" and the matching record types, dates and companies are selected automatically.',"Common questions are understood instantly, without waiting on the AI, so the filters appear right away.","When part of a question cannot be matched, the rest still applies and your original text stays in the box."]},{description:"Keywords and your AI question now sit in the search rail with the other filters, and every filter you apply is listed in full just below it.",subItems:['Keywords show in full instead of being shortened with "â¦". Remove a single phrase or a whole group with its â.',"Edit and re-run an AI question from its own pill."]},{description:"When you search or filter, the dashboard now leads with the tables that match your whole search. Tables that skip one of your filters, or have no results, move lower."},{description:'Shared search links that open on Analytics or a profile page now show the search straight away, instead of "Nothing searched yet".',minor:!0},{description:"Guidance history shows one plain line per source when something has not been collected yet, and routine OMB paperwork notices no longer fill the timeline.",minor:!0},{description:"Fixed pages that sometimes opened blank or kept loading after a KeyPedia update; they now recover on their own.",minor:!0}]},{version:"V26.10.1",date:"October 1, 2026",items:[{description:"Company profiles now show the drug products behind a company, drawn from the FDA Orange Book, Drugs@FDA and the NDC directory.",subItems:["For a company with Orange Book products, the profile lists each product with its applications, their approval state and the role the company plays: holder, filer, labeler or litigant.","A timeline shows when each product's patent and exclusivity protection ends.","Each product links to its own report, with the companies and facilities behind the drug and their KRA."]},{description:"The Orange Book search has an All field that searches every column with one term."},{description:"Each US FDA guidance now appears once, with its earlier versions shown in its history.",subItems:["Guid
1ances that were listed two or three times are now a single row showing the newest version.","Expand a guidance to see its timeline, including earlier draft and final versions and the date each was issued.","Guidance counts and search results no longer include the duplicate entries."]},{description:"Settings â Connected apps now has step-by-step setup for Claude, Claude Code and Microsoft 365 Copilot.",minor:!0}]},{version:"V26.9.25",date:"September 25, 2026",items:[{description:"Connect your KeyPedia account to Claude, Claude Code and Microsoft Copilot, then search KeyPedia's datasets and quote documents from your assistant.",subItems:["Manage your connections under Settings â Connected apps: see each connected app, its access and recent usage, and disconnect it at any time."]}]},{version:"V26.9.22",date:"September 22, 2026",items:[{description:"The Observations tab in reports now shows observations from every matching document.",subItems:["Topic and keyword searches set to match any keyword were only showing observations from documents that contained all of them.","483s and Warning Letters without an inspection date now appear on the timeline, dated by their issue date."]},{description:"Fixed crashes when scrolling reports, company profiles, and Predictive."},{description:"Dossier exports are more reliable and easier to follow up on.",subItems:["Large dossier exports no longer fail to download.","The Metadata section now comes as the CSV files in the zip instead of pages in the PDF.","The records and observations CSV files end with a Record Link column that opens each record in KeyPedia."]},{description:"Fixed an error when opening some guidance documents; their issuing office now always displays."},{description:"Added a Media menu to the top navigation."},{description:"The platform overview walkthrough now steps through in the correct order.",minor:!0}]},{version:"V26.9.14",date:"September 14, 2026",items:[{description:"The dashboard loads faster and updates more smoothly.",subItems:["It loads the tables in view first and brings in the rest as you scroll, so results appear sooner.","Changing a filter now updates the tables in place instead of reloading the whole page, and no longer drops results that were already on their way.","Tables load a few at a time, so the page stays responsive while several are still filling in.","The records list loads lighter, pulling a record's full document text only when you open or export it."]},{description:"Signing in now takes you straight to your dashboard on the first try."},{description:"KeyPedia is easier to use on a phone.",subItems:["Every signed-in page now has a menu button, and the menu has larger tap targets and a clear close button.","KeyPedia AI chat history opens on phones again.","Dashboard search and filters take up less of the screen, result groups start collapsed, and region tabs scroll sideways.","Saved searches show the first six, with a Show all option for the rest."]},{description:"Analytics and dossier exports finish faster on broad searches.",subItems:["Analytics loads faster when a search covers many records, such as every 483 at once.","The AI summary, observation analysis, and knowledge graph now ask you to add a company, person, or office to the search instead of running on thousands of records.","The knowledge graph is now optional in exports. Tick it under Custom to include it."]},{description:"EAEU record types can now be searched from the All tab.",minor:!0},{description:"Report and profile CSV exports no longer include the Verified column.",minor:!0},{description:"The dashboard no longer shows the Saved-search risk changes card.",minor:!0}]},{version:"V26.9.10",date:"September 9, 2026",items:[{description:"The homepage is back to its previous headline, subtitle, and simple search box.",subItems:["Searching from the homepage opens KeyPedia Lite when signed out and KeyPedia AI when signed in, as before.","The Why KeyPedia comparison section no longer appears on the homepage."]}]},{version:"V26.9.9",date:"September 9, 2026",items:[{description:"The Inspection Date filter now applies to the US Records table.",subItems:["Narrowing by inspection date now filters the US Records list and its count, matching how the Inspections table already behaved.","The date pill drops the Added Date option, which had no effect on these records."]},{description:"The Media events map and calendar are more accurate.",subItems:["Events with no mapped location no longer snap to a phantom New York pin, so opening an event now stays on its real city.","The map reframes onto the events actually shown, including after a location or keyword search, instead of sitting on the whole-world view.","The map opens on upcoming events by default, so finished conferences no longer clutter it.","On the calendar, Today selects the current day and opens its panel, with a clear empty state when nothing is scheduled."]}]},{version:"V26.9.3",date:"September 8, 2026",items:[{description:"The landing page now starts with the live KeyPedia Lite search.",subItems:["Run a search directly in Lite before signing up, or carry the same search into your dashboard when signed in.","See how public evidence becomes connected profiles, saved searches and workflow-ready signals."]}
1,{description:"Document pages now make the value of full company profile access clear.",subItems:["Compare one source document with the connected records, sites, people, citations and enforcement history in a company profile.","Open the related company profile or ask about profile access from the document page."]},{description:"Saving a search is now a clearly labeled one-click action."}]},{version:"V26.9.2",date:"September 4, 2026",items:[{description:"FDA inspections can now be filtered and tagged by five new attributes.",subItems:["Filter the inspections list by Inspection Type (Domestic or Foreign), Announcement (Pre-Announced, Unannounced or Short Notice), Reason, Pre-Approval (PAI), and whether an FDA-483 was issued.","Pick several values in one dropdown to widen a filter, or combine dropdowns to narrow, and the list and its count update together.","Each inspection now shows these as colored tags, both in the table and on its detail page.","The Distribution and Chronological statistics panels respond to the same filters, so the charts narrow with your selection."]}]},{version:"V26.9.1",date:"September 3, 2026",items:[{description:"State Board of Pharmacy regulations added as a new record type.",subItems:["California, Arizona and Indiana pharmacy rules, each with its title, citation, status and effective date.","Search them by keyword, narrow them by state, and sort by the date each rule last changed.","Open a row for the full text, its change history, and links to the state's own documents."]},{description:"Your saved searches now come up in the main search bar.",subItems:["Type two letters and matching saved searches lead the suggestions, marked with a Saved badge; pick one and it applies.","Paste a shared search link into the bar and open it straight from there.","Save, Share and Export sit together in the header on the dashboard, Home and every profile."]},{description:"Managing saved searches on Home got a proper table.",subItems:["Rename, copy the link, stop sharing or delete a search from the row menu, and the row updates on the spot instead of reloading the whole list.","Search your saved searches by name or query text, with a live count of how many match.","A KeyPedia Risk Score column shows each search's tier, score and daily move, and you can filter the table by either.","The Archive page has moved into Settings, under Saved searches."]},{description:"The filter box has been rebuilt around what you have actually applied.",subItems:["An applied filter now stays on the pill rail in purple, reads back its value, and clears in one click.","The Record type filter shows how many records sit behind each option, and is sorted alphabetically with a type-to-find box.","Every long filter list gained a search box, select-all over what you filtered to, and a compact Selected list you can clear.","The Location filter now embeds the working map, and the radius slider no longer lags on large areas.",'Date filters accept plain typing such as "aug" or "jan 2 1997", with the calendar on a button beside the box.',"Duplicate CFR code chips fold into one row with a count, and the exact-match sweep no longer stops at the first page.",'Black text and borders throughout, purple focus rings and checkboxes, and "Search anything..." when nothing is filtered.',"Managing a company, office or person filter now happens inline in one panel instead of a page-covering popup, and offices and people can be saved as a group like companies already could."]},{description:"Every profile now reads as a report.",subItems:["People, companies, offices and citation codes all get the same numbered report: summary, risk, activity, findings and the record ledger.","A citation code page finally shows its part, section, type and definition, which appeared nowhere before.","A person profile gained a Co-inspectors tab covering everyone who shares a record with them, and every record those people authored.","When your search covers several companies or people, the report opens with a table of their facts rather than a stack of panels.","The old view is still one click away under Legacy."]},{description:"Download a full dossier of any report or profile.",subItems:["An executive brief comes back as a single PDF; a full or custom dossier comes back as a zip with the PDF and its data as CSV files.","The charts and the map now appear in the PDF exactly as they look on screen - the old export printed none of them.","Downloading also saves the search and stamps its share link on the cover, so the reader can open the live version."]},{description:"Export the inspections table to CSV.",subItems:["Take all columns or pick your own, up to 500 inspections per export, with a notice when your search is larger than that."]},{description:"One search bar across the public site, the dashboard and your document library.",subItems:["Public record search can now be scoped to a company, an office or a person, with a chip per scope you can clear independently.","Searching for a company, office or person returns the same matches on the public site as it does on the dashboard - the two used to disagree.","Your purchased documents are searchable from the dashboard bar and from your library page."]},{description:"Media hub search actually finds things now.",subItems:["Results filter as you type and are ranked by relevance, with typo tolerance and plain-English queries handled instead of returning nothing.","Desktop filters are consolidated into single dropdown pills, sort moved beside the result count with a Relevance option, and Date Range takes typed dates, presets or the calendar.","Article links now carry the article's own preview image, and the Ask-AI buttons name the piece properly."]},{description:"Every KeyPedia email has been rewritten.",subItems:["The Monday brief is rebuilt around your saved searches - activity by jurisdiction and record family, risk-score status and movement, and links to the profiles behind each match.","Welcome, trial, document store, FOIA and account emails all refreshed, with matching plain-text versions.","Fixed dark mode, Outlook and phone-width rendering, and stopped duplicate or contradictory lifecycle emails going out."]},{description:"A new homepage and a guided signup.",subItems:["The homepage wizard writes what you want to track, detect and integrate in your own words, and carries it into signup.","Signup is now three numbered steps, and the third opens in place after your account is made - no page jump, and it survives a reload.","Book your onboarding call from that step, with your name and email already filled in.","Sign-in greets you by state, remembers which method you last used, and password rules turn green as you satisfy them.","Live password checks, linked terms, and the newsletter signup moved into the footer."]},{description:"Speaking engagements now stand out in orange on the media calendar.",minor:!0},{description:"Fixed the keyword and violation code panel: the term you searched is no longer buried, and clicking a cell or a header now filters the dashboard instead of returning an empty table.",minor:!0},{description:'Removed the "Get exclusive updates!" popup from the home page.',minor:!0},{description:"Choose which assistant the Ask button opens, and which export shape it defaults to.",minor:!0},{description:"Global Key Solutions is now KeyPedia across the product; the legal entity keeps its name.",minor:!0},{description:"The Platform link and three old platform URLs no longer dead-end.",minor:!0}]},{version:"V26.8.3",date:"August 12, 2026",items:[{description:"Share a saved search with a link.",subItems:["
1Sharing is off until you turn it on, per search, and you can stop sharing at any time.","Anyone opening the link signs in first, then lands straight on your search."]},{description:"KeyPedia Risk Score (KRA) Score Re-design",subItems:["The risk panel on a company profile now reads in one glance: the tier, the score, and what is driving it sit side by side instead of stacked down the page","Full-contrast text throughout, darker driver indicators, and plainer wording","A site with no inspection or enforcement history now reads âNot enough dataâ instead of a low-risk score, so an empty record is never mistaken for a clean one","The search-level risk card on Predictive Insights gets the same redesign, with a matching âNo risk signalâ state for zero scores"]},{description:"Eurasian Economic Union (EAEU) data added",subItems:["Registrations, devices, quality monitoring and registry persons, with their own filters and record pages."]},{description:"Save and Share now sit together at the top of every search and profile."},{description:"Add every 503B facility we track to a saved search in one click."},{description:"A Saved column shows when you saved each search, and sorts by it."},{description:"The Monday digest only arrives when your saved searches had news that week."},{description:"Document shop upgrades to KeyPedia Lite."},{description:"Browsing a record type, such as 483s or warning letters, now takes about a second instead of up to half a minute."},{description:"Inspection details show whether an officer is from industry or an agency."},{description:"Fixed the Location filter, which had stopped suggesting places."},{description:"Fixed date filters returning the wrong day, and open-ended date ranges failing to load."},{description:"503B outsourcing facilities added as a company filter.",minor:!0},{description:"Records and company profiles show their KeyPedia ID.",minor:!0},{description:"Full UK MHRA documents and their attachments now require sign-in. Summaries stay public.",minor:!0},{description:"Refreshed the KeyPedia logo.",minor:!0}]},{version:"V26.8.2",date:"August 3, 2026",items:[{description:"One unified smart search across KeyPedia",subItems:["The public site now has the same type-ahead search as the dashboard, with suggestions for companies, people, offices and record types.","Search companies by FEI number.","Valisure, Orange Book and FOIA search bars upgraded to match."]},{description:"Record pages now show document titles.",minor:!0}]},{version:"V26.8.1",date:"August 2, 2026",items:[{description:"Saved searches now load instantly on Home",subItems:["Weekly per-search activity is precomputed in the background instead of recalculated on every page load","Requests can no longer hang indefinitely - clear error states replace endless loading"]},{description:"Weekly activity now covers every data source",subItems:['New "Other" column surfaces UK MHRA, China NMPA, EAEU, Orange Book, Canada and FDA guidance matches','"New this week" and the Monday email digest count all sources, so activity outside FDA/EU is never missed']}]},{version:"V26.7.6",date:"July 28, 2026",items:[{description:"Document store: guest checkout now works - buy a document without an account."},{description:"Media: newsletter subscribe options added to article and media pages."}]},{version:"V26.7.5",date:"July 23, 2026",items:[{description:"Sharable searches now available in KeyPedia."},{description:"All-Data results now hide the tables your filters can't touch.",subItems:["Apply a filter and the All-Data view collapses the data types that filter can't narrow, so you only see the tables it actually applies to.","Table order is now consistent between the All tab and the standalone tabs, and each table only claims the filters its own query really uses."]}]},{version:"V26.7.4",date:"July 14, 2026",items:[{description:"Search by GMP topic.",subItems:["Type a topic - Data Integrity, Contamination Control, Recall - and KeyPedia searches the whole cluster of related terms behind it, not just the words you typed.","Topics appear at the top of the search bar as you type, and apply instantly as a filter."]},{description:"Clearer names for saved searches.",subItems:["New saved searches now get a readable name automatically - the topic, company, or theme they cover - instead of a string of keywords.","You can still rename any search yourself; your name always wins."]},{description:"Inspections linked to 483s and warning letters directly in the record preview on the dashboard.",subItems:["Open a 483 or warning letter and the FDA inspection behind it - dates, officers and citations - sits right there in the record detail view."]},{description:"Newsfeed upgrades for company profiles."},{description:"Industry-associated pill filters added for people on records.",subItems:["An individual is marked as industry-associated only where the record confirms it - people we cannot confirm are left unmarked rather than shown as agency staff.","The same person could previously read as agency-associated in one view and industry-associated in another, depending on how the list was loaded. Both views now agree.","Person pills and the officer charts moved onto the GKS palette across records and statistics."]}]},{version:"V26.7.3",date:"July 13, 2026",items:[{description:"Riskbased / Device Data 1.0 is now a platform module.",subItems:["New Devices, MAUDE module in the sidebar and Product Suite, with the full Riskbased app table: MAUDE 3.5, AlphaSPIKE, AI Summary, AI Agents, Competitor Jux, Custom KPIs, FDA Audit AI, HHA Ideas, Recall Database, Meta Analysis, and Keyword Isolation.","Pick an app from the table and it loads right in the window."]},{description:"KeyPedia Lite: the free MAUDE explorer is now under Records.",subItems:["Find MAUDE with the other FDA record types on the Records page. The free explorer loads with no sign-in.","The rest of the Riskbased suite is previewed there with a one-click path to full access."]},{description:"Riskbased.ai is now a KeyPedia company.",subItems:["Read the press release [here](https://www.keypedia.com/media/riskbasedai).","Browse [riskbased.ai](https://www.riskbased.ai) and the [free MAUDE version](/records?type=maude).","Current Riskbased users: the Riskbased module is integrated under the Devices, MAUDE module.","Current KeyPedia and GKS users: all device and MAUDE data is available on your product, with MAUDE / Riskbased in the Product Suite and the More menu."]}]},{version:"V26.7.2",date:"July 2, 2026",items:[{description:"UK MHRA regulatory guidance is now on KeyPedia.",subItems:["Browse guidance under /records alongside every other record type.","Full detail pages for each guidance document, with source attachments you can open."]},{description:"UK MHRA Manufacturer's / Importer's Authorisations (MIA) added to the dashboard and records, including the manufacturing sites, roles, and statistics for each authorisation."},{description:"Home page refresh: a cleaner, search-first landing with your saved searches, suggested searches, and FOIA console up front."},{description:"Bulk-add companies to a filter: paste a list or upload a CSV to build a company filter in one step, with optional AI matching."},{description:"Valisure labelling refreshed to Drug Quality and Compliance Risk, plus the Q2 data batch."},{description:"Fixed: manufacturing-authorisation tables no longer carry stale results between filters;
1 guidance pages now use the correct share and SEO links."}]},{version:"V26.7.1",date:"July 1, 2026",items:[{description:"UK MHRA guidance content went live: guidance documents from gov.uk now populate across KeyPedia."}]},{version:"V26.6.9",date:"June 30, 2026",items:[{description:"Began ingesting UK MHRA regulatory guidance directly from gov.uk, feeding the new guidance library."}]},{version:"V26.6.8",date:"June 26, 2026",items:[{description:"Valisure 3.0: live regulatory risk score.",subItems:["The Valisure module now shows the real KRA v10 regulatory risk score inline, as a score circle, replacing the old record-count preview.","Wired into Formulary Compare, Manufacturers, and Company Profile; the score matches the dashboard exactly."]},{description:"UK MHRA GMP data added to the extraction pipeline."},{description:"Fixed: the homepage press-release banner now opens the live post instead of a broken link."}]},{version:"V26.6.7",date:"June 25, 2026",items:[{description:"Dashboard omni-search: one search box now covers every filter category (companies, record types, codes, and more), with a promoted Best match row for exact codes and Select all per category."},{description:"Faster keyword search: rebuilt to search document bodies directly for more relevant, quicker results."},{description:"Fixed: intermittent âno resultsâ on keyword + filter searches; the homepage âSee How It Worksâ banner now points to the Media library instead of a dead link."}]},{version:"V26.6.6",date:"June 24, 2026",items:[{description:"KeyPedia Risk Analysis (KRA v10) across the platform.",subItems:["A KRA Risk column in Saved Queries.","A risk indicator on the dashboard.","A full risk panel on /predictive: risk tier, percentile, red/yellow/green distribution, and an 18-month trend.","A KeyPedia Risk card on company profiles, plus supplier-list (cohort) risk."]},{description:"KeyPedia branding on share cards: links shared from keypedia.com now show the KeyPedia name and logo."},{description:"Fixed: background risk widgets can no longer sign you out if a single request hiccups."}]},{version:"V26.6.5",date:"June 19, 2026",items:[{description:"KeyPedia assistant refresh: a redesigned landing with suggestions tuned to what you can access, export any chat to PDF, and search / rename in your chat history."},{description:"Database results now hide internal ID columns and add one-click View in dashboard from any result."}]},{version:"V26.6.4",date:"June 15, 2026",items:[{description:"KeyPedia Brand V2 rolled out across the platform: new logos, sub-brand lockups, PDF exports, and emails."},{description:"Talk to AI on any record: open a record straight into ChatGPT, Microsoft Copilot, Claude, or Perplexity for a second opinion."},{description:"The Media library is now branded KeyPedia Media."}]},{version:"V26.6.3",date:"June 12, 2026",items:[{description:"We moved home to keypedia.com: the public platform now lives at www.keypedia.com. Same platform, new address."}]},{version:"V26.6.2",date:"June 11, 2026",items:[{description:"Predictive risk score (KRA V9): the Predictive panel now shows a Legacy vs. V9 risk split, with a V9 probability line on timeline charts. Available to every signed-in user."},{description:"FOIA âMy Requestsâ improvements: sortable columns, a denser layout, copyable request IDs, and combined multi-document search."}]},{version:"V26.6.1",date:"June 5, 2026",items:[{description:"Data Trends now has an APIs & Feeds section showing where our data comes from, with clearer acquisition labels and a multi-select filter."}]},{version:"V26.5.5",date:"May 28, 2026",items:[{description:"Suggested saved searches on the dashboard home: save popular searches with one click."},{description:"AI-named saved searches: the platform suggests a clear name for searches you save from AI queries."},{description:"New dashboard sidebar: a cleaner, collapsible navigation (More / Valisure / KeyPedia)."},{description:"People shown as pills on US inspections, so agency- vs. industry-associated contacts read at a glance."}]},{version:"V26.5.4",date:"May 23, 2026",items:[{description:"Valisure Formulary Compare now shows live regulatory record counts with deep links straight into the dashboard, instead of a placeholder."},{description:"Public company and record pages read cleaner: better narrative summaries and no more âUnknown Dateâ in titles."}]},{version:"V26.5.3",date:"May 22, 2026",items:[{description:"Began collecting UK MHRA GMP inspection data, laying the groundwork for the UK jurisdiction."}]},{version:"V26.5.2",date:"May 19, 2026",items:[{description:"UK MHRA filters on the dashboard: filter by certificate number,
1certificate type, compliance status, and country, with multi-select pills."},{description:"Smarter dashboard results: groups reorder by count after you apply a filter, and groups that don't match a filter are hidden instead of showing unfiltered rows."},{description:"/predictive is fast now: the page went from a ~70-second freeze to loading smoothly, even with large observation sets."},{description:"Fixed: China product-recall counts now respect the company filter."}]},{version:"V26.5.1",date:"May 6, 2026",items:[{description:"Document Store launched: browse, add to cart, and purchase individual regulatory documents, with a proper checkout and order history."}]},{version:"V26.4.7",date:"April 28, 2026",items:[{description:"Chrome extension sign-in hardening: smoother, more secure login for the browser extension."},{description:"Added inspected-establishment type detail to FDA 483 records."}]},{version:"V26.4.6",date:"April 27, 2026",items:[{description:"United Kingdom (MHRA) added as the 6th jurisdiction: UK MHRA GMP inspections are now searchable end-to-end across the dashboard, record detail, and statistics, and the assistant now understands UK / MHRA questions."}]},{version:"V26.4.5",date:"April 16, 2026",items:[{description:"Career page fixes and improved data quality on inspection officers (better name matching and normalization)."}]},{version:"V26.4.4",date:"April 15, 2026",items:[{description:"Pick your own chart colors on the analysis charts."},{description:"Deactivation emails: if an org admin deactivates your account, you now get an email with your group admin's contact details."},{description:"User management cleanup: search waits until you stop typing, with a better layout on smaller screens."},{description:"Media pages print properly: open an article, hit print, and it looks like a real document."},{description:"Distribution Analysis: pin-to-filter: pin entities from your results and use them as a new filter, for second-degree searches without starting over."},{description:"Chronological Analysis: cleaner colors, smarter default date ranges, and more accurate inspection analytics."}]},{version:"V26.4.3",date:"April 13, 2026",items:[{description:"Fixed: resolved a login failure caused by a cache-memory error."}]},{version:"V26.4.2",date:"April 8, 2026",items:[{description:"FDA Complete Response Letters (CRLs) added, including the source PDFs: a new document type in the platform."}]},{version:"V26.4.1",date:"April 3, 2026",items:[{description:"China (NMPA) regulatory data expanded in the Knowledge Graph, including drug inspections and product recalls."},{description:"Predictive Risk and Keyword Coverage dashboards enhanced with better analytics."},{description:"Feedback routing: contact and feedback forms now reach the team instantly, with faster responses."},{description:"User status audit dashboard for admins (activity stats, charts, access overview)."},{description:"General bug fixes and stability improvements."}]},{version:"V26.3.9",date:"March 27, 2026",items:[{description:"Round of bug fixes and stability improvements; fixed empty China drug-inspection summaries."}]},{version:"V26.3.8",date:"March 23, 2026",items:[{description:"Automatic translation of foreign-language regulatory PDFs: non-English documents are now translated during processing, so more content is searchable."}]},{version:"V26.3.7",date:"March 20, 2026",items:[{description:"Predictive Risk & Keyword Coverage enhancements."},{description:"Fixed: restored the KeyPedia assistant after a dependency issue."}]},{version:"V26.3.6",date:"March 13, 2026",items:[{description:"Fixed: resolved a login bug and an expired-user sign-in bug."}]},{version:"V26.3.5",date:"March 11, 2026",items:[{description:"UK MHRA Drug Safety Updates & Drug/Device Alerts added: UK safety communications are now tracked."}]},{version:"V26.3.4",date:"March 6, 2026",items:[{description:"Demo scheduling calendar: book a demo directly from the site."}]},{version:"V26.3.3",date:"March 5, 2026",items:[{description:"Filled in missing US inspection citations for more complete records."}]},{version:"V26.3.2",date:"March 4, 2026",items:[{description:"Faster statistics: stats queries are now cached per session for quicker loads."},{description:"Fixed: you're no longer shown as logged out after leaving a tab in the background too long; fixed a sign-out caused by a stale login cookie."}]},{version:"V26.3.1",date:"March 1, 2026",items:[{description:"People on records are color-coded by role: agency-associated personnel appear as filled purple pills and industry contacts as outlined pills, with a legend on both the records table and the statistics charts."}]},{version:"V26.2.6",date:"February 19, 2026",items:[{description:"Single sign-on (OKTA SSO) support."},{description:"Calendar view for regulatory events."},{description:"Company Map rebuilt on Google Maps."},{description:"Predictive Risk Dashboard with linked observation counts."},{description:"Org management: sortable columns, cumulative active-user counts, and a status filter."},{description:"Faster load times from stats-query caching; cross-page and client-side column sorting."}]},{version:"V26.2.5",date:"February 13, 2026",items:[{description:"Fixed: company page no longer fails to load; multi-keyword search in Chronological Analysis fixed."}]},{version:"V26.2.4",date:"February 12, 2026",items:[{description:"Fixed: the country filter buttons now work correctly."},{description:"Standardized country names and cleaned up dashboard tab labels."},{description:"Brazil dataset updates."}]},{version:"V26.2.3",date:"February 11, 2026",items:[{description:"Auth and user-management improvements across sign-in and SSO flows."}]},{version:"V26.2.2",date:"February 8, 2026",items:[{description:"Save searches in KeyPedia, plus improvements to AI search."},{description:"Fixed: resolved a chatbot and saved-searches issue."}]},{version:"V26.2.1",date:"February 6, 2026",items:[{description:"Fixed: admins can once again manage other users in their organization."}]},{version:"V26.1.1",date:"January 27, 2026",items:[{description:"KeyPedia 2026.01 release: platform-wide improvements and the start of the 2026 line."}]},{version:"V25.12.0",date:"December 2025",items:[{description:"Predictive Insights v1.0 added to the dashboard."},{description:"Export for people, companies, and codes."},{description:"Orange Book products added to the dashboard."},{description:"Business Types added to company filters."},{description:"Full-Year option in the FOIA Manager."},{description:"Orange Book UI fixes."}]},{version:"V25.11.0",date:"November 2025",items:[{description:"Brazil GMP Certificates added."},{description:"Canada Drug Inspection Reports added."},{description:"China (NMPA) unannounced inspections and product recalls added."},{description:"Redesigned dashboard, company profile, and sidebar."},{description:"KeyPedia now reaches everything in the dashboard."},{description:"Guidance excerpts shown on the canvas."}]},{version:"V25.10.0",date:"October 2025",items:[{description:"Refreshed home page UI."},{description:"New header, footer, privacy, and terms pages."},{description:"Single sign-on, user groups, and subscriptions."},{description:"Chatbot improvements and bug fixes."}]},{version:"V25.9.0",date:"September 2025",items:[{description:"KeyPedia Agent launched."},{description:"Guidances and EMA records added to the dashboard."},{description:"Overall bug fixes and stability improvements."}]},{version:"V25.8.0",date:"August 2025",items:[{description:"Knowledge Graph and Careers page launched."},{description:"Experts page rebuilt."},{description:"AI search improvements."}]},{version:"V25.7.0",date:"July 2025",items:[{description:"AI-powered search & filter with natural-language queries."},{description:"In-house Blog launched."},{description:"Faster page loads across the platform."}]},{version:"V25.6.0",date:"June 2025",items:[{description:"New person view with more statistics."},{description:"New Chronological Analysis and Keyword-Violation Code Correlation charts."},{description:"Adjustable chart brush position; separate start/end date pickers."}]}];
1e.s(["formatPatchNoteVersion",0,function(e){return`${e.version} \xb7 ${e.date}`},"getAllPatchNotes",0,function(){return t},"getLatestPatchNote",0,function(){return t.length>0?t[0]:null}])},651226,e=>{"use strict";let t={src:e.i(714076).default,width:1782,height:458,blurWidth:0,blurHeight:0};e.s(["default",0,t])},832350,e=>{"use strict";let t={src:e.i(812910).default,width:200,height:200,blurWidth:8,blurHeight:8,blurDataURL:"data:image/jpeg;base64,/9j/4AAQSkZJRgABAgAAAQABAAD/wAARCAAIAAgDAREAAhEBAxEB/9sAQwAKBwcIBwYKCAgICwoKCw4YEA4NDQ4dFRYRGCMfJSQiHyIhJis3LyYpNCkhIjBBMTQ5Oz4+PiUuRElDPEg3PT47/9sAQwEKCwsODQ4cEBAcOygiKDs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwD0r/iY/wBsfZ9s+37R5vn5/d+Tj7vpndxj05q9LXI1vY//2Q=="};e.s(["default",0,t])},755838,(e,t,a)=>{"use strict";var s=e.r(271645),r="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},i=s.useState,n=s.useEffect,o=s.useLayoutEffect,l=s.useDebugValue;function d(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!r(e,a)}catch(e){return!0}}var c="u"<typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var a=t(),s=i({inst:{value:a,getSnapshot:t}}),r=s[0].inst,c=s[1];return o(function(){r.value=a,r.getSnapshot=t,d(r)&&c({inst:r})},[e,a,t]),n(function(){return d(r)&&c({inst:r}),e(function(){d(r)&&c({inst:r})})},[e]),l(a),a};a.useSyncExternalStore=void 0!==s.useSyncExternalStore?s.useSyncExternalStore:c},802239,(e,t,a)=>{"use strict";t.exports=e.r(755838)},510728,605173,799676,e=>{"use strict";let t={src:e.i(554071).default,width:144,height:144,blurWidth:0,blurHeight:0};e.s(["default",0,t],510728);let a={src:e.i(328762).default,width:256,height:212,blurWidth:8,blurHeight:7,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAHCAYAAAA1WQxeAAAA60lEQVR42g3LPUsCYQDA8T/n4T2Kb1zdC5QNEdTWIkFDECVCDc3dEEJRQxBtUhjUcpUtBWERFdoS5XEgIqjDIQ4Hem6K30c/wI9rcMqExh8owSXKo4XI/6H2OhjjKrpDCcnfRMoVUJ7viH5VSXk3JO1tIjstFn0KyJULwg8VYsE68sYuYr+JGVyhFv9ZqLOHbL0T7R4iTjSkeZOQdkbytEO6e0TK4olI4xxxW0MdZmc6g8h4pAcldPuXpR8+iflbhLNFEraD4ZUxvt8wXw9I5Aas+rwQdxvMjVz03jHxvI1232c5mLA2arPiTgHHOT93njn+XwAAAABJRU5ErkJggg=="};e.s(["default",0,a],605173);var s=e.i(843476),r=e.i(271645),i=e.i(30207),n=e.i(934620);e.i(174080);var o=e.i(991918),l=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let a=(0,o.createSlot)(`Primitive.${t}`),i=r.forwardRef((e,r)=>{let{asChild:i,...n}=e;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,s.jsx)(i?a:t,{...n,ref:r})});return i.displayName=`Primitive.${t}`,{...e,[t]:i}},{}),d=e.i(802239);function c(){return()=>{}}var u="Avatar",[h,p]=function(e,t=[]){let a=[],i=()=>{let t=a.map(e=>r.createContext(e));return function(a){let s=a?.[e]||t;return r.useMemo(()=>({[`__scope${e}`]:{...a,[e]:s}}),[a,s])}};return i.scopeName=e,[function(t,i){let n=r.createContext(i);n.displayName=t+"Context";let o=a.length;a=[...a,i];let l=t=>{let{scope:a,children:i,...l}=t,d=a?.[e]?.[o]||n,c=r.useMemo(()=>l,Object.values(l));return(0,s.jsx)(d.Provider,{value:c,children:i})};return l.displayName=t+"Provider",[l,function(a,s){let l=s?.[e]?.[o]||n,d=r.useContext(l);if(d)return d;if(void 0!==i)return i;throw Error(`\`${a}\` must be used within \`${t}\``)}]},function(...e){let t=e[0];if(1===e.length)return t;let a=()=>{let a=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let s=a.reduce((t,{useScope:a,scopeName:s})=>{let r=a(e)[`__scope${s}`];return{...t,...r}},{});return r.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return a.scopeName=t.scopeName,a}(i,...t)]}(u),[m,f]=h(u),x=r.forwardRef((e,t)=>
1{let{__scopeAvatar:a,...i}=e,[n,o]=r.useState("idle");return(0,s.jsx)(m,{scope:a,imageLoadingStatus:n,onImageLoadingStatusChange:o,children:(0,s.jsx)(l.span,{...i,ref:t})})});x.displayName=u;var g="AvatarImage",y=r.forwardRef((e,t)=>{let{__scopeAvatar:a,src:o,onLoadingStatusChange:u=()=>{},...h}=e,p=f(g,a),m=function(e,{referrerPolicy:t,crossOrigin:a}){let s=(0,d.useSyncExternalStore)(c,()=>!0,()=>!1),i=r.useRef(null),o=s?(i.current||(i.current=new window.Image),i.current):null,[l,u]=r.useState(()=>w(o,e));return(0,n.useLayoutEffect)(()=>{u(w(o,e))},[o,e]),(0,n.useLayoutEffect)(()=>{let e=e=>()=>{u(e)};if(!o)return;let s=e("loaded"),r=e("error");return o.addEventListener("load",s),o.addEventListener("error",r),t&&(o.referrerPolicy=t),"string"==typeof a&&(o.crossOrigin=a),()=>{o.removeEventListener("load",s),o.removeEventListener("error",r)}},[o,a,t]),l}(o,h),x=(0,i.useCallbackRef)(e=>{u(e),p.onImageLoadingStatusChange(e)});return(0,n.useLayoutEffect)(()=>{"idle"!==m&&x(m)},[m,x]),"loaded"===m?(0,s.jsx)(l.img,{...h,ref:t,src:o}):null});y.displayName=g;var b="AvatarFallback",v=r.forwardRef((e,t)=>{let{__scopeAvatar:a,delayMs:i,...n}=e,o=f(b,a),[d,c]=r.useState(void 0===i);return r.useEffect(()=>{if(void 0!==i){let e=window.setTimeout(()=>c(!0),i);return()=>window.clearTimeout(e)}},[i]),d&&"loaded"!==o.imageLoadingStatus?(0,s.jsx)(l.span,{...n,ref:t}):null});function w(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}v.displayName=b;var j=e.i(975157);let k=r.forwardRef(({className:e,...t},a)=>(0,s.jsx)(x,{ref:a,className:(0,j.cn)("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));k.displayName=x.displayName;let S=r.forwardRef(({className:e,...t},a)=>(0,s.jsx)(y,{ref:a,className:(0,j.cn)("aspect-square h-full w-full",e),...t}));S.displayName=y.displayName;let N=r.forwardRef(({className:e,...t},a)=>(0,s.jsx)(v,{ref:a,className:(0,j.cn)("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));N.displayName=v.displayName,e.s(["Avatar",0,k,"AvatarFallback",0,N,"AvatarImage",0,S],799676)},357662,e=>{"use strict";let t=(0,e.i(33550).default)("outline","trash","Trash",[["path",{d:"M4 7l16 0",key:"svg-0"}],["path",{d:"M10 11l0 6",key:"svg-1"}],["path",{d:"M14 11l0 6",key:"svg-2"}],["path",{d:"M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12",key:"svg-3"}],["path",{d:"M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3",key:"svg-4"}]]);e.s(["IconTrash",0,t],357662)},387890,e=>{"use strict";let t=(0,e.i(33550).default)("outline","clock","Clock",[["path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0",key:"svg-0"}],["path",{d:"M12 7v5l3 3",key:"svg-1"}]]);e.s(["IconClock",0,t],387890)},511936,457162,e=>{"use strict";e.i(247167);var t=e.i(843476),a=e.i(502913),s=e.i(357662),r=e.i(387890),i=e.i(348239),n=e.i(617708),o=e.i(102761),l=e.i(354534),d=e.i(343277),c=e.i(357772),u=e.i(848719);let h=(0,e.i(33550).default)("outline","pencil","Pencil",[["path",{d:"M4 20h4l10.5 -10.5a2.828 2.828 0 1 0 -4 -4l-10.5 10.5v4",key:"svg-0"}],["path",{d:"M13.5 6.5l4 4",key:"svg-1"}]]);e.s(["IconPencil",0,h],457162);var p=e.i(618566),m=e.i(271645),f=e.i(261238),x=e.i(519455),g=e.i(776639),y=e.i(755146),b=e.i(793479),v=e.i(530909),w=e.i(557951),j=e.i(414877),k=e.i(908406),S=e.i(975157),N=e.i(161822),C=e.i(915253),A=e.i(890357);e.s(["default",0,({onChatSelect:e,onNewChat:I,isHovered:E,onMouseEnter:M,onMouseLeave:R,onClose:P,isMobile:_,onRef:D})=>{let T=(0,N.useAppDispatch)(),{toast:O}=(0,k.useToast)(),{user:F}=(0,w.useAuth)(),B=(0,N.useAppSelector)(e=>e.user.user),L=F?.id||B?.id,{state:z}=(0,v.useSidebar)(),K=_??(0,j.useIsMobile)(),[U,$]=(0,m.useState)(!1),V=(0,m.useRef)(null),H=(0,m.useRef)(null);(0,m.useEffect)(()=>{D&&V.current&&D(V.current)},[D]);let q=void 0!==E?E:U,{chatHistory:G,currentChatId:W,isLoadingHistory:Y,loadingChatIds:Q,streamingStates:J={}}=(0,N.useAppSelector)(e=>e.chat),[X,Z]=(0,m.useState)(!1),[ee,et]=(0,m.useState)(null),[ea,es]=(0,m.useState)(!1),[er,ei]=(0,m.useState)(null),[en,eo]=(0,m.useState)(""),[el,ed]=(0,m.useState)(!1),[ec,eu]=(0,m.useState)(""),[eh,ep]=(0,m.useState)(!1),[em,ef]=(0,m.useState)(!1),ex=(0,p.useRouter)();(0,m.useEffect)(()=>()=>{H.current&&clearTimeout(H.current)},[]),(0,m.useEffect)(()=>{(async()=>
1{if(L&&!eh&&!Y&&!(G.length>0)){ep(!0),T(C.actions.chat.setLoadingHistory(!0));try{let e=await (0,f.fetchData)("https://gksc-prod-backend-290557432249.us-east1.run.app/api/chatbot/history/","POST",{user_id:L});if(e&&Array.isArray(e)){let t=e.map(e=>({...e,is_favorite:e.favorite_chat||e.is_favorite||!1})),a=A.store.getState().chat.chatHistory,s=new Set(t.map(e=>e.id)),r=a.filter(e=>!s.has(e.id));T(C.actions.chat.setChatHistory([...r,...t]))}}catch(e){console.error("Failed to fetch chat history:",e)}finally{T(C.actions.chat.setLoadingHistory(!1))}}})()},[L,T,Y,eh,G.length]),(0,m.useEffect)(()=>{ep(!1)},[L]);let eg=async e=>{if(ee)try{await (0,f.fetchData)(`https://gksc-prod-backend-290557432249.us-east1.run.app/api/chatbot/history/${ee.id}/`,"DELETE"),T(C.actions.chat.removeChatFromHistory(ee.id)),W===ee.id&&ex.push("/keypedia")}catch(e){console.error("Failed to delete chat:",e)}finally{Z(!1),et(null)}},ey=async()=>{if(!er)return;let e=en.trim();if(!e||e===er.title){es(!1),ei(null);return}let t=er.title;ed(!0),T(C.actions.chat.updateChatInHistory({chatId:er.id,updates:{title:e}}));try{await (0,f.fetchData)("https://gksc-prod-backend-290557432249.us-east1.run.app/api/chatbot/history/save/","POST",{id:er.id,user_id:L,title:e}),es(!1),ei(null)}catch(e){console.error("Failed to rename chat:",e),T(C.actions.chat.updateChatInHistory({chatId:er.id,updates:{title:t}})),O({title:"Failed to rename chat",description:"Please try again later.",variant:"destructive"})}finally{ed(!1)}},eb=async(e,t)=>{t.stopPropagation(),T(C.actions.chat.toggleChatFavorite(e.id));try{await (0,f.fetchData)(`https://gksc-prod-backend-290557432249.us-east1.run.app/api/chatbot/history/${e.id}/favorite/`,"POST",{is_favorite:!e.is_favorite,user_id:L})}catch(t){console.error("Failed to toggle favorite:",t),T(C.actions.chat.toggleChatFavorite(e.id)),O({title:"Failed to update favorite",description:"Please try again later.",variant:"destructive"})}},ev=ec.trim().toLowerCase(),ew=[...G.filter(e=>{if(em&&!e.is_favorite)return!1;if(!ev)return!0;let t=(e.title||"").toLowerCase(),a=(e.last_message?.text||"").toLowerCase();return t.includes(ev)||a.includes(ev)})].sort((e,t)=>{let a=new Date(e.updated_at||e.created_at).getTime();return new Date(t.updated_at||t.created_at).getTime()-a});return(0,t.jsxs)(t.Fragment,{children:[K&&q&&(0,t.jsx)("button",{type:"button","aria-label":"Close chat history",className:"fixed inset-0 z-[59] bg-black/50",onClick:P}),(0,t.jsx)("div",{className:(0,S.cn)("fixed top-0 h-full bg-sidebar border-r border-sidebar-border z-[60] transition-all duration-200 ease-in-out text-sidebar-foreground",K?"w-[85vw] max-w-sm":"w-80",q?"opacity-100 translate-x-0 pointer-events-auto":"opacity-0 translate-x-[-100%] pointer-events-none"),style:{left:K?"0":"collapsed"===z?"3.9rem":"11.8rem",transition:"opacity 200ms ease-in-out, transform 200ms ease-in-out",marginLeft:"0"},ref:V,role:K?"dialog":void 0,"aria-modal":!!K&&!!q||void 0,"aria-label":"Chat history",onMouseEnter:K?void 0:e=>{H.current&&(clearTimeout(H.current),H.current=null),M?M():$(!0)},onMouseLeave:K?void 0:e=>{let t=e?.relatedTarget;if(t&&t instanceof Node){let e=V.current?.contains(t),a=t.closest('[data-sidebar="menu-item"]')?.classList.contains("group/chat-history");if(e||a){H.current&&(clearTimeout(H.current),H.current=null);return}}H.current=setTimeout(()=>{e&&requestAnimationFrame(()=>{let t=document.elementFromPoint(e.clientX,e.clientY);if(!t)return void(R?R():$(!1));let a=V.current;a?.contains(t)||t.closest('[data-sidebar="menu-item"]')?.classList.contains("group/chat-history")||null!==t.closest(".group\\/chat-history")||(R?R():$(!1))})},400)},onMouseMove:K?void 0:()=>{H.current&&(clearTimeout(H.current),H.current=null)},onClick:K?e=>e.stopPropagation():void 0,children:(0,t.jsxs)("div",{className:"flex h-full flex-col overflow-hidden",children:[(0,t.jsx)("div",{className:"border-sidebar-border flex-shrink-0 border-b p-4",children:(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:"flex h-6 w-6 items-center justify-center rounded-lg bg-gradient-to-r from-blue-500 to-indigo-500",children:(0,t.jsx)(a.IconMessage,{size:14,className:"text-white"})}),(0,t.jsx)("h3",{className:"text-sm font-semibold",children:"Chat History"})]}),(0,t.jsx)(x.Button,{variant:"ghost",size:"icon",onClick:P,className:"h-11 w-11 md:h-8 md:w-8","aria-label":"Close chat history",children:(0,t.jsx)(c.IconX,{size:18,className:"text-sidebar-foreground"})})]})}),(0,t.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col overflow-y-auto",children:[(0,t.jsxs)("div",{className:(0,S.cn)("flex-shrink-0 border-b border-sidebar-border",K?"p-2 space-y-2":"p-3 space-y-3"),children:[(0,t.jsxs)(x.Button,{variant:"outline",onClick:I,className:(0,S.cn)("w-full justify-start bg-sidebar-accent border-sidebar-border hover:bg-sidebar-accent text-sidebar-accent-foreground font-medium transition-all duration-200 shadow-sm hover:shadow-md","h-11 text-sm"),children:[(0,t.jsx)("div",{className:"mr-3 flex h-5 w-5 items-center justify-center rounded-md bg-gradient-to-r from-blue-500 to-indigo-500",children:(0,t.jsx)(n.IconPlus,{size:14,className:"text-white"})}),"New Chat"]}),(0,t.jsxs)(x.Button,{variant:em?"default":"outline",onClick:()=>ef(!em),className:(0,S.cn)("w-full justify-start font-medium transition-all duration-200","h-11 text-sm md:h-10",em?"bg-gradient-to-r from-yellow-500 to-amber-500 hover:from-solid-yellow-600 hover:to-solid-amber-600 text-white border-yellow-400":"bg-sidebar-accent border-sidebar-border hover:border-sidebar-border text-sidebar-foreground hover:bg-sidebar-accent"),children:[(0,t.jsx)(d.IconFilter,{size:16,className:"mr-2"}
1),em?"Show All":"Favorites Only"]}),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(u.IconSearch,{size:16,className:"text-sidebar-foreground/50 pointer-events-none absolute left-3 top-1/2 -translate-y-1/2"}),(0,t.jsx)(b.Input,{type:"text",value:ec,onChange:e=>eu(e.target.value),placeholder:em?"Search favorites...":"Search chats...",className:(0,S.cn)("bg-sidebar-accent border-sidebar-border text-sidebar-foreground pl-9 pr-9","h-11 text-sm md:h-10")}),ec&&(0,t.jsx)(x.Button,{size:"icon",variant:"ghost",onClick:()=>eu(""),className:"hover:bg-sidebar-accent absolute right-0 top-1/2 h-11 w-11 -translate-y-1/2 md:right-1 md:h-7 md:w-7","aria-label":"Clear chat history search",children:(0,t.jsx)(c.IconX,{size:14,className:"text-sidebar-foreground/70"})})]})]}),Y?(0,t.jsxs)("div",{className:"p-6 text-center",children:[(0,t.jsx)("div",{className:"mx-auto mb-3 flex h-8 w-8 items-center justify-center rounded-xl bg-gradient-to-r from-blue-500 to-indigo-500",children:(0,t.jsx)("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-white border-t-transparent"})}),(0,t.jsx)("p",{className:"text-sidebar-foreground text-sm font-medium",children:"Loading history..."})]}):0===ew.length?(0,t.jsxs)("div",{className:"p-6 text-center",children:[(0,t.jsx)("div",{className:"bg-sidebar-accent mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-2xl",children:(0,t.jsx)(a.IconMessage,{size:20,className:"text-sidebar-foreground/50"})}),(0,t.jsx)("p",{className:"text-sidebar-foreground mb-1 text-sm font-medium",children:ev?"No matching chats":em?"No favorite chats yet":"No chat history yet"}),(0,t.jsx)("p",{className:"text-sidebar-foreground/70 text-xs",children:ev?em?"Try searching all chats":"Try a different search term":em?"Star some conversations to see them here":"Start a new conversation to see it here"})]}):(0,t.jsx)("div",{className:(0,S.cn)("space-y-2",K?"p-2":"p-3"),children:ew.map(n=>{let d,c,u,p=Q.includes(n.id),m=J&&J[n.id]?.isStreaming||!1;return(0,t.jsx)("div",{onClick:()=>{e(n),P?.()},onKeyDown:t=>{t.target.closest("button")||("Enter"===t.key||" "===t.key)&&(t.preventDefault(),e(n),P?.())},role:"button",tabIndex:0,className:(0,S.cn)("group min-h-11 cursor-pointer rounded-xl border transition-all duration-200 focus-visible:ring-2 focus-visible:ring-sidebar-ring focus-visible:outline-none",K?"p-3":"p-4",W===n.id?"bg-sidebar-accent border-sidebar-border shadow-sm":"bg-sidebar-accent/50 border-sidebar-border hover:border-sidebar-border hover:bg-sidebar-accent hover:shadow-sm",p||m?"opacity-75":""),children:(0,t.jsxs)("div",{className:"flex items-start justify-between",children:[(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"mb-2 flex items-center gap-3",children:[(0,t.jsx)("div",{className:(0,S.cn)("w-8 h-8 rounded-lg flex items-center justify-center flex-shrink-0",W===n.id?"bg-sidebar-primary":"bg-sidebar-accent"),children:p||m?(0,t.jsx)("div",{className:"border-sidebar-primary-foreground h-4 w-4 animate-spin rounded-full border-2 border-t-transparent"}):(0,t.jsx)(a.IconMessage,{size:16,className:W===n.id?"text-sidebar-primary-foreground":"text-sidebar-foreground"})}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[(0,t.jsx)("p",{className:"text-sidebar-foreground flex-1 truncate text-sm font-semibold",children:n.title||"Untitled Chat"}),(p||m)&&(0,t.jsxs)("div",{className:"flex flex-shrink-0 items-center gap-1 text-xs text-blue-600",children:[(0,t.jsx)("div",{className:"h-3 w-3 animate-spin rounded-full border border-blue-600 border-t-transparent"}),(0,t.jsx)("span",{children:m?"Streaming":"Loading"})]})]}),(0,t.jsx)(x.Button,{size:"icon",variant:"ghost",className:(0,S.cn)("hover:bg-sidebar-accent flex-shrink-0 transition-all duration-200",K?"h-11 w-11":"h-7 w-7",n.is_favorite||K?"opacity-100":"opacity-0 group-hover:opacity-100"),onClick:e=>eb(n,e),"aria-label":n.is_favorite?"Remove from favorites":"Add to favorites",children:n.is_favorite?(0,t.jsx)(l.IconStarFilled,{size:14,className:"text-yellow-500"}):(0,t.jsx)(o.IconStar,{size:14,className:"text-sidebar-foreground
1/50 hover:text-yellow-500"})})]}),n.last_message&&(0,t.jsx)("p",{className:"text-sidebar-foreground/70 mb-2 ml-11 truncate text-xs leading-relaxed",children:n.last_message.text.replace(/\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/[*_~`#]+/g,"").replace(/\n+/g," ").trim()}),(0,t.jsx)("div",{className:"text-sidebar-foreground/60 ml-11 flex items-center gap-2 text-xs",children:(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)(r.IconClock,{size:12}),(0,t.jsx)("span",{className:"font-medium",children:(d=new Date(n.updated_at||n.created_at),((u=new Date(c=new Date)).setDate(u.getDate()-1),d.toDateString()===c.toDateString())?"Today":d.toDateString()===u.toDateString()?"Yesterday":d.toLocaleDateString("en-US",{month:"short",day:"numeric"}))})]})})]}),(0,t.jsxs)(y.DropdownMenu,{children:[(0,t.jsx)(y.DropdownMenuTrigger,{asChild:!0,children:(0,t.jsx)(x.Button,{size:"icon",variant:"ghost",className:(0,S.cn)("hover:bg-sidebar-accent transition-all duration-200",K?"h-11 w-11 opacity-100":"h-8 w-8 opacity-0 group-hover:opacity-100"),onClick:e=>e.stopPropagation(),"aria-label":"Chat actions",children:(0,t.jsx)(i.IconDotsVertical,{size:16,className:"text-sidebar-foreground/70"})})}),(0,t.jsxs)(y.DropdownMenuContent,{align:"end",className:"w-48",children:[(0,t.jsxs)(y.DropdownMenuItem,{onClick:e=>{e.stopPropagation(),ei(n),eo(n.title||""),es(!0)},children:[(0,t.jsx)(h,{size:16,className:"mr-2"}),"Rename chat"]}),(0,t.jsx)(y.DropdownMenuItem,{onClick:e=>eb(n,e),className:"text-yellow-600 hover:bg-yellow-50 focus:text-yellow-600",children:n.is_favorite?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(l.IconStarFilled,{size:16,className:"mr-2"}),"Remove from favorites"]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(o.IconStar,{size:16,className:"mr-2"}),"Add to favorites"]})}),(0,t.jsxs)(y.DropdownMenuItem,{onClick:e=>{e.stopPropagation(),et(n),Z(!0)},className:"text-red-600 hover:bg-red-50 focus:text-red-600",children:[(0,t.jsx)(s.IconTrash,{size:16,className:"mr-2"}),"Delete chat"]})]})]})]})},n.id)})})]})]})}),(0,t.jsx)(g.Dialog,{open:ea,onOpenChange:es,children:(0,t.jsxs)(g.DialogContent,{children:[(0,t.jsxs)(g.DialogHeader,{children:[(0,t.jsx)(g.DialogTitle,{children:"Rename Chat"}),(0,t.jsx)(g.DialogDescription,{children:"Give this conversation a new title."})]}),(0,t.jsx)(b.Input,{autoFocus:!0,value:en,onChange:e=>eo(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),ey())},placeholder:"Chat title",maxLength:200}),(0,t.jsxs)(g.DialogFooter,{children:[(0,t.jsx)(x.Button,{variant:"outline",onClick:()=>es(!1),disabled:el,children:"Cancel"}),(0,t.jsx)(x.Button,{onClick:ey,disabled:el||!en.trim(),children:el?"Saving...":"Save"})]})]})}),(0,t.jsx)(g.Dialog,{open:X,onOpenChange:Z,children:(0,t.jsxs)(g.DialogContent,{children:[(0,t.jsxs)(g.DialogHeader,{children:[(0,t.jsx)(g.DialogTitle,{children:"Delete Chat History"}),(0,t.jsx)(g.DialogDescription,{children:"Are you sure you want to delete this chat? This action cannot be undone."})]}),(0,t.jsxs)(g.DialogFooter,{children:[(0,t.jsx)(x.Button,{variant:"outline",onClick:()=>Z(!1),children:"Cancel"}),(0,t.jsx)(x.Button,{variant:"destructive",onClick:eg,children:"Delete"})]})]})})]})}],511936)},201928,e=>{"use strict";let t=(0,e.i(475254).default)("shopping-cart",[["circle",{cx:"8",cy:"21",r:"1",key:"jimo8o"}],["circle",{cx:"19",cy:"21",r:"1",key:"13723u"}],["path",{d:"M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12",key:"9zh506"}]]);e.s(["ShoppingCart",0,t],201928)},510735,e=>{"use strict";var t=e.i(702807);let a=t.gql` 2 fragment ComputedCartFields on ComputedCartType { 3 subtotalCents 4 totalCents 5 currency 6 aboveGlobalCap 7 constantsVersion 8 lines { 9 documentKind 10 documentId 11 unitAmountCents 12 discountCents 13 appliedRuleId 14 finalAmountCents 15 documentLabel 16 seoUrl 17 } 18 } 19`,s=t.gql` 20 fragment CartFields on CartType { 21 id 22 expiresAt 23 updatedAt 24 items { 25 id 26 documentKind 27 documentId 28 unitAmountCentsSnapshot 29 currencySnapshot 30 addedAt 31 documentLabel 32 seoUrl 33 } 34 computed { 35 ...ComputedCartFields 36 } 37 } 38 ${a} 39`,r=t.gql` 40 query GetCart { 41 cart { 42 ...CartFields 43 } 44 } 45 ${s} 46`,i=t.gql` 47 query GetMyLibrary { 48 myLibrary { 49 id 50 documentKind 51 documentId 52 grantedAt 53 documentLabel 54 documentUrl 55 seoUrl 56 dashboardUrl 57 receiptUrl 58 shortOrderId 59 } 60 } 61`,n=t.gql` 62 query GetMyLibraryCount { 63 myLibraryCount 64 } 65`;t.gql` 66 query GetMyOrder($id: ID!) { 67 myOrder(id: $id) { 68 id 69 status 70 amountTotalCents 71 currency 72 receiptUrl 73 pricingConstantsVersion 74 createdAt 75 paidAt 76 refundedAt 77 items { 78 id 79 documentKind 80 documentId
81 unitAmountCents 82 discountCents 83 } 84 } 85 } 86`,t.gql` 87 query GetMyOrders($limit: Int = 20, $offset: Int = 0) { 88 myOrders(limit: $limit, offset: $offset) { 89 id 90 status 91 amountTotalCents 92 currency 93 createdAt 94 paidAt 95 items { 96 documentKind 97 documentId 98 unitAmountCents 99 } 100 } 101 } 102`;let o=t.gql` 103 query GetRelatedDocs($documentKind: String!, $documentId: String!, $limit: Int = 5) { 104 relatedDocs(documentKind: $documentKind, documentId: $documentId, limit: $limit) { 105 documentKind 106 documentId 107 label 108 unitAmountCents 109 relationship 110 } 111 } 112`,l=t.gql` 113 mutation AddToCart($documentKind: String!, $documentId: String!) { 114 addToCart(documentKind: $documentKind, documentId: $documentId) { 115 ...CartFields 116 } 117 } 118 ${s} 119`,d=t.gql` 120 mutation RemoveFromCart($itemId: ID!) { 121 removeFromCart(itemId: $itemId) { 122 ...CartFields 123 } 124 } 125 ${s} 126`,c=t.gql` 127 mutation ClearCart { 128 clearCart { 129 ...CartFields 130 } 131 } 132 ${s} 133`,u=t.gql` 134 mutation CreateCheckoutSession($uiMode: String) { 135 createCheckoutSession(uiMode: $uiMode) { 136 url 137 clientSecret 138 orderId 139 } 140 } 141`;e.s(["ADD_TO_CART",0,l,"CLEAR_CART",0,c,"CREATE_CHECKOUT_SESSION",0,u,"GET_CART",0,r,"GET_MY_LIBRARY",0,i,"GET_MY_LIBRARY_COUNT",0,n,"GET_RELATED_DOCS",0,o,"REMOVE_FROM_CART",0,d])},567018,514089,410396,406074,613737,e=>{"use strict";var t=e.i(869981),a=e.i(271645),s=e.i(559409),r=e.i(991407);let i=e.i(12124).canUseDOM?a.useLayoutEffect:a.useEffect;var n=e.i(276320);function o(e,o){let d=(0,n.useApolloClient)(o?.client),[c,u]=a.useState(()=>l(d)),h=a.useRef({result:c,mutationId:0,isMounted:!0,client:d,mutation:e,options:o});i(()=>{Object.assign(h.current,{client:d,options:o,mutation:e})});let p=a.useCallback((e={})=>{let{options:a,mutation:i}=h.current,n={...a,mutation:i},o=e.client||h.current.client,l="function"==typeof e.context?e.context(a?.context):e.context;!h.current.result.loading&&h.current.isMounted&&u(h.current.result={loading:!0,error:void 0,data:void 0,called:!0,client:o});let d=++h.current.mutationId,c=(0,s.mergeOptions)(n,{...e,context:l});return(0,r.preventUnhandledRejection)(o.mutate(c).then(a=>{let{data:s,error:r}=a,i=e.onError||h.current.options?.onError;if(r&&i&&i(r,c),d===h.current.mutationId){let e={called:!0,loading:!1,data:s,error:r,client:o};h.current.isMounted&&!(0,t.equal)(h.current.result,e)&&u(h.current.result=e)}let n=e.onCompleted||h.current.options?.onCompleted;return r||n?.(a.data,c),a},a=>{if(d===h.current.mutationId&&h.current.isMounted){let e={loading:!1,error:a,data:void 0,called:!0,client:o};(0,t.equal)(h.current.result,e)||u(h.current.result=e)}let s=e.onError||h.current.options?.onError;throw s&&s(a,c),a}))},[]),m=a.useCallback(()=>{if(h.current.isMounted){let e=l(h.current.client);Object.assign(h.current,{mutationId:0,result:e}),u(e)}},[]);return a.useEffect(()=>{let e=h.current;return e.isMounted=!0,()=>{e.isMounted=!1}},[]),[p,{reset:m,...c}]}function l(e){return{data:void 0,error:void 0,called:!1,loading:!1,client:e}}e.s(["useMutation",0,o],514089);var d=e.i(138413),c=e.i(557951),u=e.i(510735);let h=new Set(["record","fda_record","guidance","china_recall","china_unannounced","china_drug_inspection","china_product_recall"]),p=[{threshold:3,pct:5},{threshold:5,pct:10}];e.s(["SELLABLE_KINDS",0,h,"formatCents",0,(e,t="USD")=>new Intl.NumberFormat("en-US",{style:"currency",currency:t,minimumFractionDigits:0,maximumFractionDigits:2}).format(e/100),"nextDiscountHint",0,e=>{for(let t of p)if(e<t.threshold)return{itemsAway:t.threshold-e,pct:t.pct};return null},"parsePendingItemParam",0,e=>{if(!e)return null;let t=e.indexOf(":");if(t<=0)return null;let a=e.slice(0,t),s=e.slice(t+1);return h.has(a)&&0!==s.length&&!(s.length>128)&&/^[A-Za-z0-9_.-]+$/.test(s)?{kind:a,id:s}:null}],410396),e.i(247167);var m=e.i(261238);let f=new Map;async function x(e){return await (0,m.fetchData)("https://gksc-prod-backend-290557432249.us-east1.run.app/api/store/checkout/preview","POST",{items:e},!1,void 0,!0)}function g(e){let t=e.map(e=>`${e.documentKind}:${e.documentId}`).sort().join("|"),[s,r]=(0,a.useState)(()=>f.get(t)??null),[i,n]=(0,a.useState)(e.length>0&&!f.has(t)),[o,l]=(0,a.useState)(null);return(0,a.useEffect)(()=>
141{if(0===e.length){r(null),n(!1),l(null);return}let a=f.get(t);if(a){r(a),n(!1),l(null);return}let s=!0;return n(!0),l(null),x(e).then(e=>{s&&(f.set(t,e),r(e))}).catch(e=>{s&&l(e instanceof Error?e.message:"Could not load pricing")}).finally(()=>{s&&n(!1)}),()=>{s=!1}},[t]),{cart:s,loading:i,error:o}}e.s(["useCartPreview",0,g],406074);let y="gks.store.guest_cart.v1",b=e=>"string"==typeof e&&0!==e.length&&!(e.length>128)&&/^[A-Za-z0-9_.-]+$/.test(e),v=()=>{try{let e=window.localStorage.getItem(y);if(!e)return[];let t=JSON.parse(e);if(!Array.isArray(t))return[];return t.filter(e=>!!e&&"object"==typeof e&&"string"==typeof e.documentKind&&"string"==typeof e.documentId&&!!h.has(e.documentKind)&&!!b(e.documentId)).slice(0,50)}catch{return[]}},w=e=>{try{window.localStorage.setItem(y,JSON.stringify(e)),window.dispatchEvent(new Event("gks.guest_cart.updated"))}catch{}},j=()=>{let[e,t]=a.default.useState(()=>v());a.default.useEffect(()=>{let e=()=>t(v());return window.addEventListener("storage",e),window.addEventListener("gks.guest_cart.updated",e),()=>{window.removeEventListener("storage",e),window.removeEventListener("gks.guest_cart.updated",e)}},[]);let{cart:s,loading:r,error:i}=g(a.default.useMemo(()=>e.map(e=>({documentKind:e.documentKind,documentId:e.documentId})),[e])),n=0===e.length?{lines:[],subtotalCents:0,totalCents:0,currency:"USD",aboveGlobalCap:!1,constantsVersion:""}:s,o=a.default.useMemo(()=>{if(0===e.length)return n?{id:"guest",expiresAt:null,updatedAt:new Date().toISOString(),items:[],computed:n}:null;if(!n)return null;let t=e.map((e,t)=>{let a=n.lines.find(t=>t.documentKind===e.documentKind&&t.documentId===e.documentId);return{id:`guest|${t}|${e.documentKind}|${e.documentId}`,documentKind:e.documentKind,documentId:e.documentId,unitAmountCentsSnapshot:a?.unitAmountCents??0,currencySnapshot:n.currency,addedAt:e.addedAt,documentLabel:a?.documentLabel??null,seoUrl:a?.seoUrl??null}});return{id:"guest",expiresAt:null,updatedAt:new Date().toISOString(),items:t,computed:n}},[e,n]),l=a.default.useCallback(async(a,s)=>{if(!h.has(a)||!b(s))return;let r=e.filter(e=>e.documentKind!==a||e.documentId!==s);if(r.length>=50)return;let i=[...r,{documentKind:a,documentId:s,addedAt:new Date().toISOString()}];w(i),t(i)},[e]),d=a.default.useCallback(async a=>{let s=a.split("|");if(4!==s.length||"guest"!==s[0])return;let r=s[2],i=s[3],n=e.find(e=>e.documentKind===r&&e.documentId===i);if(!n)return;let o=e.filter(e=>e!==n);w(o),t(o)},[e]),c=a.default.useCallback(async()=>{w([]),t([])},[]),u=a.default.useCallback(async()=>{t(v())},[]);return{cart:o,loading:r,error:i?Error(i):null,refetch:u,addToCart:l,removeFromCart:d,clearCart:c,itemCount:e.length}},k=()=>{w([])};e.s(["clearGuestCartStorage",0,k,"useGuestCart",0,j],613737);let S=null,N=!1;e.s(["useCart",0,()=>{let{user:e}=(0,c.useAuth)(),t=!!e,s=j(),{data:r,loading:i,error:n,refetch:l}=(0,d.useQuery)(u.GET_CART,{skip:!t,fetchPolicy:"cache-and-network",notifyOnNetworkStatusChange:!0}),[h]=o(u.ADD_TO_CART,{refetchQueries:[{query:u.GET_CART}],awaitRefetchQueries:!0}),[p]=o(u.REMOVE_FROM_CART,{refetchQueries:[{query:u.GET_CART}],awaitRefetchQueries:!0}),[m]=o(u.CLEAR_CART,{refetchQueries:[{query:u.GET_CART}],awaitRefetchQueries:!0}),f=(0,a.useCallback)(async(e,t)=>{await h({variables:{documentKind:e,documentId:t}})},[h]),x=(0,a.useCallback)(async e=>{await p({variables:{itemId:e}})},[p]),g=(0,a.useCallback)(async()=>{await m()},[m]),y=(0,a.useCallback)(async()=>{await l()},[l]);if((0,a.useEffect)(()=>{if(!t){S=null,N=!1;return}if(N||S)return;let e=(s.cart?.items??[]).map(e=>({documentKind:e.documentKind,documentId:e.documentId}));if(0===e.length){N=!0;return}S=(async()=>{try{for(let t of e)try{await h({variables:{documentKind:t.documentKind,documentId:t.documentId}})}catch{}k()}finally{N=!0,S=null}})()},[t,s.cart,h]),!t)return{...s,isGuest:!0};let b=r?.cart??null;return{cart:b,loading:i,error:n??null,refetch:y,addToCart:f,removeFromCart:x,clearCart:g,itemCount:b?.items.length??0,isGuest:!1}}],567018)},856353,e=>{"use strict";var t=e.i(618566),a=e.i(271645),s=e.i(567018);e.s(["useBuyAction",0,()=>{let e=(0,t.useRouter)(),{addToCart:r}=(0,s.useCart)(),[i,n]=(0,a.useState)(!1),[o,l]=(0,a.useState)(null),d=(0,a.useCallback)(async(e,t)=>{n(!0),l(null);try{await r(e,t)}catch(e){throw l(e instanceof Error?e.message:"Could not add to cart"),e}finally{n(!1)}},[r]),c=(0,a.useCallback)(async(t,a)=>{await d(t,a),e.push("/cart")},[d,e]);return{addToCart:d,buyNow:c,loading:i,error:o}}])},727612,e=>{"use strict";let t=(0,e.i(475254).default)("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);e.s(["Trash2",0,t],727612)},318021,947505,956694,e=>{"use strict";var t=e.i(843476),a=e.i(201928),s=e.i(727612),r=e.i(37727),i=e.i(522016),n=e.i(271645),o=e.i(519455),l=e.i(557951),d=e.i(567018);function c(e){if(!e||"string"!=typeof e||0===e.length)return null;for(let t=0;t<e.length;t++){let a=e.charCodeAt(t);if(a<=32||127===a)return null}return e.includes("\\")||e.startsWith("//")?null:e.startsWith("/")||e.toLowerCase().startsWith("https://")?e:null}
141e.s(["safeSeoHref",0,c],947505);var u=e.i(410396),h=e.i(929592);let p={ABOVE_GLOBAL_CAP:"This cart is too large for online checkout. Contact our sales team and we'll help you complete the order.",CART_EMPTY:"Your cart is empty. Add a document to continue.",RATE_LIMITED:"You're going a little fast. Please wait a moment and try again."},m=({error:e,onRetry:a})=>{let s=e?p[e.match(/[A-Z][A-Z0-9_]{2,}/)?.[0]??""]??"Something went wrong. Please try again.":"";return s?(0,t.jsx)(h.Alert,{variant:"destructive",children:(0,t.jsxs)(h.AlertDescription,{className:"flex flex-wrap items-center justify-between gap-3",children:[(0,t.jsx)("span",{children:s}),a&&(0,t.jsx)(o.Button,{variant:"outline",size:"sm",onClick:a,children:"Try again"})]})}):null};e.s(["StoreErrorNotice",0,m],956694);let f=({open:e,onClose:h})=>{let{user:p}=(0,l.useAuth)(),{cart:f,error:x,refetch:g,removeFromCart:y}=(0,d.useCart)();n.default.useEffect(()=>{if(!e)return;let t=e=>"Escape"===e.key&&h();return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[e,h]),n.default.useEffect(()=>{if(!e)return;let t=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=t}},[e]);let b=f?.items??[],v=f?.computed?.totalCents??0;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{"aria-hidden":!0,onClick:h,className:"fixed inset-0 z-40 bg-solid-gray-900/20 backdrop-blur-[1px] transition-opacity duration-200 "+(e?"opacity-100":"pointer-events-none opacity-0")}),(0,t.jsxs)("aside",{role:"dialog","aria-label":"Shopping cart",className:"fixed inset-y-0 right-0 z-50 flex w-full max-w-sm flex-col border-l border-gray-200 bg-surface shadow-2xl transition-transform duration-200 ease-out "+(e?"translate-x-0":"translate-x-full"),children:[(0,t.jsxs)("header",{className:"flex items-center justify-between border-b border-gray-100 px-4 py-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(a.ShoppingCart,{className:"h-4 w-4 text-gray-700"}),(0,t.jsxs)("h2",{className:"text-sm font-semibold tracking-tight",children:["Your cart",b.length>0&&(0,t.jsx)("span",{className:"ml-1.5 rounded-full bg-emerald-100 px-1.5 py-0.5 text-[11px] font-semibold text-emerald-700",children:b.length})]})]}),(0,t.jsx)("button",{onClick:h,"aria-label":"Close cart",className:"rounded-full p-1 text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-900",children:(0,t.jsx)(r.X,{className:"h-4 w-4"})})]}),(0,t.jsxs)("div",{className:"flex-1 overflow-y-auto",children:[x&&(0,t.jsx)("div",{className:"px-4 pt-4",children:(0,t.jsx)(m,{error:x.message,onRetry:()=>void g()})}),0===b.length?(0,t.jsxs)("div",{className:"flex flex-col items-center gap-2 px-5 pt-10 pb-6 text-center",children:[(0,t.jsx)(a.ShoppingCart,{className:"h-8 w-8 text-gray-300"}),(0,t.jsx)("p",{className:"text-sm text-gray-700",children:"Your cart is empty."}),(0,t.jsx)("p",{className:"max-w-[20rem] text-xs text-gray-500",children:p?"Click Buy this document on a public document page to add items here.":"Browse public document pages and click Buy this document. We'll ask for your email at checkout, no account needed up front."}),(0,t.jsx)(o.Button,{asChild:!0,size:"sm",variant:"outline",className:"mt-1",children:(0,t.jsx)(i.default,{href:"/records",onClick:h,children:"Browse documents"})})]}):(0,t.jsx)("ul",{className:"divide-y divide-gray-100",children:b.map(e=>{let a,r=f?.computed?.lines.find(t=>t.documentKind===e.documentKind&&t.documentId===e.documentId),n=r?.documentLabel||e.documentLabel||`${e.documentKind}:${(a=e.documentId).length>12?`${a.slice(0,8)}â¦`:a}`,o=c(r?.seoUrl??e.seoUrl??null),l=r?.finalAmountCents??e.unitAmountCentsSnapshot,d=e.documentKind.replace(/_/g," "),p=(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("p",{className:"line-clamp-2 text-sm font-medium "+(o?"text-gray-900 group-hover:text-blue-700":"text-gray-900"),children:n}),(0,t.jsxs)("div",{className:"mt-1 flex flex-wrap items-center gap-1.5 text-[11px]",children:[(0,t.jsx)("span",{className:"rounded bg-gray-100 px-1.5 py-0.5 font-mono tracking-wide text-gray-600 uppercase",children:d}),(0,t.jsx)("span",{className:"font-semibold text-gray-900",children:(0,u.formatCents)(l)}),o&&(0,t.jsx)("span",{className:"ml-auto text-blue-600 group-hover:underline",children:"View profile â"})]})]});return(0,t.jsxs)("li",{className:"flex items-start gap-3 px-4 py-3 transition-colors hover:bg-gray-50",children:[o?(0,t.jsx)(i.default,{href:o,onClick:h,"aria-label":`Open ${n} profile`,className:"group flex min-w-0 flex-1 items-start focus-visible:rounded-md focus-visible:ring-2 focus-visible:ring-blue-300 focus-visible:outline-none",children:p}):p,(0,t.jsx)("button",{onClick:()=>y(e.id),"aria-label":`Remove ${n} from cart`,title:"Remove from cart",className:"shrink-0 rounded-md p-1.5 text-red-500 transition-colors hover:bg-red-50 hover:text-red-700 focus-visible:ring-2 focus-visible:ring-red-300 focus-visible:outline-none",children:(0,t.jsx)(s.Trash2,{className:"h-4 w-4"})})]},e.id)})})]}),b.length>0&&(0,t.jsxs)("footer",{className:"space-y-1.5 border-t border-gray-100 bg-gray-50/70 px-4 py-2.5",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,t.jsx)("span",{className:"font-medium text-gray-700",children:"Total"}),(0,t.jsx)("span",{className:"text-base font-semibold text-gray-900",children:(0,u.formatCents)(v)})]}),(0,t.jsx)("p",{className:"text-xs leading-tight text-gray-600",children:"You'll receive an email with PDF + library access right after payment clears."}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-2 pt-0.5",children:[(0,t.jsx)(o.Button,{variant:"outline",asChild:!0,className:"flex-1",size:"sm",children:(0,t.jsx)(i.default,{href:"/cart",onClick:h,children:"View cart"})}),(0,t.jsx)(o.Button,{asChild:!0,className:"flex-1",size:"sm",children:(0,t.jsx)(i.default,{href:"/checkout",onClick:h,children:"Checkout"})})]})]})]})]})};e.s(["CartDrawer",0,f,"default",0,f],318021)},204329,e=>{"use strict";var t=e.i(843476),a=e.i(643531),s=e.i(531278),r=e.i(201928),i=e.i(271645),n=e.i(519455),o=e.i(856353),l=e.i(567018),d=e.i(406074),c=e.i(410396),u=e.i(318021),h=e.i(956694);let p=new Set(["record","fda_record","china_recall","china_unannounced","china_drug_inspection","china_product_recall"]),m=({documentKind:e,documentId:m,label:f,variant:x="primary",tone:g="filled",hideNote:y=!1,expressCheckout:b=!1,className:v})=>{let w=c.SELLABLE_KINDS.has(e),{addToCart:j,buyNow:k,loading:S,error:N}=(0,o.useBuyAction)(),{cart:C}=(0,l.useCart)(),[A,I]=i.default.useState(!1),{cart:E,loading:M}=(0,d.useCartPreview)(w?[{documentKind:e,documentId:m}]:[]),R=E?.totalCents??null,P=C?.items.some(t=>t.documentKind===e&&t.documentId===m);if(!w)return null;let _=async()=>
141{if(P)return void I(!0);try{b?await k(e,m):(await j(e,m),I(!0))}catch{}},D=f??(p.has(e)?"Purchase report":"guidance"===e?"Purchase guidance":"Purchase");return(0,t.jsxs)("div",{className:v,children:[(0,t.jsxs)(n.Button,{onClick:_,disabled:S||M,size:"compact"===x?"sm":"lg",variant:"outline"===g?"outline":"secondary"===x?"secondary":"default",className:`w-full ${"compact"===x?"":"h-12 px-4 text-base font-semibold rounded-lg"} ${"outline"===g?"border-2 border-primary text-primary-text hover:bg-primary hover:text-white":""} ${"filled"===g&&"compact"!==x?"shadow-md hover:shadow-lg":""}`.replace(/\s+/g," ").trim(),children:[S?(0,t.jsx)(s.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}):P?(0,t.jsx)(a.Check,{className:`mr-2 h-4 w-4 ${"outline"===g?"text-emerald-600":"text-emerald-300"}`}):(0,t.jsx)(r.ShoppingCart,{className:"mr-2 h-4 w-4"}),P?null!==R?`In cart \xb7 ${(0,c.formatCents)(R)} \xb7 View`:"In cart · View":null===R?M?"Loading priceâ¦":D:`${D} \xb7 ${(0,c.formatCents)(R)}`]}),N&&(0,t.jsx)("div",{className:"mt-2",children:(0,t.jsx)(h.StoreErrorNotice,{error:N})}),!y&&"primary"===x&&!P&&null!==R&&(0,t.jsx)("p",{className:"text-primary-700 mt-2 text-xs leading-snug",children:"One-time document purchase. Lifetime access in your library. Need the complete company record? Ask about profile access. All sales final."}),!y&&"primary"===x&&P&&(0,t.jsx)("p",{className:"mt-2 text-xs font-medium text-emerald-700",children:"Added to your cart. Click to review or check out."}),(0,t.jsx)(u.CartDrawer,{open:A,onClose:()=>I(!1)})]})};e.s(["BuyButton",0,m,"default",0,m])},488844,e=>{"use strict";let t=(0,e.i(475254).default)("package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]);e.s(["Package",0,t],488844)},27365,150965,e=>{"use strict";var t=e.i(475254);let a=(0,t.default)("file-down",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M12 18v-6",key:"17g6i2"}],["path",{d:"m9 15 3 3 3-3",key:"1npd3o"}]]);e.s(["FileDown",0,a],27365);let s=(0,t.default)("shopping-bag",[["path",{d:"M16 10a4 4 0 0 1-8 0",key:"1ltviw"}],["path",{d:"M3.103 6.034h17.794",key:"awc11p"}],["path",{d:"M3.4 5.467a2 2 0 0 0-.4 1.2V20a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6.667a2 2 0 0 0-.4-1.2l-2-2.667A2 2 0 0 0 17 2H7a2 2 0 0 0-1.6.8z",key:"o988cm"}]]);e.s(["ShoppingBag",0,s],150965)},492161,975089,e=>{"use strict";let t=(0,e.i(475254).default)("menu",[["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 18h16",key:"19g7jn"}],["path",{d:"M4 6h16",key:"1o0s65"}]]);e.s(["Menu",0,t],492161);let a={src:e.i(91044).default,width:584,height:150,blurWidth:0,blurHeight:0};e.s(["default",0,a],975089)},516015,(e,t,a)=>{},898547,(e,t,a)=>{var s=e.i(247167);e.r(516015);var r=e.r(271645),i=r&&"object"==typeof r&&"default"in r?r:{default:r},n=void 0!==s.default&&s.default.env&&!0,o=function(e){return"[object String]"===Object.prototype.toString.call(e)},l=function(){function e(e){var t=void 0===e?{}:e,a=t.name,s=void 0===a?"stylesheet":a,r=t.optimizeForSpeed,i=void 0===r?n:r;d(o(s),"`name` must be a string"),this._name=s,this._deletedRulePlaceholder="#"+s+"-deleted-rule____{}",d("boolean"==typeof i,"`optimizeForSpeed` must be a boolean"),this._optimizeForSpeed=i,this._serverSheet=void 0,this._tags=[],this._injected=!1,this._rulesCount=0;var l="u">typeof window&&document.querySelector('meta[property="csp-nonce"]');this._nonce=l?l.getAttribute("content"):null}var t,a=e.prototype;return a.setOptimizeForSpeed=function(e){d("boolean"==typeof e,"`setOptimizeForSpeed` accepts a boolean"),d(0===this._rulesCount,"optimizeForSpeed cannot be when rules have already been inserted"),this.flush(),this._optimizeForSpeed=e,this.inject()},a.isOptimizeForSpeed=function(){return this._optimizeForSpeed},a.inject=function(){var e=this;if(d(!this._injected,"sheet already injected"),this._injected=!0,"u">typeof window&&this._optimizeForSpeed){this._tags[0]=this.makeStyleTag(this._name),this._optimizeForSpeed="insertRule"in this.get
141Sheet(),this._optimizeForSpeed||(n||console.warn("StyleSheet: optimizeForSpeed mode not supported falling back to standard mode."),this.flush(),this._injected=!0);return}this._serverSheet={cssRules:[],insertRule:function(t,a){return"number"==typeof a?e._serverSheet.cssRules[a]={cssText:t}:e._serverSheet.cssRules.push({cssText:t}),a},deleteRule:function(t){e._serverSheet.cssRules[t]=null}}},a.getSheetForTag=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]},a.getSheet=function(){return this.getSheetForTag(this._tags[this._tags.length-1])},a.insertRule=function(e,t){if(d(o(e),"`insertRule` accepts only strings"),"u"<typeof window)return"number"!=typeof t&&(t=this._serverSheet.cssRules.length),this._serverSheet.insertRule(e,t),this._rulesCount++;if(this._optimizeForSpeed){var a=this.getSheet();"number"!=typeof t&&(t=a.cssRules.length);try{a.insertRule(e,t)}catch(t){return n||console.warn("StyleSheet: illegal rule: \n\n"+e+"\n\nSee https://stackoverflow.com/q/20007992 for more info"),-1}}else{var s=this._tags[t];this._tags.push(this.makeStyleTag(this._name,e,s))}return this._rulesCount++},a.replaceRule=function(e,t){if(this._optimizeForSpeed||"u"<typeof window){var a="u">typeof window?this.getSheet():this._serverSheet;if(t.trim()||(t=this._deletedRulePlaceholder),!a.cssRules[e])return e;a.deleteRule(e);try{a.insertRule(t,e)}catch(s){n||console.warn("StyleSheet: illegal rule: \n\n"+t+"\n\nSee https://stackoverflow.com/q/20007992 for more info"),a.insertRule(this._deletedRulePlaceholder,e)}}else{var s=this._tags[e];d(s,"old rule at index `"+e+"` not found"),s.textContent=t}return e},a.deleteRule=function(e){if("u"<typeof window)return void this._serverSheet.deleteRule(e);if(this._optimizeForSpeed)this.replaceRule(e,"");else{var t=this._tags[e];d(t,"rule at index `"+e+"` not found"),t.parentNode.removeChild(t),this._tags[e]=null}},a.flush=function(){this._injected=!1,this._rulesCount=0,"u">
141typeof window?(this._tags.forEach(function(e){return e&&e.parentNode.removeChild(e)}),this._tags=[]):this._serverSheet.cssRules=[]},a.cssRules=function(){var e=this;return"u"<typeof window?this._serverSheet.cssRules:this._tags.reduce(function(t,a){return a?t=t.concat(Array.prototype.map.call(e.getSheetForTag(a).cssRules,function(t){return t.cssText===e._deletedRulePlaceholder?null:t})):t.push(null),t},[])},a.makeStyleTag=function(e,t,a){t&&d(o(t),"makeStyleTag accepts only strings as second parameter");var s=document.createElement("style");this._nonce&&s.setAttribute("nonce",this._nonce),s.type="text/css",s.setAttribute("data-"+e,""),t&&s.appendChild(document.createTextNode(t));var r=document.head||document.getElementsByTagName("head")[0];return a?r.insertBefore(s,a):r.appendChild(s),s},t=[{key:"length",get:function(){return this._rulesCount}}],function(e,t){for(var a=0;a<t.length;a++){var s=t[a];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,s.key,s)}}(e.prototype,t),e}();function d(e,t){if(!e)throw Error("StyleSheet: "+t+".")}var c=function(e){for(var t=5381,a=e.length;a;)t=33*t^e.charCodeAt(--a);return t>>>0},u={};function h(e,t){if(!t)return"jsx-"+e;var a=String(t),s=e+a;return u[s]||(u[s]="jsx-"+c(e+"-"+a)),u[s]}function p(e,t){"u"<typeof window&&(t=t.replace(/\/style/gi,"\\/style"));var a=e+t;return u[a]||(u[a]=t.replace(/__jsx-style-dynamic-selector/g,e)),u[a]}var m=function(){function e(e){var t=void 0===e?{}:e,a=t.styleSheet,s=void 0===a?null:a,r=t.optimizeForSpeed,i=void 0!==r&&r;this._sheet=s||new l({name:"styled-jsx",optimizeForSpeed:i}),this._sheet.inject(),s&&"boolean"==typeof i&&(this._sheet.setOptimizeForSpeed(i),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),this._fromServer=void 0,this._indices={},this._instancesCounts={}}var t=e.prototype;return t.add=function(e){var t=this;void 0===this._optimizeForSpeed&&(this._optimizeForSpeed=Array.isArray(e.children),this._sheet.setOptimizeForSpeed(this._optimizeForSpeed),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),"u">typeof window&&!this._fromServer&&(this._fromServer=this.selectFromServer(),this._instancesCounts=Object.keys(this._fromServer).reduce(function(e,t){return e[t]=0,e},{}));var a=this.getIdAndRules(e),s=a.styleId,r=a.rules;if(s in this._instancesCounts){this._instancesCounts[s]+=1;return}var i=r.map(function(e){return t._sheet.insertRule(e)}).filter(function(e){return -1!==e});this._indices[s]=i,this._instancesCounts[s]=1},t.remove=function(e){var t=this,a=this.getIdAndRules(e).styleId;if(function(e,t){if(!e)throw Error("StyleSheetRegistry: "+t+".")}(a in this._instancesCounts,"styleId: `"+a+"` not found"),this._instancesCounts[a]-=1,this._instancesCounts[a]<1){var s=this._fromServer&&this._fromServer[a];s?(s.parentNode.removeChild(s),delete this._fromServer[a]):(this._indices[a].forEach(function(e){return t._sheet.deleteRule(e)}),delete this._indices[a]),delete this._instancesCounts[a]}},t.update=function(e,t){this.add(t),this.remove(e)},t.flush=function(){this._sheet.flush(),this._sheet.inject(),this._fromServer=void 0,this._indices={},this._instancesCounts={}},t.cssRules=function(){var e=this,t=this._fromServer?Object.keys(this._fromServer).map(function(t){return[t,e._fromServer[t]]}):[],a=this._sheet.cssRules();return t.concat(Object.keys(this._indices).map(function(t){return[t,e._indices[t].map(function(e){return a[e].cssText}).join(e._optimizeForSpeed?"":"\n")]}).filter(function(e){return!!e[1]}))},t.styles=function(e){var t,a;return t=this.cssRules(),void 0===(a=e)&&(a={}),t.map(function(e){var t=e[0],s=e[1];return i.default.createElement("style",{id:"__"+t,key:"__"+t,nonce:a.nonce?a.nonce:void 0,dangerouslySetInnerHTML:{__html:s}})})},t.getIdAndRules=function(e){var t=e.children,a=e.dynamic,s=e.id;if(a){var r=h(s,a);return{styleId:r,rules:Array.isArray(t)?t.map(function(e){return p(r,e)}):[p(r,t)]}}return{styleId:h(s),rules:Array.isArray(t)?t:[t]}},t.selectFromServer=function(){return Array.prototype.slice.call(document.querySelectorAll('[id^="__jsx-"]')).reduce(function(e,t){return e[t.id.slice(2)]=t,e},{})},e}(),f=r.createContext(null);function x(){return new m}function g(){return r.useContext(f)}f.displayName="StyleSheetContext";var y=i.default.useInsertionEffect||i.default.useLayoutEffect,b="u">typeof window?x():void 0;function v(e){var t=b||g();return t&&("u"<typeof window?t.add(e):y(function(){return t.add(e),function(){t.remove(e)}},[e.id,String(e.dynamic)])),null}v.dynamic=function(e){return e.map(function(e){return h(e[0],e[1])}).join(" ")},a.StyleRegistry=function(e){var t=e.registry,a=e.children,s=r.useContext(f),n=r.useState(function(){return s||t||x()})[0];return i.default.createElement(f.Provider,{value:n},a)},a.createStyleRegistry=x,a.style=v,a.useStyleRegistry=g},437902,(e,t,a)=>{t.exports=e.r(898547).style},270652,e=>{"use strict";let t=(0,e.i(33550).default)("outline","arrow-right","ArrowRight",[["path",{d:"M5 12l14 0",key:"svg-0"}],["path",{d:"M13 18l6 -6",key:"svg-1"}],["path",{d:"M13 6l6 6",key:"svg-2"}]]);e.s(["IconArrowRight",0,t],270652)},496969,582284,e=>{"use strict";var t=e.i(843476),a=e.i(437902),s=e.i(270652),r=e.i(357772),i=e.i(271645),n=e.i(202343),o=e.i(649828);function l(e,t={}){let a=t.surface??"band",[s,r]=(0,i.useState)(""),[d,c]=(0,i.useState)(!1),[u,h]=(0,i.useState)("idle"),[p,m]=(0,i.useState)(""),f=(0,i.useRef)(!1),x=(0,i.useRef)(!1),g=(0,i.useCallback)(()=>{x.current||(x.current=!0,(0,n.trackNewsletter)("form_focus",{surface:a}
141))},[a]),y=e=>{h("error"),m(e)},b=async t=>{if(t.preventDefault(),f.current)return;let i=!!s&&/^\S+@\S+$/.test(s);if((0,n.trackNewsletter)("submit_attempt",{surface:a,client_valid:i}),!i){y("Please enter a valid email address"),(0,n.trackNewsletter)("error",{surface:a,reason:"client_invalid"});return}f.current=!0,c(!0),h("idle"),m("");try{let t=await fetch("/api/subscribe",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:s})}),i=t.headers.get("content-type");if(!i||!i.includes("application/json")){(0,o.consoleErrorDev)("Non-JSON response:",await t.text()),y("Something went wrong. Please try again in a moment."),(0,n.trackNewsletter)("error",{surface:a,reason:"non_json",http_status:t.status});return}let l=await t.json();if(!t.ok){y(l.message||"Subscription failed"),(0,n.trackNewsletter)("error",{surface:a,reason:429===t.status?"rate_limited":"api_rejected",http_status:t.status});return}h("success"),r(""),(0,n.trackNewsletter)("subscribed",{surface:a}),e?.(s)}catch(t){(0,o.consoleErrorDev)("Subscription error:",t);let e=t instanceof TypeError;y(e?"Network error. Please check your connection.":"Failed to subscribe. Please try again."),(0,n.trackNewsletter)("error",{surface:a,reason:e?"network":"unknown"})}finally{f.current=!1,c(!1)}},v=(0,i.useCallback)(()=>{r(""),h("idle"),m("")},[]);return{email:s,setEmail:r,loading:d,status:u,errorMessage:p,submit:b,reset:v,onEmailFocus:g}}e.s(["useNewsletterSignup",0,l],582284);var d=e.i(975157);let c="kp_media_subscribe_dismissed",u=!1;function h(){u=!0;try{window.sessionStorage.setItem(c,"1")}catch{}}function p(){return(0,t.jsxs)("div",{className:"jsx-aef6755e3887a55c flex items-center gap-2 py-1",children:[(0,t.jsxs)("svg",{viewBox:"0 0 24 24","aria-hidden":!0,className:"jsx-aef6755e3887a55c kp-check h-5 w-5 flex-shrink-0",children:[(0,t.jsx)("circle",{cx:"12",cy:"12",r:"11",fill:"none",stroke:"#16a34a",strokeWidth:"2",className:"jsx-aef6755e3887a55c kp-check-circle"}),(0,t.jsx)("path",{d:"M7 12.5l3.2 3.3L17 9",fill:"none",stroke:"#16a34a",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:"jsx-aef6755e3887a55c kp-check-mark"})]}),(0,t.jsx)("span",{className:"jsx-aef6755e3887a55c text-sm font-bold tracking-wide text-[#16a34a]",children:"Subscribed"}),(0,t.jsx)(a.default,{id:"aef6755e3887a55c",children:".kp-check-circle.jsx-aef6755e3887a55c{stroke-dasharray:70;stroke-dashoffset:70px;animation:.4s ease-out forwards kpCircle}.kp-check-mark.jsx-aef6755e3887a55c{stroke-dasharray:24;stroke-dashoffset:24px;animation:.3s ease-out .35s forwards kpMark}@keyframes kpCircle{to{stroke-dashoffset:0}}@keyframes kpMark{to{stroke-dashoffset:0}}"})]})}e.s(["default",0,()=>{let[e,a]=i.default.useState(!0),[o,m]=i.default.useState(!1),[f,x]=i.default.useState(!1),[g,y]=i.default.useState(96),{email:b,setEmail:v,loading:w,status:j,errorMessage:k,submit:S,reset:N,onEmailFocus:C}=l(void 0,{surface:"media_popout"}),A=`nlpop-${i.default.useId()}`;return(i.default.useEffect(()=>{if(function(){if(u)return!0;try{return"1"===window.sessionStorage.getItem(c)}catch{return!1}}())return;a(!1);let e=document.querySelector("header"),t=()=>{e&&y(Math.min(Math.round(e.getBoundingClientRect().height)+12,Math.max(12,window.innerHeight-220)))};t(),window.addEventListener("resize",t);let s=window.setTimeout(()=>m(!0),5e3);return()=>{window.removeEventListener("resize",t),window.clearTimeout(s)}},[]),i.default.useEffect(()=>{if("success"!==j)return;h();let e=window.setTimeout(()=>{x(!1),N()},1900);return()=>window.clearTimeout(e)},[j,N]),e)?null:(0,t.jsx)("div",{style:{"--kp-popout-top":`${g}px`},className:(0,d.cn)("no-print fixed right-4 bottom-4 z-40 w-[260px] max-w-[calc(100vw-2rem)] transition-[opacity,transform] duration-300","md:top-[var(--kp-popout-top)] md:bottom-auto",o?"translate-y-0 opacity-100":"pointer-events-none -translate-y-2 opacity-0"),children:(0,t.jsxs)("div",{className:"relative border-2 border-[#ED8600] bg-orange-50 px-3 py-2 shadow-sm",children:[(0,t.jsx)("button",{type:"button",onClick:()=>{a(!0),h(),(0,n.trackNewsletter)("popout_dismissed",{surface:"media_popout",expanded:f})},"aria-label":"Dismiss",className:"absolute top-0 right-0 p-1.5 text-gray-500 transition-colors hover:text-gray-800",children:(0,t.jsx)(r.IconX,{size:14})}),"success"===j?(0,t.jsx)(p,{}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("button",{type:"button",onClick:()=>{f||(0,n.trackNewsletter)("popout_opened",{surface:"media_popout"}),x(!f)},"data-attr":"newsletter-popout-toggle",className:"block w-full cursor-pointer text-left","aria-expanded":f,"aria-controls":`${A}-form`,children:(0,t.jsxs)("div",{className:"flex items-center gap-2 pr-4 text-sm font-bold tracking-wide text-contrast",children:[(0,t.jsx)("span",{"aria-hidden":!0,
141className:"h-1.5 w-1.5 flex-shrink-0 rounded-full bg-[#ED8600]"}),"Subscribe for premium content"]})}),f&&(0,t.jsxs)("form",{id:`${A}-form`,onSubmit:S,className:"mt-2",children:[(0,t.jsxs)("div",{className:"flex items-center border border-gray-300 bg-surface pr-1 focus-within:border-[#524FE5]",children:[(0,t.jsx)("label",{htmlFor:A,className:"sr-only",children:"Work email"}),(0,t.jsx)("input",{id:A,type:"email",autoComplete:"email",inputMode:"email",required:!0,"aria-required":"true","aria-invalid":"error"===j,"aria-describedby":"error"===j?`${A}-err`:void 0,placeholder:"[email protected]","data-attr":"newsletter-email-input",value:b,onChange:e=>{v(e.target.value),e.target.value&&C()},disabled:w,autoFocus:!0,className:"min-w-0 flex-1 bg-transparent px-2 py-1 text-sm text-gray-900 placeholder:text-gray-400 focus:outline-none"}),(0,t.jsx)("button",{type:"submit","data-attr":"newsletter-subscribe-button",disabled:w||!b,"aria-label":"Subscribe",className:"flex-shrink-0 p-1 text-brand transition-colors hover:text-brand-ink disabled:opacity-40",children:(0,t.jsx)(s.IconArrowRight,{size:16})})]}),"error"===j&&(0,t.jsx)("p",{id:`${A}-err`,className:"mt-1 text-[11px] font-semibold text-gray-900",children:k})]}),(0,t.jsx)("p",{className:"mt-2 text-[11px] font-medium text-gray-800",children:"Two communications per quarter."})]})]})})}],496969)},818127,e=>{"use strict";let t=(0,e.i(33550).default)("outline","mail","Mail",[["path",{d:"M3 7a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v10a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-10",key:"svg-0"}],["path",{d:"M3 7l9 6l9 -6",key:"svg-1"}]]);e.s(["IconMail",0,t],818127)},864377,e=>{"use strict";var t=e.i(843476),a=e.i(626197),s=e.i(818127),r=e.i(519455),i=e.i(582284);e.s(["default",0,({onSubmit:e,variant:n="band"})=>{let{email:o,setEmail:l,loading:d,status:c,errorMessage:u,submit:h,onEmailFocus:p}=(0,i.useNewsletterSignup)(e,{surface:n});return"footer"===n?(0,t.jsxs)("div",{className:"space-y-2 pt-1",children:[(0,t.jsx)("div",{className:"text-sm font-semibold text-white",children:"Stay in the loop"}),(0,t.jsx)("p",{className:"text-xs text-white/70",children:"KRA score changes, company updates and news. About monthly, unsubscribe anytime."}),(0,t.jsxs)("form",{onSubmit:h,className:"mt-1 flex flex-col gap-2 sm:max-w-xs",children:[(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(s.IconMail,{size:16,className:"absolute top-1/2 left-2.5 -translate-y-1/2 text-[#CDCDF9]","aria-hidden":!0}),(0,t.jsx)("input",{type:"email",placeholder:"[email protected]","aria-label":"Email address","data-attr":"newsletter-email-input",value:o,onChange:e=>l(e.target.value),onFocus:p,disabled:d,className:"w-full rounded-md border border-[#555555] bg-[#2a2a2a] py-2 pr-3 pl-8 text-xs text-white placeholder:text-white/40 focus:border-[#524FE5] focus:ring-1 focus:ring-[#524FE5] focus:outline-none dark:border-white/20 dark:bg-black",required:!0})]}),(0,t.jsx)(r.Button,{type:"submit","data-attr":"newsletter-subscribe-button",disabled:d||!o,className:"rounded-md bg-[#524FE5] px-4 py-2 text-xs font-medium text-white hover:bg-[#3F3DA8]",children:d?"Subscribing...":"Subscribe"})]}),"error"===c&&(0,t.jsx)("div",{className:"text-xs text-red-300",role:"alert",children:u}),"success"===c&&(0,t.jsxs)("div",{className:"flex items-center gap-1.5 text-xs text-[#CDCDF9]",children:[(0,t.jsx)(a.IconCheck,{size:14,"aria-hidden":!0}),"Subscribed. Check your email to confirm."]})]}):(0,t.jsx)("div",{className:"w-full border-y border-brand-lilac bg-brand-ice py-12",children:(0,t.jsxs)("div",{className:"mx-auto max-w-4xl px-6",children:[(0,t.jsxs)("div",{className:"mb-8 text-center",children:[(0,t.jsx)("h2",{className:"mb-3 text-3xl font-bold text-gray-900",children:"See KRA score changes, company updates and news"}),(0,t.jsx)("p",{className:"text-lg text-gray-900",children:"Correspondence is about monthly. Unsubscribe anytime."})]}),(0,t.jsxs)("div",{className:"mx-auto max-w-lg",children:[(0,t.jsxs)("form",{onSubmit:h,className:"flex flex-col gap-3 sm:flex-row",children:[(0,t.jsxs)("div",{className:"relative flex-1",children:[(0,t.jsx)(s.IconMail,{size:20,className:"absolute top-1/2 left-3 -translate-y-1/2 text-brand","aria-hidden":!0}),(0,t.jsx)("input",{type:"email",placeholder:"[email protected]","aria-label":"Email address","data-attr":"newsletter-email-input",value:o,onChange:e=>l(e.target.value),onFocus:p,disabled:d,className:"w-full rounded-lg border border-brand-lilac bg-surface py-3 pr-4 pl-10 focus:border-[#524FE5] focus:ring-2 focus:ring-brand-lilac focus:outline-none",required:!0})]}),(0,t.jsx)(r.Button,{type:"submit","data-attr":"newsletter-subscribe-button",disabled:d||!o,className:"rounded-lg bg-[#524FE5] px-8 py-3 font-medium text-white hover:bg-[#3F3DA8]",children:d?"Subscribing...":"Subscribe"})]}),"error"===c&&(0,t.jsx)("div",{className:"mt-4 rounded-md border border-red-200 bg-red-50 p-3",children:(0,t.jsx)("div",{className:"text-sm text-red-700",children:u})}),"success"===c&&(0,t.jsxs)("div",{className:"mt-4 flex items-center justify-center gap-2 rounded-md border border-brand-lilac bg-surface p-3",children:[(0,t.jsx)(a.IconCheck,{size:16,className:"text-brand","aria-hidden":!0}),(0,t.jsx)("div",{className:"text-sm font-medium text-brand-ink",children:"Subscribed. Check your email to confirm."})]})]})]})})}])},74270,e=>{"use strict";var t=e.i(843476),a=e.i(201928),s=e.i(271645),r=e.i(567018),i=e.i(318021);let n=({className:e})=>{let{itemCount:n}=(0,r.useCart)(),[o,l]=s.default.useState(!1),[d,c]=s.default.useState(!1);s.default.useEffect(()=>{c(!0)},[]);let u=n>0;return d&&u?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("button",{type:"button","aria-label":u?`Open cart, ${n} item${1===n?"":"s"}`:"Open cart",onClick:()=>l(!0),className:"relative inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full border border-gray-200 bg-surface text-gray-700 transition-colors hover:border-emerald-400 hover:text-emerald-600 xl:h-9 xl:w-9 "+(e??""),children:[(0,t.jsx)(a.ShoppingCart,{className:"h-4 w-4 xl:h-[18px] xl:w-[18px]"}
141),u&&(0,t.jsx)("span",{"aria-hidden":!0,className:"absolute -top-1.5 -right-1.5 inline-flex min-w-[18px] items-center justify-center rounded-full bg-emerald-500 px-1.5 py-0.5 text-[10px] font-semibold text-white shadow ring-2 ring-white",children:n>99?"99+":n})]}),(0,t.jsx)(i.CartDrawer,{open:o,onClose:()=>l(!1)})]}):null};e.s(["HeaderCartButton",0,n,"default",0,n])},456629,e=>{"use strict";e.s(["default",()=>R]);var t=e.i(843476),a=e.i(905142),s=e.i(846932),r=e.i(88653),i=e.i(492161),n=e.i(664659),o=e.i(531278),l=e.i(836159),d=e.i(657688),c=e.i(522016),u=e.i(618566),h=e.i(271645),p=e.i(975089),m=e.i(651226),f=e.i(388349),x=e.i(678976),g=e.i(519455),y=e.i(755146),b=e.i(496969),v=e.i(864377),w=e.i(772436),j=e.i(980376),k=e.i(557951);e.i(954442);var S=e.i(74270),N=e.i(975157),C=e.i(834289),A=e.i(202343),I=e.i(306130);let E="bg-gradient-to-br from-[#09139f] via-[#1d1dc7] to-[#121272] text-white shadow-[0_4px_14px_0_rgba(9,19,159,0.39)] transition-all duration-300 ease-out hover:-translate-y-0.5 hover:brightness-110 hover:shadow-[0_6px_20px_rgba(9,19,159,0.35)] active:scale-95 active:translate-y-0",M="flex shrink-0 items-center justify-center rounded-full bg-gradient-to-br from-amber-400 via-amber-500 to-solid-amber-700 font-bold tracking-wider text-white shadow-inner ring-1 ring-inset ring-amber-200/60 transition-transform duration-300 group-hover:scale-105 group-hover:brightness-110",R=({children:e})=>{let R=(0,u.useRouter)(),P=(0,u.usePathname)(),_=P?.split("/")[1]||"",[D,{open:T,close:O}]=(0,a.useDisclosure)(!1),[F,B]=(0,h.useState)(!1),[L,z]=(0,h.useState)(!1),{user:K,loading:U}=(0,k.useAuth)(),$="See KeyPedia in Action",V=()=>{R.push("/")},H=()=>{R.push("/media")},q=e=>{R.push(`/media?types=${e}`)},G=()=>{let e=!!localStorage.getItem("firebaseIdToken")||!!(0,C.getFirebaseTokenFromCookie)();if(K||U&&e)z(!0),R.push("/home"),setTimeout(()=>z(!1),3e3);else{if("/auth/signin"===P)return;R.push("/auth/signin")}},W=()=>{if(!K)return"";if(K.first_name&&K.last_name)return`${K.first_name[0]}${K.last_name[0]}`.toUpperCase();if(K.displayName){let e=K.displayName.split(" ").filter(Boolean);if(e.length>=2)return`${e[0][0]}${e[1][0]}`.toUpperCase();if(1===e.length)return e[0][0].toUpperCase()}let e=K.email;return e?e.charAt(0).toUpperCase():"U"},Y=()=>{R.push("/about-us")},Q=()=>{R.push("/solutions")},J=()=>{R.push("/solutions#product-suite")},X=()=>{R.push("/use-cases")},Z=()=>{R.push("/pricing")},ee=()=>{R.push("/programsandpartners")},et=()=>{R.push("/careers")},ea=()=>{R.push("/platform/overview")},es=()=>{R.push("/platform/documentation")},er=()=>{R.push("/records")},ei=()=>{R.push("/people")},en=()=>{R.push("/offices")},eo=()=>{R.push("/companies")},el="h-16 shrink-0 rounded-none px-3 text-sm font-medium text-contrast hover:text-blue-600 xl:px-4 xl:text-base";return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(l.default,{children:[(0,t.jsx)("title",{children:"KeyPedia"}),(0,t.jsx)("meta",{name:"description",content:"KeyPedia"}),(0,t.jsx)("meta",{name:"viewport",content:"width=device-width, initial-scale=1"}),(0,t.jsx)("link",{rel:"icon",href:"/favicon.ico"})]}),(0,t.jsxs)("div",{className:"text-s flex min-h-screen flex-col",children:[(0,t.jsxs)("header",{className:"sticky top-0 right-0 left-0 z-50 flex flex-col border-b border-gray-200 bg-surface",children:[(0,t.jsxs)("div",{className:"bg-[#5A58E6] px-4 py-2 text-center text-sm font-medium text-white",children:["Attention"," ",(0,t.jsx)("a",{href:"https://www.globalkeysolutions.net",target:"_blank",rel:"noopener noreferrer",className:"underline hover:text-white/80",children:"www.globalkeysolutions.net"})," ","is now"," ",(0,t.jsx)("a",{href:"https://www.keypedia.com",target:"_blank",rel:"noopener noreferrer",className:"underline hover:text-white/80",children:"www.keypedia.com"}),", read the full press release"," ",(0,t.jsx)("a",{href:"/media/keypediawebsitechange?from=banner",className:"underline hover:text-white/80",children:"here"}),"."]}),(0,t.jsx)("div",{className:"mx-auto flex h-16 w-full max-w-[1440px] items-center justify-between px-4 lg:px-6",children:(0,t.jsxs)("div",{className:"flex w-full items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex shrink-0 items-center",children:[(0,t.jsx)(d.default,{src:p.default,alt:"KeyPedia Logo",height:32,width:250,className:"hidden h-7 w-auto shrink-0 cursor-pointer object-contain min-[1250px]:block lg:h-8",onClick:()=>R.push("/"),priority:!0}),(0,t.jsx)(d.default,{src:f.default,alt:"KeyPedia Icon",height:32,width:50,className:"h-7 w-auto shrink-0 cursor-pointer object-contain min-[1250px]:hidden",onClick:()=>R.push("/"),priority:!0})]}),(0,t.jsxs)("div",{className:"hidden flex-1 items-center justify-end gap-1 min-[1250px]:flex xl:gap-2",children:[(0,t.jsx)(g.Button,{variant:"ghost",className:(0,N.cn)(el,""===_&&"text-blue-600"),onClick:V,children:"Product"}),(0,t.jsxs)(y.DropdownMenu,{children:[(0,t.jsx)(y.DropdownMenuTrigger,{asChild:!0,children:(0,t.jsxs)(g.Button,{variant:"ghost",className:(0,N.cn)(el,["about-us","experts","solutions","partners","programs","program","careers","values","code-of-ethics","programsandpartners","use-cases"].includes(_)&&"text-blue-600"),children:["Company",(0,t.jsx)(n.ChevronDown,{className:"ml-1 h-3.5 w-3.5 shrink-0 xl:h-4 xl:w-4"})]})}),(0,t.jsxs)(y.DropdownMenuContent,{className:"w-56",children:[(0,t.jsx)(y.DropdownMenuItem,{onClick:Q,children:"Solutions"}),(0,t.jsx)(y.DropdownMenuItem,{className:"py-1.5 pl-7 text-[13px] text-gray-500",onClick:J,children:"Products"}),(0,t.jsx)(y.DropdownMenuItem,{className:"py-1.5 pl-7 text-[13px] text-gray-500",onClick:X,children:"Use Cases"}),(0,t.jsx)(y.DropdownMenuItem,{className:"py-1.5 pl-7 text-[13px] text-gray-500",onClick:Z,children:"Pricing"}),(0,t.jsx)(y.DropdownMenuItem,{className:"py-1.5 pl-7 text-[13px] text-gray-500",onClick:ee,children:"Outcomes"}),(0,t.jsx)(y.DropdownMenuItem,{onClick:Y,children:"About Us"}),(0,t.jsx)(y.DropdownMenuItem,{className:"py-1.5 pl-7 text-[13px] text-gray-500",onClick:()=>R.push("/values"),children:"Values & Mission"}),(0,t.jsx)(y.DropdownMenuItem,{className:"py-1.5 pl-7 text-[13px] text-gray-500",onClick:()=>R.push("/experts"),children:"Meet Our Experts"}),(0,t.jsx)(y.DropdownMenuItem,{className:"py-1.5 pl-7 text-[13px] text-gray-500",onClick:()=>R.push("/about-us/team"),children:"Founding Team"}),(0,t.jsx)(y.DropdownMenuItem,{className:"py-1.5 pl-7 text-[13px] text-gray-500",onClick:()=>
141R.push("/code-of-ethics"),children:"Code of Ethics"}),(0,t.jsx)(y.DropdownMenuItem,{className:"py-1.5 pl-7 text-[13px] text-gray-500",onClick:()=>R.push("/platform/overview"),children:"How We Process Data"}),(0,t.jsx)(y.DropdownMenuItem,{className:"py-1.5 pl-7 text-[13px] text-gray-500",onClick:()=>R.push("/faq"),children:"Product FAQ"}),(0,t.jsx)(y.DropdownMenuItem,{className:"py-1.5 pl-7 text-[13px] text-gray-500",onClick:et,children:"Careers"})]})]}),(0,t.jsxs)(y.DropdownMenu,{children:[(0,t.jsx)(y.DropdownMenuTrigger,{asChild:!0,children:(0,t.jsxs)(g.Button,{variant:"ghost",className:(0,N.cn)(el,"platform"===_&&"text-blue-600"),children:["Platform",(0,t.jsx)(n.ChevronDown,{className:"ml-1 h-3.5 w-3.5 shrink-0 xl:h-4 xl:w-4"})]})}),(0,t.jsxs)(y.DropdownMenuContent,{children:[(0,t.jsx)(y.DropdownMenuItem,{onClick:ea,children:"Overview"}),(0,t.jsx)(y.DropdownMenuItem,{onClick:es,children:"Research"}),(0,t.jsx)(y.DropdownMenuItem,{onClick:()=>R.push("/faq"),children:"FAQ"})]})]}),(0,t.jsxs)(y.DropdownMenu,{children:[(0,t.jsx)(y.DropdownMenuTrigger,{asChild:!0,children:(0,t.jsxs)(g.Button,{variant:"ghost",className:(0,N.cn)(el,"media"===_&&"text-blue-600"),children:["Media",(0,t.jsx)(n.ChevronDown,{className:"ml-1 h-3.5 w-3.5 shrink-0 xl:h-4 xl:w-4"})]})}),(0,t.jsxs)(y.DropdownMenuContent,{className:"w-56",children:[(0,t.jsx)(y.DropdownMenuItem,{className:"font-medium text-gray-900 focus:text-primary-700",onClick:H,children:"All Media"}),(0,t.jsx)(y.DropdownMenuSeparator,{}),(0,t.jsx)(y.DropdownMenuItem,{className:"py-1.5 pl-7 text-[13px] text-gray-700 focus:text-primary-700",onClick:()=>q("blog"),children:"Blog Posts"}),(0,t.jsx)(y.DropdownMenuItem,{className:"py-1.5 pl-7 text-[13px] text-gray-700 focus:text-primary-700",onClick:()=>q("case_study"),children:"Case Studies"}),(0,t.jsx)(y.DropdownMenuItem,{className:"py-1.5 pl-7 text-[13px] text-gray-700 focus:text-primary-700",onClick:()=>q("webinar"),children:"Webinars"}),(0,t.jsx)(y.DropdownMenuItem,{className:"py-1.5 pl-7 text-[13px] text-gray-700 focus:text-primary-700",onClick:()=>q("press_release"),children:"Press Releases"}),(0,t.jsx)(y.DropdownMenuSeparator,{}),(0,t.jsx)(y.DropdownMenuItem,{onClick:()=>{R.push("/media?view=calendar")},children:"Calendar"}),(0,t.jsx)(y.DropdownMenuItem,{onClick:()=>{R.push("/media?view=map")},children:"Map"})]})]}),(0,t.jsxs)(y.DropdownMenu,{children:[(0,t.jsx)(y.DropdownMenuTrigger,{asChild:!0,children:(0,t.jsxs)(g.Button,{variant:"ghost",className:(0,N.cn)(el,["browse","records","people","officers","offices","companies"].includes(_)&&"text-blue-600"),children:["Browse KeyPediaâ¢",(0,t.jsx)(n.ChevronDown,{className:"ml-1 h-3.5 w-3.5 shrink-0 xl:h-4 xl:w-4"})]})}),(0,t.jsxs)(y.DropdownMenuContent,{className:"w-56",children:[(0,t.jsx)(y.DropdownMenuItem,{className:"font-medium text-gray-900 focus:text-primary-700",onClick:()=>R.push("/browse"),children:"KeyPedia⢠Lite"}),(0,t.jsx)(y.DropdownMenuItem,{className:"py-1.5 pl-7 text-[13px] text-gray-700 focus:text-primary-700",onClick:er,children:"Records"}),(0,t.jsx)(y.DropdownMenuItem,{className:"py-1.5 pl-7 text-[13px] text-gray-700 focus:text-primary-700",onClick:eo,children:"Companies"}),(0,t.jsx)(y.DropdownMenuItem,{className:"py-1.5 pl-7 text-[13px] text-gray-700 focus:text-primary-700",onClick:en,children:"Offices"}),(0,t.jsx)(y.DropdownMenuItem,{className:"py-1.5 pl-7 text-[13px] text-gray-700 focus:text-primary-700",onClick:ei,children:"People"})]})]}),(0,t.jsxs)("div",{className:"ml-2 flex shrink-0 items-center gap-3 lg:ml-4 lg:gap-4",children:[(0,t.jsx)(x.ThemeToggle,{location:"public_header"}),(0,t.jsx)(S.HeaderCartButton,{}),(0,t.jsx)("button",{className:"inline-flex h-8 shrink-0 items-center justify-center rounded-full border-2 border-brand-cta px-4 text-xs font-semibold whitespace-nowrap text-brand-cta transition-all duration-200 hover:bg-[#5A58E6]/10 hover:shadow-sm xl:h-9 xl:px-5 xl:text-sm","data-track-click":"header_primary_cta_option_2",onClick:()=>{(0,A.trackLandingCTA)($,"header","/request-demo"),R.push("/request-demo")},children:$}),(0,t.jsxs)(s.motion.button,{layout:!0,className:`group flex shrink-0 items-center rounded-full text-xs font-medium tracking-wide whitespace-nowrap xl:text-sm ${E} ${K&&!U?"h-8 justify-between gap-2.5 pr-1 pl-4 xl:h-9 xl:pr-1.5 xl:pl-5":"h-8 justify-center px-4 xl:h-9 xl:px-5"}`,onClick:G,disabled:L,children:[L&&(0,t.jsx)(o.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}),(0,t.jsx)(s.motion.span,{layout:!0,children:"Go to Dashboard"}),(0,t.jsx)(r.AnimatePresence,{children:K&&!U&&(0,t.jsx)(s.motion.div,{layout:!0,initial:{opacity:0,scale:.5,width:0,marginLeft:0}
141,animate:{opacity:1,scale:1,width:"auto",marginLeft:4},exit:{opacity:0,scale:.5,width:0,marginLeft:0},transition:{type:"spring",stiffness:500,damping:30},className:"flex items-center justify-center overflow-hidden",children:(0,t.jsx)("div",{className:`h-6 w-6 text-[10px] xl:h-7 xl:w-7 xl:text-[11px] ${M}`,children:W()})})})]})]})]}),(0,t.jsxs)("div",{className:"ml-auto flex items-center gap-2 min-[1250px]:hidden",children:[(0,t.jsx)(x.ThemeToggle,{location:"public_header_mobile"}),(0,t.jsx)(S.HeaderCartButton,{}),(0,t.jsxs)(j.Sheet,{open:F,onOpenChange:B,children:[(0,t.jsx)(j.SheetTrigger,{asChild:!0,children:(0,t.jsx)(g.Button,{variant:"ghost",size:"sm",children:(0,t.jsx)(i.Menu,{className:"h-6 w-6"})})}),(0,t.jsxs)(j.SheetContent,{side:"left",className:"flex h-full w-80 flex-col p-0",children:[(0,t.jsx)(j.SheetTitle,{className:"sr-only",children:"Navigation Menu"}),(0,t.jsx)("div",{className:"flex flex-shrink-0 items-center justify-between border-b p-6",children:(0,t.jsx)(d.default,{src:p.default,alt:"KeyPedia",height:32,width:250,className:"h-8 w-auto cursor-pointer object-contain",onClick:()=>{R.push("/"),B(!1)},priority:!0})}),(0,t.jsx)("div",{className:"min-h-0 flex-1 overflow-y-auto p-6",children:(0,t.jsxs)("div",{className:"space-y-8",children:[(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(g.Button,{variant:"ghost",className:"h-12 w-full justify-start text-left text-base font-medium",onClick:()=>{V(),B(!1)},children:"Product"}),(0,t.jsx)(g.Button,{variant:"ghost",className:"h-12 w-full justify-start text-left text-base font-medium",onClick:()=>{H(),B(!1)},children:"Media"})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("div",{className:"px-3 py-2 text-sm font-semibold tracking-wide text-gray-500 uppercase",children:"COMPANY"}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(g.Button,{variant:"ghost",className:"h-10 w-full justify-start pl-6 text-left text-sm",onClick:()=>{Q(),B(!1)},children:"Solutions"}),(0,t.jsx)(g.Button,{variant:"ghost",className:"h-8 w-full justify-start pl-9 text-left text-[13px] text-gray-500",onClick:()=>{J(),B(!1)},children:"Products"}),(0,t.jsx)(g.Button,{variant:"ghost",className:"h-8 w-full justify-start pl-9 text-left text-[13px] text-gray-500",onClick:()=>{X(),B(!1)},children:"Use Cases"}),(0,t.jsx)(g.Button,{variant:"ghost",className:"h-8 w-full justify-start pl-9 text-left text-[13px] text-gray-500",onClick:()=>{Z(),B(!1)},children:"Pricing"}),(0,t.jsx)(g.Button,{variant:"ghost",className:"h-8 w-full justify-start pl-9 text-left text-[13px] text-gray-500",onClick:()=>{ee(),B(!1)},children:"Outcomes"}),(0,t.jsx)(g.Button,{variant:"ghost",className:"h-10 w-full justify-start pl-6 text-left text-sm",onClick:()=>{Y(),B(!1)},children:"About Us"}),(0,t.jsx)(g.Button,{variant:"ghost",className:"h-8 w-full justify-start pl-9 text-left text-[13px] text-gray-500",onClick:()=>{R.push("/values"),B(!1)},children:"Values & Mission"}),(0,t.jsx)(g.Button,{variant:"ghost",className:"h-8 w-full justify-start pl-9 text-left text-[13px] text-gray-500",onClick:()=>{R.push("/experts"),B(!1)},children:"Meet Our Experts"}),(0,t.jsx)(g.Button,{variant:"ghost",className:"h-8 w-full justify-start pl-9 text-left text-[13px] text-gray-500",onClick:()=>{R.push("/about-us/team"),B(!1)},children:"Founding Team"}),(0,t.jsx)(g.Button,{variant:"ghost",className:"h-8 w-full justify-start pl-9 text-left text-[13px] text-gray-500",onClick:()=>{R.push("/code-of-ethics"),B(!1)},children:"Code of Ethics"}),(0,t.jsx)(g.Button,{variant:"ghost",className:"h-8 w-full justify-start pl-9 text-left text-[13px] text-gray-500",onClick:()=>{R.push("/platform/overview"),B(!1)},children:"How We Process Data"}),(0,t.jsx)(g.Button,{variant:"ghost",className:"h-8 w-full justify-start pl-9 text-left text-[13px] text-gray-500",onClick:()=>{R.push("/faq"),B(!1)},children:"Product FAQ"}),(0,t.jsx)(g.Button,{variant:"ghost",className:"h-8 w-full justify-start pl-9 text-left text-[13px] text-gray-500",onClick:()=>{et(),B(!1)},children:"Careers"})]})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("div",{className:"px-3 py-2 text-sm font-semibold tracking-wide text-gray-500 uppercase",children:"PLATFORM"}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(g.Button,{variant:"ghost",className:"h-10 w-full justify-start pl-6 text-left text-sm",onClick:()=>{ea(),B(!1)},children:"Overview"}),(0,t.jsx)(g.Button,{variant:"ghost",className:"h-10 w-full justify-start pl-6 text-left text-sm",onClick:()=>{es(),B(!1)},children:"Research"}),(0,t.jsx)(g.Button,{variant:"ghost",className:"h-10 w-full justify-start pl-6 text-left text-sm",onClick:()=>{R.push("/faq"),B(!1)},children:"FAQ"})]})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("div",{className:"px-3 py-2 text-sm font-semibold tracking-wide text-gray-500 uppercase",children:"BROWSE"}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(g.Button,{variant:"ghost",className:"h-10 w-full justify-start pl-6 text-left text-sm font-medium",onClick:()=>{R.push("/browse"),B(!1)},children:"KeyPedia⢠Lite Hub"}),(0,t.jsx)("div",{className:"my-1 border-t border-gray-100"}),(0,t.jsx)(g.Button,{variant:"ghost",className:"h-10 w-full justify-start pl-6 text-left text-sm",onClick:()=>{er(),B(!1)},children:"Records"}),(0,t.jsx)(g.Button,{variant:"ghost",className:"h-10 w-full justify-start pl-6 text-left text-sm",onClick:()=>{eo(),B(!1)},children:"Companies"}),(0,t.jsx)(g.Button,{variant:"ghost",className:"h-10 w-full justify-start pl-6 text-left text-sm",onClick:()=>{en(),B(!1)},children:"Offices"}),(0,t.jsx)(g.Button,{variant:"ghost",className:"h-10 w-full justify-start pl-6 text-left text-sm",onClick:()=>{ei(),B(!1)},children:"People"})]})]})]})}),(0,t.jsxs)("div",{className:"flex flex-shrink flex-col gap-3 border-t p-6",children:[(0,t.jsx)("button",{className:"inline-flex h-12 w-full items-center justify-center rounded-full border-2 border-brand-cta text-base font-semibold text-brand-cta transition-all duration-200 hover:bg-[#5A58E6]/10 hover:shadow-sm","data-track-click":"mobile_primary_cta_option_2",onClick:()=>{(0,A.trackLandingCTA)($,"mobile_menu","/request-demo"),R.push("/request-demo"),B(!1)},children:$}),(0,t.jsxs)(s.motion.button,{layout:!0,className:`group flex h-12 w-full items-center rounded-full text-base font-medium tracking-wide ${E} ${K&&!U?"justify-between pr-1.5 pl-6":"justify-center"}`,onClick:()=>{G(),B(!1)},disabled:L,children:[L&&(0,t.jsx)(o.Loader2,{className:"mr-2 h-5 w-5 animate-spin"}),(0,t.jsx)(s.motion.span,{layout:!0,children:"Go to Dashboard"}),(0,t.jsx)(r.AnimatePresence,{children:K&&!U&&(0,t.jsx)(s.motion.div,{layout:!0,initial:{opacity:0,scale:.5,width:0,marginLeft:0}
141,animate:{opacity:1,scale:1,width:"auto",marginLeft:8},exit:{opacity:0,scale:.5,width:0,marginLeft:0},transition:{type:"spring",stiffness:500,damping:30},className:"flex items-center justify-center overflow-hidden",children:(0,t.jsx)("div",{className:`h-9 w-9 text-xs ${M}`,children:W()})})})]})]})]})]})]})]})})]}),(0,t.jsx)("main",{className:"flex flex-1 flex-col overscroll-none",children:(0,t.jsxs)("div",{className:"flex flex-1 flex-col",children:[e,(0,t.jsx)("footer",{className:"mt-0 w-full bg-[#343434] px-4 py-10 text-sm dark:border-t dark:border-white/10 dark:bg-black",children:(0,t.jsxs)("div",{className:"mx-auto w-full max-w-7xl",children:[(0,t.jsxs)("div",{className:"mb-5 grid grid-cols-1 gap-8 md:grid-cols-2 lg:grid-cols-4",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(d.default,{src:m.default,alt:"KeyPedia",height:42,width:160,className:"h-10 w-auto object-contain"}),(0,t.jsx)("div",{className:"text-xs text-white",children:"Regulatory Data Transformed"}),(0,t.jsx)("div",{className:"no-print pt-3",children:(0,t.jsx)(v.default,{variant:"footer"})})]}),(0,t.jsxs)("div",{id:"contact",className:"space-y-2",children:[(0,t.jsx)("div",{className:"text-sm font-semibold text-white",children:"Contact"}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("div",{className:"font-medium text-white",children:"New York Office:"}),(0,t.jsx)("div",{className:"text-white",children:"370 Jay Street 7th Floor"}),(0,t.jsx)("div",{className:"text-white",children:"Brooklyn, NY 11201"})]}),(0,t.jsxs)("div",{className:"mt-2 space-y-1",children:[(0,t.jsx)("div",{className:"font-medium text-white",children:"Scranton Office:"}),(0,t.jsx)("div",{className:"text-white",children:"Scranton Enterprise Center, Suite 217"}),(0,t.jsx)("div",{className:"text-white",children:"201 Lackawanna Avenue"}),(0,t.jsx)("div",{className:"text-white",children:"Scranton, PA, 18503"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-xs text-white",children:"ðºð¸"}),(0,t.jsx)("a",{href:"tel:+19177895099",className:"text-xs text-white hover:underline",children:"+1 917-789-5099"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-xs text-white",children:"ðªðº"}),(0,t.jsx)("a",{href:"tel:+48532447507",className:"text-xs text-white hover:underline",children:"+48 532-447-507"})]}),(0,t.jsx)("a",{href:"mailto:[email protected]",className:"text-xs text-white hover:underline",children:"[email protected]"})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("div",{className:"text-sm font-semibold text-white",children:"Quick Links"}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(c.default,{href:"/",className:"block text-xs text-white hover:underline",children:"Home"}),(0,t.jsx)(c.default,{href:"/platform/overview",className:"block text-xs text-white hover:underline",children:"Platform Overview"}),(0,t.jsx)(c.default,{href:"/media",className:"block text-xs text-white hover:underline",children:"Media"}),(0,t.jsx)("div",{className:"mt-3 mb-1 text-xs font-semibold text-white",children:"KeyPedia⢠Lite"}),(0,t.jsx)(c.default,{href:"/browse",className:"block text-xs text-white hover:underline",children:"Browse Hub"}),(0,t.jsx)(c.default,{href:"/directory",className:"block text-xs text-white hover:underline",children:"Database Directory"}),(0,t.jsx)(c.default,{href:"/records",className:"block text-xs text-white hover:underline",children:"Records"}),(0,t.jsx)(c.default,{href:"/companies",className:"block text-xs text-white hover:underline",children:"Companies"}),(0,t.jsx)(c.default,{href:"/offices",className:"block text-xs text-white hover:underline",children:"Offices"}),(0,t.jsx)(c.default,{href:"/people",className:"block text-xs text-white hover:underline",children:"People"}),(0,t.jsx)(c.default,{href:"/careers",className:"block text-xs text-white hover:underline",children:"Careers"}),(0,t.jsx)(c.default,{href:"/about-us",className:"block text-xs text-white hover:underline",children:"About Us"}),(0,t.jsx)(c.default,{href:"/about-us/team",className:"block text-xs text-white hover:underline",children:"Founding Team"}),(0,t.jsx)(c.default,{href:"/experts",className:"block text-xs text-white hover:underline",children:"Meet Our Experts"}),(0,t.jsx)(c.default,{href:"/partners",className:"block text-xs text-white hover:underline",children:"Partners"})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("div",{className:"text-sm font-semibold text-white",children:"Legal & Ethics"}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(c.default,{href:"/privacy-policy",className:"block text-xs text-white hover:underline",children:"Privacy Policy"}),(0,t.jsx)(c.default,{href:"/terms-of-service",className:"block text-xs text-white hover:underline",children:"Terms of Service"}),(0,t.jsx)(c.default,{href:"/values",className:"block text-xs text-white hover:underline",children:"Our Values & Mission"}),(0,t.jsx)(c.default,{href:"/code-of-ethics",className:"block text-xs text-white hover:underline",children:"Code of Ethics & AI Policy"})]})]})]}),(0,t.jsx)(w.Separator,{className:"my-5 bg-[#555555]"}),(0,t.jsx)("div",{className:"flex items-center justify-between",children:(0,t.jsx)("div",{className:"text-xs text-white",children:"©2026 KeyPedia⢠| Global Key Solutions Corp. All rights reserved."})})]})})]})})]}),(0,t.jsx)(I.default,{modalOpen:T,modalClose:O,modalOpened:D,withEmail:!0,subject:"[GKS Contact Us Request]"}),"media"===_&&(0,t.jsx)(b.default,{})]})}},52048,e=>{"use strict";var t=e.i(843476),a=e.i(138413),s=e.i(107233),r=e.i(519455),i=e.i(515288),n=e.i(567018),o=e.i(510735),l=e.i(410396);let d=({anchorKind:e,anchorId:d})=>{let{addToCart:c,cart:u}=(0,n.useCart)(),{data:h,loading:p}=(0,a.useQuery)(o.GET_RELATED_DOCS,{variables:{documentKind:e,documentId:d,limit:4},fetchPolicy:"cache-and-network"}),m=h?.relatedDocs??[];if(p||0===m.length)return null;let f=new Set(u?.items.map(e=>`${e.documentKind}:${e.documentId}
141`)??[]),x=m.filter(e=>!f.has(`${e.documentKind}:${e.documentId}`));return 0===x.length?null:(0,t.jsx)(i.Card,{children:(0,t.jsxs)(i.CardContent,{className:"space-y-3 p-4",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-gray-900",children:"Frequently bought together"}),(0,t.jsx)("p",{className:"text-xs text-gray-500",children:"From the same company. Add 3+ items for 5% off, 5+ for 10% off."}),(0,t.jsx)("ul",{className:"divide-y",children:x.map(e=>(0,t.jsxs)("li",{className:"flex items-center justify-between gap-3 py-3",children:[(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("p",{className:"truncate text-sm text-gray-900",children:e.label}),(0,t.jsx)("p",{className:"text-xs text-gray-500",children:(0,l.formatCents)(e.unitAmountCents)})]}),(0,t.jsxs)(r.Button,{variant:"outline",size:"sm",onClick:()=>c(e.documentKind,e.documentId),children:[(0,t.jsx)(s.Plus,{className:"mr-1 h-3 w-3"}),"Add"]})]},`${e.documentKind}:${e.documentId}`))})]})})};e.s(["RelatedDocsCarousel",0,d,"default",0,d])},305316,e=>{"use strict";e.s(["CartPage",()=>S,"default",()=>N]);var t=e.i(247167),a=e.i(843476),s=e.i(664659),r=e.i(655900),i=e.i(778917),n=e.i(27365),o=e.i(531278),l=e.i(263488),d=e.i(488844),c=e.i(150965),u=e.i(283086),h=e.i(727612),p=e.i(618566),m=e.i(271645),f=e.i(456629),x=e.i(519455),g=e.i(515288),y=e.i(557951),b=e.i(567018),v=e.i(947505),w=e.i(410396),j=e.i(52048),k=e.i(956694);let S=()=>{let e=(0,p.useRouter)(),s=(0,p.useSearchParams)(),{user:r}=(0,y.useAuth)(),{cart:i,loading:n,error:h,refetch:v,addToCart:S,removeFromCart:N,clearCart:A}=(0,b.useCart)(),I=m.default.useRef(!1);if(m.default.useEffect(()=>{if(I.current||!r)return;let t=(0,w.parsePendingItemParam)(s.get("pendingItem"));t&&(I.current=!0,(async()=>{try{await S(t.kind,t.id)}catch(e){console.error("pending_item_attach_failed",e)}finally{let t=new URLSearchParams(s.toString());t.delete("pendingItem"),t.delete("next");let a=t.toString();e.replace(a?`/cart?${a}`:"/cart")}})())},[r,s,S,e]),n&&!i)return(0,a.jsx)(f.default,{children:(0,a.jsx)("div",{className:"flex min-h-[60vh] items-center justify-center",children:(0,a.jsx)(o.Loader2,{className:"h-6 w-6 animate-spin text-gray-400"})})});if(h)return(0,a.jsx)(f.default,{children:(0,a.jsx)("div",{className:"mx-auto max-w-2xl py-12",children:(0,a.jsx)(k.StoreErrorNotice,{error:h.message,onRetry:()=>void v()})})});let E=i?.items??[],M=i?.computed,R=0===E.length,P=M?.aboveGlobalCap===!0,_=(0,w.nextDiscountHint)(E.length),D=E[0];return(0,a.jsx)(f.default,{children:(0,a.jsx)("div",{className:"min-h-[80vh] bg-gradient-to-br from-gray-50 to-blue-50/30 py-10",children:(0,a.jsxs)("div",{className:"mx-auto max-w-6xl px-4",children:[(0,a.jsxs)("div",{className:"mb-6 flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"text-3xl font-semibold text-gray-900",children:"Your cart"}),(0,a.jsx)("p",{className:"mt-1 text-sm text-gray-600",children:"Review what you're buying, then continue to a secure embedded checkout. Your purchased docs unlock instantly inside KeyPediaâ¢."})]}),!R&&(0,a.jsx)(x.Button,{variant:"ghost",size:"sm",onClick:()=>A(),children:"Clear cart"})]}),R?(0,a.jsx)(g.Card,{children:(0,a.jsxs)(g.CardContent,{className:"flex flex-col items-center gap-4 py-16 text-center",children:[(0,a.jsx)(c.ShoppingBag,{className:"h-12 w-12 text-gray-300"}),(0,a.jsx)("p",{className:"text-lg text-gray-600",children:"Your cart is empty."}),(0,a.jsxs)("p",{className:"max-w-md text-sm text-gray-500",children:["Browse public document pages on KeyPedia⢠and click"," ",(0,a.jsx)("span",{className:"font-medium",children:"Buy this document"})," to add items here."]}),(0,a.jsx)(x.Button,{onClick:()=>e.push("/records"),children:"Browse documents"})]})}):(0,a.jsxs)("div",{className:"grid gap-6 lg:grid-cols-[1fr_360px]",children:[(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)(g.Card,{className:"border-orange-200 bg-orange-50/60",children:(0,a.jsxs)(g.CardContent,{className:"space-y-3 p-5",children:[(0,a.jsx)("p",{className:"text-sm font-semibold tracking-wide text-gray-900 uppercase",children:"How it works"}),(0,a.jsxs)("ul",{className:"grid gap-3 sm:grid-cols-3",children:[(0,a.jsxs)("li",{className:"flex items-start gap-2.5 rounded-md bg-surface/60 p-3",children:[(0,a.jsx)(c.ShoppingBag,{className:"mt-0.5 h-5 w-5 shrink-0 text-orange-600"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-semibold text-gray-900",children:"Buy these docs"}),(0,a.jsx)("p",{className:"text-xs text-gray-800",children:"Pay once with Stripe. Permanent access, no subscription required."})]})]}),(0,a.jsxs)("li",{className:"flex items-start gap-2.5 rounded-md bg-surface/60 p-3",children:[(0,a.jsx)(l.Mail,{className:"mt-0.5 h-5 w-5 shrink-0 text-orange-600"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-semibold text-gray-900",children:"Receive email + PDF"}),(0,a.jsx)("p",{className:"text-xs text-gray-800",children:"We email a receipt and direct PDF links the moment payment clears."})]})]}),(0,a.jsxs)("li",{className:"flex items-start gap-2.5 rounded-md bg-surface/60 p-3",children:[(0,a.jsx)(d.Package,{className:"mt-0.5 h-5 w-5 shrink-0 text-orange-600"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-semibold text-gray-900",children:"Bundle and save"}),(0,a.jsx)("p",{className:"text-xs text-gray-800",children:"3+ docs save 5%; 5+ docs save 10%. A full company profile connects the related sites, people, citations, and enforcement history."})]})]})]})]})}),(0,a.jsx)("div",{className:"space-y-3",children:E.map(e=>(0,a.jsx)(C,{item:e,computedLine:M?.lines.find(t=>t.documentKind===e.documentKind&&t.documentId===e.documentId),onRemove:()=>N(e.id)},e.id))}),D&&(0,a.jsx)(j.RelatedDocsCarousel,{anchorKind:D.documentKind,anchorId:D.documentId})]}),(0,a.jsx)("div",{className:"lg:sticky lg:top-24 lg:self-start",children:(0,a.jsxs)(g.Card,{children:[(0,a.jsx)(g.CardHeader,{children:(0,a.jsxs)(g.CardTitle,{className:"flex items-center gap-2 text-base",children:[(0,a.jsx)(u.Sparkles,{className:"h-4 w-4 text-blue-500"}),"Order summary"]})}),(0,a.jsxs)(g.CardContent,{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"flex justify-between text-sm",children:[(0,a.jsx)("span",{className:"text-gray-600",children:"Subtotal"}),(0,a.jsx)("span",{className:"font-medium",children:(0,w.formatCents)(M?.subtotalCents??0)})]}),M&&M.subtotalCents!==M.totalCents&&(0,a.jsxs)("div",{className:"flex justify-between text-sm text-emerald-600",children:[(0,a.jsx)("span",{children:"Volume discount"}),(0,a.jsxs)("span",{children:["â",(0,w.formatCents)(M.subtotalCents-M.totalCents)]})]}),(0,a.jsxs)("div",{className:"flex justify-between border-t pt-3 text-base font-semibold",children:[(0,a.jsx)("span",{children:"Total"}),(0,a.jsx)("span",{children:(0,w.formatCents)(M?.totalCents??0)})]}),_&&(0,a.jsxs)("p",{className:"rounded-md bg-blue-50 p-3 text-xs text-blue-900",children:["Add ",_.itemsAway," more ",1===_.itemsAway?"doc":"docs"," to save"," ",_.pct,"% on your order."]}),P?(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("p",{className:"rounded-md bg-amber-50 p-3 text-sm text-amber-900",children:"Carts over $15,000 are routed through our sales team for an enterprise quote."}),(0,a.jsx)(x.Button,{className:"w-full",onClick:()=>window.location.href=t.default.env.NEXT_PUBLIC_SALES_CONTACT_URL||"/request-demo",children:"Talk to sales"})]}):(0,a.jsx)(x.Button,{className:"w-full",size:"lg",onClick:()=>e.push("/checkout"),children:"Proceed to checkout"}),(0,a.jsx)("p",{className:"text-xs text-gray-500",children:"Secure payment via Stripe. Your card
141is never sent to KeyPedia. All sales final, no refunds."})]})]})})]})]})})})},N=S,C=({item:e,computedLine:t,onRemove:o})=>{let l,[d,c]=m.default.useState(!1),u=t?.finalAmountCents??e.unitAmountCentsSnapshot,p=t?.discountCents??0,f=e.documentLabel||`${e.documentKind}:${(l=e.documentId).length>12?`${l.slice(0,8)}â¦`:l}`,y=e.documentKind.replace(/_/g," ").toUpperCase(),b=(0,v.safeSeoHref)(e.seoUrl);return(0,a.jsx)(g.Card,{children:(0,a.jsxs)(g.CardContent,{className:"p-4",children:[(0,a.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>c(e=>!e),"aria-expanded":d,className:"group min-w-0 flex-1 text-left",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("p",{className:"line-clamp-2 text-sm font-semibold text-gray-900 group-hover:text-blue-700",children:f}),d?(0,a.jsx)(r.ChevronUp,{className:"h-4 w-4 shrink-0 text-gray-400"}):(0,a.jsx)(s.ChevronDown,{className:"h-4 w-4 shrink-0 text-gray-400"})]}),(0,a.jsxs)("div",{className:"mt-1 flex flex-wrap items-center gap-2 text-xs text-gray-500",children:[(0,a.jsx)("span",{className:"rounded bg-gray-100 px-1.5 py-0.5 font-mono tracking-wide uppercase",children:y}),(0,a.jsx)("span",{children:"·"}),(0,a.jsxs)("span",{children:["Snapshot ",(0,w.formatCents)(e.unitAmountCentsSnapshot)]}),b&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{children:"·"}),(0,a.jsx)("span",{className:"text-blue-600",children:"Preview available"})]})]})]}),(0,a.jsxs)("div",{className:"text-right",children:[(0,a.jsx)("p",{className:"font-medium text-gray-900",children:(0,w.formatCents)(u)}),p>0&&(0,a.jsxs)("p",{className:"text-xs text-emerald-600",children:["â",(0,w.formatCents)(p)," discount"]})]}),(0,a.jsx)(x.Button,{variant:"ghost",size:"icon","aria-label":"Remove from cart",onClick:o,children:(0,a.jsx)(h.Trash2,{className:"h-4 w-4 text-gray-500"})})]}),d&&(0,a.jsxs)("div",{className:"mt-3 grid gap-2 rounded-md bg-gray-50 p-3 text-xs text-gray-700 sm:grid-cols-2",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium text-gray-500",children:"Document type"}),(0,a.jsx)("p",{children:y})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium text-gray-500",children:"Document ID"}),(0,a.jsx)("p",{className:"font-mono break-all",children:e.documentId})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium text-gray-500",children:"Snapshot price"}),(0,a.jsxs)("p",{children:[(0,w.formatCents)(e.unitAmountCentsSnapshot)," (locked at add)"]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium text-gray-500",children:"Delivery"}),(0,a.jsxs)("p",{className:"flex items-center gap-1",children:[(0,a.jsx)(n.FileDown,{className:"h-3 w-3"})," PDF + KeyPedia⢠profile"]})]}),b&&(0,a.jsx)("div",{className:"sm:col-span-2",children:(0,a.jsxs)("a",{href:b,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 text-blue-600 hover:underline",children:["Open public preview ",(0,a.jsx)(i.ExternalLink,{className:"h-3 w-3"})]})})]})]})})}},667668,911860,540259,e=>{"use strict";var t,a=e.i(271645),s=e.i(745009);function r(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),a.push.apply(a,s)}return a}function i(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?r(Object(a),!0).forEach(function(t){o(e,t,a[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):r(Object(a)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))})}return e}function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function l(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var a,s,r=e&&("u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null!=r){var i=[],n=!0,o=!1;try{for(r=r.call(e);!(n=(a=r.next()).done)&&(i.push(a.value),!t||i.length!==t);n=!0);}catch(e){o=!0,s=e}finally{try{n||null==r.return||r.return()}finally{if(o)throw s}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return d(e,t);var a=Object.prototype.toString.call(e).slice(8,-1);if("Object"===a&&e.constructor&&(a=e.constructor.name),"Map"===a||"Set"===a)return Array.from(e);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return d(e,t)}}
141(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,s=Array(t);a<t;a++)s[a]=e[a];return s}var c=function(e,t,s){var r=!!s,i=a.default.useRef(s);a.default.useEffect(function(){i.current=s},[s]),a.default.useEffect(function(){if(!r||!e)return function(){};var a=function(){i.current&&i.current.apply(i,arguments)};return e.on(t,a),function(){e.off(t,a)}},[r,t,e,i])},u=function(e){var t=a.default.useRef(e);return a.default.useEffect(function(){t.current=e},[e]),t.current},h=function(e){return null!==e&&"object"===n(e)},p="[object Object]",m=function e(t,a){if(!h(t)||!h(a))return t===a;var s=Array.isArray(t);if(s!==Array.isArray(a))return!1;var r=Object.prototype.toString.call(t)===p;if(r!==(Object.prototype.toString.call(a)===p))return!1;if(!r&&!s)return t===a;var i=Object.keys(t),n=Object.keys(a);if(i.length!==n.length)return!1;for(var o={},l=0;l<i.length;l+=1)o[i[l]]=!0;for(var d=0;d<n.length;d+=1)o[n[d]]=!0;var c=Object.keys(o);return c.length===i.length&&c.every(function(s){return e(t[s],a[s])})},f="Invalid prop `stripe` supplied to `Elements`. We recommend using the `loadStripe` utility from `@stripe/stripe-js`. See https://stripe.com/docs/stripe-js/react#elements-props-stripe for details.",x=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:f;if(null===e||h(e)&&"function"==typeof e.elements&&"function"==typeof e.createToken&&"function"==typeof e.createPaymentMethod&&"function"==typeof e.confirmCardPayment)return e;throw Error(t)},g=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:f;if(h(e)&&"function"==typeof e.then)return{tag:"async",stripePromise:Promise.resolve(e).then(function(e){return x(e,t)})};var a=x(e,t);return null===a?{tag:"empty"}:{tag:"sync",stripe:a}},y=function(e){e&&e._registerWrapper&&e.registerAppInfo&&(e._registerWrapper({name:"react-stripe-js",version:"6.4.0"}),e.registerAppInfo({name:"react-stripe-js",version:"6.4.0",url:"https://stripe.com/docs/stripe-js/react"}))},b=a.default.createContext(null);b.displayName="ElementsContext";var v=function(e,t){if(!e)throw Error("Could not find Elements context; You need to wrap the part of your app that ".concat(t," in an <Elements> provider."));return e};s.default.any,s.default.object,s.default.func.isRequired;var w=a.default.createContext(null);w.displayName="CheckoutContext";var j=function(e){var t=a.default.useContext(w),s=a.default.useContext(b);if(!t)return v(s,e);if(!s)return t;throw Error("You cannot wrap the part of your app that ".concat(e," in both a checkout provider and <Elements> provider."))},k=["mode"],S=function(e,t,r){var n="".concat(e.charAt(0).toUpperCase()+e.slice(1),"Element"),d=t?function(e){j("mounts <".concat(n,">"));var t=e.id,s=e.className;return a.default.createElement("div",{id:t,className:s})}:function(t){var s,r=t.id,d=t.className,p=t.options,f=void 0===p?{}:p,x=t.onBlur,g=t.onFocus,y=t.onReady,b=t.onChange,v=t.onEscape,w=t.onClick,S=t.onLoadError,N=t.onLoaderStart,C=t.onNetworksChange,A=t.onConfirm,I=t.onCancel,E=t.onShippingAddressChange,M=t.onShippingRateChange,R=t.onSavedPaymentMethodRemove,P=t.onSavedPaymentMethodUpdate,_=t.onAvailablePaymentMethodsChange,D=j("mounts <".concat(n,">")),T="elements"in D?D.elements:null,O="checkoutState"in D?D.checkoutState:null,F=(null==O?void 0:O.type)==="success"||(null==O?void 0:O.type)==="loading"?O.sdk:null,B=l(a.default.useState(null),2),L=B[0],z=B[1],K=a.default.useRef(null),U=a.default.useRef(null);c(L,"blur",x),c(L,"focus",g),c(L,"escape",v),c(L,"click",w),c(L,"loaderror",S),c(L,"loaderstart",N),c(L,"networkschange",C),c(L,"confirm",A),c(L,"cancel",I),c(L,"shippingaddresschange",E),c(L,"shippingratechange",M),c(L,"savedpaymentmethodremove",R),c(L,"savedpaymentmethodupdate",P),c(L,"availablepaymentmethodschange",_),c(L,"change",b),y&&(s="expressCheckout"===e?y:function(){y(L)}),c(L,"ready",s),a.default.useLayoutEffect(function(){if(null===K.current&&null!==U.current&&(T||F)){var t=null;if(F)switch(e){case"paymentForm":t=F.createForm(f);break;case"payment":t=F.createPaymentElement(f);break;case"address":if("mode"in f){var a=f.mode,s=function(e,t){if(null==e)return{};var a,s,r=function(e,t){if(null==e)return{};var a,s,r={},i=Object.keys(e);for(s=0;s<i.length;s++)a=i[s],t.indexOf(a)>=0||(r[a]=e[a]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)a=i[s],!(t.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}(f,k);if("shipping"===a)t=F.createShippingAddressElement(s);else if("billing"===a)t=F.createBillingAddressElement(s);else throw Error("Invalid options.mode. mode must be 'billing' or 'shipping'.")}else throw Error("You must supply options.mode. mode must be 'billing' or 'shipping'.");break;case"expressCheckout":t=F.createExpressCheckoutElement(f);break;case"currencySelector":t=F.createCurrencySelectorElement();break;case"taxId":t=F.createTaxIdElement(f);break;case"contactDetails":t=F.createContactDetailsElement();break;default:throw Error("<".concat(n,"> is not supported inside a checkout provider. Use an <Elements> provider instead."))}else T&&(t=T.create(e,f));K.current=t,z(t),t&&t.mount(U.current)}},[T,F,f]);var $=u(f);return a.default.useEffect(function(){if(K.current){var e,t,a,s=(e=f,t=$,a=["paymentRequest"],h(e)?Object.keys(e).reduce(function(s,r){var n=!h(t)||!m(e[r],t[r]);return a.includes(r)?(n&&console.warn("Unsupported prop change: options.".concat(r," is not a mutable property.")),s):n?i(i({},s||{}),{},o({},r,e[r])):s},null):null);s&&"update"in K.current&&K.current.update(s)}},[f,$]),a.default.useLayoutEffect(function(){return function(){if(K.current&&"function"==typeof K.current.destroy)try{K.current.destroy(),K.current=null}catch(e){}}},[]),a.default.createElement("div",{id:r,className:d,ref:U})};return d.propTypes={id:s.default.string,className:s.default.string,onChange:s.default.func,onBlur:s.default.func,onFocus:s.default.func,onReady:s.default.func,onEscape:s.default.func,onClick:s.default.func,onLoadError:s.default.func,onLoaderStart:s.default.func,onNetworksChange:s.default.func,onConfirm:s.default.func,onCancel:s.default.func,onShippingAddressChange:s.default.func,onShippingRateChange:s.default.func,onSavedPaymentMethodRemove:s.default.func,onSavedPaymentMethodUpdate:s.default.func,onAvailablePaymentMethodsChange:s.default.func,options:s.default.object},d.displayName=n,d.__elementType=e,d},N="u"<typeof window,C=a.default.createContext(null);C.displayName="EmbeddedCheckoutProviderContext";var A=function(){var e=a.default.useContext(C);if(!e)throw Error("<EmbeddedCheckout> must be used within <EmbeddedCheckoutProvider>");return e},I=N?function(e){var t=e.id,s=e.className;return A(),a.default.createElement("div",{id:t,className:s})}:function(e){var t=e.id,s=e.className,r=A().embeddedCheckout,i=a.default.useRef(!1),n=a.default.useRef(null);return a.default.useLayoutEffect(function(){return!i.current&&r&&null!==n.current&&(r.mount(n.current),i.current=!0),function(){if(i.current&&r)try{r.unmount(),i.current=!1}catch(e){}}},[r]),a.default.createElement("div",{ref:n,id:t,className:s})};function E(e){return(E="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}S("auBankAccount",N),S("card",N),S("cardNumber",N),S("cardExpiry",N),S("cardCvc",N),S("iban",N),S("payment",N),S("expressCheckout",N),S("paymentRequestButton",N),S("linkAuthentication",N),S("contactDetails",N),S("address",N),S("shippingAddress",N),S("paymentMethodMessaging",N),S("taxId",N),S("issuingCardNumberDis
141play",N),S("issuingCardCvcDisplay",N),S("issuingCardExpiryDisplay",N),S("issuingCardPinDisplay",N),S("issuingCardCopyButton",N),e.s(["EmbeddedCheckout",0,I,"EmbeddedCheckoutProvider",0,function(e){var t=e.stripe,s=e.options,r=e.children,i=a.default.useMemo(function(){return g(t,"Invalid prop `stripe` supplied to `EmbeddedCheckoutProvider`. We recommend using the `loadStripe` utility from `@stripe/stripe-js`. See https://stripe.com/docs/stripe-js/react#elements-props-stripe for details.")},[t]),n=a.default.useRef(null),o=a.default.useRef(null),d=l(a.default.useState({embeddedCheckout:null}),2),c=d[0],h=d[1];a.default.useEffect(function(){if(!o.current&&!n.current){var e=function(e){o.current||n.current||(o.current=e,n.current=o.current.createEmbeddedCheckoutPage(s).then(function(e){h({embeddedCheckout:e})}))};"async"===i.tag&&!o.current&&(s.clientSecret||s.fetchClientSecret)?i.stripePromise.then(function(t){t&&e(t)}):"sync"===i.tag&&!o.current&&(s.clientSecret||s.fetchClientSecret)&&e(i.stripe)}},[i,s,c,o]),a.default.useEffect(function(){return function(){c.embeddedCheckout?(n.current=null,c.embeddedCheckout.destroy()):n.current&&n.current.then(function(){n.current=null,c.embeddedCheckout&&c.embeddedCheckout.destroy()})}},[c.embeddedCheckout]),a.default.useEffect(function(){y(o)},[o]);var p=u(t);a.default.useEffect(function(){null!==p&&p!==t&&console.warn("Unsupported prop change on EmbeddedCheckoutProvider: You cannot change the `stripe` prop after setting it.")},[p,t]);var m=u(s);return a.default.useEffect(function(){if(null!=m){if(null==s)return void console.warn("Unsupported prop change on EmbeddedCheckoutProvider: You cannot unset options after setting them.");void 0===s.clientSecret&&void 0===s.fetchClientSecret&&console.warn("Invalid props passed to EmbeddedCheckoutProvider: You must provide one of either `options.fetchClientSecret` or `options.clientSecret`."),null!=m.clientSecret&&s.clientSecret!==m.clientSecret&&console.warn("Unsupported prop change on EmbeddedCheckoutProvider: You cannot change the client secret after setting it. Unmount and create a new instance of EmbeddedCheckoutProvider instead."),null!=m.fetchClientSecret&&s.fetchClientSecret!==m.fetchClientSecret&&console.warn("Unsupported prop change on EmbeddedCheckoutProvider: You cannot change fetchClientSecret after setting it. Unmount and create a new instance of EmbeddedCheckoutProvider instead."),null!=m.onComplete&&s.onComplete!==m.onComplete&&console.warn("Unsupported prop change on EmbeddedCheckoutProvider: You cannot change the onComplete option after setting it."),null!=m.onShippingDetailsChange&&s.onShippingDetailsChange!==m.onShippingDetailsChange&&console.warn("Unsupported prop change on EmbeddedCheckoutProvider: You cannot change the onShippingDetailsChange option after setting it."),null!=m.onLineItemsChange&&s.onLineItemsChange!==m.onLineItemsChange&&console.warn("Unsupported prop change on EmbeddedCheckoutProvider: You cannot change the onLineItemsChange option after setting it.")}},[m,s]),a.default.createElement(C.Provider,{value:c},r)}],667668);var M="dahlia",R="https://js.stripe.com",P="".concat(R,"/").concat(M,"/stripe.js"),_=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,D=/^https:\/\/js\.stripe\.com\/(v3|[a-z]+)\/stripe\.js(\?.*)?$/,T=function(){for(var e=document.querySelectorAll('script[src^="'.concat(R,'"]')),t=0;t<e.length;t++){var a,s=e[t];if(a=s.src,_.test(a)||D.test(a))return s}return null},O=function(e){var t=e&&!e.advancedFraudSignals?"?advancedFraudSignals=false":"",a=document.createElement("script");a.src="".concat(P).concat(t);var s=document.head||document.body;if(!s)throw Error("Expected document.body not to be null. Stripe.js requires a <body> element.");return s.appendChild(a),a},F=function(e,t){e&&e._registerWrapper&&e._registerWrapper({name:"stripe-js",version:"9.6.0",startTime:t})},B=null,L=null,z=null,K=function(e,t,a){if(null===e)return null;var s,r=t[0];if("string"!=typeof r)throw Error("Expected publishable key to be of type string, got type ".concat(E(r)," instead."));var i=r.match(/^pk_test/),n=3===(s=e.version)?"v3":s;i&&n!==M&&console.warn("Stripe.js@".concat(n," was loaded on the page, but @stripe/stripe-js@").concat("9.6.0"," expected Stripe.js@").concat(M,". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));var o=e.apply(void 0,t);return F(o,a),o},U=!1,$=function(){return t||(t=(null!==B?B:(B=new Promise(function(e,t){if("u"<typeof window||"u"<typeof document)return void e(null);if(window.Stripe,window.Stripe)return void e(window.Stripe);try{var a,s=T();s?s&&null!==z&&null!==L&&(s.removeEventListener("load",z),s.removeEventListener("error",L),null==(a=s.parentNode)||a.removeChild(s),s=O(null)):s=O(null),z=function(){window.Stripe?e(window.Stripe):t(Error("Stripe.js not available"))},L=function(e){t(Error("Failed to load Stripe.js",{cause:e}))},s.addEventListener("load",z),s.addEventListener("error",L)}catch(e){t(e);return}})).catch(function(e){return B=null,Promise.reject(e)})).catch(function(e){return t=null,Promise.reject(e)}))};Promise.resolve().then(function(){return $()}).catch(function(e){U||console.warn(e)}),e.s(["loadStripe",0,function(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++)t[a]=arguments[a];U=!0;var s=Date.now();return $().then(function(e){return K(e,t,s)})}],911860),e.s([],540259)},871689,e=>{"use strict";let t=(0,e.i(475254).default)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);e.s(["ArrowLeft",0,t],871689)},173855,465261,350627,e=>{"use strict";e.s(["CheckoutPage",()=>N,"default",()=>C],173855),e.i(247167);var t=e.i(843476),a=e.i(514089),s=e.i(667668);e.i(540259);var r=e.i(911860),i=e.i(871689),n=e.i(531278),o=e.i(263488),l=e.i(581418),d=e.i(522016),c=e.i(618566),u=e.i(271645),h=e.i(456629),p=e.i(261238),m=e.i(519455),f=e.i(515288),x=e.i(557951),g=e.i(567018),y=e.i(510735),b=e.i(410396),v=e.i(793479),w=e.i(956694);let j=({onProceed:e})=>{let[a,s]=u.default.useState(""),[r,i]=u.default.useState(!1),[n,o]=u.default.useState(null),[l,c]=u.default.useState(null),h=async t=>{t.preventDefault();let s=a.trim();if(s&&!r){i(!0),o(null),c(null);try{let t=await (0,p.fetchData)("https://gksc-prod-backend-290557432249.us-east1.run.app/api/store/checkout/access-check","POST",{email:s},!1,void 0,!0);t.hasAccess?c("hasAccess"):t.deactivated?c("deactivated"):e(s)}catch(e){o(e instanceof Error?e.message:"ACCESS_CHECK_FAILED")}finally{i(!1)}}};return(0,t.jsx)(f.Card,{children:(0,t.jsxs)(f.CardContent,{className:"space-y-4 p-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"text-lg font-semibold text-gray-900",children:"Enter your email to continue"}),(0,t.jsx)("p",{className:"mt-1 text-sm text-gray-600",children:"We'll send your receipt and secure document links here."})]}),"hasAccess"===l?(0,t.jsxs)("div",{className:"space-y-3 rounded-md border border-blue-200 bg-blue-50/50 p-4",children:[(0,t.jsx)("p",{className:"text-sm text-gray-900",children:"This email already has a KeyPedia account with platform access. Please sign in to view this document."}),(0,t.jsx)(m.Button,{asChild:!0,children:(0,t.jsx)(d.default,{href:"/auth/signin",children:"Sign in"})})]}):"deactivated"===l?(0,t.jsx)("div",{className:"rounded-md border border-amber-200 bg-amber-50/60 p-4",children:(0,t.jsx)("p",{className:"text-sm text-gray-900",children:"Your account needs to be reactivated â please contact us before purchasing."})}):(0,t.jsxs)("form",{onSubmit:h,className:"space-y-3",children:[(0,t.jsx)(v.Input,{type:"email","aria-label":"Email address",placeholder:"[email protected]",value:a,onChange:e=>s(e.target.value),disabled:r}),(0,t.jsx)(w.StoreErrorNotice,{error:n}
141),(0,t.jsx)(m.Button,{type:"submit",disabled:r||!a.trim(),className:"w-full",children:r?"Checkingâ¦":"Continue to payment"})]})]})})},k="pk_live_51PsXEfDx2fqvyoZWWx4RX4k50nqpMxux6O8mZjj9N7RczdsDsT75uKtP97MPhVa2EsX5BgcDXmMwvI8SADVqCeP600aR9Y9bWi",S=(0,r.loadStripe)(k),N=()=>{let e=(0,c.useRouter)(),{loading:r}=(0,x.useAuth)(),{cart:v,loading:w,isGuest:N,removeFromCart:C}=(0,g.useCart)(),[A]=(0,a.useMutation)(y.CREATE_CHECKOUT_SESSION),I=u.default.useMemo(()=>v&&0!==v.items.length?v.items.map(e=>`${e.documentKind}:${e.documentId}`).join("|"):null,[v]),E=u.default.useRef(v?.items??[]);u.default.useEffect(()=>{E.current=v?.items??[]},[v]);let[M,R]=u.default.useState(null),[P,_]=u.default.useState(null),[D,T]=u.default.useState(null),[O,F]=u.default.useState(0),[B,L]=u.default.useState(null),[z,K]=u.default.useState(!1),U=v?.items??[],$=U.length,V=v?.computed?.totalCents??0,H=u.default.useCallback(t=>{let a=t instanceof Error?t.message:String(t);if(a.includes("ABOVE_GLOBAL_CAP"))T("Your cart exceeds $15,000. Please contact sales for an enterprise quote.");else if(a.includes("CART_EMPTY"))e.replace("/cart");else if(a.includes("INVALID_EMAIL"))T("That email address looks invalid. Please double-check it.");else if(a.includes("INVALID_DOCUMENT")){let e=a.match(/INVALID_DOCUMENT(?:\s*:\s*([^:\s]+):([^\s)]+))?/);e&&e[1]&&e[2]?(L({kind:e[1],id:e[2]}),T(`One of the documents in your cart is no longer available (${e[1]}:${e[2].slice(0,8)}â¦). Remove it to continue.`)):T("One of the documents in your cart is no longer available. Edit your cart and try again.")}else T(a.replace(/^GraphQL error: /,""))},[e]),q=u.default.useRef(!1),G=u.default.useCallback(async()=>{if(B){K(!0);try{let e=(v?.items??[]).find(e=>e.documentKind===B.kind&&e.documentId===B.id);e&&await C(e.id),T(null),L(null),R(null),q.current=!1,F(e=>e+1)}catch(e){T(e instanceof Error?e.message:"Failed to remove item. Please edit cart.")}finally{K(!1)}}},[B,v?.items,C]);return u.default.useEffect(()=>{if(q.current||r||w)return;if(!I)return void e.replace("/cart");if(N&&!P)return;q.current=!0;let t=!1;return(async()=>{try{if(N){let e=E.current.map(e=>({documentKind:e.documentKind,documentId:e.documentId})),a=await (0,p.fetchData)("https://gksc-prod-backend-290557432249.us-east1.run.app/api/store/checkout/guest","POST",{items:e,email:P,uiMode:"embedded"},!1,void 0,!0);if(t)return;let s=a?.clientSecret;if(!s)return void T("Stripe did not return a session. Please try again.");R(s)}else{let e=await A({variables:{uiMode:"embedded"}});if(t)return;let a=e.data?.createCheckoutSession?.clientSecret;if(!a)return void T("Stripe did not return a session. Please try again.");R(a)}}catch(e){if(t)return;H(e)}})(),()=>{t=!0}},[!k,r,w,I,N,P,H,A,e,O]),(0,t.jsx)(h.default,{children:(0,t.jsx)("div",{className:"min-h-[80vh] bg-gradient-to-br from-gray-50 to-blue-50/30 py-10",children:(0,t.jsxs)("div",{className:"mx-auto max-w-6xl px-4",children:[(0,t.jsxs)("div",{className:"mb-6 flex flex-wrap items-end justify-between gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h1",{className:"text-2xl font-semibold text-gray-900",children:"Checkout"}),(0,t.jsx)("p",{className:"mt-1 text-sm text-gray-600",children:"Secure payment."})]}),(0,t.jsxs)(d.default,{href:"/cart",className:"inline-flex items-center gap-1 text-sm font-medium text-blue-600 hover:underline",children:[(0,t.jsx)(i.ArrowLeft,{className:"h-4 w-4"}),"Edit cart"]})]}),D?(0,t.jsx)(f.Card,{children:(0,t.jsxs)(f.CardContent,{className:"py-12 text-center",children:[(0,t.jsx)("p",{className:"text-base text-red-600",children:D}),(0,t.jsxs)("div",{className:"mt-4 flex flex-wrap justify-center gap-3",children:[(0,t.jsx)(m.Button,{variant:"outline",onClick:()=>e.push("/cart"),children:"Back to cart"}),B?(0,t.jsx)(m.Button,{onClick:G,disabled:z,children:z?"Removingâ¦":"Remove unavailable item & retry"}):(0,t.jsx)(m.Button,{onClick:()=>{T(null),R(null),q.current=!1,F(e=>e+1)},children:"Try again"})]})]})}):(0,t.jsxs)("div",{className:"grid gap-6 lg:grid-cols-[1fr_360px]",children:[N&&!P?(0,t.jsx)(j,{onProceed:_}):(0,t.jsx)("div",{className:"rounded-xl border bg-surface shadow-sm",children:M?(0,t.jsx)(s.EmbeddedCheckoutProvider,{stripe:S,options:{clientSecret:M},children:(0,t.jsx)(s.EmbeddedCheckout,{})}):(0,t.jsxs)("div",{className:"flex min-h-[400px] flex-col items-center justify-center p-10 text-center",children:[(0,t.jsx)(n.Loader2,{className:"h-6 w-6 animate-spin text-gray-400"}),(0,t.jsx)("p",{className:"mt-3 text-sm text-gray-500",children:"Preparing your secure payment formâ¦"}),N&&(0,t.jsx)("p",{className:"mt-4 max-w-sm text-xs text-gray-500",children:"Stripe will ask for your email on the next screen. The same address receives your receipt, document links, and a single-use link to set a password."})]})}),(0,t.jsxs)("div",{className:"space-y-3 lg:sticky lg:top-24 lg:self-start",children:[(0,t.jsx)(f.Card,{className:"border-blue-200 bg-blue-50/40",children:(0,t.jsxs)(f.CardContent,{className:"space-y-2 p-5",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm font-semibold text-gray-900",children:[(0,t.jsx)(o.Mail,{className:"h-4 w-4 text-blue-700"}),"What happens after you pay"]}),(0,t.jsxs)("p",{className:"rounded-md border border-blue-200 bg-surface/70 px-2 py-1.5 text-xs text-gray-900",children:[(0,t.jsx)("span",{className:"font-semibold",children:"Important:"})," the email you enter at payment becomes the owner of these documents. All receipts, secure PDF links, and account-setup instructions are sent to that address."]}),(0,t.jsxs)("ol",{className:"space-y-1.5 pl-1 text-xs text-gray-800",children:[(0,t.jsx)("li",{children:"1. We email a receipt and secure links to each PDF you bought."}),(0,t.jsxs)("li",{children:["2."," ",N?(0,t.jsxs)(t.Fragment,{children:["The same email contains a single-use link to set a password and unlock your library at ",(0,t.jsx)("span",{className:"font-mono",children:"/account/library"}),"."]}):(0,t.jsxs)(t.Fragment,{children:["One-click access to your document library at"," ",(0,t.jsx)("span",{className:"font-mono",children:"/account/library"}),"."]})]}),(0,t.jsxs)("li",{children:["3. ",$," document",1===$?"":"s",", permanent access, no subscription, available immediately."]})]})]})}),(0,t.jsx)(f.Card,{children:(0,t.jsxs)(f.CardContent,{className:"space-y-4 p-6",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm font-medium text-gray-900",children:[(0,t.jsx)(l.ShieldCheck,{className:"h-4 w-4 text-emerald-500"}),"Order summary"]}),(0,t.jsx)(d.default,{href:"/cart",className:"text-xs font-medium text-blue-600 hover:underline",children:"Edit"})]}),(0,t.jsx)("div",{className:"space-y-2 text-sm",children:U.map(e=>{let a,s=e.documentLabel||`${e.documentKind}:${(a=e.documentId).length>12?`${a.slice(0,8)}â¦`:a}`;return(0,t.jsxs)("div",{className:"flex justify-between gap-3 text-gray-700",children:[(0,t.jsx)("span",{className:"line-clamp-2",children:s}),(0,t.jsx)("span",{className:"shrink-0 font-medium text-gray-900",children:(0,b.formatCents)(e.unitAmou
141ntCentsSnapshot)})]},e.id)})}),(0,t.jsxs)("div",{className:"flex justify-between border-t pt-3 text-base font-semibold",children:[(0,t.jsx)("span",{children:"Total"}),(0,t.jsx)("span",{children:(0,b.formatCents)(V)})]})]})})]})]})]})})})},C=N;var A=e.i(475254);let I=(0,A.default)("key-round",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);e.s(["KeyRound",0,I],465261);let E=(0,A.default)("receipt",[["path",{d:"M4 2v20l2-1 2 1 2-1 2 1 2-1 2 1 2-1 2 1V2l-2 1-2-1-2 1-2-1-2 1-2-1-2 1Z",key:"q3az6g"}],["path",{d:"M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8",key:"1h4pet"}],["path",{d:"M12 17.5v-11",key:"1jc1ny"}]]);e.s(["Receipt",0,E],350627)},34095,e=>{"use strict";let t=(0,e.i(475254).default)("library-big",[["rect",{width:"8",height:"18",x:"3",y:"3",rx:"1",key:"oynpb5"}],["path",{d:"M7 3v18",key:"bbkbws"}],["path",{d:"M20.4 18.9c.2.5-.1 1.1-.6 1.3l-1.9.7c-.5.2-1.1-.1-1.3-.6L11.1 5.1c-.2-.5.1-1.1.6-1.3l1.9-.7c.5-.2 1.1.1 1.3.6Z",key:"1qboyk"}]]);e.s(["LibraryBig",0,t],34095)},326438,10488,e=>{"use strict";e.s(["LibraryPage",()=>R,"default",()=>P],326438);var t=e.i(843476),a=e.i(138413),s=e.i(778917),r=e.i(178583),i=e.i(465261),n=e.i(531278),o=e.i(263488),l=e.i(350627),d=e.i(522016),c=e.i(271645),u=e.i(569649),h=e.i(456629),p=e.i(519455),m=e.i(515288),f=e.i(124558),x=e.i(557951),g=e.i(250623),y=e.i(947505),b=e.i(510735),v=e.i(34095),w=e.i(618566);e.i(911046);var j=e.i(624114);e.i(652680);var k=e.i(833889),S=e.i(858047);e.i(98972);var N=e.i(386183),C=e.i(150489);e.i(462379);var A=e.i(157356);let I={freeTextLabel:"Search your documents for",freeTextRow:!1,categories:[{key:"my_documents",title:"My Documents",icon:v.LibraryBig,noSelectAll:!0,badge:{label:"Purchased",className:"bg-emerald-50 text-emerald-700"}}]},E=({className:e})=>{let a=(0,w.useRouter)(),{query:s,setQuery:r,debouncedQuery:i}=(0,k.useOmniSearchQuery)(),n=function(){let[e,t]=c.default.useState(""),[a,s]=c.default.useState(!1);return{state:null,appliedState:null,setState:()=>void 0,hasState:!1,hasUnappliedChanges:!1,commit:()=>void 0,clear:()=>t(""),auxText:e,setAuxText:t,busy:a,setBusy:s}}(),{candidates:o,loading:l}=(0,C.useGatewaySuggestions)(i,{surface:"library"}),{groups:d,bestMatch:u}=c.default.useMemo(()=>(0,S.buildGroups)(o,I),[o]);return(0,t.jsx)(A.SearchSessionProvider,{surface:"library",adapter:n,children:(0,t.jsx)(j.SearchBar,{surface:"library",slots:{},id:"library-omni",config:I,query:s,onQueryChange:r,groups:d,bestMatch:u,loading:l,onCandidate:e=>{let t;(t=(0,N.internalHref)(e.url))&&a.push(t)},onFreeText:()=>void 0,placeholder:"Search your purchased documentsâ¦",ariaLabel:"Search your purchased documents",clearOnSelect:!1,emptyState:"No purchased documents match.",className:e})})},M=({children:e})=>{let[a,s]=c.default.useState(!1);c.default.useEffect(()=>{s(!0)},[]);let{hasAnyPermissionGroups:r}=(0,g.useSubscription)();return a&&r([...f.DASHBOARD_CHROME_PERMISSION_GROUPS,"document_store"])?(0,t.jsx)(u.default,{title:"My Purchased Docs",bypassSubscriptionWall:!0,children:e}):(0,t.jsx)(h.default,{children:e})},R=()=>{let{user:e,loading:c}=(0,x.useAuth)(),{data:u,loading:h,error:f}=(0,a.useQuery)(b.GET_MY_LIBRARY,{fetchPolicy:"cache-and-network"}),g=u?.myLibrary??[];if(h&&0===g.length)return(0,t.jsx)(M,{children:(0,t.jsx)("div",{className:"flex min-h-[40vh] items-center justify-center",children:(0,t.jsx)(n.Loader2,{className:"h-6 w-6 animate-spin text-gray-400"})})});let v=!!f&&(f.message.includes("UNAUTHENTICATED")||f.message.toLowerCase().includes("authentication"));return!c&&(v||!e&&f)?(0,t.jsx)(M,{children:(0,t.jsx)("div",{className:"mx-auto max-w-xl px-4 py-16",children:(0,t.jsx)(m.Card,{children:(0,t.jsxs)(m.CardContent,{className:"space-y-4 py-10 text-center",children:[(0,t.jsx)(o.Mail,{className:"mx-auto h-10 w-10 text-blue-500"}),(0,t.jsx)("h1",{className:"text-xl font-semibold tracking-tight text-gray-900",children:"Open the link from your email to view your library"}),(0,t.jsx)("p",{className:"text-sm text-gray-600",children:"Your purchased documents are tied to the email you used at checkout. We sent you two emails the moment your payment cleared:"}
141),(0,t.jsxs)("ul",{className:"mx-auto max-w-md space-y-1 text-left text-xs text-gray-600",children:[(0,t.jsxs)("li",{children:[(0,t.jsx)("strong",{children:"Order receipt"})," with an ",(0,t.jsx)("em",{children:"Open your library"})," button."]}),(0,t.jsxs)("li",{children:[(0,t.jsx)("strong",{children:"Activate your KeyPedia account"})," with a magic link to set a password."]})]}),(0,t.jsxs)("p",{className:"text-xs text-gray-500",children:["Click either link from your inbox to land back here, signed in. If nothing arrived, search for ",(0,t.jsx)("code",{className:"font-mono",children:"Order #"})," or check spam."]}),(0,t.jsxs)("div",{className:"flex flex-col items-stretch gap-2 pt-2 sm:flex-row sm:justify-center",children:[(0,t.jsx)(p.Button,{asChild:!0,variant:"outline",children:(0,t.jsxs)(d.default,{href:"/auth/signin?next=/account/library",children:[(0,t.jsx)(i.KeyRound,{className:"mr-1 h-4 w-4"}),"Sign in with email and password"]})}),(0,t.jsx)(p.Button,{asChild:!0,children:(0,t.jsx)(d.default,{href:"/records",children:"Keep browsing"})})]})]})})})}):f?(0,t.jsx)(M,{children:(0,t.jsxs)("div",{className:"mx-auto max-w-3xl px-4 py-16 text-center text-red-600",children:["Failed to load your library. ",f.message]})}):e&&0===g.length?(0,t.jsx)(M,{children:(0,t.jsxs)("div",{className:"mx-auto max-w-3xl px-4 py-16 text-center",children:[(0,t.jsx)("h1",{className:"text-2xl font-semibold",children:"My Purchased Docs"}),(0,t.jsx)("p",{className:"mt-3 text-gray-600",children:"You don't have any purchased documents yet."}),(0,t.jsx)(p.Button,{asChild:!0,className:"mt-6",children:(0,t.jsx)(d.default,{href:"/records",children:"Browse documents"})})]})}):(0,t.jsx)(M,{children:(0,t.jsxs)("div",{className:"mx-auto max-w-5xl px-4 py-12",children:[(0,t.jsxs)("div",{className:"mb-8",children:[(0,t.jsx)("h1",{className:"text-3xl font-semibold text-gray-900",children:"My Purchased Docs"}),(0,t.jsxs)("p",{className:"mt-2 text-sm text-gray-600",children:[g.length," document",1===g.length?"":"s"," ready to open or download."]}),(0,t.jsx)(E,{className:"mt-4 max-w-xl"})]}),(0,t.jsx)("div",{className:"grid gap-4 md:grid-cols-2",children:g.map(e=>{let a,i=(e=>{let t=(0,y.safeSeoHref)(e.dashboardUrl);if(t)return{href:t,isInApp:!0};let a=(0,y.safeSeoHref)(e.seoUrl);if(a)return{href:a,isInApp:!1};let s=(0,y.safeSeoHref)(e.documentUrl);return s?{href:s,isInApp:!1}:null})(e);return(0,t.jsxs)(m.Card,{className:"transition-shadow hover:shadow-md",children:[(0,t.jsx)(m.CardHeader,{className:"pb-3",children:(0,t.jsx)(m.CardTitle,{className:"line-clamp-2 text-base",children:e.documentLabel})}),(0,t.jsxs)(m.CardContent,{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-xs text-gray-500",children:[(0,t.jsx)(r.FileText,{className:"h-3 w-3"}),(0,t.jsx)("span",{children:e.documentKind}),(0,t.jsx)("span",{children:"·"}),(0,t.jsxs)("span",{children:["Purchased ",(e=>{try{return new Date(e).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}catch{return e}})(e.grantedAt)]})]}),i?(0,t.jsx)(p.Button,{asChild:!0,variant:"outline",className:"w-full",children:i.isInApp?(0,t.jsxs)(d.default,{href:i.href,children:["Open document to download",(0,t.jsx)(s.ExternalLink,{className:"ml-2 h-3 w-3"})]}):(0,t.jsxs)("a",{href:i.href,target:"_blank",rel:"noreferrer",children:["Open document to download",(0,t.jsx)(s.ExternalLink,{className:"ml-2 h-3 w-3"})]})}):(0,t.jsx)(p.Button,{variant:"outline",className:"w-full",disabled:!0,children:"Document unavailable"}),(e.receiptUrl||e.shortOrderId)&&(a=(0,y.safeSeoHref)(e.receiptUrl),(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2 border-t border-gray-100 pt-2 text-[11px] text-gray-500",children:[e.shortOrderId?(0,t.jsxs)("span",{className:"font-mono",children:["Order #",e.shortOrderId]}):(0,t.jsx)("span",{}),a&&(0,t.jsxs)("a",{href:a,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 font-medium text-blue-600 hover:underline",children:[(0,t.jsx)(l.Receipt,{className:"h-3 w-3"}),"Receipt"]})]}))]})]},e.id)})})]})})},P=R;var _=e.i(607486);let D=(0,e.i(475254).default)("radar",[["path",{d:"M19.07 4.93A10 10 0 0 0 6.99 3.34",key:"z3du51"}
141],["path",{d:"M4 6h.01",key:"oypzma"}],["path",{d:"M2.29 9.62A10 10 0 1 0 21.31 8.35",key:"qzzz0"}],["path",{d:"M16.24 7.76A6 6 0 1 0 8.23 16.67",key:"1yjesh"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M17.99 11.66A6 6 0 0 1 15.77 16.67",key:"1u2y91"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"m13.41 10.59 5.66-5.66",key:"mhq4k0"}]]);e.s(["ProfileValueCallout",0,function({companyName:e,profileHref:a}){let s=(0,c.useId)();return(0,t.jsx)("section",{"aria-labelledby":s,className:"mt-8 border border-primary-200 bg-surface/90 p-5 shadow-sm md:p-6",children:(0,t.jsxs)("div",{className:"grid gap-5 md:grid-cols-[1fr_auto] md:items-center",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-xs font-bold tracking-[0.14em] text-primary-700 uppercase",children:"Document or profile"}),(0,t.jsx)("h2",{id:s,className:"mt-2 text-xl font-semibold text-gray-900",children:"One record shows the event. A profile shows the pattern."}),(0,t.jsxs)("div",{className:"mt-4 grid gap-3 sm:grid-cols-2",children:[(0,t.jsxs)("div",{className:"flex gap-3",children:[(0,t.jsx)(r.FileText,{className:"mt-0.5 h-5 w-5 shrink-0 text-gray-500","aria-hidden":!0}),(0,t.jsxs)("p",{className:"text-sm leading-6 text-gray-700",children:[(0,t.jsx)("strong",{className:"text-gray-900",children:"Buy this document"})," for the source file and details behind this single event."]})]}),(0,t.jsxs)("div",{className:"flex gap-3",children:[(0,t.jsx)(D,{className:"mt-0.5 h-5 w-5 shrink-0 text-primary-700","aria-hidden":!0}),(0,t.jsxs)("p",{className:"text-sm leading-6 text-gray-700",children:[(0,t.jsx)("strong",{className:"text-gray-900",children:"Choose full profile access"})," to connect related records, sites, people, citations, and enforcement history in one view."]})]})]})]}),(0,t.jsx)(p.Button,{asChild:!0,variant:"outline",className:"max-w-full border-primary-300 text-primary-700",children:(0,t.jsxs)(d.default,{href:a,children:[(0,t.jsx)(_.Building2,{className:"mr-2 h-4 w-4 shrink-0","aria-hidden":!0}),(0,t.jsxs)("span",{className:"min-w-0 truncate",children:["Explore ",e]})]})})]})})}],10488)},503116,e=>{"use strict";let t=(0,e.i(475254).default)("clock",[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);e.s(["Clock",0,t],503116)},739619,e=>{"use strict";let t;var a=e.i(843476),s=e.i(271645),r=e.i(30030),i=e.i(820783),n=e.i(326999),o=e.i(981140),l=Symbol("radix.slottable"),d="AlertDialog",[c,u]=(0,r.createContextScope)(d,[n.createDialogScope]),h=(0,n.createDialogScope)(),p=e=>{let{__scopeAlertDialog:t,...s}=e,r=h(t);return(0,a.jsx)(n.Root,{...r,...s,modal:!0})};p.displayName=d;var m=s.forwardRef((e,t)=>{let{__scopeAlertDialog:s,...r}=e,i=h(s);return(0,a.jsx)(n.Trigger,{...i,...r,ref:t})});m.displayName="AlertDialogTrigger";var f=e=>{let{__scopeAlertDialog:t,...s}=e,r=h(t);return(0,a.jsx)(n.Portal,{...r,...s})};f.displayName="AlertDialogPortal";var x=s.forwardRef((e,t)=>{let{__scopeAlertDialog:s,...r}=e,i=h(s);return(0,a.jsx)(n.Overlay,{...i,...r,ref:t})});x.displayName="AlertDialogOverlay";var g="AlertDialogContent",[y,b]=c(g),v=((t=({children:e})=>(0,a.jsx)(a.Fragment,{children:e})).displayName="AlertDialogContent.Slottable",t.__radixId=l,t),w=s.forwardRef((e,t)=>{let{__scopeAlertDialog:r,children:l,...d}=e,c=h(r),u=s.useRef(null),p=(0,i.useComposedRefs)(t,u),m=s.useRef(null);return(0,a.jsx)(n.WarningProvider,{contentName:g,titleName:j,docsSlug:"alert-dialog",children:(0,a.jsx)(y,{scope:r,cancelRef:m,children:(0,a.jsxs)(n.Content,{role:"alertdialog",...c,...d,ref:p,onOpenAutoFocus:(0,o.composeEventHandlers)(d.onOpenAutoFocus,e=>{e.preventDefault(),m.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:[(0,a.jsx)(v,{children:l}),(0,a.jsx)(E,{contentRef:u})]})})})});w.displayName=g;var j="AlertDialogTitle",k=s.forwardRef((e,t)=>{let{__scopeAlertDialog:s,...r}=e,i=h(s);return(0,a.jsx)(n.Title,{...i,...r,ref:t})});k.displayName=j;var S="AlertDialogDescription",N=s.forwardRef((e,t)=>{let{__scopeAlertDialog:s,...r}=e,i=h(s);return(0,a.jsx)(n.Description,{...i,...r,ref:t})});N.displayName=S;var C=s.forwardRef((e,t)=>
141{let{__scopeAlertDialog:s,...r}=e,i=h(s);return(0,a.jsx)(n.Close,{...i,...r,ref:t})});C.displayName="AlertDialogAction";var A="AlertDialogCancel",I=s.forwardRef((e,t)=>{let{__scopeAlertDialog:s,...r}=e,{cancelRef:o}=b(A,s),l=h(s),d=(0,i.useComposedRefs)(t,o);return(0,a.jsx)(n.Close,{...l,...r,ref:d})});I.displayName=A;var E=({contentRef:e})=>{let t=`\`${g}\` requires a description for the component to be accessible for screen reader users. 142 143You can add a description to the \`${g}\` by passing a \`${S}\` component as a child, which also benefits sighted users by adding visible context to the dialog. 144 145Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${g}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component. 146 147For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return s.useEffect(()=>{document.getElementById(e.current?.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},M=e.i(519455),R=e.i(975157);let P=s.forwardRef(({className:e,...t},s)=>(0,a.jsx)(x,{className:(0,R.cn)("fixed inset-0 z-[70] bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:s}));P.displayName=x.displayName;let _=s.forwardRef(({className:e,...t},s)=>(0,a.jsxs)(f,{children:[(0,a.jsx)(P,{}),(0,a.jsx)(w,{ref:s,className:(0,R.cn)("fixed left-[50%] top-[50%] z-[70] grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...t})]}));_.displayName=w.displayName;let D=({className:e,...t})=>(0,a.jsx)("div",{className:(0,R.cn)("flex flex-col space-y-2 text-center sm:text-left",e),...t});D.displayName="AlertDialogHeader";let T=({className:e,...t})=>(0,a.jsx)("div",{className:(0,R.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});T.displayName="AlertDialogFooter";let O=s.forwardRef(({className:e,...t},s)=>(0,a.jsx)(k,{ref:s,className:(0,R.cn)("text-lg font-semibold",e),...t}));O.displayName=k.displayName;let F=s.forwardRef(({className:e,...t},s)=>(0,a.jsx)(N,{ref:s,className:(0,R.cn)("text-sm text-muted-foreground",e),...t}));F.displayName=N.displayName;let B=s.forwardRef(({className:e,...t},s)=>(0,a.jsx)(C,{ref:s,className:(0,R.cn)((0,M.buttonVariants)(),e),...t}));B.displayName=C.displayName;let L=s.forwardRef(({className:e,...t},s)=>(0,a.jsx)(I,{ref:s,className:(0,R.cn)((0,M.buttonVariants)({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));L.displayName=I.displayName,e.s(["AlertDialog",0,p,"AlertDialogAction",0,B,"AlertDialogCancel",0,L,"AlertDialogContent",0,_,"AlertDialogDescription",0,F,"AlertDialogFooter",0,T,"AlertDialogHeader",0,D,"AlertDialogTitle",0,O,"AlertDialogTrigger",0,m],739619)},359603,e=>{"use strict";var t=e.i(138413),a=e.i(510735);e.s(["useShopAccess",0,()=>{let{data:e,loading:s,error:r}=(0,t.useQuery)(a.GET_MY_LIBRARY_COUNT,{fetchPolicy:"cache-first",errorPolicy:"ignore"});return r?{isShopBuyer:!1,loading:!1}:{isShopBuyer:("number"==typeof e?.myLibraryCount?e.myLibraryCount:0)>0,loading:s}}])},954442,67388,94014,e=>{"use strict";e.s([],954442),e.i(204329),e.i(318021),e.i(305316),e.i(173855),e.i(74270),e.i(326438),e.i(10488),e.i(52048),e.s(["SuccessPage",()=>$,"default",()=>H],94014),e.i(247167);var t=e.i(843476);e.i(151718);var a=e.i(752842),s=e.i(496312),r=e.i(212181),i=e.i(595468),n=e.i(503116),o=e.i(174886),l=e.i(286536),d=e.i(77705),c=e.i(778917),u=e.i(27365),h=e.i(531278),p=e.i(263488),m=e.i(522016),f=e.i(618566),x=e.i(271645),g=e.i(456629),y=e.i(261238),b=e.i(959141),v=e.i(231535),w=e.i(638383),j=e.i(75814),k=e.i(739619),S=e.i(519455),N=e.i(515288),C=e.i(107308),A=e.i(793479),I=e.i(110204),E=e.i(772436),M=e.i(557951),R=e.i(546475),P=e.i(834289),_=e.i(613737);let D="gksClaimPrefillV1",T="gksClaimRedirectInFlightV1",O=()=>{if(void 0!==window.sessionStorage)try{sessionStorage.removeItem(D),sessionStorage.removeItem(T)}catch{}},F=()=>
147{if(void 0!==window.sessionStorage){if((()=>{if(void 0===window.sessionStorage)return!1;try{return"1"===sessionStorage.getItem(T)}catch{return!1}})()){try{sessionStorage.removeItem(T)}catch{}return}O()}},B=e=>{if(void 0===window.sessionStorage)return;let t={...e,expiresAt:Date.now()+12e4};try{sessionStorage.setItem(D,JSON.stringify(t))}catch{return}try{window.setTimeout(O,12e4)}catch{}try{window.addEventListener("pagehide",F,{once:!0}),window.addEventListener("beforeunload",F,{once:!0})}catch{}},L=()=>{if(void 0!==window.sessionStorage)try{sessionStorage.setItem(T,"1")}catch{}},z=()=>{O()};e.s(["clearClaimPrefill",0,z,"markClaimRedirectInFlight",0,L,"readClaimPrefill",0,()=>{if(void 0===window.sessionStorage)return null;let e=null;try{e=sessionStorage.getItem(D)}catch{return null}if(O(),!e)return null;try{let t=JSON.parse(e);if("number"==typeof t.expiresAt&&Number.isFinite(t.expiresAt)&&t.expiresAt<Date.now())return null;let{firstName:a,lastName:s,password:r}=t;return{firstName:a,lastName:s,password:r}}catch{return null}},"writeClaimPrefill",0,B],67388);var K=e.i(410396);let U=e=>e.slice(0,8).toUpperCase(),$=()=>{let e=(0,f.useSearchParams)(),{user:a}=(0,M.useAuth)(),s=e.get("order_id"),r=e.get("session_id"),[o,l]=x.default.useState(null),[d,u]=x.default.useState(!0),[p,b]=x.default.useState(!1),v=x.default.useRef(Date.now()),w=x.default.useCallback(async()=>{if(!s||!r)return null;let e=`https://gksc-prod-backend-290557432249.us-east1.run.app/api/store/checkout/status?order_id=${encodeURIComponent(s)}&session_id=${encodeURIComponent(r)}`,t=await (0,y.fetchData)(e,"GET",void 0,!1);return t?.status==="success"&&t?.order?t.order:null},[s,r]),j=o?.status==="paid";return(x.default.useEffect(()=>{if(!s||!r)return void u(!1);let e=!0,t=null,a=null,i=async()=>{try{let s=await w();if(!e)return;if(s&&(l(s),"paid"===s.status)){t&&clearInterval(t),a&&clearTimeout(a),u(!1),b(!1),(0,_.clearGuestCartStorage)();return}}catch{}};return i(),t=setInterval(()=>{i()},1500),a=setTimeout(()=>{e&&(u(!1),b(!0),clearInterval(t))},6e4),()=>{e=!1,clearInterval(t),a&&clearTimeout(a)}},[s,r,w]),x.default.useEffect(()=>{if(j)return;let e=setInterval(()=>{Date.now()-v.current>6e4&&d&&(u(!1),b(!0),clearInterval(e))},1e3);return()=>clearInterval(e)},[j,d]),s)?r?j||p||!d?!j&&p?(0,t.jsx)(g.default,{children:(0,t.jsx)("div",{className:"mx-auto max-w-xl px-4 py-16",children:(0,t.jsx)(N.Card,{children:(0,t.jsxs)(N.CardContent,{className:"flex flex-col items-center gap-4 py-12 text-center",children:[(0,t.jsx)(n.Clock,{className:"h-10 w-10 text-amber-500"}),(0,t.jsx)("h1",{className:"text-2xl font-semibold tracking-tight text-gray-900",children:"Provisioning is taking longer than usual"}),(0,t.jsx)("p",{className:"max-w-md text-sm text-gray-600",children:"Your payment was successful but we haven't seen the confirmation webhook yet. Your library will populate once Stripe finishes processing (typically within a few minutes), and you'll get a confirmation email. If nothing arrives within 24 hours, contact support with the order number below."}),(0,t.jsx)(G,{orderId:s}),(0,t.jsxs)("div",{className:"flex flex-col items-stretch gap-2 sm:flex-row",children:[(0,t.jsx)(S.Button,{variant:"outline",onClick:async()=>{try{let e=await w();if(e&&(l(e),"paid"===e.status)){b(!1),u(!1),(0,_.clearGuestCartStorage)();return}}catch{}},children:"Check again"}),(0,t.jsx)(S.Button,{asChild:!0,children:(0,t.jsx)(m.default,{href:"/account/library",children:"Open library"})})]})]})})})}):(0,t.jsx)(g.default,{children:(0,t.jsx)("div",{className:"mx-auto max-w-2xl px-4 py-12",children:(0,t.jsx)(N.Card,{children:(0,t.jsxs)(N.CardContent,{className:"space-y-6 px-6 py-10",children:[(0,t.jsxs)("div",{className:"flex flex-col items-center gap-3 text-center",children:[(0,t.jsx)(i.CheckCircle2,{className:"h-14 w-14 text-emerald-500"}),(0,t.jsx)("h1",{className:"text-2xl font-semibold tracking-tight text-gray-900",children:"Your purchase is ready"}),(0,t.jsx)("p",{className:"text-sm text-gray-600",children:"We've emailed your receipt and library link."})]}),(0,t.jsxs)("div",{className:"rounded-lg border border-gray-200 bg-gray-50 p-5",children:[(0,t.jsxs)("div",{className:"mb-4 flex flex-wrap items-center justify-between gap-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-[11px] font-semibold tracking-wider text-gray-500 uppercase",children:"Order"}),(0,t.jsxs)("p",{className:"mt-0.5 font-mono text-base text-gray-900",children:["#",U(o.id)]})]}),(0,t.jsxs)("div",{className:"text-right",children:[(0,t.jsx)("p",{className:"text-[11px] font-semibold tracking-wider text-gray-500 uppercase",children:"Total"}),(0,t.jsx)("p",{className:"mt-0.5 text-base font-semibold text-gray-900",children:(0,K.formatCents)(o.amountTotalCents,o.currency)})]})]}),(0,t.jsx)("ul",{className:"space-y-1.5 border-t border-gray-200 pt-3 text-sm",children:o.items.map(e=>(0,t.jsxs)("li",{className:"flex justify-between gap-3 text-gray-700",children:[(0,t.jsxs)("span",{className:"line-clamp-1",children:[e.documentKind.replace(/_/g," "),":"," ",(0,t.jsx)("span",{className:"font-mono text-xs text-gray-500",children:e.documentId.slice(0,8)})]}),(0,t.jsx)("span",{className:"shrink-0 font-medium text-gray-900",children:(0,K.formatCents)(e.unitAmou
147ntCents,o.currency)})]},e.id))}),(0,t.jsxs)("div",{className:"mt-4 flex flex-wrap items-center justify-between gap-2 border-t border-gray-200 pt-3",children:[(0,t.jsx)(W,{orderId:o.id}),o.receiptUrl&&(0,t.jsxs)("a",{href:o.receiptUrl,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 text-sm font-medium text-blue-600 hover:underline",children:["View Stripe receipt",(0,t.jsx)(c.ExternalLink,{className:"h-3 w-3"})]})]})]}),(0,t.jsx)(V,{orderId:o.id,sessionId:r,itemCount:o.items.length,isAuthenticated:!!a,buyerEmail:o.buyerEmail??null})]})})})}):(0,t.jsx)(g.default,{children:(0,t.jsx)("div",{className:"mx-auto max-w-xl px-4 py-16",children:(0,t.jsx)(N.Card,{children:(0,t.jsxs)(N.CardContent,{className:"flex flex-col items-center gap-4 py-12 text-center",children:[(0,t.jsx)(h.Loader2,{className:"h-10 w-10 animate-spin text-blue-600"}),(0,t.jsx)("h1",{className:"text-2xl font-semibold tracking-tight text-gray-900",children:"Confirming with Stripeâ¦"}),(0,t.jsx)("p",{className:"max-w-md text-sm text-gray-600",children:"Your payment is in. We're provisioning your access. This usually takes a few seconds."}),(0,t.jsx)(G,{orderId:s})]})})})}):(0,t.jsx)(g.default,{children:(0,t.jsxs)("div",{className:"mx-auto max-w-2xl px-4 py-16 text-center",children:[(0,t.jsx)("h1",{className:"text-2xl font-semibold",children:"Missing checkout session"}),(0,t.jsx)("p",{className:"mt-2 text-gray-600",children:"We need the checkout session ID to verify your purchase status. Please use the link from Stripe redirect or your receipt email."}),(0,t.jsx)(S.Button,{asChild:!0,className:"mt-6",children:(0,t.jsx)(m.default,{href:"/records",children:"Browse documents"})})]})}):(0,t.jsx)(g.default,{children:(0,t.jsxs)("div",{className:"mx-auto max-w-2xl px-4 py-16 text-center",children:[(0,t.jsx)("h1",{className:"text-2xl font-semibold",children:"Order not found"}),(0,t.jsx)("p",{className:"mt-2 text-gray-600",children:"We couldn't find an order ID in the URL. If you completed payment, your receipt has been emailed to you."}),(0,t.jsx)(S.Button,{asChild:!0,className:"mt-6",children:(0,t.jsx)(m.default,{href:"/account/library",children:"Open your library"})})]})})},V=({orderId:e,sessionId:i,itemCount:n,isAuthenticated:o,buyerEmail:c})=>{let g=(0,f.useRouter)(),{setRememberMe:N}=(0,M.useAuth)(),[_,D]=x.default.useState(!1),[T,O]=x.default.useState(!1),[F,K]=x.default.useState(!1),[U,$]=x.default.useState(!1),[V,H]=x.default.useState(null),[G,W]=x.default.useState(null),[Y,Q]=x.default.useState(null),[J,X]=x.default.useState(null),[Z,ee]=x.default.useState(""),[et,ea]=x.default.useState(""),[es,er]=x.default.useState(""),[ei,en]=x.default.useState(""),[eo,el]=x.default.useState(!1),[ed,ec]=x.default.useState(!1),[eu,eh]=x.default.useState(!1),ep=x.default.useMemo(()=>({length:es.length>=8,lower:/[a-z]/.test(es),upper:/[A-Z]/.test(es),number:/\d/.test(es),special:/[@$!%*?&]/.test(es)}),[es]),em=ep.length&&ep.lower&&ep.upper&&ep.number&&ep.special,ef=x.default.useCallback(async t=>{try{let a=await (0,y.fetchData)("https://gksc-prod-backend-290557432249.us-east1.run.app/api/store/checkout/magic-link","POST",{order_id:e,session_id:i,...t?{redirect_path:t}:{}},!1);if(a?.status==="success"&&"string"==typeof a?.magic_link_url)return{kind:"success",url:a.magic_link_url};if(a?.code==="ALREADY_ISSUED")return{kind:"already_issued"};if(a?.code==="ACCOUNT_EXISTS")return{kind:"account_exists",message:"string"==typeof a?.message?a.message:void 0};return{kind:"fail"}}catch(t){let e=t instanceof Error?t.message:"";if(e.includes("ALREADY_ISSUED")||e.includes("already been issued"))return{kind:"already_issued"};if(e.includes("ACCOUNT_EXISTS")||e.includes("already has a Global Key Solutions account"))return{kind:"account_exists"};return{kind:"fail"}}},[e,i]),ex=x.default.useCallback(()=>{window.location.assign("/account/library")},[]),eg=x.default.useCallback(async e=>{H(e),Q(null),N(!0);try{let t;switch(e){case"google":t=new a.GoogleAuthProvider;break;case"microsoft":t=new s.OAuthProvider("microsoft.com");break;case"okta":t=new s.OAuthProvider("oidc.okta")}let i=await (0,r.signInWithPopup)(b.auth,t);if(!i?.user)return;let n=await i.user.getIdToken();(0,P.setFirebaseTokenCookie)(n,!0);let o=await (0,R.signin)(n);
147if(o&&"object"==typeof o&&"status"in o){if("success"===o.status&&o.uid)return void g.push("/account/library");Q(o.message||"Sign-in completed but we could not verify your account.")}else Q("string"==typeof o?o:"Authentication failed.");try{await b.auth.signOut()}catch{}}catch(e){"auth/popup-closed-by-user"===e.code?Q("Sign-in was cancelled."):"auth/popup-blocked"===e.code?Q("Popup was blocked. Allow popups and try again."):Q("Sign-in failed. Use name and password below, or the link in your receipt email.")}finally{H(null)}},[g,N]),ey=x.default.useCallback(async()=>{W(null),X(null),K(!0);try{let e=await ef();if("success"===e.kind)return void window.location.assign(e.url);if("already_issued"===e.kind)return void W("A sign-in link for this order has already been issued. Open the link in your receipt email.");if("account_exists"===e.kind)return void X(e.message??"This email already has a KeyPedia account. Sign in to access your purchase.");W("We could not open your sign-in link. Use the link in your receipt email.")}finally{K(!1)}},[ef]),eb=x.default.useCallback(()=>{let t=new URLSearchParams({order:e});return`/auth/claim?${t.toString()}`},[e]),ev=x.default.useCallback(async()=>{Q(null);let e=Z.trim(),t=et.trim();if(!e||!t)return void Q("Please enter your first and last name.");if(!em)return void Q("Password must be at least 8 characters and include an uppercase letter, lowercase letter, number, and special character.");if(es!==ei)return void Q("Passwords do not match.");$(!0);try{B({firstName:e,lastName:t,password:es});let a=await ef(eb());if("success"===a.kind){L(),window.location.assign(a.url);return}if(z(),"already_issued"===a.kind)return void Q("A sign-in link for this order was already issued. Open the link from your receipt email.");if("account_exists"===a.kind)return void X(a.message??"This email already has a KeyPedia account. Sign in to access your purchase.");Q("We could not start account setup right now. Try again or use the link in your receipt email.")}catch(e){z(),console.error("handleStartAccountSetup unexpected error",e),Q("Something went wrong starting account setup. Try again or use the link in your receipt email.")}finally{$(!1)}},[Z,et,es,ei,ef,eb]),ew=F||U||null!==V;return(0,t.jsxs)("div",{className:"space-y-3",children:[o?(0,t.jsx)(S.Button,{size:"lg",className:"w-full bg-solid-violet-600 text-white shadow hover:bg-solid-violet-700",onClick:ex,children:"Access my documents"}):J?(0,t.jsxs)("div",{className:"space-y-3 rounded-lg border border-violet-200 bg-violet-50/60 p-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-sm font-semibold text-gray-900",children:"You already have an account with this email"}),(0,t.jsx)("p",{className:"mt-1 text-xs text-gray-700",children:J}),c&&(0,t.jsxs)("p",{className:"mt-2 text-[11px] text-gray-500",children:["Checkout email: ",(0,t.jsx)("span",{className:"font-medium text-gray-700",children:c})]})]}),(0,t.jsx)(S.Button,{size:"lg",className:"w-full bg-solid-violet-600 text-white shadow hover:bg-solid-violet-700",asChild:!0,children:(0,t.jsx)(m.default,{href:`/auth/signin?next=${encodeURIComponent("/account/library")}`,children:"Sign in to access your purchase"})}),(0,t.jsxs)("p",{className:"text-[11px] text-gray-500",children:["Forgot your password? Use the one-time link in your receipt email or"," ",(0,t.jsx)(m.default,{href:"/auth/forgot-password",className:"text-violet-700 underline decoration-violet-300 underline-offset-2 hover:text-violet-900",children:"reset it here"}),"."]})]}):(0,t.jsxs)(C.Collapsible,{open:_,onOpenChange:D,children:[(0,t.jsx)(C.CollapsibleTrigger,{asChild:!0,children:(0,t.jsx)(S.Button,{size:"lg",className:"w-full bg-solid-violet-600 text-white shadow hover:bg-solid-violet-700",disabled:ew,children:U?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(h.Loader2,{className:"mr-1 h-4 w-4 animate-spin"}),"Preparing your accountâ¦"]}):F?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(h.Loader2,{className:"mr-1 h-4 w-4 animate-spin"}),"Opening your linkâ¦"]}):"Access my documents"})}),(0,t.jsxs)(C.CollapsibleContent,{className:"mt-3 space-y-3 rounded-lg border border-gray-200 bg-surface p-3 sm:p-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-sm font-semibold text-gray-900",children:"Set up your account"}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-gray-600",children:"Use the same email as checkout. Add your name and password once, or continue with SSO if that email is already enabled for your organization."})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(I.Label,{className:"text-xs text-gray-700",children:"Checkout email"}),(0,t.jsx)(A.Input,{readOnly:!0,disabled:!0,value:c||"â",className:"h-9 cursor-not-allowed border-gray-200 bg-gray-100 text-gray-700","aria-readonly":!0}),(0,t.jsxs)("p",{className:"text-[11px] text-gray-500",children:["This email was used for purchase and owns these documents. Need a different email?"," ",(0,t.jsx)("a",{href:"mailto:[email protected]?subject=Switch%20account%20email",className:"text-violet-700 underline decoration-violet-300 underline-offset-2 hover:text-violet-900",children:"Contact support"})," ","to switch."]})]}),(0,t.jsxs)("div",{className:"grid gap-2 sm:grid-cols-3",children:[(0,t.jsxs)(S.Button,{type:"button",variant:"outline",size:"sm",className:"border-gray-300 bg-surface text-gray-700 hover:border-gray-400 hover:bg-gray-50 hover:text-gray-700",onClick:()=>eg("google"),disabled:null!==V||U,children:["google"===V?(0,t.jsx)(h.Loader2,{className:"mr-1.5 h-4 w-4 animate-spin"}):(0,t.jsx)(v.default,{size:14,className:"mr-1.5"}),"Google"]}),(0,t.jsxs)(S.Button,{type:"button",variant:"outline",size:"sm",className:"border-gray-300 bg-surface text-gray-700 hover:border-gray-400 hover:bg-gray-50 hover:text-gray-700",onClick:()=>eg("microsoft"),disabled:null!==V||U,children:["microsoft"===V?(0,t.jsx)(h.Loader2,{className:"mr-1.5 h-4 w-4 animate-spin"}):(0,t.jsx)(w.default,{size:14,className:"mr-1.5"}),"Microsoft"]}),(0,t.jsxs)(S.Button,{type:"button",variant:"outline",size:"sm",className:"border-gray-300 bg-surface text-gray-700 hover:border-gray-400 hover:bg-gray-50 hover:text-gray-700",onClick:()=>eg("okta"),disabled:null!==V||U,children:["okta"===V?(0,t.jsx)(h.Loader2,{className:"mr-1.5 h-4 w-4 animate-spin"}):(0,t.jsx)(j.default,{size:14,className:"mr-1.5"}),"Okta"]})]}),(0,t.jsxs)("div",{className:"relative py-0.5",children:[(0,t.jsx)("div",{className:"absolute inset-0 flex items-center",children:(0,t.jsx)(E.Separator,{className:"w-full"})}),(0,t.jsx)("div",{className:"relative flex justify-center text-[10px] tracking-wider up
147percase",children:(0,t.jsx)("span",{className:"text-muted-foreground bg-surface px-2",children:"Or set a password"})})]}),(0,t.jsxs)("div",{className:"grid gap-2 sm:grid-cols-2",children:[(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(I.Label,{htmlFor:"success-first",className:"text-xs text-gray-700",children:"First name"}),(0,t.jsx)(A.Input,{id:"success-first",value:Z,onChange:e=>ee(e.target.value),className:"h-9",placeholder:"First name",autoComplete:"given-name"})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(I.Label,{htmlFor:"success-last",className:"text-xs text-gray-700",children:"Last name"}),(0,t.jsx)(A.Input,{id:"success-last",value:et,onChange:e=>ea(e.target.value),className:"h-9",placeholder:"Last name",autoComplete:"family-name"})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(I.Label,{htmlFor:"success-pass",className:"text-xs text-gray-700",children:"Password"}),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(A.Input,{id:"success-pass",type:eo?"text":"password",value:es,onChange:e=>er(e.target.value),onFocus:()=>eh(!0),onBlur:()=>{es||eh(!1)},className:"h-9 pr-9",placeholder:"Enter your password",autoComplete:"new-password"}),(0,t.jsx)("button",{type:"button",onClick:()=>el(e=>!e),className:"absolute top-0 right-0 flex h-full items-center px-3 text-gray-500 hover:text-gray-700","aria-label":eo?"Hide password":"Show password",children:eo?(0,t.jsx)(d.EyeOff,{className:"h-4 w-4"}):(0,t.jsx)(l.Eye,{className:"h-4 w-4"})})]})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(I.Label,{htmlFor:"success-pass2",className:"text-xs text-gray-700",children:"Confirm password"}),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(A.Input,{id:"success-pass2",type:ed?"text":"password",value:ei,onChange:e=>en(e.target.value),className:"h-9 pr-9",placeholder:"Re-enter your password",autoComplete:"new-password"}),(0,t.jsx)("button",{type:"button",onClick:()=>ec(e=>!e),className:"absolute top-0 right-0 flex h-full items-center px-3 text-gray-500 hover:text-gray-700","aria-label":ed?"Hide password":"Show password",children:ed?(0,t.jsx)(d.EyeOff,{className:"h-4 w-4"}):(0,t.jsx)(l.Eye,{className:"h-4 w-4"})})]})]})]}),(eu||es)&&(0,t.jsxs)("div",{className:"rounded-md border border-gray-200 bg-gray-50 p-2.5",children:[(0,t.jsx)("p",{className:"mb-1 text-[11px] font-medium text-gray-700",children:"Password must contain:"}),(0,t.jsxs)("ul",{className:"grid grid-cols-2 gap-x-3 gap-y-0.5 text-[11px]",children:[(0,t.jsx)(q,{ok:ep.length,label:"At least 8 characters"}),(0,t.jsx)(q,{ok:ep.upper,label:"One uppercase letter"}),(0,t.jsx)(q,{ok:ep.lower,label:"One lowercase letter"}),(0,t.jsx)(q,{ok:ep.number,label:"One number"}),(0,t.jsx)(q,{ok:ep.special,label:"One special character"})]})]}),Y&&(0,t.jsx)("p",{className:"text-xs text-red-600",children:Y}),(0,t.jsx)(S.Button,{className:"w-full bg-solid-violet-600 text-white shadow hover:bg-solid-violet-700",onClick:ev,disabled:U||F||null!==V,children:U?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(h.Loader2,{className:"mr-1 h-4 w-4 animate-spin"}),"Startingâ¦"]}):"Save and access documents"}),(0,t.jsx)("p",{className:"text-[11px] leading-relaxed text-gray-500",children:"Free library, no subscription charge. We use this account for support and document discussions."})]})]}),G&&(0,t.jsx)("p",{className:"px-1 text-center text-xs text-red-600",children:G}),(0,t.jsxs)("div",{className:"space-y-2 px-1 text-center text-xs text-gray-900",children:[(0,t.jsxs)("p",{className:"flex items-start justify-center gap-1.5",children:[(0,t.jsx)(p.Mail,{className:"mt-0.5 h-3 w-3 shrink-0 text-gray-900"}),"Please check junk and spam for your receipt and confirmation."]}),(0,t.jsxs)("p",{className:"flex items-start justify-center gap-1.5",children:[(0,t.jsx)(u.FileDown,{className:"mt-0.5 h-3 w-3 shrink-0 text-gray-900"}),(0,t.jsxs)("span",{children:[n," document",1===n?"":"s",", permanent access. Your purchase stays linked to"," ",c?(0,t.jsx)("span",{className:"font-medium",children:c}):"your email","."]})]}),(0,t.jsxs)("p",{className:"text-xs leading-relaxed text-gray-900",children:["Set up an account above for easier return access and discussions on your documents."," ",(0,t.jsx)("button",{type:"button",className:"font-medium text-violet-700 underline decoration-violet-300 underline-offset-2 hover:text-violet-900",onClick:()=>O(!0),disabled:F,children:"Access this purchase once via email"}
147)," ","if you do not want to set a password here."]})]}),!o&&(0,t.jsx)(k.AlertDialog,{open:T,onOpenChange:O,children:(0,t.jsxs)(k.AlertDialogContent,{children:[(0,t.jsxs)(k.AlertDialogHeader,{children:[(0,t.jsx)(k.AlertDialogTitle,{children:"One-time email access"}),(0,t.jsxs)(k.AlertDialogDescription,{className:"space-y-2 text-left",children:[(0,t.jsxs)("span",{children:["You are choosing the emailed sign-in link instead of setting a password on this page. Your document access still belongs to"," ",c?(0,t.jsx)("strong",{children:c}):"your checkout email","."]}),(0,t.jsxs)("span",{className:"block",children:["To come back later, go to the sign-in page, click"," ",(0,t.jsx)("strong",{children:"Forgot password?"}),", enter the email above, and check your inbox (including spam) for the reset link."]})]})]}),(0,t.jsxs)(k.AlertDialogFooter,{className:"gap-2",children:[(0,t.jsx)(k.AlertDialogCancel,{className:"border-violet-300 bg-surface text-violet-700 hover:bg-violet-50 hover:text-violet-800",onClick:()=>{O(!1),D(!0)},children:"Set a password and keep my free library forever"}),(0,t.jsx)(k.AlertDialogAction,{className:"bg-solid-violet-600 hover:bg-solid-violet-700",onClick:()=>{O(!1),ey()},children:"Access my document now and make an account later"})]})]})})]})},H=$,q=({ok:e,label:a})=>(0,t.jsxs)("li",{className:`flex items-center gap-1.5 ${e?"text-emerald-700":"text-gray-500"}`,children:[(0,t.jsx)("span",{"aria-hidden":!0,className:"inline-block w-2 text-center",children:e?"â":"â¢"}),(0,t.jsx)("span",{children:a})]}),G=({orderId:e})=>(0,t.jsxs)("div",{className:"flex flex-col items-center gap-1",children:[(0,t.jsx)("p",{className:"text-[11px] font-semibold tracking-wider text-gray-500 uppercase",children:"Order"}),(0,t.jsxs)("p",{className:"font-mono text-sm text-gray-900",children:["#",U(e)]}),(0,t.jsx)(W,{orderId:e})]}),W=({orderId:e})=>{let[a,s]=x.default.useState(!1),r=async()=>{try{await navigator.clipboard.writeText(e),s(!0),setTimeout(()=>s(!1),1500)}catch{}};return(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-center gap-1.5 text-[11px] text-gray-500",children:[(0,t.jsx)("span",{className:"font-mono break-all text-gray-700",children:e}),(0,t.jsxs)("button",{type:"button",onClick:r,"aria-label":"Copy order ID",className:"inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-900",children:[(0,t.jsx)(o.Copy,{className:"h-3 w-3"}),a?"Copied":"Copy"]})]})};e.i(567018),e.i(359603),e.i(856353)},569649,e=>{"use strict";e.s(["default",()=>eD],569649);var t=e.i(843476),a=e.i(533372),s=e.i(226200),r=e.i(184086),i=e.i(905142),n=e.i(422510),o=e.i(617708),l=e.i(217923),d=e.i(248939),c=e.i(952571),u=e.i(292270),h=e.i(73526),p=e.i(78094),m=e.i(514764),f=e.i(972520),x=e.i(178583),g=e.i(464837),y=e.i(983123),b=e.i(39172),v=e.i(878894),w=e.i(531278),j=e.i(836159),k=e.i(618566),S=e.i(271645),N=e.i(643028),C=e.i(954850),A=e.i(568586),I=e.i(678976),E=e.i(519455),M=e.i(13838),R=e.i(772436),P=e.i(530909),_=e.i(377855),D=e.i(124558),T=e.i(557951),O=e.i(250623),F=e.i(414877),B=e.i(542724),L=e.i(509186),z=e.i(54340),K=e.i(502913),U=e.i(21218),$=e.i(694351),V=e.i(260289),H=e.i(373264),q=e.i(98919),G=e.i(581418),W=e.i(107233),Y=e.i(761911),Q=e.i(283086),J=e.i(248256),X=e.i(707866),Z=e.i(68787),ee=e.i(664659),et=e.i(541071),ea=e.i(972518),es=e.i(799647),er=e.i(239616),ei=e.i(657688),en=e.i(522016),eo=e.i(824071),el=e.i(651226),ed=e.i(510728),ec=e.i(605173),eu=e.i(832350),eh=e.i(799676),ep=e.i(107308),em=e.i(511936);e.i(954442);var ef=e.i(359603),ex=e.i(242722),eg=e.i(161822);let ey=()=>{let{state:e}=(0,P.useSidebar)(),a="collapsed"===e,s=(0,S.useRef)(null),r=(0,S.useRef)(null),i=(0,S.useRef)(null),[n,o]=(0,S.useState)(!1);(0,S.useEffect)(()=>()=>i.current?.(),[]),(0,S.useEffect)(()=>{if(!s.current)return;let e=s.current;for(;e&&!e.classList.contains("group/sidebar-wrapper")&&!Array.from(e.classList).some(e=>"group/sidebar-wrapper"===e||e.endsWith("/sidebar-wrapper"));)e=e.parentElement;r.current=e},[]);let l=(0,S.useCallback)(e=>{let t=Math.min(P.SIDEBAR_WIDTH_MAX_REM,Math.max(P.SIDEBAR_WIDTH_MIN_REM,e)),a=`${t}rem`;return r.current&&r.current.style.setProperty("--sidebar-width",a),a},[]);return a?null:(0,t.jsx)("div",{ref:s,role:"separator","aria-orientation":"vertical","aria-label":"Resize sidebar",onPointerDown:e=>{if(a)return;e.preventDefault(),e.currentTarget.setPointerCapture(e.pointerId),o(!0);let t=e.clientX,s=r.current?.querySelector('[data-sidebar="sidebar"]')?.getBoundingClientRect().width??224,n=`${s/16}
147rem`,d=e=>{n=l((s+(e.clientX-t))/16)},c=()=>{window.removeEventListener("pointermove",d),window.removeEventListener("pointerup",u),i.current=null},u=()=>{try{window.localStorage.setItem(P.SIDEBAR_WIDTH_STORAGE_KEY,n)}catch{}o(!1),c()};window.addEventListener("pointermove",d),window.addEventListener("pointerup",u),i.current=c},className:`absolute top-0 right-0 z-30 h-full w-2 cursor-col-resize touch-none select-none transition-colors hover:bg-white/10 ${n?"bg-white/20":""}`,style:{transform:"translateX(50%)"},children:(0,t.jsx)("div",{className:`pointer-events-none absolute top-0 left-1/2 h-full w-0.5 -translate-x-1/2 transition-colors ${n?"bg-white/60":"bg-white/20"}`})})},eb=({router:e})=>{let{state:a,toggleSidebar:s,isMobile:r}=(0,P.useSidebar)(),{user:i}=(0,T.useAuth)(),n=i?"/home":"/";return r||"collapsed"!==a?(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2 py-4 pr-px pl-3",children:[(0,t.jsx)("button",{type:"button",onClick:()=>e.push(n),"aria-label":"KeyPedia home",className:"min-w-0 cursor-pointer rounded-md",children:(0,t.jsx)(ei.default,{src:el.default,alt:"KeyPedia Logo",width:140,height:48,className:"object-contain",priority:!0})}),(0,t.jsx)("button",{type:"button",onClick:s,"aria-label":"Collapse sidebar",title:"Collapse sidebar",className:"grid size-8 shrink-0 place-items-center rounded-md text-white/70 transition-colors hover:bg-white/10 hover:text-white",children:(0,t.jsx)(ea.PanelLeftClose,{className:"size-[18px]","aria-hidden":!0})})]}):(0,t.jsx)("div",{className:"flex items-center justify-center px-1 py-4",children:(0,t.jsxs)("button",{type:"button",onClick:s,"aria-label":"Open sidebar",title:"Open sidebar",className:"group/logo relative grid size-10 place-items-center rounded-lg transition-colors hover:bg-white/10",children:[(0,t.jsx)(ei.default,{src:ed.default,alt:"KeyPedia",width:30,height:30,className:"object-contain transition-opacity duration-150 group-hover/logo:opacity-0",priority:!0}),(0,t.jsx)(es.PanelLeftOpen,{className:"absolute size-5 text-white opacity-0 transition-opacity duration-150 group-hover/logo:opacity-100","aria-hidden":!0})]})})},ev=({user:e,getInitials:a,router:s})=>{let{state:r,isMobile:i}=(0,P.useSidebar)(),n=!i&&"collapsed"===r;return(0,t.jsxs)("div",{className:"flex items-center gap-1 pr-0.5 pb-2",children:[(0,t.jsxs)(P.SidebarMenuButton,{className:`flex-1 px-2 ${n?"justify-center":"justify-start"}`,tooltip:"Account settings",onClick:()=>s.push("/settings"),children:[(0,t.jsx)(eh.Avatar,{className:`h-6 w-6 shrink-0 ${n?"mx-auto":""}`,children:(0,t.jsx)(eh.AvatarFallback,{className:"bg-primary text-primary-foreground text-xs",children:a()})}),!n&&(0,t.jsx)("span",{className:"ml-1.5 truncate text-sm",children:e?.first_name?`Hi ${e.first_name}`:"My Account"})]}),!n&&(0,t.jsx)("button",{type:"button",onClick:()=>s.push("/settings"),className:"text-muted-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground flex h-7 w-7 shrink-0 items-center justify-center rounded-md transition-colors",title:"Settings","aria-label":"Settings",children:(0,t.jsx)(er.Settings,{className:"h-4 w-4"})})]})},ew=({isActive:e,isCollapsed:a,pathname:s,dashboardSubItems:r,getHrefWithFilters:i})=>{let{isMobile:n}=(0,P.useSidebar)(),[o,l]=(0,ex.useResponsiveDefaultOpen)(n);return a?(0,t.jsx)(P.SidebarMenuItem,{children:(0,t.jsx)(P.SidebarMenuButton,{isActive:e,tooltip:"Dashboard",asChild:!0,children:(0,t.jsxs)(en.default,{href:i("/dashboard"),children:[(0,t.jsx)(V.LayoutDashboard,{className:"h-5 w-5"}),(0,t.jsx)("span",{children:"Dashboard"})]})})}):(0,t.jsx)(ep.Collapsible,{open:o,onOpenChange:l,asChild:!0,children:(0,t.jsxs)(P.SidebarMenuItem,{children:[(0,t.jsx)(P.SidebarMenuButton,{isActive:e,tooltip:"Dashboard",asChild:!0,children:(0,t.jsxs)(en.default,{href:i("/dashboard"),onClick:()=>{o||l(!0)},children:[(0,t.jsx)(V.LayoutDashboard,{className:"h-5 w-5"}),(0,t.jsx)("span",{children:"Dashboard"})]})}),(0,t.jsx)(ep.CollapsibleTrigger,{asChild:!0,children:(0,t.jsx)(P.SidebarMenuAction,{"aria-label":o?"Collapse Dashboard menu":"Expand Dashboard menu",className:"data-[state=open]:bg-sidebar-accent/40",children:(0,t.jsx)(ee.ChevronDown,{className:`h-4 w-4 shrink-0 opacity-60 transition-transform ${o?"rotate-180":""}`})})}),(0,t.jsx)(ep.CollapsibleContent,{className:"[&_[data-sidebar=menu-sub-button]]:h-auto [&_[data-sidebar=menu-sub-button]]:min-h-7 [&_[data-sidebar=menu-sub-button]]:py-1 [&_[data-sidebar=menu-sub-button]>span]:whitespace-normal [&_[data-sidebar=menu-sub-button]>span]:break-words",children:(0,t.jsxs)(P.SidebarMenuSub,{children:[(0,t.jsx)(P.SidebarMenuSubItem,{children:(0,t.jsx)(P.SidebarMenuSubButton,{asChild:!0,isActive:"/dashboard"===s,children:(0,t.jsxs)(en.default,{href:i("/dashboard"),
147children:[(0,t.jsx)(V.LayoutDashboard,{className:"h-4 w-4"}),(0,t.jsx)("span",{children:"All Data"})]})})}),r.map(e=>{let a=e.icon,r=(e.activeFor??[e.href]).some(e=>s?.startsWith(e))??!1;return(0,t.jsxs)(P.SidebarMenuSubItem,{children:[(0,t.jsx)(P.SidebarMenuSubButton,{asChild:!0,isActive:r,children:(0,t.jsxs)(en.default,{href:i(e.href),className:"relative",children:[(0,t.jsx)(a,{className:"h-4 w-4"}),(0,t.jsx)("span",{className:"flex-1",children:e.title}),e.badge&&(0,t.jsx)("span",{className:"ml-2 h-2 w-2 rounded-full bg-blue-500"})]})}),r&&e.showsReportContents&&(0,t.jsx)(ej,{})]},e.title)})]})})]})})},ej=()=>{let{items:e,activeId:a,scrollTo:s}=(0,A.useReportContents)();return 0===e.length?null:(0,t.jsx)(P.SidebarMenuSub,{className:"mt-0.5 mr-0 ml-3 gap-0 border-l pr-0 pl-2",children:e.map(e=>{let r=e.id===a;return(0,t.jsx)(P.SidebarMenuSubItem,{children:(0,t.jsxs)("button",{type:"button",onClick:()=>s(e.id),"aria-current":r?"true":void 0,className:"flex w-full items-start gap-1.5 rounded-sm px-1 py-1 text-left text-[12.5px] leading-[16px] transition-colors hover:bg-sidebar-accent/60",style:{fontWeight:r?600:400,opacity:r?1:.75},children:[(0,t.jsx)("span",{className:"mt-px shrink-0 font-mono text-[10.5px] tabular-nums opacity-70",children:e.no}),(0,t.jsx)("span",{className:"min-w-0 flex-1 break-words hyphens-auto",children:e.label}),e.stat?(0,t.jsx)("span",{className:"mt-px shrink-0 font-mono text-[10.5px] tabular-nums opacity-70",children:e.stat}):null]})},e.id)})})},ek=({isActive:e,isCollapsed:a,pathname:s,router:r,canAccessKeypedia:i,handleNewChat:n,handleHistoryClick:o,historyItemRef:l})=>{let{isMobile:d}=(0,P.useSidebar)(),[c,u]=(0,ex.useResponsiveDefaultOpen)(d);return a?i?(0,t.jsx)(P.SidebarMenuItem,{children:(0,t.jsxs)(P.SidebarMenuButton,{isActive:e,tooltip:"KeyPedia",onClick:()=>r.push("/keypedia"),children:[(0,t.jsx)(ei.default,{src:ed.default,alt:"KeyPedia",className:"h-5 w-5 shrink-0"}),(0,t.jsx)("span",{children:"KeyPediaâ¢"})]})}):null:(0,t.jsx)(ep.Collapsible,{open:c,onOpenChange:u,asChild:!0,children:(0,t.jsxs)(P.SidebarMenuItem,{children:[(0,t.jsx)(P.SidebarMenuButton,{isActive:e,tooltip:"KeyPedia","aria-label":"Start new KeyPedia chat",asChild:!0,children:(0,t.jsxs)(en.default,{href:"/keypedia",onClick:e=>{e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||1===e.button||(c||u(!0),n())},children:[(0,t.jsx)(ei.default,{src:ed.default,alt:"KeyPedia",className:"h-5 w-5 shrink-0"}),(0,t.jsx)("span",{children:"KeyPediaâ¢"})]})}),(0,t.jsx)(ep.CollapsibleTrigger,{asChild:!0,children:(0,t.jsx)(P.SidebarMenuAction,{"aria-label":c?"Collapse KeyPedia menu":"Expand KeyPedia menu",className:"data-[state=open]:bg-sidebar-accent/40",children:(0,t.jsx)(ee.ChevronDown,{className:`h-4 w-4 shrink-0 opacity-60 transition-transform ${c?"rotate-180":""}`})})}),(0,t.jsx)(ep.CollapsibleContent,{className:"[&_[data-sidebar=menu-sub-button]]:!h-auto [&_[data-sidebar=menu-sub-button]]:min-h-7 [&_[data-sidebar=menu-sub-button]]:py-1 [&_[data-sidebar=menu-sub-button]>span]:!whitespace-normal [&_[data-sidebar=menu-sub-button]>span]:!break-words [&_[data-sidebar=menu-sub-button]>span]:!overflow-visible",children:(0,t.jsxs)(P.SidebarMenuSub,{children:[(0,t.jsx)(P.SidebarMenuSubItem,{children:(0,t.jsx)(P.SidebarMenuSubButton,{asChild:!0,isActive:"/keypedia"===s,children:(0,t.jsxs)("button",{type:"button",onClick:n,children:[(0,t.jsx)(W.Plus,{className:"h-4 w-4"}),(0,t.jsx)("span",{children:"New Chat"})]})})}),(0,t.jsx)(P.SidebarMenuSubItem,{ref:l,children:(0,t.jsx)(P.SidebarMenuSubButton,{asChild:!0,children:(0,t.jsxs)("button",{type:"button",onClick:o,children:[(0,t.jsx)(K.IconMessage,{className:"h-4 w-4"}),(0,t.jsx)("span",{children:"History"})]})})})]})})]})})},eS=({isCollapsed:e,pathname:a,searchParams:s,currentRoute:r,router:i,getHrefWithFilters:n,isOnValisureRoute:o,canAccessChromeExt:l,canAccessValisure:d,canAccessRiskbased:c,canAccessAdmin:u,canManageOrgUsers:h,termsHref:p,productGuideHref:m})=>{let{isShopBuyer:f}=(0,ef.useShopAccess)(),{isMobile:g}=(0,P.useSidebar)(),y=a?.startsWith("/media")||a?.startsWith("/dashboard/media"),b=s?.get("premium")==="true"||s?.get("premium")==="only",v=o||a?.startsWith("/account/library")===!0||!0===y||"/product-suite"===a||a?.startsWith("/keypedia/extension")===!0||"/org"===a||a?.startsWith("/admin")===!0||!!p&&a===p,[w,j]=(0,ex.useResponsiveDefaultOpen)(g,v),[k,N]=(0,S.useState)(o);return((0,S.useEffect)(()=>{o&&N(!0)},[o]),e)?null:(0,t.jsx)(ep.Collapsible,{open:w,onOpenChange:j,asChild:!0,children:(0,t.jsxs)(P.SidebarMenuItem,{children:[(0,t.jsx)(ep.CollapsibleTrigger,{asChild:!0,children:(0,t.jsxs)(P.SidebarMenuButton,{tooltip:"More",children:[(0,t.jsx)(et.MoreHorizontal,{className:"h-5 w-5"}),(0,t.jsx)("span",{children:"More"}),(0,t.jsx)(ee.ChevronDown,{className:`ml-auto h-4 w-4 shrink-0 opacity-60 transition-transform ${w?"rotate-180":""}`})]})}),(0,t.jsx)(ep.CollapsibleContent,{className:"[&_[data-sidebar=menu-sub-button]]:!h-auto [&_[data-sidebar=menu-sub-button]]:min-h-7 [&_[data-sidebar=menu-sub-button]]:py-1 [&_[data-sidebar=menu-sub-button]>span]:!whitespace-normal [&_[data-sidebar=menu-sub-button]>span]:!break-words [&_[data-sidebar=menu-sub-button]>span]:!overflow-visible",children:(0,t.jsxs)(P.SidebarMenuSub,{children:[f&&(0,t.jsx)(P.SidebarMenuSubItem,{children:(0,t.jsx)(P.SidebarMenuSubButton,{asChild:!0,isActive:"/account/library"===a||a?.startsWith("/account/library/")===!0,children:(0,t.jsxs)(en.default,{href:"/account/library",children:[(0,t.jsx)(Z.BookMarked,{className:"h-4 w-4"}),(0,t.jsx)("span",{children:"My Purchased Docs"})]})})}),(0,t.jsx)(P.SidebarMenuSubItem,{children:(0,t.jsx)(P.SidebarMenuSubButton,{asChild:!0,isActive:y&&b,children:(0,t.jsxs)(en.default,{href:n("/dashboard/media?premium=only"),children:[(0,t.jsx)(X.Library,{className:"h-4 w-4"}),(0,t.jsx)("span",{children:"Content Library"})]})})}),y&&(0,t.jsx)(P.SidebarMenuSubItem,{children:(0,t.jsx)(P.SidebarMenuSubButton,{asChild:!0,isActive:y&&!b,children:(0,t.jsxs)(en.default,{href:n("/dashboard/media"),children:[(0,t.jsx)(J.Globe,{className:"h-4 w-4"}),(0,t.jsx)("span",{children:"All Content"})]})})}),(0,t.jsx)(P.SidebarMenuSubItem,{children:(0,t.jsx)(P.SidebarMenuSubButton,{asChild:!0,isActive:"/product-suite"===a,children:(0,t.jsxs)(en.default,{href:"/product-suite",children:[(0,t.jsx)(H.LayoutGrid,{className:"h-4 w-4"}),(0,t.jsx)("span",{children:"Product Suite"})]})})}),l&&(0,t.jsx)(P.SidebarMenuSubItem,{children:(0,t.jsx)(P.SidebarMenuSubButton,{asChild:!0,isActive:"/keypedia/extension"===a,children:(0,t.jsxs)(en.default,{href:"/keypedia/extension",children:[(0,t.jsx)(ei.default,{src:"/chrome-logo.png",alt:"",width:16,height:16,className:"h-4 w-4 shrink-0"}),(0,t.jsx)("span",{children:"Chrome Extension"})]})})}),d&&(0,t.jsx)(ep.Collapsible,{open:k,onOpenChange:N,asChild:!0,children:(0,t.jsxs)(P.SidebarMenuSubItem,{children:[(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(P.SidebarMenuSubButton,{asChild:!0,isActive:o&&!s?.get("tab"),children:(0,t.jsxs)(en.default,{href:"/valisure",onClick:()=>{k||N(!0)},children:[(0,t.jsx)(ei.default,{src:eu.default,alt:"",className:"h-4 w-4 shrink-0 rounded-sm"}),(0,t.jsx)("span",{children:"Valisure"})]})}),(0,t.jsx)(ep.CollapsibleTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button","aria-label":k?"Collapse Valisure menu":"Expand Valisure menu",className:"absolute top-1/2 right-1 flex h-5 w-5 -translate-y-1/2 items-center justify-center rounded text-sidebar-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 focus-visible:ring-sidebar-ring focus-visible:outline-none data-[state=open]:bg-sidebar-accent/40",children:(0,t.jsx)(ee.ChevronDown,{className:`h-3.5 w-3.5 shrink-0 opacity-60 transition-transform ${k?"rotate-180":""}`})})})]}),(0,t.jsx)(ep.CollapsibleContent,{children:(0,t.jsxs)(P.SidebarMenuSub,{children:[(0,t.jsx)(P.SidebarMenuSubItem,{children:(0,t.jsx)(P.SidebarMenuSubButton,{asChild:!0,isActive:o&&!s?.get("tab"),children:(0,t.jsxs)(en.default,{href:"/valisure",children:[(0,t.jsx)(H.LayoutGrid,{className:"h-4 w-4"}),(0,t.jsx)("span",{children:"All Data"})]})})}),(0,t.jsx)(P.SidebarMenuSubItem,{children:(0,t.jsx)(P.SidebarMenuSubButton,{asChild:!0,isActive:o&&s?.get("tab")==="docs",children:(0,t.jsxs)(en.default,{href:"/valisure?tab=docs",children:[(0,t.jsx)(x.FileText,{className:"h-4 w-4"}),(0,t.jsx)("span",{children:"Docs"})]})})}),(0,t.jsx)(P.SidebarMenuSubItem,{children:(0,t.jsx)(P.SidebarMenuSubButton,{asChild:!0,isActive:o&&s?.get("tab")==="uploads",children:(0,t.jsxs)(en.default,{href:"/valisure?tab=uploads",children:[(0,t.jsx)(U.Activity,{className:"h-4 w-4"}),(0,t.jsx)("span",{children:"Changelog"})]})})})]})})]})}),c&&(0,t.jsx)(P.SidebarMenuSubItem,{children:(0,t.jsx)(P.SidebarMenuSubButton,{asChild:!0,isActive:a?.startsWith("/riskbased"),children:(0,t.jsxs)(en.default,{href:"/riskbased",children:[(0,t.jsx)(ei.default,{src:ec.default,alt:"",className:"h-4 w-4 shrink-0 rounded-sm"}),(0,t.jsx)("span",{children:"Devices, MAUDE"})]})})}),p&&(0,t.jsx)(P.SidebarMenuSubItem,{children:(0,t.jsx)(P.SidebarMenuSubButton,{asChild:!0,isActive:a===p,children:(0,t.jsxs)(en.default,{href:p,children:[(0,t.jsx)(x.FileText,{className:"h-4 w-4"}),(0,t.jsx)("span",{children:"Terms of service"})]})})}),m&&(0,t.jsx)(P.SidebarMenuSubItem,{children:(0,t.jsx)(P.SidebarMenuSubButton,{asChild:!0,children:(0,t.jsxs)("a",{href:m,target:"_blank",rel:"noopener noreferrer",children:[(0,t.jsx)(Z.BookMarked,{className:"h-4 w-4"}),(0,t.jsx)("span",{children:"Product User Guide"})]})})}),(0,t.jsx)(P.SidebarMenuSubItem,{children:(0,t.jsx)(P.SidebarMenuSubButton,{asChild:!0,children:(0,t.jsxs)("button",{type:"button",onClick:()=>i.push("/settings"),children:[(0,t.jsx)(er.Settings,{className:"h-4 w-4"}),(0,t.jsx)("span",{children:"Settings"})]})})}),h&&(0,t.jsx)(P.SidebarMenuSubItem,{children:(0,t.jsx)(P.SidebarMenuSubButton,{asChild:!0,className:"text-blue-500 hover:text-blue-600",children:(0,t.jsxs)("button",{type:"button",onClick:()=>i.push("/org"),children:[(0,t.jsx)(Y.Users,{className:"h-4 w-4"}),(0,t.jsx)("span",{children:"My Organization"})]})})}),u&&(0,t.jsx)(P.SidebarMenuSubItem,{children:(0,t.jsx)(P.SidebarMenuSubButton,{asChild:!0,className:"text-red-500 hover:text-red-600",children:(0,t.jsxs)("button",{type:"button",onClick:()=>i.push("/admin"),children:["admin"===r?(0,t.jsx)(G.ShieldCheck,{className:"h-4 w-4"}):(0,t.jsx)(q.Shield,{className:"h-4 w-4"}),(0,t.jsx)("span",{children:"Admin Panel"})]})})})]})})]})})},eN=({pathname:e})=>(0,t.jsx)(P.SidebarGroup,{children:(0,t.jsx)(P.SidebarGroupContent,{children:(0,t.jsxs)(P.SidebarMenu,{children:[(0,t.jsx)(P.SidebarMenuItem,{children:(0,t.jsx)(P.SidebarMenuButton,{isActive:"/account/library"===e||e?.startsWith("/account/library/")===!0,tooltip:"My Documents",asChild:!0,children:(0,t.jsxs)(en.default,{href:"/account/library",children:[(0,t.jsx)(Z.BookMarked,{className:"h-5 w-5"}),(0,t.jsx)("span",{children:"My Documents"})]})})}),(0,t.jsx)(P.SidebarMenuItem,{children:(0,t.jsx)(P.SidebarMenuButton,{isActive:"/settings"===e||e?.startsWith("/settings/")===!0,tooltip:"Profile & settings",asChild:!0,children:(0,t.jsxs)(en.default,{href:"/settings",children:[(0,t.jsx)(er.Settings,{className:"h-5 w-5"}),(0,t.jsx)("span",{children:"Profile & settings"})]})})})]})})}),eC=({isShopOnly:e,isOnDashboardRoute:a,isOnKeyPediaRoute:s,isOnValisureRoute:r,pathname:i,router:n,currentRoute:o,dashboardSubItems:l,canAccessDashboard:d,canAccessKeypedia:c,canAccessValisure:u,canAccessRiskbased:h,canAccessChromeExt:p,canAccessAdmin:m,canManageOrgUsers:f,termsHref:x,productGuideHref:g,handleNewChat:y,handleHistoryClick:b,historyItemRef:v})=>{let{state:w,isMobile:j}=(0,P.useSidebar)(),S=!j&&"collapsed"===w,N=(0,k.useSearchParams)(),C=eA(i,N);return e?(0,t.jsx)(eN,{pathname:i}):(0,t.jsx)(P.SidebarGroup,{children:(0,t.jsx)(P.SidebarGroupContent,{children:(0,t.jsxs)(P.SidebarMenu,{children:[(0,t.jsx)(P.SidebarMenuItem,{children:(0,t.jsx)(P.SidebarMenuButton,{isActive:"home"===o,tooltip:"Home",asChild:!0,children:(0,t.jsxs)(en.default,{href:"/home",children:[(0,t.jsx)($.Home,{className:"h-5 w-5"}),(0,t.jsx)("span",{children:"Home"})]})})}),d&&(0,t.jsx)(ew,{isActive:a,isCollapsed:S,pathname:i,dashboardSubItems:l,getHrefWithFilters:C}),c&&(0,t.jsx)(ek,{isActive:s&&!i?.startsWith("/keypedia/extension"),isCollapsed:S,pathname:i,router:n,canAccessKeypedia:c,handleNewChat:y,handleHistoryClick:b,historyItemRef:v}),(0,t.jsx)(eS,{isCollapsed:S,pathname:i,searchParams:N,currentRoute:o,router:n,getHrefWithFilters:C,isOnValisureRoute:r,canAccessChromeExt:p,canAccessValisure:u,canAccessRiskbased:h,canAccessAdmin:m,canManageOrgUsers:f,termsHref:x,productGuideHref:g})]})})})},eA=(e,t)=>
147a=>{let s=e?.split("/")[1],r=a.split("?")[0];if(("dashboard"===s||"companyMap"===s||"statistics"===s||"predictive"===s||"knowledge-graph"===s)&&("/dashboard"===r||"/dashboard/media"===r||"/companyMap"===r||"/statistics"===r||"/predictive"===r||"/knowledge-graph"===r)){let i=e?.replace(/\/+$/,"")||"";if("dashboard"===s&&i.split("/").length>3&&!i.startsWith("/dashboard/media"))return a;let n=new URLSearchParams(t?.toString()||"");n.delete("premium"),new URLSearchParams(a.includes("?")?a.split("?")[1]:"").forEach((e,t)=>{n.set(t,e)});let o=n.toString();return o?`${r}?${o}`:r}return a},eI=({isCollapsed:e})=>{let a=(0,k.useRouter)(),s=(0,eo.getLatestPatchNote)(),r=s?(0,eo.formatPatchNoteVersion)(s):"Latest updates";return(0,t.jsx)(P.SidebarMenuItem,{children:(0,t.jsxs)(P.SidebarMenuButton,{tooltip:`What's new â ${r}`,onClick:()=>a.push("/patch-notes"),children:[(0,t.jsx)(Q.Sparkles,{className:"h-5 w-5"}),!e&&(0,t.jsxs)("span",{className:"text-muted-foreground text-xs",children:["What's new · ",r]})]})})},eE=({currentRoute:e,isShopOnly:a=!1,isOnDashboardRoute:s,isOnKeyPediaRoute:r,isOnValisureRoute:i,pathname:n,dashboardSubItems:o,footerItems:l,getInitials:d,canAccessAdmin:c,canManageOrgUsers:h,historyItemRef:p,historyPanelRef:f,historyPanelIsOpen:x,handleHistoryClick:g,handleHistoryPanelMouseEnter:y,handleHistoryMouseLeave:b,handleChatSelect:v,handleNewChat:w,setIsHistoryHovered:j,setIsHistoryOpen:N})=>{let C=(0,k.useRouter)(),A=(0,F.useIsMobile)(),I=(0,eg.useAppSelector)(e=>e.user.user),E=(0,L.usePermissionGroup)("dashboard"),M=(0,L.usePermissionGroup)("chatbot"),R=(0,L.usePermissionGroupWithAdminOverride)("valisure"),_=(0,L.usePermissionGroupWithAdminOverride)("riskbased"),D=(0,L.useAnyPermissionGroupsWithAdminOverride)(["ke
147ypedia_predictive","extension_sop_access","admin_users"]),T=l.find(e=>"Sign out"===e.title)?.onClick??(()=>{}),O=l.find(e=>"Send Feedback"===e.title)?.onClick??(()=>{}),B=l.find(e=>"Terms of service"===e.title)?.href,z=l.find(e=>"Product User Guide"===e.title)?.href;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(P.Sidebar,{collapsible:"icon",variant:"sidebar",children:[(0,t.jsxs)(P.SidebarHeader,{className:"border-b-2 border-white/50",children:[(0,t.jsx)(eb,{router:C}),(0,t.jsx)(P.SidebarMenu,{children:(0,t.jsx)(ev,{user:I,getInitials:d,router:C})})]}),(0,t.jsx)(P.SidebarContent,{className:`!overflow-y-scroll [scrollbar-color:rgba(255,255,255,0.55)_rgba(255,255,255,0.12)] [scrollbar-width:thin] [&::-webkit-scrollbar]:w-2.5 [&::-webkit-scrollbar]:!appearance-none [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-white/55 hover:[&::-webkit-scrollbar-thumb]:bg-white/75 [&::-webkit-scrollbar-track]:rounded-full [&::-webkit-scrollbar-track]:bg-white/12 ${A?"[&_[data-sidebar=menu-button]]:!h-11 [&_[data-sidebar=menu-sub-button]]:!min-h-11":""}`,children:n&&(0,t.jsx)(S.Suspense,{fallback:null,children:(0,t.jsx)(eC,{isShopOnly:a,isOnDashboardRoute:s??!1,isOnKeyPediaRoute:r??!1,isOnValisureRoute:i??!1,pathname:n,router:C,currentRoute:e,dashboardSubItems:o,canAccessDashboard:E,canAccessKeypedia:M,canAccessValisure:R,canAccessRiskbased:_,canAccessChromeExt:D,canAccessAdmin:c,canManageOrgUsers:h,termsHref:B,productGuideHref:z,handleNewChat:w,handleHistoryClick:g,historyItemRef:p})})}),(0,t.jsx)(P.SidebarFooter,{className:"bg-sidebar border-t-2 border-white/50",children:(0,t.jsx)(P.SidebarGroup,{className:"py-1",children:(0,t.jsx)(P.SidebarGroupContent,{children:(0,t.jsxs)(P.SidebarMenu,{children:[(0,t.jsx)(P.SidebarMenuItem,{children:(0,t.jsx)(P.SidebarMenuButton,{tooltip:"Go to public site",asChild:!0,className:"text-sm font-medium",children:(0,t.jsxs)(en.default,{href:"/",children:[(0,t.jsx)(J.Globe,{className:"h-5 w-5"}),(0,t.jsx)("span",{children:"Public site"})]})})}),(0,t.jsx)(P.SidebarMenuItem,{children:(0,t.jsxs)(P.SidebarMenuButton,{tooltip:"Sign out",onClick:T,className:"text-sm font-medium",children:[(0,t.jsx)(u.LogOut,{className:"h-5 w-5"}),(0,t.jsx)("span",{children:"Sign out"})]})}),(0,t.jsx)(P.SidebarMenuItem,{children:(0,t.jsxs)(P.SidebarMenuButton,{tooltip:"Send Feedback",onClick:O,className:"text-sm font-medium",children:[(0,t.jsx)(m.Send,{className:"h-5 w-5"}),(0,t.jsx)("span",{children:"Send Feedback"})]})}),(0,t.jsx)(eM,{})]})})})}),(0,t.jsx)(P.SidebarRail,{}),(0,t.jsx)(ey,{})]}),(0,t.jsx)(em.default,{onChatSelect:v,onNewChat:w,isHovered:x,onMouseEnter:y,onMouseLeave:b,onClose:()=>{j(!1),N(!1)},isMobile:A,onRef:e=>{e&&(f.current=e)}})]})},eM=()=>{let{state:e}=(0,P.useSidebar)();return(0,t.jsx)(eI,{isCollapsed:"collapsed"===e})};var eR=e.i(975157),eP=e.i(118502),e_=e.i(306130);let eD=({title:e,description:K,children:U,openChatHistoryRef:$,headerActions:V,cockpitProps:H,hideHeader:q=!1,disableScrollWrapper:G=!1,bypassSubscriptionWall:W=!1})=>{let Y=(0,k.useRouter)(),Q=(0,k.usePathname)(),{user:J,signOut:X}=(0,T.useAuth)(),Z=(0,eg.useAppSelector)(e=>e.user.user),[ee,{open:et,close:ea}]=(0,i.useDisclosure)(!1),es=(0,F.useIsMobile)(),[er,ei]=(0,S.useState)(!1),[en,eo]=(0,S.useState)(!1),el=(0,S.useRef)(null),ed=(0,S.useRef)(null),ec=(0,S.useRef)(null),eu=(0,L.useCanAccessAdmin)(),eh=(0,L.usePermission)("can_manage_org_users");(0,B.useAuthCheck)(!0);let{hasActiveSubscription:ep,hasAnyPermissionGroups:em}=(0,O.useSubscription)(),{loading:ef,authStatus:ex}=(0,T.useAuth)(),ey=em([...D.SUBSCRIPTION_BYPASS_PERMISSION_GROUPS]),eb=em(["document_store"]),ev=(0,z.isBuyerEntitlementRoute)(Q),ew=eb&&!em([...D.DASHBOARD_CHROME_PERMISSION_GROUPS]),ej=Q?.split("/")[1],ek="dashboard"===ej&&!Q?.startsWith("/dashboard/media")||"statistics"===ej||"predictive"===ej||"knowledge-graph"===ej||"companyMap"===ej,eS=Q?.startsWith("/keypedia"),eN=Q?.startsWith("/valisure"),eC=(0,S.useCallback)(()=>{eo(!0),ei(!0)},[]),eA=(0,S.useCallback)(()=>{let e=!(en||er);eo(e),ei(e)},[en,er]);(0,S.useEffect)(()=>{$&&($.current=eC)},[$,eC]);let eI=()=>{Y.push("/keypedia"),ei(!1),eo(!1)};(0,S.useEffect)(()=>()=>{ec.current&&clearTimeout(ec.current)},[]);let eM=en||er;if(ef)return(0,t.jsx)("div",{className:"flex h-svh w-full items-center justify-center",children:(0,t.jsx)(w.Loader2,{className:"text-muted-foreground h-8 w-8 animate-spin"})});if(!W&&!(ev&&eb)&&J&&!ep&&!ey&&("fail"===ex||J.subscription_status?.status==="expired"||J.subscription_status?.has_subscription===!1)){let e=async()=>{await X(),Y.push("/auth/signin")},a=J?.email||Z?.email||"";return(0,t.jsx)("div",{className:"flex h-svh w-full items-center justify-center",children:(0,t.jsxs)("div",{className:"flex max-w-lg flex-col items-center gap-5 p-8 text-center",children:[(0,t.jsx)("div",{className:"rounded-full bg-yellow-100 p-3",children:(0,t.jsx)(v.AlertTriangle,{className:"h-8 w-8 text-yellow-600"})}),(0,t.jsx)("h2",{className:"text-xl font-semibold",children:"Subscription
147Expired"}),(0,t.jsx)("p",{className:"text-muted-foreground",children:"Your subscription has expired. Renew to continue accessing the dashboard, KeyPedia AI, and premium content."}),(0,t.jsxs)("div",{className:"bg-muted/50 w-full rounded-lg border p-4 text-left",children:[(0,t.jsx)("p",{className:"mb-2 text-sm font-medium",children:"Need help or think this is an error?"}),(0,t.jsx)("p",{className:"text-muted-foreground mb-3 text-xs",children:a?`We'll reach out to ${a}, or you can contact us directly.`:"Contact our team and we'll get you sorted."}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsx)(E.Button,{size:"sm",onClick:()=>window.open(`mailto:[email protected]?subject=Subscription%20Renewal&body=Hi%2C%20my%20subscription%20has%20expired.%20Email%3A%20${encodeURIComponent(a)}`,"_blank"),children:"Contact Support"}),(0,t.jsx)(E.Button,{size:"sm",variant:"outline",onClick:e,children:"Sign Out"})]})]})]})})}let eD=async()=>{await X(),Y.push("/auth/signin")},eT=[{title:"Analytics",icon:g.FileUser,href:"/dashboard/report",showsReportContents:!0},{title:"Individual profile",icon:b.UserSearch,href:"/dashboard/individual",showsReportContents:!0,activeFor:["/dashboard/individual","/dashboard/person/","/dashboard/company/","/dashboard/office/","/dashboard/violationCode/"]},{title:"Statistics",icon:l.BarChart3,href:"/statistics"},{title:"Predictive",icon:f.ArrowRight,href:"/predictive"},{title:"Graph",icon:p.Network,href:"/knowledge-graph"},{title:"Map",icon:h.Map,href:"/companyMap"},{title:"FOIA Requests",icon:x.FileText,href:"/dashboard/foia",badge:!0},{title:"Data sources",icon:y.Rss,href:"/dashboard/sources"}],eO=[{title:"Sign out",icon:u.LogOut,onClick:eD},{title:"Send Feedback",icon:m.Send,onClick:()=>{et()}},{title:"Terms of service",icon:d.Clipboard,href:"/terms-of-service",external:!1},{title:"Product User Guide",icon:c.Info,href:"https://drive.google.com/file/d/1TEZXsWkf_pOhgI6SHeFReDRQcF9ftl3w/view?pli=1",external:!0}];return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(j.default,{children:[(0,t.jsx)("title",{children:"KeyPedia"}),(0,t.jsx)("meta",{name:"description",content:"KeyPedia"}),(0,t.jsx)("meta",{name:"viewport",content:"width=device-width, initial-scale=1"}),(0,t.jsx)("link",{rel:"icon",href:"/favicon.ico"})]}),(0,t.jsx)(A.ReportContentsProvider,{children:(0,t.jsxs)(P.SidebarProvider,{defaultOpen:!0,children:[(0,t.jsx)(eE,{currentRoute:ej,isShopOnly:ew,isOnDashboardRoute:ek??!1,isOnKeyPediaRoute:eS??!1,isOnValisureRoute:eN??!1,pathname:Q,dashboardSubItems:eT,footerItems:eO,getInitials:()=>{let e=J?.email||Z?.email;return e?e.charAt(0).toUpperCase():"U"},canAccessAdmin:eu,canManageOrgUsers:eh,historyItemRef:el,historyPanelRef:ed,historyPanelIsOpen:eM,handleHistoryClick:()=>{eo(!en),ei(!en)},handleHistoryPanelMouseEnter:()=>{ec.current&&(clearTimeout(ec.current),ec.current=null)},handleHistoryMouseLeave:()=>{},handleChatSelect:e=>{Y.push(`/keypedia/${e.id}`),ei(!1),eo(!1)},handleNewChat:eI,setIsHistoryHovered:ei,setIsHistoryOpen:eo}),(0,t.jsxs)(P.SidebarInset,{className:(0,eR.cn)(`${es?"h-dvh":"h-svh"} flex flex-col ${G?"overflow-auto":"overflow-hidden"} overscroll-none print:!h-auto print:!overflow-visible`,!es&&eS&&"transition-[padding] duration-200 ease-linear",eM&&!es&&eS&&"md:peer-data-[state=collapsed]:pl-80 md:peer-data-[state=expanded]:pl-72"),children:[!q&&(0,t.jsxs)("header",{className:"flex min-h-12 shrink-0 items-center gap-1.5 border-b px-2 py-1 md:gap-2 md:px-4 print:hidden",children:[(0,t.jsx)(P.SidebarTrigger,{className:"h-11 w-11 shrink-0 rounded-md border border-brand-lilac bg-brand-ice text-brand-ink hover:bg-brand-lilac lg:hidden"}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[(0,t.jsx)("h2",{className:"min-w-0 truncate text-base font-semibold md:shrink-0 md:text-lg",children:e}),K&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(R.Separator,{orientation:"vertical",className:"hidden h-4 sm:block"}),(0,t.jsx)("div",{className:"text-muted-foreground hidden truncate text-sm sm:block",children:K})]})]}),(eS||V)&&(0,t.jsxs)(s.Group,{gap:4,align:"center",wrap:"nowrap",className:"no-print ml-auto shrink-0",children:[eS&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(r.Tooltip,{label:eM?"Hide chat history":"Chat history",withArrow:!0,zIndex:500,children:(0,t.jsxs)(a.Button,{onClick:eA,variant:eM?"light":"outline",size:"xs",color:"primary","aria-label":"Chat history",className:(0,eR.cn)(eP.RESPONSIVE_ICON_BUTTON,"md:!px-3"),children:[(0,t.jsx)(n.IconHistory,{size:14}),(0,t.jsx)("span",{className:"hidden md:ml-1.5 md:inline",children:"History"})]})}),(0,t.jsx)(r.Tooltip,{label:"Start a new chat",withArrow:!0,zIndex:500,children:(0,t.jsxs)(a.Button,{onClick:eI,variant:"outline",size:"xs",color:"primary","aria-label":"New chat",className:(0,eR.cn)(eP.RESPONSIVE_ICON_BUTTON,"md:!px-3"),children:[(0,t.jsx)(o.IconPlus,{size:14}),(0,t.jsx)("span",{className:"hidden md:ml-1.5 md:inline",children:"New chat"})]})})]}),V]}),H&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(R.Separator,{orientation:"vertical",className:"ml-auto h-4"}),(0,t.jsx)("div",{className:"no-print flex shrink-0 items-center",children:(0,t.jsx)(N.default,{...H})})]}),!H&&(0,t.jsx)("div",{id:"dashboard-header-actions",className:"no-print ml-auto flex min-w-0 shrink items-center gap-1 overflow-x-auto overscroll-contain empty:hidden md:shrink-0 md:gap-1.5 md:overflow-visible"}),(0,t.jsx)(I.ThemeToggle,{location:"app_header",appearance:"app",className:"no-print shrink-0"})]}),G?(0,t.jsx)("div",{className:"min-h-0 flex-1",children:(0,t.jsx)(C.default,{children:U})}):(0,t.jsx)(M.ScrollableContent,{className:"p-5",children:(0,t.jsx)(C.default,{children:U})})]})]})}),(0,t.jsx)(_.Toaster,{}),Q&&(0,t.jsx)(e_.default,{modalOpen:et,modalClose:ea,modalOpened:ee,pathName:Q.split("/")[1],subject:"[Dashboard Feedback]"})]})}}]);
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.