← Files iter0ARCHIVED FILE

ui/builder.html

149 KB · Nov 16, 2026 · 06:09 UTC

↓ Download file

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>iter0 builder</title>
<style>
:root{--bg:var(--color-background-primary,#fff);--fg:var(--color-text-primary,#0d0d0d);--muted:var(--color-text-secondary,#5d5d63);--surface:var(--color-background-secondary,#f7f7f8);--surface2:var(--color-background-tertiary,#ececef);--line:var(--color-border-primary,rgba(13,13,13,.14));--line2:var(--color-border-secondary,rgba(13,13,13,.08));--font:var(--font-sans,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif);--btn:var(--fg);--btn-fg:var(--bg);--ok:#14703f;--ok-bg:rgba(20,112,63,.1);--warn:#8f5200;--warn-bg:rgba(143,82,0,.1);--bad:#b3261e;--bad-bg:rgba(179,38,30,.09);--shadow:0 1px 2px rgba(0,0,0,.05),0 8px 24px -14px rgba(0,0,0,.2);--shadow-up:0 1px 2px rgba(0,0,0,.07),0 16px 32px -16px rgba(0,0,0,.3);--r:14px;color-scheme:light}:root[data-theme=dark]{--bg:var(--color-background-primary,#212121);--fg:var(--color-text-primary,#f4f4f5);--muted:var(--color-text-secondary,#adadb3);--surface:var(--color-background-secondary,#2b2b2d);--surface2:var(--color-background-tertiary,#363639);--line:var(--color-border-primary,rgba(255,255,255,.16));--line2:var(--color-border-secondary,rgba(255,255,255,.09));--ok:#62d69a;--ok-bg:rgba(98,214,154,.14);--warn:#f2b866;--warn-bg:rgba(242,184,102,.14);--bad:#ff9c93;--bad-bg:rgba(255,156,147,.14);--shadow:0 1px 2px rgba(0,0,0,.35),0 10px 28px -14px rgba(0,0,0,.65);--shadow-up:0 1px 2px rgba(0,0,0,.45),0 18px 36px -16px rgba(0,0,0,.75);color-scheme:dark}*{box-sizing:border-box}html,body{margin:0}body{background:var(--bg);color:var(--fg);font:14px/1.45 var(--font);-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}html[data-builder=false] body{padding:4px 2px}button{font:inherit;color:inherit;cursor:pointer}img{display:block}img[hidden]{display:none}h1,h2,h3,p{margin:0}svg.i{width:16px;height:16px;stroke:currentColor;fill:none;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round;flex:none}.btn{display:inline-flex;align-items:center;justify-content:center;gap:7px;height:36px;padding:0 16px;border-radius:999px;border:1px solid transparent;background:var(--btn);color:var(--btn-fg);font-weight:600;font-size:14px;line-height:1;transition:opacity .15s,transform .15s,background .15s;white-space:nowrap}.btn:hover,.btn:active{opacity:.88}.btn.ghost{background:transparent;color:var(--fg);border-color:var(--line)}.btn.ghost:hover{background:var(--surface);opacity:1}.btn[disabled]{opacity:1;background:var(--surface2);color:var(--muted);border-color:var(--line);cursor:default;pointer-events:none}.btn,.ib,.tb,.sg,.row,.dir,.mrow,.zb,.rt-h{position:relative}.btn:after,.ib:after,.tb:after,.sg:after,.row:after,.dir:after,.mrow:after,.zb:after,.rt-h:after{content:"";position:absolute;left:50%;top:50%;width:100%;height:100%;min-width:44px;min-height:44px;transform:translate(-50%,-50%);pointer-events:auto}.btn:focus-visible,.ib:focus-visible,.row:focus-visible,.dir:focus-visible,.zb:focus-visible,.tb:focus-visible{outline:2px solid var(--fg);outline-offset:2px}.status{display:inline-flex;align-items:center;gap:6px;height:24px;padding:0 10px;border-radius:999px;font-size:12px;font-weight:600;background:var(--surface2);color:var(--fg);white-space:nowrap}@keyframes pulse{50%{opacity:.3}}@keyframes spin{to{transform:rotate(360deg)}}@keyframes shimmer{to{background-position:-200% 0}}.shim{background:linear-gradient(100deg,var(--surface) 30%,var(--surface2) 50%,var(--surface) 70%);background-size:200% 100%;animation:shimmer 1.6s linear infinite}.boot{display:flex;flex-direction:column;gap:10px;padding:14px;border:1px solid var(--line2);border-radius:var(--r);background:var(--bg)}.boot i{display:block;height:12px;width:62%;border-radius:6px}.boot i:first-child{height:64px;width:100%;border-radius:10px}.boot i:last-child{width:38%}.thumb{position:relative;aspect-ratio:16/10;overflow:hidden;background:var(--surface);border-bottom:1px solid var(--line2)}.thumb img{width:100%;height:100%;object-fit:cover;object-position:top center}.preview-fallback{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;padding:42px 8px;background:var(--bg);color:var(--fg);text-align:center;font-size:13px;pointer-events:none}.preview-fallback span{font-size:12px;color:var(--muted)}.preview-fallback .btn{pointer-events:auto;font-size:12px;margin-top:4px}.im .preview-fallback{padding:2px;font-size:9px;line-height:11px}.im .preview-fallback span{font-size:8px}.in .preview-fallback{font-size:calc(14px / var(--s,1))}.in .preview-fallback span{font-size:calc(12px / var(--s,1))}.thumb:after{content:"";position:absolute;inset:0;box-shadow:inset 0 0 0 1px var(--line2);pointer-events:none}.card{position:relative;display:flex;flex-direction:column;background:var(--bg);border:1px solid var(--line);border-radius:var(--r);overflow:hidden;box-shadow:var(--shadow);transition:transform .18s,box-shadow .18s}.card:hover{box-shadow:var(--shadow-up)}.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}#feedback{margin:10px 2px 0;padding:10px 14px;border-radius:12px;background:var(--surface);border:1px solid var(--line2);font-size:13px;line-height:1.4;color:var(--fg)}#feedback:empty{display:none}.paid-action{padding:6px 2px;display:flex;align-items:center;gap:12px;flex-wrap:wrap}.paid-title{font-size:13px;line-height:18px;font-weight:500;margin-bottom:6px;overflow-wrap:anywhere}.paid-error{width:100%;font-size:13px;line-height:1.4;color:var(--fg);overflow-wrap:anywhere}#feedback{overflow-wrap:anywhere}.paid-action>span{position:relative;display:inline-grid;flex-shrink:0}.paid-action>span>span[aria-hidden]{position:absolute;pointer-events:none;visibility:hidden;left:0;top:0;height:0;width:0;overflow:hidden}.paid-action [aria-hidden]>span{position:absolute;left:0;top:0;width:max-content;white-space:nowrap}.paid-action .sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.paid-pill{position:relative;display:inline-flex;grid-column:1;grid-row:1;justify-self:start;align-items:center;justify-content:center;gap:6px;height:32px;padding:0 12px;border:0;border-radius:9px;font:500 13px/18px var(--font);white-space:nowrap;background:var(--surface);color:var(--fg);transition:none}.paid-pill:before{content:"";position:absolute;left:50%;top:50%;width:100%;min-width:44px;min-height:44px;transform:translate(-50%,-50%)}.paid-pill:hover,.paid-pill:active{background:var(--surface2)}.paid-pill-armed{background:var(--fg);color:var(--bg)}.paid-pill-armed:hover,.paid-pill-armed:active{background:color-mix(in srgb,var(--fg) 88%,var(--bg))}.paid-pill:focus-visible{outline:2px solid var(--fg);outline-offset:2px}.paid-pill:disabled{background:var(--surface2);color:var(--muted);cursor:not-allowed}@media(prefers-reduced-motion:no-preference){.paid-pill{transition:width .15s}}@media(max-width:767px),(any-pointer:coarse){.paid-pill{min-height:44px;min-width:44px}}.paid-action .paid-pill{min-width:max-content}.pay{border:1px solid var(--line);border-radius:16px;background:var(--bg);box-shadow:var(--shadow);overflow:hidden;margin:2px}.pay-h{display:flex;align-items:flex-start;gap:12px;padding:16px 16px 0}.pay-mark{display:grid;place-items:center;width:36px;height:36px;border-radius:10px;background:var(--fg);color:var(--bg);flex:none}.pay-mark svg.i{width:20px;height:20px}.pay-t{min-width:0;padding-top:1px}.pay-t h1{font-size:15px;line-height:20px;font-weight:600;letter-spacing:-.01em}.pay-lede{font-size:13px;line-height:18px;color:var(--muted);margin-top:2px}.pay-brief{margin:12px 16px 0;padding:10px 12px;border-radius:10px;background:var(--surface);font-size:13px;line-height:19px;color:var(--fg);overflow-wrap:anywhere}.pay-brief span{display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}.pay .set.proposed{padding:12px 16px 0}.pay-f{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-top:14px;padding:12px 16px;border-top:1px solid var(--line2);background:var(--surface)}.pay-note{font-size:12px;line-height:16px;color:var(--muted);min-width:0;flex:1 1 180px}.pay-note .n1{display:none;color:var(--fg);font-weight:500}.pay:has(.paid-pill-armed) .pay-note .n0{display:none}.pay:has(.paid-pill-armed) .pay-note .n1{display:inline}.pay-note .n2{display:none;color:var(--fg);font-weight:500}.pay.busy .pay-note .n0,.pay.busy .pay-note .n1{display:none}.pay.busy .pay-note .n2{display:inline-flex;align-items:center;gap:8px}.pay-note .n2:before{content:"";width:12px;height:12px;border-radius:50%;border:2px solid var(--line2,rgba(127,127,127,.3));border-top-color:currentColor;animation:payspin .8s linear infinite}@keyframes payspin{to{transform:rotate(360deg)}}.pay .paid-action{padding:0;margin-left:auto}.pay .paid-pill{height:38px;padding:0 18px;border-radius:999px;font:600 14px/18px var(--font);background:var(--btn);color:var(--btn-fg)}.pay .paid-pill:hover{background:color-mix(in srgb,var(--btn) 86%,var(--bg))}.pay .paid-pill-armed{background:#2f6fed;color:#fff;box-shadow:0 0 0 4px #2f6fed38}.pay .paid-pill-armed:hover,.pay .paid-pill-armed:active{background:#2a63d6}.pay .paid-pill:disabled{background:var(--surface2);color:var(--muted);box-shadow:none}.pay .paid-error{padding:0 16px 12px}.requote{padding:6px 2px}.requote:empty{display:none}.paid-action:has(~.requote .btn){display:none}.pay-f:has(.requote .btn) .pay-note{display:none}.pay .requote{padding:0;margin-left:auto}.pay .requote .btn{height:38px;padding:0 18px}@media(max-width:480px){.pay-f{flex-direction:column;align-items:stretch;gap:10px}.pay-note{flex:none}.pay .paid-action{margin-left:0;display:block}.pay .paid-action>span{display:grid}.pay .paid-pill{width:100%!important;justify-self:stretch;min-width:0;height:auto;min-height:44px;padding-block:10px;white-space:normal;text-wrap:balance;text-align:center}.pay .requote{margin-left:0}.pay .requote .btn{width:100%}}.rt{border:1px solid var(--line);border-radius:12px;background:var(--bg);margin:0 0 12px;overflow:hidden}.rt-h{display:flex;align-items:center;gap:8px;width:100%;min-height:44px;padding:6px 12px;border:0;background:none;text-align:left;font-size:13px;font-weight:500;color:var(--fg)}.rt-h:hover{background:var(--surface)}.rt-h .rt-t{flex:1;min-width:0}.rt-h svg.i{width:14px;height:14px;color:var(--muted)}.rt-b{border-top:1px solid var(--line2);padding:4px 6px 6px}.rt-p{display:flex;align-items:center;gap:8px;padding:4px 6px 6px;font-size:12px;color:var(--muted)}.rt ul{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:2px}.rt-r{display:flex;align-items:center;gap:10px;min-height:44px;padding:5px 6px;border-radius:8px}.rt-r .av{display:grid;place-items:center;width:28px;height:28px;border-radius:50%;border:1px solid var(--line);background:var(--surface);color:color-mix(in srgb,var(--fg) 80%,transparent);flex:none}.rt-r .av svg.i{width:20px;height:20px;stroke-width:1.3}.rt-n{flex:1;min-width:0;display:flex;flex-direction:column}.rt-n b{font-size:12px;line-height:16px;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rt-n>span{display:flex;align-items:center;gap:6px;font-size:12px;line-height:16px;color:var(--muted);overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.hosts{display:flex;align-items:center;flex:none}.hosts em{font-style:normal;margin-left:4px;font-size:11px;color:var(--muted)}.mono{display:inline-grid;place-items:center;width:16px;height:16px;border-radius:3px;background:var(--surface2);color:var(--fg);font-size:9px;font-weight:600;line-height:1;box-shadow:0 0 0 2px var(--bg)}.mono+.mono{margin-left:-4px}@media(prefers-reduced-motion:reduce){*{transition-duration:.01ms!important}}
@scope(html[data-view=build-status]){body{padding:4px 2px 2px}.bs{background:var(--bg);border:1px solid var(--line);border-radius:var(--r);box-shadow:var(--shadow);overflow:hidden}.top{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 16px;border-bottom:1px solid var(--line2)}.top h1{font-size:15px;line-height:1.3;font-weight:600}.top p{margin-top:1px;font-size:13px;color:var(--muted)}.bs-rt{padding:12px 16px;border-bottom:1px solid var(--line2)}.bs-rt .rt{margin:0}.pv{padding:16px;background:var(--surface)}.frame{border-radius:10px;overflow:hidden;background:var(--bg);border:1px solid var(--line);box-shadow:var(--shadow)}.chrome{display:flex;align-items:center;gap:5px;height:26px;padding:0 10px;border-bottom:1px solid var(--line2);background:var(--bg)}.chrome b{width:7px;height:7px;border-radius:50%;background:var(--surface2)}.chrome span{margin-left:8px;flex:1;max-width:60%;height:15px;border-radius:8px;background:var(--surface);font-size:11px;line-height:15px;color:var(--muted);padding:0 9px;overflow:hidden;white-space:nowrap}.shot{position:relative;aspect-ratio:16/10;overflow:hidden;background:var(--surface)}.shot img{position:absolute;inset:0;z-index:1;width:100%;height:100%;object-fit:cover;object-position:top center;opacity:0;transition:opacity .25s ease-out}.shot img.ld{opacity:1}.shot iframe.draft{position:absolute;top:0;left:0;z-index:1;width:1440px;height:800px;border:0;background:#fff;transform-origin:0 0}.wire{position:absolute;inset:0;display:flex;flex-direction:column;gap:10px;padding:18px 20px}.wire i{display:block;border-radius:6px}.wire .nav{display:flex;justify-content:space-between;align-items:center;height:14px;margin-bottom:14px}.wire .nav i{height:10px}.wire .cards{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-top:auto}.wire .cards i{height:56px;border-radius:10px}.building .shot:after{content:"";position:absolute;left:0;right:0;height:38%;background:linear-gradient(180deg,transparent,color-mix(in srgb,var(--fg) 8%,transparent),transparent);animation:scan 2.6s ease-in-out infinite}@keyframes scan{0%{top:-40%}to{top:100%}}.res{padding:14px 16px 16px;display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap}.res p{font-size:13px;color:var(--muted);max-width:46ch}.res .acts{display:flex;gap:8px;flex-wrap:wrap}.prog{height:3px;border-radius:2px;background:var(--surface2);overflow:hidden;position:relative}.prog:after{content:"";position:absolute;top:0;bottom:0;width:36%;border-radius:2px;background:var(--fg);animation:run 1.5s ease-in-out infinite}@keyframes run{0%{left:-36%}to{left:100%}}.fail{padding:22px 16px;display:flex;gap:12px;align-items:flex-start}.fail .ic{display:grid;place-items:center;width:32px;height:32px;border-radius:10px;background:var(--bad-bg);color:var(--bad);flex:none}.fail p{font-size:13px;color:var(--muted);margin-top:2px}.fail h2{font-size:15px;font-weight:600}.fail .btn{margin-top:12px}@media(max-width:640px){.pv{padding:12px}.res{flex-direction:column;align-items:stretch}.res .btn{width:100%}.res .acts{flex-direction:column-reverse}}.build-wait-host{position:relative;width:100%;height:560px;overflow:hidden;border-radius:16px;border:1px solid var(--line)}.bw-layer{position:absolute;inset:0;display:grid;grid-template:auto 1fr / minmax(0,1fr) minmax(0,1.05fr);gap:16px 24px;padding:18px 22px 22px;background:var(--surface);background-image:radial-gradient(circle,var(--line) 1px,transparent 1.3px);background-size:28px 28px}.bw-l-h{grid-column:1 / -1;display:flex;align-items:center;gap:9px;font-size:13px;font-weight:600;color:var(--fg)}.bw-l-h i{width:7px;height:7px;border-radius:50%;background:#b58bd0;animation:bwl 2.8s ease-in-out infinite}:scope[data-theme=dark] .bw-l-h i{background:#dda6ee}.bw-l-c{align-self:center;display:flex;gap:18px;align-items:center;padding:20px;max-width:440px;border-radius:22px;background:var(--bg);border:1px solid var(--line)}.bw-l-a{flex:none;width:56px;height:56px;border-radius:50%;background:var(--line)}.bw-l-c div{display:flex;flex-direction:column;gap:4px;min-width:0}.bw-l-c b{font-size:12px;font-weight:500;color:var(--muted)}.bw-l-stage{font-size:16px;line-height:1.3;font-weight:600;color:var(--fg)}.bw-l-p{border-radius:18px;border:1px solid var(--line2);background:var(--bg);overflow:hidden}.bw-l-p b{display:block;padding:10px 16px;border-bottom:1px solid var(--line);font-size:13px;font-weight:500;color:var(--muted)}.bw-l-p s{display:block;height:10px;margin:14px 16px;border-radius:6px;background:var(--line);animation:bwl 2.8s ease-in-out infinite}.bw-l-p s.h{height:84px}@keyframes bwl{0%,to{opacity:.45}50%{opacity:1}}@media(prefers-reduced-motion:reduce){.bw-l-h i,.bw-l-p s{animation:none}}@media(max-width:560px){.bw-layer{grid-template:auto auto 1fr / 1fr;padding:16px}.bw-l-c{max-width:none;padding:14px}.bw-l-a{width:44px;height:44px}}.build-wait-footer{display:flex;align-items:center;justify-content:flex-end;gap:12px;padding:12px 16px}.bw-status{flex:1;min-width:0;font-size:13px;color:var(--muted)}.build-wait-footer .sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}:scope[data-mode=expanded] .build-wait-host,:scope[data-mode=fullscreen] .build-wait-host{height:max(560px,calc(100vh - 72px))}.cmp-row{display:flex;gap:16px;padding:14px 16px;align-items:center}.cmp-shot{flex:0 0 216px;border-radius:10px;border:1px solid var(--line)}.cmp-tx{flex:1;min-width:0;display:flex;flex-direction:column;gap:6px}.cmp-h{display:flex;align-items:center;justify-content:space-between;gap:12px}.cmp-h h1{font-size:15px;line-height:1.3;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cmp-tx>p{font-size:13px;color:var(--muted)}.cmp .acts{display:flex;gap:8px;flex-wrap:wrap;margin-top:6px}.cmp .bs-rt{border-top:1px solid var(--line2);border-bottom:0}.cmp-list{padding:14px 16px}.cmp-list ul{list-style:none;margin:4px 0 0;padding:0;display:flex;flex-direction:column;gap:8px}.cmp-list li{display:flex;align-items:center;gap:10px;font-size:13px}.cmp-list li>span:last-child{display:flex;flex-direction:column;min-width:0}.cmp-list li b{font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cmp-list li>span:last-child>span{color:var(--muted);font-size:12px}.cmp-mini{flex:none;width:56px;aspect-ratio:16/10;border-radius:6px;overflow:hidden;background:var(--surface);border:1px solid var(--line2)}.cmp-mini img{width:100%;height:100%;object-fit:cover;object-position:top center}.shot:has(.preview-fallback) .wire{display:none}.cmp-shot .preview-fallback{padding:8px}.cmp-mini{position:relative}.cmp-mini .preview-fallback{padding:0;font-size:0}.cmp-mini .preview-fallback>*{display:none}@media(max-width:640px){.cmp-row{flex-direction:column;align-items:stretch}.cmp-shot{flex:none;width:100%}.cmp .acts .btn{flex:1 1 auto}}}
@scope(html[data-view=show-three]){body{padding:4px 0 2px}.wrap{padding:0 2px}.head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding:2px 2px 12px}.head h1{font-size:15px;line-height:1.3;font-weight:600;letter-spacing:-.005em}.head p{margin-top:2px;font-size:13px;color:var(--muted)}.set{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.card .thumb{border-radius:0}.tag{position:absolute;top:10px;left:10px;z-index:1;display:inline-flex;align-items:center;height:22px;padding:0 9px;border-radius:999px;font-size:12px;font-weight:600;background:color-mix(in srgb,var(--bg) 92%,transparent);color:var(--fg);box-shadow:0 0 0 1px var(--line2),0 1px 3px #0000001f;backdrop-filter:blur(6px)}.body{display:flex;flex-direction:column;gap:12px;padding:14px;flex:1}.name{font-size:15px;line-height:1.3;font-weight:600;letter-spacing:-.005em}.body .btn{width:100%;margin-top:auto}.proposed{margin-bottom:12px}.proposed .body{gap:6px}.proposed .name,.proposed p{overflow-wrap:anywhere}.proposed p{font-size:13px;color:var(--muted)}.skel .thumb>div{position:absolute;inset:0}.skel .ln{height:12px;border-radius:6px}.skel .btn{pointer-events:none;opacity:.35}.msg{display:flex;align-items:center;gap:12px;padding:16px;border:1px solid var(--line);border-radius:var(--r);background:var(--bg);box-shadow:var(--shadow)}.msg .ic{display:grid;place-items:center;width:32px;height:32px;border-radius:10px;background:var(--surface2);flex:none}.msg .ic.bad{background:var(--bad-bg);color:var(--bad)}.msg h1{font-size:15px;font-weight:600}.msg p{margin-top:2px;font-size:13px;color:var(--muted)}.msg .btn{margin-left:auto}.foot{display:flex;align-items:center;gap:8px;margin-top:12px}.zoom{display:none}@media(max-width:640px){.set{display:flex;flex-direction:column;gap:10px}.set.proposed{display:grid;grid-template-columns:1fr;margin:0 0 12px}.set:not(.proposed) .card{display:grid;grid-template-columns:minmax(0,42%) minmax(0,1fr);grid-template-areas:"thumb name" "thumb act" "thumb rq";grid-template-rows:auto auto 1fr;column-gap:14px}.set:not(.proposed) .body{display:contents}.set:not(.proposed) .thumb{grid-area:thumb;align-self:start;border-bottom:0;border-right:1px solid var(--line2)}.set:not(.proposed) .body>:first-child{grid-area:name;padding:14px 12px 0 0}.set:not(.proposed) .body>:nth-child(2){grid-area:act;margin:8px 12px 12px 0}.set:not(.proposed) .requote{grid-area:rq;padding:0 12px 10px 0}.set:not(.proposed) .tag{top:6px;left:6px;height:20px;padding:0 7px;font-size:11px}.zoom{display:block;position:absolute;inset:0;z-index:1;width:100%;padding:0;border:0;background:transparent;cursor:zoom-in}.zoom svg{position:absolute;right:6px;bottom:6px;width:22px;height:22px;padding:4px;border-radius:6px;background:color-mix(in srgb,var(--bg) 88%,transparent);color:var(--fg);box-shadow:0 0 0 1px var(--line2)}.zoom:focus-visible{outline:2px solid var(--fg);outline-offset:-2px}.thumb:has(.preview-fallback) .zoom{display:none}.set:not(.proposed) .card.big{grid-template-columns:minmax(0,1fr);grid-template-areas:"thumb" "name" "act" "rq";grid-template-rows:auto}.set:not(.proposed) .card.big .thumb{border-right:0;border-bottom:1px solid var(--line2)}.set:not(.proposed) .card.big .body>*{padding-left:14px}.set:not(.proposed) .card.big .body>:nth-child(2){margin-left:14px;padding-left:2px}.card.big .zoom{cursor:zoom-out}.card.big .tag{top:10px;left:10px;height:22px;padding:0 9px;font-size:12px}.wrap{padding:0 16px}.msg{flex-wrap:wrap}.msg>div{flex:1 1 0;min-width:0}.msg .btn{margin-left:0;width:100%}}@media(max-width:440px){.set:not(.proposed) .card{grid-template-areas:"thumb name" "act act" "rq rq";grid-template-rows:auto auto auto}.set:not(.proposed) .body>:first-child{align-self:center;padding:8px 12px 8px 0}.set:not(.proposed) .body>:nth-child(2){margin:0 12px 10px}.set:not(.proposed) .requote{padding:0 12px 10px}.set:not(.proposed) .card.big .body>:nth-child(2){margin-left:12px}}}
@scope(html[data-builder=true]){:scope{--builder-bg: #ffffff;--builder-panel: #ffffff;--builder-surface: #ffffff;--builder-side: #ffffff;--builder-marker: #222222;--builder-tint: #f3f3f3;--builder-tint-strong: #ececec;--builder-pill: #f3f3f3;--builder-primary: #111111;--builder-primary-hover: #333333;--builder-primary-pressed: #000000;--builder-on-primary: #ffffff;--builder-active: #222222;--builder-active-hover: #333333;--builder-on-active: #ffffff;--builder-bubble-user: #f3f3f3;--builder-bubble-ceo: transparent;--builder-field-on-side: #f3f3f3;--builder-disabled-ink: #6b6b6b;--builder-chip: #ffffff;--builder-chip-hover: #ececec;--builder-cta: #ffffff;--builder-cta-ink: #222222;--builder-cta-hover: #ececec;--builder-canvas: #eeeeee;--builder-frame-label: #e6e6e6;--builder-text: #222222;--builder-text-soft: #444444;--builder-subtle: #666666;--builder-fill: #f3f3f3;--builder-hover: #ececec;--builder-pressed: #e5e5e5;--builder-rule: #eeeeee;--builder-card-rule: #e2e2e2;--builder-focus: #222222;--builder-accent-line: transparent;--builder-edge: var(--builder-rule);--builder-accent-icon: var(--builder-subtle);--builder-radius-control: 9px;--builder-radius-card: 15px;--builder-rail: 270px;--builder-agent: 380px;--builder-shadow-pill: 0 1px 2px rgba(0, 0, 0, .12), 0 4px 12px rgba(0, 0, 0, .06);--builder-shadow-float: 0 2px 6px rgba(0, 0, 0, .1), 0 12px 28px rgba(0, 0, 0, .08);--builder-shadow-menu: 0 4px 12px rgba(0, 0, 0, .1), 0 18px 40px rgba(0, 0, 0, .12);--builder-popover-radius: 16px;--builder-popover-fill: #f5f5f5;--builder-popover-edge: #e8e8e8;--builder-popover-shadow: 0 4px 12px rgba(0, 0, 0, .1), 0 18px 40px rgba(0, 0, 0, .12)}:scope[data-theme=dark]{--builder-bg: #141414;--builder-panel: #141414;--builder-surface: #141414;--builder-side: #141414;--builder-canvas: #0d0d0d;--builder-frame-label: #262626;--builder-frame-label-hover: #303030;--builder-frame-label-text: #e6e6e6;--builder-frame-label-subtle: #b5b5b5;--builder-frame-chip: #3a3a3a;--builder-frame-chip-hover: #454545;--builder-text: #f2f2f2;--builder-text-soft: #d2d2d2;--builder-subtle: #a3a3a3;--builder-fill: #232323;--builder-hover: #2d2d2d;--builder-pressed: #383838;--builder-rule: #262626;--builder-card-rule: #333333;--builder-focus: #f2f2f2;--builder-marker: #f2f2f2;--builder-tint: #2d2d2d;--builder-tint-strong: #3a3a3a;--builder-pill: #2d2d2d;--builder-primary: #f2f2f2;--builder-primary-hover: #ffffff;--builder-primary-pressed: #d6d6d6;--builder-on-primary: #111111;--builder-active: #f2f2f2;--builder-active-hover: #ffffff;--builder-on-active: #111111;--builder-bubble-user: #232323;--builder-bubble-ceo: transparent;--builder-field-on-side: #232323;--builder-disabled-ink: #a8a8a8;--builder-chip: #2d2d2d;--builder-chip-hover: #383838;--builder-cta: #2d2d2d;--builder-cta-ink: #f2f2f2;--builder-cta-hover: #383838;--builder-popover-fill: #232323;--builder-popover-edge: #333333;--builder-shadow-pill: 0 1px 2px rgba(0, 0, 0, .5), 0 4px 12px rgba(0, 0, 0, .35);--builder-shadow-float: 0 2px 6px rgba(0, 0, 0, .5), 0 12px 28px rgba(0, 0, 0, .4);--builder-shadow-menu: 0 4px 12px rgba(0, 0, 0, .5), 0 18px 40px rgba(0, 0, 0, .5);--builder-popover-shadow: 0 4px 12px rgba(0, 0, 0, .5), 0 18px 40px rgba(0, 0, 0, .5)}:scope{--canvas:#eeeeee;--fill:color-mix(in srgb,var(--fg) 5%,var(--bg));--hover:color-mix(in srgb,var(--fg) 8%,var(--bg));--pressed:color-mix(in srgb,var(--fg) 12%,var(--bg));--halo:color-mix(in srgb,var(--fg) 38%,transparent);--pill-shadow:0 1px 2px rgba(0,0,0,.08),0 4px 12px rgba(0,0,0,.08);--float:0 0 0 1px var(--line2),0 2px 6px rgba(0,0,0,.1),0 12px 28px rgba(0,0,0,.1)}:scope[data-theme=dark]{--canvas:#0d0d0d;--pill-shadow:0 1px 2px rgba(0,0,0,.5),0 4px 12px rgba(0,0,0,.35);--float:0 0 0 1px var(--line),0 2px 6px rgba(0,0,0,.5),0 12px 28px rgba(0,0,0,.4)}:scope,body{height:100%}body{font-size:13px;line-height:18px;overflow:hidden;padding:0}#app{height:100vh;min-height:0}.app,.lib{display:flex;flex-direction:column;height:100%;min-height:0}.bar{display:flex;align-items:center;gap:12px;height:50px;padding:0 10px;border-bottom:1px solid var(--line2);background:var(--bg);flex:none;min-width:0}.sep{width:1px;height:20px;background:var(--line);margin:0 6px;flex:none}.ib,.tb{display:inline-flex;align-items:center;justify-content:center;gap:6px;height:32px;min-width:32px;padding:0 8px;border:0;border-radius:9px;background:none;font-weight:500;color:var(--fg);transition:background .12s;white-space:nowrap}.ib:hover,.tb:hover{background:var(--hover)}.ib:active,.tb:active{background:var(--pressed)}.tb.fill{background:var(--fill);padding:0 12px}.tb.fill:hover{background:var(--hover)}.tb.dark{background:var(--btn);color:var(--btn-fg);font-weight:600;padding:0 14px;border-radius:999px;height:34px}.tb.dark:hover{opacity:.88;background:var(--btn)}.tb[disabled],.ib[disabled],.zb[disabled],.row[disabled],.mrow[disabled],.dir[disabled],.rt-h[disabled]{opacity:1;color:var(--muted);cursor:default;pointer-events:none}.tb.dark[disabled]{background:var(--surface2);color:var(--muted)}.name{display:flex;align-items:center;gap:8px;min-width:0;margin-left:4px;font-weight:500}.name b{font-weight:600;max-width:240px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.st{display:inline-flex;align-items:center;gap:6px;color:var(--muted);font-size:12px;white-space:nowrap}.spacer{flex:1;min-width:8px}.main{flex:1;display:flex;min-height:0;position:relative}.side{width:256px;flex:none;background:var(--bg);border-right:1px solid var(--line2);display:flex;flex-direction:column;min-height:0;transition:width .18s}.side.fold{width:48px}.side.fold .sb-body,.side.fold .side-foot,.side.fold .sb-head h2{display:none}.side.fold .sb-head{justify-content:center;padding:0}.sb-head{display:flex;align-items:center;justify-content:space-between;height:50px;padding:0 8px 0 14px;flex:none}.sb-head h2{font-size:14px;line-height:20px;font-weight:600}.fold-ic{transition:transform .18s}.side.fold .fold-ic{transform:rotate(180deg)}.sb-body{flex:1;overflow-y:auto;padding:4px 8px 10px;display:flex;flex-direction:column;gap:8px;min-height:0}.sb-rt{padding:2px 0 8px}.sb-rt .rt{margin:0}.row{position:relative;display:flex;align-items:center;gap:10px;width:100%;min-height:36px;padding:6px 10px;border:0;border-radius:9px;background:none;text-align:left;color:var(--fg)}button.row:hover{background:var(--hover)}.row[aria-current=true]{background:var(--fill)}.row[aria-current=true]:before{content:"";position:absolute;left:-8px;top:8px;bottom:8px;width:2px;border-radius:2px;background:var(--fg)}.row .t{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.row .p{color:var(--muted);font-size:12px}.row svg.i{color:var(--muted)}.lbl{display:flex;align-items:center;justify-content:space-between;margin:16px 10px 6px;font-size:12px;line-height:16px;color:var(--muted)}.dir{display:flex;align-items:center;gap:10px;width:100%;padding:6px;border-radius:12px;border:1px solid var(--line);text-align:left;background:var(--bg);color:var(--fg);transition:background .12s}.dir+.dir{margin-top:6px}.dir:hover{background:var(--fill)}.dir[aria-current=true]{border-color:var(--fg)}.dir .im{position:relative;width:64px;aspect-ratio:16/10;border-radius:7px;overflow:hidden;background:var(--fill);flex:none;border:1px solid var(--line2)}.dir .im img{width:100%;height:100%;object-fit:cover;object-position:top}.dir .tx{min-width:0;display:flex;flex-direction:column}.dir .tx b{font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.dir .tx span{font-size:12px;color:var(--muted)}.side-foot{padding:10px 8px 12px;border-top:1px solid var(--line2);flex:none}.side-foot .tb{width:100%;height:36px;border-radius:10px}.preview-unavailable{position:absolute;inset:0;margin:0;display:grid;place-items:center;padding:32px;color:var(--fg);font:500 calc(16px / var(--s,1))/1.5 var(--font);text-align:center}.canvas{position:relative;display:flex;flex-direction:column;flex:1;min-width:0;min-height:0;background:var(--canvas);overflow:hidden}.board{position:absolute;left:0;top:0;padding:64px 0 0;transition:transform .3s cubic-bezier(.2,.7,.2,1)}.fl{display:flex;align-items:center;gap:8px;height:32px;padding:0 10px 0 8px;border-radius:9px;background:var(--bg);color:var(--fg);margin-bottom:8px;font-weight:500;white-space:nowrap;box-shadow:0 0 0 1px var(--line2)}.fl .pl{display:grid;place-items:center;color:var(--muted)}.fl .pl svg{width:13px;height:13px}.fl .sub{color:var(--muted);font-weight:400;margin-left:2px}.fb{position:relative;overflow:hidden;background:#fff;border-radius:3px;box-shadow:0 0 0 2px var(--halo),0 10px 30px -12px #0000004d}.in{position:relative;transform-origin:0 0;overflow:hidden}.in>img{position:absolute;left:0;top:0;width:100%;height:100%;object-fit:cover;object-position:top left}.in{cursor:crosshair}.fr.phone .fb{border-radius:calc(28px * var(--fs,1));box-shadow:0 0 0 8px #1c1c1e,0 0 0 9px var(--line),0 18px 40px -14px #0006}.fr.phone .fl{margin-bottom:18px}.scroller{position:relative;flex:1;min-height:0;overflow:auto;overscroll-behavior:contain}.board{position:relative;left:auto;top:auto;padding:28px 0 110px;width:max-content;transition:none}.fr.phone{padding-top:0}.hl{position:absolute;z-index:2;pointer-events:none;outline:calc(2px / var(--s,1)) solid #111;outline-offset:calc(-1px / var(--s,1));background:transparent;box-shadow:0 0 0 calc(4px / var(--s,1)) #dda6ee;border-radius:calc(2px / var(--s,1))}.hl.hover{outline-style:dashed;outline-color:#111;background:transparent;box-shadow:none}.hl[hidden]{display:none}#preview-image[aria-busy=true]{cursor:progress}.pv-state{position:absolute;inset:0;z-index:3;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:calc(10px / var(--s,1));padding:calc(24px / var(--s,1));text-align:center;color:var(--muted);background:linear-gradient(100deg,var(--surface) 30%,var(--surface2) 50%,var(--surface) 70%) 0 0 / 200% 100%;font:500 calc(14px / var(--s,1))/1.4 var(--font);animation:shimmer 1.6s linear infinite;cursor:default}.pv-state[hidden]{display:none}.pv-dot{width:calc(16px / var(--s,1));height:calc(16px / var(--s,1));border-radius:50%;border:calc(2px / var(--s,1)) solid var(--line);border-top-color:var(--fg);animation:spin .8s linear infinite}.pv-state.failed{animation:none;background:var(--surface);color:var(--fg)}.pv-state .btn{height:calc(34px / var(--s,1));padding:0 calc(16px / var(--s,1));font-size:calc(13px / var(--s,1));gap:calc(7px / var(--s,1))}@media(prefers-reduced-motion:reduce){.pv-state,.pv-dot{animation:none}}.canvas:has(.pv-state:not([hidden])) .chipdock.idle{display:none}.hl-tag{position:absolute;left:0;top:0;transform-origin:0 0;transform:scale(calc(1 / var(--s,1)));border-radius:0 0 6px!important;display:inline-flex;align-items:center;height:22px;padding:0 8px;border-radius:6px;background:#111;color:#fff;font:600 12px/1 var(--font);white-space:nowrap;max-width:420px;overflow:hidden;text-overflow:ellipsis}.hl-tag:empty{display:none}.seg{display:inline-flex;align-items:center;gap:12px;padding:2px 8px;border-radius:10px;background:var(--fill);margin-right:4px;flex:none}.sg{display:inline-grid;place-items:center;width:32px;height:28px;border:0;border-radius:8px;background:none;color:var(--muted)}.sg:hover{color:var(--fg)}.sg[aria-checked=true]{background:var(--bg);color:var(--fg);box-shadow:0 0 0 1px var(--line2),0 1px 2px #00000014}.sg[disabled]{opacity:1;color:var(--muted);cursor:default}.tb.on{background:var(--fill)}.tb .hide-sm.i{width:14px;height:14px;color:var(--muted);margin-left:-2px}.tb.dark.sm{height:30px;padding:0 12px;font-size:13px}.mwrap{position:relative;display:inline-flex}.menu{position:absolute;top:calc(100% + 6px);right:0;z-index:30;width:300px;max-width:calc(100vw - 20px);padding:6px;border-radius:14px;background:var(--bg);box-shadow:var(--float);text-align:left}.menu.wide{width:320px}.mh{display:flex;align-items:baseline;justify-content:space-between;padding:6px 8px 8px}.mh b{font-size:13px;font-weight:600}.mh span{font-size:12px;color:var(--muted)}.mlist{max-height:300px;overflow:auto}.mrow{display:flex;align-items:center;gap:10px;width:100%;min-height:44px;padding:6px 8px;border:0;border-radius:9px;background:none;text-align:left;color:var(--fg)}.mrow:hover{background:var(--hover)}.mrow.on{background:var(--fill)}.mrow>svg.i{color:var(--muted)}.mrow .mx{width:13px;height:13px;margin-left:auto;opacity:.6}.mt{flex:1;min-width:0;display:flex;flex-direction:column}.mt b{font-weight:500;font-size:13px;line-height:18px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mt span{font-size:12px;line-height:16px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.vn{display:inline-grid;place-items:center;min-width:30px;height:24px;padding:0 6px;border-radius:7px;background:var(--fill);font-size:12px;font-weight:600;color:var(--fg)}.mrow.on .vn{background:var(--btn);color:var(--btn-fg)}.mnote{padding:8px 8px 6px;font-size:12px;line-height:16px;color:var(--muted);border-top:1px solid var(--line2);margin-top:4px}.msep{height:1px;background:var(--line2);margin:4px 6px}.vbar{position:relative;align-self:center;flex:none;margin:12px 12px 0;display:flex;align-items:center;gap:8px;padding:7px 7px 7px 12px;border-radius:12px;background:var(--bg);box-shadow:var(--float);white-space:nowrap;max-width:calc(100% - 24px)}.vbar>svg.i{color:var(--muted)}.vbar>span{font-weight:500;overflow:hidden;text-overflow:ellipsis}.canvas.viewing .board{padding-top:28px}.row.add{color:var(--muted)}.row.add svg.i{color:var(--muted)}.chipdock .x{height:28px;min-width:28px;margin-left:0;flex:none}.fl .fn{overflow:hidden;text-overflow:ellipsis}.pill{position:absolute;display:flex;align-items:center;gap:10px;height:44px;padding:0 6px;border-radius:14px;background:var(--bg);box-shadow:var(--float);z-index:5}.zoombar{position:absolute;right:14px;bottom:14px;z-index:5;display:flex;align-items:center;gap:6px}.zoombar .pill{position:static}.pill #zoom-value{min-width:42px;text-align:center;font-weight:500}.zb{display:inline-flex;align-items:center;justify-content:center;gap:6px;height:34px;min-width:34px;padding:0 8px;border:0;border-radius:10px;background:none;font-weight:500;color:var(--fg)}.zb:hover{background:var(--hover)}.addpg{display:flex;flex-direction:column;gap:8px;margin:2px 0 6px;padding:10px;border:1px solid var(--line);border-radius:12px;background:var(--bg)}.addpg label{font-weight:600;color:var(--fg)}.addpg input{height:34px;padding:0 10px;border:1px solid var(--line);border-radius:9px;background:var(--bg);color:var(--fg);font:inherit}.addpg input:focus{outline:2px solid var(--fg);outline-offset:-1px}.addpg-acts{display:flex;justify-content:flex-end;gap:6px}.chipdock{position:absolute;left:50%;bottom:72px;transform:translate(-50%);z-index:5;display:flex;align-items:center;gap:14px;padding:8px;border-radius:12px;background:var(--bg);border:1px solid var(--line);box-shadow:var(--float);max-width:calc(100% - 28px);min-height:44px}.chipdock .c{display:inline-flex;align-items:center;gap:6px;height:28px;padding:0 10px 0 8px;border-radius:8px;background:var(--fill);color:var(--fg);font-size:13px;font-weight:600;max-width:260px}.chipdock .c span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chipdock .ask-change{flex:none;color:var(--fg);font-size:13px;font-weight:600;box-shadow:inset 0 0 0 1px var(--line)}.chipdock .h{color:var(--muted);font-size:12px;line-height:16px}.chipdock.idle{padding-left:12px}.chipdock.idle svg.i{color:var(--muted)}#feedback{position:static;flex:none;margin:0;padding:8px 14px;border:0;border-radius:0;box-shadow:none;background:var(--surface);color:var(--fg);font-size:13px;line-height:18px}#feedback:empty{display:none}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}.pj-top{gap:6px;padding:0 14px 0 18px}.pj-crumb{display:flex;align-items:center;gap:6px;min-width:0;font-weight:500;color:var(--muted)}.pj-crumb b{color:var(--fg);font-weight:600}.pj-crumb .i{width:14px;height:14px}.pj-logo{width:18px;height:18px;color:var(--fg)}.pj{flex:1;overflow:auto;min-height:0;scroll-padding-bottom:120px}.pj-top,.pj{background:var(--builder-bg)}.pj-in{max-width:980px;margin:0 auto;padding:28px 32px 136px}.pj-hello{display:flex;align-items:center;gap:14px;margin-bottom:18px}.pj-hello h1{font-size:28px;line-height:34px;font-weight:600;letter-spacing:-.02em}.pj-ask{position:relative;border:1px solid transparent;border-radius:16px;background:var(--builder-fill);transition:background-color .12s,border-color .12s,box-shadow .12s}.pj-ask:has(textarea:focus){background:var(--builder-surface);border-color:#8c8c8c;box-shadow:var(--builder-shadow-pill)}.pj-ask textarea{display:block;width:100%;min-height:40px;max-height:208px;resize:none;border:0;outline:0;border-radius:16px;background:none;color:var(--builder-text);font:inherit;font-size:16px;line-height:24px;padding:12px 12px 4px}.pj-ask textarea::placeholder{color:var(--builder-subtle);white-space:nowrap}.pj-ask svg.i{stroke-width:1.17}.pj-tools{display:flex;flex-wrap:nowrap;align-items:center;gap:8px;height:40px;padding:0 8px}.pj-plus{position:relative;display:inline-flex;flex:none}.pj-ib{display:inline-grid;place-items:center;width:32px;height:32px;padding:0;border:0;border-radius:9px;background:none;color:var(--builder-subtle);transition:background-color .15s,color .15s}.pj-ib:hover{background:var(--builder-hover)}.pj-ib:active,.pj-ib[aria-expanded=true]{background:var(--builder-pressed)}.pj-chip{display:inline-flex;align-items:center;gap:2px;min-width:0;height:24px;padding:2px 2px 2px 8px;border-radius:999px;background:var(--builder-pill);color:var(--builder-text);font-size:12px;line-height:16px;font-weight:500}.pj-ask:not(:has(textarea:focus)) .pj-chip{background:var(--builder-surface)}.pj-chip>span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.pj-chip-x{display:inline-grid;place-items:center;width:18px;height:18px;padding:0;border:0;border-radius:999px;background:none;color:var(--builder-subtle)}.pj-chip-x:hover{background:var(--builder-hover);color:var(--builder-text)}.pj-chip-x:active{background:var(--builder-pressed)}.pj-chip-x svg.i{width:12px;height:12px;stroke-width:1.5}.pj-send{display:grid;place-items:center;flex:none;width:32px;height:32px;padding:0;border:0;border-radius:999px;background:var(--builder-primary);color:var(--builder-on-primary);transition:background-color .15s,color .15s}.pj-send:hover{background:var(--builder-primary-hover)}.pj-send:active{background:var(--builder-primary-pressed)}.pj-send[disabled]{background:var(--builder-hover);color:var(--builder-subtle)}.pj-menu{position:absolute;left:0;top:calc(100% + 6px);z-index:30;width:min(300px,calc(100vw - 32px));padding:6px;border:1px solid var(--builder-popover-edge);border-radius:16px;background:var(--builder-surface);box-shadow:var(--builder-popover-shadow);color:var(--builder-text);font-size:13px;line-height:18px;text-align:left}.pj-menu[hidden]{display:none}.pj-chip-slot{display:contents}.pj-mi{display:flex;align-items:center;gap:10px;width:100%;min-height:36px;padding:6px 10px;border:0;border-radius:9px;background:none;color:var(--builder-text);font:inherit;text-align:left}.pj-mi:hover,.pj-mi:focus-visible{background:var(--builder-hover)}.pj-mi>span{flex:1;min-width:0}.pj-mi svg.i{color:var(--builder-subtle)}.pj-mi .ck{visibility:hidden}.pj-mi[aria-checked=true] .ck{visibility:visible;color:var(--builder-text)}.pj-ib:focus-visible,.pj-send:focus-visible,.pj-chip-x:focus-visible{outline:2px solid var(--builder-focus);outline-offset:2px}@media(prefers-reduced-motion:reduce){.pj-ask,.pj-ib,.pj-send{transition:none}}.pj-free{margin:10px 2px 0;font-size:13px;color:var(--builder-subtle)}.pj-starts{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}.pj-start{display:inline-flex;align-items:center;justify-content:center;gap:6px;height:32px;padding:0 12px;border:0;border-radius:9px;background:var(--builder-fill);color:var(--builder-text);font-size:13px;line-height:18px;font-weight:500;transition:background-color .15s}.pj-start:hover{background:var(--builder-hover)}.pj-start:active{background:var(--builder-pressed)}.pj-start .i{width:13px;height:13px;color:var(--builder-subtle)}.pj-head{display:flex;align-items:center;gap:10px;margin:28px 0 16px;padding-bottom:14px;border-bottom:1px solid var(--line2)}.pj-head h2{font-size:17px;line-height:24px;font-weight:600;letter-spacing:-.01em}.pj-find{position:relative;display:flex;align-items:center;width:240px;max-width:100%}.pj-find .i{position:absolute;left:10px;width:14px;height:14px;color:var(--muted);pointer-events:none}.pj-find input{width:100%;height:34px;padding:0 10px 0 30px;border:1px solid var(--line);border-radius:9px;background:var(--bg);color:var(--fg);font:inherit;font-size:13px;outline:0}.pj-find input:focus{border-color:color-mix(in srgb,var(--fg) 45%,var(--bg))}.pj-find input::placeholder{color:var(--muted)}.pj-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:28px 22px;list-style:none;margin:0;padding:0}.pj-card{min-width:0}.pj-shot{position:relative;display:block;width:100%;aspect-ratio:16/10;padding:0;border:1px solid var(--line2);border-radius:12px;overflow:hidden;background:var(--fill)}.pj-shot img{width:100%;height:100%;object-fit:cover;object-position:top center}.pj-shot:hover{border-color:var(--line)}.pj-shot:focus-visible,.pj-new:focus-visible,.pj-start:focus-visible{outline:2px solid var(--fg);outline-offset:2px}.pj-new{display:grid;place-items:center;border:1.5px dashed var(--line);background:none;color:var(--fg)}.pj-new:hover{background:var(--fill)}.pj-new .i{width:20px;height:20px}.pj-new-t{display:none}.pj-meta{display:flex;align-items:flex-start;gap:6px;margin-top:10px;min-width:0}.pj-meta div{flex:1;min-width:0}.pj-meta h3{font-size:13.5px;line-height:20px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.pj-meta p{font-size:12px;line-height:18px;color:var(--muted)}.pj-meta .ib{height:28px;min-width:28px;padding:0 6px;color:var(--muted)}.pj-meta .ib:hover{color:var(--fg)}.pj-shot img{opacity:0;transition:opacity .2s ease-out}.pj-shot img.ld{opacity:1}.pj-skel .pj-shot{border-color:transparent}.pj-skel .pj-shot,.pj-skel i{animation:pjpulse 1.8s ease-in-out infinite}.pj-skel i{display:block;border-radius:6px;background:var(--fill)}.pj-skel h3 i{height:12px;margin:4px 0}.pj-skel p i{height:10px;margin:4px 0}.pj-skel .ib{visibility:hidden}@keyframes pjpulse{0%,to{opacity:1}50%{opacity:.55}}@media(prefers-reduced-motion:reduce){.pj-skel .pj-shot,.pj-skel i{animation:none}.pj-shot img{transition:none}}.pj-free[hidden]{display:none}.pj-pager{display:flex;align-items:center;justify-content:center;gap:14px;margin-top:32px}.pj-pager[hidden]{display:none}.pj-pager .btn{height:32px;padding:0 12px 0 8px;font-size:13px}.pj-pager #pj-next{padding:0 8px 0 12px}.pj-page{min-width:92px;text-align:center;font-size:13px;line-height:18px;color:var(--muted);font-variant-numeric:tabular-nums}.pj-none{grid-column:1/-1;display:flex;align-items:center;gap:12px;padding:18px 0;color:var(--muted)}.pj-none .btn{height:32px;font-size:13px}@media(max-width:1100px){.name b{max-width:150px}}@media(max-width:900px){.pj-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.side{width:216px}.chipdock{max-width:calc(100% - 28px);bottom:72px}}@media(max-width:767px){.bar{height:48px;padding:0 6px}.hide-sm{display:none!important}.sep{margin:0 2px}.name b{max-width:130px}.main{flex-direction:column}.side,.side.fold{width:100%;border-right:0;border-bottom:1px solid var(--line2);flex:none}.side .sb-head,.side.fold .sb-head{height:44px;padding:0 6px 0 14px;justify-content:space-between}.side.fold .sb-head h2{display:block}.side:not(.fold) .sb-body{max-height:36vh}.fold-ic{transform:rotate(90deg)}.side.fold .fold-ic{transform:rotate(-90deg)}.row,.ib,.tb,.zb{min-height:44px}.ib{min-width:44px}.tb.dark{min-height:40px}.zoombar{display:none}.chipdock{bottom:12px;max-width:calc(100% - 20px)}.chipdock.idle,.chipdock .h{display:none}.chipdock{padding:8px;gap:14px}.chipdock .c{min-width:0;max-width:100px;padding:0 6px}.chipdock .ask-change{padding:0 8px}.pj-top{padding:0 6px 0 14px}.pj-in{padding:16px 16px 128px}.pj-hello{gap:12px;margin-bottom:16px}.pj-hello h1{font-size:22px;line-height:28px}.pj-ask textarea{min-height:44px}.pj-chip{height:28px;padding-left:10px}.pj-chip-x{width:24px;height:24px}.pj-mi{min-height:44px}.pj-start{min-height:36px}.pj-starts{flex-wrap:nowrap;overflow-x:auto;margin-top:8px;margin-right:-16px;padding:4px 16px 4px 0;scroll-padding-inline:16px;scrollbar-width:none}.pj-start{flex:none}.pj-head{flex-wrap:wrap;margin-top:20px}.pj-find{order:3;width:100%}.pj-find input{height:40px;font-size:16px}.pj-grid{grid-template-columns:1fr;gap:24px}.pj-fresh .pj-new{aspect-ratio:auto;height:56px;display:flex;align-items:center;justify-content:center;gap:8px;font-weight:600}.pj-fresh .pj-new-t{display:inline}.pj-fresh .pj-meta{display:none}.vbar{align-self:stretch;margin:10px 10px 0;max-width:none;flex-wrap:wrap;white-space:normal;padding:8px 8px 8px 12px}.vbar>span{flex:1 1 calc(100% - 30px)}.vbar .zb,.vbar .tb{flex:1}#edit-bar{flex-wrap:nowrap}#edit-bar>span{flex:1 1 auto}#edit-bar .zb{flex:none}.canvas.viewing .board{padding-top:28px}}.pj-ib,.pj-send,.pj-start,.pj-chip-x{position:relative}.pj-ib:after,.pj-send:after,.pj-start:after,.pj-chip-x:after{content:"";position:absolute;left:50%;top:50%;width:100%;height:100%;min-width:44px;min-height:44px;transform:translate(-50%,-50%)}.pj-starts{row-gap:12px}button.pj-shot{overflow:visible}button.pj-shot:after{content:"";position:absolute;inset:-2px}.pj-shot img{display:block;border-radius:11px}.pj-top .tb{min-width:44px}}
</style></head>
<body data-surface="builder"><svg width="0" height="0" style="position:absolute" aria-hidden="true" focusable="false">
  <symbol id="select" viewBox="0 0 16 16"><path d="M2 6V3.5A1.5 1.5 0 013.5 2H6M10 2h2.5A1.5 1.5 0 0114 3.5V6M14 10v2.5a1.5 1.5 0 01-1.5 1.5H10M6 14H3.5A1.5 1.5 0 012 12.5V10"/><path d="M6.5 6.5l5 2-2.2.9-.9 2.2z"/></symbol>
  <symbol id="mark" viewBox="0 0 480 480"><g transform="translate(30.25 0)" fill="currentColor" stroke="none"><path d="M233.9 20H399.5V305L316.7 287L233.9 305V140.88L126.26 158L49.78 140H68.3Z"/><path d="M233.9 20H399.5V305L316.7 287L233.9 305V140.88L126.26 158L49.78 140H68.3Z" transform="translate(419.5 480) rotate(180)"/></g></symbol>
  <symbol id="arrow-up" viewBox="0 0 16 16"><path d="M8 13V3M3.5 7.5L8 3l4.5 4.5"/></symbol>
  <symbol id="arrow-ur" viewBox="0 0 16 16"><path d="M5 11l6-6M6 5h5v5"/></symbol>
  <symbol id="search" viewBox="0 0 16 16"><circle cx="7" cy="7" r="4.5"/><path d="M10.5 10.5L14 14"/></symbol>
  <symbol id="refresh" viewBox="0 0 16 16"><path d="M13.5 8a5.5 5.5 0 11-1.7-4M13.5 2.5v3h-3"/></symbol>
  <symbol id="ext" viewBox="0 0 16 16"><path d="M9 2.5h4.5V7M13.5 2.5L7.5 8.5M12 9.5v3a1 1 0 01-1 1H3.5a1 1 0 01-1-1V5a1 1 0 011-1h3"/></symbol>
  <symbol id="chev-d" viewBox="0 0 16 16"><path d="M4 6l4 4 4-4"/></symbol>
  <symbol id="chev-u" viewBox="0 0 16 16"><path d="M4 10l4-4 4 4"/></symbol>
  <symbol id="chev-l" viewBox="0 0 16 16"><path d="M10 3.5L5.5 8l4.5 4.5"/></symbol>
  <symbol id="chev-r" viewBox="0 0 16 16"><path d="M6 3.5L10.5 8 6 12.5"/></symbol>
  <symbol id="plus" viewBox="0 0 16 16"><path d="M8 3v10M3 8h10"/></symbol>
  <symbol id="minus" viewBox="0 0 16 16"><path d="M3 8h10"/></symbol>
  <symbol id="x" viewBox="0 0 16 16"><path d="M4 4l8 8M12 4l-8 8"/></symbol>
  <symbol id="home" viewBox="0 0 16 16"><path d="M2.5 7.2L8 2.5l5.5 4.7V13a.5.5 0 01-.5.5h-3V9.5H6v4H3a.5.5 0 01-.5-.5z"/></symbol>
  <symbol id="layers" viewBox="0 0 16 16"><path d="M8 2l6 3.2-6 3.2L2 5.2zM2 8.2l6 3.2 6-3.2M2 11l6 3.2 6-3.2"/></symbol>
  <symbol id="grid" viewBox="0 0 16 16"><rect x="2.5" y="2.5" width="4.5" height="4.5" rx="1"/><rect x="9" y="2.5" width="4.5" height="4.5" rx="1"/><rect x="2.5" y="9" width="4.5" height="4.5" rx="1"/><rect x="9" y="9" width="4.5" height="4.5" rx="1"/></symbol>
  <symbol id="play" viewBox="0 0 16 16"><path d="M5 3l7 5-7 5z"/></symbol>
  <symbol id="sparkle" viewBox="0 0 16 16"><path d="M8 2l1.4 3.6L13 7l-3.6 1.4L8 12l-1.4-3.6L3 7l3.6-1.4zM12.5 11.5v3M11 13h3"/></symbol>
  <symbol id="fit" viewBox="0 0 16 16"><path d="M2.5 6V3.5a1 1 0 011-1H6M10 2.5h2.5a1 1 0 011 1V6M13.5 10v2.5a1 1 0 01-1 1H10M6 13.5H3.5a1 1 0 01-1-1V10"/></symbol>
  <symbol id="check" viewBox="0 0 16 16"><path d="M3.5 8.5l3 3 6-7"/></symbol>
  <symbol id="alert" viewBox="0 0 16 16"><circle cx="8" cy="8" r="6"/><path d="M8 5v3.5M8 11h.01"/></symbol>
  <symbol id="info" viewBox="0 0 16 16"><circle cx="8" cy="8" r="6"/><path d="M8 7.5V11M8 5h.01"/></symbol>
  <symbol id="monitor" viewBox="0 0 16 16"><rect x="1.5" y="2.5" width="13" height="9" rx="1.6"/><path d="M5.5 14h5M8 11.5V14"/></symbol>
  <symbol id="phone" viewBox="0 0 16 16"><rect x="4.25" y="1.5" width="7.5" height="13" rx="1.8"/><path d="M7 12.5h2"/></symbol>
  <symbol id="clock" viewBox="0 0 16 16"><circle cx="8" cy="8" r="6"/><path d="M8 4.8V8l2.2 1.4"/></symbol>
  <symbol id="upload" viewBox="0 0 16 16"><path d="M8 10.5V2.5M4.8 5.5L8 2.3l3.2 3.2M2.5 10v2.5a1 1 0 001 1h9a1 1 0 001-1V10"/></symbol>
  <symbol id="download" viewBox="0 0 16 16"><path d="M8 2.5v8M4.8 7.5L8 10.7l3.2-3.2M2.5 10v2.5a1 1 0 001 1h9a1 1 0 001-1V10"/></symbol>
  <symbol id="link" viewBox="0 0 16 16"><path d="M6.8 9.2a2.8 2.8 0 004 0l2.1-2.1a2.8 2.8 0 00-4-4l-.9.9M9.2 6.8a2.8 2.8 0 00-4 0L3.1 8.9a2.8 2.8 0 004 4l.9-.9"/></symbol>
  <symbol id="globe" viewBox="0 0 16 16"><circle cx="8" cy="8" r="6"/><path d="M2 8h12M8 2c1.7 1.7 2.5 3.7 2.5 6S9.7 12.3 8 14M8 2C6.3 3.7 5.5 5.7 5.5 8s.8 4.3 2.5 6"/></symbol>
  <symbol id="branch" viewBox="0 0 16 16"><circle cx="4.5" cy="3.8" r="1.6"/><circle cx="4.5" cy="12.2" r="1.6"/><circle cx="11.5" cy="5.5" r="1.6"/><path d="M4.5 5.4v5.2M11.5 7.1c0 2.4-3.5 2.2-6.4 3.8"/></symbol>
  <symbol id="file" viewBox="0 0 16 16"><path d="M9 1.8H4.5a1 1 0 00-1 1v10.4a1 1 0 001 1h7a1 1 0 001-1V5.3z"/><path d="M9 1.8v3.5h3.5"/></symbol>
  <symbol id="av-business" viewBox="0 0 24 24"><g stroke-width="1.3"><circle cx="12" cy="13.5" r="6.5"/><path d="M9.6 16.2c1.3 1 3.5 1 4.8 0"/><path d="M5.6 12.2c.4-3.6 3-5.7 6.4-5.7 2.6 0 4.9 1.3 5.9 3.6-2.6.3-5-.6-6.7-2.2-.9 1.9-2.9 3.5-5.6 4.3"/><circle cx="9.7" cy="13" r="1.5"/><circle cx="14.3" cy="13" r="1.5"/><path d="M11.2 13h1.6"/></g></symbol>
  <symbol id="av-competitor" viewBox="0 0 24 24"><g stroke-width="1.3"><circle cx="12" cy="13.5" r="6.5"/><path d="M9.6 16.2c1.3 1 3.5 1 4.8 0"/><circle cx="9.7" cy="13" r=".55" fill="currentColor" stroke="none"/><circle cx="14.3" cy="13" r=".55" fill="currentColor" stroke="none"/><path d="M6 11c0-3.2 2.7-5.3 6-5.3s6 2.1 6 5.3"/><path d="M6 11h13.5"/></g></symbol>
  <symbol id="av-design" viewBox="0 0 24 24"><g stroke-width="1.3"><circle cx="12" cy="13.5" r="6.5"/><path d="M9.6 16.2c1.3 1 3.5 1 4.8 0"/><circle cx="9.7" cy="13" r=".55" fill="currentColor" stroke="none"/><circle cx="14.3" cy="13" r=".55" fill="currentColor" stroke="none"/><path d="M5.8 10.4c.2-2.6 3.3-4.4 6.8-4.2 2.9.2 5.2 1.7 5.6 3.6-3.9.9-8.4 1.1-12.4.6Z"/><path d="M12.4 6.2l.6-1.4"/></g></symbol>
  <symbol id="av-memory" viewBox="0 0 24 24"><g stroke-width="1.3"><circle cx="12" cy="13.5" r="6.5"/><path d="M9.6 16.2c1.3 1 3.5 1 4.8 0"/><circle cx="12" cy="4.9" r="1.7"/><path d="M5.7 12.4c.5-3.3 3.1-5.4 6.3-5.4s5.8 2.1 6.3 5.4"/><path d="M8.9 13.2c.5.5 1.1.5 1.6 0M13.5 13.2c.5.5 1.1.5 1.6 0"/></g></symbol>
  <symbol id="av-market" viewBox="0 0 24 24"><g stroke-width="1.3"><circle cx="12" cy="13.5" r="6.5"/><path d="M9.6 16.2c1.3 1 3.5 1 4.8 0"/><circle cx="9.7" cy="13" r=".55" fill="currentColor" stroke="none"/><circle cx="14.3" cy="13" r=".55" fill="currentColor" stroke="none"/><path d="M8.4 6.6V4.8M12 6.6V3M15.6 6.6V5.4"/></g></symbol>
  <symbol id="av-customer" viewBox="0 0 24 24"><g stroke-width="1.3"><circle cx="12" cy="13.5" r="6.5"/><path d="M9.6 16.2c1.3 1 3.5 1 4.8 0"/><circle cx="9.7" cy="13" r=".55" fill="currentColor" stroke="none"/><circle cx="14.3" cy="13" r=".55" fill="currentColor" stroke="none"/><path d="M12 7c-2-1.2-3-2.2-3-3.3 0-.9.7-1.6 1.6-1.6.6 0 1.1.3 1.4.8.3-.5.8-.8 1.4-.8.9 0 1.6.7 1.6 1.6 0 1.1-1 2.1-3 3.3Z"/></g></symbol>
</svg><main id="app" class="lib" aria-live="polite"><div class="boot" role="status" aria-label="Loading"><i class="shim"></i><i class="shim"></i><i class="shim"></i></div></main><p id="feedback" role="status"></p><script>"use strict";(()=>{var Y,m,Ee,Je,H,ke,Pe,Te,oe,z,B,Se,ue,ie,le,Xe,J={},X=[],Ze=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,ee=Array.isArray;function A(e,t){for(var n in t)e[n]=t[n];return e}function ae(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function Ye(e,t,n){var r,i,_,s={};for(_ in t)_=="key"?r=t[_]:_=="ref"?i=t[_]:s[_]=t[_];if(arguments.length>2&&(s.children=arguments.length>3?Y.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(_ in e.defaultProps)s[_]===void 0&&(s[_]=e.defaultProps[_]);return G(e,s,r,i,null)}function G(e,t,n,r,i){var _={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++Ee,__i:-1,__u:0};return i==null&&m.vnode!=null&&m.vnode(_),_}function M(e){return e.children}function Q(e,t){this.props=e,this.context=t}function F(e,t){if(t==null)return e.__?F(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?F(e):null}function et(e){if(e.__P&&e.__d){var t=e.__v,n=t.__e,r=[],i=[],_=A({},t);_.__v=t.__v+1,m.vnode&&m.vnode(_),ce(e.__P,_,t,e.__n,e.__P.namespaceURI,32&t.__u?[n]:null,r,n??F(t),!!(32&t.__u),i),_.__v=t.__v,_.__.__k[_.__i]=_,Me(r,_,i),t.__e=t.__=null,_.__e!=n&&Ne(_)}}function Ne(e){if((e=e.__)!=null&&e.__c!=null)return e.__e=e.__c.base=null,e.__k.some(function(t){if(t!=null&&t.__e!=null)return e.__e=e.__c.base=t.__e}),Ne(e)}function we(e){(!e.__d&&(e.__d=!0)&&H.push(e)&&!Z.__r++||ke!=m.debounceRendering)&&((ke=m.debounceRendering)||Pe)(Z)}function Z(){try{for(var e,t=1;H.length;)H.length>t&&H.sort(Te),e=H.shift(),t=H.length,et(e)}finally{H.length=Z.__r=0}}function Ae(e,t,n,r,i,_,s,u,c,l,a){var o,p,f,v,y,g,d,h=r&&r.__k||X,T=t.length;for(c=tt(n,t,h,c,T),o=0;o<T;o++)(f=n.__k[o])!=null&&(p=f.__i!=-1&&h[f.__i]||J,f.__i=o,g=ce(e,f,p,i,_,s,u,c,l,a),v=f.__e,f.ref&&p.ref!=f.ref&&(p.ref&&fe(p.ref,null,f),a.push(f.ref,f.__c||v,f)),y==null&&v!=null&&(y=v),(d=!!(4&f.__u))||p.__k===f.__k?(c=He(f,c,e,d),d&&p.__e&&(p.__e=null)):typeof f.type=="function"&&g!==void 0?c=g:v&&(c=v.nextSibling),f.__u&=-7);return n.__e=y,c}function tt(e,t,n,r,i){var _,s,u,c,l,a=n.length,o=a,p=0;for(e.__k=new Array(i),_=0;_<i;_++)(s=t[_])!=null&&typeof s!="boolean"&&typeof s!="function"?(typeof s=="string"||typeof s=="number"||typeof s=="bigint"||s.constructor==String?s=e.__k[_]=G(null,s,null,null,null):ee(s)?s=e.__k[_]=G(M,{children:s},null,null,null):s.constructor===void 0&&s.__b>0?s=e.__k[_]=G(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):e.__k[_]=s,c=_+p,s.__=e,s.__b=e.__b+1,u=null,(l=s.__i=nt(s,n,c,o))!=-1&&(o--,(u=n[l])&&(u.__u|=2)),u==null||u.__v==null?(l==-1&&(i>a?p--:i<a&&p++),typeof s.type!="function"&&(s.__u|=4)):l!=c&&(l==c-1?p--:l==c+1?p++:(l>c?p--:p++,s.__u|=4))):e.__k[_]=null;if(o)for(_=0;_<a;_++)(u=n[_])!=null&&(2&u.__u)==0&&(u.__e==r&&(r=F(u)),Le(u,u));return r}function He(e,t,n,r){var i,_;if(typeof e.type=="function"){for(i=e.__k,_=0;i&&_<i.length;_++)i[_]&&(i[_].__=e,t=He(i[_],t,n,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=F(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function nt(e,t,n,r){var i,_,s,u=e.key,c=e.type,l=t[n],a=l!=null&&(2&l.__u)==0;if(l===null&&u==null||a&&u==l.key&&c==l.type)return n;if(r>(a?1:0)){for(i=n-1,_=n+1;i>=0||_<t.length;)if((l=t[s=i>=0?i--:_++])!=null&&(2&l.__u)==0&&u==l.key&&c==l.type)return s}return-1}function xe(e,t,n){t[0]=="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||Ze.test(t)?n:n+"px"}function q(e,t,n,r,i){var _,s;e:if(t=="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof r=="string"&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||xe(e.style,t,"");if(n)for(t in n)r&&n[t]==r[t]||xe(e.style,t,n[t])}else if(t[0]=="o"&&t[1]=="n")_=t!=(t=t.replace(Se,"$1")),s=t.toLowerCase(),t=s in e||t=="onFocusOut"||t=="onFocusIn"?s.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+_]=n,n?r?n[B]=r[B]:(n[B]=ue,e.addEventListener(t,_?le:ie,_)):e.removeEventListener(t,_?le:ie,_);else{if(i=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&n==1?"":n))}}function Ce(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t[z]==null)t[z]=ue++;else if(t[z]<n[B])return;return n(m.event?m.event(t):t)}}}function ce(e,t,n,r,i,_,s,u,c,l){var a,o,p,f,v,y,g,d,h,T,E,C,R,U,$,P=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(c=!!(32&n.__u),_=[u=t.__e=n.__e]),(a=m.__b)&&a(t);e:if(typeof P=="function")try{if(d=t.props,h=P.prototype&&P.prototype.render,T=(a=P.contextType)&&r[a.__c],E=a?T?T.props.value:a.__:r,n.__c?g=(o=t.__c=n.__c).__=o.__E:(h?t.__c=o=new P(d,E):(t.__c=o=new Q(d,E),o.constructor=P,o.render=_t),T&&T.sub(o),o.state||(o.state={}),o.__n=r,p=o.__d=!0,o.__h=[],o._sb=[]),h&&o.__s==null&&(o.__s=o.state),h&&P.getDerivedStateFromProps!=null&&(o.__s==o.state&&(o.__s=A({},o.__s)),A(o.__s,P.getDerivedStateFromProps(d,o.__s))),f=o.props,v=o.state,o.__v=t,p)h&&P.getDerivedStateFromProps==null&&o.componentWillMount!=null&&o.componentWillMount(),h&&o.componentDidMount!=null&&o.__h.push(o.componentDidMount);else{if(h&&P.getDerivedStateFromProps==null&&d!==f&&o.componentWillReceiveProps!=null&&o.componentWillReceiveProps(d,E),t.__v==n.__v||!o.__e&&o.shouldComponentUpdate!=null&&o.shouldComponentUpdate(d,o.__s,E)===!1){t.__v!=n.__v&&(o.props=d,o.state=o.__s,o.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(w){w&&(w.__=t)}),X.push.apply(o.__h,o._sb),o._sb=[],o.__h.length&&s.push(o);break e}o.componentWillUpdate!=null&&o.componentWillUpdate(d,o.__s,E),h&&o.componentDidUpdate!=null&&o.__h.push(function(){o.componentDidUpdate(f,v,y)})}if(o.context=E,o.props=d,o.__P=e,o.__e=!1,C=m.__r,R=0,h)o.state=o.__s,o.__d=!1,C&&C(t),a=o.render(o.props,o.state,o.context),X.push.apply(o.__h,o._sb),o._sb=[];else do o.__d=!1,C&&C(t),a=o.render(o.props,o.state,o.context),o.state=o.__s;while(o.__d&&++R<25);o.state=o.__s,o.getChildContext!=null&&(r=A(A({},r),o.getChildContext())),h&&!p&&o.getSnapshotBeforeUpdate!=null&&(y=o.getSnapshotBeforeUpdate(f,v)),U=a!=null&&a.type===M&&a.key==null?De(a.props.children):a,u=Ae(e,ee(U)?U:[U],t,n,r,i,_,s,u,c,l),o.base=t.__e,t.__u&=-161,o.__h.length&&s.push(o),g&&(o.__E=o.__=null)}catch(w){if(t.__v=null,c||_!=null)if(w.then){for(t.__u|=c?160:128;u&&u.nodeType==8&&u.nextSibling;)u=u.nextSibling;_[_.indexOf(u)]=null,t.__e=u}else{for($=_.length;$--;)ae(_[$]);se(t)}else t.__e=n.__e,t.__k=n.__k,w.then||se(t);m.__e(w,t,n)}else _==null&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):u=t.__e=rt(n.__e,t,n,r,i,_,s,c,l);return(a=m.diffed)&&a(t),128&t.__u?void 0:u}function se(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(se))}function Me(e,t,n){for(var r=0;r<n.length;r++)fe(n[r],n[++r],n[++r]);m.__c&&m.__c(t,e),e.some(function(i){try{e=i.__h,i.__h=[],e.some(function(_){_.call(i)})}catch(_){m.__e(_,i.__v)}})}function De(e){return typeof e!="object"||e==null||e.__b>0?e:ee(e)?e.map(De):A({},e)}function rt(e,t,n,r,i,_,s,u,c){var l,a,o,p,f,v,y,g=n.props||J,d=t.props,h=t.type;if(h=="svg"?i="http://www.w3.org/2000/svg":h=="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),_!=null){for(l=0;l<_.length;l++)if((f=_[l])&&"setAttribute"in f==!!h&&(h?f.localName==h:f.nodeType==3)){e=f,_[l]=null;break}}if(e==null){if(h==null)return document.createTextNode(d);e=document.createElementNS(i,h,d.is&&d),u&&(m.__m&&m.__m(t,_),u=!1),_=null}if(h==null)g===d||u&&e.data==d||(e.data=d);else{if(_=_&&Y.call(e.childNodes),!u&&_!=null)for(g={},l=0;l<e.attributes.length;l++)g[(f=e.attributes[l]).name]=f.value;for(l in g)f=g[l],l=="dangerouslySetInnerHTML"?o=f:l=="children"||l in d||l=="value"&&"defaultValue"in d||l=="checked"&&"defaultChecked"in d||q(e,l,null,f,i);for(l in d)f=d[l],l=="children"?p=f:l=="dangerouslySetInnerHTML"?a=f:l=="value"?v=f:l=="checked"?y=f:u&&typeof f!="function"||g[l]===f||q(e,l,f,g[l],i);if(a)u||o&&(a.__html==o.__html||a.__html==e.innerHTML)||(e.innerHTML=a.__html),t.__k=[];else if(o&&(e.innerHTML=""),Ae(t.type=="template"?e.content:e,ee(p)?p:[p],t,n,r,h=="foreignObject"?"http://www.w3.org/1999/xhtml":i,_,s,_?_[0]:n.__k&&F(n,0),u,c),_!=null)for(l=_.length;l--;)ae(_[l]);u||(l="value",h=="progress"&&v==null?e.removeAttribute("value"):v!=null&&(v!==e[l]||h=="progress"&&!v||h=="option"&&v!=g[l])&&q(e,l,v,g[l],i),l="checked",y!=null&&y!=e[l]&&q(e,l,y,g[l],i))}return e}function fe(e,t,n){try{if(typeof e=="function"){var r=typeof e.__u=="function";r&&e.__u(),r&&t==null||(e.__u=e(t))}else e.current=t}catch(i){m.__e(i,n)}}function Le(e,t,n){var r,i;if(m.unmount&&m.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||fe(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(_){m.__e(_,t)}r.base=r.__P=null}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&Le(r[i],t,n||typeof e.type!="function");n||ae(e.__e),e.__c=e.__=e.__e=void 0}function _t(e,t,n){return this.constructor(e,n)}function pe(e,t,n){var r,i,_,s;t==document&&(t=document.documentElement),m.__&&m.__(e,t),i=(r=typeof n=="function")?null:n&&n.__k||t.__k,_=[],s=[],ce(t,e=(!r&&n||t).__k=Ye(M,null,[e]),i||J,J,t.namespaceURI,!r&&n?[n]:i?null:t.firstChild?Y.call(t.childNodes):null,_,!r&&n?n:i?i.__e:t.firstChild,r,s),Me(_,e,s)}Y=X.slice,m={__e:function(e,t,n,r){for(var i,_,s;t=t.__;)if((i=t.__c)&&!i.__)try{if((_=i.constructor)&&_.getDerivedStateFromError!=null&&(i.setState(_.getDerivedStateFromError(e)),s=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,r||{}),s=i.__d),s)return i.__E=i}catch(u){e=u}throw e}},Ee=0,Je=function(e){return e!=null&&e.constructor===void 0},Q.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=A({},this.state),typeof e=="function"&&(e=e(A({},n),this.props)),e&&A(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),we(this))},Q.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),we(this))},Q.prototype.render=M,H=[],Pe=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Te=function(e,t){return e.__v.__b-t.__v.__b},Z.__r=0,oe=Math.random().toString(8),z="__d"+oe,B="__a"+oe,Se=/(PointerCapture)$|Capture$/i,ue=0,ie=Ce(!1),le=Ce(!0),Xe=0;var I,b,de,Ue,K=0,Ke=[],k=m,We=k.__b,Re=k.__r,$e=k.diffed,Fe=k.__c,Ie=k.unmount,je=k.__;function ne(e,t){k.__h&&k.__h(b,e,K||t),K=0;var n=b.__H||(b.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function D(e){return K=1,ot(Ve,e)}function ot(e,t,n){var r=ne(I++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):Ve(void 0,t),function(u){var c=r.__N?r.__N[0]:r.__[0],l=r.t(c,u);c!==l&&(r.__N=[l,r.__[1]],r.__c.setState({}))}],r.__c=b,!b.__f)){var i=function(u,c,l){if(!r.__c.__H)return!0;var a=r.__c.__H.__.filter(function(p){return p.__c});if(a.every(function(p){return!p.__N}))return!_||_.call(this,u,c,l);var o=r.__c.props!==u;return a.some(function(p){if(p.__N){var f=p.__[0];p.__=p.__N,p.__N=void 0,f!==p.__[0]&&(o=!0)}}),_&&_.call(this,u,c,l)||o};b.__f=!0;var _=b.shouldComponentUpdate,s=b.componentWillUpdate;b.componentWillUpdate=function(u,c,l){if(this.__e){var a=_;_=void 0,i(u,c,l),_=a}s&&s.call(this,u,c,l)},b.shouldComponentUpdate=i}return r.__N||r.__}function W(e,t){var n=ne(I++,3);!k.__s&&ve(n.__H,t)&&(n.__=e,n.u=t,b.__H.__h.push(n))}function he(e,t){var n=ne(I++,4);!k.__s&&ve(n.__H,t)&&(n.__=e,n.u=t,b.__h.push(n))}function L(e){return K=5,Oe(function(){return{current:e}},[])}function Oe(e,t){var n=ne(I++,7);return ve(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function re(e,t){return K=8,Oe(function(){return e},t)}function it(){for(var e;e=Ke.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(te),t.__h.some(me),t.__h=[]}catch(n){t.__h=[],k.__e(n,e.__v)}}}k.__b=function(e){b=null,We&&We(e)},k.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),je&&je(e,t)},k.__r=function(e){Re&&Re(e),I=0;var t=(b=e.__c).__H;t&&(de===b?(t.__h=[],b.__h=[],t.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(t.__h.some(te),t.__h.some(me),t.__h=[],I=0)),de=b},k.diffed=function(e){$e&&$e(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Ke.push(t)!==1&&Ue===k.requestAnimationFrame||((Ue=k.requestAnimationFrame)||lt)(it)),t.__H.__.some(function(n){n.u&&(n.__H=n.u),n.u=void 0})),de=b=null},k.__c=function(e,t){t.some(function(n){try{n.__h.some(te),n.__h=n.__h.filter(function(r){return!r.__||me(r)})}catch(r){t.some(function(i){i.__h&&(i.__h=[])}),t=[],k.__e(r,n.__v)}}),Fe&&Fe(e,t)},k.unmount=function(e){Ie&&Ie(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(r){try{te(r)}catch(i){t=i}}),n.__H=void 0,t&&k.__e(t,n.__v))};var Be=typeof requestAnimationFrame=="function";function lt(e){var t,n=function(){clearTimeout(r),Be&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);Be&&(t=requestAnimationFrame(n))}function te(e){var t=b,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),b=t}function me(e){var t=b;e.__c=e.__(),b=t}function ve(e,t){return!e||e.length!==t.length||t.some(function(n,r){return n!==e[r]})}function Ve(e,t){return typeof t=="function"?t(e):t}var qe=e=>e();function ze(e){return{render:t=>pe(t,e),unmount:()=>pe(null,e)}}function Ge(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Ge(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function O(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Ge(e))&&(r&&(r+=" "),r+=t);return r}var st=0;function x(e,t,n,r,i,_){t||(t={});var s,u,c=t;if("ref"in c)for(u in c={},t)u=="ref"?s=t[u]:c[u]=t[u];var l={type:e,props:c,key:n,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--st,__i:-1,__u:0,__source:i,__self:_};if(typeof e=="function"&&(s=e.defaultProps))for(u in s)c[u]===void 0&&(c[u]=s[u]);return m.vnode&&m.vnode(l),l}function Qe({label:e,price:t,confirmable:n,consentKey:r="",confirmClassName:i,onAction:_,onUnavailableAction:s,confirmWindowMs:u=5e3,expiryMessage:c="",sameGestureMs:l=250,className:a,disabled:o,"aria-label":p,...f}){let v=o||!n&&!s,y=`${r}
${e}
${t}`,[g,d]=D(null),[h,T]=D(null),E=L(null),C=L(null),R=L(null),U=L(null),$=L(null),P=L(null),w=n&&!v&&g===y,V=`Confirm \xB7 ${t}`,j=n&&h===y?c:"",N=re(()=>{E.current=null,C.current!==null&&clearTimeout(C.current),C.current=null,d(null)},[]),ye=re(()=>{N(),T(y)},[N,y]);W(()=>{if(!j)return;let S=setTimeout(()=>T(null),5e3);return()=>clearTimeout(S)},[j]),he(()=>{n&&(R.current?.style.setProperty("--pill-normal-width",`${U.current?.getBoundingClientRect().width??0}px`),R.current?.style.setProperty("--pill-confirm-width",`${$.current?.getBoundingClientRect().width??0}px`))},[n,e,V]),W(()=>{g!==null&&(!n||v||g!==y)&&N()},[y,n,v,g,N]),W(()=>{if(!w)return;let S=_e=>{_e.key==="Escape"&&N()},be=_e=>{P.current?.contains(_e.target)||N()};return document.addEventListener("keydown",S),document.addEventListener("pointerdown",be),()=>{document.removeEventListener("keydown",S),document.removeEventListener("pointerdown",be),C.current!==null&&clearTimeout(C.current),E.current=null}},[w,y,N]);let ge=x("button",{...f,ref:P,type:"button",disabled:v,"data-confirming":w?"":void 0,"aria-label":w?V:p,"aria-describedby":w?void 0:f["aria-describedby"],onBlur:N,onKeyDown:S=>{S.repeat&&(S.key==="Enter"||S.key===" ")&&S.preventDefault()},onClick:()=>{if(!v){if(!n){s?.();return}if(E.current?.key===y){let S=performance.now()-E.current.armedAt;if(S<l)return;if(S<u){N(),_();return}ye();return}T(null),E.current={key:y,armedAt:performance.now()},d(y),C.current!==null&&clearTimeout(C.current),C.current=setTimeout(ye,u)}},className:O(a,w&&i,n&&"col-start-1 row-start-1 justify-self-start whitespace-nowrap transition-none motion-safe:transition-[width] motion-safe:duration-150"),style:n?{width:w?"var(--pill-confirm-width, max-content)":"var(--pill-normal-width, max-content)"}:void 0,children:w?V:e});return n?x("span",{ref:R,className:"relative inline-grid shrink-0",children:[x("span",{"aria-hidden":"true",className:"pointer-events-none invisible absolute left-0 top-0 h-0 w-0 overflow-hidden",children:[x("span",{ref:U,className:O(a,"absolute left-0 top-0 w-max whitespace-nowrap"),children:e}),x("span",{ref:$,className:O(a,"absolute left-0 top-0 w-max whitespace-nowrap"),children:V})]}),ge,x("span",{className:"sr-only","aria-live":"polite","aria-atomic":"true",children:w?`Confirm, ${t}`:j}),j&&x("span",{"data-confirm-expiry":"","aria-hidden":"true",className:"col-start-1 row-start-2 mt-1 max-w-56 whitespace-normal text-xs leading-4 text-[color:var(--builder-subtle)]",children:j})]}):ge}var ut=12e3,at=400;function ct({quote:e,confirm:t,expired:n}){let[r,i]=D(!1),[_,s]=D(""),[u,c]=D(()=>e.expiresAt<=Date.now());W(()=>{let a=setTimeout(()=>{c(!0),n()},Math.max(0,e.expiresAt-Date.now()));return()=>clearTimeout(a)},[e,n]);let l=`${e.credits} credit${e.credits===1?"":"s"}`;return x(M,{children:[x(Qe,{label:`${r==="approval"?"Waiting for approval":r?"Starting\u2026":e.label} \xB7 ${l}`,price:l,consentKey:e.quoteId,confirmable:!u&&!r,confirmWindowMs:ut,sameGestureMs:at,disabled:u||!!r,className:"paid-pill",confirmClassName:"paid-pill-armed",onAction:()=>{s(""),i("starting"),Promise.resolve().then(t).then(a=>i(a==="approval"?"approval":!1),a=>{s(a instanceof Error?a.message:"This action could not start. Check its status in chat before retrying."),i(!1)})}}),_&&x("p",{className:"paid-error",role:"alert",children:_})]})}window.iter0PaidConfirm={mount(e,t,n,r){let i=ze(e);return qe(()=>i.render(x(ct,{quote:t,confirm:n,expired:r}))),()=>i.unmount()}};})();

"use strict";(()=>{var a=["https://iter0.com/extensions/build-wait-doc.11294ce0d82e.js","https://iter0.com/extensions/build-wait-doc.js"];var u='<div class="bw-layer" aria-hidden="true"><p class="bw-l-h"><i></i>Building your website</p><div class="bw-l-c"><span class="bw-l-a"></span><div><b>Launch CEO</b><span class="bw-l-stage">Reading your brief</span></div></div><div class="bw-l-p"><b>Your page</b><s class="h"></s><s style="width:62%"></s><s style="width:78%"></s><s style="width:54%"></s></div></div>',l=null;function w(){let i=window;return typeof i.iter0BuildWaitDocument=="string"?Promise.resolve(i.iter0BuildWaitDocument):(l??=new Promise((d,e)=>{let r=[...a],s=()=>{let o=r.shift();if(!o){l=null,e(new Error("build wait document unavailable"));return}let t=document.createElement("script");t.src=o,t.async=!0,t.onload=()=>typeof i.iter0BuildWaitDocument=="string"?d(i.iter0BuildWaitDocument):s(),t.onerror=()=>{t.remove(),s()},document.head.appendChild(t)};s()}),l)}function b(i,d){let e=document.createElement("iframe");e.title="Website build progress",e.setAttribute("sandbox","allow-scripts"),e.setAttribute("data-build-wait",""),e.style.cssText="position:absolute;inset:0;display:block;width:100%;height:100%;border:0;visibility:hidden";let r=d,s=!0,o=n=>{r=n,e.contentWindow?.postMessage({type:"iter0-build-wait",payload:r},"*")},t=n=>{n.source!==e.contentWindow||n.data?.type!=="iter0-build-wait-ready"||(e.style.visibility="visible",i.querySelector(".bw-layer")?.remove(),o(r))};return window.addEventListener("message",t),i.innerHTML=u,i.append(e),w().then(n=>{s&&(e.srcdoc=n)},()=>{}),{feed:o,destroy(){s=!1,window.removeEventListener("message",t),e.remove()}}}Object.assign(window,{iter0MountBuildWait:b});})();

(()=>{const Pe=document.body.dataset.surface;let be=Pe==="builder";const y=()=>be,I=document.getElementById("app"),L=document.getElementById("feedback"),ti=L.parentElement,D=new Map;let A="starting",Ke=!1,en=!1;const Qe=1440,O=390,Xe=1280,ni=900,tn=844;let X=null,vt=0,s={},b={},u=null,P=null,B,M=!1,It=!1,de=null,Z=null,ee=null,x=null,j=null,U=null,N=null,_e=null,Ae=!1,Ze={designId:null,text:""},te=!1,k=null,Be=null,nn=null,ne=!1,et=!1,Me=0;const $t=[],le=new Map,ce=new Map,sn=new WeakMap,kt=new Set,tt=new Set;let an=null;const W=window.openai?.widgetState;let Y=W&&!W.modelContent&&W.structuredContent&&typeof W.structuredContent=="object"?{...W,modelContent:{...W.structuredContent,message:(Array.isArray(W.content)?W.content:[]).map(e=>e?.text||"").join(`
`)}}:W||{};function Et(e){Y={...Y,...e,...e.privateContent?{privateContent:{...Y.privateContent,...e.privateContent}}:{}},window.openai?.setWidgetState?.(Y)}const rn=Y.privateContent;let qe=rn?.version===1?rn:null;function on(){y()&&Et({privateContent:{version:1,designId:s.design?.designId??null,device:Z,pageView:ee,versionView:x,selected:P,sideFold:X,zoom:de,researchOpen:_e}})}function ii(){if(!qe||!s.design)return;const e=qe;qe=null,e.designId===s.design.designId&&(Z=["phone","desktop"].includes(e.device)?e.device:null,ee=s.pages?.some(t=>t.pageId===e.pageView)?e.pageView:null,x=s.versions?.some(t=>t.versionId===e.versionView&&!t.current)?e.versionView:null,P=!x&&s.sections?.some(t=>t.sectionId===e.selected)?e.selected:null,X=typeof e.sideFold=="boolean"?e.sideFold:null,de=typeof e.zoom=="number"&&Number.isFinite(e.zoom)?Math.max(.1,Math.min(1.5,e.zoom)):null,_e=typeof e.researchOpen=="boolean"?e.researchOpen:null)}const l=e=>String(e??"").replace(/[&<>"']/g,t=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[t]),dn=(e,t)=>{const n={...e};return typeof t?.currentHtml=="string"&&typeof n.currentHtml!="string"&&(n.currentHtml=t.currentHtml),typeof t?.html=="string"&&typeof n.html!="string"&&(n.html=t.html),n},ue=e=>!!e?.html||e?.edited===!0,ln=(e,t)=>{if(A==="compatibility"){e==="ui/notifications/size-changed"&&window.openai?.notifyIntrinsicHeight?.(t.height);return}window.parent.postMessage({jsonrpc:"2.0",method:e,params:t},"*")};function q(e,t,n){if(M)return Promise.reject(new Error("This view has closed."));const i=e==="tools/call"&&t.arguments?.quoteOnly!==!0&&["iter0_confirm_paid_action","iter0_create_site","iter0_edit_site","iter0_show_three"].includes(t.name),a=n||(i?9e5:2e4);if(A==="compatibility"){const r=window.openai;if(e==="tools/call"&&r?.callTool)return new Promise((o,c)=>{const h=setTimeout(()=>c(new Error("ChatGPT did not respond. Try again.")),a);Promise.resolve().then(()=>r.callTool(t.name,t.arguments)).then(o,f=>{const m=new Error(f?.message||"ChatGPT could not complete this request.");m.hostRefusal=!0,c(m)}).finally(()=>clearTimeout(h))});if(e==="tools/call"){const o=new Error("ChatGPT cannot call this tool from the card.");return o.hostRefusal=!0,Promise.reject(o)}return e==="ui/message"&&r?.sendFollowUpMessage?Promise.resolve().then(()=>r.sendFollowUpMessage({prompt:t.content.map(o=>o.text||"").join(`
`)})).then(o=>o||{}):e==="ui/open-link"&&r?.openExternal?Promise.resolve().then(()=>r.openExternal({href:t.url})).then(o=>o||{}):e==="ui/request-display-mode"&&r?.requestDisplayMode?Promise.resolve().then(()=>r.requestDisplayMode({mode:t.mode})):e==="ui/update-model-context"&&(r?.setWidgetState||Ke)?(r?.setWidgetState&&Et({modelContent:{...t.structuredContent,message:(t.content||[]).map(o=>o.text||"").join(`
`)}}),Ke&&window.parent.postMessage({jsonrpc:"2.0",id:++vt,method:e,params:t},"*"),Promise.resolve({})):Promise.reject(new Error("This control is unavailable here. Continue in chat."))}return new Promise((r,o)=>{if(M)return o(new Error("This view has closed."));const c=++vt,h=setTimeout(()=>{D.delete(c),o(new Error("ChatGPT did not respond. Try again."))},a);D.set(c,{resolve:r,reject:o,timeout:h}),window.parent.postMessage({jsonrpc:"2.0",id:c,method:e,params:t},"*")})}async function we(e){const t=await q("ui/message",{role:"user",content:[{type:"text",text:e}]});if(t.isError)throw new Error("ChatGPT could not complete this request. Try again.");return t}let xt=!1;function si(e){try{const t=(e.searchParams.get("t")||e.searchParams.get("token")||"").split(".")[0],n=JSON.parse(atob(t.replace(/-/g,"+").replace(/_/g,"/")));return(typeof n.e=="number"?n.e:n.expires*1e3)<Date.now()+6e4}catch{return!1}}function $(e,t=!1){try{const n=new URL(e);return n.origin!=="https://iter0.com"||n.username||n.password?"":t&&si(n)?(xt=!0,""):(t?n.pathname==="/api/mcp/preview"||n.pathname==="/api/mcp/direction-image":n.pathname==="/build"||n.pathname==="/delivery")?n.href:""}catch{return""}}const p=(e,t="")=>`<svg class="i ${t}" aria-hidden="true"><use href="#${e}"/></svg>`;function ai(e,t){const n=$(e,!0);return n?`<div class="thumb"><img src="${l(n)}" alt="Preview of ${l(t)}"></div>`:'<div class="thumb shim"></div>'}const T=(e,t,n="",{ghost:i=!1,glyph:a=""}={})=>`<button class="btn${i?" ghost":""}" data-action="${e}" data-value="${l(n)}">${a?p(a):""}${l(t)}</button>`;let cn,Re="builder-bar";function un(){const e=document.getElementById(Re)||document.getElementById("builder-bar");if(e?e.insertAdjacentElement?.("afterend",L):y()?I.appendChild?.(L):ti?.appendChild?.(L),Re==="add-page-row"&&L.textContent&&L.parentElement===e?.parentElement){const t=e.parentElement,i=t.getBoundingClientRect().top+t.clientTop,a=i+t.clientHeight,r=e.getBoundingClientRect(),o=L.getBoundingClientRect();o.bottom>a?t.scrollTop+=o.bottom-a:r.top<i&&(t.scrollTop+=r.top-i)}}function v(e,t="builder-bar",n=!1){L.textContent=e,clearTimeout(cn),Re=t,un(),y()&&e&&!n&&(cn=setTimeout(()=>{L.textContent=""},4e3))}function H(e){v(e instanceof Error?e.message:"This action is unavailable. Try again.",Re,!!s.batchId)}function Tt(e){return e.content?.find(t=>t.type==="text"&&typeof t.text=="string"&&t.text.trim())?.text||"This request is unavailable. Check the response in chat or try again."}async function pe(e,t){const n=await q("tools/call",{name:e,arguments:t,_meta:{"iter0/card":!0}}),i=n?.mcp_tool_result||n?.call_tool_result||n;if(!i||e==="iter0_confirm_paid_action"&&!i.isError&&!i.structuredContent?.runId&&!i.structuredContent?.batchId&&!ue(i.structuredContent)){const a=new Error("ChatGPT has not started this action.");throw a.hostRefusal=!0,a}if(i.isError){const a=new Error(i.structuredContent?.code==="out_of_credits"?"Not enough credits for this.":i.structuredContent?.code==="invalid_quote"?"This confirmation has expired or is unavailable. Ask for this action again.":Tt(i));a.code=i.structuredContent?.code,a.signedOut=!!i._meta?.["mcp/www_authenticate"]||/^Sign in to your iter0 account/.test(Tt(i));const r=i.structuredContent?.status;throw typeof r=="string"&&r!=="running"&&(a.final=i.structuredContent),a}if(!i._meta?.paidAction&&i.structuredContent?.confirmation?.quoteId){const a=window.openai?.toolResponseMetadata,r=a?.mcp_tool_result?._meta||a?.call_tool_result?._meta||a;if(r?.paidAction?.quoteId===i.structuredContent.confirmation.quoteId)return{...i,_meta:{...i._meta,...r}}}return i}async function R(e,t){const n=await pe(e,t);return dn(n.structuredContent||{},n._meta)}function ye(){document.documentElement.dataset.theme=b.theme==="dark"?"dark":"light",document.documentElement.dataset.mode=b.displayMode||"inline",J&&J.feed({...s,theme:b.theme==="dark"?"dark":"light"}),Object.entries(b.styles?.variables||{}).forEach(([e,t])=>{/^--[a-z0-9-]+$/i.test(e)&&typeof t=="string"&&document.documentElement.style.setProperty(e,t)})}let Ct=!1;const ve=e=>e?.polishing===!0&&e.polishIncomplete!==!0;let C="",Ie=0,nt="",it="",pn=0;const jt=()=>!C&&(s.status==="running"||s.status==="done"&&ve(s)&&!!s.runId&&!s.batchId),ri=18e5;function st(e){C=e,clearTimeout(B),B=null,g()}async function Ne(e=""){if(M||Ct||!(e||jt()))return;const t=s,n=t.batchId||t.runId;n!==it&&(it=n,pn=Date.now()),Ct=!0;let i,a;try{i=t.batchId?await R("iter0_get_design_set_status",{batchId:t.batchId}):await R("iter0_get_site_status",e==="manual"?{runId:t.runId}:{runId:t.runId,waitCursor:We})}catch(r){a=r}Ct=!1,s===t&&!M&&(a?a.signedOut?st("signin"):a.final?F({...t.batchId?{batchId:t.batchId}:{runId:t.runId},...a.final}):(++Ie>=3||e==="manual")&&(nt=a.message,H(a)):(Ie=0,nt&&L.textContent===nt&&v("",Re),nt="",i.status==="disconnected"?st("signin"):F(i)),jt()&&Math.max(Date.now()-pn,(s.progress?.elapsedSeconds||0)*1e3)>ri&&st("stale")),B||ie()}function ie(e=!1){if(M||!jt()){clearTimeout(B),B=null;return}if(e&&!Ie){clearTimeout(B),B=null,Ne();return}B||(B=setTimeout(()=>{B=null,Ne()},Math.max(s.runId&&!s.batchId&&s.status==="running"?1e3:5e3,[0,2e3,5e3,15e3][Math.min(Ie,3)])))}const Le=e=>{const t=new Date(e);return Number.isNaN(t.getTime())?"":t.toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})},hn=e=>{const t=new Date(e);return Number.isNaN(t.getTime())?"":t.toLocaleString(void 0,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})},St=(e,t)=>`${e} ${t}${e===1?"":t.endsWith("h")?"es":"s"}`,Pt={running:"Still working. This view checks progress every few seconds.",stopped:"Check the response in chat for recovery and refund details."};function oi(e){const t=String(e).replace(/^www\./,"");return`<span class="mono" title="${l(t)}">${l((t.match(/[a-z0-9]/i)||["?"])[0].toUpperCase())}</span>`}const _t=(e,t,n=!0)=>e?.length?`<span class="hosts" aria-hidden="true">${e.slice(0,t).map(oi).join("")}${n&&e.length>t?`<em>+${e.length-t}</em>`:""}</span>`:"";function di(e){const t=[];return e.sources&&t.push(`read ${St(e.sources,"source")}`),e.searches&&t.push(`ran ${St(e.searches,"search")}`),t.join(" \xB7 ")}function At(e){if(!e||!Array.isArray(e.researchers)||!e.researchers.length)return"";const t=e.status==="running",n=_e??t,i=di(e),a=[...new Set(e.researchers.flatMap(c=>c.hosts||[]))],r=e.status==="stopped"?"Research stopped":e.status==="failed"?"Research couldn't finish":"Research finished",o=t?"Your CEO is researching":`${r}${i?` \xB7 ${i}`:""}`;return`<section class="rt${n?" open":""}" aria-label="Research team"><button class="rt-h" data-action="research" aria-expanded="${n}">${_t(a,3,!1)}<span class="rt-t">${l(o)}</span>${p(n?"chev-d":"chev-r")}</button>${n?`<div class="rt-b">${t&&i?`<div class="rt-p">${_t(a,4)}<span>${l(i[0].toUpperCase()+i.slice(1))} so far</span></div>`:""}<ul>${e.researchers.map(c=>`<li class="rt-r"><span class="av">${p(`av-${c.id}`)}</span><span class="rt-n"><b>${l(c.name)}</b><span>${l(c.activity||(c.state==="working"?"Working\u2026":c.state==="reported"?"Reported":"Waiting"))}</span></span>${_t(c.hosts,3)}</li>`).join("")}</ul></div>`:""}</section>`}function li(){const e=At(s.research);s.status==="done"?(I.innerHTML=`<div class="head"><div><h1>Three directions</h1><p>Pick one to build.</p></div></div>${e}<div class="set" role="list">${(s.directions||[]).map((t,n)=>`<article class="card" role="listitem">${ai(t.screenshotUrl||t.previewImageUrl,t.title).replace(/<\/div>$/,`<span class="tag">Design ${"ABC"[n]||n+1}</span><button class="zoom" data-action="zoom" aria-expanded="false" aria-label="See Design ${"ABC"[n]||n+1} larger">${p("fit")}</button></div>`)}<div class="body"><h2 class="name">${l(t.title)}</h2><div id="paid-build-${n}" class="paid-action">${T("build","Build this direction",t.directionId)}</div><div id="paid-build-${n}-requote" class="requote"></div></div></article>`).join("")}</div>`,window.iter0PaidConfirm&&Zi(s)):s.status==="running"?I.innerHTML=`<div class="head"><div><h1>Working on three designs</h1><p>${Pt.running}</p></div><span class="status warn">Working</span></div>${e}<div class="set" aria-hidden="true">${[0,1,2].map(()=>'<article class="card skel"><div class="thumb"><div class="shim"></div></div><div class="body"><div class="ln shim" style="width:60%"></div><div class="ln shim" style="height:36px;border-radius:999px"></div></div></article>').join("")}</div><div class="foot">${T("refresh","Check progress","",{ghost:!0,glyph:"refresh"})}</div>`:I.innerHTML=`<section class="msg"><span class="ic bad">${p("alert")}</span><div><h1>The designs stopped</h1><p>${Pt.stopped}</p></div>${T("refresh","Check progress","",{ghost:!0})}</section>`}function ci(){if(s.status==="running"){!J||Yt!==s.runId?(J?.destroy(),Yt=s.runId,We=0,I.innerHTML=`<section class="build-wait-host" aria-label="Building your website"></section><div class="build-wait-footer"><p class="bw-status" id="bw-status" aria-hidden="true"></p><span class="sr-only" id="bw-phase" aria-live="polite"></span>${T("refresh","Check progress","",{ghost:!0,glyph:"refresh"})}</div>`,J=window.iter0MountBuildWait(I.firstElementChild,{...s,theme:b.theme==="dark"?"dark":"light"})):J.feed({...s,theme:b.theme==="dark"?"dark":"light"});const h=document.getElementById("bw-status"),f=document.getElementById("bw-phase"),m=I.querySelector?.(".bw-l-stage");h&&(h.textContent=at(s)),m&&(m.textContent=at(s,!1)),f&&f.textContent!==at(s,!1)&&(f.textContent=at(s,!1)),Number.isSafeInteger(s.buildWait?.cursor)&&(We=Math.max(We,s.buildWait.cursor));return}const e=s.status==="running",t=s.status==="done",n=t&&!!(s.designId||$(s.url)),i=e?["warn","Building"]:n?["ok","Ready"]:t?["warn","Finishing"]:["bad","Stopped"],a=`<span class="status ${i[0]}">${i[1]}</span>`;if(!e&&!t){const h={refunded:"Your credit was refunded.",pending:"Your refund is pending.",not_charged:"No credit was charged.",uncertain:"Your credit charge is still being checked."}[s.refundState]||Pt.stopped;I.innerHTML=`<section class="bs"><div class="top"><div><h1>Your website</h1></div>${a}</div><div class="fail"><span class="ic">${p("alert")}</span><div><h2>The build stopped</h2><p>${l(h)}</p>${T("refresh","Check progress","",{ghost:!0})}</div></div></section>`;return}const r=t?$(s.previewImageUrl,!0):"",o=t&&s.designId?T("open-builder","Open the builder",s.designId):"",c=t&&$(s.url)?T("open","Open in iter0",s.url,{ghost:!0,glyph:"ext"}):"";gn({title:n&&ve(s)?"Polishing your website":n?"Your site is ready":"Your site is still being finished",chip:a,sub:n&&ve(s)?"It's ready to open. The last fixes land by themselves.":n?"A draft only you can see until you publish.":"It can't be opened yet. Check again in a moment.",image:r,alt:"Preview of your website",actions:`${o}${c||T("refresh","Check progress","",{ghost:!0})}`,after:s.research?`<div class="bs-rt">${At(s.research)}</div>`:""})}function at(e,t=!0){const n=Number.isSafeInteger(e.progress?.elapsedSeconds)?e.progress.elapsedSeconds:null,i=e.progress?.stage,a=i==="checking"?"Your page is written. Now checking and fixing it":i==="saving"?"Saving your page":n===null?"Starting your build":"Building your website";return n===null||!t?a:`${a} \xB7 ${Math.floor(n/60)}m ${n%60}s`}function gn({title:e,sub:t,chip:n="",image:i,alt:a,actions:r,after:o=""}){I.innerHTML=`<section class="bs done cmp"><div class="cmp-row"><div class="shot cmp-shot">${Bt}${i?`<img src="${l(i)}" alt="${l(a)}">`:""}</div><div class="cmp-tx"><div class="cmp-h"><h1>${l(e)}</h1>${n}</div><p>${l(t)}</p><div class="acts">${r}</div></div></div>${o}</section>`,fn()}const ui=()=>b.displayMode==="fullscreen";function pi(){const e=s.design;if(e){const n=_?.designId===e.designId?_:null,i=n&&!n.undone&&n.undoToken?T("undo-edit",n.busy?"Undoing\u2026":"Undo","",{ghost:!0}):"",a=$(e.url)?T("open","Open in iter0",e.url,{ghost:!0,glyph:"ext"}):"";gn({title:e.name||"Your website",image:$(n?.image||e.previewImageUrl,!0),alt:`Preview of ${e.name||"your website"}`,sub:n?n.undone?"Edit undone. Your page is back to how it was.":"Edit saved to your page.":`Saved design${Le(e.updatedAt)?` \xB7 edited ${Le(e.updatedAt)}`:""}`,actions:`${T("expand","Open the builder")}${i}${a}`});return}const t=(Array.isArray(s.designs)?s.designs:u?.designs||[]).slice(0,3);I.innerHTML='<section class="bs done cmp"><div class="cmp-tx cmp-list"><div class="cmp-h"><h1>Your iter0 projects</h1></div>'+(t.length?`<ul>${t.map(n=>`<li><span class="cmp-mini">${$(n.previewImageUrl,!0)?`<img src="${l($(n.previewImageUrl,!0))}" alt="">`:""}</span><span><b>${l(n.name)}</b><span>Edited ${l(Le(n.updatedAt))}</span></span></li>`).join("")}</ul>`:`<p>${Array.isArray(s.designs)?"No designs yet. Describe your website in the chat to start one.":"Loading your projects\u2026"}</p>`)+`<div class="acts">${T("expand","Open your projects")}${T("open","Open in iter0","https://iter0.com/build?pane=projects",{ghost:!0,glyph:"ext"})}</div></div></section>`}function fn(){const e=I.querySelector?.(".shot img");if(e){const t=()=>e.classList.add("ld");e.complete&&e.naturalWidth?t():e.addEventListener("load",t)}}const Bt='<div class="wire" aria-hidden="true"><div class="nav"><i class="shim" style="width:18%;height:12px"></i><i class="shim" style="width:34%"></i></div><i class="shim" style="width:62%;height:26px"></i><i class="shim" style="width:42%;height:26px"></i><i class="shim" style="width:50%;height:10px;margin-top:6px"></i><div class="cards"><i class="shim"></i><i class="shim"></i><i class="shim"></i></div></div>';let _=null,Mt=!1,qt=null;function hi(e){y()||e?.name!=="iter0_edit_site"||q("ui/request-display-mode",{mode:"fullscreen"}).then(t=>{t?.mode==="fullscreen"&&(b.displayMode="fullscreen",Mt=!0,ye(),mn())}).catch(()=>{})}function mn(){const e=bn()?s.saved===!0:s.status==="done";!Mt||y()||b.displayMode!=="fullscreen"||!s.designId||!e||(Mt=!1,be=!0,Q(s.designId).catch(t=>{be=Pe==="builder",g(),H(t)}))}function gi(e){if(_?.designId!==e.designId)return"";const t=_.undone?"":`<button class="zb" data-action="undo-edit">${_.busy?"Undoing\u2026":"Undo"}</button>`;return`<div class="vbar" id="edit-bar" role="status">${p("check")}<span>${_.undone?"Edit undone. Your page is back to how it was.":"Edit saved to your page."}</span>${t}</div>`}function bn(){return s.edited===!0||typeof s.html=="string"&&typeof s.saved=="boolean"}function fi(){const e=_&&s.undoToken&&_.undoToken===s.undoToken?_:{busy:!1,undone:!1,image:""},t=s.saved===!0,n=e.undone,i=t?n?'<span class="status warn">Undone</span>':'<span class="status ok">Saved</span>':'<span class="status warn">Not saved</span>',a=t?n?"Edit undone":"Edit saved":"Edit ready",r=t?n?"Your page is back to how it was before this edit":"Your page now has this change":s.saveNote||"The edit is ready in chat.",o=t?$(e.image||s.previewImageUrl,!0):"",c=t&&!n&&s.undoToken?T("undo-edit",e.busy?"Undoing\u2026":"Undo","",{ghost:!0}):"",h=t?`${Bt}${o?`<img src="${l(o)}" alt="Preview of your page">`:""}`:`${Bt}${typeof s.html=="string"?`<iframe class="draft" sandbox="" title="The edited page, not saved" srcdoc="${l(s.html)}"></iframe>`:""}`;I.innerHTML=`<section class="bs done"><div class="top"><div><h1>${a}</h1><p>${l(r)}</p></div>${i}</div><div class="pv"><div class="frame"><div class="chrome"><b></b><b></b><b></b><span>${t?"iter0.com":"Edited page \xB7 not saved"}</span></div><div class="shot">${h}</div></div></div><div class="res"><p>${t?"A draft only you can see until you publish.":"Scroll the preview to see the whole edit. Your saved page is unchanged."}</p><div class="acts">${c}${T("open-builder",t?"Open the builder":"Open your saved page",s.designId)}</div></div></section>`;const f=I.querySelector("iframe.draft");if(f){const m=f.parentElement,E=m.clientWidth/Qe;f.style.transform=`scale(${E})`,f.style.height=`${Math.ceil(m.clientHeight/E)}px`}fn()}async function mi(){const e=_;if(!(!e||e.busy||e.undone)){e.busy=!0,g();try{const t=await R("iter0_undo_edit",{designId:e.designId,undoToken:e.undoToken});e.undone=!0,e.image=t.previewImageUrl||"",q("ui/update-model-context",{structuredContent:{designId:e.designId,editUndone:!0},content:[{type:"text",text:"The person undid the last edit. The design is back to the page from before that edit."}]}).catch(()=>{}),y()&&s.design?.designId===e.designId&&await Q(e.designId)}finally{e.busy=!1,g()}}}const se=6,d={draft:"",mode:"",plus:!1,search:"",loading:!1,page:0,seq:0};let z=null,$e="",Rt=null,Nt=null;const rt=new Map,Lt=new Map,Oe={show3:{label:"Show 3 designs",glyph:"sparkle"},build:{label:"Build one site",glyph:"layers"}},bi=["A caf\xE9 or restaurant","A trades business","A clinic or studio","A product launch"];function wn(){const e=u?.firstName;return u?.designs?.length&&!d.search?e?`Let's sharpen your website, ${e}`:"Let's sharpen your website":e?`What are we building, ${e}?`:"What are we building?"}const wi=["We build an AI tool that answers support tickets. Sharpen my pitch.","Here is my site. What would a stranger skip?","Show me three designs for my SaaS launch.","Add a Features page in the same style."],yi=["Sharpen my AI support tool pitch.","What would strangers skip on my site?","Show three designs for my SaaS.","Add a Features page in this style."],S={timer:0,index:0,length:0,erasing:!1};function yn(){clearTimeout(S.timer);const e=document.getElementById("pj-draft");if(!e)return;const t=window.matchMedia?.("(max-width: 639px)").matches?yi:wi,n=()=>document.activeElement!==e&&!e.value;if(window.matchMedia?.("(prefers-reduced-motion: reduce)").matches){n()&&(e.placeholder=t[0]);return}const i=()=>{const a=document.getElementById("pj-draft");if(!a)return;if(document.activeElement===a||a.value){a.placeholder="Describe your website or product";return}const r=t[S.index%t.length];let o;S.erasing?S.length>1?(S.length--,o=18):(S.length=0,S.erasing=!1,S.index=(S.index+1)%t.length,o=350):(S.length=Math.min(S.length+1,r.length),S.erasing=S.length>=r.length,o=S.erasing?1700:45),a.placeholder=r.slice(0,S.length),S.timer=setTimeout(i,o)};n()&&(S.timer=setTimeout(i,S.length?45:900))}const vn=e=>{const t=new Date(e).getTime();if(Number.isNaN(t))return"";const n=Math.round((Date.now()-t)/6e4),i=new Intl.RelativeTimeFormat(void 0,{numeric:"auto"});return Math.abs(n)<60?i.format(-Math.max(1,n),"minute"):Math.abs(n)<1440?i.format(-Math.round(n/60),"hour"):Math.abs(n)<1440*30?i.format(-Math.round(n/1440),"day"):Le(e)};function vi(e){const t=$(e.previewImageUrl,!0);return`<li class="pj-card"><button class="pj-shot" data-action="design" data-value="${l(e.designId)}" aria-label="Open ${l(e.name)}">${t?`<img src="${l(t)}" alt="" loading="lazy" decoding="async">`:""}</button><div class="pj-meta"><div><h3 title="${l(e.name)}">${l(e.name)}</h3><p>Edited ${l(vn(e.updatedAt))}</p></div><button class="ib" data-action="show3again" data-value="${l(e.designId)}" aria-label="Show 3 new designs like ${l(e.name)}" title="Show 3 new designs like this">${p("sparkle")}</button></div></li>`}const Ii='<li class="pj-card pj-skel" aria-hidden="true"><div class="pj-shot"></div><div class="pj-meta"><div><h3><i style="width:62%"></i></h3><p><i style="width:38%"></i></p></div><span class="ib" aria-hidden="true"></span></div></li>',$i=`<li class="pj-card pj-fresh"><button class="pj-shot pj-new" data-action="new-site" aria-label="New website">${p("plus")}<span class="pj-new-t" aria-hidden="true">New website</span></button><div class="pj-meta"><div><h3>New website</h3><p>Describe it above</p></div></div></li>`;function ot(e){const t=document.createElement("template");return t.innerHTML=e,[...t.content.children]}function In(){return Rt||(Rt=ot($i)[0]),Rt}function ki(){return Nt?.query!==d.search&&(Nt={query:d.search,node:ot(`<li class="pj-none" role="status"><span>No projects match \u201C${l(d.search)}\u201D.</span>${T("clear-search","Clear search","",{ghost:!0})}</li>`)[0]}),Nt.node}function Ei(e){const t=$(e.previewImageUrl,!0),n=`${e.name}${e.updatedAt}${t?"picture":"none"}`;let i=rt.get(e.designId);if(i?.sig!==n)i={sig:n,src:t,node:ot(vi(e))[0]},rt.set(e.designId,i);else if(i.src!==t){const o=i.node.querySelector?.(".pj-shot img");o&&(o.src=t),i.src=t}const a=i.node.querySelector?.(".pj-meta p"),r=`Edited ${vn(e.updatedAt)}`;return a&&a.textContent!==r&&(a.textContent=r),i.node}function $n(){const e=new Set((u?.designs||[]).map(t=>t.designId));for(const t of[...rt.keys()])e.has(t)||rt.delete(t)}function xi(e){return Lt.has(e)||Lt.set(e,Array.from({length:e},()=>ot(Ii)[0])),Lt.get(e)}const Ue=()=>d.search?se:se-1,Ot=e=>e===0?0:Ue()+(e-1)*se,dt=e=>Ot(e)+(e===0?Ue():se),kn=e=>e<=Ue()?1:1+Math.ceil((e-Ue())/se),ke=()=>u?.designs||[],he=e=>!u?.nextCursor||ke().length>=dt(e);function Ti(){let e=d.page;for(;e>0&&!he(e);)e--;return e}function Ci(){return u?u.nextCursor?Number.isInteger(u.total)?Math.max(kn(u.total),d.page+2):null:kn(ke().length):null}const En=()=>!d.loading&&d.page>0,Ut=()=>!d.loading&&!!u&&he(d.page)&&(ke().length>dt(d.page)||!!u.nextCursor);function ji(e){const t=ke().slice(Ot(e),dt(e));return!t.length&&d.search?[ki()]:[...e===0&&!d.search?[In()]:[],...t.map(Ei)]}function Si(e){const t=!d.loading&&Number.isInteger(u?.total)?Math.max(1,u.total-Ot(e)):1/0;return[...e===0&&!d.search?[In()]:[],...xi(Math.min(e===0?Ue():se,t))]}function Pi(e,t){for(t.forEach((n,i)=>{e.children[i]!==n&&e.insertBefore(n,e.children[i]||null)});e.children.length>t.length;)e.lastElementChild.remove()}function ae(){const e=document.getElementById("pj-grid");if(!e)return;const t=!u||d.loading||!he(d.page);e.setAttribute?.("aria-busy",String(t)),Pi(e,t?Si(d.page):ji(d.page)),e.querySelectorAll?.(".pj-shot img").forEach(n=>{n.complete&&n.naturalWidth&&n.classList.add("ld")}),_i(),Ni()}function _i(){const e=document.getElementById("pj-pager");if(!e)return;const t=Ci(),n=t?`Page ${d.page+1} of ${t}`:`Page ${d.page+1}`;e.hidden=!u||d.loading||t===1;const i=document.getElementById("pj-page"),a=document.getElementById("pj-prev"),r=document.getElementById("pj-next");i&&i.textContent!==n&&(i.textContent=n),a&&(a.disabled=!En()),r&&(r.disabled=!Ut())}function Ai(){if(Array.isArray(s.designs)&&s!==u&&qi(s),document.getElementById("pj")){Bi(),ae();return}const e=document.activeElement?.id,t=e==="pj-draft"||e==="pj-search"?[document.activeElement.selectionStart,document.activeElement.selectionEnd]:null;if(I.innerHTML=`<header class="bar pj-top" id="builder-bar"><div class="pj-crumb"><svg class="i pj-logo" aria-hidden="true"><use href="#mark"/></svg><span>iter0</span>${p("chev-r")}<b>Projects</b></div><span class="spacer"></span><button class="tb" data-action="open" data-value="https://iter0.com/build?pane=projects" aria-label="Open iter0 in a new tab">${p("ext")}<span class="hide-sm">Open iter0</span></button></header>
<div class="pj" id="pj"><div class="pj-in"><div class="pj-hello"><h1 id="pj-title">${l(wn())}</h1></div>
<div class="pj-ask" id="pj-ask" data-composer=""><textarea id="pj-draft" rows="1" maxlength="2000" aria-label="Describe your website" placeholder="Describe your website or product">${l(d.draft)}</textarea><div class="pj-tools" data-composer-toolbar=""><span class="pj-plus"><button class="pj-ib" id="pj-plus" data-action="plus" aria-label="Add and more tools" aria-haspopup="menu" aria-expanded="${d.plus}" aria-controls="pj-menu">${p("plus")}</button><div class="pj-menu" id="pj-menu" role="menu" aria-label="Add and more tools"${d.plus?"":" hidden"}>${Object.entries(Oe).map(([n,i])=>`<button class="pj-mi" role="menuitemradio" data-action="pick" data-value="${n}" aria-checked="${d.mode===n}">${p(i.glyph)}<span>${i.label}</span><svg class="i ck" aria-hidden="true"><use href="#check"/></svg></button>`).join("")}</div></span><span id="pj-chip" class="pj-chip-slot">${Sn()}</span><span class="spacer"></span><button class="pj-send" id="pj-send" data-action="send" aria-label="${d.mode?`${Oe[d.mode].label}: send to ChatGPT`:"Send to ChatGPT"}"${d.draft.trim()?"":" disabled"}>${p("arrow-up")}</button></div></div>
<p class="pj-free" id="pj-free"${u?.firstSiteFree?"":" hidden"}>Your first site is free.</p><div class="pj-starts">${bi.map(n=>`<button class="pj-start" data-action="starter" data-value="${l(n)}">${l(n)}${p("arrow-ur")}</button>`).join("")}</div>
<div class="pj-head" id="pj-head"><h2>Your projects</h2><span class="spacer"></span><label class="pj-find"><span class="sr-only">Search projects</span>${p("search")}<input id="pj-search" type="search" maxlength="80" autocomplete="off" placeholder="Search projects\u2026" value="${l(d.search)}"></label><button class="ib" data-action="refresh" aria-label="Refresh projects">${p("refresh")}</button></div>
<ul class="pj-grid" id="pj-grid" aria-label="Your projects"></ul>
<nav class="pj-pager" id="pj-pager" aria-label="Projects pages" hidden><button class="btn ghost" id="pj-prev" data-action="page-prev" aria-label="Previous page" disabled>${p("chev-l")}Previous</button><span class="pj-page" id="pj-page" role="status"></span><button class="btn ghost" id="pj-next" data-action="page-next" aria-label="Next page" disabled>Next${p("chev-r")}</button></nav></div></div>`,ae(),t){const n=document.getElementById(e),i=n?.value.length??0;n?.focus(),n?.setSelectionRange?.(Math.min(t[0]??i,i),Math.min(t[1]??i,i))}document.getElementById("pj-draft")?.addEventListener("blur",yn),yn()}function Bi(){const e=document.getElementById("pj-title"),t=wn();e&&e.textContent!==t&&(e.textContent=t);const n=document.getElementById("pj-free");n&&(n.hidden=!u?.firstSiteFree);const i=document.getElementById("pj-search");i&&document.activeElement!==i&&i.value!==d.search&&(i.value=d.search)}let xn="";const Mi=(e,t)=>e.slice(0,t.length).every((n,i)=>n.designId===t[i].designId);function qi(e){const t=JSON.stringify(e);if(u&&t===xn){s=u;return}xn=t;const n=ke(),i=e.designs,a=e.query||"",r=!!u&&!d.loading&&a===d.search&&Mi(n,i),o=Number.isInteger(e.total)&&Number.isInteger(u?.total)&&e.total!==u.total;if(r&&i.length>0&&i.length<n.length&&e.nextCursor&&!o){u={...u,firstName:e.firstName,firstSiteFree:e.firstSiteFree,creditBalance:e.creditBalance,...Number.isInteger(e.total)?{total:e.total}:{},designs:n.map((f,m)=>i[m]||f)},s=u;return}const c=r&&i.length>=n.length,h=c&&(e.nextCursor??null)===(u.nextCursor??null);u=e,d.search=a,d.loading=!1,h||(d.seq++,z=null,$e=""),c||(d.page=0),$n()}function Ri(){if(z)return z.done;const e=u?.nextCursor;if(!e||d.loading)return Promise.resolve(!1);const t=d.seq,n=d.search,i={done:null};return z=i,i.done=(async()=>{try{const a=await R("iter0_list_my_designs",{cursor:e,limit:se,...n?{query:n}:{}});if(t!==d.seq)return!1;if(!Array.isArray(a.designs))throw new Error("The next page could not be loaded. Try again.");const r=new Set(u.designs.map(o=>o.designId));return Tn({...u,designs:[...u.designs,...a.designs.filter(o=>!r.has(o.designId))],nextCursor:a.nextCursor??null}),$e="",!0}catch(a){if(t!==d.seq)return!1;throw $e=e,a}finally{z===i&&(z=null)}})(),i.done}function Tn(e){u=e,Array.isArray(s.designs)&&(s=u)}function Ni(){!u||d.loading||z||!u.nextCursor||$e===u.nextCursor||he(d.page)&&ke().length>=dt(d.page+1)||Ri().then(()=>ae(),()=>{!he(d.page)&&document.getElementById("pj-grid")&&(d.page=Ti(),v("The next page could not be loaded. Try again.")),ae()})}function Li(){const e=document.getElementById("pj-head"),t=e?.getBoundingClientRect?.();t&&t.top<0&&e.scrollIntoView?.({block:"start"})}async function Cn(e){!u||d.loading||e<0||e===d.page||e>d.page&&!Ut()||(he(e)||($e=""),d.page=e,ae(),Li(),z&&!he(e)&&await z.done.catch(()=>{}))}function Oi(e){const t=e.disabled?document.getElementById(e.id==="pj-next"?"pj-prev":"pj-next"):e;t&&!t.disabled&&document.activeElement!==t&&t.focus?.({preventScroll:!0})}async function Ui(e){const t=++d.seq,n=()=>t===d.seq;let i;try{i=await R("iter0_list_my_designs",e)}catch(a){return{current:n(),error:a}}return{current:n(),next:Array.isArray(i.designs)?i:null}}let jn=null;async function lt(e){d.search=e.trim().slice(0,80),d.loading=!0,d.page=0,z=null,$e="",ae();const t=await Ui({...d.search?{query:d.search}:{},limit:se});if(t.current){if(d.loading=!1,t.error)throw ae(),t.error;if(t.next){const n=u?{firstName:u.firstName,creditBalance:u.creditBalance,firstSiteFree:u.firstSiteFree,pageSize:u.pageSize}:{};Tn({...n,...t.next}),$n()}ae()}}function Sn(){const e=Oe[d.mode];return e?`<span class="pj-chip" data-composer-inline-chip="${d.mode}"><span>${e.label}</span><button class="pj-chip-x" data-action="clear-mode" aria-label="Remove ${e.label}">${p("x")}</button></span>`:""}function ct(e){d.plus=e;const t=document.getElementById("pj-menu"),n=document.getElementById("pj-plus");t&&(t.hidden=!e),n?.setAttribute?.("aria-expanded",String(e))}function Pn(e){d.mode=Oe[e]?e:"";const t=document.getElementById("pj-chip");t&&(t.innerHTML=Sn()),document.querySelectorAll?.(".pj-mi").forEach(i=>i.setAttribute("aria-checked",String(i.dataset.value===d.mode))),document.getElementById("pj-send")?.setAttribute?.("aria-label",d.mode?`${Oe[d.mode].label}: send to ChatGPT`:"Send to ChatGPT")}async function Hi(){const e=d.draft.trim();if(!e)return;const t=d.mode==="build"?`Build a website for this: ${e}
Quote the credit price and check with me before starting.`:d.mode==="show3"?`Show me three website designs for this: ${e}
Check my brief with me and quote the credit price before starting.`:`${e}
This is for a website on iter0. Check my brief with me and quote any credit price before starting anything.`,n=d.draft;if(await we(t),d.draft===n){d.draft="";const i=document.getElementById("pj-draft");i&&(i.value="");const a=document.getElementById("pj-send");a&&(a.disabled=!0)}v("Sent to ChatGPT. It replies in the chat.")}const He=()=>s.pages?.length?s.pages:[{pageId:"home",title:"Home",route:"/"}],Ee=()=>s.versions?.length?[...s.versions].sort((e,t)=>t.number-e.number):[{versionId:"current",number:1,createdAt:s.design?.updatedAt,current:!0}],Di=()=>Ee().find(e=>e.current)||Ee()[0],_n=()=>!!window.matchMedia?.("(max-width:767px)").matches,xe=new Set,re=new Map,Te=new Map,An=new Set,Ht=()=>x?Ee().find(e=>e.versionId===x):null,Bn=()=>{const e=ee&&ee!==He()[0].pageId?He().find(t=>t.pageId===ee):null;return e?.previewImageUrl?e:null},Dt=()=>!Ht()&&!Bn()&&!!$(s.design?.phonePreviewImageUrl,!0),De=()=>Z==="phone"&&Dt()?"phone":"desktop",ze=()=>`${s.design?.designId}:${De()}`;function Ce(){const e=s.design,t=Ht(),n=Bn(),i=(a,r,o)=>{const c=$(a,!0),h=Te.get(c);let f=c;if(c&&h){const m=new URL(c);m.searchParams.set("retry",String(h)),f=m.href}return{src:f,base:c,width:r,full:o}};return t&&!t.current?i(t.previewImageUrl,Xe,!1):n?i(n.previewImageUrl,Xe,!1):De()==="phone"?i(e.phonePreviewImageUrl,O,!0):xe.has(ze())?i(e.previewImageUrl,Xe,!1):e.pagePreviewImageUrl?i(e.pagePreviewImageUrl,Qe,!0):i(e.previewImageUrl,Xe,!1)}function zi(e){const t=e.width===O,n=re.get(e.src);return n==="loaded"?"":n==="failed"?`<div class="pv-state failed" id="pv-state" role="status"><span>${t?"Phone preview":"Preview"} didn't load</span>${T("retry-preview","Try again")}</div>`:`<div class="pv-state" id="pv-state" role="status" aria-live="polite"><span class="pv-dot" aria-hidden="true"></span><span>Loading ${t?"phone preview":"preview"}\u2026</span></div>`}function Gi(){if(!s.design||De()!=="desktop"||!Dt()||typeof Image!="function"||typeof navigator<"u"&&navigator.connection?.saveData)return;const e=$(s.design.phonePreviewImageUrl,!0);!e||An.has(e)||re.has(e)||(An.add(e),new Image().src=e)}function Mn(){const e=s.design;if(j==="versions"){const t=Ee(),n=t.length===1;return`<div class="menu" role="menu" id="menu-versions"><div class="mh"><b>Versions</b><span>${St(t.length,"version")}</span></div><div class="mlist">${t.map(i=>{const a=x?x===i.versionId:!!i.current;return`<button class="mrow${a?" on":""}" role="menuitemradio" aria-checked="${a}" data-action="version" data-value="${l(i.versionId)}"><span class="vn">v${l(i.number)}</span><span class="mt"><b>${l(i.note||(i.current?"Saved design":`Version ${i.number}`))}</b><span>${l(hn(i.createdAt))}${i.current?" \xB7 Current":""}</span></span>${a?p("check"):""}</button>`}).join("")}</div>${n?'<p class="mnote">Earlier versions appear here after each change you make in ChatGPT.</p>':'<p class="mnote">Pick a version to review it. Restoring always checks with you first.</p>'}</div>`}if(j==="publish"){const t=String(e.url??""),n=i=>l(`${t}${t.includes("?")?"&":"?"}task=${i}`);return`<div class="menu wide" role="menu" id="menu-publish"><div class="mh"><b>Publish</b><span>Finishes in iter0</span></div>
<button class="mrow" role="menuitem" data-action="open" data-value="${n("share")}">${p("link")}<span class="mt"><b>Share a preview link</b><span>Anyone with the link can view this design</span></span>${p("ext","mx")}</button>
<button class="mrow" role="menuitem" data-action="open" data-value="${n("domain")}">${p("globe")}<span class="mt"><b>Put it on your domain</b><span>Connect a domain and go live</span></span>${p("ext","mx")}</button>
<button class="mrow" role="menuitem" data-action="open" data-value="https://iter0.com/delivery">${p("branch")}<span class="mt"><b>Send to GitHub</b><span>Connect a repository for a PR preview</span></span>${p("ext","mx")}</button>
<div class="msep"></div>
<button class="mrow" role="menuitem" data-action="open" data-value="${n("download")}">${p("download")}<span class="mt"><b>Download HTML</b><span>Export the page from iter0</span></span>${p("ext","mx")}</button></div>`}return""}function ut(){return Ze.designId===s.design?.designId?Ze.text:""}function zt(){Ae=!1,Ze={designId:null,text:""},g(),document.getElementById("add-page-row")?.focus()}function Fi(){const e=s.design,t=s.sections||[],n=u?.designs||[];X===null&&(X=_n());const i=Ht(),a=Dt();Z===null&&a&&(Z=_n()?"phone":"desktop");const r=De(),o=He(),c=ee||o[0].pageId,h=!i&&t.find(w=>w.sectionId===P),f=Di(),m=Ce(),E=w=>$(w.previewImageUrl,!0)?`<img src="${l($(w.previewImageUrl,!0))}" alt="">`:"",Zt=`<div class="seg" role="radiogroup" aria-label="Preview size"><button id="dev-desktop" class="sg" role="radio" aria-checked="${r==="desktop"}" data-action="device" data-value="desktop" aria-label="Desktop preview" title="Desktop">${p("monitor")}</button><button id="dev-phone" class="sg" role="radio" aria-checked="${r==="phone"}" data-action="device" data-value="phone" aria-label="Phone preview" title="${a?"Phone":"Phone preview is not ready for this design"}"${a?"":" disabled"}>${p("phone")}</button></div>`,Je=i&&!i.current?`<div class="vbar" id="version-bar" role="status">${p("clock")}<span>${m.src?"Viewing":"Selected"} version ${l(i.number)}${i.createdAt?` \xB7 ${l(hn(i.createdAt))}`:""}</span><button class="zb" data-action="version" data-value="${l(f.versionId)}">Back to current</button><button class="tb dark sm" data-action="restore" data-value="${l(i.versionId)}">Restore this version</button></div>`:"",me=document.activeElement?.id==="add-page-input",ei=me?[document.activeElement.selectionStart,document.activeElement.selectionEnd]:null;if(I.innerHTML=`<header class="bar" id="builder-bar"><button class="tb fill" data-action="library" aria-label="Projects">${p("chev-l")}<span class="hide-sm">Projects</span></button><span class="sep hide-sm"></span><div class="name"><b>${l(e.name)}</b><span class="st hide-sm">Saved</span></div><span class="spacer"></span>${Zt}<span class="mwrap"><button id="opener-versions" class="tb${j==="versions"?" on":""}" data-action="menu" data-value="versions" aria-haspopup="menu" aria-expanded="${j==="versions"}" aria-label="Versions">${p("clock")}<span class="hide-sm">Version ${l((i||f).number)}</span>${p("chev-d","hide-sm")}</button>${j==="versions"?Mn():""}</span><button class="ib hide-sm" data-action="refresh" aria-label="Refresh preview">${p("refresh")}</button><button class="ib hide-sm" data-action="open" data-value="${l(e.url)}" aria-label="Open in iter0">${p("ext")}</button><span class="mwrap"><button id="opener-publish" class="tb dark" data-action="menu" data-value="publish" aria-haspopup="menu" aria-expanded="${j==="publish"}" aria-label="Publish">${p("upload")}<span class="hide-sm">Publish</span></button>${j==="publish"?Mn():""}</span></header>
<div class="main"><aside class="side${X?" fold":""}" id="side" aria-label="Pages and sections"><div class="sb-head" id="pages-bar"><h2>Pages</h2><button class="ib" data-action="side" aria-label="Show or hide the sidebar" aria-expanded="${!X}">${p("chev-l","fold-ic")}</button></div><div class="sb-body">${s.research?`<div class="sb-rt">${At(s.research)}</div>`:""}${o.map((w,Se)=>`<button class="row" data-action="page" data-value="${l(w.pageId)}"${w.pageId===c?' aria-current="true"':""}>${p(Se===0?"home":"file")}<span class="t">${l(w.title)}</span><span class="p">${l(w.route)}</span></button>`).join("")}
${Ae?`<div class="addpg" id="add-page-row" data-form="add-page"><label for="add-page-input">What is the new page for?</label><input id="add-page-input" name="purpose" maxlength="240" autocomplete="off" placeholder="e.g. Pricing, with 3 plans and FAQs" value="${l(ut())}"><div class="addpg-acts"><button type="button" class="tb" data-action="add-page-cancel">Cancel</button><button type="button" class="tb dark" id="add-page-submit" data-action="add-page-send"${ut().trim()&&!te?"":" disabled"}>${te?"Sending\u2026":"Add page"}</button></div></div>`:`<button class="row add" id="add-page-row" data-action="add-page" title="Describe a new page and ChatGPT adds it">${p("plus")}<span class="t">Add a page</span></button>`}
<div class="lbl"><span>Sections</span><span>${t.length}</span></div>${t.length?t.map(w=>`<button class="row" aria-pressed="${!i&&P===w.sectionId}" data-action="section" data-value="${l(w.sectionId)}"${i?" disabled":P===w.sectionId?' aria-current="true"':""}>${p("select")}<span class="t">${l(w.label||"Section")}</span></button>`).join(""):'<p class="lbl">No sections found</p>'}
${n.length?`<div class="lbl"><span>Projects</span><span>${n.length}</span></div>${n.map(w=>`<button class="dir" data-action="design" data-value="${l(w.designId)}"${w.designId===e.designId?' aria-current="true"':""}><span class="im">${E(w)}</span><span class="tx"><b>${l(w.name)}</b><span>${w.designId===e.designId?"Open now":`Updated ${l(Le(w.updatedAt))}`}</span></span></button>`).join("")}`:""}</div>
<div class="side-foot"><button class="tb fill" data-action="show3" data-value="">${p("sparkle")}<span>Show me 3 new designs</span></button></div></aside>
<section class="canvas${i&&!i.current?" viewing":""}" id="canvas" aria-label="Design preview">${Je||(i?"":gi(e))}<div class="scroller" id="scroller"><div class="board" id="board"><div class="fr${m.width===O?" phone":""}" id="preview-frame"><div class="fl"><span class="pl">${p(m.width===O?"phone":"monitor")}</span><span class="fn">${l(o.find(w=>w.pageId===c)?.title||e.name)}</span><span class="sub">${i&&!i.current?`Version ${l(i.number)}`:m.width===O?"Phone 390":`Desktop ${m.width}`}</span></div><div class="fb" id="preview-box"><div class="in" id="preview-image">${m.src?`${re.get(m.src)==="failed"?"":`<img id="preview-img" src="${l(m.src)}" alt="Preview of ${l(e.name)}">`}${zi(m)}`:`<p class="preview-unavailable" role="status">${i?`Preview unavailable for version ${l(i.number)}`:"Preview unavailable"}</p>`}<div class="hl hover" id="hl-hover" hidden></div><div class="hl" id="hl-sel" hidden><span class="hl-tag" id="hl-tag"></span></div></div></div></div></div></div>
${i?"":h?`<div class="chipdock"><span class="c">${p("select")}<span>${l(h.label||"Section")}</span></span><button class="tb ask-change" data-action="ask-change" aria-label="Ask ChatGPT to change this">Ask ChatGPT<span class="hide-sm"> to change this</span></button><button class="zb x" data-action="unselect" aria-label="Clear the selected section">${p("x")}</button></div>`:`<div class="chipdock idle">${p("select")}<span class="h" id="idle-hint">${On()}</span></div>`}
<div class="zoombar"><div class="pill zoom" aria-label="Zoom"><button class="zb" data-action="zoom-out" aria-label="Zoom out">${p("minus")}</button><span id="zoom-value"></span><button class="zb" data-action="zoom-in" aria-label="Zoom in">${p("plus")}</button></div><div class="pill fit"><button class="zb" data-action="fit" title="Fit the page to the screen">${p("fit")}<span>Fit</span></button></div></div></section></div>`,me){const w=document.getElementById("add-page-input"),Se=w?.value.length??0;w?.focus(),w?.setSelectionRange?.(Math.min(ei[0]??Se,Se),Math.min(ei[1]??Se,Se))}document.getElementById("preview-img")?.addEventListener("load",()=>{K(),G()}),K(),Nn().then(()=>G()),P!==null&&!i&&Fe()}const je=new Map,pt=new Map;let ht={html:null,hash:""};function Wi(e){if(ht.html===e)return ht.hash;let t=3735928559,n=1103547991;for(let i=0;i<e.length;i++){const a=e.charCodeAt(i);t=Math.imul(t^a,2654435761),n=Math.imul(n^a,1597334677)}return t=Math.imul(t^t>>>16,2246822507)^Math.imul(n^n>>>13,3266489909),n=Math.imul(n^n>>>16,2246822507)^Math.imul(t^t>>>13,3266489909),ht={html:e,hash:(n>>>0).toString(16).padStart(8,"0")+(t>>>0).toString(16).padStart(8,"0")},ht.hash}const qn=()=>De()==="phone"?O:Qe,Rn=()=>{const e=Ln();return`${s.design?.designId}:${qn()}:${e.length}:${Wi(e)}`};function Nn(){const e=Rn(),t=qn(),n=Ln();if(je.has(e))return U=je.get(e),Promise.resolve();if(U=null,!n||typeof document.createElement!="function")return Promise.resolve();if(pt.has(e))return pt.get(e);let i=!1;const a=new Promise(r=>{const o=document.createElement("iframe");o.setAttribute("sandbox","allow-same-origin"),o.setAttribute("aria-hidden","true"),o.tabIndex=-1,o.style.cssText=`position:fixed;left:-20000px;top:0;width:${t}px;height:${t===O?tn:ni}px;border:0;visibility:hidden;pointer-events:none`;const c=f=>{i=!0,pt.delete(e),f&&(je.set(e,f),je.size>24&&je.delete(je.keys().next().value)),e===Rn()&&(U=f),o.remove(),r()},h=setTimeout(()=>c(null),4e3);o.addEventListener("load",()=>{clearTimeout(h);try{const f=o.contentDocument,m=f.documentElement.scrollHeight,E=Array.from(f.querySelectorAll("header,section,footer")).filter(Je=>!Je.parentElement?.closest("header,section,footer")).slice(0,50),Zt=E.length?E:[f.body];c({height:m,rects:Zt.map(Je=>{const me=Je.getBoundingClientRect();return{x:me.left,y:me.top+o.contentWindow.scrollY,w:me.width,h:me.height}})})}catch{c(null)}}),o.srcdoc=n.replace(/<script\b[\s\S]*?<\/script>/gi,""),document.body.appendChild(o)});return i||pt.set(e,a),a}const V=new Map;let gt=null;const Ge=()=>`${s.design?.designId}:${s.design?.updatedAt}`,Ln=()=>typeof s.currentHtml=="string"?s.currentHtml:V.get(Ge())?.html||"",Yi=()=>y()&&!!s.design&&!x&&typeof s.currentHtml!="string"&&!!s.sections?.length;function On(){const e=typeof s.currentHtml=="string"?null:V.get(Ge());return e&&(e.state==="none"||e.state==="failed")?"Pick a section in the list, then describe the change in ChatGPT.":"Click a section on the page, then describe the change in ChatGPT."}function Fe(){if(!Yi())return Promise.resolve();const e=Ge(),t=V.get(e);if(t)return t.task||Promise.resolve();const n=s.design.designId,i={state:"loading"};return V.set(e,i),V.size>8&&V.delete(V.keys().next().value),document.getElementById("preview-image")?.setAttribute?.("aria-busy","true"),i.task=(async()=>{try{const r=await pe("iter0_design_layout",{designId:n}),o=r._meta?.layoutHtml;r.structuredContent?.layout==="ready"&&typeof o=="string"&&o?Object.assign(i,{state:"ready",html:o}):i.state="none"}catch{i.state="failed"}if(e!==Ge()||(i.state==="ready"&&await Nn(),e!==Ge()))return;document.getElementById("preview-image")?.removeAttribute?.("aria-busy");const a=document.getElementById("idle-hint");if(a&&(a.textContent=On()),i.state==="ready"){if(gt&&!x){const r=Ft(gt);N=r>=0?r:null}G()}})(),i.task}function Gt(e,t){if(xe.has(ze())&&Ce().src===$(s.design?.previewImageUrl,!0))return null;const n=U?.rects?.[e];if(!n)return null;const i=U.height?t/U.height:1;return{x:n.x,y:n.y*i,w:n.w,h:n.h*i}}function Un(e,t){if(e){if(!t){e.hidden=!0;return}Object.assign(e.style,{left:`${t.x}px`,top:`${t.y}px`,width:`${t.w}px`,height:`${t.h}px`}),e.hidden=!1}}function G(e=!1){if(!s.design||!document.getElementById("hl-sel"))return;const t=s.sections||[],n=Wt(),i=t.findIndex(o=>o.sectionId===P),a=i>=0&&!x?Gt(i,n.height):null;Un(document.getElementById("hl-sel"),a&&a.y<n.height?a:null),document.getElementById("hl-tag").textContent=i>=0?t[i].label||"Section":"";const r=!x&&N!==null&&N!==i?Gt(N,n.height):null;if(Un(document.getElementById("hl-hover"),r&&r.y<n.height?r:null),e&&a){const o=document.getElementById("scroller"),c=K();o?.scrollTo?.({top:Math.max(0,a.y*c-40),behavior:"smooth"})}}function Ft(e){const t=document.getElementById("preview-image");if(!t||!U)return-1;const n=Wt(),i=t.getBoundingClientRect(),a=i.width/n.width,r=(e.clientX-i.left)/a,o=(e.clientY-i.top)/a;let c=-1,h=1/0;return(s.sections||[]).forEach((f,m)=>{const E=Gt(m,n.height);E&&r>=E.x&&r<=E.x+E.w&&o>=E.y&&o<=E.y+E.h&&E.w*E.h<h&&(c=m,h=E.w*E.h)}),c}function Wt(){const e=document.getElementById("preview-img"),t=s.design?Ce():{width:Qe,full:!1},n=t.width;return t.full&&e?.naturalWidth?{width:n,height:Math.round(e.naturalHeight*n/e.naturalWidth)}:{width:n,height:n===O?tn:800}}const Vi={iter0_create_site:["Build your website","A finished page you can edit and publish."],iter0_edit_site:["Edit your page","Only this change. Everything else stays as it is."],iter0_show_three:["Three design directions","Three different looks to compare before you build."]};let J=null,Yt=null,We=0,ge=!1;const Ji={boot:["alert","This card didn't load","ChatGPT didn't connect to iter0. Reload the card, or carry on in chat.","reload","Reload card"],crash:["alert","Something went wrong in this card","Reload the card, or carry on in chat.","reload","Reload card"],stale:["clock","{whose} taking longer than usual","The card has stopped checking. Check again, or ask ChatGPT how it's going.","refresh","Check progress"],signin:["info","Sign in to iter0 again","Your iter0 sign-in has expired. Ask ChatGPT to check {what}, and it will ask you to sign in.","refresh","Check progress"],error:["alert","This request didn't finish","Check the response in chat.","",""]};function Vt(e,t=""){const n={whose:s.batchId?"Your designs are":"Your website is",what:s.batchId?"these designs":"this build"},[i,a,r,o,c]=Ji[e].map(h=>h.replace(/\{(whose|what)\}/,(f,m)=>n[m]));document.documentElement.dataset.view="show-three",document.documentElement.dataset.builder="false",I.className="wrap",I.innerHTML=`<section class="msg" role="alert"><span class="ic${i==="alert"?" bad":""}">${p(i)}</span><div><h1>${a}</h1><p>${l(t)||r}</p></div>${o?T(o,c,"",{ghost:!0}):""}</section>`,L.textContent=""}let Ye="";function Hn(e){Ye=Tt(e),!Object.keys(s).length&&!y()?g():H(new Error(Ye))}function Dn(){ne?et=!0:g()}function g(){if(et=!1,J&&(C||s.status!=="running"||!s.runId||s.batchId||s.approvalRequired)&&(J.destroy(),J=null,Yt=null,We=0),$t.splice(0).forEach(a=>a()),C==="boot"||C==="crash"||C&&s.status==="running")return Vt(C);if(Ye&&!y()&&!ge&&!Object.keys(s).length)return Vt("error",Ye);const e=s.approvalRequired&&k?.name==="iter0_show_three"?nn||k.arguments?.directions:null,n=!(e||ge||s.approvalRequired||s.html&&!s.designId&&!s.runId||ue(s)||s.batchId||s.runId)&&y()&&!ui()&&!s.code,i=e||ge?"show-three":s.approvalRequired||s.html&&!s.designId&&!s.runId?"quote":ue(s)?"build-status":s.batchId?"show-three":s.runId||n?"build-status":y()?"builder":"quote";if(document.documentElement.dataset.view=i,document.documentElement.dataset.builder=String(i==="builder"),ii(),I.className=i==="builder"?s.design?"app":"lib":i==="show-three"?"wrap":"",s.approvalRequired){const a=(k?.summary?.split(`
`)[0]||"").replace(/^(Build|Edit|Show three):\s*/i,""),[r,o]=Vi[k?.name]||["Confirm this action",""],c=`${k?.credits} credit${k?.credits===1?"":"s"}`,h=Array.isArray(e)?`<div class="set proposed" role="list">${e.map(f=>`<article class="card" role="listitem"><div class="body"><h2 class="name">${l(f.title)}</h2><p>${l(f.direction)}</p></div></article>`).join("")}</div>`:"";if(I.innerHTML=`<section class="pay"><div class="pay-h"><div class="pay-t"><h1>${l(r)}</h1>${o?`<p class="pay-lede">${l(o)}</p>`:""}</div></div>`+(a&&!h?`<p class="pay-brief"><span>${l(a)}</span></p>`:"")+h+`<div class="pay-f"><p class="pay-note"><span class="n0">Nothing is spent until you confirm.</span><span class="n1">Tap again to spend ${l(c)}.</span><span class="n2">Starting\u2026</span></p><div id="paid-confirm" class="paid-action"></div><div id="paid-confirm-requote" class="requote"></div></div></section>`,k)mt(document.getElementById("paid-confirm"),k);else if(Be){const f=s,m=Be;pe(m.name,m.arguments).then(E=>{s===f&&ft(E)}).catch(H)}else v("Ask ChatGPT for this action again.")}else s.code==="out_of_credits"?I.innerHTML="<p>Not enough credits for this.</p>":bn()&&s.designId?fi():s.html&&!s.runId?I.innerHTML="<p>The edit is ready in chat.</p>":s.batchId?li():s.runId?ci():n?pi():y()&&s.design?Fi():y()&&(Array.isArray(s.designs)||!Object.keys(s).length)?Ai():I.innerHTML=ge?`<section class="msg"><span class="ic bad">${p("alert")}</span><div><h1>This request was cancelled</h1><p>Ask ChatGPT to try again.</p></div></section>`:"<p>Waiting for the result from ChatGPT.</p>";I.scrollTop=0,un(),on(),xt&&(xt=!1,Ki())}let zn=0;function Ki(){if(!(C||M||Date.now()-zn<6e5))if(zn=Date.now(),s.batchId||s.runId)Ne("quiet");else if(s.design){const e=s.design.designId;R("iter0_get_design",{designId:e}).then(t=>{t.design&&s.design?.designId===e&&(s=t,N=null,g())}).catch(()=>{})}else y()&&Array.isArray(s.designs)&&lt(d.search).catch(()=>{})}function K(){const e=document.getElementById("canvas");if(!e||!document.getElementById("preview-frame"))return 1;const t=Wt(),i=t.width===O?Math.min(1,(e.clientWidth-32)/O):Math.max(.1,Math.min(.72,(e.clientWidth-64)/t.width)),a=de??i,r=Math.round(t.width*a),o=Math.round(t.height*a);document.getElementById("preview-frame").style.width=`${r}px`,Object.assign(document.getElementById("preview-box").style,{width:`${r}px`,height:`${o}px`});const c=document.getElementById("preview-image");return Object.assign(c.style,{width:`${t.width}px`,height:`${t.height}px`,transform:`scale(${a})`}),c.style.setProperty("--s",String(a)),document.getElementById("board").style.marginLeft=`${Math.max(16,(e.clientWidth-r)/2)}px`,document.getElementById("zoom-value").textContent=`${Math.round(a*100)}%`,a}function F(e,t={}){const n=t.paidAction?.quoteId||e.confirmation?.quoteId;if(Object.keys(e).length&&(ge=!1,C==="boot"&&(C="")),e.approvalRequired&&tt.has(n)||(!e.approvalRequired&&(e.batchId||e.runId||ue(e))&&k?.quoteId&&tt.add(k.quoteId),s.batchId&&e.batchId===s.batchId&&JSON.stringify(e)===JSON.stringify(s)&&JSON.stringify(t.paidAction||null)===JSON.stringify(k)))return;const a=o=>JSON.stringify({...o,previewImageUrl:String(o.previewImageUrl||"").replace(/token=[^&]*/,"")});if(s.runId&&s.status==="done"&&ve(s)&&a(e)===a(s))return;if((s.batchId||e.batchId)&&(Me++,le.clear(),ce.clear()),s.approvalRequired&&e.approvalRequired&&k?.quoteId&&t.paidAction?.quoteId===k.quoteId&&JSON.stringify(t.paidAction)===JSON.stringify(k)){s=e,Be=t.paidRequest||Be;return}if((k||ne)&&(e.runId||e.batchId||ue(e)||e.code==="out_of_credits"||e.approvalRequired&&t.paidAction?.quoteId!==k?.quoteId)&&v(""),k=t.paidAction||null,Be=t.paidRequest||null,nn=t.proposedDirections||null,e.edited===!0&&e.saved===!0&&e.designId&&Yn(e.designId,e.updatedAt),e.undoToken&&e.designId&&_?.undoToken!==e.undoToken?_={designId:e.designId,undoToken:e.undoToken,busy:!1,undone:!1,image:""}:!e.undoToken&&e.edited===!0&&e.saved===!0&&_?.designId===e.designId&&(_=null),s=e,g(),ie(),mn(),e.batchId||e.runId){const o={...e.batchId?{batchId:e.batchId}:{runId:e.runId},status:e.status,...e.designId?{designId:e.designId}:{},...e.runId&&e.status==="done"&&$(e.url)?{url:e.url}:{},...Array.isArray(e.directions)?{directions:e.directions.map(h=>({directionId:h.directionId,title:h.title,direction:h.direction}))}:{}},c=JSON.stringify(o);if(c!==an){an=c;const h=e.runId&&qt?.runId===e.runId?` from the direction "${qt.title}"`:"",f=e.runId?e.status==="running"?`The person confirmed a website build in the iter0 card${h}. It is running now (runId ${e.runId}); the card shows its progress and offers Open the builder when it is done. Do not start another build, and do not say earlier designs are still generating.`:e.status==="done"?`The website build${h} is done.${$(e.url)?` Its link is ${e.url}. Give the person exactly this link when they ask for the site or its link; never make up another iter0 link.`:" The card shows it with Open the builder."} The designId is for iter0 tools only: never show it to the person. For a later status question, call iter0_get_design for the current link.`:`The website build${h} stopped. The card shows the refund state.`:e.status==="running"?"The three design directions are being prepared in the iter0 card.":e.status==="done"?"The three design directions are ready in the iter0 card. The person can pick one there to build.":"";q("ui/update-model-context",{structuredContent:o,...f?{content:[{type:"text",text:f}]}:{}}).catch(()=>{}),Gn(e)}}else e.edited===!0&&e.saved===!0&&e.designId&&Gn(e);const r=qe?.designId;y()&&Array.isArray(e.designs)?!b["openai/deepLink"]?.url&&r?Q(r).catch(()=>{qe=null,Qt().catch(H)}):Qt().catch(H):!y()&&r&&b.displayMode==="fullscreen"&&e.status==="done"&&e.designId===r&&(be=!0,Q(r).catch(H))}function ft(e){const t=dn(e.structuredContent||{},e._meta),n=e._meta||{},i=n.paidAction,a=i?.arguments?.directionId;!ne&&s.batchId&&s.status==="done"&&i?.name==="iter0_create_site"&&s.directions?.some(r=>r.directionId===a)&&(ce.has(a)||JSON.stringify(le.get(a))===JSON.stringify(i))&&(t.approvalRequired||JSON.stringify(t)===JSON.stringify(s))||F(t,n)}let Ve=null,oe="";function Gn(e){const t=e.batchId||e.runId||"";!oe||oe===t||Et({privateContent:{moved:{from:oe,...e.batchId?{batchId:t}:e.runId?{runId:t}:{edited:!0},...e.status?{status:e.status}:{},...e.designId?{designId:e.designId}:{}}}})}function Jt(e){const t=e.structuredContent||{},n=e._meta||{},i=JSON.stringify(t)===JSON.stringify(Ve?.structuredContent||null)&&JSON.stringify(n)===JSON.stringify(Ve?._meta||{});C==="crash"&&!i&&(C=""),Ve=e,Ye="",oe=t.approvalRequired?n.paidAction?.quoteId||t.confirmation?.quoteId||"":t.batchId||t.runId||"";const a=t.approvalRequired&&Y.modelContent,r=Y.privateContent?.moved||(a?.runId||a?.batchId?{from:oe,...a.batchId?{batchId:a.batchId}:{runId:a.runId},status:a.status,designId:a.designId}:null);if(r&&oe&&r.from===oe){if(s.runId||s.batchId||ue(s))return;tt.add(oe),r.edited?(F({edited:!0,saved:!0,designId:r.designId}),R("iter0_get_design",{designId:r.designId}).then(c=>{s.edited&&s.designId===r.designId&&!s.previewImageUrl&&c.design?.previewImageUrl&&(s={...s,previewImageUrl:c.design.previewImageUrl},g())}).catch(()=>{})):(F({...r.batchId?{batchId:r.batchId}:{runId:r.runId},status:r.status||"running",...r.designId?{designId:r.designId}:{}}),Ne("quiet"));return}const o=s.batchId?t.batchId===s.batchId:!!s.runId&&!t.batchId&&t.runId===s.runId;i&&(y()&&s.design||o)||ft(e)}function Fn(e){const t=b.displayMode;if(b={...b,theme:e.theme??window.openai?.theme,displayMode:e.displayMode??window.openai?.displayMode},ye(),b.displayMode!==t&&y()&&!("toolOutput"in e)&&Dn(),"toolOutput"in e||"toolResponseMetadata"in e){const n=e.toolResponseMetadata??window.openai?.toolResponseMetadata??{},i=n.mcp_tool_result||n.call_tool_result;if(i?.isError){Hn(i);return}Jt({structuredContent:e.toolOutput??window.openai?.toolOutput??i?.structuredContent??{},_meta:i?._meta||n})}else ie(!0)}async function Qi(e,t){if(ne)return;ne=!0;const n=e.name==="iter0_create_site"&&s.directions?.find(a=>a.directionId===e.arguments?.directionId),i=document.getElementById(t)?.closest?.(".pay");hi(e),i?i.classList.add("busy"):v("Waiting for ChatGPT.",t,!0);try{const a=kt.has(e.quoteId)&&e.approvalId;kt.add(e.quoteId);const r=a?await pe(e.name,{...e.arguments,approvalId:e.approvalId}):await pe("iter0_confirm_paid_action",{quoteId:e.quoteId,name:e.name,arguments:e.arguments,credits:e.credits});!r.structuredContent?.approvalRequired&&(r.structuredContent?.batchId||r.structuredContent?.runId||ue(r.structuredContent))&&tt.add(e.quoteId),n&&r.structuredContent?.runId&&(qt={runId:r.structuredContent.runId,title:n.title}),v(""),ft(r)}catch(a){if(et&&(ne=!1,g()),a.message==="Not enough credits for this.")v(a.message,t,!0);else{if(a.hostRefusal)return v("ChatGPT did not start this. Reply yes in chat to start it.",t,!0),q("ui/update-model-context",{structuredContent:{confirmation:{quoteId:e.quoteId,name:e.name,arguments:e.arguments,credits:e.credits}}}).catch(()=>{}),"approval";a.code==="invalid_quote"?Wn(t,"This quote is no longer available."):v(`${a.message||"ChatGPT could not complete this action."} Check its status before retrying, or reply yes in chat.`,t,!0)}}finally{ne=!1,i?.classList.remove("busy"),et&&g()}}function mt(e,t){if(!e||!window.iter0PaidConfirm)throw new Error("The price could not be loaded. Try again, or ask in chat.");if(sn.get(e)===t)return;e.innerHTML="",sn.set(e,t);const n=!(t.expiresAt>Date.now());$t.push(window.iter0PaidConfirm.mount(e,t,()=>Qi(t,e.id),()=>Wn(e.id,n||kt.has(t.quoteId)?"This quote has expired.":"This quote expired. Nothing was spent.")))}function Wn(e,t){v(t,e,!0);const n=document.getElementById(`${e}-requote`);n&&(n.innerHTML=T("requote","Get a new quote",e))}async function Xi(e){const t=s,n=/^paid-build-(\d+)$/.exec(e);v("Getting a new quote\u2026",e,!0);try{if(n){const i=t.directions?.[Number(n[1])]?.directionId;if(i){le.delete(i);const a=await Kt(i,t);if(s===t){mt(document.getElementById(e),a);const r=document.getElementById(`${e}-requote`);r&&(r.innerHTML="")}}}else if(k){const i=await pe(k.name,k.arguments);s===t&&ft(i)}v("")}catch(i){s===t&&v(i.message||"A new quote could not be made. Try again, or ask in chat.",e,!0)}}async function Kt(e,t){const n=le.get(e);if(n&&n.expiresAt>Date.now())return n;if(ce.has(e))return ce.get(e);const i=Me,a=(async()=>{const o=(await pe("iter0_create_site",{directionId:e,quoteOnly:!0}))._meta?.paidAction;if(!o||!/^quote-[a-f0-9]{24}$/.test(o.quoteId)||o.name!=="iter0_create_site"||o.arguments?.directionId!==e||!Number.isFinite(o.credits)||o.credits<0||!Number.isFinite(o.expiresAt)||o.expiresAt<=Date.now())throw new Error("The price could not be loaded. Try again, or ask in chat.");return i===Me&&s===t&&le.set(e,o),o})();ce.set(e,a);try{return await a}finally{ce.get(e)===a&&ce.delete(e)}}async function Zi(e){const t=Me;for(const[n,i]of(e.directions||[]).entries())try{const a=await Kt(i.directionId,e);if(t!==Me||s!==e)return;mt(document.getElementById(`paid-build-${n}`),a)}catch(a){s===e&&v(a.message||"The price could not be loaded. Try again, or ask in chat.",`paid-build-${n}`,!0)}}function Yn(e,t){const n=u?.designs?.find(o=>o.designId===e),i=Date.parse(t);if(!n||Number.isNaN(i)||i<=Date.parse(n.updatedAt))return;const a=u.designs.map(o=>o.designId===e?{...o,updatedAt:t}:o).sort((o,c)=>(Date.parse(c.updatedAt)||0)-(Date.parse(o.updatedAt)||0)),r=s===u;u={...u,designs:a},r&&(s=u)}const es=9e5;let fe=null,Vn;const Jn=()=>x||j||Ae||te||ut()||_?.busy;function Kn(){clearTimeout(Vn);const e=fe;if(M||!e||e.designId!==s.design?.designId)return void(fe=null);const t=e.waited<6e4?5e3:2e4;e.waited+=t,Vn=setTimeout(ts,t)}async function ts(){const e=fe;if(e){try{if(e.landed||=e.waited>es||(t=>!(t.status==="done"&&ve(t)))(await R("iter0_get_site_status",{runId:e.runId})),e.landed&&!Jn()){const t=await R("iter0_get_design",{designId:e.designId});if(fe===e&&e.designId===s.design?.designId&&!Jn()){fe=null,t.design&&t.design.updatedAt!==s.design.updatedAt&&(t.sections?.some(n=>n.sectionId===P)||(P=null),s=t,N=null,g());return}}}catch{if(++e.errors>20)return void(fe=null)}Kn()}}async function Q(e){const t=ve(s)&&s.status==="done"&&s.designId===e&&!s.batchId&&s.runId,n=await R("iter0_get_design",{designId:e});if(n.design){Yn(n.design.designId,n.design.updatedAt);const i=`${n.design.designId}:${n.design.updatedAt}`;V.get(i)?.state==="failed"&&V.delete(i)}s=n,P=null,de=null,ee=null,x=null,j=null,N=null,g(),t&&(fe={runId:t,designId:e,waited:0,errors:0}),Kn()}async function Qt(){const e=b["openai/deepLink"]?.url;if(!e||It||!e.startsWith("/")||e.startsWith("//"))return;const t=new URL(e,"https://iter0.com"),n=t.pathname==="/design"?t.searchParams.get("id"):null;if(n){It=!0;try{await Q(n)}finally{It=!1}}}async function Qn(e,t){const n=s.sections?.find(i=>i.sectionId===e);!n||!s.design||x||(await q("ui/update-model-context",{structuredContent:{designId:s.design.designId,sectionId:e},content:[{type:"text",text:`Selected section: ${n.label}. Pass designId ${s.design.designId} and sectionId ${e}, with the change as prompt, to iter0_edit_site; iter0 loads the page itself, so send no page code. Quote and confirm any edit in chat. A confirmed edit is saved to the design, and the card offers Undo.`}]}),P=e,N=null,g(),G(t),v("Section selected. Describe your change in ChatGPT."),U||Fe().then(()=>{P===e&&G(t)}))}async function ns(e,t){if(v("",e==="add-page"?"add-page-row":e==="restore"||e==="version"?"version-bar":"builder-bar"),e!=="menu"&&j&&y()&&s.design&&(j=null,e!=="version"&&e!=="open"&&g()),e==="expand"){if((await q("ui/request-display-mode",{mode:"fullscreen"}))?.mode!=="fullscreen")throw new Error("Full screen is unavailable here. Open the design in iter0.");b.displayMode="fullscreen",ye(),g()}else if(e==="open-builder"){const n=await q("ui/request-display-mode",{mode:"fullscreen"});if(n.mode!=="fullscreen")throw new Error("Fullscreen is unavailable in this host. Open the design in iter0.");b.displayMode=n.mode,be=!0;try{await Q(t)}catch(i){throw be=Pe==="builder",g(),i}}else if(e==="build"){const n=s,i=n.directions?.findIndex(r=>r.directionId===t)??-1;v("Loading price\u2026",i>=0?`paid-build-${i}`:"builder-bar",!0);const a=await Kt(t,n);if(s!==n)return;if(i>=0){const r=document.getElementById(`paid-build-${i}`);mt(r,a),v(""),r.querySelector("button").click()}else F({approvalRequired:!0},{paidAction:a})}else if(e==="requote")await Xi(t);else if(e==="open"){const n=$(t);if(n){const i=new URL(n);i.searchParams.set("src","chatgpt"),await q("ui/open-link",{url:i.href})}s.design&&g()}else if(e==="undo-edit")await mi();else if(e==="design")await Q(t);else if(e==="research")_e=!(_e??s.research?.status==="running"),g();else if(e==="menu")j=j===t?null:t,g();else if(e==="device")Z!==t&&(Z=t,de=null,g());else if(e==="retry-preview"){xe.delete(ze());const n=Ce();if(!n.base)return;if((Te.get(n.base)||0)>=1&&s.design){re.clear(),Te.clear(),await Q(s.design.designId);return}re.delete(n.src),Te.set(n.base,(Te.get(n.base)||0)+1),g()}else if(e==="page"){const n=He().find(i=>i.pageId===t);if(!n)return;n.pageId===He()[0].pageId||n.previewImageUrl?(ee=n.pageId,P=null,g()):await we(`Show me the ${n.title} page (${n.route}) of my design ${s.design.name}.`)}else if(e==="add-page")Ae=!0,g(),document.getElementById("add-page-input")?.focus();else if(e==="add-page-cancel")zt();else if(e==="add-page-send"){const n=ut().trim();if(!n||!s.design||te)return;te=!0,g();try{await we(`Add a page to my site ${s.design.name}: ${n}`)}catch(i){throw te=!1,g(),i}te=!1,zt(),v("Sent to ChatGPT. It will reply in the chat.","add-page-row")}else if(e==="version"){const n=Ee().find(i=>i.versionId===t);x=!n||n.current?null:t,g()}else if(e==="restore"){const n=Ee().find(i=>i.versionId===t);if(!n)return;await q("ui/update-model-context",{structuredContent:{designId:s.design.designId,versionId:n.versionId},content:[{type:"text",text:`The user selected version ${n.number} of design ${s.design.designId}. The saved design remains unchanged until they confirm in chat.`}]}),await we(`Restore version ${n.number} of my design ${s.design.name} (designId ${s.design.designId}, versionId ${n.versionId}) with iter0_restore_version. Check with me before you confirm it.`),v("ChatGPT will check with you before it restores this version.","version-bar")}else if(e==="ask-change"){const n=!x&&s.sections?.find(i=>i.sectionId===P);if(!n||!s.design)return;U||Fe(),await we(`I want to change the ${n.label} section of my site (designId ${s.design.designId}, sectionId ${n.sectionId}). Ask me what I want changed before quoting or starting an edit.`)}else if(e==="unselect")P=null,g();else if(e==="side"){const n=document.getElementById("side");n.classList.toggle("fold"),X=n.classList.contains("fold"),document.querySelector("[data-action=side]").setAttribute("aria-expanded",String(!X)),setTimeout(()=>{K(),G()},220)}else if(e==="fit")de=null,K();else if(e==="zoom-in"||e==="zoom-out")de=Math.max(.1,Math.min(1.5,K()+(e==="zoom-in"?.1:-.1))),K();else if(e==="library")b["openai/deepLink"]=null,Z=null,F(u||await R("iter0_list_my_designs",{}));else if(e==="show3"||e==="show3again")e==="show3again"&&await q("ui/update-model-context",{structuredContent:{designId:t},content:[{type:"text",text:`Use owned design ${t} as context. Read it before proposing new directions.`}]}),await we("Show me three website designs. Check my brief with me and quote the credit price before starting.");else if(e==="section")await Qn(t,!0);else if(e==="refresh-preview"){const n=s,i=n.directions?.findIndex(h=>h.directionId===t)??-1;if(i<0)return;v("Refreshing preview\u2026","builder-bar",!0);const a=await R("iter0_get_design_set_status",{batchId:n.batchId});if(s!==n)return;const r=a.directions?.find(h=>h.directionId===t),o=$(r?.screenshotUrl||r?.previewImageUrl,!0);if(!o)throw new Error("The preview is still unavailable. Try again shortly.");const c=document.querySelectorAll(".set .card")[i]?.querySelector(".thumb img");if(c){c.dataset.retries="1";const h=new URL(o);h.searchParams.set("retry",String(Date.now())),c.src=h.href}v("")}else if(e==="reload")is();else if(e==="refresh")xe.clear(),re.clear(),Te.clear(),s.batchId||s.runId?(C&&(C="",g()),Ie=0,it="",await Ne("manual")):s.design?await Q(s.design.designId):y()&&document.getElementById("pj-grid")?await lt(d.search):F(await R("iter0_list_my_designs",{}));else if(e==="plus")ct(!d.plus);else if(e==="pick")Pn(t),ct(!1),document.getElementById("pj-draft")?.focus();else if(e==="clear-mode")Pn(""),document.getElementById("pj-draft")?.focus();else if(e==="send")await Hi();else if(e==="starter"||e==="new-site"){const n=document.getElementById("pj-draft");if(!n)return;e==="starter"&&!n.value.trim()&&(d.draft=`${t}: `,n.value=d.draft),n.focus(),n.setSelectionRange?.(n.value.length,n.value.length),n.scrollIntoView?.({block:"center",behavior:"smooth"});const i=document.getElementById("pj-send");i&&(i.disabled=!n.value.trim())}else if(e==="page-next")await Cn(d.page+1);else if(e==="page-prev")await Cn(d.page-1);else if(e==="clear-search"){const n=document.getElementById("pj-search");n&&(n.value=""),await lt(""),document.getElementById("pj-search")?.focus()}}document.addEventListener("click",async e=>{const t=e.target.closest("[data-action]");if(d.plus&&!(t&&["plus","pick"].includes(t.dataset.action))&&ct(!1),!t){if(j&&!e.target.closest?.(".menu")){j=null,g();return}if(y()&&s.design&&!x&&e.target.closest?.("#preview-image")){const n=s;if(U||await Fe(),s!==n||x)return;const i=Ft(e);if(i>=0)try{await Qn(s.sections[i].sectionId,!1)}catch(a){H(a)}}return}if(!t.disabled){if(t.dataset.action==="zoom"){const n=t.closest(".card");n&&t.setAttribute("aria-expanded",String(n.classList.toggle("big")));return}t.disabled=!0;try{await ns(t.dataset.action,t.dataset.value)}catch(n){H(n)}finally{t.disabled=t.id==="pj-send"?!d.draft.trim():t.id==="pj-prev"?!En():t.id==="pj-next"?!Ut():!1,(t.id==="pj-prev"||t.id==="pj-next")&&Oi(t),on()}}}),document.addEventListener("mousemove",e=>{if(!y()||!s.design||x||!e.target.closest?.("#preview-image")){gt=null,N!==null&&(N=null,G());return}gt={clientX:e.clientX,clientY:e.clientY},U||Fe();const t=Ft(e);(t>=0?t:null)!==N&&(N=t>=0?t:null,G())}),document.addEventListener("input",e=>{if(e.target.id==="pj-draft"){d.draft=e.target.value,e.target.style.height="auto",e.target.style.height=`${Math.min(208,e.target.scrollHeight)}px`;const n=document.getElementById("pj-send");n&&(n.disabled=!d.draft.trim());return}if(e.target.id==="pj-search"){clearTimeout(jn);const n=e.target.value;jn=setTimeout(()=>{n.trim()!==d.search&&lt(n).catch(H)},300);return}if(e.target.id!=="add-page-input")return;Ze={designId:s.design?.designId??null,text:e.target.value};const t=document.getElementById("add-page-submit");t&&(t.disabled=!e.target.value.trim())}),document.addEventListener("keydown",e=>{if(e.key==="Enter"&&!e.shiftKey&&e.target.id==="pj-draft"){if(e.isComposing||e.keyCode===229)return;e.preventDefault();const i=document.getElementById("pj-send");i&&!i.disabled&&i.click();return}if(e.key==="Enter"&&e.target.id==="add-page-input"){if(e.isComposing||e.keyCode===229)return;e.preventDefault();const i=document.getElementById("add-page-submit");i&&!i.disabled&&!te&&i.click();return}const t={ArrowDown:1,ArrowRight:1,ArrowUp:-1,ArrowLeft:-1}[e.key],n=t&&e.target.closest?.("[role=radiogroup],[role=menu]");if(n){const i=[...n.querySelectorAll("[role=radio],[role^=menuitem]")].filter(o=>!o.disabled),a=i.indexOf(e.target);if(a<0||i.length<2)return;const r=i[(a+t+i.length)%i.length];e.preventDefault(),r.focus?.(),n.getAttribute("role")==="radiogroup"&&(r.click(),document.getElementById(r.id)?.focus());return}if(e.key==="Escape")if(d.plus)ct(!1),document.getElementById("pj-plus")?.focus();else if(j){const i=j;j=null,g(),document.getElementById(`opener-${i}`)?.focus()}else Ae&&e.target.closest?.('[data-form="add-page"]')&&zt()}),window.addEventListener("resize",()=>{K(),G()}),document.addEventListener("visibilitychange",()=>ie(!0)),window.addEventListener("focus",()=>ie(!0)),window.addEventListener("pageshow",()=>ie(!0)),document.addEventListener("error",e=>{const t=e.target;if(t.tagName!=="IMG")return;t.hidden=!0;const n=t.parentElement;if(!n)return;if(t.id==="preview-img"&&y()&&s.design){const o=Ce();if(o.full&&o.width===O&&t.src===o.src){re.set(o.src,"failed"),g();return}if(!x&&t.src===o.src&&o.base&&o.base===$(s.design.pagePreviewImageUrl,!0)&&$(s.design.previewImageUrl,!0)&&!xe.has(ze())){xe.add(ze()),g();return}const c=document.getElementById("pv-state");c&&(c.hidden=!0)}if(s.batchId&&n.classList.contains("thumb")&&!t.dataset.retries){t.dataset.retries="1";const o=t.src;setTimeout(()=>{if(!t.isConnected||M||t.src!==o)return;const c=new URL(t.src);c.searchParams.set("retry","1"),t.src=c.href},1e3)}if(n.querySelector(".preview-fallback"))return;const i=document.createElement("div");i.className="preview-fallback";const a=[...document.querySelectorAll(".set .card")].indexOf(t.closest(".card")),r=s.batchId&&s.directions?.[a];i.setAttribute("role",r?"group":"img"),i.setAttribute("aria-label",`${t.alt||"Design preview"}. Preview unavailable.`),i.innerHTML=`<p>Preview unavailable</p>${r?T("refresh-preview","Refresh preview",r.directionId,{ghost:!0}):"<span>Refresh to try again</span>"}`,n.appendChild(i)},!0),document.addEventListener("load",e=>{const t=e.target;if(!(t.tagName!=="IMG"||!t.naturalWidth)&&(t.classList?.add("ld"),t.hidden=!1,t.parentElement?.querySelector(".preview-fallback")?.remove(),t.id==="preview-img"&&y()&&s.design)){if(t.src===Ce().src){re.set(t.src,"loaded");const n=document.getElementById("pv-state");n&&(n.hidden=!0),K(),G()}Gi()}},!0);function bt(e){if(!(M||C==="crash")){globalThis.console?.error?.("iter0 card:",e),C="crash",clearTimeout(B),B=null;try{g()}catch{Vt("crash")}}}const wt=e=>t=>{try{e(t)}catch(n){bt(n)}};window.addEventListener("error",e=>{e.error&&bt(e.error)}),window.addEventListener("unhandledrejection",e=>{e.reason&&bt(e.reason)});function is(){if(C="",Ie=0,it="",A==="starting"){g(),Xt();return}try{g()}catch(e){s={},k=null;try{Ve?Jt(Ve):g()}catch{bt(e);return}}ie(!0)}if(window.addEventListener("message",wt(e=>{if(e.source!==window.parent||!e.data||e.data.jsonrpc!=="2.0")return;const t=e.data;if(A==="compatibility"&&!Ke&&t.id===yt&&t.result&&!D.has(t.id)){if(Ke=!0,document.documentElement.dataset.lateHost="true",window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/initialized",params:{}},"*"),Y.modelContent){const{message:n,...i}=Y.modelContent;q("ui/update-model-context",{structuredContent:i,...n?{content:[{type:"text",text:n}]}:{}}).catch(()=>{})}return}if(D.has(t.id)){const n=D.get(t.id);if(clearTimeout(n.timeout),D.delete(t.id),t.error){const i=new Error("ChatGPT could not complete this request. Try again.");i.hostRefusal=!0,n.reject(i)}else n.resolve(t.result)}else if(t.method==="ui/notifications/tool-result")t.params.isError&&t.params.structuredContent?.code!=="out_of_credits"?Hn(t.params):Jt(t.params);else if(t.method==="ui/notifications/host-context-changed"){const n=b.displayMode;b={...b,...t.params},ye(),ie(!0),Qt().catch(H),b.displayMode!==n&&y()&&Dn()}else t.method==="ui/notifications/tool-input"?!ne&&!s.batchId&&!s.runId&&(ge=!1,le.clear(),F({})):t.method==="ui/notifications/tool-cancelled"?(le.clear(),F({}),clearTimeout(B),y()?v("This request was cancelled."):(ge=!0,g())):t.method==="ui/resource-teardown"&&(M=!0,clearTimeout(B),$t.splice(0).forEach(n=>n()),D.forEach(n=>{clearTimeout(n.timeout),n.reject(new Error("This view has closed."))}),D.clear(),window.parent.postMessage({jsonrpc:"2.0",id:t.id,result:{}},"*"))})),window.addEventListener("openai:set_globals",wt(e=>{A==="starting"&&Zn(e.detail?.globals),!M&&A==="compatibility"&&Fn(e.detail?.globals||{})})),typeof ResizeObserver=="function"){let e=null,t="";new ResizeObserver(()=>{const i=`${document.documentElement.dataset.builder}|${document.documentElement.dataset.mode}`;if(i!==t&&(t=i,e=null),document.documentElement.dataset.builder==="true"||Pe==="builder"&&I.querySelector(".boot"))return;const a=Math.ceil(document.body.getBoundingClientRect().height);a!==e&&(e=a,ln("ui/notifications/size-changed",{height:a}))}).observe(document.body)}let yt=0;function Xn(){b.theme||(b={...b,theme:window.openai?.theme||(window.matchMedia?.("(prefers-color-scheme: dark)").matches?"dark":"light"),displayMode:b.displayMode||window.openai?.displayMode},ye())}function Xt(e=0){if(M||A!=="starting")return;const t=q("ui/initialize",{protocolVersion:"2026-01-26",appInfo:{name:"iter0",version:"0.5.0"},appCapabilities:{availableDisplayModes:Pe==="builder"?["fullscreen"]:["inline","fullscreen"]}},8e3);yt=vt,t.then(wt(n=>{A==="starting"&&(A="standard",document.documentElement.dataset.bridge=A,b=n.hostContext||{},C==="boot"&&(C=""),ye(),ln("ui/notifications/initialized",{}),g())}),wt(()=>{M||A!=="starting"||(Xn(),e<2?(e||g(),setTimeout(()=>Xt(e+1),e?3e3:1e3)):Object.keys(s).length||st("boot"))}))}Xn(),Xt();function Zn(e){if(M||!en||A!=="starting"||typeof window.openai?.callTool!="function"&&typeof window.openai?.sendFollowUpMessage!="function")return;A="compatibility",document.documentElement.dataset.bridge=A;const t=D.get(yt);t&&(clearTimeout(t.timeout),D.delete(yt),t.resolve({})),v(""),Fn({...window.openai,...e})}setTimeout(()=>{en=!0,Zn()},500)})();
</script></body></html>

SHA-256: 09f4cfe5d9d6e05c6d341901f24ac5912f63b71b97ce8af5985a66efa02aa4af