PageSourceSearch

https://portals.to/_next/static/chunks/5120-373b94b8fc26ec99.js

js portals.to collected 2026-10-10 02:24:22 UTC 38,919 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5120],{36763:(e,t,a)=>{a.d(t,{i:()=>o});var r=a(74848),s=a(20053),n=a(96540);let i=()=>(0,r.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsx)("rect",{x:"5.5",y:"5.5",width:"8",height:"8",rx:"1.5",stroke:"currentColor",strokeWidth:"1.4"}),(0,r.jsx)("path",{d:"M10.5 5.5V4A1.5 1.5 0 0 0 9 2.5H4A1.5 1.5 0 0 0 2.5 4v5A1.5 1.5 0 0 0 4 10.5h1.5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})]}),l=()=>(0,r.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":!0,xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsx)("path",{d:"M2.5 7.5L5.5 10.5L11.5 3.5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})});function o(e){let{value:t,label:a="copy",copiedLabel:o="copied",iconOnly:d=!1,ariaLabel:c="Copy to clipboard",className:p}=e,[x,m]=(0,n.useState)(!1),u=(0,n.useRef)(null);(0,n.useEffect)(()=>()=>{u.current&&clearTimeout(u.current)},[]);let h=(0,n.useCallback)(async()=>{try{if(navigator?.clipboard?.writeText)await navigator.clipboard.writeText(t);else{let e=document.createElement("textarea");e.value=t,e.setAttribute("readonly",""),e.style.position="absolute",e.style.left="-9999px",document.body.appendChild(e),e.select(),document.execCommand("copy"),document.body.removeChild(e)}m(!0),u.current&&clearTimeout(u.current),u.current=setTimeout(()=>m(!1),2e3)}catch{}},[t]);return(0,r.jsxs)("button",{type:"button","data-component":"CopyButton",onClick:h,"aria-label":d?c:void 0,className:(0,s.$)("inline-flex items-center gap-1.5 shrink-0 cursor-pointer","rounded-input border border-border-subtle bg-surface-primary","px-2.5 py-1.5 font-body text-p3-tight font-medium lowercase","transition-colors duration-200",x?"text-accent-primary border-accent-primary":"text-text-tertiary hover:text-text-primary hover:border-border-default",p),children:[x?(0,r.jsx)(l,{}):(0,r.jsx)(i,{}),!d&&(0,r.jsx)("span",{children:x?o:a})]})}},57614:(e,t,a)=>{a.d(t,{V4:()=>d,R1:()=>L});var r=a(74848),s=a(20053),n=a(96540),i=a(81225),l=a(77225),o=a(7568);function d(e){let{value:t,onChange:a,onSubmit:i,busy:l=!1,disabled:d=!1,rateLimited:c=!1,placeholder:p="describe what you want to build…",maxLength:x,submitLabel:m="send",ariaLabel:u="describe your build",prominent:h=!1,hidden:f=!1}=e,b=(0,n.useRef)(null);if((0,n.useEffect)(()=>{let e=b.current;e&&(e.style.height="auto",e.style.height=`${Math.min(e.scrollHeight,144)}px`)},[t]),f)return null;let g=!l&&!d&&!c&&t.trim().length>0;return(0,r.jsxs)("div",{"data-component":"CreateChat-ChatComposer",className:"flex flex-col gap-2",children:[(0,r.jsxs)("div",{className:(0,s.$)("relative flex gap-2",h?"flex-col items-stretch gap-4 rounded-[24px] border border-border-default bg-surface-elevated p-4 shadow-card max-[768px]:gap-3 max-[768px]:rounded-[20px] max-[768px]:p-3":"items-end rounded-[18px] border border-border-subtle bg-surface-elevated px-3 py-2.5 shadow-card-subtle max-[768px]:px-2.5 max-[768px]:py-2","transition-[border-color,box-shadow] duration-200 ease-in-out","focus-within:border-border-focus"),children:[(0,r.jsx)("textarea",{ref:b,value:t,onChange:e=>a(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||e.nativeEvent.isComposing||(e.preventDefault(),g&&i())},rows:1,maxLength:x,placeholder:p,disabled:d,"aria-label":u,className:(0,s.$)("flex-1 min-w-0 resize-none border-0 bg-transparent outline-none",h?"min-h-[128px] px-3 py-3 max-[768px]:min-h-[104px] max-[768px]:px-2":"px-3 py-2 max-[768px]:px-2","font-body text-p1 text-text-primary","placeholder:text-text-placeholder placeholder:font-medium","[scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden","disabled:cursor-not-allowed disabled:opacity-60")}),(0,r.jsx)(o.$n,{variant:g?"primary":"inactive",size:h?"md":"sm",onClick:()=>{g&&i()},disabled:!g,"aria-label":m,className:(0,s.$)("shrink-0",h?"w-full justify-center":"self-end mb-0.5"),children:l?"thinking…":d?"building…":m})]}),c&&(0,r.jsx)("p",{className:"font-body text-p3-tight font-medium text-feedback-error m-0 px-1 lowercase",children:"you've hit today's chat limit. it resets at midnight UTC — try again then, or upgrade your plan."})]})}var c=a(40572);function p(e){let{templates:t,onPick:a,busy:n=!1}=e;return t.length?(0,r.jsxs)("div",{"data-component":"CreateChat-AssistantTemplateCard",className:"flex flex-col gap-3",children:[(0,r.jsx)("div",{className:(0,s.$)("grid gap-3",1===t.length&&"grid-cols-1",2===t.length&&"grid-cols-2 max-[640px]:grid-cols-1",t.length>=3&&"grid-cols-3 max-[768px]:grid-cols-2 max-[480px]:grid-cols-1"),children:t.map(e=>(0,r.jsxs)("button",{type:"button",onClick:()=>{n||a(e)},disabled:n,className:(0,s.$)("group relative flex flex-col text-left p-0","bg-surface-elevated border border-border-subtle rounded-card shadow-card-subtle overflow-hidden","cursor-pointer transition-[border-color,box-shadow,transform] duration-200 ease-in-out","hover:border-border-focus hover:shadow-elevation-subtle","disabled:cursor-not-allowed disabled:opacity-60 disabled:hover:border-border-subtle"),children:[(0,r.jsx)("div",{className:"relative w-full aspect-video overflow-hidden bg-surface-sunken",children:(0,r.jsx)("img",{src:e.img,alt:e.name,className:"absolute inset-0 w-full h-full object-cover transition-transform duration-300 ease-out group-hover:scale-[1.03]"})}),(0,r.jsxs)("div",{className:"flex flex-col gap-1 p-3",children:[(0,r.jsx)("span",{className:"font-body text-p1-tight font-bold text-text-primary lowercase",children:e.name}),e.description&&(0,r.jsx)("span",{className:"font-body text-p2 font-medium text-text-secondary line-clamp-2",children:e.description})]})]},e.id))}),t.length>0&&(0,r.jsx)("div",{className:"flex items-center justify-end",children:(0,r.jsx)("span",{className:"font-body text-p3-tight font-medium text-text-tertiary lowercase",children:"click a template to start your space"})})]}):null}var x=a(8735),m=a(24501),u=a(97717);function h(e){let{rec:t,isSelected:a,isAdded:n,onClick:i,onOpenInShop:l}=e,o="paid"===t.pricing,d=!!t.alreadyOwned;return(0,r.jsxs)("button",{type:"button",onClick:()=>{n||(o&&!d?l():i())},disabled:n,className:(0,s.$)("relative flex flex-col gap-1 p-1 rounded-card text-left","bg-transparent border-2 transition-[border-color,background-color] duration-150 ease-in-out",n?"cursor-default":"cursor-pointer",n?"border-feedback-success/50":a?"border-accent-primary bg-accent-primary/5":"border-transparent hover:border-border-focus/50"),children:[(0,r.jsxs)("div",{className:"relative aspect-square w-full overflow-hidden rounded-[8px] bg-surface-sunken",children:[(0,r.jsx)(u.s,{item:{thumbnailSrc:t.thumbnailSrc,type:t.isPack?"pack":"3d",category:t.category,subcategory:t.subcategory},alt:t.title}),d?(0,r.jsx)("span",{className:"absolute top-1.5 left-1.5 px-1.5 py-0.5 rounded-full bg-accent-primary/85 text-[var(--ice-13)] font-body text-p3-tight font-bold lowercase",children:"created"===t.source?"yours":"in 
1inventory"}):o?(0,r.jsx)("span",{className:"absolute top-1.5 left-1.5 px-1.5 py-0.5 rounded-full bg-surface-primary/85 text-text-primary font-body text-p3-tight font-bold lowercase",children:t.price}):(0,r.jsx)("span",{className:"absolute top-1.5 left-1.5 px-1.5 py-0.5 rounded-full bg-feedback-success/85 text-[var(--ice-13)] font-body text-p3-tight font-bold lowercase",children:"free"}),(a||n)&&(0,r.jsx)("span",{className:(0,s.$)("absolute top-2 right-2 inline-flex items-center justify-center w-6 h-6 rounded-full",n?"bg-feedback-success":"bg-accent-primary","text-[var(--ice-13)]"),"aria-hidden":!0,children:(0,r.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:(0,r.jsx)("path",{d:"M2.5 7.5L5.5 10.5L11.5 3.5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),o&&!d&&!n&&(0,r.jsx)("span",{className:"absolute bottom-1.5 right-1.5 px-1.5 py-0.5 rounded-full bg-surface-primary/85 text-text-secondary font-body text-p3-tight font-medium lowercase",children:"view in shop →"})]}),(0,r.jsxs)("div",{className:"flex flex-col gap-0.5 px-1 pt-1",children:[(0,r.jsx)("span",{className:"font-body text-p2-tight font-bold text-text-primary line-clamp-1",children:t.title}),(0,r.jsxs)("span",{className:"flex min-w-0 items-center gap-1 font-body text-p3-tight font-medium text-text-tertiary lowercase",children:[(0,r.jsx)("span",{className:"line-clamp-1",children:t.isPack?`pack${t.itemCount?` \xb7 ${t.itemCount} items`:""}`:`by ${t.creator}`}),!t.isPack&&(0,r.jsx)(m.Y,{official:t.creatorOfficial,verified:t.creatorVerified,size:12})]})]})]})}function f(e){let{packs:t,items:a,onSubmit:s,onOpenInShop:l,claiming:d=!1,addedIds:c=[],isLatest:p=!1}=e,m=i.X("create:build-picker-selection",{ids:[]})?.ids??[],u=new Set(m),f=(0,n.useRef)(!1),[b,g]=(0,n.useState)(!1),y=e=>{if(b)return;let t=new Set(m);t.has(e)?t.delete(e):t.add(e),(0,x.Gt)("create:build-picker-selection",{ids:Array.from(t)})},v=m.filter(e=>!c.includes(e)),j=!d&&!b&&v.length>0,w=()=>{!f.current&&j&&(f.current=!0,g(!0),s(v),(0,x.Gt)("create:build-picker-selection",{ids:[]}))},k=(0,i.X)("create:build-picker-commit",0)??0,N=(0,n.useRef)(null);return((0,n.useEffect)(()=>{if(null===N.current){N.current=k;return}k!==N.current&&(N.current=k,p&&w())},[k,p]),0===t.length&&0===a.length)?null:(0,r.jsxs)("div",{"data-component":"CreateChat-BuildPicker",className:"flex flex-col gap-4",children:[t.length>0&&(0,r.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,r.jsx)("span",{className:"font-body text-p2-tight font-bold text-text-secondary lowercase",children:"packs"}),(0,r.jsx)("div",{className:"grid gap-3 grid-cols-2 sm:grid-cols-3 md:grid-cols-4",children:t.map(e=>(0,r.jsx)(h,{rec:e,isSelected:u.has(e.id),isAdded:c.includes(e.id),onClick:()=>y(e.id),onOpenInShop:()=>l(e.id)},e.id))})]}),a.length>0&&(0,r.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,r.jsx)("span",{className:"font-body text-p2-tight font-bold text-text-secondary lowercase",children:"items"}),(0,r.jsx)("div",{className:"grid gap-3 grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5",children:a.map(e=>(0,r.jsx)(h,{rec:e,isSelected:u.has(e.id),isAdded:c.includes(e.id),onClick:()=>y(e.id),onOpenInShop:()=>l(e.id)},e.id))})]}),p&&(0,r.jsxs)("div",{className:"flex items-center justify-between gap-3 pt-1 flex-wrap",children:[(0,r.jsx)("span",{className:"font-body text-p3-tight font-medium text-text-tertiary lowercase",children:b?"locked in — keep an eye on the next message":0===v.length?"tap items + packs to start your build":`${v.length} selected`}),(0,r.jsx)(o.$n,{variant:j?"primary":"inactive",size:"sm",disabled:!j,onClick:w,children:b||d?"building…":0===v.length?"build with these":1===v.length?"build with this":`build with these ${v.length}`})]})]})}function b(e){let{packs:t,onClaim:a,claimingIds:n=[],addedIds:i=[]}=e;return t.length?(0,r.jsxs)("div",{"data-component":"CreateChat-AssistantPackCarousel",className:"flex flex-col gap-2",children:[(0,r.jsx)("span",{className:"font-body text-p2-tight font-bold text-text-secondary lowercase",children:"packs to build with"}),(0,r.jsx)("div",{className:(0,s.$)("flex gap-3 overflow-x-auto pb-2 -mx-1 px-1","[scrollbar-width:thin] [&::-webkit-scrollbar]:h-1 [&::-webkit-scrollbar-thumb]:bg-border-subtle","min-[769px]:flex-wrap min-[769px]:overflow-visible"),children:t.map(e=>{let t=n.includes(e.id),l=i.includes(e.id);return(0,r.jsxs)("div",{className:(0,s.$)("flex flex-col shrink-0 w-[180px] min-[769px]:w-[200px]","bg-surface-elevated border border-border-subtle rounded-card shadow-card-subtle overflow-hidden"),children:[(0,r.jsxs)("div",{className:"relative w-full aspect-square bg-surface-sunken",children:[(0,r.jsx)("img",{src:e.thumbnailSrc,alt:e.title,className:"absolute inset-0 w-full h-full object-cover"}),(0,r.jsx)("span",{className:(0,s.$)("absolute top-2 left-2 px-2 py-0.5 rounded-full","font-body text-p3-tight font-bold lowercase",e.alreadyOwned?"bg-accent-primary/85 text-[var(--ice-13)]":"free"===e.pricing?"bg-feedback-success/15 text-feedback-success":"bg-surface-primary/90 text-text-primary"),children:e.alreadyOwned?"created"===e.source?"yours":"in 
1inventory":"free"===e.pricing?"free":e.price})]}),(0,r.jsxs)("div",{className:"flex flex-col gap-1 p-3 flex-1",children:[(0,r.jsx)("span",{className:"font-body text-p2-tight font-bold text-text-primary line-clamp-1",children:e.title}),(0,r.jsxs)("span",{className:"flex min-w-0 items-center gap-1 font-body text-p3-tight font-medium text-text-tertiary lowercase",children:[(0,r.jsxs)("span",{className:"line-clamp-1",children:["by ",e.creator,e.itemCount?` \xb7 ${e.itemCount} items`:""]}),(0,r.jsx)(m.Y,{official:e.creatorOfficial,verified:e.creatorVerified,size:12})]}),(0,r.jsx)("div",{className:"mt-2",children:(0,r.jsx)(o.$n,{variant:l?"success":t?"inactive":"primary",size:"xs",onClick:()=>{l||t||a(e.id,"paid"===e.pricing)},disabled:l||t,className:"w-full",children:l?"added to room":t?"adding…":"paid"===e.pricing?"view in shop":"add to room"})})]})]},e.id)})})]}):null}function g(e){let{items:t,onClaim:a,claiming:i=!1,addedIds:l=[]}=e,[d,c]=(0,n.useState)(()=>new Set);if(!t.length)return null;let p=e=>{c(t=>{let a=new Set(t);return a.has(e)?a.delete(e):a.add(e),a})},x=Array.from(d).filter(e=>!l.includes(e)),h=!i&&x.length>0;return(0,r.jsxs)("div",{"data-component":"CreateChat-AssistantItemPicker",className:"flex flex-col gap-3",children:[(0,r.jsx)("span",{className:"font-body text-p2-tight font-bold text-text-secondary lowercase",children:"items to build with — pick what you want"}),(0,r.jsx)("div",{className:"grid gap-3 grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5",children:t.map(e=>{let t=l.includes(e.id),a=d.has(e.id),n=!!e.alreadyOwned;return(0,r.jsxs)("button",{type:"button",onClick:()=>{t||p(e.id)},disabled:t,className:(0,s.$)("relative flex flex-col gap-1 p-1 rounded-card","bg-transparent border-2 transition-[border-color,background-color] duration-150 ease-in-out",t?"cursor-default":"cursor-pointer",t?"border-feedback-success/50":a?"border-accent-primary bg-accent-primary/5":"border-transparent hover:border-border-focus/50"),children:[(0,r.jsxs)("div",{className:"relative aspect-square w-full overflow-hidden rounded-[8px] bg-surface-sunken",children:[(0,r.jsx)(u.s,{item:{thumbnailSrc:e.thumbnailSrc,type:e.isPack?"pack":"3d",category:e.category,subcategory:e.subcategory},alt:e.title}),n?(0,r.jsx)("span",{className:"absolute top-1.5 left-1.5 px-1.5 py-0.5 rounded-full bg-accent-primary/85 text-[var(--ice-13)] font-body text-p3-tight font-bold lowercase",children:"created"===e.source?"yours":"in inventory"}):"free"===e.pricing?(0,r.jsx)("span",{className:"absolute top-1.5 left-1.5 px-1.5 py-0.5 rounded-full bg-feedback-success/85 text-[var(--ice-13)] font-body text-p3-tight font-bold lowercase",children:"free"}):(0,r.jsx)("span",{className:"absolute top-1.5 left-1.5 px-1.5 py-0.5 rounded-full bg-surface-primary/85 text-text-primary font-body text-p3-tight font-bold lowercase",children:e.price})]}),(0,r.jsxs)("div",{className:"flex flex-col gap-0.5 px-1 pt-1 text-left",children:[(0,r.jsx)("span",{className:"font-body text-p2-tight font-bold text-text-primary line-clamp-1",children:e.title}),(0,r.jsxs)("span",{className:"flex min-w-0 items-center gap-1 font-body text-p3-tight font-medium text-text-tertiary lowercase",children:[(0,r.jsxs)("span",{className:"line-clamp-1",children:["by ",e.creator]}),(0,r.jsx)(m.Y,{official:e.creatorOfficial,verified:e.creatorVerified,size:12})]})]}),(a||t)&&(0,r.jsx)("span",{className:(0,s.$)("absolute top-2 right-2 inline-flex items-center justify-center w-6 h-6 rounded-full",t?"bg-feedback-success":"bg-accent-primary","text-[var(--ice-13)]"),"aria-hidden":!0,children:(0,r.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:(0,r.jsx)("path",{d:"M2.5 7.5L5.5 10.5L11.5 3.5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]},e.id)})}),(0,r.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,r.jsx)("span",{className:"font-body text-p3-tight font-medium text-text-tertiary lowercase",children:0===x.length?"tap items to add to this room":`${x.length} item${1===x.length?"":"s"} selected`}),(0,r.jsx)(o.$n,{variant:h?"primary":"inactive",size:"sm",disabled:!h,onClick:()=>{h&&a(x)},children:i?"adding…":0===x.length?"add to room":`add ${x.length} to room`})]})]})}function y(e){let{result:t,onRun:a,onOpenInGame:n,busy:i=!1}
1=e,{status:l,itemsPlaced:d,fallbackMessage:c}=t;return(0,r.jsxs)("div",{"data-component":"CreateChat-AssistantArrangeProgress",className:(0,s.$)("flex flex-col gap-2 p-3 rounded-card","bg-surface-elevated border border-border-subtle shadow-card-subtle"),children:["queued"===l&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{className:"font-body text-p2-tight font-bold text-text-primary lowercase",children:"want me to lay everything out for you?"}),(0,r.jsx)("p",{className:"font-body text-p2 font-medium text-text-secondary m-0",children:"I'll drop your items into sensible zones for the template you picked. You can rearrange anything in-game afterwards."}),(0,r.jsx)(o.$n,{variant:"primary",size:"sm",onClick:a,disabled:i,className:"self-start mt-1",children:"arrange for me"})]}),"running"===l&&(0,r.jsxs)("span",{className:"font-body text-p2-tight font-medium text-text-secondary inline-flex items-center gap-2 lowercase",children:[(0,r.jsx)("span",{className:"inline-block w-2 h-2 rounded-full bg-accent-primary animate-pulse"}),"arranging your scene…"]}),"done"===l&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("span",{className:"font-body text-p2-tight font-bold text-feedback-success lowercase",children:["done — placed ",d??0," item",1===d?"":"s"]}),(0,r.jsx)("p",{className:"font-body text-p2 font-medium text-text-secondary m-0",children:"Your scene is ready. Open it in-game to walk around and tweak placements."}),(0,r.jsx)(o.$n,{variant:"primary",size:"sm",onClick:n,className:"self-start mt-1",children:"open in-game →"})]}),"error"===l&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{className:"font-body text-p2-tight font-bold text-feedback-error lowercase",children:"arrangement didn't land"}),(0,r.jsx)("p",{className:"font-body text-p2 font-medium text-text-secondary m-0",children:c??"Your room is ready, but I couldn't auto-arrange this template. Open it in-game to start placing items by hand."}),(0,r.jsx)(o.$n,{variant:"secondary",size:"sm",onClick:n,className:"self-start mt-1",children:"open in-game →"})]})]})}function v(e){let{template:t,selections:a,roomName:n,onBuild:l,busy:d=!1}=e,c=(0,i.X)("create:auth",{isAuthenticated:!1,uid:null,profile:null}),p=!!c?.isAuthenticated,x=a.filter(e=>"paid"!==e.pricing),m=a.filter(e=>"paid"===e.pricing),u=a.length;return(0,r.jsxs)("div",{"data-component":"CreateChat-AssistantDraftPlan",className:"flex flex-col gap-4",children:[t&&(0,r.jsxs)("div",{className:(0,s.$)("flex items-stretch gap-3","bg-surface-elevated border border-border-subtle rounded-card overflow-hidden"),children:[(0,r.jsx)("div",{className:"relative shrink-0 w-[112px] aspect-video bg-surface-sunken max-[480px]:w-[88px]",children:(0,r.jsx)("img",{src:t.img,alt:t.name,className:"absolute inset-0 w-full h-full object-cover"})}),(0,r.jsxs)("div",{className:"flex flex-col justify-center gap-0.5 py-2 pr-3 min-w-0",children:[(0,r.jsx)("span",{className:"font-body text-p3-tight font-bold text-text-tertiary lowercase",children:"your space"}),(0,r.jsx)("span",{className:"font-heading text-h6 font-bold text-text-primary lowercase line-clamp-1",children:n?.length?n:t.name}),(0,r.jsxs)("span",{className:"font-body text-p3-tight font-medium text-text-tertiary lowercase line-clamp-1",children:["built on the ",t.name," template"]})]})]}),u>0&&(0,r.jsxs)("div",{className:"flex flex-col gap-3",children:[x.length>0&&(0,r.jsx)(j,{label:m.length>0?`${x.length} included free`:`${x.length} ready to build with`,selections:x,tone:"free"}),m.length>0&&(0,r.jsx)(j,{label:`${m.length} you'll pick up after signing up`,selections:m,tone:"paid",note:p?"paid items aren't auto-claimed — open them in the marketplace to buy.":"paid items wait in your draft. you can grab them from the marketplace once you've signed up."})]}),(0,r.jsxs)("div",{className:(0,s.$)("flex items-center justify-between gap-3 pt-1","max-[480px]:flex-col max-[480px]:items-stretch max-[480px]:gap-2"),children:[(0,r.jsx)("span",{className:"font-body text-p3-tight font-medium text-text-tertiary lowercase",children:0===u?"no items selected — that's fine, you can build with the template alone.":p?"ready to spin up your space?":"sign up to lock it in. your draft is preserved."}),(0,r.jsx)(o.$n,{variant:d?"inactive":"primary",size:"md",disabled:d,onClick:()=>{d||l()},children:d?"building…":p?"build it":"sign up to continue your game in 3D"})]})]})}function j(e){let{label:t,selections:a,tone:n,note:i}=e;return(0,r.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,r.jsx)("span",{className:"font-body text-p2-tight font-bold text-text-secondary lowercase",children:t}),"paid"===n&&(0,r.jsx)("span",{className:"font-body text-p3-tight font-bold text-text-tertiary uppercase tracking-wide",children:"paid"})]}),(0,r.jsx)("div",{className:"grid gap-2 grid-cols-3 sm:grid-cols-4 md:grid-cols-5",children:a.map(e=>(0,r.jsxs)("div",{className:(0,s.$)("relative flex flex-col gap-1 p-1 rounded-card","paid"===n&&"opacity-90"),children:[(0,r.jsxs)("div",{className:"relative aspect-square w-full overflow-hidden rounded-[8px] bg-surface-sunken",children:[(0,r.jsx)(u.s,{item:{thumbnailSrc:e.thumbnailSrc,type:e.isPack?"pack":"3d",category:e.category,subcategory:e.subcategory},alt:e.title}),"free"===n&&(0,r.jsx)("span",{className:"absolute top-1 left-1 px-1.5 py-0.5 rounded-full bg-feedback-success/85 text-[var(--ice-13)] font-body text-p3-tight font-bold lowercase",children:"free"}),"paid"===n&&(0,r.jsx)("span",{className:"absolute top-1 left-1 px-1.5 py-0.5 rounded-full bg-surface-primary/85 text-text-primary font-body text-p3-tight font-bold lowercase",children:e.price})]}),(0,r.jsx)("span",{className:"font-body text-p3-tight font-bold text-text-primary line-clamp-1 px-0.5",children:e.title})]},e.id))}),i&&(0,r.jsx)("span",{className:"font-body text-p3-tight font-medium text-text-tertiary lowercase",children:i})]})}function w(e){let{title:t,pitch:a,highlights:n}=e;return(0,r.jsxs)("div",{"data-component":"CreateChat-AssistantGamePitch",className:(0,s.$)("flex flex-col gap-4","bg-surface-elevated border border-border-subtle rounded-card shadow-card-subtle","px-5 py-5 max-[640px]:px-4 max-[640px]:py-4"),children:[(0,r.jsx)("span",{className:"font-body text-p3-tight font-bold uppercase tracking-[0.12em] text-accent-primary",children:"game plan"}),(0,r.jsx)("h2",{className:"font-heading text-h2 font-bold text-text-primary m-0 break-words",children:t}),(0,r.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,r.jsx)("span",{className:"font-body text-p3-tight font-bold uppercase tracking-[0.1em] text-text-tertiary",children:"concept"}),(0,r.jsx)("p",{className:"font-body text-p1 font-medium text-text-primary m-0 whitespace-pre-wrap break-words",children:a})]}),n.length>0&&(0,r.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,r.jsx)("span",{className:"font-body text-p3-tight font-bold uppercase tracking-[0.1em] text-text-tertiary",children:"gameplay & design"}),(0,r.jsx)("ul",{className:(0,s.$)("flex flex-col gap-2 m-0 pl-5","list-disc marker:text-text-tertiary"),children:n.map((e,t)=>(0,r.jsx)("li",{className:"font-body text-p1 font-medium text-text-primary break-words",children:e},t))})]})]})}function k(e){let{onApprove:t,available:a=!0,busy:i=!1}
1=e,l=(0,n.useRef)(!1),[d,c]=(0,n.useState)(!1);return(0,r.jsxs)("div",{"data-component":"CreateChat-AssistantPitchConfirm",className:(0,s.$)("flex items-center justify-between gap-3 flex-wrap","bg-surface-elevated border border-border-subtle rounded-card","px-4 py-3 max-[480px]:px-3 max-[480px]:py-3"),children:[(0,r.jsx)("span",{className:"font-body text-p1-tight font-bold text-text-primary lowercase",children:d||i?"building your first draft.":a?"ready to build it?":"this plan was updated."}),(0,r.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[!d&&a&&!i&&(0,r.jsx)("span",{className:"font-body text-p2-tight font-medium text-text-tertiary lowercase",children:"type a change below, or"}),(0,r.jsx)(o.$n,{variant:d||i||!a?"inactive":"primary",size:"sm",disabled:d||i||!a,onClick:()=>{l.current||!a||i||(l.current=!0,c(!0),t())},children:d||i?"building…":a?"build this game":"updated"})]})]})}function N(e){let{turn:t}=e;return"system"===t.kind?(0,r.jsx)("div",{"data-component":"CreateChat-ChatTurn-System",className:(0,s.$)("self-stretch flex justify-center my-1"),children:(0,r.jsx)("span",{className:(0,s.$)("font-body text-p2-tight font-medium px-3 py-1.5 rounded-full","error"===t.variant?"bg-feedback-error/10 text-feedback-error":"bg-surface-sunken text-text-tertiary"),children:t.text})}):"user"===t.kind?(0,r.jsxs)("div",{"data-component":"CreateChat-ChatTurn-User",className:"self-end flex items-end gap-2 max-w-[85%] max-[640px]:max-w-[92%]",children:[(0,r.jsx)("div",{className:(0,s.$)("px-4 py-2.5 rounded-[18px] rounded-br-[6px]","bg-accent-primary text-[var(--ice-13)]","font-body text-p1 font-medium whitespace-pre-wrap break-words"),children:t.text}),e.isAuthenticated&&(0,r.jsx)(c.H,{name:e.username??"",src:e.userAvatarUrl,size:32})]}):(0,r.jsxs)("div",{"data-component":"CreateChat-ChatTurn-Assistant",className:"self-start flex flex-col gap-3 max-w-[85%] max-[640px]:max-w-full",children:[(0,r.jsx)("div",{className:(0,s.$)("px-4 py-2.5 rounded-[18px] rounded-bl-[6px]","bg-surface-elevated border border-border-subtle text-text-primary shadow-card-subtle","font-body text-p1 font-medium whitespace-pre-wrap break-words"),children:t.text}),t.cards?.map((a,s)=>{switch(a.kind){case"templates":return r.jsx(p,{templates:a.templates,onPick:e.onTemplatePick,busy:e.busyCreatingRoom},`${t.id}-card-${s}`);case"build-picker":return r.jsx(f,{packs:a.packs,items:a.items,onSubmit:e.onBuildPickerSubmit,onOpenInShop:e.onOpenInShop,claiming:e.busyClaiming,addedIds:e.addedItemIds,isLatest:e.isLatestBuildPicker},`${t.id}-card-${s}`);case"draft-plan":return r.jsx(v,{template:a.template,selections:a.selections,roomName:a.roomName,onBuild:e.onPlanBuild,busy:e.busyBuilding},`${t.id}-card-${s}`);case"game-pitch":return r.jsx(w,{title:a.title,pitch:a.pitch,highlights:a.highlights},`${t.id}-card-${s}`);case"pitch-confirm":return r.jsx(k,{onApprove:e.onPitchApprove,available:e.isLatestPitch,busy:e.busyBuilding},`${t.id}-card-${s}`);case"packs":return r.jsx(b,{packs:a.packs,onClaim:e.onPackClaim,claimingIds:e.claimingPackIds,addedIds:e.addedPackIds},`${t.id}-card-${s}`);case"items":return r.jsx(g,{items:a.items,onClaim:e.onItemsClaim,claiming:e.busyClaiming,addedIds:e.addedItemIds},`${t.id}-card-${s}`);case"room-created":return r.jsxs("div",{className:"px-3 py-2 rounded-card bg-feedback-success/10 text-feedback-success font-body text-p2-tight font-bold lowercase",children:['✓ created your space — "',a.room.name,'"']},`${t.id}-card-${s}`);case"claim-summary":return r.jsxs("div",{className:"px-3 py-2 rounded-card bg-surface-sunken font-body text-p2-tight font-medium text-text-secondary lowercase",children:["added ",a.addedItemCount," item",1===a.addedItemCount?"":"s"," to your inventory",a.skippedPaidCount>0?` \xb7 skipped ${a.skippedPaidCount} paid item${1===a.skippedPaidCount?"":"s"} (you'll need to buy these in the marketplace)`:""]},`${t.id}-card-${s}`);case"arrange-progress":return r.jsx(y,{result:a.result,onRun:e.onArrangeRun,onOpenInGame:()=>{e.onOpenInGame("")},busy:e.busyArranging},`${t.id}-card-${s}`);case"open-in-game":return r.jsx("div",{className:"self-start",children:r.jsx("button",{type:"button",onClick:()=>e.onOpenInGame(a.roomId),className:"inline-flex items-center gap-2 px-4 py-2 rounded-pill bg-accent-primary text-[var(--ice-13)] font-body text-p2-tight font-bold lowercase cursor-pointer border-0 transition-opacity duration-150 hover:opacity-90",children:"open in-game →"})},`${t.id}-card-${s}`);default:return null}})]})}var C=a(41738),$=a(87296),I=a(99300),S=a(29117);function P(e){let{onStart:t,onOpenSetup:a}
1=e,[i,l]=(0,n.useState)(""),[c,p]=(0,n.useState)(!1),{trackEvent:x}=(0,S.s)(),m=(0,n.useRef)(!1);(0,n.useEffect)(()=>{let e=(0,I.Sb)(window.sessionStorage);e&&l(e.prompt),p(!0)},[]),(0,n.useEffect)(()=>{c&&(0,I.Tw)(window.sessionStorage,i)},[c,i]),(0,n.useEffect)(()=>{m.current||(m.current=!0,x("create_advisor_viewed",{interaction_model:"description_only"}))},[x]);let u=e=>{let t="web-upload"===e?"upload":"github";x("create_advisor_starting_point_selected",{starting_point:t}),x("create_advisor_setup_started",{product_path:"web",starting_point:t}),a(e)};return(0,r.jsx)("div",{"data-component":"CreateAdvisor",className:(0,s.$)("flex w-full overflow-y-auto","min-h-[calc(100dvh-90px)] max-[768px]:min-h-[calc(100dvh-128px)]","px-6 py-12 max-[768px]:px-4 max-[768px]:py-8 max-[768px]:pb-[112px]"),children:(0,r.jsxs)("div",{className:"m-auto flex w-full max-w-[760px] flex-col gap-8",children:[(0,r.jsxs)("div",{className:"mx-auto flex max-w-[680px] flex-col items-center gap-4 text-center",children:[(0,r.jsx)("span",{className:"font-body text-p2-tight font-bold uppercase tracking-[0.08em] text-accent-primary",children:"make a new game"}),(0,r.jsx)("h1",{className:"m-0 font-heading text-h2 font-bold lowercase text-text-primary",children:"what game do you want to make?"}),(0,r.jsx)("p",{className:"m-0 font-body text-p1 font-medium text-text-secondary",children:"Describe it below and Portals will build the first draft."})]}),(0,r.jsx)("div",{children:(0,r.jsx)(d,{value:i,onChange:l,onSubmit:()=>{let e=i.trim();e&&(x("create_advisor_starting_point_selected",{starting_point:"new"}),x("create_advisor_inference_started"),t(e))},busy:!1,maxLength:I.qn,placeholder:"Describe your game…",submitLabel:"start building",prominent:!0})}),(0,r.jsxs)("div",{className:"flex items-center gap-4","aria-hidden":!0,children:[(0,r.jsx)("span",{className:"h-px flex-1 bg-border-subtle"}),(0,r.jsx)("span",{className:"font-body text-p3-tight font-bold uppercase tracking-[0.08em] text-text-tertiary",children:"bring an existing game"}),(0,r.jsx)("span",{className:"h-px flex-1 bg-border-subtle"})]}),(0,r.jsxs)("div",{className:"flex flex-col items-center gap-3",children:[(0,r.jsx)("p",{className:"m-0 max-w-[560px] text-center font-body text-p2 text-text-secondary",children:"Connect GitHub or import a ZIP. Portals will validate the project and get you to a playable preview before asking you to publish."}),(0,r.jsxs)("div",{"aria-label":"Existing project options",className:"flex flex-wrap items-center justify-center gap-2",children:[(0,r.jsx)(o.$n,{variant:"subtle",size:"sm",className:"min-h-11 !bg-black !px-5 !text-white enabled:hover:!bg-[#24292f]",onClick:()=>u("web-github"),children:(0,r.jsxs)("span",{className:"inline-flex items-center gap-2.5",children:[(0,r.jsx)(C.A,{className:"h-5 w-5","aria-hidden":!0}),"connect GitHub"]})}),(0,r.jsx)(o.$n,{variant:"subtle",size:"sm",className:"min-h-11 !bg-black !px-5 !text-white enabled:hover:!bg-[#24292f]",onClick:()=>u("web-upload"),children:(0,r.jsxs)("span",{className:"inline-flex items-center gap-2.5",children:[(0,r.jsx)($.A,{className:"h-5 w-5","aria-hidden":!0}),"import a ZIP"]})})]})]})]})})}function A(){return"undefined"!=typeof crypto&&"randomUUID"in crypto?crypto.randomUUID():`s_${Date.now()}_${Math.random().toString(36).slice(2,10)}`}function _(){return`op_${Date.now()}_${Math.random().toString(36).slice(2,8)}`}function L(){let e=(0,i.X)("create:auth",{isAuthenticated:!1,uid:null,profile:null}),t=(0,i.X)("create:status","idle"),a=(0,i.X)("create:turns",[])??[],c=(0,i.X)("create:last-error",null),p=(0,i.X)("create:rate-limit",null),x=(0,i.X)("create:web-build-progress",null),m=(0,i.X)("create:draft",null),u=(0,l.v)("create:intent:submit",()=>{}),h=(0,l.v)("create:templates:pick",()=>{}),f=(0,l.v)("create:pack:claim",()=>{}),b=(0,l.v)("create:items:claim",()=>{}),g=(0,l.v)("create:arrange:run",()=>{}),y=(0,l.v)("create:open-in-game",()=>{}),v=(0,l.v)("create:plan:build",()=>{}),j=(0,l.v)("create:pitch:approve",()=>{}),w=(0,l.v)("create:reset",()=>{}),k=(0,l.v)("create:setup:open",()=>{}),[C,$]=(0,n.useState)(""),I=(0,n.useRef)("");I.current||(I.current=A());let S=(()=>{for(let e=a.length-1;e>=0;e--){let t=a[e];if("assistant"===t.kind&&t.cards){let e=t.cards.find(e=>"room-created"===e.kind);if(e&&"room-created"===e.kind)return e.room.id}}return""})(),L=(()=>{for(let e=a.length-1;e>=0;e--){let t=a[e];if("assistant"===t.kind&&t.cards?.some(e=>"build-picker"===e.kind))return t.id}return null})(),z=(()=>{for(let e=a.length-1;e>=0;e--){let t=a[e];if("assistant"===t.kind&&t.cards?.some(e=>"pitch-confirm"===e.kind))return t.id}return null})(),O=(()=>{for(let e=a.length-1;e>=0;e--){let t=a[e];if("assistant"===t.kind&&t.cards){let e=t.cards.find(e=>"room-created"===e.kind);if(e&&"room-created"===e.kind)return e.room.templateName}}return""})(),T=e=>{let t=(e??C).trim();t&&($(""),u({sessionId:I.current,prompt:t}))},B=(0,n.useRef)(null),R=(0,n.useRef)(!0);(0,n.useEffect)(()=>{let e=B.current;if(!e||!R.current)return;let t=e.firstElementChild,a=t?.lastElementChild;if(a){let t=Math.max(0,a.offsetTop-12);e.scrollTo({top:t,behavior:"smooth"})}else e.scrollTop=e.scrollHeight},[a.length]);let E=0===a.length&&!c,D="thinking"===t||"creating-room"===t||"fetching-marketplace"===t,U="claiming"===t,X="arranging"===t,G=!e.isAuthenticated&&!!m?.template,H=(m?.selections?.length??0)>0,M=(()=>{for(let e=a.length-1;e>=0;e--){let t=a[e];if("assistant"===t.kind)return t}return null})(),q=M?.cards?.some(e=>"templates"===e.kind&&e.templates&&e.templates.length>0)??!1,W=M?.cards?.some(e=>"room-created"===e.kind)??!1,Y=M?.cards?.some(e=>"pitch-confirm"===e.kind)??!1,V=!!m?.template||W,F=(0,r.jsx)(d,{value:C,onChange:$,onSubmit:()=>T(),busy:D,disabled:X,placeholder:X?"building your space — hang tight…":void 0,rateLimited:p?.remaining===0});return"building-web"===t?(0,r.jsx)("div",{"data-component":"CreateChat-WebBuild",className:"flex h-[calc(100dvh-90px)] w-full items-center justify-center px-5 max-[768px]:h-[calc(100dvh-128px)]",children:(0,r.jsxs)("div",{className:"flex w-full max-w-[520px] flex-col items-center text-center",children:[(0,r.jsx)("span",{className:"mb-7 grid h-16 w-16 place-items-center rounded-full bg-accent-primary/10",children:(0,r.jsx)("span",{className:"h-9 w-9 animate-spin rounded-full border-[3px] border-accent-primary/20 border-t-accent-primary"})}),(0,r.jsx)("h1",{className:"m-0 font-heading text-h2 font-bold text-text-primary",children:x?.title||"building your game"}),(0,r.jsx)("p",{className:"mb-8 mt-3 font-body text-p1 text-text-secondary",children:x?.detail||"creating the first playable version…"}),(0,r.jsx)("div",{role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":x?.percent??10,className:"h-2 w-full overflow-hidden rounded-full bg-surface-sunken",children:(0,r.jsx)("span",{className:"block h-full rounded-full bg-accent-primary transition-[width] duration-700",style:{width:`${x?.percent??10}%`}})})]})}):E?(0,r.jsx)("div",{"data-component":"CreateChat",className:"flex flex-col w-full h-full",children:(0,r.jsx)(P,{onStart:e=>T(e),onOpenSetup:e=>k({entry:e})})}):(0,r.jsxs)("div",{"data-component":"CreateChat",className:(0,s.$)("flex flex-col w-full","h-[calc(100dvh-90px)] max-[768px]:h-[calc(100dvh-128px)]"),children:[(0,r.jsx)("div",{className:"shrink-0 px-4 pt-3 pb-1 max-[768px]:px-3 max-[768px]:pt-2",children:(0,r.jsx)("div",{className:"mx-auto max-w-[760px] w-full flex justify-end",children:(0,r.jsx)(o.$n,{variant:"subtle",size:"sm",onClick:()=>{$(""),I.current=A(),w({sessionId:I.current})},disabled:D||U||X,children:"reset chat"})})}),(0,r.jsx)("div",{ref:B,onScroll:()=>{let e=B.current;if(!e)return;let t=e.scrollHeight-e.clientHeight-e.scrollTop;R.current=t<=80},className:(0,s.$)("flex-1 min-h-0 overflow-y-auto","px-4 py-6 max-[768px]:px-3 max-[768px]:py-4","overflow-x-hidden"),children:(0,r.jsxs)("div",{className:"flex flex-col gap-4 mx-auto max-w-[760px] w-full",children:[a.map(a=>(0,r.jsx)(N,{turn:a,userAvatarUrl:e.profile?.avatarUrl,username:e.profile?.username,isAuthenticated:!!e.isAuthenticated,onTemplatePick:e=>h({sessionId:I.current,opId:_(),templateName:e.templateName,name:""}),onPackClaim:(e,t)=>f({sessionId:I.current,opId:_(),packId:e,isPaid:t}),onItemsClaim:e=>b({sessionId:I.current,opId:_(),itemIds:e}),onBuildPickerSubmit:e=>b({sessionId:I.current,opId:_(),itemIds:e}),onOpenInShop:e=>{window.open(`/marketplace/${encodeURIComponent(e)}`,"_blank")}
1,onArrangeRun:()=>g({sessionId:I.current,opId:_(),roomId:S,templateName:O}),onOpenInGame:e=>y({sessionId:I.current,roomId:e||S}),onPlanBuild:()=>v({sessionId:I.current,opId:_()}),onPitchApprove:()=>j({sessionId:I.current,opId:_()}),busyCreatingRoom:"creating-room"===t,busyClaiming:U,busyArranging:X,busyBuilding:"creating-room"===t,isLatestBuildPicker:a.id===L,isLatestPitch:a.id===z&&!D},a.id)),D&&(0,r.jsxs)("div",{className:"self-start flex items-center gap-2 px-3 py-2 font-body text-p2-tight text-text-tertiary lowercase",children:[(0,r.jsxs)("span",{className:"inline-flex gap-1",children:[(0,r.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-text-tertiary animate-bounce",style:{animationDelay:"0ms"}}),(0,r.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-text-tertiary animate-bounce",style:{animationDelay:"120ms"}}),(0,r.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-text-tertiary animate-bounce",style:{animationDelay:"240ms"}})]}),"thinking"]})]})}),(0,r.jsx)("div",{className:(0,s.$)("shrink-0 px-4 pt-3 pb-3 max-[768px]:px-3 max-[768px]:pb-[max(0.75rem,env(safe-area-inset-bottom))]","border-t border-border-subtle bg-surface-primary"),children:(0,r.jsx)("div",{className:"mx-auto max-w-[760px] w-full",children:G?(0,r.jsx)(o.$n,{variant:H?"primary":"inactive",size:"md",className:"w-full justify-center",disabled:!H,onClick:()=>{H&&v({sessionId:I.current,opId:_()})},children:"sign up to continue your game in 3D"}):!q||Y||V?F:(0,r.jsxs)("div",{"data-component":"CreateChat-PickTemplateHint",className:(0,s.$)("flex items-center justify-center gap-2 w-full","px-4 py-3 rounded-pill","bg-surface-sunken border border-border-subtle"),"aria-live":"polite",children:[(0,r.jsx)("span",{"aria-hidden":!0,className:"font-body text-p1 text-text-tertiary leading-none",children:"↑"}),(0,r.jsx)("span",{className:"font-body text-p1-tight font-bold text-text-secondary lowercase",children:"tap a template above to keep building"})]})})})]})}}}]);

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.