PageSourceSearch

https://cdbx.ai/_next/static/chunks/app/layout-5d3467ce593a782d.js?dpl=dpl_DcG1iPgjWYTd5Gj6jP4kw73PFfP1

js cdbx.ai collected 2026-10-05 13:47:10 UTC 76,745 bytes, 1 lines download raw bytes

1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="3fdb4e56-8ede-4830-8b15-b1f848c2be38",e._sentryDebugIdIdentifier="sentry-dbid-3fdb4e56-8ede-4830-8b15-b1f848c2be38")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7177],{40996:(e,t,i)=>{Promise.resolve().then(i.t.bind(i,50407,23)),Promise.resolve().then(i.bind(i,20706)),Promise.resolve().then(i.bind(i,63186)),Promise.resolve().then(i.bind(i,88323)),Promise.resolve().then(i.bind(i,92627)),Promise.resolve().then(i.bind(i,95988)),Promise.resolve().then(i.bind(i,87775)),Promise.resolve().then(i.bind(i,84379)),Promise.resolve().then(i.bind(i,62262)),Promise.resolve().then(i.bind(i,37433)),Promise.resolve().then(i.bind(i,3407)),Promise.resolve().then(i.bind(i,41033)),Promise.resolve().then(i.bind(i,86149)),Promise.resolve().then(i.bind(i,88346)),Promise.resolve().then(i.bind(i,11610)),Promise.resolve().then(i.bind(i,43252)),Promise.resolve().then(i.bind(i,60367)),Promise.resolve().then(i.bind(i,78772)),Promise.resolve().then(i.bind(i,58593)),Promise.resolve().then(i.bind(i,18651)),Promise.resolve().then(i.bind(i,63299)),Promise.resolve().then(i.bind(i,57486)),Promise.resolve().then(i.bind(i,8863)),Promise.resolve().then(i.bind(i,32400)),Promise.resolve().then(i.bind(i,37888)),Promise.resolve().then(i.bind(i,89591)),Promise.resolve().then(i.bind(i,12768)),Promise.resolve().then(i.bind(i,24929)),Promise.resolve().then(i.bind(i,24590)),Promise.resolve().then(i.bind(i,15802)),Promise.resolve().then(i.bind(i,57765)),Promise.resolve().then(i.bind(i,38805)),Promise.resolve().then(i.bind(i,38844)),Promise.resolve().then(i.bind(i,37066)),Promise.resolve().then(i.bind(i,99470)),Promise.resolve().then(i.bind(i,25313)),Promise.resolve().then(i.bind(i,48517)),Promise.resolve().then(i.bind(i,80945)),Promise.resolve().then(i.bind(i,15148)),Promise.resolve().then(i.bind(i,45046)),Promise.resolve().then(i.bind(i,76520)),Promise.resolve().then(i.bind(i,65869)),Promise.resolve().then(i.bind(i,23950)),Promise.resolve().then(i.bind(i,91698)),Promise.resolve().then(i.bind(i,93549)),Promise.resolve().then(i.bind(i,29354)),Promise.resolve().then(i.bind(i,47404)),Promise.resolve().then(i.bind(i,38883)),Promise.resolve().then(i.bind(i,67521)),Promise.resolve().then(i.bind(i,23171)),Promise.resolve().then(i.bind(i,65647)),Promise.resolve().then(i.bind(i,57762)),Promise.resolve().then(i.bind(i,54545)),Promise.resolve().then(i.t.bind(i,96758,23)),Promise.resolve().then(i.t.bind(i,25791,23)),Promise.resolve().then(i.t.bind(i,37901,23)),Promise.resolve().then(i.t.bind(i,10571,23)),Promise.resolve().then(i.t.bind(i,47256,23)),Promise.resolve().then(i.t.bind(i,19160,23)),Promise.resolve().then(i.t.bind(i,79658,23)),Promise.resolve().then(i.t.bind(i,47022,23))},23950:(e,t,i)=>{"use strict";i.d(t,{ReferralCapture:()=>r});var n=i(50653),l=i(20680);let s="cdbx_ref";function r(){let e=(0,l.useSearchParams)();return(0,n.useEffect)(()=>{let t=null==e?void 0:e.get("ref");if(!t||document.cookie.split("; ").some(e=>e.startsWith("".concat(s,"="))))return;let i=new Date(Date.now()+2592e6).toUTCString();document.cookie="".concat(s,"=").concat(encodeURIComponent(t),"; expires=").concat(i,"; path=/; SameSite=Lax")},[e]),null}},45046:(e,t,i)=>{"use strict";i.d(t,{PostHogPageView:()=>r});var n=i(50653),l=i(20680),s=i(38597);function r(){let e=(0,l.usePathname)(),t=(0,l.useSearchParams)(),i=(0,s.sf)();return(0,n.useEffect)(()=>{if(!e||!i)return;let n=(null==t?void 0:t.size)?"".concat(e,"?").concat(t.toString()):e;i.capture("$pageview",{$current_url:"".concat(window.location.origin).concat(n)})},[e,t,i]),null}},76520:(e,t,i)=>{"use strict";i.d(t,{SignupTracker:()=>r});var n=i(50653),l=i(89128);let s="cdbx_new_signup";function r(){return(0,n.useEffect)(()=>{document.cookie.split("; ").some(e=>e.startsWith("".concat(s,"=")))&&(document.cookie="".concat(s,"=; Max-Age=0; path=/"),(0,l.s)("signed_up"))},[]),null}},99489:(e,t,i)=>{"use strict";i.d(t,{M:()=>b});var n=i(9417),l=i(50653),s=i(36316),r=i(5230),o=i(73989),a=i(32585),d=i(83577),c=i(71982),u=i(2252),m=i(85381),p=i(94839),y=i.n(p),f=i(80422);let h="cdbx:lastSignInProvider";function x(){return(0,n.jsxs)("svg",{viewBox:"0 0 24 24",width:"16",height:"16","aria-hidden":"true",children:[(0,n.jsx)("path",{fill:"#4285F4",d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"}),(0,n.jsx)("path",{fill:"#34A853",d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"}),(0,n.jsx)("path",{fill:"#FBBC05",d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z"}),(0,n.jsx)("path",{fill:"#EA4335",d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z"})]})}function b(e){let{isOpen:t,onClose:i,subtitle:a="Choose how you want to continue"}=e,[d,c]=(0,l.useState)(null),[p,b]=(0,l.useState)(null),[g,w]=(0,l.useState)(!1);(0,l.useEffect)(()=>{t&&(c(localStorage.getItem(h)),b(null),w(!1))},[t]);let A=e=>{localStorage.setItem(h,e),b(e),g&&(document.cookie="".concat(f.S8,"=1; path=/; max-age=").concat(f.jZ,"; SameSite=Lax")),(0,u.Jv)(e)};return(0,n.jsx)(s.Y,{isOpen:t,onOpenChange:e=>!e&&i(),size:"sm",placement:"center",children:(0,n.jsx)(r.g,{children:(0,n.jsxs)("div",{className:"px-6 pt-7 pb-5 flex flex-col gap-3",children:[(0,n.jsxs)("div",{className:"flex flex-col items-center gap-2 mb-2",children:[(0,n.jsx)("img",{src:"/cdbx-icon.png",alt:"cdbx",width:40,height:40,className:"w-10 h-10 rounded-full border border-default-200"}),(0,n.jsx)("h2",{className:"text-lg font-semibold text-foreground",children:"Sign in to cdbx"}),(0,n.jsx)("p",{className:"text-sm text-default-400",children:a})]}),(0,n.jsx)(v,{icon:(0,n.jsx)(m.hL4,{size:18}),label:"Continue with GitHub",isLast:"github"===d,isLoading:"github"===p,isDisabled:null!==p,onPress:()=>A("github")}),(0,n.jsx)(v,{icon:(0,n.jsx)(x,{}),label:"Continue with Google",isLast:"google"===d,isLoading:"google"===p,isDisabled:null!==p,onPress:()=>A("google")}),(0,n.jsx)(o.A,{isSelected:g,onValueChange:w,isDisabled:null!==p,size:"sm",className:"mt-2 items-start",classNames:{label:"text-[11px] text-default-500 leading-relaxed"},children:f.ML}),(0,n.jsxs)("p",{className:"text-center text-[11px] text-default-400 mt-1 leading-relaxed",children:["By continuing, you agree to the cdbx"," ",(0,n.jsx)(y(),{href:"/terms",className:"underline underline-offset-2 hover:text-foreground transition-colors",children:"Terms"})," ","and"," ",(0,n.jsx)(y(),{href:"/privacy",className:"underline underline-offset-2 hover:text-foreground transition-colors",children:"Privacy Policy"}),"."]})]})})})}function v(e){let{icon:t,label:i,isLast:l,isLoading:s,isDisabled:r,onPress:o}=e;return(0,n.jsx)(a.T,{size:"lg",variant:"flat",className:"w-full font-medium justify-start gap-3 px-4",startContent:s?(0,n.jsx)(d.o,{size:"sm",color:"current"}):t,endContent:l&&!s?(0,n.jsx)(c.R,{size:"sm",color:"primary",variant:"flat",className:"ml-auto text-xs",children:"Last used"}):null,isDisabled:r,onPress:o,children:i})}},65869:(e,t,i)=>{"use strict";i.d(t,{AppChrome:()=>eM});var n=i(9417),l=i(20680),s=i(58707),r=i(94839),o=i.n(r);let a=e=>!!e&&e.startsWith("/apps/"),d=e=>!!e&&e.startsWith("/programs/"),c=e=>a(e)||d(e);var u=i(50653),m=i(10098),p=i(31192),y=i(90620),f=i(92652),h=i(61619),x=i(44333),b=i(81377),v=i(2252),g=i(32585),w=i(48047),A=i(67999),j=i(52054),N=i(40563),M=i(8712);let T=e=>{let{className:t,size:i="sm"}=e,l="xs"===i,s=(0,M.j)(),r=(0,M.G)(N.zS);return(0,n.jsx)(g.T,{isIconOnly:!0,disableRipple:!0,color:"default",variant:"light",size:l?"sm":i,"aria-label":"Mode Toggle",onPress:()=>{s((0,N.iY)({...r,mode:r.mode===x.dX.light?x.dX.dark:x.dX.light,themeName:r.mode===x.dX.light?x.gM.cdbxDark:x.gM.cdbxLight,lightModeTheme:x.gM.cdbxLight,darkModeTheme:x.gM.cdbxDark,useSystemMode:!1}))},className:"group transition-all delay-150 duration-300 ".concat(l?"h-6 
1w-6 min-w-6":""," ").concat(t),children:r.useSystemMode?r.systemMode===x.dX.light?(0,n.jsx)(A.g,{}):(0,n.jsx)(j.r,{}):r.mode===x.dX.light?(0,n.jsx)(A.g,{}):(0,n.jsx)(j.r,{})})};var L=i(99489),S=i(57271);let V=()=>{let{status:e}=(0,v.wV)(),t=(0,M.j)(),i=(0,M.G)(N.zS),[l,s]=(0,u.useState)(!1);(0,u.useEffect)(()=>{var e,n,l,s;let r=window.matchMedia("(prefers-color-scheme: dark)").matches,o=r?x.dX.dark:x.dX.light,a=null!==(s=null!==(l=null===(n=document)||void 0===n?void 0:null===(e=n.querySelector("html"))||void 0===e?void 0:e.getAttribute("data-theme"))&&void 0!==l?l:localStorage.getItem("themeName"))&&void 0!==s?s:r?i.darkModeTheme:i.lightModeTheme;t((0,N.iY)({...i,mode:o,themeName:a,systemMode:o}))},[]),(0,u.useEffect)(()=>{var e,t;localStorage.setItem("themeName",i.themeName),null===(t=document)||void 0===t||null===(e=t.querySelector("html"))||void 0===e||e.setAttribute("data-theme",i.themeName)},[i.themeName]),(0,u.useEffect)(()=>{var e;let n=null===(e=b.Z.find(e=>e.id===i.themeName))||void 0===e?void 0:e.editorThemeId;n&&t((0,S.AV)({id:n}))},[i.themeName,t]),(0,u.useEffect)(()=>{if(i.useSystemMode){let e=window.matchMedia("(prefers-color-scheme: dark)").matches,n=e?i.darkModeTheme:i.lightModeTheme;t((0,N.iY)({...i,mode:e?x.dX.dark:x.dX.light,themeName:n,systemMode:e?x.dX.dark:x.dX.light}))}},[i.useSystemMode]);let r=e=>{let{matches:n}=e;if(t((0,N.iY)({...i,systemMode:n?x.dX.dark:x.dX.light})),i.useSystemMode){var l,s;let e=n?i.darkModeTheme:i.lightModeTheme;t((0,N.iY)({...i,mode:n?x.dX.dark:x.dX.light,themeName:e})),localStorage.setItem("themeName",e),null===(s=document)||void 0===s||null===(l=s.querySelector("html"))||void 0===l||l.setAttribute("data-theme",e)}};return(0,u.useEffect)(()=>(window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",r),()=>{window.matchMedia("(prefers-color-scheme: dark)").removeEventListener("change",r)}),[]),(0,n.jsxs)("div",{className:"flex items-center gap-3",children:[(0,n.jsx)(T,{size:"xs",className:"border-solid border-1 border-slate-400 rounded-md"}),"authenticated"!==e&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(m.I,{showArrow:!1,placement:"bottom",content:"Sign in",children:(0,n.jsx)(g.T,{isIconOnly:!0,disableRipple:!0,color:"primary",variant:"bordered",size:"sm","aria-label":"Sign in",onPress:()=>s(!0),className:"h-6 w-6 min-w-6 rounded-md border-1 border-solid border-primary bg-primary/10 hover:bg-primary/20 transition-colors",children:(0,n.jsx)(w.qe4,{size:16})})}),(0,n.jsx)(L.M,{isOpen:l,onClose:()=>s(!1)})]})]})};var E=i(78978),P=i(29945),I=i(50339),C=i(40630),J=i(76825);function k(){var e,t;let{data:i,status:n}=(0,v.wV)();(0,M.j)();let[l,s]=(0,u.useState)(!1);(0,C.i)(l,()=>s(!1));let r=(0,M.G)(J.z$);return(0,M.G)(J.fo),"authenticated"!==n||null==i||null===(e=i.user)||void 0===e||e.isAdmin,"authenticated"===n&&r&&(null==i||null===(t=i.user)||void 0===t||t.id,r.owner.id),null}var D=i(5927),O=i(45361),Z=i(19244);let z=[{key:"admin",label:"Admin"},{key:O.iB.PRO,label:"Pro"},{key:O.iB.FREE,label:"Free"}];function F(){var e,t,i,l;let{data:s,status:r}=(0,v.wV)(),{tier:o,isPreviewing:a}=(0,D.N)(),[d,c]=(0,u.useState)(!1),[m,p]=(0,u.useState)(!1),y=(0,C.i)(d,()=>c(!1)),f="authenticated"===r&&!!(null==s?void 0:null===(e=s.user)||void 0===e?void 0:e.isAdmin),h=!!(null==s?void 0:null===(i=s.user)||void 0===i?void 0:null===(t=i.features)||void 0===t?void 0:t.viewAsSwitcherAccess);if(!f||!h)return null;let x=a?o:"admin",b=async e=>{if(c(!1),e!==x){p(!0);try{await fetch("/api/v1/admin/preview-tier",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tier:"admin"===e?null:e})}),window.dispatchEvent(new Event(Z.uA))}finally{p(!1)}}};return(0,n.jsx)("div",{ref:y,className:"contents",children:(0,n.jsxs)(E.y,{placement:"bottom-end",isOpen:d,onOpenChange:c,disableAnimation:!0,children:[(0,n.jsx)(P.T,{children:(0,n.jsxs)(g.T,{variant:a?"solid":"flat",color:a?"warning":"default",size:"sm",radius:"md",isLoading:m,endContent:!m&&(0,n.jsx)(w._kA,{size:12}),children:["View as: ",null===(l=z.find(e=>e.key===x))||void 0===l?void 0:l.label]})}),(0,n.jsx)(I.C,{className:"w-44 p-1",children:(0,n.jsx)("div",{className:"w-full py-1",children:z.map(e=>{let{key:t,label:i}=e;return(0,n.jsx)("button",{type:"button",onClick:()=>b(t),className:"w-full text-left px-2 py-1.5 rounded-md text-sm hover:bg-default-100 ".concat(t===x?"font-semibold text-warning-600":""),children:t===x?"✓ ".concat(i):i},t)})})})]})})}var U=i(99536);function R(){var e,t;let{data:i}=(0,v.wV)(),l=(0,M.G)(U.Lg),[s,r]=(0,u.useState)(!1),[o,a]=(0,u.useState)(!1),[d,c]=(0,u.useState)(!1);if(!(null==l?void 0:l.id)||!(null==l?void 0:l.published)||!(null==l?void 0:l.publishedSlug))return null;let m=null!==(t=l.publishedOwnerUsername)&&void 0!==t?t:null==i?void 0:null===(e=i.user)||void 0===e?void 0:e.githubUsername;if(!m)return null;let y="".concat(window.location.origin,"/").concat(m,"/").concat(l.publishedSlug),f='<iframe\n  src="'.concat(y,'"\n  width="100%"\n  height="600"\n  frameborder="0"\n  allow="clipboard-write"\n></iframe>'),h=(e,t)=>{navigator.clipboard.writeText(e),t(!0),setTimeout(()=>t(!1),2e3)};return(0,n.jsxs)(E.y,{isOpen:s,onOpenChange:r,placement:"bottom",children:[(0,n.jsx)(P.T,{children:(0,n.jsx)(g.T,{size:"sm",variant:"flat",startContent:(0,n.jsx)(p.C70,{size:14}),className:"h-7 text-xs px-2.5",children:"Share"})}),(0,n.jsx)(I.C,{className:"w-[640px] p-0",children:(0,n.jsxs)("div",{className:"flex flex-col gap-3 p-4",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("p",{className:"text-xs text-default-500 mb-1.5 font-medium",children:"Published URL"}),(0,n.jsxs)("div",{className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg bg-content2 border border-default-200",children:[(0,n.jsx)("span",{className:"text-xs text-default-500 font-mono truncate flex-1 min-w-0",children:y}),(0,n.jsx)("button",{onClick:()=>h(y,a),className:"text-default-400 hover:text-foreground transition-colors shrink-0",title:"Copy URL",children:o?(0,n.jsx)(p.RUR,{size:13,className:"text-success"}):(0,n.jsx)(p.scL,{size:13})}),(0,n.jsx)("a",{href:y,target:"_blank",rel:"noopener noreferrer",className:"text-default-400 hover:text-foreground transition-colors shrink-0",title:"Open",children:(0,n.jsx)(p.qGB,{size:13})})]})]}),(0,n.jsxs)("div",{children:[(0,n.jsxs)("div",{className:"flex items-center justify-between mb-1.5",children:[(0,n.jsxs)("p",{className:"text-xs text-default-500 font-medium flex items-center gap-1",children:[(0,n.jsx)(p.sAL,{size:13}),"Embed"]}),(0,n.jsxs)("button",{onClick:()=>h(f,c),className:"text-xs text-default-400 hover:text-foreground flex items-center gap-1 transition-colors",children:[d?(0,n.jsx)(p.RUR,{size:12,className:"text-success"}):(0,n.jsx)(p.scL,{size:12}),d?"Copied":"Copy"]})]}),(0,n.jsx)("pre",{className:"text-xs font-mono bg-content2 border border-default-200 rounded-lg p-2.5 overflow-hidden text-default-500 whitespace-pre-wrap break-words",children:f})]})]})})]})}var B=i(85676),W=i(55415),_=i(93071);let G=()=>{var e,t,i,r,a;let d=(0,l.usePathname)(),{status:g,data:w}=(0,v.wV)(),A=(0,M.j)(),j=(0,M.G)(_.Ss),N=(0,M.G)(h.z),T=(0,M.G)(J.z$),L=(0,M.G)(J.fo),E="authenticated"===g&&!!T&&(null==w?void 0:null===(e=w.user)||void 0===e?void 0:e.id)===T.owner.id,P=c(d),I="/"===d,C=null==d?void 0:d.includes("swagger-preview");if((0,u.useEffect)(()=>{var e;(null==w?void 0:null===(e=w.user)||void 0===e?void 0:e.isAdmin)||A((0,S.Os)({newPreferences:{...j,useAI:!1}}))},[]),(0,u.useEffect)(()=>{let e=()=>{navigator&&A((0,W.If)({isOnline:navigator.onLine}))};return window.addEventListener("load",e),window.addEventListener("online",e),window.addEventListener("offline",e),()=>{window.removeEventListener("load",e),window.removeEventListener("online",e),window.removeEventListener("offline",e)}},[A]),(0,u.useEffect)(()=>{let e=e=>{e.preventDefault()};return window.addEventListener("error",e),()=>{window.removeEventListener("error",e)}},[]),C||(null==T?void 0:T.isPublished))return null;let D=null!==(a=null==w?void 0:null===(t=w.user)||void 0===t?void 0:t.username)&&void 0!==a?a:null==w?void 0:null===(i=w.user)||void 0===i?void 0:i.githubUsername,O="authenticated"===g&&D?"/".concat(D):"/",Z=null===(r=b.Z.find(e=>e.id===N.themeName))||void 0===r?void 0:r.heroui.header;return(0,n.jsxs)("header",{className:"\n        flex justify-between items-center\n        ".concat(I?"px-4 py-3":"pl-1.5 pr-4 py-1","\n        bg-default-50 border-b-1 border-t-0 border-l-0 border-r-0 border-solid border-default-300\n      "),style:Z?{backgroundColor:Z.DEFAULT,color:Z.foreground}:void 0,children:[(0,n.jsxs)(o(),{href:O,className:"flex items-center gap-2",style:{textDecoration:"none"},onClick:P?e=>{e.preventDefault(),window.location.href=O}:void 0,children:[(0,n.jsx)(s.default,{className:"self-center",src:N.mode===x.dX.light?f.default:y.default,alt:"Logo",width:36,height:36}),P&&(0,n.jsx)("h1",{className:"text-2xl tracking-wider max-[460px]:text-2xl",children:"cdbx.ai"})]}),P?(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(B.q,{}),(0,n.jsx)(R,{})]}):(0,n.jsx)(o(),{href:"/",style:{textDecoration:"none"},children:(0,n.jsx)("h1",{className:"font-semibold text-3xl tracking-wider max-[460px]:text-2xl",children:"cdbx.ai"})}),(0,n.jsxs)("nav",{className:"flex items-center gap-2",children:[(0,n.jsx)(F,{}),(0,n.jsx)(k,{}),(0,n.jsx)(V,{}),E&&!L&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(m.I,{content:"Back to editor",children:(0,n.jsx)(o(),{href:"/apps/".concat(T.id,"/edit"),className:"flex items-center justify-center w-6 h-6 rounded-full hover:bg-default-100 text-default-500 hover:text-foreground transition-colors",children:(0,n.jsx)(p.sAL,{size:16})})}),(0,n.jsx)(m.I,{content:"Back to your dashboard",children:(0,n.jsx)(o(),{href:"/".concat(T.owner.username),className:"flex items-center justify-center w-6 h-6 rounded-full hover:bg-default-100 text-default-500 hover:text-foreground transition-colors",children:(0,n.jsx)(p.RdN,{size:16})})})]})]})]})};var q=i(10980),X=i(54252),K=i(61549),H=i(47404),Y=i(95811),Q=i(36316),$=i(5230),ee=i(21966),et=i(62023),ei=i(91685),en=i(69798),el=i(87436),es=i(17874),er=i(76119),eo=i(67370);let ea=eo.Ik({name:eo.Yj().min(3,{message:"Name must be at least 3 characters"}).max(50,{message:"Name cannot be more than 50 characters"}).trim(),description:eo.Yj().min(0).max(300,{message:"Description cannot be more than 300 characters"}).trim()}),ed=e=>{let{isOpen:t,onOpen:i,onClose:l,onOpenChange:s,trigger:r}=e,o=(0,M.j)(),{data:a}=(0,v.wV)(),d=(0,M.G)(X.iy),c=(0,M.G)(U.W6),u=(0,er.rp)(c)?"Program":"App",{register:m,handleSubmit:p,formState:{errors:y,isValid:f}}=(0,el.mN)({resolver:(0,es.u)(ea),mode:"onTouched"}),h=e=>{let{name:t,description:i}=e;
1a&&o((0,X.e1)({userId:a.user.id,name:t,description:i})),l()};return(0,n.jsxs)(n.Fragment,{children:[r,(0,n.jsx)(Q.Y,{size:"2xl",isOpen:t,onOpenChange:s,classNames:{backdrop:"bg-black/50",header:"border-0 border-solid border-b-[1px] border-default-200",footer:"border-0 border-solid border-t-[1px] border-default-200"},children:(0,n.jsx)($.g,{children:e=>{var t,i;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(ee.c,{className:"flex flex-col gap-1",children:["Save ",u]}),(0,n.jsxs)("form",{onSubmit:p(h),children:[(0,n.jsx)(et.h,{children:(0,n.jsxs)("div",{className:"space-y-4 py-12",children:[(0,n.jsx)(ei.r,{fullWidth:!0,isClearable:!0,defaultValue:d,type:"text",variant:"bordered",label:"Name",labelPlacement:"outside-left",description:"Required",...m("name",{required:!0}),isInvalid:!!y.name,errorMessage:null===(t=y.name)||void 0===t?void 0:t.message,classNames:{mainWrapper:"w-full",label:"w-[90px]",inputWrapper:" shadow-md rounded border-1.5 border-solid !border-slate-500 dark:!border-slate-600"}}),(0,n.jsx)(ei.r,{fullWidth:!0,isClearable:!0,defaultValue:"",type:"text",variant:"bordered",label:"Description",labelPlacement:"outside-left",description:"Optional",...m("description",{required:!0}),isInvalid:!!y.description,errorMessage:null===(i=y.description)||void 0===i?void 0:i.message,classNames:{mainWrapper:"w-full",label:"w-[90px]",inputWrapper:"shadow-md rounded border-1.5 border-solid !border-slate-500 dark:!border-slate-600"}})]})}),(0,n.jsx)(en.q,{children:(0,n.jsxs)(g.T,{type:"submit",className:"bg-green-500 text-white",isDisabled:!f,children:["Save ",u]})})]})]})}})})]})};var ec=i(25240),eu=i(85381),em=i(70342);let ep=[{href:"https://x.com/cdbxai",label:"X (Twitter)",icon:em.vIh},{href:"https://www.reddit.com/user/cdbx-ai/",label:"Reddit",icon:em.JaC},{href:"https://www.linkedin.com/company/cdbx",label:"LinkedIn",icon:eu.QEs},{href:"https://www.instagram.com/cdbx.ai/",label:"Instagram",icon:em.rcE}],ey=e=>{let{className:t=""}=e;return(0,n.jsx)("div",{className:"flex items-center gap-3 ".concat(t),style:{display:"flex",flexDirection:"row",alignItems:"center",gap:12},children:ep.map(e=>{let{href:t,label:i,icon:l}=e;return(0,n.jsx)("a",{href:t,target:"_blank",rel:"noopener noreferrer","aria-label":i,title:i,className:"text-gray-400 hover:text-gray-200 transition-colors",style:{color:"#9ca3af"},children:(0,n.jsx)(l,{size:16})},t)})})},ef=()=>{let{data:e}=(0,v.wV)(),t=(0,l.usePathname)(),{status:i}=(0,H.K)(),s=(0,M.G)(J.z$),r=c(t),a=r&&!!i,d=r&&!a,m=null==t?void 0:t.includes("swagger-preview"),p=(0,M.j)(),{isOpen:y,onOpen:f,onClose:h,onOpenChange:x}=(0,q.j)(),b=(0,M.G)(X.Vr),g=(0,M.G)(X.Ku),w=(0,M.G)(K.Xk),A=(0,M.G)(U.W6),j=A?(0,ec.K0)(A):"",N=(0,M.G)(X.wo),T=(0,M.G)(U.F3),L=(0,M.G)(U.Zx),S=d&&T?N?L>0?"unsaved":"saved":"unsaved-new":null,[V,E]=(0,u.useState)("idle");return((0,u.useEffect)(()=>{if(b){E("bundling");return}if(null==g?void 0:g.err){E("error");return}if(null==g?void 0:g.code){E("success");let e=setTimeout(()=>E("idle"),3e3);return()=>clearTimeout(e)}},[b,null==g?void 0:g.code,null==g?void 0:g.err]),m||(null==s?void 0:s.isPublished))?null:(0,n.jsxs)("footer",{className:"\n        flex items-center\n        ".concat(r?"justify-between h-[36px]":"flex-col md:grid md:grid-cols-3 gap-4 justify-center","\n        bg-default-50 text-xs text-gray-400\n        px-4 ").concat(r?"":"py-4","\n        border-0 border-t border-solid border-default-300\n      "),children:[(0,n.jsxs)("div",{className:"flex justify-center md:justify-start items-center",children:[!r&&!e&&(0,n.jsxs)("span",{className:"mr-3",children:["Built by"," ",(0,n.jsx)(o(),{href:Y.UM.social.linkedIn,target:"_blank",className:"text-gray-300 hover:text-primary transition-colors",children:Y.UM.fullName})]}),(0,n.jsx)(o(),{href:"/"}),d&&j&&(0,n.jsx)("span",{className:"font-mono text-xs text-gray-500 mr-3",children:j}),a&&(null==i?void 0:i.framework)&&(0,n.jsx)("span",{className:"font-mono text-xs text-gray-500 mr-3",children:i.framework}),d&&!w&&"idle"!==V&&(0,n.jsxs)("span",{className:"flex items-center gap-1 font-mono text-xs ".concat("bundling"===V?"text-blue-400":"error"===V?"text-red-400":"text-green-400"),children:[(0,n.jsx)("span",{className:"inline-block h-1.5 w-1.5 rounded-full ".concat("bundling"===V?"bg-blue-400 animate-pulse":"error"===V?"bg-red-400":"bg-green-400")}
1),"bundling"===V?"Bundling…":"error"===V?"Build failed":"Bundle complete"]}),a&&i&&("error"===i.phase?(0,n.jsxs)("span",{className:"flex items-center gap-1 font-mono text-xs text-red-400",title:i.message,children:[(0,n.jsx)("span",{className:"inline-block h-1.5 w-1.5 rounded-full bg-red-400"})," error",i.onRetry&&(0,n.jsx)("button",{onClick:i.onRetry,className:"underline hover:text-red-300",children:"retry"})]}):"ready"!==i.phase?(0,n.jsxs)("span",{className:"flex items-center gap-1 font-mono text-xs text-yellow-400",title:i.message,children:[(0,n.jsx)("span",{className:"inline-block h-1.5 w-1.5 rounded-full bg-yellow-400 animate-pulse"}),"starting"===i.phase?"starting…":"opening"===i.phase?"connecting…":"loading…"]}):(0,n.jsxs)("span",{className:"flex items-center gap-1 font-mono text-xs text-green-400",children:[(0,n.jsx)("span",{className:"inline-block h-1.5 w-1.5 rounded-full bg-green-400"}),"open"===i.connectionState?"connected":i.connectionState]})),a&&(null==i?void 0:i.saveState)&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("span",{className:"mx-2 h-3 w-px bg-default-300","aria-hidden":!0}),"saving"===i.saveState?(0,n.jsxs)("span",{className:"flex items-center gap-1 font-mono text-xs text-gray-500",title:"Saving to the container…",children:[(0,n.jsx)("span",{className:"inline-block h-1.5 w-1.5 rounded-full bg-gray-400 animate-pulse"})," Saving…"]}):"unsaved"===i.saveState?(0,n.jsxs)("button",{onClick:i.onSave,className:"flex items-center gap-1 font-mono text-xs text-yellow-400 hover:text-yellow-300",title:"Unsaved changes — click to save (⌘S)",children:[(0,n.jsx)("span",{className:"inline-block h-1.5 w-1.5 rounded-full bg-yellow-400"})," Unsaved"]}):(0,n.jsxs)("span",{className:"flex items-center gap-1 font-mono text-xs text-gray-500",title:"All changes saved to the container",children:[(0,n.jsx)("span",{className:"inline-block h-1.5 w-1.5 rounded-full bg-green-400"})," Saved"]})]}),S&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("span",{className:"mx-2 h-3 w-px bg-default-300","aria-hidden":!0}),"saved"===S?(0,n.jsxs)("span",{className:"flex items-center gap-1 font-mono text-xs text-gray-500",title:"All changes saved",children:[(0,n.jsx)("span",{className:"inline-block h-1.5 w-1.5 rounded-full bg-green-400"})," Saved"]}):(0,n.jsxs)("button",{onClick:()=>{N?p((0,X.t3)({silent:!0})):f()},className:"flex items-center gap-1 font-mono text-xs text-yellow-400 hover:text-yellow-300",title:"unsaved-new"===S?"Never saved — click to save":"Unsaved changes — click to save",children:[(0,n.jsx)("span",{className:"inline-block h-1.5 w-1.5 rounded-full bg-yellow-400"})," Unsaved"]}),"unsaved-new"===S&&(0,n.jsx)(ed,{isOpen:y,onOpen:f,onClose:h,onOpenChange:x,trigger:null})]})]}),!r&&(0,n.jsxs)("nav",{className:"flex justify-center items-center gap-4",children:[(0,n.jsx)(o(),{href:"/about",children:"About"}),(0,n.jsx)(o(),{href:"/terms",children:"Terms"}),(0,n.jsx)(o(),{href:"/privacy",children:"Privacy"}),(0,n.jsx)(o(),{href:"/contact",children:"Contact"}),(0,n.jsx)(o(),{href:"/invest",children:"Invest"}),(0,n.jsx)(o(),{href:"/feature-requests",children:"Feature requests"}),(0,n.jsx)(o(),{href:"/status",children:"Status"})]}),(0,n.jsxs)("div",{className:"flex justify-center md:justify-end items-center gap-4",children:[!r&&(0,n.jsx)(ey,{}),(0,n.jsx)("div",{children:"\xa9 ".concat(new Date().getFullYear()," cdbx.ai.")})]})]})};var eh=i(53042);let ex=[{key:"ai",text:"AI features are temporarily disabled. They will be back soon."},{key:"codeExecution",text:"Code execution is temporarily disabled. It will be back soon."},{key:"mcp",text:"The MCP server is temporarily disabled. It will be back soon."}];function eb(){let{ai:e,codeExecution:t,mcp:i,isLoading:l}=(0,eh.e)();if(l)return null;let s={ai:e,codeExecution:t,mcp:i},r=ex.filter(e=>!s[e.key]);return 0===r.length?null:(0,n.jsx)("div",{className:"flex flex-col bg-warning-50 dark:bg-warning-950/30 border-b border-warning-200 dark:border-warning-900",children:r.map(e=>(0,n.jsxs)("div",{className:"flex items-center justify-center gap-2 px-4 py-1.5 text-xs font-medium text-warning-600",children:[(0,n.jsx)(p.fQM,{size:14,className:"shrink-0"}),e.text]},e.key))})}var ev=i(65460),eg=i(1060);let ew={[x.VL.success]:{wrapperCls:"bg-success/10 border-success/30",iconCls:"text-success",icon:(0,n.jsx)(w.G3G,{size:18})},[x.VL.error]:{wrapperCls:"bg-danger/10 border-danger/30",iconCls:"text-danger",icon:(0,n.jsx)(w.dSe,{size:18})},[x.VL.warn]:{wrapperCls:"bg-warning/10 border-warning/30",iconCls:"text-warning",icon:(0,n.jsx)(w.tr_,{size:18})},[x.VL.info]:{wrapperCls:"bg-primary/10 border-primary/30",iconCls:"text-primary",icon:(0,n.jsx)(w.TBY,{size:18})},[x.VL.default]:{wrapperCls:"bg-default-100 border-default-200",iconCls:"text-default-500",icon:null}},eA=e=>{var t;let{notification:i}=e,l=(0,M.j)(),s=(0,u.useRef)(null),{id:r,message:o="",description:a,descriptionAsCode:d=!1,notificationType:c,dissmissable:m=!0,showIcon:p=!0}=i,y=null!==(t=ew[c])&&void 0!==t?t:ew[x.VL.default],{shouldAutoRemove:f,effectiveDuration:h}=(0,eg.K)(i),b=()=>l((0,ev.ww)({notificationId:r}));return((0,u.useEffect)(()=>
1{if(f)return s.current=setTimeout(b,h),()=>{s.current&&clearTimeout(s.current)}},[r,h,f]),("string"==typeof o?o.trim().length>0:!!o)||a)?(0,n.jsxs)("div",{className:"flex items-start gap-3 w-80 rounded-lg border px-4 py-3 shadow-md ".concat(y.wrapperCls),children:[p&&y.icon&&(0,n.jsx)("span",{className:"shrink-0 mt-0.5 ".concat(y.iconCls),children:y.icon}),(0,n.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,n.jsx)("p",{className:"text-sm font-medium text-foreground leading-snug",children:o}),a&&!d&&(0,n.jsx)("p",{className:"mt-1 text-xs text-foreground/70 break-words",children:a}),a&&d&&(0,n.jsx)("pre",{className:"mt-1 text-xs text-foreground/80 overflow-x-auto",children:(0,n.jsx)("code",{children:String(a)})})]}),m&&(0,n.jsx)("button",{onClick:b,className:"shrink-0 mt-0.5 p-0.5 rounded text-default-400 hover:text-default-600 dark:hover:text-default-200 transition-colors","aria-label":"Dismiss",children:(0,n.jsx)(w.lr4,{size:16})})]}):null},ej=e=>{let{instanceLocation:t}=e,i=(0,M.G)(ev.Tr);if(null===i||0===i.length)return null;let l=i.filter(e=>{let{displayLocation:i,environments:n=["development","production"]}=e;return i===t&&n.includes("production")});return 0===l.length?null:(0,n.jsx)("div",{className:"fixed bottom-4 right-4 z-[200] flex flex-col gap-2 items-end pointer-events-none",children:l.map(e=>(0,n.jsx)("div",{className:"pointer-events-auto",children:(0,n.jsx)(eA,{notification:e})},e.id))})},eN=["/oauth"];function eM(e){let{children:t}=e,i=(0,l.usePathname)();return eN.some(e=>null==i?void 0:i.startsWith(e))?(0,n.jsx)(n.Fragment,{children:t}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(G,{}),(0,n.jsx)(eb,{}),(0,n.jsx)(ej,{instanceLocation:x.hZ.banner}),(0,n.jsx)("div",{className:"flex flex-col flex-1",children:t}),(0,n.jsx)(ef,{})]})}},80422:(e,t,i)=>{"use strict";i.d(t,{ML:()=>n,S8:()=>l,bz:()=>r,jZ:()=>s});let n="Send me a welcome email with 50% off Pro, plus occasional product updates. Unsubscribe anytime.",l="cdbx_promo_consent",s=900,r={title:"Want product updates from cdbx?",body:"We've changed how email works: we now only send product updates and offers to people who ask for them.\n\nYou're currently set to receive none, which means you won't hear about new features unless you turn it on.\n\nTakes one click under **Email communication** — and you can turn it back off just as easily.",link:"/?tab=settings-email-communications"}},91698:(e,t,i)=>{"use strict";i.d(t,{HeroUIProvider:()=>s});var n=i(9417),l=i(58597);function s(e){let{children:t}=e;return(0,n.jsx)(l.M,{children:t})}},93549:(e,t,i)=>{"use strict";i.d(t,{NextAuthSessionProvider:()=>s});var n=i(9417);i(50653);var l=i(2252);let s=e=>{let{children:t,session:i}=e;return(0,n.jsx)(l.CP,{session:i,refetchInterval:60,children:t})}},29354:(e,t,i)=>{"use strict";i.d(t,{PostHogProvider:()=>d});var n=i(9417),l=i(50653),s=i(26631),r=i(38597),o=i(2252);function a(){var e,t;let{data:i,status:n}=(0,o.wV)(),r=(0,l.useRef)(null);return(0,l.useEffect)(()=>{var e;"authenticated"===n&&(null==i?void 0:null===(e=i.user)||void 0===e?void 0:e.id)&&r.current!==i.user.id?(r.current=i.user.id,s.Ay.identify(i.user.id,{tier:i.user.tier})):"unauthenticated"===n&&r.current&&(r.current=null,s.Ay.reset())},[n,null==i?void 0:null===(e=i.user)||void 0===e?void 0:e.id,null==i?void 0:null===(t=i.user)||void 0===t?void 0:t.tier]),null}function d(e){let{children:t}=e;return(0,n.jsxs)(r.so,{client:s.Ay,children:[(0,n.jsx)(a,{}),t]})}s.Ay.init("phc_Df3DueWF8fckTeih7krtuo6KqsNNhBma8SSNTndh4eJg",{api_host:"https://eu.i.posthog.com",person_profiles:"identified_only",capture_pageview:!1,session_recording:{maskAllInputs:!0}})},47404:(e,t,i)=>{"use strict";i.d(t,{K:()=>o,ProjectEditorStatusProvider:()=>r});var n=i(9417),l=i(50653);let s=(0,l.createContext)({status:null,setStatus:()=>{}});function r(e){let{children:t}=e,[i,r]=(0,l.useState)(null),o=(0,l.useMemo)(()=>({status:i,setStatus:r}),[i]);return(0,n.jsx)(s.Provider,{value:o,children:t})}let o=()=>(0,l.useContext)(s)},38883:(e,t,i)=>{"use strict";i.d(t,{default:()=>eQ});var n=i(9417),l=i(50653),s=i(41986),r=i(98785),o=i(58915),a=i(54318),d=i(18329),c=i(54252),u=i(830),m=i(31325),p=i(99536),y=i(54205);let f=e=>e.aiChat.config;function*h(e){let{payload:{chatId:t}}=e;try{yield(0,a.Lt)(f);let e=yield(0,a.Lt)(p.Lg),i=(0,m.Ex)(null!=e?e:null),n={id:t,title:"New Chat",messages:[{id:(0,u.MZ)(),role:"system",content:i,
1createdAt:new Date().toISOString(),copied:!1}],createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};yield(0,a.yJ)(d.Kc.createChatSucceeded(n))}catch(e){console.error("Error creating chat:",e)}}function*x(e){let t=yield(0,a.Lt)(y.DU),i=!1;for(let n of e){let e=t[n];e&&(yield(0,a.yJ)(c.Vs.setFileContentByPath({path:n,content:e.proposedContent})),yield(0,a.yJ)(d.Kc.rejectPendingEdit(n)),i=!0)}i&&(yield(0,a.yJ)(c.Vs.markAppAsBuilt()),yield(0,a.yJ)(d.Kc.exitChatOnlyMode()),"bundle"===(yield(0,a.Lt)(p.jx))&&(yield(0,a.yJ)(c.Vs.bundleCode())),yield(0,a.yJ)(c.Vs.updateExperiment({silent:!0})))}function*b(e){let{payload:t}=e;yield*x([t])}function*v(){let e=yield(0,a.Lt)(y.DU);yield*x(Object.keys(e))}var g=i(44333),w=i(57271),A=i(93071);function*j(e){let{payload:{panelId:t}}=e;try{let e=yield(0,a.Lt)(A.P8),i=(0,u.W5)({panels:e,panelId:t,newPropsValues:{isSelected:!0},noMatchProps:{isSelected:!1}});yield(0,a.yJ)(w.T6.setSidePanelSelectedSucceeded(i))}catch(i){let e={id:(0,u.MZ)(),message:"Unable to set side panel with id: ".concat(t," as selected."),notificationType:g.VL.error,displayLocation:g.hZ.banner,removeNotification:!0,dissmissable:!0,showIcon:!0};yield(0,a.T1)(u.bM,i,"setTabSelected",e)}}function*N(e){let{payload:{tabId:t}}=e;try{let e=yield(0,a.Lt)(A.F4),i=(0,u.Nt)({tabs:e,tabId:t,newPropsValues:{isSelected:!0},noMatchProps:{isSelected:!1}});yield(0,a.yJ)(w.T6.setTabSelectedSucceeded(i))}catch(i){let e={id:(0,u.MZ)(),message:"Unable to set tab with id: ".concat(t," as selected."),notificationType:g.VL.error,displayLocation:g.hZ.banner,removeNotification:!0,dissmissable:!0,showIcon:!0};yield(0,a.T1)(u.bM,i,"setTabSelected",e)}}function*M(e){let{payload:{tabId:t}}=e;try{let e=yield(0,a.Lt)(A.F4),i=(0,u.Nt)({tabs:e,tabId:t,newPropsValues:{isSelected:!0,isOpen:!0},noMatchProps:{isSelected:!1}});yield(0,a.yJ)(w.T6.setTabSelectedAndOpenSucceeded(i))}catch(i){let e={id:(0,u.MZ)(),message:"Unable to set tab with id: ".concat(t," as selected and open."),notificationType:g.VL.error,displayLocation:g.hZ.banner,removeNotification:!0,dissmissable:!0,showIcon:!0};yield(0,a.T1)(u.bM,i,"setTabSelectedAndOpen",e)}}function*T(e){let{payload:{tabId:t}}=e;try{let e=yield(0,a.Lt)(A.F4),i=(0,u.Nt)({tabs:e,tabId:t,newPropsValues:{isOpen:!1,isSelected:!1}}),n=yield(0,a.Lt)(A.Zi);if(n.length>1){let e;let l=n.findIndex(e=>e.id===t);e=0===l?n[l+1].id:n[l-1].id,i=(0,u.Nt)({tabs:i,tabId:e,newPropsValues:{isSelected:!0},noMatchProps:{isSelected:!1}})}yield(0,a.yJ)(w.T6.setTabClosedSucceeded(i))}catch(i){let e={id:(0,u.MZ)(),message:"Unable to set tab with id: ".concat(t," closed."),notificationType:g.VL.error,displayLocation:g.hZ.banner,removeNotification:!0,dissmissable:!0,showIcon:!0};yield(0,a.T1)(u.bM,i,"setTabClosed",e)}}var L=i(94390),S=i(65460),V=i(61549),E=i(32883),P=i(4271),I=i(64685),C=i(74015),J=i(53960),k=i(57827),D=i(14430),O=i(58601),Z=i(95811);let z=new Set(["js","jsx","ts","tsx","vue","svelte"]),F=new Set(["assert","async_hooks","buffer","child_process","cluster","console","crypto","dgram","diagnostics_channel","dns","domain","events","fs","fs/promises","http","http2","https","inspector","module","net","os","path","perf_hooks","process","punycode","querystring","readline","repl","stream","string_decoder","timers","tls","trace_events","tty","url","util","v8","vm","wasi","worker_threads","zlib","node:fs","node:path","node:os","node:http","node:https","node:crypto","node:events","node:stream","node:util","node:buffer","node:process"]),U=[/\bfrom\s+['"]([^'"]+)['"]/gm,/\bimport\s+['"]([^'"./][^'"]*)['"]/gm,/\brequire\s*\(\s*['"]([^'"./][^'"]*)['"]\s*\)/gm,/\bimport\s*\(\s*['"]([^'"./][^'"]*)['"]\s*\)/gm];function*R(e){let{payload:{userId:t,name:i,description:n}}=e;
1try{yield(0,a.yJ)(c.Vs.createNewExperimentRequested());let e=yield(0,a.Lt)(p.Lg),l=(0,I.eN)(e),s=(0,I.BR)({userId:t,name:i,description:n,experiment:{...e,previewHtml:l}}),r=yield(0,a.T1)(J.A.Experiment.create,{experiment:s}),o=yield(0,a.T1)(I.k8,{data:r.data}),d={...o},u=yield(0,a.Lt)(p.EX);if("bundle"===e.BuildType){let{code:e,err:t}=yield(0,a.T1)(E.m,{experiment:o,envVars:u});d={...o,bundle:{code:e,err:t}}}yield(0,a.yJ)(c.Vs.createNewExperimentSucceeded(d)),yield(0,a.yJ)(c.Vs.setSavedFiles(d.files))}catch(t){let e={id:(0,u.MZ)(),message:"Unable to create new experiment.",notificationType:g.VL.error,displayLocation:g.hZ.banner,removeNotification:!0,dissmissable:!0,showIcon:!0};yield(0,a.T1)(O.b,t,"createNewExperiment",e,c.Vs.createNewExperimentFailed)}}function*B(e){let{payload:{userId:t}}=e;try{yield(0,a.yJ)(c.Vs.fetchUserExperimentsRequested());let e=yield(0,a.T1)(J.A.User.getExperimentsForUser,{userId:t}),i=yield(0,a.T1)(I.xC,{data:e.data});yield(0,a.yJ)(c.Vs.fetchUserExperimentsSucceeded(i))}catch(i){let e={id:(0,u.MZ)(),message:"Unable to fetch experiments for user with id: ".concat(t,"."),notificationType:g.VL.error,displayLocation:g.hZ.banner,removeNotification:!0,dissmissable:!0,showIcon:!0};yield(0,a.T1)(O.b,i,"loadExperiment",e,c.Vs.fetchUserExperimentsFailed)}}function*W(e){let{payload:{experimentId:t}}=e;try{var i;
1yield(0,a.yJ)(c.Vs.loadExperimentRequested());let e=yield(0,a.T1)(J.A.Experiment.getExperimentById,{experimentId:t}),n=yield(0,a.T1)(I.k8,{data:e.data}),l=[];if("plan"!==n.type)try{let e=yield(0,a.T1)(J.A.Experiment.getEnvVars,{experimentId:t});l=(null==e?void 0:e.data)||[]}catch(e){}yield(0,a.yJ)(c.Vs.setEnvVars(l));let s={...n},r=(0,u.ZS)(n.templateId),o=null!==(i=null==r?void 0:r.buildType)&&void 0!==i?i:n.BuildType;if("bundle"===o){let{code:e,err:t}=yield(0,a.T1)(E.m,{experiment:n,envVars:l});if(!(s={...n,bundle:{code:e,err:t}}).thumbnailUrl){let i=(0,I.eN)({...s,bundle:{code:e,err:t}});i&&(yield(0,a.yJ)(c.Vs.partialUpdateExperiment({experimentId:s.id,updatedProperties:{previewHtml:i}})))}}n.templateId===g.TW.note?(yield(0,a.yJ)((0,V.MT)(!1)),yield(0,a.yJ)((0,V.rW)(!1)),yield(0,a.yJ)((0,V.zO)(!1))):"compile"===o?(yield(0,a.yJ)((0,V.MT)(!1)),yield(0,a.yJ)((0,V.rW)(!0)),yield(0,a.yJ)((0,V.zO)(!1)),yield(0,a.yJ)((0,V.LX)(!1)),yield(0,a.yJ)((0,w.Cm)())):(yield(0,a.yJ)((0,V.MT)(!1)),yield(0,a.yJ)((0,V.rW)(!0)),yield(0,a.yJ)((0,V.zO)(!0)),yield(0,a.yJ)((0,V.LX)(!0)),yield(0,a.yJ)((0,w.Zq)())),yield(0,a.yJ)(c.
1Vs.loadExperimentSucceeded(s)),yield(0,a.yJ)(c.Vs.setSavedFiles(s.files))}catch(i){let e={id:(0,u.MZ)(),message:"Unable to load user experiment with id: ".concat(t,"."),notificationType:g.VL.error,displayLocation:g.hZ.banner,removeNotification:!0,dissmissable:!0,showIcon:!0};yield(0,a.T1)(O.b,i,"loadExperiment",e,c.Vs.loadExperimentFailed)}}function*_(e){let{payload:{experimentId:t,updatedExperiment:i,silent:n=!1}}=e;try{let e,l;if(yield(0,a.yJ)(c.Vs.updateExperimentRequested()),t&&i){let i=(yield(0,a.Lt)(p.GA)).find(e=>e.id===t);if(!i){let e=yield(0,a.Lt)(p.Lg);(null==e?void 0:e.id)===t&&(i=e)}if(!i)throw Error("Experiment with id ".concat(t," not found"));e=i}else e=yield(0,a.Lt)(p.Lg);let s={code:""},r={...e,...s},o="",d=yield(0,a.Lt)(p.EX);if("bundle"===e.BuildType){let{code:t,err:i}=yield(0,a.T1)(E.m,{experiment:r,envVars:d});s={code:t,err:i},r={...e,...s},o=(0,I.eN)({...e,bundle:{code:t,err:i}})}let m=(0,I.eA)({experiment:{...e,previewHtml:o}});if(!(null==(l=yield(0,a.T1)(J.A.Experiment.update,{experiment:m}))?void 0:l.data))throw Error("Response data is undefined");r={...(0,I.k8)({data:l.data}),...s};let y=yield(0,a.Lt)(p.zH);
1if(yield(0,a.yJ)(c.Vs.updateExperimentSucceeded(r)),yield(0,a.yJ)(c.Vs.setSavedFiles(r.files)),r.id&&function(e,t){let i=new Map(e.filter(e=>e.type===g.iv.file).map(e=>{var t;return[e.path,null!==(t=e.content)&&void 0!==t?t:""]})),n=t.filter(e=>e.type===g.iv.file);return i.size!==n.length||n.some(e=>{var t;return!i.has(e.path)||i.get(e.path)!==(null!==(t=e.content)&&void 0!==t?t:"")})}(y,r.files))try{let e=r.files.filter(e=>e.type===g.iv.file).map(e=>({path:e.path,name:e.name,content:e.content||"",type:e.type}));yield(0,a.T1)(J.A.Experiment.createSnapshot,{experimentId:r.id,files:e}),yield(0,a.yJ)(c.Vs.snapshotCreated())}catch(e){}if(!n){let e={id:(0,u.MZ)(),message:"Experiment updated successfully.",notificationType:g.VL.success,displayLocation:g.hZ.banner,removeNotification:!0,dissmissable:!0,showIcon:!0};yield(0,a.yJ)(S.P9.setNotification({notification:e}))}}catch(t){let e={id:(0,u.MZ)(),message:"Unable to update experiment.",notificationType:g.VL.error,displayLocation:g.hZ.banner,removeNotification:!0,dissmissable:!0,showIcon:!0};yield(0,a.T1)(O.b,t,"updateExperiment",e,c.Vs.updateExperimentFailed)}}let G=new Set(["name","description","tags","published","publishedSlug","previewToken","access","archived"]),q=e=>Object.keys(e).every(e=>G.has(e));function*X(e){let{payload:{experimentId:t,updatedProperties:i={},silent:n=!1}}=e;try{var l;let e;
1if(yield(0,a.yJ)(c.Vs.updateExperimentRequested()),t){if(!(e=(yield(0,a.Lt)(p.GA)).find(e=>e.id===t))){let i=yield(0,a.Lt)(p.Lg);(null==i?void 0:i.id)===t&&(e=i)}if(!e)throw Error("Experiment with id ".concat(t," not found"))}else e=yield(0,a.Lt)(p.Lg);if(!e)throw Error("No experiment to update");let s=(0,u.ZS)(e.templateId),r=null!==(l=null==s?void 0:s.buildType)&&void 0!==l?l:e.BuildType,o={code:""},d="",m=yield(0,a.Lt)(p.EX);if("bundle"===r&&!q(i)){let{code:t,err:n}=yield(0,a.T1)(E.m,{experiment:{...e,...i},envVars:m});o={code:t,err:null!=n?n:void 0},d=(0,I.eN)({...e,...i,bundle:{code:t,err:null!=n?n:void 0}})}let y=yield(0,a.T1)(J.A.Experiment.partialUpdate,{experimentId:t||e.id||"",body:{...i,...d?{previewHtml:d}:{}}});if(!(null==y?void 0:y.data))throw Error("Response data is undefined.");let f={...(0,I.k8)({data:y.data}),bundle:o};if(yield(0,a.yJ)(c.Vs.partialUpdateExperimentSucceeded(f)),!n){let e={id:(0,u.MZ)(),message:"Experiment updated successfully.",notificationType:g.VL.success,displayLocation:g.hZ.banner,removeNotification:!0,dissmissable:!0,showIcon:!0};yield(0,a.yJ)(S.P9.setNotification({notification:e}))}}catch(t){let e={id:(0,u.MZ)(),message:"Unable to update experiment.",notificationType:g.VL.error,displayLocation:g.hZ.banner,removeNotification:!0,dissmissable:!0,showIcon:!0};yield(0,a.T1)(O.b,t,"partialUpdateExperiment",e,c.Vs.partialUpdateExperimentFailed)}}function*K(e){let{payload:{experimentId:t,silent:i}}=e;
1try{if(yield(0,a.yJ)(c.Vs.deleteExperimentRequested()),yield(0,a.T1)(J.A.Experiment.delete,{experimentId:t}),yield(0,a.yJ)(c.Vs.deleteExperimentSucceeded({experimentId:t})),!i){let e={id:(0,u.MZ)(),message:"Experiment deleted.",notificationType:g.VL.success,displayLocation:g.hZ.banner,removeNotification:!0,dissmissable:!0,showIcon:!0};yield(0,a.yJ)(S.P9.setNotification({notification:e}))}}catch(t){let e={id:(0,u.MZ)(),message:"Unable to delete experiment.",notificationType:g.VL.error,displayLocation:g.hZ.banner,removeNotification:!0,dissmissable:!0,showIcon:!0};yield(0,a.T1)(O.b,t,"deleteExperiment",e,c.Vs.deleteExperimentFailed)}}function*H(e){let{payload:{experimentId:t,archive:i=!0}}=e;try{yield(0,a.yJ)(c.Vs.toggleExperimentArchiveRequested());let{archived:e}=(yield(0,a.T1)(J.A.Experiment.archive,{experimentId:t,body:{archive:i}})).data;yield(0,a.yJ)(c.Vs.toggleExperimentArchiveSucceeded({experimentId:t,archived:e}))}catch(i){let e={id:(0,u.MZ)(),message:"Unable to set experiment archive status for experiment with id: ".concat(t,"."),notificationType:g.VL.error,displayLocation:g.hZ.banner,removeNotification:!0,dissmissable:!0,showIcon:!0};yield(0,a.T1)(O.b,i,"toggleExperimentArchive",e,c.Vs.toggleExperimentArchiveFailed)}}function*Y(e){let{payload:{experimentId:t,access:i,previousAccess:n}}=e;
1try{yield(0,a.yJ)(c.Vs.toggleExperimentAccessRequested());let{access:e}=(yield(0,a.T1)(J.A.Experiment.toggleAccess,{experimentId:t,body:{access:i}})).data;yield(0,a.yJ)(c.Vs.toggleExperimentAccessSucceeded({experimentId:t,access:e}))}catch(i){let e={id:(0,u.MZ)(),message:"Unable to set experiment access for experiment with id: ".concat(t,"."),notificationType:g.VL.error,displayLocation:g.hZ.banner,removeNotification:!0,dissmissable:!0,showIcon:!0};yield(0,a.yJ)(c.Vs.toggleExperimentAccessFailed({experimentId:t,access:n})),yield(0,a.T1)(O.b,i,"toggleExperimentAccess",e)}}function*Q(e){let{payload:{experimentId:t}}=e;try{yield(0,a.yJ)(c.Vs.forkExperimentRequested());let e=yield(0,a.T1)(J.A.Experiment.fork,{experimentId:t}),i=(0,I.k8)({data:e.data});yield(0,a.yJ)(c.Vs.forkExperimentSucceeded({experiment:i}));let n={id:(0,u.MZ)(),message:"Experiment forked.",notificationType:g.VL.success,displayLocation:g.hZ.banner,removeNotification:!0,dissmissable:!0,showIcon:!0};yield(0,a.yJ)(S.P9.setNotification({notification:n}))}catch(t){let e={id:(0,u.MZ)(),message:"Unable to fork experiment.",notificationType:g.VL.error,displayLocation:g.hZ.banner,removeNotification:!0,dissmissable:!0,showIcon:!0};yield(0,a.T1)(O.b,t,"forkExperiment",e,c.Vs.forkExperimentFailed)}}function*$(e){let{payload:{experimentId:t,previousStars:i}}=e;
1try{yield(0,a.yJ)(c.Vs.starExperimentRequested());let{stars:e}=(yield(0,a.T1)(J.A.Experiment.star,{experimentId:t})).data;yield(0,a.yJ)(c.Vs.starExperimentSucceeded({experimentId:t,stars:e}))}catch(n){let e={id:(0,u.MZ)(),message:"Unable to star experiment.",notificationType:g.VL.error,displayLocation:g.hZ.banner,removeNotification:!0,dissmissable:!0,showIcon:!0};yield(0,a.yJ)(c.Vs.starExperimentFailed({experimentId:t,stars:i})),yield(0,a.T1)(O.b,n,"starExperiment",e)}}let ee="var(--muted-foreground, var(--muted, #888))",et="var(--background, var(--bg, transparent))",ei="var(--font-sans, sans-serif)",en="display:flex;align-items:center;justify-content:center;height:100vh;"+"font-family:".concat(ei,";color:").concat(ee,";background:").concat(et,";font-size:14px"),el="{{ display: 'flex', alignItems: 'center', justifyContent: 'center', height: '100vh', "+"fontFamily: '".concat(ei,"', color: '").concat(ee,"', background: '").concat(et,"', fontSize: '14px' }}"),es={[g.TW.react]:[{path:"@/src/App.jsx",content:"import React from 'react';\n\nexport const App = () => (\n  <div style=".concat(el,">\n    Bringing your ideas to life…\n  </div>\n);\n")},{path:"@/src/Counter.jsx",content:"// placeholder\n"}],[g.TW.preact]:[{path:"@/src/App.jsx",content:"import { h } from 'preact';\n\nexport const App = () => (\n  <div style=".concat(el,">\n    Bringing your ideas to life…\n  </div>\n);\n")}],[g.TW.vue]:[{path:"@/src/App.vue",content:'<template>\n  <div style="'.concat(en,'">\n    Bringing your ideas to life…\n  </div>\n</template>\n')}],[g.TW.svelte]:[{path:"@/src/App.svelte",content:'<div style="'.concat(en,'">\n  Bringing your ideas to life…\n</div>\n')}],[g.TW.javascript]:[{path:"@/src/index.js",content:"const root = document.getElementById('root');\nroot.setAttribute('style', '".concat(en,"');\nroot.textContent = 'Bringing your ideas to life…';\n")}],[g.TW.typescript]:[{path:"@/src/index.ts",content:"const root = document.getElementById('root') as HTMLElement;\nroot.setAttribute('style', '".concat(en,"');\nroot.textContent = 'Bringing your ideas to life…';\n")}],[g.TW.html]:[{path:"@/public/index.html",content:"",htmlHeadContent:"<style>body{margin:0;".concat(en,"}</style>"),htmlBodyContent:"Bringing your ideas to life…"}]};function*er(e){let{payload:{templateId:t,onSuccess:i,isVibe:n,designSystemId:l}}=e;try{yield(0,a.Lt)(P.S);let e=(0,u.ZS)(t);if(void 0===e)throw Error("Could not find template");let s=(0,I.SD)(),r={templateId:t,BuildType:e.buildType,name:s,description:"",access:"private",archived:!1,files:n?function(e,t){let i=es[t];return i?e.map(e=>{let t=i.find(t=>t.path===e.path);if(!t)return e;let n={...e};return void 0!==t.content&&(n.content=t.content),void 0!==t.htmlHeadContent&&(n.htmlHeadContent=t.htmlHeadContent),void 0!==t.htmlBodyContent&&(n.htmlBodyContent=t.htmlBodyContent),n}):e}([...e.files],t):[...e.files],bundle:{code:""},stars:[],tags:[],...l?{designSystemId:l}:{}};t===g.TW.note?(yield(0,a.yJ)((0,V.MT)(!1)),yield(0,a.yJ)((0,V.rW)(!1)),yield(0,a.yJ)((0,V.zO)(!1))):"compile"===e.buildType?(yield(0,a.yJ)((0,V.MT)(!1)),yield(0,a.yJ)((0,V.rW)(!0)),yield(0,a.yJ)((0,V.zO)(!1)),yield(0,a.yJ)((0,V.LX)(!1)),yield(0,a.yJ)((0,w.Cm)())):n?(yield(0,a.yJ)((0,V.MT)(!0)),yield(0,a.yJ)((0,V.iQ)(!1)),yield(0,a.yJ)((0,V.rW)(!0)),yield(0,a.yJ)((0,V.zO)(!1)),yield(0,a.yJ)((0,V.LX)(!1))):(yield(0,a.yJ)((0,V.MT)(!1)),yield(0,a.yJ)((0,V.rW)(!0)),yield(0,a.yJ)((0,V.zO)(!0)),yield(0,a.yJ)((0,V.LX)(!0)),yield(0,a.yJ)((0,w.Zq)())),yield(0,a.yJ)((0,k.rR)()),yield(0,a.yJ)(c.
1Vs.selectTemplateSucceeded(r)),i&&i(),"bundle"===e.buildType&&(yield(0,a.yJ)(c.Vs.bundleCode()))}catch(i){let e={id:(0,u.MZ)(),message:"Unable to select template with id: ".concat(t),notificationType:g.VL.error,displayLocation:g.hZ.banner,removeNotification:!0,dissmissable:!0,showIcon:!0};yield(0,a.T1)(O.b,i,"selectTemplate",e)}}function*eo(e){let{payload:{experimentId:t}}=e;try{var i;let e=yield(0,a.T1)(J.A.Experiment.getExperimentById,{experimentId:t}),n=yield(0,a.T1)(I.k8,{data:e.data}),l=[];try{let e=yield(0,a.T1)(J.A.Experiment.getEnvVars,{experimentId:t});l=(null==e?void 0:e.data)||[]}catch(e){}yield(0,a.yJ)(c.Vs.setEnvVars(l));let s={...n,bundle:{code:""}},r=(0,u.ZS)(n.templateId),o=null!==(i=null==r?void 0:r.buildType)&&void 0!==i?i:n.BuildType;if("bundle"===o){let{code:e,err:t}=yield(0,a.T1)(E.m,{experiment:s,envVars:l});s={...n,bundle:{code:e,err:t}}}n.templateId===g.TW.note?(yield(0,a.yJ)((0,V.MT)(!1)),yield(0,a.yJ)((0,V.rW)(!1)),yield(0,a.yJ)((0,V.zO)(!1))):"compile"===o?(yield(0,a.yJ)((0,V.MT)(!1)),yield(0,a.yJ)((0,V.rW)(!0)),yield(0,a.yJ)((0,V.zO)(!1)),yield(0,a.yJ)((0,V.LX)(!1)),yield(0,a.yJ)((0,w.Cm)())):(yield(0,a.yJ)((0,V.MT)(!1)),yield(0,a.yJ)((0,V.rW)(!0)),yield(0,a.yJ)((0,V.zO)(!0)),yield(0,a.yJ)((0,V.LX)(!0)),yield(0,a.yJ)((0,w.Zq)())),yield(0,a.yJ)(c.
1Vs.selectExperimentSucceeded(s)),yield(0,a.yJ)(c.Vs.setSavedFiles(s.files))}catch(i){let e={id:(0,u.MZ)(),message:"Unable to select user experiment with id: ".concat(t),notificationType:g.VL.error,displayLocation:g.hZ.banner,removeNotification:!0,dissmissable:!0,showIcon:!0};yield(0,a.T1)(O.b,i,"selectExperiment",e)}}function*ea(){try{var e,t;let i=yield(0,a.Lt)(p.Lg),n=yield(0,a.Lt)(p.EX),l=null!==(t=null===(e=(0,u.ZS)(i.templateId))||void 0===e?void 0:e.buildType)&&void 0!==t?t:i.BuildType;if("none"===l||"compile"===l){yield(0,a.yJ)(c.Vs.bundleCodeSucceeded(i));return}let{code:s,err:r}=yield(0,a.T1)(E.m,{experiment:i,envVars:n}),o={...i,bundle:{code:s,err:r}};yield(0,a.yJ)(c.Vs.bundleCodeSucceeded(o))}catch(t){yield(0,a.yJ)(c.Vs.bundleCodeFailed());let e={id:(0,u.MZ)(),message:"error bundling code.",notificationType:g.VL.error,displayLocation:g.hZ.banner,removeNotification:!0,dissmissable:!0,showIcon:!0};yield(0,a.T1)(O.b,t,"bundleCode",e)}}function*ed(e){let{payload:{fileId:t,selectedFileNewContent:i,newHeadContent:n,newBodyContent:l}}=e;try{let e,s;let r=yield(0,a.Lt)(p.Lg);if(!r){console.warn("No current experiment found");return}if(void 0!==t){let i=r.files.find(e=>e.id===t);if(!i)return;e=i}else e=yield(0,a.Lt)(p.um);s=e.name===Z.yu.html?{...e,htmlHeadContent:null==n?void 0:n.trim(),htmlBodyContent:null==l?void 0:l.trim()}:{...e,content:i}
1,yield(0,a.yJ)(c.Vs.updateSelectedFileSucceeded(s))}catch(t){let e={id:(0,u.MZ)(),message:"Unable to update selected file.",notificationType:g.VL.error,displayLocation:g.hZ.banner,removeNotification:!0,dissmissable:!0,showIcon:!0};yield(0,a.T1)(O.b,t,"updateSelectedFile",e)}}function*ec(e){let{payload:{nodeId:t}}=e;try{let e=yield(0,a.Lt)(p.Lg),i=(0,I.OK)({nodes:e.files,nodeId:t,newPropsValues:{isSelected:!0},noMatchProps:{isSelected:!1}}),n={...e,files:[...i]};yield(0,a.yJ)(c.Vs.setNodeSelectedSucceeded(n))}catch(i){let e={id:(0,u.MZ)(),message:"Unable to set node with id: ".concat(t," as selected."),notificationType:g.VL.error,displayLocation:g.hZ.banner,removeNotification:!0,dissmissable:!0,showIcon:!0};yield(0,a.T1)(O.b,i,"setNodeSelected",e)}}function*eu(e){let{payload:{nodeId:t}}=e;try{let e=yield(0,a.Lt)(p.Lg),i=(0,I.OK)({nodes:e.files,nodeId:t,newPropsValues:{isSelected:!0,isOpen:!0},noMatchProps:{isSelected:!1}}),n={...e,files:[...i]};yield(0,a.yJ)(c.Vs.setNodeSelectedAndOpenSucceeded(n))}catch(i){let e={id:(0,u.MZ)(),message:"Unable to set node with i
1d: ".concat(t," as selected and open."),notificationType:g.VL.error,displayLocation:g.hZ.banner,removeNotification:!0,dissmissable:!0,showIcon:!0};yield(0,a.T1)(O.b,i,"setNodeSelectedAndOpen",e)}}function*em(e){let{payload:{nodeId:t}}=e;try{let e=yield(0,a.Lt)(p.Lg),i=(0,I.OK)({nodes:e.files,nodeId:t,newPropsValues:{isOpen:!1,isSelected:!1}}),n=yield(0,a.Lt)(p.hZ);if(n.length>1){let e;let l=n.findIndex(e=>e.id===t);e=0===l?n[l+1].id:n[l-1].id,i=(0,I.OK)({nodes:i,nodeId:e,newPropsValues:{isSelected:!0},noMatchProps:{isSelected:!1}})}yield(0,a.yJ)(c.Vs.setFileNodeClosedSucceeded(i))}catch(i){let e={id:(0,u.MZ)(),message:"Unable to set file node with id: ".concat(t," closed."),notificationType:g.VL.error,displayLocation:g.hZ.banner,removeNotification:!0,dissmissable:!0,showIcon:!0};yield(0,a.T1)(O.b,i,"setFileNodeClosed",e)}}function*ep(e){let{payload:{nodeId:t}}=e;try{let e=yield(0,a.Lt)(p.Lg),i=e.files.findIndex(e=>e.id===t);-1!==i&&(yield(0,a.yJ)(c.Vs.toggleExpandFolderNodeSucceeded({nodeId:t,fileIndex:i,isExpanded:!e.files[i].isExpanded})))}catch(i){let e={id:(0,u.MZ)(),message:"Unable to toggle expand folder with id: ".concat(t),notificationType:g.VL.error,displayLocation:g.hZ.banner,removeNotification:!0,dissmissable:!0,showIcon:!0};yield(0,a.T1)(O.b,i,"toggleExpandFolderNode",e)}}function*ey(e){let{payload:{nodeId:t}}=e;try{var i;let e=yield(0,a.Lt)(p.Lg),n=null===(i=e.files.find(e=>e.id===t))||void 0===i?void 0:i.isEditing,l=(0,I.OK)({nodes:e.files,nodeId:t,newPropsValues:{isEditing:!n}});
1yield(0,a.yJ)(c.Vs.toggleIsEditingNodeSucceeded(l))}catch(i){let e={id:(0,u.MZ)(),message:"Unable to toggle edit node with id: ".concat(t),notificationType:g.VL.error,displayLocation:g.hZ.banner,removeNotification:!0,dissmissable:!0,showIcon:!0};yield(0,a.T1)(O.b,i,"toggleIsEditingNode",e)}}function*ef(e){let{payload:{result:t}}=e;try{let{destination:e,source:i,draggableId:n}=t,l=yield(0,a.Lt)(p.iH),s=yield(0,a.Lt)(p.hZ),r=yield(0,a.Lt)(p.LE);if(!e||e.droppableId===i.droppableId&&e.index===i.index)return;if(i.droppableId===Z.qJ.fileTabsContainer&&e.droppableId===Z.qJ.fileTabsContainer){let t=s.map((e,t)=>({...e,openSortPosition:t})),r=t.find(e=>e.path===n);t.splice(i.index,1),t.splice(e.index,0,r),t=t.map((e,t)=>({...e,openSortPosition:t}));let o=l.map(e=>t.find(t=>t.id===e.id)||e).sort((e,t)=>e.id>t.id?1:-1);yield(0,a.yJ)(c.Vs.reorderNodesSucceeded(o))}if(i.droppableId===Z.qJ.fileTreeContainer&&e.droppableId===Z.qJ.fileTabsContainer){let t=n.includes("parent")?n.substring(n.indexOf(".")+1):n,o=null==l?void 0:l.find(e=>e.path===t);if(n.includes("parent")&&(null==o?void 0:o.isOpen)||(null==o?void 0:o.type)!==g.iv.file)return;let d=[...s],u=[...r];if(o.isOpen)d.splice(i.index,1);else{let e=n.includes("parent")?n.substring(n.indexOf(".")+1):n,t=u.findIndex(t=>t.path===e);u.splice(t,1)}let m={...o,isOpen:!0,isSelected:!0},p=d.map(e=>({...e,isSelected:!1}));p.splice(e.index,0,m);let y=[...p,...u];
1yield(0,a.yJ)(c.Vs.reorderNodesSucceeded(y))}}catch(t){let e={id:(0,u.MZ)(),message:"Unable to reorder nodes",notificationType:g.VL.error,displayLocation:g.hZ.banner,removeNotification:!0,dissmissable:!0,showIcon:!0};yield(0,a.T1)(O.b,t,"reorderNodes",e)}}function*eh(e){let{payload:{parentNodeId:t,nodeType:i}}=e;try{let e=yield(0,a.Lt)(p.Lg),{templateId:n}=e,l=yield(0,a.Lt)(p.$4,{parentNodeId:t}),s=(0,C.l)(e.files),{ext:r,mimeType:o}=(0,C.b6)(n),d=i===g.iv.new_file?"newFile.".concat(r):"newFolder",u={id:s,parentId:t,name:d,path:0===t?"@/".concat(d):"".concat(l.path,"/").concat(d),type:i===g.iv.new_file?g.iv.file:g.iv.folder,isRoot:0===t,isSelected:!0,isEditing:!0,userCanRename:!0,userCanUpdate:!0,userCanDelete:!0};i===g.iv.new_file&&(u.content="",u.mimeType=o,u.isMain=!1,u.isOpen=!0),i===g.iv.new_folder&&(u.children=[],u.isExpanded=!1);let m=e.files.map(e=>{if(e.id===t&&e.children){let t=[...e.children,{id:s}];return{...e,children:t}}return{...e,isSelected:!1}}),y={...e,files:[...m,u]};yield(0,a.yJ)(c.Vs.createFileOrFolderSucceeded(y))}catch(n){let e={id:(0,u.MZ)(),message:"Unable to create ".concat(i," in ").concat(t,"."),notificationType:g.VL.error,displayLocation:g.hZ.banner,removeNotification:!0,dissmissable:!0,showIcon:!0};yield(0,a.T1)(O.b,n,"createFileOrFolder",e)}}function*ex(e){let{payload:{parentNodeId:t,file:i,userId:n}}=e;try{let e=yield(0,a.Lt)(p.Lg);if(!e.id){if(!n){let e={id:(0,u.MZ)(),message:"Sign in to upload files.",notificationType:g.VL.error,displayLocation:g.hZ.banner,removeNotification:!0,dissmissable:!0,showIcon:!0};yield(0,a.yJ)(S.P9.setNotification({notification:e}));return}let t=(0,I.BR)({userId:n,name:e.name,description:e.description,experiment:e}),i=yield(0,a.T1)(J.A.Experiment.create,{experiment:t}),l=yield(0,a.T1)(I.k8,{data:i.data}),s={...l};if("bundle"===e.BuildType){let e=yield(0,a.Lt)(p.EX),{code:t,err:i}=yield(0,a.T1)(E.m,{experiment:l,envVars:e});s={...l,bundle:{code:t,err:i}}}
1yield(0,a.yJ)(c.Vs.createNewExperimentSucceeded(s)),yield(0,a.yJ)(c.Vs.setSavedFiles(s.files)),e=s}let l=yield(0,a.Lt)(p.$4,{parentNodeId:t}),s=yield(0,a.T1)(J.A.Experiment.uploadAsset,{experimentId:e.id,file:i}),r=(0,C.l)(e.files),o={id:r,parentId:t,name:i.name,path:0===t?"@/".concat(i.name):"".concat(l.path,"/").concat(i.name),type:g.iv.asset,isRoot:0===t,isSelected:!0,isEditing:!1,userCanRename:!0,userCanUpdate:!1,userCanDelete:!0,isOpen:!0,assetUrl:s.data.url,assetContentType:s.data.contentType,assetSizeBytes:s.data.sizeBytes},d=e.files.map(e=>e.id===t&&e.children?{...e,children:[...e.children,{id:r}]}:{...e,isSelected:!1}),m={...e,files:[...d,o]};yield(0,a.yJ)(c.Vs.createFileOrFolderSucceeded(m))}catch(t){let e={id:(0,u.MZ)(),message:"Unable to upload ".concat(i.name,"."),notificationType:g.VL.error,displayLocation:g.hZ.banner,removeNotification:!0,dissmissable:!0,showIcon:!0};yield(0,a.T1)(O.b,t,"uploadAsset",e)}finally{yield(0,a.yJ)(c.Vs.uploadAssetSettled({parentNodeId:t}))}}function*eb(e){let{payload:{nodeId:t,newName:i}}=e;try{let e=yield(0,a.Lt)(p.Lg),n=yield(0,a.Lt)(p.dV,{nodeId:t}),l=n.path.replace(n.path.substring(n.path.lastIndexOf("/")+1),i),s=i.split(".").pop()||"",r=(0,I.OK)({nodes:e.files,nodeId:t,newPropsValues:{name:i,mimeType:s,path:l}});
1yield(0,a.yJ)(c.Vs.renameFileOrFolderSucceeded(r))}catch(i){let e={id:(0,u.MZ)(),message:"Unable to rename node with id: ".concat(t,"."),notificationType:g.VL.error,displayLocation:g.hZ.banner,removeNotification:!0,dissmissable:!0,showIcon:!0};yield(0,a.T1)(O.b,i,"renameFileOrFolder",e)}}function*ev(e){let{payload:{nodeId:t,newParentId:i}}=e;try{let e=(yield(0,a.Lt)(p.Lg)).files,n=e.find(e=>e.id===t);if(!n||!1===n.userCanMove||n.parentId===i)return;let l=n.type===g.iv.folder||n.type===g.iv.new_folder;if(l&&0!==i){let n=i;for(;0!==n;){if(n===t)return;let i=e.find(e=>e.id===n);if(!i)break;n=i.parentId}}let s=0!==i?e.find(e=>e.id===i):null,r=s?s.path:"@",o="".concat(r,"/").concat(n.name),d=n.path,u=n.parentId,m=e.map(e=>{if(0!==u&&e.id===u&&e.children)return{...e,children:e.children.filter(e=>e.id!==t)};if(0!==i&&e.id===i){var n;return{...e,children:[...null!==(n=e.children)&&void 0!==n?n:[],{id:t}]}}return e.id===t?{...e,parentId:i,path:o,isRoot:0===i}:l&&e.path.startsWith(d+"/")?{...e,path:o+e.path.slice(d.length)}:e});
1yield(0,a.yJ)(c.Vs.moveNodeSucceeded(m))}catch(t){let e={id:(0,u.MZ)(),message:"Unable to move file.",notificationType:g.VL.error,displayLocation:g.hZ.banner,removeNotification:!0,dissmissable:!0,showIcon:!0};yield(0,a.T1)(O.b,t,"moveNode",e)}}function*eg(e){let{payload:{nodeId:t,parentNodeId:i}}=e;try{let e=(yield(0,a.Lt)(p.Lg)).files.map(e=>{if(e.id===i){var n;let i=null===(n=e.children)||void 0===n?void 0:n.filter(e=>e.id!==t);return{...e,children:i}}return e}).filter(e=>e.id!==t);yield(0,a.yJ)(c.Vs.deleteFileOrFolderSucceeded(e))}catch(i){let e={id:(0,u.MZ)(),message:"Unable to delete node with id: ".concat(t,"."),notificationType:g.VL.error,displayLocation:g.hZ.banner,removeNotification:!0,dissmissable:!0,showIcon:!0};yield(0,a.T1)(O.b,i,"deleteFileOrFolder",e)}}function*ew(e){let{payload:{experimentId:t,name:i}}=e;try{yield(0,a.T1)(J.A.Experiment.partialUpdate,{experimentId:t,body:{name:i}}),yield(0,a.yJ)(c.Vs.renameExperimentSucceeded({experimentId:t,name:i}))}catch(t){let e={id:(0,u.MZ)(),message:"Unable to rename experiment.",notificationType:g.VL.error,displayLocation:g.hZ.banner,removeNotification:!0,dissmissable:!0,showIcon:!0};yield(0,a.T1)(O.b,t,"renameExperiment",e,c.Vs.renameExperimentFailed)}}function eA(e){return(0,L.Od)(t=>{let i=new WebSocket(e);return i.onmessage=e=>{try{t(JSON.parse(e.data))}catch(e){}},i.onerror=()=>t(L.Kp),i.onclose=()=>t(L.Kp),()=>{i.close()}})}function*ej(){var e,t,i,n,l,s,r,o;let d=[];try{let o=yield(0,a.Lt)(p.Lg),u={};for(let e of o.files)e.type===g.iv.file&&void 0!==e.content&&(u[e.name]=e.content);let m=null!==(e=Z.yu[o.templateId])&&void 0!==e?e:"main",y={python:"python3 ".concat(m),go:"go run ".concat(m),rust:"rustc ".concat(m," && ./program"),csharp:"dotnet script ".concat(m),java:"java ".concat(m.replace(".java","")),kotlin:"kotlinc ".concat(m," && java -jar program.jar"),ruby:"ruby ".concat(m),nodejs:"node ".concat(m),bun:"bun run ".concat(m),c:"gcc ".concat(m," -o program && ./program"),cpp:"g++ ".concat(m," -o program && ./program"),php:"php ".concat(m),perl:"perl ".concat(m),lua:"lua ".concat(m),r:"Rscript ".concat(m),swift:"swift ".concat(m),scala:"scala ".concat(m),haskell:"runhaskell ".concat(m),elixir:"elixir ".concat(m),clojure:"clojure -M ".concat(m),bash:"bash ".concat(m),nim:"nim r --hints:off ".concat(m),fsharp:"dotnet fsi ".concat(m),julia:"julia ".concat(m),dart:"dart run ".concat(m),crystal:"crystal run ".concat(m),groovy:"groovy ".concat(m),d:"rdmd ".concat(m),ocaml:"ocaml ".concat(m),zig:"zig run ".concat(m)},f=null!==(t=y[o.templateId])&&void 0!==t?t:m,h=null!==(i=({nodejs:"javascript",bun:"typescript"})[o.templateId])&&void 0!==i?i:o.templateId;yield(0,a.yJ)((0,V.zO)(!1)),yield(0,a.yJ)((0,k.rR)()),yield(0,a.yJ)((0,k.pm)({level:"prompt",source:"system",message:f}));let x=(n="https://runner.cdbx.ai",void 0!==n)?n:"http://localhost:8080",b=yield(0,a.T1)([J.A.Runner,J.A.Runner.runAsync],{language:h,files:u,entrypoint:m}),v=x.replace(/^http/,"ws"),w="".concat(v).concat(b.wsUrl),A=yield(0,a.T1)(eA,w);try{for(;;){let e=yield(0,a.s)(A);switch(e.type){case"status":"running"===e.status&&(yield(0,a.yJ)((0,k.pm)({level:"info",source:"system",message:"Running..."})));break;case"stdout":yield(0,a.yJ)((0,k.pm)({level:"console",source:"console",message:null!==(l=e.line)&&void 0!==l?l:""}));break;case"stderr":{let t=null!==(s=e.line)&&void 0!==s?s:"";d.push(t),yield(0,a.yJ)((0,k.pm)({level:"error",source:"system",message:t}));break}case"done":{let t=null!==(r=e.exitCode)&&void 0!==r?r:0;if(0===t)yield(0,a.yJ)((0,k.pm)({level:"success",source:"system",message:"✓  Exited with code 0"}
1)),yield(0,a.yJ)(c.Vs.runCodeSucceeded());else{let i=e.error?"✗  ".concat(e.error):"✗  Exited with code ".concat(t);yield(0,a.yJ)((0,k.pm)({level:"error",source:"system",message:i}));let n=(0,D.T)("",d.join("\n"),h);n.length>0&&(yield(0,a.yJ)(c.Vs.setDiagnostics({[m]:n}))),yield(0,a.yJ)(c.Vs.runCodeFailed())}}}}}finally{A.close()}}catch(e){yield(0,a.yJ)(c.Vs.runCodeFailed()),yield(0,a.yJ)((0,k.pm)({level:"error",source:"system",message:"✗  ".concat(null!==(o=null==e?void 0:e.message)&&void 0!==o?o:"Failed to run code")}))}}function*eN(e){let{payload:t}=e,i=null==t?void 0:t.path;if("@/package.json"===i||"package.json"===i)return;let n=yield(0,a.Lt)(p.Lg);if(!n||"bundle"!==n.BuildType)return;let l=function(e){let t={};for(let n of e){var i;if(!n.content||"package.json"===n.name||"AGENTS.md"===n.name||"AI.md"===n.name)continue;let e=null===(i=n.name.split(".").pop())||void 0===i?void 0:i.toLowerCase();if(e&&z.has(e))for(let e of U){let i;for(e.lastIndex=0;null!==(i=e.exec(n.content));){let e=function(e){let t,i;if(e.startsWith("./")||e.startsWith("../")||e.startsWith("@/")||e.startsWith("/"))return null;let n=e.startsWith("@"),l=e.indexOf("@",n?1:0);if(l>0){t=e.slice(0,l);let n=e.slice(l+1),s=n.indexOf("/");i=s>0?n.slice(0,s):n}else{if(n){let i=e.split("/");t=i.length>=2?"".concat(i[0],"/").concat(i[1]):e}else t=e.split("/")[0];i="latest"}return!t||F.has(t)?null:{name:t,version:i}}(i[1]);e&&(t[e.name]&&"latest"!==t[e.name]||(t[e.name]=e.version))}}}return t}(n.files),s=function(e,t){let i=e.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/^-+|-+$/g,"")||"cdbx-experiment",n={};return Object.keys(t).sort().forEach(e=>{n[e]=t[e]}),JSON.stringify({name:i,description:"A cdbx experiment",private:!0,version:"0.0.0",dependencies:n},null,2)}(n.name,l),r=n.files.find(e=>"@/package.json"===e.path);
1(null==r?void 0:r.content)!==s&&(yield(0,a.yJ)(c.Vs.setFileContentByPath({path:"@/package.json",content:s})))}let eM=e=>e.type===c.Vs.setFileContentByPath.type||e.type===c.Vs.updateSelectedFileSucceeded.type;function*eT(){let e=yield(0,a.Lt)(p.Lg);if(null==e?void 0:e.id)try{let t=e.files.filter(e=>e.type===g.iv.file).map(e=>({path:e.path,name:e.name,content:e.content||"",type:e.type}));yield(0,a.T1)(J.A.Experiment.createSnapshot,{experimentId:e.id,files:t}),yield(0,a.yJ)(c.Vs.snapshotCreated())}catch(e){}}var eL=i(55415);function*eS(e){let{payload:{isOnline:t}}=e;try{if(t){let e=yield(0,a.Lt)(P.z);e&&(yield(0,a.yJ)(S.P9.removeNotification({notificationId:e}))),yield(0,a.yJ)(eL.oL.setIsOnlineSuccessful({isOnline:t,offlineNotificationId:void 0}))}else{let e=(0,u.MZ)(),i={id:e,message:"currently working offline.",notificationType:g.VL.warn,displayLocation:g.hZ.banner,removeNotification:!1,dissmissable:!0,showIcon:!0};yield(0,a.yJ)(S.P9.setNotification({notification:i})),yield(0,a.yJ)(eL.oL.setIsOnlineSuccessful({isOnline:t,offlineNotificationId:e}))}}catch(t){let e={id:(0,u.MZ)(),message:"error updating network status.",notificationType:g.VL.error,displayLocation:g.hZ.banner,removeNotification:!0,dissmissable:!0,showIcon:!0};yield(0,a.T1)(u.bM,t,"updateNetworkStatus",e)}}var eV=i(1060);function*eE(e){let{payload:{notification:t}}=e;try{let{id:e}=t,{shouldAutoRemove:i,effectiveDuration:n}=(0,eV.K)(t),{remove:l,cancel:s}=yield(0,a.O4)({remove:(0,a.cb)(n),cancel:(0,a.s)(S.P9.cancelRemoveNotification)});l&&i?yield(0,a.yJ)(S.P9.removeNotification({notificationId:e})):yield(0,a.yJ)(S.P9.cancelRemoveNotification({notificationId:e}))}catch(e){(0,O.b)(e,"manageNotification")}}let eP=function*(){yield(0,a.Q7)([function*(){yield(0,a.jP)(d.Kc.createChat,h)}(),function*(){yield(0,a.jP)(d.Kc.acceptPendingEdit,b)}(),function*(){yield(0,a.jP)(d.Kc.acceptAllPendingEdits,v)}(),function*(){yield(0,a.jP)(w.T6.setSidePanelSelected,j)}(),function*(){yield(0,a.jP)(w.T6.setTabSelected,N)}(),function*(){yield(0,a.jP)(w.T6.setTabSelectedAndOpen,M)}(),function*(){yield(0,a.jP)(w.T6.setTabClosed,T)}(),function*(){yield(0,a.jP)(c.Vs.selectTemplate,er)}(),function*(){yield(0,a.jP)(c.Vs.selectExperiment,eo)}(),function*(){yield(0,a.jP)(c.Vs.loadExperiment,W)}(),function*(){yield(0,a.jP)(c.Vs.toggleExperimentArchive,H)}(),function*(){yield(0,a.jP)(c.Vs.toggleExperimentAccess,Y)}(),function*(){yield(0,a.jP)(c.Vs.renameExperiment,ew)}(),function*(){yield(0,a.jP)(c.Vs.forkExperiment,Q)}(),function*(){yield(0,a.jP)(c.Vs.starExperiment,$)}(),function*(){yield(0,a.IJ)(c.Vs.createNewExperiment,R)}(),function*(){yield(0,a.jP)(c.Vs.updateExperiment,_)}(),function*(){yield(0,a.jP)(c.Vs.partialUpdateExperiment,X)}(),function*(){yield(0,a.jP)(c.Vs.deleteExperiment,K)}(),function*(){yield(0,a.jP)(c.Vs.bundleCode,ea)}(),function*(){yield(0,a.jP)(c.Vs.updateSelectedFile,ed)}(),function*(){yield(0,a.jP)(c.Vs.setNodeSelected,ec)}(),function*(){yield(0,a.jP)(c.Vs.setNodeSelectedAndOpen,eu)}(),function*(){yield(0,a.jP)(c.Vs.setFileNodeClosed,em)}(),function*(){yield(0,a.jP)(c.Vs.toggleExpandFolderNode,ep)}(),function*(){yield(0,a.jP)(c.Vs.toggleIsEditingNode,ey)}(),function*(){yield(0,a.jP)(c.Vs.reorderNodes,ef)}(),function*(){yield(0,a.jP)(c.Vs.moveNode,ev)}(),function*(){yield(0,a.jP)(c.Vs.createFileOrFolder,eh)}(),function*(){yield(0,a.jP)(c.Vs.uploadAsset,ex)}(),function*(){yield(0,a.jP)(c.Vs.renameFileOrFolder,eb)}(),function*(){yield(0,a.jP)(c.Vs.deleteFileOrFolder,eg)}(),function*(){yield(0,a.jP)(c.Vs.runCode,ej)}(),function*(){yield(0,a.sg)(500,eM,eN)}(),function*(){yield(0,a.jP)(c.Vs.createAutoSnapshot,eT)}(),function*(){yield(0,a.jP)(eL.oL.setIsOnline,eS)}(),function*(){yield(0,a.jP)(S.P9.setNotification,eE)}(),function*(){yield(0,a.jP)(c.Vs.fetchUserExperiments,B)}()])};var eI=i(76825);let eC={templates:(0,u.yv)()},eJ=(0,r.Z0)({name:Z.I6.template,initialState:eC,reducers:{}});eJ.actions;let{}=eJ.actions,ek=eJ.reducer;var eD=i(40563);let eO=(0,r.Z0)({name:Z.I6.user,initialState:{},reducers:{}});eO.actions;let{}=eO.actions,eZ=eO.reducer,{aiChat:ez,editor:eF,experiment:eU,layout:eR,log:eB,network:eW,notification:e_,previewViewer:eG,template:eq,theme:eX,user:eK}=Z.I6,eH=(0,o.Ay)(),eY=()=>{let e=(0,r.U1)({reducer:{[ez]:d.Ay,[eF]:w.Ay,[eU]:c.Ay,[eR]:V.Ay,[eB]:k.Ay,[eW]:eL.Ay,[e_]:S.Ay,[eG]:eI.Ay,[eq]:ek,[eX]:eD.Ay,[eK]:eZ},middleware:[eH],devTools:!0});return eH.run(eP),e};function eQ(e){let{children:t}=e,i=(0,l.useRef)();return i.current||(i.current=eY()),(0,n.jsx)(s.Kq,{store:i.current,children:t})}},4271:(e,t,i)=>{"use strict";i.d(t,{S:()=>s,z:()=>r});var n=i(95811);let l=e=>e[n.I6.network],s=e=>l(e).isOnline,r=e=>l(e).offlineNotificationId},55415:(e,t,i)=>{"use strict";i.d(t,{Ay:()=>c,If:()=>a,S8:()=>s.S,oL:()=>o});var n=i(98785),l=i(95811),s=i(4271);let r=(0,n.Z0)({name:l.I6.network,initialState:{isOnline:!0,offlineNotificationId:void 0},reducers:{setIsOnline:(e,t)=>{let{payload:{isOnline:i}}=t},setIsOnlineSuccessful:(e,t)=>
1{let{payload:{isOnline:i,offlineNotificationId:n}}=t;e.isOnline=i,e.offlineNotificationId=n||void 0}}}),o=r.actions,{setIsOnline:a,setIsOnlineSuccessful:d}=r.actions,c=r.reducer},76825:(e,t,i)=>{"use strict";i.d(t,{wY:()=>c,Ay:()=>m,z$:()=>r,fo:()=>o,Rg:()=>d,Rt:()=>u});var n=i(98785),l=i(95811);let s=e=>e[l.I6.previewViewer],r=e=>s(e).resource,o=e=>s(e).viewAsAnonymous,a=(0,n.Z0)({name:l.I6.previewViewer,initialState:{resource:null,viewAsAnonymous:!1},reducers:{setPreviewResource:(e,t)=>{let{payload:i}=t;e.resource=i},clearPreviewResource:e=>{e.resource=null,e.viewAsAnonymous=!1},setViewAsAnonymous:(e,t)=>{let{payload:i}=t;e.viewAsAnonymous=i}}});a.actions;let{setPreviewResource:d,clearPreviewResource:c,setViewAsAnonymous:u}=a.actions,m=a.reducer},1060:(e,t,i)=>{"use strict";i.d(t,{K:()=>r});var n=i(44333),l=i(95811);let s={[n.VL.success]:4e3,[n.VL.info]:5e3,[n.VL.warn]:7e3,[n.VL.error]:8e3,[n.VL.default]:5e3};function r(e){var t;let{notificationType:i,removeNotification:r,displayDuration:o}=e;return{shouldAutoRemove:i!==n.VL.error&&r,effectiveDuration:null!==(t=null!=o?o:s[i])&&void 0!==t?t:l.Nq}}},14430:(e,t,i)=>{"use strict";function n(e,t,i){let n=[t,e].filter(Boolean).join("\n");switch(i){case"python":return function(e){let t=[],i=e.split("\n");for(let e=0;e<i.length;e++){let n=i[e].match(/File "([^"]+)", line (\d+)/);if(!n)continue;let l=parseInt(n[2],10),s="Syntax error";for(let t=e+1;t<Math.min(e+5,i.length);t++){let e=i[t].match(/^(\w+Error):\s*(.+)/);if(e){s="".concat(e[1],": ").concat(e[2]);break}}t.push({startLineNumber:l,startColumn:1,endLineNumber:l,endColumn:1e3,message:s,severity:"error"})}return t}(n);case"go":return function(e){let t;let i=[],n=/(?:\.\/)?[\w./\-]+\.go:(\d+):(\d+):\s*(.+)/g;for(;null!==(t=n.exec(e));)i.push({startLineNumber:parseInt(t[1],10),startColumn:parseInt(t[2],10),endLineNumber:parseInt(t[1],10),endColumn:1e3,message:t[3].trim(),severity:"error"});return i}(n);case"rust":return function(e){let t=[];for(let n of e.split("\n"))if(n.trim().startsWith("{"))try{var i;let e=JSON.parse(n);if("error"!==e.level&&"warning"!==e.level)continue;let l=null===(i=e.spans)||void 0===i?void 0:i.find(e=>e.is_primary);if(!l)continue;t.push({startLineNumber:l.line_start,startColumn:l.column_start,endLineNumber:l.line_end,endColumn:l.column_end,message:e.message,severity:"error"===e.level?"error":"warning"})}catch(e){}return t}(t);case"javascript":case"nodejs":return function(e){let t;let i=[],n=/[\w./\-]+\.(?:js|mjs|cjs):(\d+)\n/g;for(;null!==(t=n.exec(e));){let n=parseInt(t[1],10),l=e.slice(t.index+t[0].length).match(/^(\w+Error):\s*(.+)/m),s=l?"".concat(l[1],": ").concat(l[2]):"Syntax error";i.push({startLineNumber:n,startColumn:1,endLineNumber:n,endColumn:1e3,message:s,severity:"error"})}return i}(n);case"ruby":return function(e){let t;let i=[],n=/[\w./\-]+\.rb:(\d+):\s*(.+)/g;for(;null!==(t=n.exec(e));)t[2].includes("Syntax OK")||i.push({startLineNumber:parseInt(t[1],10),startColumn:1,endLineNumber:parseInt(t[1],10),endColumn:1e3,message:t[2].trim(),severity:"error"});return i}(n);case"php":return function(e){let t;let i=[],n=/(?:Parse|Fatal) error:\s*(.+?) in .+ on line (\d+)/g;for(;null!==(t=n.exec(e));){let e=parseInt(t[2],10);i.push({startLineNumber:e,startColumn:1,endLineNumber:e,endColumn:1e3,message:t[1].trim(),severity:"error"})}return i}(n);case"perl":return function(e){let t;let i=[],n=/(.+?) at [\w./\-]+ line (\d+)/g;for(;null!==(t=n.exec(e));)i.push({startLineNumber:parseInt(t[2],10),startColumn:1,endLineNumber:parseInt(t[2],10),endColumn:1e3,message:t[1].trim(),severity:"error"});return i}(n);case"bash":return function(e){let t;let i=[],n=/[\w./\-]+:(?:\s*line\s*)?(\d+):\s*(.+)/g;for(;null!==(t=n.exec(e));)i.push({startLineNumber:parseInt(t[1],10),startColumn:1,endLineNumber:parseInt(t[1],10),endColumn:1e3,message:t[2].trim(),severity:"error"});return i}(n);case"c":case"cpp":return function(e){let t;let i=[],n=/[\w./\-]+\.[ch]p*:(\d+):(\d+):\s*(error|warning):\s*(.+)/g;for(;null!==(t=n.exec(e));)i.push({startLineNumber:parseInt(t[1],10),startColumn:parseInt(t[2],10),endLineNumber:parseInt(t[1],10),endColumn:1e3,message:t[4].trim(),severity:"error"===t[3]?"error":"warning"});return i}(n);case"java":return function(e){let t;
1let i=[],n=/[\w./\-]+\.java:(\d+):\s*(?:error|warning):\s*(.+)/g;for(;null!==(t=n.exec(e));)i.push({startLineNumber:parseInt(t[1],10),startColumn:1,endLineNumber:parseInt(t[1],10),endColumn:1e3,message:t[2].trim(),severity:"error"});return i}(n);default:return[]}}i.d(t,{T:()=>n})},50407:()=>{},90620:(e,t,i)=>{"use strict";i.r(t),i.d(t,{default:()=>n});let n={src:"/_next/static/media/dark-box.b060a4a2.png",height:1024,width:1024,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAMAAADz0U65AAAAFVBMVEX7+/v19fX09PTz9PT19fXz8/P09PSO6WTRAAAAB3RSTlMBEkFQaS44d5B9OgAAAAlwSFlzAAALEwAACxMBAJqcGAAAAC9JREFUeJwti7kNADAMhLgn3n/kKFZoaABAYjkz5zmFBuS0sdCQMALLljduN/77BRAIAG3De1YuAAAAAElFTkSuQmCC",blurWidth:8,blurHeight:8}},92652:(e,t,i)=>{"use strict";i.r(t),i.d(t,{default:()=>n});let n={src:"/_next/static/media/light-box.41e726a2.png",height:1024,width:1024,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAMAAADz0U65AAAAFVBMVEUSEhccHSAdHx8cHR8dHiAdHSAdHiDI74LgAAAAB3RSTlMBPhRQaS5bI7bILgAAAAlwSFlzAAALEwAACxMBAJqcGAAAAcV0RVh0UmF3AApleGlmCiAgICAgMjE0CjQ1Nzg2OTY2MDAwMDQ5NDkyYTAwMDgwMDAwMDAwYTAwMDAwMTA0MDAwMTAwMDAwMDAwMDQwMDAwMDEwMTA0MDAwMTAwMDAwMAowMDA0MDAwMDAyMDEwMzAwMDMwMDAwMDA4NjAwMDAwMDEyMDEwMzAwMDEwMDAwMDAwMTAwMDAwMDFhMDEwNTAwMDEwMDAwMDAKOGMwMDAwMDAxYjAxMDUwMDAxMDAwMDAwOTQwMDAwMDAyODAxMDMwMDAxMDAwMDAwMDIwMDAwMDAzMTAxMDIwMDBkMDAwMDAwCjljMDAwMDAwMzIwMTAyMDAxNDAwMDAwMGFhMDAwMDAwNjk4NzA0MDAwMTAwMDAwMGJlMDAwMDAwMDAwMDAwMDAwODAwMDgwMAowODAwNDgwMDAwMDAwMTAwMDAwMDQ4MDAwMDAwMDEwMDAwMDA0NzQ5NGQ1MDIwMzIyZTMxMzAyZTMzMzQwMDAwMzIzMDMyMzYKM2EzMDM0M2EzMDM3MjAzMjMyM2EzNDM1M2EzMTMyMDAwMTAwMDFhMDAzMDAwMTAwMDAwMDAxMDAwMDAwMDAwMDAwMDAK/JlPQAAAAC5JREFUeJwti7kRADAMg9Dj/VfO2Rc1UCAAm9tIs0yhAStttEKCDLJkXdxe/O8PDNwAW5X5bA0AAAAASUVORK5CYII=",blurWidth:8,blurHeight:8}}},e=>{var t=t=>e(e.s=t);e.O(0,[29730,10419,73414,10412,36859,32633,96546,72119,94839,32585,2252,54113,67145,4117,28655,41986,98785,9605,20208,69575,10098,27820,30143,54190,42523,64697,9302,15400,95811,25240,56331,32883,84029,56943,14987,62202,39411,77358],()=>t(40996)),_N_E=e.O()}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.