{"version":3,"file":"XTEngineeringLoop.BhMuhXYk.mjs","names":["React.useRef","__esmMin","init_ssg_sandbox_shims","init_npm_react_18_3_1","window","ce","init_jsx_runtime","c","p","de","addPropertyControls","ControlType","init_framer_D6uXRwWs","afterPaint","once","useAnimated","XT_LOCKUP_CSS","XT_BASE_CSS","whenSized","XT_FONT_IMPORT","init_XTShared","XTStyle","install","NS","el","n","name","k","attrs","r","x","draw","svg","root","\"class\"","box","srcs","sink","aside","rect","b","S","R","stacked","railX","paths","wire","kind","head","s","d","dir","y","tx2","last","i","a","cx","jy","sy","rad2","ty","tx","lab2","cy","spread","y0","y1","x0","x1","mx","bx","by0","floor","rad","lab","A","f","mount","raf","schedule","es","e","init","XTEngineeringLoop","props","animated","host","home","html","HOME_HTML","HTML","key","cancelSized","ids","cancel","api","redraw","ms","style","CSS","HOME_CSS","init_XTEngineeringLoop"],"sources":["https:/framerusercontent.com/modules/OF2QtQTcAj5WqPaZx8A7/GpavmVAZkpBe4UkKpmgM/XTEngineeringLoop.js"],"sourcesContent":["// @ts-nocheck\n// XT Engineering loop. Port of site/visuals/engineering-loop (Round 11, engineering.html \"How it works\"). The markup is copied\n// verbatim from the page (the gated Routines node is left out); the wire-drawing script is the original, verbatim, installed once\n// per page. Wires are drawn on the canvas too (static); comets play only on the published site and in Preview, in view.\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";import{XTStyle,XT_FONT_IMPORT,XT_BASE_CSS,XT_LOCKUP_CSS,useAnimated,once,afterPaint,whenSized}from\"https://framerusercontent.com/modules/dJPZ5VRbhPbRDwnU4bd6/SWSCRD2FKFAHO19Do92q/XTShared.js\";const CSS=`/* ==========================================================================\n   VISUAL \\xb7 engineering-loop  (Brains and Rules feed every session; sessions\n   return new lessons). Round 11, engineering.html. Tokens from xt.css only.\n   Line language follows visuals/control-plane: hairline wires, small comets,\n   mono eyebrows, white nodes with the soft float shadow.\n   Wires are drawn by engineering-loop.js from the nodes' real positions, so the\n   layout is plain HTML: wide (sources left, Sessions right) at a container of\n   640px and up, stacked below that.\n   ========================================================================== */\n.xt-eng-loop-host .v-eng-loop {\n  --el-fill: var(--card, #fff);\n  --el-stroke: var(--hair);\n  --el-ink: var(--ink);\n  --el-ink-2: var(--ink-2);\n  --el-sub: var(--muted);\n  --el-bg: var(--canvas);\n  --el-wire: color-mix(in oklab, var(--muted-soft) 62%, var(--el-bg));\n  --el-fwd: var(--lavender-deep);   /* context and rules going into a session (the enforcement color) */\n  --el-ret: var(--sky-deep);        /* new lessons coming back */\n  --el-shadow: 0 1px 0 rgba(255, 255, 255, .8) inset, 0 0 0 1px rgba(12, 10, 9, .04), 0 24px 48px -28px rgba(41, 37, 36, .28), 0 8px 18px -12px rgba(41, 37, 36, .10);\n  --el-cycle: 9s;\n  --el-pad: 44px;                   /* room on the left for the return rail */\n\n  position: relative;\n  container-type: inline-size;\n  padding: 8px 0 76px var(--el-pad);\n  color: var(--el-ink);\n  font-family: var(--sans);\n}\n.xt-eng-loop-host .band-dark .v-eng-loop, .xt-eng-loop-host .v-eng-loop--dark {\n  --el-fill: var(--dark-2);\n  --el-stroke: var(--hair-dark);\n  --el-ink: var(--on-dark);\n  --el-ink-2: var(--on-dark-soft);\n  --el-sub: var(--on-dark-muted);\n  --el-bg: var(--dark);\n  --el-wire: color-mix(in oklab, var(--on-dark) 27%, var(--el-bg));\n  --el-fwd: color-mix(in oklab, var(--lavender) 50%, var(--lavender-deep));\n  --el-ret: color-mix(in oklab, var(--sky) 55%, var(--sky-deep));\n  --el-shadow: 0 0 0 1px var(--hair-dark), 0 24px 48px -28px rgba(0, 0, 0, .6);\n}\n\n/* ------------------------------------------------------------ layout */\n.xt-eng-loop-host .el-grid {\n  position: relative; z-index: 1;\n  display: grid; grid-template-columns: minmax(0, 5fr) minmax(120px, 3fr) minmax(0, 5fr);\n  align-items: center;\n}\n.xt-eng-loop-host .el-src { display: grid; gap: 20px; }\n.xt-eng-loop-host .el-mid { display: flex; justify-content: center; align-items: center; padding: 0 12px; }\n.xt-eng-loop-host .el-sink { display: grid; }\n\n/* ------------------------------------------------------------- nodes */\n.xt-eng-loop-host .el-node {\n  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 34px; column-gap: 16px; row-gap: 6px; align-items: start;\n  padding: 18px 18px 18px 20px; border-radius: 14px;\n  background: var(--el-fill); box-shadow: var(--el-shadow);\n  color: inherit; text-decoration: none;\n  transition: box-shadow .4s var(--ease, ease);\n}\n.xt-eng-loop-host .el-node[hidden] { display: none; }\n.xt-eng-loop-host .el-node__k {\n  grid-column: 1; display: inline-flex; align-items: center; gap: 8px;\n  font: 400 11px/1.3 var(--mono); letter-spacing: 0; text-transform: uppercase; color: var(--el-sub);\n}\n.xt-eng-loop-host .el-node__k i { width: 7px; height: 7px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1.5px var(--el-fwd); }\n.xt-eng-loop-host .el-node--sink .el-node__k i { box-shadow: inset 0 0 0 1.5px var(--el-ret); }\n.xt-eng-loop-host .el-node__t { grid-column: 1; font: 400 var(--fs-h4, 24px)/1.25 var(--display); letter-spacing: -0.04em; color: var(--el-ink); text-wrap: balance; }\n.xt-eng-loop-host .el-node__d { grid-column: 1; font-size: 14px; line-height: 1.4; letter-spacing: -0.02em; color: var(--el-sub); text-wrap: pretty; }\n.xt-eng-loop-host .el-node .paths__go { grid-column: 2; grid-row: 1 / span 3; align-self: center; }\n.xt-eng-loop-host .el-node:hover .paths__go, .xt-eng-loop-host .el-node:focus-visible .paths__go { background: var(--ink-2); color: #fff; box-shadow: none; }\n.xt-eng-loop-host .band-dark .el-node:hover .paths__go, .xt-eng-loop-host .band-dark .el-node:focus-visible .paths__go { background: var(--on-dark); color: var(--ink); }\n.xt-eng-loop-host .el-node--sink { padding-block: 28px; }\n.xt-eng-loop-host .el-node--sink .el-node__t { font-size: clamp(24px, 2.23vw, 32px); }\n\n/* Optional node: hangs off the sources, dashed, outside the lesson loop. */\n.xt-eng-loop-host .el-node--aside { background: transparent; box-shadow: inset 0 0 0 1px var(--el-stroke); }\n\n/* ------------------------------------------------------------- labels on the wires */\n.xt-eng-loop-host .el-label {\n  position: relative; z-index: 2;\n  display: inline-block; padding: 4px 8px; border-radius: 6px;\n  background: var(--el-bg);\n  font: 400 11px/1.35 var(--mono); letter-spacing: 0; text-transform: uppercase; color: var(--el-sub);\n  text-align: center; max-width: 15em; text-wrap: balance;\n}\n.xt-eng-loop-host .el-mid .el-label { background: transparent; }\n.xt-eng-loop-host .el-label--ret { position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%); white-space: nowrap; max-width: none; }\n.xt-eng-loop-host .el-label b { font-weight: 400; color: var(--el-ink-2); }\n\n/* -------------------------------------------------------------- wires */\n.xt-eng-loop-host .el-wires { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; z-index: 0; }\n.xt-eng-loop-host .el-wire { fill: none; stroke-width: 1.25; stroke-linecap: round; stroke-linejoin: round; }\n.xt-eng-loop-host .el-wire--fwd { stroke: color-mix(in oklab, var(--el-fwd) 70%, var(--el-bg)); }\n.xt-eng-loop-host .el-wire--ret { stroke: var(--el-ret); stroke-dasharray: 4 5; }\n.xt-eng-loop-host .el-head { fill: none; stroke-width: 1.25; stroke-linecap: round; stroke-linejoin: round; }\n.xt-eng-loop-host .el-head--fwd { stroke: color-mix(in oklab, var(--el-fwd) 70%, var(--el-bg)); }\n.xt-eng-loop-host .el-head--ret { stroke: var(--el-ret); }\n.xt-eng-loop-host .el-comet { fill: none; stroke-linecap: round; opacity: 0; stroke-dashoffset: 6; }\n.xt-eng-loop-host .el-comet--fwd { stroke: var(--el-fwd); stroke-width: 3; stroke-dasharray: 6 300; }\n.xt-eng-loop-host .el-comet--ret { stroke: var(--el-ret); stroke-width: 3; stroke-dasharray: 8 300; }\n\n/* The 9s story: context and rules travel into the session (0-30%), the session\n   works (30-46%), a new lesson travels back (46-80%), the sources take it in (80-94%). */\n@media (prefers-reduced-motion: no-preference) {\n  .xt-eng-loop-host .v-eng-loop:not([data-motion=\"off\"]).is-live .el-comet--fwd { animation: el-fwd var(--el-cycle) var(--ease, ease) infinite; animation-delay: calc(var(--i, 0) * .18s); }\n  .xt-eng-loop-host .v-eng-loop:not([data-motion=\"off\"]).is-live .el-comet--ret { animation: el-ret var(--el-cycle) var(--ease, ease) infinite; animation-delay: calc(var(--i, 0) * .12s); }\n  .xt-eng-loop-host .v-eng-loop:not([data-motion=\"off\"]).is-live .el-node--sink { animation: el-sink var(--el-cycle) linear infinite; }\n  .xt-eng-loop-host .v-eng-loop:not([data-motion=\"off\"]).is-live .el-src .el-node:not(.el-node--aside) { animation: el-src var(--el-cycle) linear infinite; }\n}\n@keyframes el-fwd {\n  0%, 2% { stroke-dashoffset: 6; opacity: 0; }\n  3% { opacity: 1; }\n  27% { opacity: 1; }\n  30%, 100% { stroke-dashoffset: -100; opacity: 0; }\n}\n@keyframes el-ret {\n  0%, 46% { stroke-dashoffset: 8; opacity: 0; }\n  47% { opacity: 1; }\n  78% { opacity: 1; }\n  81%, 100% { stroke-dashoffset: -100; opacity: 0; }\n}\n@keyframes el-sink {\n  0%, 28%, 50%, 100% { box-shadow: var(--el-shadow); }\n  33%, 44% { box-shadow: var(--el-shadow), 0 0 0 1.5px color-mix(in oklab, var(--el-fwd) 55%, transparent); }\n}\n@keyframes el-src {\n  0%, 79%, 96%, 100% { box-shadow: var(--el-shadow); }\n  83%, 92% { box-shadow: var(--el-shadow), 0 0 0 1.5px color-mix(in oklab, var(--el-ret) 60%, transparent); }\n}\n\n/* ------------------------------------------------------------ stacked (narrow) */\n@container (max-width: 639px) {\n  .xt-eng-loop-host .v-eng-loop { --el-pad: 32px; padding-bottom: 8px; }\n  .xt-eng-loop-host .el-grid { grid-template-columns: minmax(0, 1fr); }\n  .xt-eng-loop-host .el-src { gap: 12px; margin-right: 24px; }\n  .xt-eng-loop-host .el-mid { justify-content: flex-start; padding: 44px 0 44px 0; }\n  .xt-eng-loop-host .el-mid .el-label { margin-left: calc(50% + 14px); max-width: calc(50% - 14px); text-align: left; padding-inline: 0; }\n  .xt-eng-loop-host .el-node { padding: 16px; column-gap: 12px; }\n  .xt-eng-loop-host .el-node--sink { padding-block: 20px; }\n  .xt-eng-loop-host .el-node__t { font-size: 20px; }\n  .xt-eng-loop-host .el-node--sink .el-node__t { font-size: 22px; }\n  .xt-eng-loop-host .el-label--ret { position: static; transform: none; display: block; width: max-content; margin: 16px 0 0 calc(-1 * var(--el-pad) + 4px); }\n}\n\n/* paths__go (assets/xt.css, section 12) */\n.xt-eng-loop-host .paths__go { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; box-shadow: inset 0 0 0 1px var(--hair-strong); transition: background var(--t-fast), box-shadow var(--t-fast), color var(--t-fast); }\n.xt-eng-loop-host .paths__go::after { content: \"\"; width: 13px; height: 10px; background: currentColor;\n  -webkit-mask: url(\"data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 10'><path d='M0 5h12.5M8.5 1l4 4-4 4' fill='none' stroke='black' stroke-width='1.4'/></svg>\") center / contain no-repeat;\n          mask: url(\"data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 10'><path d='M0 5h12.5M8.5 1l4 4-4 4' fill='none' stroke='black' stroke-width='1.4'/></svg>\") center / contain no-repeat; }\n/* Placement from assets/pages/engineering.css (HOW IT WORKS); the 640px viewport rule becomes a container rule. */\n.xt-eng-loop-host { container-type: inline-size; }\n.xt-eng-loop-host *, .xt-eng-loop-host *::before, .xt-eng-loop-host *::after { box-sizing: border-box; }\n:where(.xt-eng-loop-host) :where(p, figure) { margin: 0; }\n/* engineering.css line 106, with 2.8vw (not 3vw) side padding: Framer keeps a 40px gutter at 810px where the site uses 16px, and this keeps the loop wide there as on the site. */\n.xt-eng-loop-host .ei-loop__stage { padding: clamp(24px, 4vw, 56px) clamp(0px, 2.8vw, 48px) clamp(16px, 2vw, 24px); }\n.xt-eng-loop-host .ei-loop__stage .v-eng-loop { max-width: 1040px; margin-inline: auto; }\n@container (max-width: 608px) { .xt-eng-loop-host .ei-loop__stage { padding-bottom: 0; } }\n`;/* Preset \"home\": the home-v2 segment well (site/assets/pages/home-v2.css .hv-seg__well + home-v2/engineering.css).\n   The canvas well frame owns the hairline, radius and soft fill; this renders the well's padding, light and the loop.\n   The well is the size container, as on the site; the 720px viewport rule becomes a container rule on the host. */const HOME_CSS=`.xt-eng-loop-host .hv-eng-well { position: relative; isolation: isolate; container-type: inline-size; padding: 32px; min-height: 420px; display: grid; place-items: center; }\n.xt-eng-loop-host .hv-eng-well > .atmos { position: absolute; inset: 0; width: auto; z-index: 0; }\n.xt-eng-loop-host .hv-eng-well > .v-eng-loop { position: relative; width: 100%; z-index: 1; --el-bg: var(--canvas-soft); }\n.xt-eng-loop-host .hv-eng-well .el-node--sink .el-node__t { font-size: clamp(22px, 1.95vw, 28px); }\n@container (max-width: 639px) { .xt-eng-loop-host .hv-eng-well .el-label--ret { background: transparent; } }\n@container (max-width: 700px) { .xt-eng-loop-host .hv-eng-well { padding: 20px; min-height: 0; } }\n/* Framer keeps a 40px gutter at 810px where the site uses 16px; slimmer side padding keeps the loop wide there, as on the site. */\n@container (min-width: 701px) and (max-width: 790px) { .xt-eng-loop-host .hv-eng-well { padding-inline: 20px; } }\n/* Site type scale at <=810px (assets/xt.css: --fs-h4 22px): node titles 22px as on the site; the stacked-loop 20px and sink sizes still apply. */\n@media (max-width: 810px) { .xt-eng-loop-host .hv-eng-well { --fs-h4: 22px; } }\n`;const HTML=`<div class=\"figure__stage ei-loop__stage\">\n        <div class=\"atmos\" aria-hidden=\"true\"><span class=\"orb orb--lavender\" style=\"--x:18%;--y:40%;--size:520px;--o:.45\"></span><span class=\"orb orb--sky\" style=\"--x:86%;--y:62%;--size:480px;--o:.4\"></span></div>\n<div class=\"v-eng-loop\" role=\"group\" aria-label=\"How a lesson travels in XTrace. Brains hold what the team knows and Rules hold what every agent follows; both go into every engineer's next session through the XTrace plugin. Sessions are where new lessons come from, and XTrace finds them automatically and feeds them back into the team's Brains and Rules.\">\n  <div class=\"el-grid\">\n    <div class=\"el-src\">\n      <a class=\"el-node\" href=\"#brains\">\n        <span class=\"el-node__k\"><i></i>Brains</span>\n        <span class=\"el-node__t\">What the team knows</span>\n        <span class=\"el-node__d\">Lessons, decisions and proven fixes, each with its source.</span>\n        <span class=\"paths__go\" aria-hidden=\"true\"></span>\n      </a>\n      <a class=\"el-node\" href=\"#rules\">\n        <span class=\"el-node__k\"><i></i>Rules</span>\n        <span class=\"el-node__t\">What every agent follows</span>\n        <span class=\"el-node__d\">Team standards drawn from your own history.</span>\n        <span class=\"paths__go\" aria-hidden=\"true\"></span>\n      </a>\n    </div>\n    <div class=\"el-mid\"><span class=\"el-label\">Into every engineer’s <b>next session</b></span></div>\n    <div class=\"el-sink\">\n      <a class=\"el-node el-node--sink\" href=\"#sessions\">\n        <span class=\"el-node__k\"><i></i>Sessions</span>\n        <span class=\"el-node__t\">Where new lessons come from</span>\n        <span class=\"el-node__d\">Your team’s AI coding work, captured where it happens.</span>\n        <span class=\"paths__go\" aria-hidden=\"true\"></span>\n      </a>\n    </div>\n  </div>\n  <span class=\"el-label el-label--ret\">New lessons, <b>found automatically</b></span>\n</div>\n      </div>`;// Home segment markup: the same loop (verbatim), node links to /engineering#…, home-v2 orbs (parts/engineering.html).\nconst HOME_HTML=`<div class=\"hv-eng-well\">\n<div class=\"atmos\" aria-hidden=\"true\"><span class=\"orb orb--lavender\" style=\"--x:16%;--y:30%;--size:440px;--o:.4\"></span><span class=\"orb orb--sky\" style=\"--x:88%;--y:70%;--size:400px;--o:.35\"></span></div>\n`+HTML.slice(HTML.indexOf('<div class=\"v-eng-loop\"'),HTML.lastIndexOf(\"</div>\")).replace(/href=\"#(brains|rules|sessions)\"/g,'href=\"/engineering#$1\"')+`</div>`;function install(){/* ==========================================================================\n   VISUAL · engineering-loop  ·  engineering-loop.js\n   Draws the wires of .v-eng-loop from the real node positions:\n     - forward (lavender): every source node (Brains, Rules) into Sessions\n     - return (sky, dashed): Sessions back to every source node (\"new lessons\")\n   Wide layout: sources left, Sessions right. Stacked: Sessions under the sources.\n   Redraws on resize (ResizeObserver). Comets play only while the figure is in\n   view; reduced motion or data-motion=\"off\" shows the static wires.\n   Self-initialises; window.XTEngLoop.mount(el) for late nodes.\n   ========================================================================== */(function(){\"use strict\";if(window.XTEngLoop)return;var NS=\"http://www.w3.org/2000/svg\";function el(name,attrs){var n=document.createElementNS(NS,name);for(var k in attrs)n.setAttribute(k,attrs[k]);return n;}function r(x){return Math.round(x*10)/10;}function draw(root){var svg=root.querySelector(\".el-wires\");if(!svg){svg=el(\"svg\",{\"class\":\"el-wires\",\"aria-hidden\":\"true\",focusable:\"false\"});root.insertBefore(svg,root.firstChild);}while(svg.firstChild)svg.removeChild(svg.firstChild);var box=root.getBoundingClientRect();if(!box.width)return;var srcs=Array.prototype.filter.call(root.querySelectorAll(\".el-src .el-node\"),function(n){return!n.hidden&&!n.classList.contains(\"el-node--aside\");});var sink=root.querySelector(\".el-node--sink\");var aside=root.querySelector(\".el-node--aside:not([hidden])\");if(!srcs.length||!sink)return;function rect(n){var b=n.getBoundingClientRect();return{l:b.left-box.left,t:b.top-box.top,r:b.right-box.left,b:b.bottom-box.top,w:b.width,h:b.height};}var S=rect(sink),R=srcs.map(rect);var stacked=S.t>R[R.length-1].b-1;var pad=parseFloat(getComputedStyle(root).getPropertyValue(\"--el-pad\"))||40;var railX=r(pad*.42);var paths=[];function wire(d,kind,i){svg.appendChild(el(\"path\",{\"class\":\"el-wire el-wire--\"+kind,d:d}));paths.push({d:d,kind:kind,i:i});}function head(x,y,dir,kind){// small open chevron, 5px, pointing in dir: 'r' | 'd' | 'l' | 'u'\nvar s=5,d;if(dir===\"r\")d=\"M\"+(x-s)+\" \"+(y-s)+\" L\"+x+\" \"+y+\" L\"+(x-s)+\" \"+(y+s);else if(dir===\"d\")d=\"M\"+(x-s)+\" \"+(y-s)+\" L\"+x+\" \"+y+\" L\"+(x+s)+\" \"+(y-s);else if(dir===\"u\")d=\"M\"+(x-s)+\" \"+(y+s)+\" L\"+x+\" \"+y+\" L\"+(x+s)+\" \"+(y+s);else d=\"M\"+(x+s)+\" \"+(y-s)+\" L\"+x+\" \"+y+\" L\"+(x+s)+\" \"+(y+s);svg.appendChild(el(\"path\",{\"class\":\"el-head el-head--\"+kind,d:d}));}if(!stacked){// forward: each source's right edge into the sink's left edge, fanned around its middle\nvar n=R.length,cy=S.t+S.h/2,spread=Math.min(18,S.h/6);R.forEach(function(a,i){var y0=r(a.t+a.h/2),y1=r(cy+(i-(n-1)/2)*spread*2),x0=r(a.r),x1=r(S.l-2),mx=r((x0+x1)/2);wire(\"M\"+x0+\" \"+y0+\" C\"+mx+\" \"+y0+\" \"+mx+\" \"+y1+\" \"+x1+\" \"+y1,\"fwd\",i);head(x1,y1,\"r\",\"fwd\");});// return: down from the sink, left under everything, up the rail, into each source's left edge\nvar bx=r(S.l+S.w/2),by0=r(S.b),floor=r(Math.max(S.b,rect(root.querySelector(\".el-src\")).b)+44),rad=12;R.forEach(function(a,i){var ty=r(a.t+a.h/2),tx=r(a.l-2);var d=\"M\"+bx+\" \"+by0+\" V\"+(floor-rad)+\" Q\"+bx+\" \"+floor+\" \"+(bx-rad)+\" \"+floor+\" H\"+(railX+rad)+\" Q\"+railX+\" \"+floor+\" \"+railX+\" \"+(floor-rad)+\" V\"+(ty+rad)+\" Q\"+railX+\" \"+ty+\" \"+(railX+rad)+\" \"+ty+\" H\"+tx;wire(d,\"ret\",i);head(tx,ty,\"r\",\"ret\");});// label sits on the floor segment\nvar lab=root.querySelector(\".el-label--ret\");if(lab){lab.style.left=r((railX+bx)/2)+\"px\";lab.style.bottom=\"auto\";lab.style.top=r(floor-lab.offsetHeight/2)+\"px\";}}else{// forward: a trunk down the middle from the last source into the sink; sources join it on the right\nvar tx2=r(S.l+S.w/2),last=R[R.length-1];R.forEach(function(a,i){var d;if(i===R.length-1)d=\"M\"+tx2+\" \"+r(a.b)+\" V\"+r(S.t-2);else{// join the trunk through the channel to the right of the sources\nvar cx=r(a.r+12),y=r(a.t+a.h/2),jy=r(last.b+20);d=\"M\"+r(a.r)+\" \"+y+\" H\"+(cx-8)+\" Q\"+cx+\" \"+y+\" \"+cx+\" \"+(y+8)+\" V\"+(jy-8)+\" Q\"+cx+\" \"+jy+\" \"+(cx-8)+\" \"+jy+\" H\"+(tx2+8)+\" Q\"+tx2+\" \"+jy+\" \"+tx2+\" \"+(jy+8)+\" V\"+r(S.t-2);}wire(d,\"fwd\",i);});head(tx2,r(S.t-2),\"d\",\"fwd\");// return: from the sink's left edge, up the rail, into each source\nvar sy=r(S.t+S.h/2),rad2=10;R.forEach(function(a,i){var ty=r(a.t+a.h/2),tx=r(a.l-2);var d=\"M\"+r(S.l)+\" \"+sy+\" H\"+(railX+rad2)+\" Q\"+railX+\" \"+sy+\" \"+railX+\" \"+(sy-rad2)+\" V\"+(ty+rad2)+\" Q\"+railX+\" \"+ty+\" \"+(railX+rad2)+\" \"+ty+\" H\"+tx;wire(d,\"ret\",i);head(tx,ty,\"r\",\"ret\");});var lab2=root.querySelector(\".el-label--ret\");if(lab2){lab2.style.left=\"\";lab2.style.top=\"\";lab2.style.bottom=\"\";}}// optional aside node (e.g. Routines): a quiet dotted tie from the first source, no comet\nif(aside){var A=rect(aside),f=R[0];var ax=r(f.l+28);var dA=\"M\"+ax+\" \"+r(R[R.length-1].b)+\" V\"+r(A.t-2);var p=el(\"path\",{\"class\":\"el-wire el-wire--ret\",d:dA,style:\"stroke-dasharray:1 4\"});svg.appendChild(p);}// comets ride the same paths\npaths.forEach(function(p){svg.appendChild(el(\"path\",{\"class\":\"el-comet el-comet--\"+p.kind,d:p.d,pathLength:\"100\",style:\"--i:\"+p.i}));});root.classList.toggle(\"is-stacked\",stacked);}function mount(root){if(root.__elMounted)return;root.__elMounted=true;var raf=0;function schedule(){if(raf)return;raf=requestAnimationFrame(function(){raf=0;draw(root);});}draw(root);if(window.ResizeObserver)new ResizeObserver(schedule).observe(root);else window.addEventListener(\"resize\",schedule);if(document.fonts&&document.fonts.ready)document.fonts.ready.then(schedule);window.addEventListener(\"load\",schedule);if(\"IntersectionObserver\"in window){new IntersectionObserver(function(es){es.forEach(function(e){root.classList.toggle(\"is-live\",e.isIntersecting);});},{threshold:.2}).observe(root);}else root.classList.add(\"is-live\");}function init(){Array.prototype.forEach.call(document.querySelectorAll(\".v-eng-loop\"),mount);}window.XTEngLoop={mount:mount,redraw:draw};if(document.readyState===\"loading\")document.addEventListener(\"DOMContentLoaded\",init);else init();})();}/**\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight auto\n */export default function XTEngineeringLoop(props){const{style}=props;const animated=useAnimated();const host=React.useRef(null);const home=props.preset===\"home\";let html=home?HOME_HTML:HTML;if(!animated||props.motion===false)html=html.replace('<div class=\"v-eng-loop\"','<div class=\"v-eng-loop\" data-motion=\"off\"');if(props.atmos===false)html=html.replace(/<div class=\"atmos\"[\\s\\S]*?<\\/div>/,\"\");const key=html.length+\":\"+String(animated)+String(props.motion)+String(props.atmos)+String(props.preset);React.useEffect(()=>{const box=host.current;if(!box)return;let cancelSized=()=>{};let ids=[];const cancel=afterPaint(()=>{cancelSized=whenSized(box,()=>{once(\"XTEngLoop\",install);const el=box.querySelector(\".v-eng-loop\");const api=window.XTEngLoop;if(el&&api){api.mount(el);const redraw=()=>api.redraw(el);ids=[80,400,1200,2500].map(ms=>setTimeout(redraw,ms));}});});return()=>{cancel();cancelSized();ids.forEach(clearTimeout);};},[key]);return /*#__PURE__*/_jsxs(\"div\",{ref:host,className:\"xtcc xt-eng-loop-host\",style:{width:\"100%\",fontFamily:\"var(--sans)\",letterSpacing:\"-0.04em\",color:\"var(--ink)\",WebkitFontSmoothing:\"antialiased\",...style},children:[/*#__PURE__*/_jsx(XTStyle,{css:XT_FONT_IMPORT}),/*#__PURE__*/_jsx(XTStyle,{css:XT_BASE_CSS+XT_LOCKUP_CSS+CSS+(home?HOME_CSS:\"\")}),/*#__PURE__*/_jsx(\"div\",{style:{display:\"contents\"},dangerouslySetInnerHTML:{__html:html}},key)]});}XTEngineeringLoop.displayName=\"XT Engineering loop\";addPropertyControls(XTEngineeringLoop,{preset:{type:ControlType.Enum,title:\"Preset\",options:[\"engineering\",\"home\"],optionTitles:[\"Engineering page\",\"Home segment\"],defaultValue:\"engineering\"},motion:{type:ControlType.Boolean,title:\"Motion\",defaultValue:true},atmos:{type:ControlType.Boolean,title:\"Atmosphere\",defaultValue:true}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"XTEngineeringLoop\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"auto\",\"framerSupportedLayoutWidth\":\"any\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./XTEngineeringLoop.map"],"mappings":"A,0SA+M+J,SAASsB,GAAS,EAShG,UAAU,CAAc,GAAGlB,EAAO,UAAU,OAAO,IAAImB,EAAG,6BAA6B,SAASC,EAAG,EAAK,EAAM,CAAC,IAAIC,EAAE,SAAS,gBAAgBF,EAAGG,CAAI,EAAE,IAAI,IAAIC,KAAKC,EAAMH,EAAE,aAAaE,EAAEC,EAAMD,EAAE,EAAE,OAAOF,CAAE,CAAC,SAASI,EAAE,EAAE,CAAC,OAAO,KAAK,MAAMC,EAAE,EAAE,EAAE,EAAG,CAAC,SAASC,EAAK,EAAK,CAAC,IAAIC,EAAIC,EAAK,cAAc,WAAW,EAA6H,IAAvHD,IAAK,EAAIR,EAAG,MAAM,CAACU,MAAQ,WAAW,cAAc,OAAO,UAAU,OAAO,CAAC,EAAED,EAAK,aAAaD,EAAIC,EAAK,UAAU,GAASD,EAAI,YAAWA,EAAI,YAAYA,EAAI,UAAU,EAAE,IAAIG,EAAIF,EAAK,sBAAsB,EAAE,GAAG,CAACE,EAAI,MAAM,OAAO,IAAIC,EAAK,MAAM,U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