@tscircuit/runframe 0.0.382 → 0.0.384

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -483,10 +483,9 @@ var getRandomTipForUser = () => {
483
483
 
484
484
  // lib/components/PreviewEmptyState.tsx
485
485
  import { LightbulbIcon, PlayIcon } from "lucide-react";
486
- import { useMemo } from "react";
487
486
  import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
487
+ var tipHtml = getRandomTipForUser();
488
488
  var PreviewEmptyState = ({ onRunClicked }) => {
489
- const tipHtml = useMemo(() => getRandomTipForUser(), []);
490
489
  return /* @__PURE__ */ jsxs5("div", { className: "rf-flex rf-flex-col rf-items-center rf-justify-center rf-h-full rf-bg-gray-50 rf-text-gray-500 rf-p-4", children: [
491
490
  /* @__PURE__ */ jsx7(LightbulbIcon, { className: "rf-size-14 rf-mb-4" }),
492
491
  /* @__PURE__ */ jsxs5("p", { className: "rf-text-md rf-break-words rf-max-w-xl rf-text-center", children: [
@@ -1037,7 +1036,7 @@ var RenderLogViewer = ({
1037
1036
  };
1038
1037
 
1039
1038
  // package.json
1040
- var version = "0.0.381";
1039
+ var version = "0.0.383";
1041
1040
 
1042
1041
  // lib/components/CircuitJsonPreview/CircuitJsonPreview.tsx
1043
1042
  import { jsx as jsx16, jsxs as jsxs12 } from "react/jsx-runtime";
package/dist/preview.js CHANGED
@@ -8,7 +8,7 @@ import {
8
8
  linkify,
9
9
  useOrderDialog,
10
10
  useOrderDialogCli
11
- } from "./chunk-JSQ3BBND.js";
11
+ } from "./chunk-HEIZC2EP.js";
12
12
  export {
13
13
  BomTable,
14
14
  CadViewer,
package/dist/runner.js CHANGED
@@ -26,7 +26,7 @@ import {
26
26
  useOrderDialog,
27
27
  useOrderDialogCli,
28
28
  useRunFrameStore
29
- } from "./chunk-JSQ3BBND.js";
29
+ } from "./chunk-HEIZC2EP.js";
30
30
 
31
31
  // lib/components/RunFrame/RunFrame.tsx
32
32
  import { createCircuitWebWorker } from "@tscircuit/eval/worker";
@@ -13393,4 +13393,4 @@ ${r.slice(0,2e3)}
13393
13393
  50% { opacity: 0.2; }
13394
13394
  100% { opacity: 0.6; }
13395
13395
  }
13396
- `,i.appendChild(O)}})}};a();const o=new MutationObserver(a);return o.observe(i,{childList:!0,subtree:!1,characterData:!1}),()=>{o.disconnect()}},[n,t,e,r])},lsn=Rg("schematic-viewer"),csn=()=>{Rg.enable("schematic-viewer*")},usn=lsn,fsn=n=>{const[e,t]=yt.useState(0),[r,i]=yt.useState(0);return yt.useEffect(()=>{if(!n.current)return;const a=()=>{var l;const s=(l=n.current)==null?void 0:l.getBoundingClientRect();t((s==null?void 0:s.width)||0),i((s==null?void 0:s.height)||0)};a();const o=new ResizeObserver(a);return o.observe(n.current),window.addEventListener("resize",a),()=>{o.disconnect(),window.removeEventListener("resize",a)}},[]),{containerWidth:e,containerHeight:r}},dsn=usn.extend("useComponentDragging"),psn=({onEditEvent:n,editEvents:e=[],circuitJson:t,cancelDrag:r,svgToScreenProjection:i,realToSvgProjection:a,enabled:o=!1})=>{const[s,l]=yt.useState(null),c=n0(a,i),u=yt.useRef(null),f=yt.useRef(null),h=yt.useRef(new Map);yt.useEffect(()=>{e.forEach(S=>{"edit_event_type"in S&&S.edit_event_type==="edit_schematic_component_location"&&!S.in_progress&&h.current.set(S.schematic_component_id,{...S.new_center})})},[e]);const y=yt.useCallback(S=>{if(!o)return;const A=S.target.closest('[data-circuit-json-type="schematic_component"]');if(!A)return;const O=A.getAttribute("data-schematic-component-id");if(!O)return;r&&r();const k=Tv(t).schematic_component.get(O);if(!k)return;u.current={x:S.clientX,y:S.clientY};let $;const Y=h.current.get(O);if(Y)$={...Y};else{const K=O$e({editEvents:e,schematic_component_id:O});$={x:k.center.x+K.x,y:k.center.y+K.y},h.current.set(O,{...$})}const Q={edit_event_id:Math.random().toString(36).substr(2,9),edit_event_type:"edit_schematic_component_location",schematic_component_id:O,original_center:$,new_center:{...$},in_progress:!0,created_at:Date.now(),_element:A};f.current=Q,l(Q)},[r,o,t,e]),x=yt.useCallback(S=>{if(!f.current||!u.current)return;const E={x:S.clientX-u.current.x,y:S.clientY-u.current.y},A={x:E.x/c.a,y:E.y/c.d},O={...f.current,new_center:{x:f.current.original_center.x+A.x,y:f.current.original_center.y+A.y}};f.current=O,l(O)},[c]),M=yt.useCallback(()=>{if(!f.current)return;const S={...f.current,in_progress:!1};h.current.set(S.schematic_component_id,{...S.new_center}),dsn("handleMouseUp calling onEditEvent with new edit event",{newEditEvent:S}),n&&n(S),f.current=null,u.current=null,l(null)},[n]);return yt.useEffect(()=>(window.addEventListener("mousemove",x),window.addEventListener("mouseup",M),()=>{window.removeEventListener("mousemove",x),window.removeEventListener("mouseup",M)}),[x,M]),{handleMouseDown:y,isDragging:!!f.current,activeEditEvent:s}},hsn=({onClick:n,active:e})=>dt.jsx("div",{onClick:n,style:{position:"absolute",top:"16px",right:"16px",backgroundColor:e?"#4CAF50":"#fff",color:e?"#fff":"#000",padding:"8px",borderRadius:"4px",cursor:"pointer",boxShadow:"0 2px 4px rgba(0,0,0,0.1)",display:"flex",alignItems:"center",gap:"4px",zIndex:1e3},children:dt.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[dt.jsx("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),dt.jsx("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"})]})}),msn=({circuitJson:n,containerStyle:e,editEvents:t=[],onEditEvent:r,defaultEditMode:i=!1,debugGrid:a=!1,editingEnabled:o=!1,debug:s=!1,clickToInteractEnabled:l=!1,colorOverrides:c})=>{s&&csn();const[u,f]=yt.useState(i),[h,y]=yt.useState(!l),x=yt.useRef(null),[M,S]=yt.useState([]),E=yt.useRef(n),A=Se=>`${(Se==null?void 0:Se.length)||0}_${(Se==null?void 0:Se.editCount)||0}`;yt.useEffect(()=>{const Se=A(n),Ce=A(E.current);Se!==Ce&&(S([]),E.current=n)},[n]);const{ref:O,cancelDrag:k,transform:$}=L$e({onSetTransform(Se){x.current&&(x.current.style.transform=c6(Se))},enabled:h}),{containerWidth:Y,containerHeight:Q}=fsn(O),K=yt.useMemo(()=>!Y||!Q?"":Oue(n,{width:Y,height:Q||720,grid:a?{cellSize:1,labelCells:!0}:void 0,colorOverrides:c}),[n,Y,Q]),ie=yt.useMemo(()=>{var Ce;if(!K)return Z9();const Se=(Ce=K.match(/data-real-to-screen-transform="([^"]+)"/))==null?void 0:Ce[1];try{return yH(Se)}catch(Ee){return console.error(Ee),Z9()}},[K]),ee=Se=>{S(Ce=>[...Ce,Se]),r&&r(Se)},de=yt.useMemo(()=>[...t,...M],[t,M]),{handleMouseDown:me,isDragging:_e,activeEditEvent:Me}=psn({onEditEvent:ee,cancelDrag:k,realToSvgProjection:ie,svgToScreenProjection:$,circuitJson:n,editEvents:de,enabled:u&&h});osn({svgDivRef:x,editEvents:de,realToSvgProjection:ie,svgToScreenProjection:$,activeEditEvent:Me}),ssn({svgDivRef:x,circuitJson:n,activeEditEvent:Me,editEvents:de});const Pe=yt.useMemo(()=>dt.jsx("div",{ref:x,style:{pointerEvents:l?h?"auto":"none":"auto",transformOrigin:"0 0"},dangerouslySetInnerHTML:{__html:K}}),[K,h,l]);return dt.jsxs("div",{ref:O,style:{position:"relative",backgroundColor:"#F5F1ED",overflow:"hidden",cursor:_e?"grabbing":l&&!h?"pointer":"grab",minHeight:"300px",...e},onMouseDown:Se=>{if(l&&!h){Se.preventDefault(),Se.stopPropagation();return}me(Se)},onMouseDownCapture:Se=>{if(l&&!h){Se.preventDefault(),Se.stopPropagation();return}},children:[!h&&l&&dt.jsx("div",{onClick:Se=>{Se.preventDefault(),Se.stopPropagation(),y(!0)},style:{position:"absolute",inset:0,cursor:"pointer",zIndex:10,display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"all"},children:dt.jsx("div",{style:{backgroundColor:"rgba(0, 0, 0, 0.8)",color:"white",padding:"12px 24px",borderRadius:"8px",fontSize:"16px",fontFamily:"sans-serif",pointerEvents:"none"},children:"Click to Interact"})}),o&&dt.jsx(hsn,{active:u,onClick:()=>f(!u)}),Pe]})},vsn=n=>{const[e,t]=yt.useState(0),[r,i]=yt.useState(0);return yt.useEffect(()=>{if(!n.current)return;const a=()=>{var l;const s=(l=n.current)==null?void 0:l.getBoundingClientRect();t((s==null?void 0:s.width)||0),i((s==null?void 0:s.height)||0)};a();const o=new ResizeObserver(a);return o.observe(n.current),window.addEventListener("resize",a),()=>{o.disconnect(),window.removeEventListener("resize",a)}},[]),{containerWidth:e,containerHeight:r}};Rg("assembly-viewer");var ysn=()=>{Rg.enable("assembly-viewer*")},gsn=({circuitJson:n,containerStyle:e,debugGrid:t=!1,debug:r=!1})=>{r&&ysn();const i=yt.useRef(null),{ref:a}=L$e({onSetTransform(u){i.current&&(i.current.style.transform=c6(u))}}),{containerWidth:o,containerHeight:s}=vsn(a),l=yt.useMemo(()=>!o||!s?"":M$e(n,{width:o,height:s||720}),[n,o,s]);yt.useMemo(()=>{var f;if(!l)return Z9();const u=(f=l.match(/data-real-to-screen-transform="([^"]+)"/))==null?void 0:f[1];try{return yH(u)}catch(h){return console.error(h),Z9()}},[l]);const c=yt.useMemo(()=>dt.jsx("div",{ref:i,style:{pointerEvents:"auto",transformOrigin:"0 0"},dangerouslySetInnerHTML:{__html:l}}),[l]);return dt.jsx("div",{ref:a,style:{position:"relative",backgroundColor:"#F5F1ED",overflow:"hidden",minHeight:"300px",...e},children:c})};const z$e=["Always initialize your project using [tsci init](https://github.com/tscircuit/cli) before adding components.","Define reusable modules with cached routes using [<subcircuit />](https://docs.tscircuit.com/elements/subcircuit)","Run `tsci dev` on the command line to preview your boards before export","Use units like mm or mils consistently across your designs.","Quickly set footprints with the [footprint prop](https://docs.tscircuit.com/footprints/footprinter-strings)","Check out the guide on [ordering prototypes](https://docs.tscircuit.com/building-electronics/ordering-prototypes)","Use [net labels](https://docs.tscircuit.com/elements/net) and [group elements](https://docs.tscircuit.com/elements/group) to organize complex schematics.","You can manually drag components on the PCB and Schematic using [manual edits](https://docs.tscircuit.com/guides/manual-edits)","Every tscircuit module can export to [Circuit JSON](https://github.com/tscircuit/circuit-json), Gerbers, Pick'n'Place CSV files, Bill of Materials CSV and more","You can import components from [JLCPCB](https://docs.tscircuit.com/guides/importing-modules-and-chips/importing-from-jlcpcb) or [KiCad](https://docs.tscircuit.com/guides/importing-modules-and-chips/importing-from-kicad)","Any module you push to the [registry](https://tscircuit.com/trending) will have [simple image urls](https://docs.tscircuit.com/web-apis/image-generation-api) you can use display images on a website","The default [Parts Engine](https://docs.tscircuit.com/guides/platform-configuration) will automatically find parts from common vendors for your BOM",'[Pin selectors](https://docs.tscircuit.com/guides/using-sel-references) are similar to CSS selectors, ".R1 > .pin1" means "connect to the first pin of the component R1"',"You can use the [sel](https://docs.tscircuit.com/guides/using-sel-references) object to select pins in a type-safe way","Publish modules via the [registry](https://tscircuit.com/trending) for working with a team or sharing your work","[Explore tutorials](https://docs.tscircuit.com/category/tutorials) for real-world circuit design examples.","Upload your Circuit JSON to [circuitjson.com](https://circuitjson.com) for a quick preview.","You can display Circuit JSON in 3D, PCB or Schematic mode with the [<CircuitJsonPreview />](https://docs.tscircuit.com/elements/circuitjsonpreview) React component","Use a [<group />](https://docs.tscircuit.com/elements/group) element to move multiple components at once in a schematic or PCB layout.","Refer to the [GitHub Discussions page](https://github.com/tscircuit/tscircuit/discussions) to request features","You can customize the autorouter using the [autorouter prop](https://docs.tscircuit.com/elements/board#setting-the-autorouter)","Use the [<constraint />](https://docs.tscircuit.com/footprints/constraint) element to enforce geometric relationships in PCB designs.","Join the [Discord server](https://tscircuit.com/join) to discuss issues and get help directly from the community."],_sn=()=>{let n=z$e[Math.floor(Math.random()*z$e.length)];return n=n.replace(/</g,"&lt;"),n=n.replace(/>/g,"&gt;"),n=n.replace(new RegExp('(?<!href=")(?<!\\()(?<!\\]\\()(https?:\\/\\/[^\\s\\)\\]]+)',"g"),(e,t)=>`<a class="rf-text-blue-500 rf-underline" href="${e}" target="_blank">${e}</a>`),n=n.replace(/\[([^\]]+)\]\((https?:\/\/[^\)]+)\)/g,'<a class="rf-text-blue-500 rf-underline" href="$2" target="_blank">$1</a>'),n},k7=({onRunClicked:n})=>{const e=yt.useMemo(()=>_sn(),[]);return dt.jsxs("div",{className:"rf-flex rf-flex-col rf-items-center rf-justify-center rf-h-full rf-bg-gray-50 rf-text-gray-500 rf-p-4",children:[dt.jsx(KZt,{className:"rf-size-14 rf-mb-4"}),dt.jsxs("p",{className:"rf-text-md rf-break-words rf-max-w-xl rf-text-center",children:["Tip: ",dt.jsx("span",{dangerouslySetInnerHTML:{__html:e}})]}),n&&dt.jsxs($8,{className:"rf-mt-4 rf-bg-blue-600 rf-hover:bg-blue-500",onClick:n,children:["Run Code",dt.jsx(eQt,{className:"rf-w-3 rf-h-3 rf-ml-2"})]})]})},xB=({text:n,onClick:e})=>dt.jsx("span",{className:"rf-cursor-pointer rf-underline rf-text-blue-600 rf-mx-2",onClick:e,children:n}),bB=n=>{var e;return dt.jsxs("div",{className:"rf-leading-5",children:[dt.jsx("div",{className:"rf-py-2 rf-font-bold",children:n.column.name}),dt.jsx("div",{children:((e=n.field)==null?void 0:e.call(n))??dt.jsx("input",{type:"text",className:"rf-border rf-rounded rf-p-1 rf-w-full",onChange:t=>{var r;(r=n.onTextChange)==null||r.call(n,t.target.value)}})})]})},xsn=({open:n,children:e,title:t,onClose:r})=>n?dt.jsx("div",{className:"rf-fixed rf-inset-0 rf-bg-black rf-bg-opacity-50 rf-flex rf-justify-center rf-items-center rf-z-50",onClick:r,children:dt.jsxs("div",{className:"rf-bg-white rf-p-5 rf-rounded-lg rf-relative rf-w-11/12 rf-max-w-2xl",onClick:i=>{i.preventDefault(),i.stopPropagation()},children:[dt.jsx("h2",{className:"rf-mt-0 rf-text-md rf-pb-4",children:t}),dt.jsx("button",{type:"button",className:"rf-absolute rf-top-2 rf-right-4 rf-text-2xl rf-font-bold",onClick:r,children:"×"}),e]})}):null,bsn=({elements:n})=>{const[e,t]=yt.useState({open:!1}),[r,i]=yt.useReducer((u,f)=>({...u,...f}),{}),a=[...new Set(n.map(u=>u.type))],o=n.map(u=>{const f=u[`${u.type}_id`],h=Object.fromEntries(Object.entries(u).filter(([x])=>!(x===`${u.type}_id`||!x.endsWith("_id")))),y=Object.fromEntries(Object.entries(u).filter(([x])=>!x.endsWith("_id")));return{primary_id:f,other_ids:h,...y,_og_elm:u}}),s=o.map(u=>{let f="";const h=y=>{const x=Object.keys(y.other_ids).find(E=>E.startsWith("source_"));if(!x)return`.${y.name}`;const M=x.slice(0,-3),S=o.find(E=>E.type===M&&E.primary_id===y.other_ids[x]);return S?"name"in S?`${h(S)} > .${y.name}`:`#${S.primary_id} > .${y.name}`:`??? > .${y.name}`};return"name"in u&&(f=h(u)),{...u,selector_path:f}}),l=[{key:"primary_id",name:"primary_id",renderCell:u=>dt.jsxs("div",{className:"rf-flex rf-items-center",children:[dt.jsx(xB,{text:u.primary_id,onClick:()=>i({focused_id:u.primary_id,id_search:void 0,selector_search:void 0})}),dt.jsx("span",{className:"rf-flex-grow"}),dt.jsx(xB,{text:"(JSON)",onClick:()=>t({open:!0,element:u._og_elm,title:u.primary_id})})]}),renderHeaderCell:u=>dt.jsx(bB,{column:u,onTextChange:f=>i({id_search:f}),field:r.focused_id?()=>dt.jsxs("div",{children:["Focus:"," ",dt.jsx("span",{className:"rf-underline",children:r.focused_id}),dt.jsx(xB,{text:"(unfocus)",onClick:()=>i({focused_id:void 0})})]}):void 0})},{key:"type",name:"type",renderHeaderCell:u=>dt.jsx(bB,{column:u,field:()=>dt.jsxs("select",{onChange:f=>i({component_type_filter:f.target.value}),className:"rf-border rf-rounded rf-p-1 rf-w-full",children:[dt.jsx("option",{value:"any",children:"any"},"any"),dt.jsx("option",{value:"source",children:"source"},"source"),dt.jsx("option",{value:"source/pcb",children:"source/pcb"},"source/pcb"),dt.jsx("option",{value:"source/schematic",children:"source/schematic"},"source/schematic"),a.map(f=>dt.jsx("option",{value:f,children:f},f))]})})},{key:"name",name:"name",renderHeaderCell:u=>dt.jsx(bB,{column:u,onTextChange:f=>i({name_search:f})})},{key:"selector_path",name:"selector_path",renderHeaderCell:u=>dt.jsx(bB,{column:u,onTextChange:f=>i({selector_search:f})})},{key:"other_ids",name:"other_ids",renderCell:u=>dt.jsx("div",{className:"rf-space-x-2",children:Object.entries(u.other_ids).map(([f,h])=>dt.jsx(xB,{text:h,onClick:()=>i({focused_id:h})},h))})}],c=s.filter(u=>{var f,h;return r.name_search?(h=(f=u.name)==null?void 0:f.toLowerCase())==null?void 0:h.includes(r.name_search.toLowerCase()):!0}).filter(u=>{var f;return!r.component_type_filter||r.component_type_filter==="any"?!0:r.component_type_filter==="source"?u.type.startsWith("source_"):r.component_type_filter==="source/pcb"?u.type.startsWith("source_")||u.type.startsWith("pcb_"):r.component_type_filter==="source/schematic"?u.type.startsWith("source_")||u.type.startsWith("schematic_"):(f=u.type)==null?void 0:f.includes(r.component_type_filter)}).filter(u=>r.selector_search?r.selector_search.split(" ").filter(h=>h.length>0).every(h=>{var y;return(y=u.selector_path)==null?void 0:y.includes(h)}):!0).filter(u=>{var f;return r.id_search?(f=u.primary_id)==null?void 0:f.includes(r.id_search):!0}).filter(u=>!!(!r.focused_id||u.primary_id===r.focused_id||Object.values(u.other_ids).includes(r.focused_id)));return dt.jsxs("div",{className:"rf-font-mono rf-text-xs rf-bg-white",children:[dt.jsx("div",{className:"rf-overflow-x-auto",children:dt.jsxs("table",{className:"rf-table-auto rf-w-full rf-text-left",children:[dt.jsx("thead",{children:dt.jsx("tr",{children:l.map(u=>dt.jsx("th",{className:"rf-px-4 rf-py-2 rf-border-b",children:u.renderHeaderCell?u.renderHeaderCell(u):u.name},u.key))})}),dt.jsx("tbody",{children:c.map((u,f)=>dt.jsx("tr",{className:"rf-hover:bg-gray-100",children:l.map(h=>dt.jsx("td",{className:"rf-px-4 rf-py-2 rf-border-b",children:h.renderCell?h.renderCell(u):u[h.key]},h.key))},f))})]})}),dt.jsx(xsn,{open:e.open,onClose:()=>t({open:!1}),title:e.open?e.title:"",children:dt.jsx("div",{className:"rf-bg-gray-800 rf-p-3 rf-text-white rf-rounded",children:dt.jsx("pre",{className:"rf-whitespace-pre-wrap",children:e.open?JSON.stringify(e.element,null,2):""})})})]})},Ssn=(n,e)=>n==="jlcpcb"?dt.jsx("a",{className:"rf-underline rf-text-blue-500",target:"_blank",rel:"noreferrer",href:`https://jlcpcb.com/partdetail/${e}`,children:e}):e,Esn=({circuitJson:n})=>{const e=n.filter(r=>r.type==="source_component"),t=new Set;for(const r of e)if(r.supplier_part_numbers)for(const i of Object.keys(r.supplier_part_numbers))t.add(i);return dt.jsx("div",{className:"rf-overflow-x-auto",children:dt.jsxs("table",{className:"rf-w-full rf-text-left rf-text-sm",children:[dt.jsx("thead",{children:dt.jsxs("tr",{className:"rf-border-b",children:[dt.jsx("th",{className:"rf-p-2",children:"Name"}),Array.from(t).map(r=>dt.jsx("th",{className:"rf-p-2 rf-capitalize",children:r},r))]})}),dt.jsx("tbody",{children:e.map(r=>dt.jsxs("tr",{className:"rf-border-b",children:[dt.jsx("td",{className:"rf-p-2",children:r.name}),Array.from(t).map(i=>{var a,o;return dt.jsx("td",{className:"rf-p-2",children:Ssn(i,((o=(a=r.supplier_part_numbers)==null?void 0:a[i])==null?void 0:o[0])||"")},i)})]},r.source_component_id))})]})})},wsn=({containerClassName:n,...e})=>{const t=yt.useRef(null),[r,i]=yt.useState(620);return yt.useLayoutEffect(()=>{const a=()=>{if(t.current){const s=t.current.clientHeight,l=window.innerHeight;i(Math.min(Math.max(s,620),l))}};a();const o=new ResizeObserver(a);return t.current&&o.observe(t.current),window.addEventListener("resize",a),()=>{o.disconnect(),window.removeEventListener("resize",a)}},[]),dt.jsx("div",{ref:t,className:n||"rf-w-full rf-h-full",children:dt.jsx(zZt,{...e,height:r})})},Tsn='*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }/*! tailwindcss v3.4.17 | MIT License | https://tailwindcss.com*/*,:after,:before{border:0 solid #e5e7eb;box-sizing:border-box}:after,:before{--tw-content:""}:host,html{line-height:1.5;-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-tap-highlight-color:transparent}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{color:inherit;font-family:inherit;font-feature-settings:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{color:#9ca3af;opacity:1}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]:where(:not([hidden=until-found])){display:none}:root{--radius:0.5rem}.rf-pointer-events-none{pointer-events:none}.rf-invisible{visibility:hidden}.rf-fixed{position:fixed}.rf-absolute{position:absolute}.rf-relative{position:relative}.rf-inset-0{inset:0}.-rf-left-2{left:-.5rem}.-rf-right-10{right:-2.5rem}.-rf-right-2{right:-.5rem}.-rf-right-4{right:-1rem}.-rf-right-6{right:-1.5rem}.-rf-right-7{right:-1.75rem}.-rf-right-8{right:-2rem}.-rf-right-9{right:-2.25rem}.rf-bottom-full{bottom:100%}.rf-left-0{left:0}.rf-left-1{left:.25rem}.rf-left-1\\/2{left:50%}.rf-left-2{left:.5rem}.rf-left-\\[50\\%\\]{left:50%}.rf-right-0{right:0}.rf-right-4{right:1rem}.rf-right-\\[4px\\]{right:4px}.rf-top-0{top:0}.rf-top-1{top:.25rem}.rf-top-2{top:.5rem}.rf-top-2\\.5{top:.625rem}.rf-top-\\[50\\%\\]{top:50%}.rf-top-\\[6px\\]{top:6px}.rf-z-50{z-index:50}.rf-z-\\[100\\]{z-index:100}.-rf-mx-1,.rf--mx-1{margin-left:-.25rem;margin-right:-.25rem}.rf-mx-1{margin-left:.25rem;margin-right:.25rem}.rf-mx-2{margin-left:.5rem;margin-right:.5rem}.rf-mx-auto{margin-left:auto;margin-right:auto}.rf-my-1{margin-bottom:.25rem;margin-top:.25rem}.rf-my-12{margin-bottom:3rem;margin-top:3rem}.rf-my-4{margin-bottom:1rem;margin-top:1rem}.rf-my-auto{margin-bottom:auto;margin-top:auto}.rf-mb-1{margin-bottom:.25rem}.rf-mb-12{margin-bottom:3rem}.rf-mb-2{margin-bottom:.5rem}.rf-mb-3{margin-bottom:.75rem}.rf-mb-4{margin-bottom:1rem}.rf-mb-6{margin-bottom:1.5rem}.rf-mb-8{margin-bottom:2rem}.rf-ml-1{margin-left:.25rem}.rf-ml-2{margin-left:.5rem}.rf-ml-auto{margin-left:auto}.rf-mr-1{margin-right:.25rem}.rf-mr-2{margin-right:.5rem}.rf-mt-0{margin-top:0}.rf-mt-0\\.5{margin-top:.125rem}.rf-mt-1{margin-top:.25rem}.rf-mt-2{margin-top:.5rem}.rf-mt-3{margin-top:.75rem}.rf-mt-4{margin-top:1rem}.rf-mt-5{margin-top:1.25rem}.rf-mt-auto{margin-top:auto}.rf-block{display:block}.rf-inline{display:inline}.rf-flex{display:flex}.rf-inline-flex{display:inline-flex}.rf-grid{display:grid}.rf-hidden{display:none}.rf-aspect-square{aspect-ratio:1/1}.rf-aspect-video{aspect-ratio:16/9}.rf-size-14{height:3.5rem;width:3.5rem}.rf-size-4{height:1rem;width:1rem}.\\!rf-h-2{height:.5rem!important}.\\!rf-h-2\\.5{height:.625rem!important}.\\!rf-h-3{height:.75rem!important}.\\!rf-h-full{height:100%!important}.rf-h-1{height:.25rem}.rf-h-10{height:2.5rem}.rf-h-12{height:3rem}.rf-h-2{height:.5rem}.rf-h-2\\.5{height:.625rem}.rf-h-3{height:.75rem}.rf-h-3\\.5{height:.875rem}.rf-h-4{height:1rem}.rf-h-5{height:1.25rem}.rf-h-6{height:1.5rem}.rf-h-60{height:15rem}.rf-h-64{height:16rem}.rf-h-8{height:2rem}.rf-h-9{height:2.25rem}.rf-h-\\[620px\\]{height:620px}.rf-h-\\[calc\\(100vh-52px\\)\\]{height:calc(100vh - 52px)}.rf-h-\\[calc\\(100vh-96px\\)\\]{height:calc(100vh - 96px)}.rf-h-\\[var\\(--radix-select-trigger-height\\)\\]{height:var(--radix-select-trigger-height)}.rf-h-fit{height:-moz-fit-content;height:fit-content}.rf-h-full{height:100%}.rf-h-px{height:1px}.\\!rf-max-h-\\[40vh\\]{max-height:40vh!important}.\\!rf-max-h-\\[70\\%\\]{max-height:70%!important}.rf-max-h-32{max-height:8rem}.rf-max-h-96{max-height:24rem}.rf-max-h-\\[500px\\]{max-height:500px}.rf-max-h-\\[90vh\\]{max-height:90vh}.rf-min-h-0{min-height:0}.rf-min-h-\\[200px\\]{min-height:200px}.rf-min-h-\\[620px\\]{min-height:620px}.rf-min-h-\\[calc\\(100vh-240px\\)\\]{min-height:calc(100vh - 240px)}.\\!rf-w-2{width:.5rem!important}.\\!rf-w-2\\.5{width:.625rem!important}.rf-w-1{width:.25rem}.rf-w-1\\/2{width:50%}.rf-w-11{width:2.75rem}.rf-w-11\\/12{width:91.666667%}.rf-w-12{width:3rem}.rf-w-16{width:4rem}.rf-w-2{width:.5rem}.rf-w-2\\.5{width:.625rem}.rf-w-3{width:.75rem}.rf-w-3\\.5{width:.875rem}.rf-w-32{width:8rem}.rf-w-4{width:1rem}.rf-w-5{width:1.25rem}.rf-w-6{width:1.5rem}.rf-w-64{width:16rem}.rf-w-72{width:18rem}.rf-w-8{width:2rem}.rf-w-9{width:2.25rem}.rf-w-96{width:24rem}.rf-w-fit{width:-moz-fit-content;width:fit-content}.rf-w-full{width:100%}.rf-min-w-10{min-width:2.5rem}.rf-min-w-16{min-width:4rem}.rf-min-w-\\[148px\\]{min-width:148px}.rf-min-w-\\[8rem\\]{min-width:8rem}.rf-min-w-\\[var\\(--radix-select-trigger-width\\)\\]{min-width:var(--radix-select-trigger-width)}.\\!rf-max-w-\\[60vw\\]{max-width:60vw!important}.\\!rf-max-w-\\[660px\\]{max-width:660px!important}.rf-max-w-2xl{max-width:42rem}.rf-max-w-3xl{max-width:48rem}.rf-max-w-5xl{max-width:64rem}.rf-max-w-full{max-width:100%}.rf-max-w-lg{max-width:32rem}.rf-max-w-md{max-width:28rem}.rf-max-w-xl{max-width:36rem}.rf-flex-1{flex:1 1 0%}.rf-flex-shrink-0,.rf-shrink-0{flex-shrink:0}.rf-flex-grow{flex-grow:1}.rf-table-auto{table-layout:auto}.-rf-translate-x-1{--tw-translate-x:-0.25rem}.-rf-translate-x-1,.-rf-translate-x-1\\/2{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-rf-translate-x-1\\/2{--tw-translate-x:-50%}.-rf-translate-y-1{--tw-translate-y:-0.25rem}.-rf-translate-y-1,.rf--translate-x-1{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rf--translate-x-1{--tw-translate-x:-0.25rem}.rf-translate-x-\\[-50\\%\\]{--tw-translate-x:-50%}.rf-translate-x-\\[-50\\%\\],.rf-translate-y-\\[-50\\%\\]{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rf-translate-y-\\[-50\\%\\]{--tw-translate-y:-50%}.rf-transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes rf-pulse{50%{opacity:.5}}.rf-animate-pulse{animation:rf-pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes rf-spin{to{transform:rotate(1turn)}}.rf-animate-spin{animation:rf-spin 1s linear infinite}.rf-cursor-default{cursor:default}.rf-cursor-not-allowed{cursor:not-allowed}.rf-cursor-pointer{cursor:pointer}.rf-select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.rf-grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.rf-grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.rf-flex-row{flex-direction:row}.rf-flex-col{flex-direction:column}.rf-flex-col-reverse{flex-direction:column-reverse}.rf-flex-wrap{flex-wrap:wrap}.rf-place-items-center{place-items:center}.rf-items-start{align-items:flex-start}.rf-items-end{align-items:flex-end}.rf-items-center{align-items:center}.rf-justify-end{justify-content:flex-end}.rf-justify-center{justify-content:center}.rf-justify-between{justify-content:space-between}.rf-gap-0{gap:0}.rf-gap-1{gap:.25rem}.rf-gap-2{gap:.5rem}.rf-gap-3{gap:.75rem}.rf-gap-4{gap:1rem}.rf-gap-5{gap:1.25rem}.rf-gap-6{gap:1.5rem}.rf-gap-8{gap:2rem}.rf-space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(.5rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(.5rem*var(--tw-space-x-reverse))}.rf-space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(.5rem*var(--tw-space-y-reverse));margin-top:calc(.5rem*(1 - var(--tw-space-y-reverse)))}.rf-space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(1rem*var(--tw-space-y-reverse));margin-top:calc(1rem*(1 - var(--tw-space-y-reverse)))}.rf-space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(1.5rem*var(--tw-space-y-reverse));margin-top:calc(1.5rem*(1 - var(--tw-space-y-reverse)))}.rf-divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse:0;border-bottom-width:calc(1px*var(--tw-divide-y-reverse));border-top-width:calc(1px*(1 - var(--tw-divide-y-reverse)))}.rf-overflow-auto{overflow:auto}.rf-overflow-hidden{overflow:hidden}.rf-overflow-visible{overflow:visible}.rf-overflow-x-auto{overflow-x:auto}.\\!rf-overflow-y-auto{overflow-y:auto!important}.rf-overflow-y-auto{overflow-y:auto}.\\!rf-overflow-x-hidden{overflow-x:hidden!important}.rf-overflow-x-hidden{overflow-x:hidden}.rf-overflow-x-clip{overflow-x:clip}.rf-truncate{overflow:hidden;text-overflow:ellipsis}.rf-truncate,.rf-whitespace-nowrap{white-space:nowrap}.rf-whitespace-pre-wrap{white-space:pre-wrap}.rf-break-words{overflow-wrap:break-word}.rf-rounded{border-radius:.25rem}.rf-rounded-2xl{border-radius:1rem}.rf-rounded-full{border-radius:9999px}.rf-rounded-lg{border-radius:var(--radius)}.rf-rounded-md{border-radius:calc(var(--radius) - 2px)}.rf-rounded-sm{border-radius:calc(var(--radius) - 4px)}.rf-rounded-xl{border-radius:.75rem}.rf-border{border-width:1px}.rf-border-b{border-bottom-width:1px}.rf-border-t{border-top-width:1px}.rf-border-blue-200{--tw-border-opacity:1;border-color:rgb(191 219 254/var(--tw-border-opacity,1))}.rf-border-blue-500{--tw-border-opacity:1;border-color:rgb(59 130 246/var(--tw-border-opacity,1))}.rf-border-blue-600{--tw-border-opacity:1;border-color:rgb(37 99 235/var(--tw-border-opacity,1))}.rf-border-gray-200{--tw-border-opacity:1;border-color:rgb(229 231 235/var(--tw-border-opacity,1))}.rf-border-gray-300{--tw-border-opacity:1;border-color:rgb(209 213 219/var(--tw-border-opacity,1))}.rf-border-green-200{--tw-border-opacity:1;border-color:rgb(187 247 208/var(--tw-border-opacity,1))}.rf-border-input{border-color:hsl(var(--input))}.rf-border-neutral-200{--tw-border-opacity:1;border-color:rgb(229 229 229/var(--tw-border-opacity,1))}.rf-border-primary{border-color:hsl(var(--primary))}.rf-border-red-200{--tw-border-opacity:1;border-color:rgb(254 202 202/var(--tw-border-opacity,1))}.rf-border-red-500{--tw-border-opacity:1;border-color:rgb(239 68 68/var(--tw-border-opacity,1))}.rf-border-zinc-200{--tw-border-opacity:1;border-color:rgb(228 228 231/var(--tw-border-opacity,1))}.rf-border-zinc-900{--tw-border-opacity:1;border-color:rgb(24 24 27/var(--tw-border-opacity,1))}.rf-bg-background{background-color:hsl(var(--background))}.rf-bg-black{--tw-bg-opacity:1;background-color:rgb(0 0 0/var(--tw-bg-opacity,1))}.rf-bg-black\\/80{background-color:rgba(0,0,0,.8)}.rf-bg-blue-100{--tw-bg-opacity:1;background-color:rgb(219 234 254/var(--tw-bg-opacity,1))}.rf-bg-blue-50{--tw-bg-opacity:1;background-color:rgb(239 246 255/var(--tw-bg-opacity,1))}.rf-bg-blue-500{--tw-bg-opacity:1;background-color:rgb(59 130 246/var(--tw-bg-opacity,1))}.rf-bg-blue-600{--tw-bg-opacity:1;background-color:rgb(37 99 235/var(--tw-bg-opacity,1))}.rf-bg-gray-100{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity,1))}.rf-bg-gray-300{--tw-bg-opacity:1;background-color:rgb(209 213 219/var(--tw-bg-opacity,1))}.rf-bg-gray-50{--tw-bg-opacity:1;background-color:rgb(249 250 251/var(--tw-bg-opacity,1))}.rf-bg-gray-500{--tw-bg-opacity:1;background-color:rgb(107 114 128/var(--tw-bg-opacity,1))}.rf-bg-gray-700{--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity,1))}.rf-bg-gray-800{--tw-bg-opacity:1;background-color:rgb(31 41 55/var(--tw-bg-opacity,1))}.rf-bg-gray-900{--tw-bg-opacity:1;background-color:rgb(17 24 39/var(--tw-bg-opacity,1))}.rf-bg-green-100{--tw-bg-opacity:1;background-color:rgb(220 252 231/var(--tw-bg-opacity,1))}.rf-bg-green-50{--tw-bg-opacity:1;background-color:rgb(240 253 244/var(--tw-bg-opacity,1))}.rf-bg-muted{background-color:hsl(var(--muted))}.rf-bg-neutral-100{--tw-bg-opacity:1;background-color:rgb(245 245 245/var(--tw-bg-opacity,1))}.rf-bg-neutral-50{--tw-bg-opacity:1;background-color:rgb(250 250 250/var(--tw-bg-opacity,1))}.rf-bg-neutral-800{--tw-bg-opacity:1;background-color:rgb(38 38 38/var(--tw-bg-opacity,1))}.rf-bg-neutral-900{--tw-bg-opacity:1;background-color:rgb(23 23 23/var(--tw-bg-opacity,1))}.rf-bg-orange-400{--tw-bg-opacity:1;background-color:rgb(251 146 60/var(--tw-bg-opacity,1))}.rf-bg-popover{background-color:hsl(var(--popover))}.rf-bg-red-100{--tw-bg-opacity:1;background-color:rgb(254 226 226/var(--tw-bg-opacity,1))}.rf-bg-red-50{--tw-bg-opacity:1;background-color:rgb(254 242 242/var(--tw-bg-opacity,1))}.rf-bg-red-500{--tw-bg-opacity:1;background-color:rgb(239 68 68/var(--tw-bg-opacity,1))}.rf-bg-red-900{--tw-bg-opacity:1;background-color:rgb(127 29 29/var(--tw-bg-opacity,1))}.rf-bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.rf-bg-yellow-100{--tw-bg-opacity:1;background-color:rgb(254 249 195/var(--tw-bg-opacity,1))}.rf-bg-zinc-100{--tw-bg-opacity:1;background-color:rgb(244 244 245/var(--tw-bg-opacity,1))}.rf-bg-zinc-200{--tw-bg-opacity:1;background-color:rgb(228 228 231/var(--tw-bg-opacity,1))}.rf-bg-zinc-50{--tw-bg-opacity:1;background-color:rgb(250 250 250/var(--tw-bg-opacity,1))}.rf-bg-zinc-800{--tw-bg-opacity:1;background-color:rgb(39 39 42/var(--tw-bg-opacity,1))}.rf-bg-zinc-900{--tw-bg-opacity:1;background-color:rgb(24 24 27/var(--tw-bg-opacity,1))}.rf-bg-opacity-50{--tw-bg-opacity:0.5}.rf-fill-current{fill:currentColor}.rf-object-contain{-o-object-fit:contain;object-fit:contain}.\\!rf-p-0{padding:0!important}.rf-p-0{padding:0}.rf-p-1{padding:.25rem}.rf-p-2{padding:.5rem}.rf-p-3{padding:.75rem}.rf-p-4{padding:1rem}.rf-p-5{padding:1.25rem}.rf-p-6{padding:1.5rem}.rf-p-8{padding:2rem}.rf-px-1{padding-left:.25rem;padding-right:.25rem}.rf-px-2{padding-left:.5rem;padding-right:.5rem}.rf-px-3{padding-left:.75rem;padding-right:.75rem}.rf-px-4{padding-left:1rem;padding-right:1rem}.rf-px-6{padding-left:1.5rem;padding-right:1.5rem}.rf-px-8{padding-left:2rem;padding-right:2rem}.rf-py-0{padding-bottom:0;padding-top:0}.rf-py-0\\.5{padding-bottom:.125rem;padding-top:.125rem}.rf-py-1{padding-bottom:.25rem;padding-top:.25rem}.rf-py-1\\.5{padding-bottom:.375rem;padding-top:.375rem}.rf-py-10{padding-bottom:2.5rem;padding-top:2.5rem}.rf-py-12{padding-bottom:3rem;padding-top:3rem}.rf-py-2{padding-bottom:.5rem;padding-top:.5rem}.rf-py-3{padding-bottom:.75rem;padding-top:.75rem}.rf-py-4{padding-bottom:1rem;padding-top:1rem}.rf-pb-0{padding-bottom:0}.rf-pb-3{padding-bottom:.75rem}.rf-pb-4{padding-bottom:1rem}.rf-pl-2{padding-left:.5rem}.rf-pl-4{padding-left:1rem}.rf-pl-8{padding-left:2rem}.rf-pr-2{padding-right:.5rem}.rf-pt-4{padding-top:1rem}.rf-text-left{text-align:left}.rf-text-center{text-align:center}.rf-text-right{text-align:right}.rf-font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.rf-text-2xl{font-size:1.5rem;line-height:2rem}.rf-text-3xl{font-size:1.875rem;line-height:2.25rem}.rf-text-\\[8px\\]{font-size:8px}.rf-text-base{font-size:1rem;line-height:1.5rem}.rf-text-lg{font-size:1.125rem;line-height:1.75rem}.rf-text-sm{font-size:.875rem;line-height:1.25rem}.rf-text-xl{font-size:1.25rem;line-height:1.75rem}.rf-text-xs{font-size:.75rem;line-height:1rem}.rf-font-bold{font-weight:700}.rf-font-medium{font-weight:500}.rf-font-semibold{font-weight:600}.rf-capitalize{text-transform:capitalize}.rf-tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.rf-leading-5{line-height:1.25rem}.rf-leading-none{line-height:1}.rf-leading-tight{line-height:1.25}.rf-tracking-widest{letter-spacing:.1em}.rf-text-black{--tw-text-opacity:1;color:rgb(0 0 0/var(--tw-text-opacity,1))}.rf-text-blue-500{--tw-text-opacity:1;color:rgb(59 130 246/var(--tw-text-opacity,1))}.rf-text-blue-600{--tw-text-opacity:1;color:rgb(37 99 235/var(--tw-text-opacity,1))}.rf-text-blue-700{--tw-text-opacity:1;color:rgb(29 78 216/var(--tw-text-opacity,1))}.rf-text-blue-800{--tw-text-opacity:1;color:rgb(30 64 175/var(--tw-text-opacity,1))}.rf-text-blue-900{--tw-text-opacity:1;color:rgb(30 58 138/var(--tw-text-opacity,1))}.rf-text-current{color:currentColor}.rf-text-gray-400{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity,1))}.rf-text-gray-500{--tw-text-opacity:1;color:rgb(107 114 128/var(--tw-text-opacity,1))}.rf-text-gray-600{--tw-text-opacity:1;color:rgb(75 85 99/var(--tw-text-opacity,1))}.rf-text-gray-700{--tw-text-opacity:1;color:rgb(55 65 81/var(--tw-text-opacity,1))}.rf-text-gray-800{--tw-text-opacity:1;color:rgb(31 41 55/var(--tw-text-opacity,1))}.rf-text-gray-900{--tw-text-opacity:1;color:rgb(17 24 39/var(--tw-text-opacity,1))}.rf-text-green-500{--tw-text-opacity:1;color:rgb(34 197 94/var(--tw-text-opacity,1))}.rf-text-green-600{--tw-text-opacity:1;color:rgb(22 163 74/var(--tw-text-opacity,1))}.rf-text-green-700{--tw-text-opacity:1;color:rgb(21 128 61/var(--tw-text-opacity,1))}.rf-text-green-800{--tw-text-opacity:1;color:rgb(22 101 52/var(--tw-text-opacity,1))}.rf-text-green-900{--tw-text-opacity:1;color:rgb(20 83 45/var(--tw-text-opacity,1))}.rf-text-muted-foreground{color:hsl(var(--muted-foreground))}.rf-text-neutral-50{--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.rf-text-neutral-500{--tw-text-opacity:1;color:rgb(115 115 115/var(--tw-text-opacity,1))}.rf-text-neutral-900{--tw-text-opacity:1;color:rgb(23 23 23/var(--tw-text-opacity,1))}.rf-text-neutral-950{--tw-text-opacity:1;color:rgb(10 10 10/var(--tw-text-opacity,1))}.rf-text-popover-foreground{color:hsl(var(--popover-foreground))}.rf-text-red-200{--tw-text-opacity:1;color:rgb(254 202 202/var(--tw-text-opacity,1))}.rf-text-red-300{--tw-text-opacity:1;color:rgb(252 165 165/var(--tw-text-opacity,1))}.rf-text-red-400{--tw-text-opacity:1;color:rgb(248 113 113/var(--tw-text-opacity,1))}.rf-text-red-500{--tw-text-opacity:1;color:rgb(239 68 68/var(--tw-text-opacity,1))}.rf-text-red-600{--tw-text-opacity:1;color:rgb(220 38 38/var(--tw-text-opacity,1))}.rf-text-red-700{--tw-text-opacity:1;color:rgb(185 28 28/var(--tw-text-opacity,1))}.rf-text-red-800{--tw-text-opacity:1;color:rgb(153 27 27/var(--tw-text-opacity,1))}.rf-text-red-900{--tw-text-opacity:1;color:rgb(127 29 29/var(--tw-text-opacity,1))}.rf-text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.rf-text-yellow-400{--tw-text-opacity:1;color:rgb(250 204 21/var(--tw-text-opacity,1))}.rf-text-yellow-500{--tw-text-opacity:1;color:rgb(234 179 8/var(--tw-text-opacity,1))}.rf-text-yellow-900{--tw-text-opacity:1;color:rgb(113 63 18/var(--tw-text-opacity,1))}.rf-text-zinc-200{--tw-text-opacity:1;color:rgb(228 228 231/var(--tw-text-opacity,1))}.rf-text-zinc-300{--tw-text-opacity:1;color:rgb(212 212 216/var(--tw-text-opacity,1))}.rf-text-zinc-400{--tw-text-opacity:1;color:rgb(161 161 170/var(--tw-text-opacity,1))}.rf-text-zinc-50{--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.rf-text-zinc-500{--tw-text-opacity:1;color:rgb(113 113 122/var(--tw-text-opacity,1))}.rf-text-zinc-900{--tw-text-opacity:1;color:rgb(24 24 27/var(--tw-text-opacity,1))}.rf-text-zinc-950{--tw-text-opacity:1;color:rgb(9 9 11/var(--tw-text-opacity,1))}.rf-underline{text-decoration-line:underline}.rf-line-through{text-decoration-line:line-through}.rf-underline-offset-4{text-underline-offset:4px}.rf-opacity-0{opacity:0}.rf-opacity-25{opacity:.25}.rf-opacity-30{opacity:.3}.rf-opacity-50{opacity:.5}.rf-opacity-60{opacity:.6}.rf-shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color)}.rf-shadow,.rf-shadow-lg{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.rf-shadow-lg{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color)}.rf-shadow-md{--tw-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),0 2px 4px -2px var(--tw-shadow-color)}.rf-shadow-md,.rf-shadow-sm{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.rf-shadow-sm{--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color)}.rf-outline-none{outline:2px solid transparent;outline-offset:2px}.rf-ring-2{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.rf-ring-blue-500{--tw-ring-opacity:1;--tw-ring-color:rgb(59 130 246/var(--tw-ring-opacity,1))}.rf-ring-primary{--tw-ring-color:hsl(var(--primary))}.rf-ring-offset-background{--tw-ring-offset-color:hsl(var(--background))}.rf-ring-offset-white{--tw-ring-offset-color:#fff}.rf-transition{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.rf-transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.rf-transition-colors{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1)}.rf-transition-opacity{transition-duration:.15s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}.rf-duration-200{transition-duration:.2s}.rf-ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}@keyframes enter{0%{opacity:var(--tw-enter-opacity,1);transform:translate3d(var(--tw-enter-translate-x,0),var(--tw-enter-translate-y,0),0) scale3d(var(--tw-enter-scale,1),var(--tw-enter-scale,1),var(--tw-enter-scale,1)) rotate(var(--tw-enter-rotate,0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity,1);transform:translate3d(var(--tw-exit-translate-x,0),var(--tw-exit-translate-y,0),0) scale3d(var(--tw-exit-scale,1),var(--tw-exit-scale,1),var(--tw-exit-scale,1)) rotate(var(--tw-exit-rotate,0))}}.rf-slide-in-from-left-1{--tw-enter-translate-x:-0.25rem}.rf-slide-out-to-left-1{--tw-exit-translate-x:-0.25rem}.rf-duration-200{animation-duration:.2s}.rf-ease-in-out{animation-timing-function:cubic-bezier(.4,0,.2,1)}.file\\:rf-border-0::file-selector-button{border-width:0}.file\\:rf-bg-transparent::file-selector-button{background-color:transparent}.file\\:rf-text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\\:rf-font-medium::file-selector-button{font-weight:500}.placeholder\\:rf-text-zinc-500::-moz-placeholder{--tw-text-opacity:1;color:rgb(113 113 122/var(--tw-text-opacity,1))}.placeholder\\:rf-text-zinc-500::placeholder{--tw-text-opacity:1;color:rgb(113 113 122/var(--tw-text-opacity,1))}.hover\\:rf-border-blue-300:hover{--tw-border-opacity:1;border-color:rgb(147 197 253/var(--tw-border-opacity,1))}.hover\\:\\!rf-bg-transparent:hover{background-color:transparent!important}.hover\\:rf-bg-blue-700:hover{--tw-bg-opacity:1;background-color:rgb(29 78 216/var(--tw-bg-opacity,1))}.hover\\:rf-bg-red-500\\/90:hover{background-color:rgba(239,68,68,.9)}.hover\\:rf-bg-zinc-100:hover{--tw-bg-opacity:1;background-color:rgb(244 244 245/var(--tw-bg-opacity,1))}.hover\\:rf-bg-zinc-100\\/80:hover{background-color:hsla(240,5%,96%,.8)}.hover\\:rf-bg-zinc-900\\/90:hover{background-color:rgba(24,24,27,.9)}.hover\\:rf-text-red-400:hover{--tw-text-opacity:1;color:rgb(248 113 113/var(--tw-text-opacity,1))}.hover\\:rf-text-zinc-900:hover{--tw-text-opacity:1;color:rgb(24 24 27/var(--tw-text-opacity,1))}.hover\\:rf-underline:hover{text-decoration-line:underline}.hover\\:rf-shadow-lg:hover{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.focus\\:rf-bg-gray-100:focus{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity,1))}.focus\\:rf-bg-zinc-100:focus{--tw-bg-opacity:1;background-color:rgb(244 244 245/var(--tw-bg-opacity,1))}.focus\\:rf-text-gray-900:focus{--tw-text-opacity:1;color:rgb(17 24 39/var(--tw-text-opacity,1))}.focus\\:rf-text-zinc-900:focus{--tw-text-opacity:1;color:rgb(24 24 27/var(--tw-text-opacity,1))}.focus\\:rf-outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\\:rf-ring-2:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus\\:rf-ring-ring:focus{--tw-ring-color:hsl(var(--ring))}.focus\\:rf-ring-offset-2:focus{--tw-ring-offset-width:2px}.focus-visible\\:rf-outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\\:rf-ring-1:focus-visible{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus-visible\\:rf-ring-2:focus-visible{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus-visible\\:rf-ring-zinc-950:focus-visible{--tw-ring-opacity:1;--tw-ring-color:rgb(9 9 11/var(--tw-ring-opacity,1))}.focus-visible\\:rf-ring-offset-2:focus-visible{--tw-ring-offset-width:2px}.disabled\\:rf-pointer-events-none:disabled{pointer-events:none}.disabled\\:rf-cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:rf-opacity-50:disabled{opacity:.5}.rf-group\\/bar:hover .group-hover\\/bar\\:rf-opacity-100{opacity:1}.data-\\[disabled\\]\\:rf-pointer-events-none[data-disabled]{pointer-events:none}.data-\\[side\\=bottom\\]\\:rf-translate-y-1[data-side=bottom]{--tw-translate-y:0.25rem}.data-\\[side\\=bottom\\]\\:rf-translate-y-1[data-side=bottom],.data-\\[side\\=left\\]\\:-rf-translate-x-1[data-side=left]{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[side\\=left\\]\\:-rf-translate-x-1[data-side=left]{--tw-translate-x:-0.25rem}.data-\\[side\\=right\\]\\:rf-translate-x-1[data-side=right]{--tw-translate-x:0.25rem}.data-\\[side\\=right\\]\\:rf-translate-x-1[data-side=right],.data-\\[side\\=top\\]\\:-rf-translate-y-1[data-side=top]{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[side\\=top\\]\\:-rf-translate-y-1[data-side=top]{--tw-translate-y:-0.25rem}.data-\\[state\\=active\\]\\:rf-bg-white[data-state=active]{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.data-\\[state\\=checked\\]\\:rf-bg-zinc-900[data-state=checked]{--tw-bg-opacity:1;background-color:rgb(24 24 27/var(--tw-bg-opacity,1))}.data-\\[state\\=open\\]\\:rf-bg-zinc-100[data-state=open]{--tw-bg-opacity:1;background-color:rgb(244 244 245/var(--tw-bg-opacity,1))}.data-\\[state\\=active\\]\\:rf-text-zinc-950[data-state=active]{--tw-text-opacity:1;color:rgb(9 9 11/var(--tw-text-opacity,1))}.data-\\[state\\=checked\\]\\:rf-text-zinc-50[data-state=checked]{--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.data-\\[disabled\\]\\:rf-opacity-50[data-disabled]{opacity:.5}.data-\\[state\\=active\\]\\:rf-shadow[data-state=active]{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.data-\\[state\\=open\\]\\:rf-animate-in[data-state=open]{animation-duration:.15s;animation-name:enter;--tw-enter-opacity:initial;--tw-enter-scale:initial;--tw-enter-rotate:initial;--tw-enter-translate-x:initial;--tw-enter-translate-y:initial}.data-\\[state\\=closed\\]\\:rf-animate-out[data-state=closed]{animation-duration:.15s;animation-name:exit;--tw-exit-opacity:initial;--tw-exit-scale:initial;--tw-exit-rotate:initial;--tw-exit-translate-x:initial;--tw-exit-translate-y:initial}.data-\\[state\\=closed\\]\\:rf-fade-out-0[data-state=closed]{--tw-exit-opacity:0}.data-\\[state\\=open\\]\\:rf-fade-in-0[data-state=open]{--tw-enter-opacity:0}.data-\\[state\\=closed\\]\\:rf-zoom-out-95[data-state=closed]{--tw-exit-scale:.95}.data-\\[state\\=open\\]\\:rf-zoom-in-95[data-state=open]{--tw-enter-scale:.95}.data-\\[side\\=bottom\\]\\:rf-slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y:-0.5rem}.data-\\[side\\=left\\]\\:rf-slide-in-from-right-2[data-side=left]{--tw-enter-translate-x:0.5rem}.data-\\[side\\=right\\]\\:rf-slide-in-from-left-2[data-side=right]{--tw-enter-translate-x:-0.5rem}.data-\\[side\\=top\\]\\:rf-slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y:0.5rem}.data-\\[state\\=closed\\]\\:rf-slide-out-to-left-1\\/2[data-state=closed]{--tw-exit-translate-x:-50%}.data-\\[state\\=closed\\]\\:rf-slide-out-to-top-\\[48\\%\\][data-state=closed]{--tw-exit-translate-y:-48%}.data-\\[state\\=open\\]\\:rf-slide-in-from-left-1\\/2[data-state=open]{--tw-enter-translate-x:-50%}.data-\\[state\\=open\\]\\:rf-slide-in-from-top-\\[48\\%\\][data-state=open]{--tw-enter-translate-y:-48%}.dark\\:rf-border-zinc-50:is(.rf-dark *){--tw-border-opacity:1;border-color:rgb(250 250 250/var(--tw-border-opacity,1))}.dark\\:rf-border-zinc-800:is(.rf-dark *){--tw-border-opacity:1;border-color:rgb(39 39 42/var(--tw-border-opacity,1))}.dark\\:rf-bg-red-900:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(127 29 29/var(--tw-bg-opacity,1))}.dark\\:rf-bg-zinc-50:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(250 250 250/var(--tw-bg-opacity,1))}.dark\\:rf-bg-zinc-800:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(39 39 42/var(--tw-bg-opacity,1))}.dark\\:rf-bg-zinc-950:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(9 9 11/var(--tw-bg-opacity,1))}.dark\\:rf-text-zinc-400:is(.rf-dark *){--tw-text-opacity:1;color:rgb(161 161 170/var(--tw-text-opacity,1))}.dark\\:rf-text-zinc-50:is(.rf-dark *){--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.dark\\:rf-text-zinc-900:is(.rf-dark *){--tw-text-opacity:1;color:rgb(24 24 27/var(--tw-text-opacity,1))}.dark\\:rf-placeholder-zinc-400:is(.rf-dark *)::-moz-placeholder{--tw-placeholder-opacity:1;color:rgb(161 161 170/var(--tw-placeholder-opacity,1))}.dark\\:rf-placeholder-zinc-400:is(.rf-dark *)::placeholder{--tw-placeholder-opacity:1;color:rgb(161 161 170/var(--tw-placeholder-opacity,1))}.dark\\:rf-ring-offset-zinc-950:is(.rf-dark *){--tw-ring-offset-color:#09090b}.dark\\:hover\\:rf-bg-red-900\\/90:hover:is(.rf-dark *){background-color:rgba(127,29,29,.9)}.dark\\:hover\\:rf-bg-zinc-50\\/90:hover:is(.rf-dark *){background-color:hsla(0,0%,98%,.9)}.dark\\:hover\\:rf-bg-zinc-800:hover:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(39 39 42/var(--tw-bg-opacity,1))}.dark\\:hover\\:rf-bg-zinc-800\\/80:hover:is(.rf-dark *){background-color:rgba(39,39,42,.8)}.dark\\:hover\\:rf-text-zinc-50:hover:is(.rf-dark *){--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.dark\\:focus\\:rf-bg-zinc-800:focus:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(39 39 42/var(--tw-bg-opacity,1))}.dark\\:focus\\:rf-text-zinc-50:focus:is(.rf-dark *){--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.dark\\:focus-visible\\:rf-ring-zinc-300:focus-visible:is(.rf-dark *){--tw-ring-opacity:1;--tw-ring-color:rgb(212 212 216/var(--tw-ring-opacity,1))}.dark\\:data-\\[state\\=active\\]\\:rf-bg-zinc-950[data-state=active]:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(9 9 11/var(--tw-bg-opacity,1))}.dark\\:data-\\[state\\=checked\\]\\:rf-bg-zinc-50[data-state=checked]:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(250 250 250/var(--tw-bg-opacity,1))}.dark\\:data-\\[state\\=open\\]\\:rf-bg-zinc-800[data-state=open]:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(39 39 42/var(--tw-bg-opacity,1))}.dark\\:data-\\[state\\=active\\]\\:rf-text-zinc-50[data-state=active]:is(.rf-dark *){--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.dark\\:data-\\[state\\=checked\\]\\:rf-text-zinc-900[data-state=checked]:is(.rf-dark *){--tw-text-opacity:1;color:rgb(24 24 27/var(--tw-text-opacity,1))}@media (min-width:640px){.sm\\:rf-mt-0{margin-top:0}.sm\\:rf-flex-row{flex-direction:row}.sm\\:rf-justify-end{justify-content:flex-end}.sm\\:rf-space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(.5rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(.5rem*var(--tw-space-x-reverse))}.sm\\:rf-rounded-lg{border-radius:var(--radius)}.sm\\:rf-text-left{text-align:left}}@media (min-width:768px){.md\\:rf-grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}.\\[\\&\\>span\\]\\:rf-line-clamp-1>span{display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:1}.\\[\\&\\>svg\\]\\:rf-size-4>svg{height:1rem;width:1rem}.\\[\\&\\>svg\\]\\:rf-shrink-0>svg{flex-shrink:0}.\\[\\&\\>svg\\]\\:rf-text-red-300>svg{--tw-text-opacity:1;color:rgb(252 165 165/var(--tw-text-opacity,1))}.\\[\\&\\>svg\\]\\:hover\\:rf-text-red-400:hover>svg{--tw-text-opacity:1;color:rgb(248 113 113/var(--tw-text-opacity,1))}.\\[\\&_svg\\]\\:rf-pointer-events-none svg{pointer-events:none}.\\[\\&_svg\\]\\:rf-size-4 svg{height:1rem;width:1rem}.\\[\\&_svg\\]\\:rf-shrink-0 svg{flex-shrink:0}',Msn=()=>{yt.useEffect(()=>{if(document.querySelector('style[data-styles="tscircuit-runframe"]'))return;const e=document.createElement("style");e.setAttribute("data-styles","tscircuit-runframe"),e.textContent=Tsn,document.head.appendChild(e)},[])},U$e=n=>`hsl(${Tb.indexOf(n)*137.5%360}, 70%, 50%)`,Csn=({phaseTimings:n})=>{if(!n)return null;const e=Object.values(n).reduce((t,r)=>t+r,0);return dt.jsxs("div",{className:"rf-space-y-2 rf-w-full rf-px-4",children:[dt.jsx("div",{className:"rf-relative rf-h-8 rf-flex rf-rounded-sm",children:Tb.map(t=>{const r=n[t]||0,i=r/e*100;return dt.jsx("div",{className:"rf-group/bar rf-relative rf-overflow-visible",style:{width:`${i}%`,backgroundColor:U$e(t)},children:dt.jsxs("div",{className:"rf-opacity-0 group-hover/bar:rf-opacity-100 rf-transition-opacity rf-absolute rf-bottom-full rf-left-1/2 rf-transform -rf-translate-x-1/2 rf-mb-2 rf-px-2 rf-py-1 rf-text-xs rf-whitespace-nowrap rf-rounded rf-bg-gray-900 rf-text-white rf-pointer-events-none",children:[t,": ",r.toFixed(1),"ms"]})},t)})}),dt.jsxs("div",{className:"rf-text-xs rf-text-gray-500",children:["Total: ",e.toFixed(2),"ms"]})]})},Rsn=({renderLog:n})=>{const[e,t]=yt.useState("chronological");if(!n)return dt.jsx("div",{className:"rf-p-4 rf-bg-gray-100 rf-rounded-md",children:"No render log, make sure this tab is open when you render (TODO add a rerender button here)"});const r=Object.entries((n==null?void 0:n.phaseTimings)??{});e==="chronological"?r.sort((a,o)=>Tb.indexOf(a[0])-Tb.indexOf(o[0])):r.sort((a,o)=>o[1]-a[1]);const i=r.reduce((a,[o,s])=>a+s,0);return dt.jsxs("div",{className:"rf-bg-white",children:[dt.jsxs("div",{className:"rf-flex rf-justify-between rf-items-center",children:[dt.jsx("div",{children:"Render Logs"}),dt.jsxs("div",{className:"rf-mb-4 rf-pr-2 rf-flex rf-text-xs rf-items-center",children:[dt.jsx("div",{className:"rf-mr-2",children:"Sort by:"}),dt.jsxs("select",{value:e,onChange:a=>t(a.target.value),className:"rf-px-2 rf-py-1 rf-border rf-rounded rf-text-xs",children:[dt.jsx("option",{value:"chronological",children:"Phase Order"}),dt.jsx("option",{value:"longest",children:"Duration"})]})]})]}),dt.jsx(Csn,{phaseTimings:n.phaseTimings}),dt.jsxs("table",{className:"rf-w-full rf-text-xs",children:[dt.jsx("thead",{children:dt.jsxs("tr",{children:[dt.jsx("th",{className:"rf-text-left rf-p-2",children:"Phase Order"}),dt.jsx("th",{className:"rf-text-left rf-p-2",children:"Phase"}),dt.jsx("th",{className:"rf-text-left rf-p-2",children:"Duration (ms)"})]})}),dt.jsx("tbody",{children:r.map(([a,o])=>dt.jsxs("tr",{children:[dt.jsx("td",{className:"rf-p-2",children:Tb.indexOf(a)}),dt.jsx("td",{className:"rf-p-2",children:a}),dt.jsx("td",{className:"rf-p-2",children:dt.jsx("div",{className:"rf-w-8",children:dt.jsx("div",{className:"rf-h-2 rf-rounded-sm",style:{backgroundColor:U$e(a),width:`${o/i*100}%`}})})}),dt.jsx("td",{className:"rf-p-2",children:dt.jsxs("div",{className:"rf-flex w-full",children:[dt.jsxs("span",{className:"rf-flex-grow",children:[o,"ms"]}),dt.jsxs("span",{className:"rf-text-gray-500 rf-pr-2",children:[(o/i*100).toFixed(1),"%"]})]})})]},a))})]})]})},Asn="0.0.381",Psn=["assembly","bom","circuit_json","errors","render_log"],Nsn=({code:n,onRunClicked:e=void 0,errorMessage:t,circuitJson:r,autoroutingGraphics:i,showRightHeaderContent:a=!0,showCodeTab:o=!1,codeTabContent:s,showJsonTab:l=!0,showRenderLogTab:c=!0,onActiveTabChange:u,renderLog:f,showImportAndFormatButtons:h=!0,className:y,headerClassName:x,leftHeaderContent:M,readOnly:S,isStreaming:E,autoroutingLog:A,onReportAutoroutingLog:O,isRunningCode:k,hasCodeChangedSinceLastRun:$,onEditEvent:Y,editEvents:Q,defaultActiveTab:K,autoRotate3dViewerDisabled:ie,showSchematicDebugGrid:ee=!1,showToggleFullScreen:de=!0,defaultToFullScreen:me=!1})=>{var Ue;Msn();const[_e,Me]=yt.useState(K??"pcb"),[Pe,Se]=yt.useState(me),Ce=yt.useCallback(ze=>{Me(ze),u==null||u(ze)},[u]),Ee=()=>{Se(!Pe)};return yt.useEffect(()=>{t&&Ce("errors")},[t]),yt.useEffect(()=>{(_e==="code"||_e==="errors")&&r&&!t&&Ce(K??"pcb")},[r]),dt.jsx("div",{className:Gy("flex flex-col relative rf-overflow-x-hidden",y),children:dt.jsx("div",{className:Gy("rf-md:sticky rf-md:top-2",Pe&&"rf-fixed rf-top-0 rf-left-0 rf-w-full rf-bg-white"),children:dt.jsxs(jZe,{value:_e,onValueChange:Ce,className:"rf-flex-grow rf-flex rf-flex-col",children:[dt.jsxs("div",{className:Gy("rf-flex rf-items-center rf-gap-2 rf-p-2 rf-pb-0",x),children:[M,M&&dt.jsx("div",{className:"rf-flex-grow"}),!M&&k&&dt.jsx(ije,{className:"rf-w-4 rf-h-4 rf-animate-spin"}),!M&&dt.jsx("div",{className:"rf-flex-grow"}),f&&f.progress!==1&&dt.jsxs("div",{className:"rf-flex rf-items-center rf-gap-2",children:[f.lastRenderEvent&&dt.jsx("div",{className:"rf-text-xs rf-text-gray-500",children:(Ue=f.lastRenderEvent)==null?void 0:Ue.type.split("renderable:renderLifecycle:")[1].split(":")[0]}),dt.jsx("div",{className:"rf-w-4 rf-h-4 rf-bg-blue-500 rf-opacity-50 rf-rounded-full rf-text-white",children:dt.jsx(ije,{className:"rf-w-4 rf-h-4 rf-animate-spin"})}),dt.jsxs("div",{className:"rf-text-xs rf-font-bold rf-text-gray-700 rf-tabular-nums",children:[((f.progress??0)*100).toFixed(1),"%"]})]}),a&&dt.jsxs(Gfe,{children:[o&&dt.jsx(K7,{value:"code",children:"Code"}),dt.jsxs(K7,{value:"pcb",className:"rf-whitespace-nowrap",children:[r&&dt.jsx("span",{className:Gy("rf-inline-flex rf-items-center rf-justify-center rf-w-2 rf-h-2 rf-mr-1 rf-text-xs rf-font-bold rf-text-white rf-rounded-full",$?"rf-bg-gray-500":"rf-bg-blue-500")}),"PCB"]}),dt.jsxs(K7,{value:"schematic",className:"rf-whitespace-nowrap",children:[r&&dt.jsx("span",{className:Gy("rf-inline-flex rf-items-center rf-justify-center rf-w-2 rf-h-2 rf-mr-1 rf-text-xs rf-font-bold rf-text-white rf-rounded-full",$?"rf-bg-gray-500":"rf-bg-blue-500")}),"Schematic"]}),dt.jsxs(K7,{value:"cad",children:[r&&dt.jsx("span",{className:Gy("inline-flex items-center justify-center w-2 h-2 mr-1 text-xs font-bold text-white rounded-full",$?"rf-bg-gray-500":"rf-bg-blue-500")}),"3D"]}),!["pcb","cad","schematic"].includes(_e)&&dt.jsx(K7,{value:_e,children:Vfe(_e)}),dt.jsxs(hVe,{children:[dt.jsx(mVe,{asChild:!0,children:dt.jsxs("div",{className:"rf-whitespace-nowrap rf-p-2 rf-mr-1 rf-cursor-pointer rf-relative",children:[dt.jsx(ZZt,{className:"rf-w-4 rf-h-4"}),t&&dt.jsx("span",{className:"rf-inline-flex rf-absolute rf-top-[6px] rf-right-[4px] rf-items-center rf-justify-center rf-w-1 rf-h-1 rf-ml-2 rf-text-[8px] rf-font-bold rf-text-white rf-bg-red-500 rf-rounded-full"})]})}),dt.jsxs(yce,{className:"rf-*:text-xs",children:[Psn.map(ze=>dt.jsxs(mF,{onSelect:()=>Ce(ze),children:[_e!==ze&&dt.jsx(rje,{className:"rf-w-3 rf-h-3 rf-opacity-30"}),_e===ze&&dt.jsx(nje,{className:"rf-w-3 rf-h-3"}),dt.jsx("div",{className:"rf-pr-2",children:Vfe(ze)}),ze==="errors"&&t&&dt.jsx("span",{className:"rf-inline-flex rf-items-center rf-justify-center rf-w-3 rf-h-3 rf-ml-2 rf-text-[8px] rf-font-bold rf-text-white rf-bg-red-500 rf-rounded-full",children:"1"})]},ze)),dt.jsx(mF,{disabled:!0,className:"rf-opacity-60 rf-cursor-default rf-select-none",children:dt.jsxs("div",{className:"rf-pr-2 rf-text-xs rf-text-gray-500",children:["@tscircuit/runframe@",Asn.split(".").map((ze,Fe)=>Fe===2?parseInt(ze)+1:ze).join(".")]})})]})]})]}),de&&dt.jsx($8,{onClick:Ee,variant:"ghost",children:Pe?dt.jsx(JZt,{size:16}):dt.jsx(QZt,{size:16})})]}),o&&dt.jsx(h4,{value:"code",className:"rf-flex-grow rf-overflow-hidden",children:dt.jsx("div",{className:"rf-h-full",children:s})}),dt.jsx(h4,{value:"pcb",children:dt.jsx("div",{className:Gy("rf-overflow-hidden",Pe?"rf-h-[calc(100vh-52px)]":"rf-h-[620px]"),children:dt.jsx(iT,{fallbackRender:({error:ze})=>dt.jsx("div",{className:"rf-mt-4 rf-bg-red-50 rf-rounded-md rf-border rf-border-red-200",children:dt.jsxs("div",{className:"rf-p-4",children:[dt.jsx("h3",{className:"rf-text-lg rf-font-semibold rf-text-red-800 rf-mb-3",children:"Error loading PCB viewer"}),dt.jsx("p",{className:"rf-text-xs rf-font-mono rf-whitespace-pre-wrap rf-text-red-600 rf-mt-2",children:(ze==null?void 0:ze.message)||"An unknown error occurred"})]})}),children:r?dt.jsx(wsn,{focusOnHover:!1,circuitJson:r,debugGraphics:i,containerClassName:Gy("rf-h-full rf-w-full",Pe?"rf-min-h-[calc(100vh-240px)]":"rf-min-h-[620px]"),onEditEventsChanged:ze=>{Y&&ze.forEach(Fe=>Y(Fe))}}):dt.jsx(k7,{onRunClicked:e})})})}),dt.jsx(h4,{value:"assembly",children:dt.jsx("div",{className:Gy("rf-overflow-auto",Pe?"rf-h-[calc(100vh-96px)]":"rf-h-[620px]"),children:dt.jsx(iT,{fallback:dt.jsx("div",{children:"Error loading Assembly"}),children:r?dt.jsx(gsn,{circuitJson:r,containerStyle:{height:"100%"},editingEnabled:!0,debugGrid:!0}):dt.jsx(k7,{onRunClicked:e})})})}),dt.jsx(h4,{value:"schematic",children:dt.jsx("div",{className:Gy("rf-overflow-auto",Pe?"rf-h-[calc(100vh-96px)]":"rf-h-[620px]"),children:dt.jsx(iT,{fallbackRender:({error:ze})=>dt.jsx("div",{className:"rf-mt-4 rf-bg-red-50 rf-rounded-md rf-border rf-border-red-200",children:dt.jsxs("div",{className:"rf-p-4",children:[dt.jsx("h3",{className:"rf-text-lg rf-font-semibold rf-text-red-800 rf-mb-3",children:"Error loading Schematic"}),dt.jsx("p",{className:"rf-text-xs rf-font-mono rf-whitespace-pre-wrap rf-text-red-600 rf-mt-2",children:(ze==null?void 0:ze.message)||"An unknown error occurred"})]})}),children:r?dt.jsx(msn,{circuitJson:r,containerStyle:{height:"100%"},editingEnabled:!0,onEditEvent:ze=>{Y==null||Y(ze)},debugGrid:ee}):dt.jsx(k7,{onRunClicked:e})})})}),dt.jsx(h4,{value:"cad",children:dt.jsx("div",{className:Gy("rf-overflow-auto",Pe?"rf-h-[calc(100vh-96px)]":"rf-h-[620px]"),children:dt.jsx(iT,{FallbackComponent:UZt,children:r?dt.jsx(TUt,{soup:r,autoRotateDisabled:ie}):dt.jsx(k7,{onRunClicked:e})})})}),dt.jsx(h4,{value:"bom",children:dt.jsx("div",{className:Gy("rf-overflow-auto",Pe?"rf-h-[calc(100vh-96px)]":"rf-h-[620px]"),children:dt.jsx(iT,{fallbackRender:({error:ze})=>dt.jsx("div",{className:"rf-mt-4 rf-bg-red-50 rf-rounded-md rf-border rf-border-red-200",children:dt.jsxs("div",{className:"rf-p-4",children:[dt.jsx("h3",{className:"rf-text-lg rf-font-semibold rf-text-red-800 rf-mb-3",children:"Error loading Bill of Materials"}),dt.jsx("p",{className:"rf-text-xs rf-font-mono rf-whitespace-pre-wrap rf-text-red-600 rf-mt-2",children:(ze==null?void 0:ze.message)||"An unknown error occurred"})]})}),children:r?dt.jsx(Esn,{circuitJson:r}):dt.jsx(k7,{onRunClicked:e})})})}),dt.jsx(h4,{value:"circuit_json",children:dt.jsx("div",{className:Gy("rf-overflow-auto",Pe?"rf-h-[calc(100vh-96px)]":"rf-h-[620px]"),children:dt.jsx(iT,{fallback:dt.jsx("div",{children:"Error loading JSON viewer"}),children:r?dt.jsx(bsn,{elements:r}):dt.jsx(k7,{onRunClicked:e})})})}),dt.jsx(h4,{value:"errors",children:dt.jsx("div",{className:Gy("rf-overflow-auto",Pe?"rf-h-[calc(100vh-96px)]":"rf-h-[620px]"),children:r||t?dt.jsx(Zen,{code:n,errorMessage:t,autoroutingLog:A,onReportAutoroutingLog:O}):dt.jsx(k7,{onRunClicked:e})})}),c&&dt.jsx(h4,{value:"render_log",children:dt.jsx(Rsn,{renderLog:f})})]})})})};ufe.createRoot(document.getElementById("root")).render(dt.jsx(Nsn,{defaultActiveTab:"cad",autoRotate3dViewerDisabled:!0,showRightHeaderContent:!1,circuitJson:window.CIRCUIT_JSON||{},...window.CIRCUIT_JSON_PREVIEW_PROPS||{}}))});
13396
+ `,i.appendChild(O)}})}};a();const o=new MutationObserver(a);return o.observe(i,{childList:!0,subtree:!1,characterData:!1}),()=>{o.disconnect()}},[n,t,e,r])},lsn=Rg("schematic-viewer"),csn=()=>{Rg.enable("schematic-viewer*")},usn=lsn,fsn=n=>{const[e,t]=yt.useState(0),[r,i]=yt.useState(0);return yt.useEffect(()=>{if(!n.current)return;const a=()=>{var l;const s=(l=n.current)==null?void 0:l.getBoundingClientRect();t((s==null?void 0:s.width)||0),i((s==null?void 0:s.height)||0)};a();const o=new ResizeObserver(a);return o.observe(n.current),window.addEventListener("resize",a),()=>{o.disconnect(),window.removeEventListener("resize",a)}},[]),{containerWidth:e,containerHeight:r}},dsn=usn.extend("useComponentDragging"),psn=({onEditEvent:n,editEvents:e=[],circuitJson:t,cancelDrag:r,svgToScreenProjection:i,realToSvgProjection:a,enabled:o=!1})=>{const[s,l]=yt.useState(null),c=n0(a,i),u=yt.useRef(null),f=yt.useRef(null),h=yt.useRef(new Map);yt.useEffect(()=>{e.forEach(S=>{"edit_event_type"in S&&S.edit_event_type==="edit_schematic_component_location"&&!S.in_progress&&h.current.set(S.schematic_component_id,{...S.new_center})})},[e]);const y=yt.useCallback(S=>{if(!o)return;const A=S.target.closest('[data-circuit-json-type="schematic_component"]');if(!A)return;const O=A.getAttribute("data-schematic-component-id");if(!O)return;r&&r();const k=Tv(t).schematic_component.get(O);if(!k)return;u.current={x:S.clientX,y:S.clientY};let $;const Y=h.current.get(O);if(Y)$={...Y};else{const K=O$e({editEvents:e,schematic_component_id:O});$={x:k.center.x+K.x,y:k.center.y+K.y},h.current.set(O,{...$})}const Q={edit_event_id:Math.random().toString(36).substr(2,9),edit_event_type:"edit_schematic_component_location",schematic_component_id:O,original_center:$,new_center:{...$},in_progress:!0,created_at:Date.now(),_element:A};f.current=Q,l(Q)},[r,o,t,e]),x=yt.useCallback(S=>{if(!f.current||!u.current)return;const E={x:S.clientX-u.current.x,y:S.clientY-u.current.y},A={x:E.x/c.a,y:E.y/c.d},O={...f.current,new_center:{x:f.current.original_center.x+A.x,y:f.current.original_center.y+A.y}};f.current=O,l(O)},[c]),M=yt.useCallback(()=>{if(!f.current)return;const S={...f.current,in_progress:!1};h.current.set(S.schematic_component_id,{...S.new_center}),dsn("handleMouseUp calling onEditEvent with new edit event",{newEditEvent:S}),n&&n(S),f.current=null,u.current=null,l(null)},[n]);return yt.useEffect(()=>(window.addEventListener("mousemove",x),window.addEventListener("mouseup",M),()=>{window.removeEventListener("mousemove",x),window.removeEventListener("mouseup",M)}),[x,M]),{handleMouseDown:y,isDragging:!!f.current,activeEditEvent:s}},hsn=({onClick:n,active:e})=>dt.jsx("div",{onClick:n,style:{position:"absolute",top:"16px",right:"16px",backgroundColor:e?"#4CAF50":"#fff",color:e?"#fff":"#000",padding:"8px",borderRadius:"4px",cursor:"pointer",boxShadow:"0 2px 4px rgba(0,0,0,0.1)",display:"flex",alignItems:"center",gap:"4px",zIndex:1e3},children:dt.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[dt.jsx("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),dt.jsx("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"})]})}),msn=({circuitJson:n,containerStyle:e,editEvents:t=[],onEditEvent:r,defaultEditMode:i=!1,debugGrid:a=!1,editingEnabled:o=!1,debug:s=!1,clickToInteractEnabled:l=!1,colorOverrides:c})=>{s&&csn();const[u,f]=yt.useState(i),[h,y]=yt.useState(!l),x=yt.useRef(null),[M,S]=yt.useState([]),E=yt.useRef(n),A=Se=>`${(Se==null?void 0:Se.length)||0}_${(Se==null?void 0:Se.editCount)||0}`;yt.useEffect(()=>{const Se=A(n),Ce=A(E.current);Se!==Ce&&(S([]),E.current=n)},[n]);const{ref:O,cancelDrag:k,transform:$}=L$e({onSetTransform(Se){x.current&&(x.current.style.transform=c6(Se))},enabled:h}),{containerWidth:Y,containerHeight:Q}=fsn(O),K=yt.useMemo(()=>!Y||!Q?"":Oue(n,{width:Y,height:Q||720,grid:a?{cellSize:1,labelCells:!0}:void 0,colorOverrides:c}),[n,Y,Q]),ie=yt.useMemo(()=>{var Ce;if(!K)return Z9();const Se=(Ce=K.match(/data-real-to-screen-transform="([^"]+)"/))==null?void 0:Ce[1];try{return yH(Se)}catch(Ee){return console.error(Ee),Z9()}},[K]),ee=Se=>{S(Ce=>[...Ce,Se]),r&&r(Se)},de=yt.useMemo(()=>[...t,...M],[t,M]),{handleMouseDown:me,isDragging:_e,activeEditEvent:Me}=psn({onEditEvent:ee,cancelDrag:k,realToSvgProjection:ie,svgToScreenProjection:$,circuitJson:n,editEvents:de,enabled:u&&h});osn({svgDivRef:x,editEvents:de,realToSvgProjection:ie,svgToScreenProjection:$,activeEditEvent:Me}),ssn({svgDivRef:x,circuitJson:n,activeEditEvent:Me,editEvents:de});const Pe=yt.useMemo(()=>dt.jsx("div",{ref:x,style:{pointerEvents:l?h?"auto":"none":"auto",transformOrigin:"0 0"},dangerouslySetInnerHTML:{__html:K}}),[K,h,l]);return dt.jsxs("div",{ref:O,style:{position:"relative",backgroundColor:"#F5F1ED",overflow:"hidden",cursor:_e?"grabbing":l&&!h?"pointer":"grab",minHeight:"300px",...e},onMouseDown:Se=>{if(l&&!h){Se.preventDefault(),Se.stopPropagation();return}me(Se)},onMouseDownCapture:Se=>{if(l&&!h){Se.preventDefault(),Se.stopPropagation();return}},children:[!h&&l&&dt.jsx("div",{onClick:Se=>{Se.preventDefault(),Se.stopPropagation(),y(!0)},style:{position:"absolute",inset:0,cursor:"pointer",zIndex:10,display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"all"},children:dt.jsx("div",{style:{backgroundColor:"rgba(0, 0, 0, 0.8)",color:"white",padding:"12px 24px",borderRadius:"8px",fontSize:"16px",fontFamily:"sans-serif",pointerEvents:"none"},children:"Click to Interact"})}),o&&dt.jsx(hsn,{active:u,onClick:()=>f(!u)}),Pe]})},vsn=n=>{const[e,t]=yt.useState(0),[r,i]=yt.useState(0);return yt.useEffect(()=>{if(!n.current)return;const a=()=>{var l;const s=(l=n.current)==null?void 0:l.getBoundingClientRect();t((s==null?void 0:s.width)||0),i((s==null?void 0:s.height)||0)};a();const o=new ResizeObserver(a);return o.observe(n.current),window.addEventListener("resize",a),()=>{o.disconnect(),window.removeEventListener("resize",a)}},[]),{containerWidth:e,containerHeight:r}};Rg("assembly-viewer");var ysn=()=>{Rg.enable("assembly-viewer*")},gsn=({circuitJson:n,containerStyle:e,debugGrid:t=!1,debug:r=!1})=>{r&&ysn();const i=yt.useRef(null),{ref:a}=L$e({onSetTransform(u){i.current&&(i.current.style.transform=c6(u))}}),{containerWidth:o,containerHeight:s}=vsn(a),l=yt.useMemo(()=>!o||!s?"":M$e(n,{width:o,height:s||720}),[n,o,s]);yt.useMemo(()=>{var f;if(!l)return Z9();const u=(f=l.match(/data-real-to-screen-transform="([^"]+)"/))==null?void 0:f[1];try{return yH(u)}catch(h){return console.error(h),Z9()}},[l]);const c=yt.useMemo(()=>dt.jsx("div",{ref:i,style:{pointerEvents:"auto",transformOrigin:"0 0"},dangerouslySetInnerHTML:{__html:l}}),[l]);return dt.jsx("div",{ref:a,style:{position:"relative",backgroundColor:"#F5F1ED",overflow:"hidden",minHeight:"300px",...e},children:c})};const z$e=["Always initialize your project using [tsci init](https://github.com/tscircuit/cli) before adding components.","Define reusable modules with cached routes using [<subcircuit />](https://docs.tscircuit.com/elements/subcircuit)","Run `tsci dev` on the command line to preview your boards before export","Use units like mm or mils consistently across your designs.","Quickly set footprints with the [footprint prop](https://docs.tscircuit.com/footprints/footprinter-strings)","Check out the guide on [ordering prototypes](https://docs.tscircuit.com/building-electronics/ordering-prototypes)","Use [net labels](https://docs.tscircuit.com/elements/net) and [group elements](https://docs.tscircuit.com/elements/group) to organize complex schematics.","You can manually drag components on the PCB and Schematic using [manual edits](https://docs.tscircuit.com/guides/manual-edits)","Every tscircuit module can export to [Circuit JSON](https://github.com/tscircuit/circuit-json), Gerbers, Pick'n'Place CSV files, Bill of Materials CSV and more","You can import components from [JLCPCB](https://docs.tscircuit.com/guides/importing-modules-and-chips/importing-from-jlcpcb) or [KiCad](https://docs.tscircuit.com/guides/importing-modules-and-chips/importing-from-kicad)","Any module you push to the [registry](https://tscircuit.com/trending) will have [simple image urls](https://docs.tscircuit.com/web-apis/image-generation-api) you can use display images on a website","The default [Parts Engine](https://docs.tscircuit.com/guides/platform-configuration) will automatically find parts from common vendors for your BOM",'[Pin selectors](https://docs.tscircuit.com/guides/using-sel-references) are similar to CSS selectors, ".R1 > .pin1" means "connect to the first pin of the component R1"',"You can use the [sel](https://docs.tscircuit.com/guides/using-sel-references) object to select pins in a type-safe way","Publish modules via the [registry](https://tscircuit.com/trending) for working with a team or sharing your work","[Explore tutorials](https://docs.tscircuit.com/category/tutorials) for real-world circuit design examples.","Upload your Circuit JSON to [circuitjson.com](https://circuitjson.com) for a quick preview.","You can display Circuit JSON in 3D, PCB or Schematic mode with the [<CircuitJsonPreview />](https://docs.tscircuit.com/elements/circuitjsonpreview) React component","Use a [<group />](https://docs.tscircuit.com/elements/group) element to move multiple components at once in a schematic or PCB layout.","Refer to the [GitHub Discussions page](https://github.com/tscircuit/tscircuit/discussions) to request features","You can customize the autorouter using the [autorouter prop](https://docs.tscircuit.com/elements/board#setting-the-autorouter)","Use the [<constraint />](https://docs.tscircuit.com/footprints/constraint) element to enforce geometric relationships in PCB designs.","Join the [Discord server](https://tscircuit.com/join) to discuss issues and get help directly from the community."],_sn=(()=>{let n=z$e[Math.floor(Math.random()*z$e.length)];return n=n.replace(/</g,"&lt;"),n=n.replace(/>/g,"&gt;"),n=n.replace(new RegExp('(?<!href=")(?<!\\()(?<!\\]\\()(https?:\\/\\/[^\\s\\)\\]]+)',"g"),(e,t)=>`<a class="rf-text-blue-500 rf-underline" href="${e}" target="_blank">${e}</a>`),n=n.replace(/\[([^\]]+)\]\((https?:\/\/[^\)]+)\)/g,'<a class="rf-text-blue-500 rf-underline" href="$2" target="_blank">$1</a>'),n})(),k7=({onRunClicked:n})=>dt.jsxs("div",{className:"rf-flex rf-flex-col rf-items-center rf-justify-center rf-h-full rf-bg-gray-50 rf-text-gray-500 rf-p-4",children:[dt.jsx(KZt,{className:"rf-size-14 rf-mb-4"}),dt.jsxs("p",{className:"rf-text-md rf-break-words rf-max-w-xl rf-text-center",children:["Tip: ",dt.jsx("span",{dangerouslySetInnerHTML:{__html:_sn}})]}),n&&dt.jsxs($8,{className:"rf-mt-4 rf-bg-blue-600 rf-hover:bg-blue-500",onClick:n,children:["Run Code",dt.jsx(eQt,{className:"rf-w-3 rf-h-3 rf-ml-2"})]})]}),xB=({text:n,onClick:e})=>dt.jsx("span",{className:"rf-cursor-pointer rf-underline rf-text-blue-600 rf-mx-2",onClick:e,children:n}),bB=n=>{var e;return dt.jsxs("div",{className:"rf-leading-5",children:[dt.jsx("div",{className:"rf-py-2 rf-font-bold",children:n.column.name}),dt.jsx("div",{children:((e=n.field)==null?void 0:e.call(n))??dt.jsx("input",{type:"text",className:"rf-border rf-rounded rf-p-1 rf-w-full",onChange:t=>{var r;(r=n.onTextChange)==null||r.call(n,t.target.value)}})})]})},xsn=({open:n,children:e,title:t,onClose:r})=>n?dt.jsx("div",{className:"rf-fixed rf-inset-0 rf-bg-black rf-bg-opacity-50 rf-flex rf-justify-center rf-items-center rf-z-50",onClick:r,children:dt.jsxs("div",{className:"rf-bg-white rf-p-5 rf-rounded-lg rf-relative rf-w-11/12 rf-max-w-2xl",onClick:i=>{i.preventDefault(),i.stopPropagation()},children:[dt.jsx("h2",{className:"rf-mt-0 rf-text-md rf-pb-4",children:t}),dt.jsx("button",{type:"button",className:"rf-absolute rf-top-2 rf-right-4 rf-text-2xl rf-font-bold",onClick:r,children:"×"}),e]})}):null,bsn=({elements:n})=>{const[e,t]=yt.useState({open:!1}),[r,i]=yt.useReducer((u,f)=>({...u,...f}),{}),a=[...new Set(n.map(u=>u.type))],o=n.map(u=>{const f=u[`${u.type}_id`],h=Object.fromEntries(Object.entries(u).filter(([x])=>!(x===`${u.type}_id`||!x.endsWith("_id")))),y=Object.fromEntries(Object.entries(u).filter(([x])=>!x.endsWith("_id")));return{primary_id:f,other_ids:h,...y,_og_elm:u}}),s=o.map(u=>{let f="";const h=y=>{const x=Object.keys(y.other_ids).find(E=>E.startsWith("source_"));if(!x)return`.${y.name}`;const M=x.slice(0,-3),S=o.find(E=>E.type===M&&E.primary_id===y.other_ids[x]);return S?"name"in S?`${h(S)} > .${y.name}`:`#${S.primary_id} > .${y.name}`:`??? > .${y.name}`};return"name"in u&&(f=h(u)),{...u,selector_path:f}}),l=[{key:"primary_id",name:"primary_id",renderCell:u=>dt.jsxs("div",{className:"rf-flex rf-items-center",children:[dt.jsx(xB,{text:u.primary_id,onClick:()=>i({focused_id:u.primary_id,id_search:void 0,selector_search:void 0})}),dt.jsx("span",{className:"rf-flex-grow"}),dt.jsx(xB,{text:"(JSON)",onClick:()=>t({open:!0,element:u._og_elm,title:u.primary_id})})]}),renderHeaderCell:u=>dt.jsx(bB,{column:u,onTextChange:f=>i({id_search:f}),field:r.focused_id?()=>dt.jsxs("div",{children:["Focus:"," ",dt.jsx("span",{className:"rf-underline",children:r.focused_id}),dt.jsx(xB,{text:"(unfocus)",onClick:()=>i({focused_id:void 0})})]}):void 0})},{key:"type",name:"type",renderHeaderCell:u=>dt.jsx(bB,{column:u,field:()=>dt.jsxs("select",{onChange:f=>i({component_type_filter:f.target.value}),className:"rf-border rf-rounded rf-p-1 rf-w-full",children:[dt.jsx("option",{value:"any",children:"any"},"any"),dt.jsx("option",{value:"source",children:"source"},"source"),dt.jsx("option",{value:"source/pcb",children:"source/pcb"},"source/pcb"),dt.jsx("option",{value:"source/schematic",children:"source/schematic"},"source/schematic"),a.map(f=>dt.jsx("option",{value:f,children:f},f))]})})},{key:"name",name:"name",renderHeaderCell:u=>dt.jsx(bB,{column:u,onTextChange:f=>i({name_search:f})})},{key:"selector_path",name:"selector_path",renderHeaderCell:u=>dt.jsx(bB,{column:u,onTextChange:f=>i({selector_search:f})})},{key:"other_ids",name:"other_ids",renderCell:u=>dt.jsx("div",{className:"rf-space-x-2",children:Object.entries(u.other_ids).map(([f,h])=>dt.jsx(xB,{text:h,onClick:()=>i({focused_id:h})},h))})}],c=s.filter(u=>{var f,h;return r.name_search?(h=(f=u.name)==null?void 0:f.toLowerCase())==null?void 0:h.includes(r.name_search.toLowerCase()):!0}).filter(u=>{var f;return!r.component_type_filter||r.component_type_filter==="any"?!0:r.component_type_filter==="source"?u.type.startsWith("source_"):r.component_type_filter==="source/pcb"?u.type.startsWith("source_")||u.type.startsWith("pcb_"):r.component_type_filter==="source/schematic"?u.type.startsWith("source_")||u.type.startsWith("schematic_"):(f=u.type)==null?void 0:f.includes(r.component_type_filter)}).filter(u=>r.selector_search?r.selector_search.split(" ").filter(h=>h.length>0).every(h=>{var y;return(y=u.selector_path)==null?void 0:y.includes(h)}):!0).filter(u=>{var f;return r.id_search?(f=u.primary_id)==null?void 0:f.includes(r.id_search):!0}).filter(u=>!!(!r.focused_id||u.primary_id===r.focused_id||Object.values(u.other_ids).includes(r.focused_id)));return dt.jsxs("div",{className:"rf-font-mono rf-text-xs rf-bg-white",children:[dt.jsx("div",{className:"rf-overflow-x-auto",children:dt.jsxs("table",{className:"rf-table-auto rf-w-full rf-text-left",children:[dt.jsx("thead",{children:dt.jsx("tr",{children:l.map(u=>dt.jsx("th",{className:"rf-px-4 rf-py-2 rf-border-b",children:u.renderHeaderCell?u.renderHeaderCell(u):u.name},u.key))})}),dt.jsx("tbody",{children:c.map((u,f)=>dt.jsx("tr",{className:"rf-hover:bg-gray-100",children:l.map(h=>dt.jsx("td",{className:"rf-px-4 rf-py-2 rf-border-b",children:h.renderCell?h.renderCell(u):u[h.key]},h.key))},f))})]})}),dt.jsx(xsn,{open:e.open,onClose:()=>t({open:!1}),title:e.open?e.title:"",children:dt.jsx("div",{className:"rf-bg-gray-800 rf-p-3 rf-text-white rf-rounded",children:dt.jsx("pre",{className:"rf-whitespace-pre-wrap",children:e.open?JSON.stringify(e.element,null,2):""})})})]})},Ssn=(n,e)=>n==="jlcpcb"?dt.jsx("a",{className:"rf-underline rf-text-blue-500",target:"_blank",rel:"noreferrer",href:`https://jlcpcb.com/partdetail/${e}`,children:e}):e,Esn=({circuitJson:n})=>{const e=n.filter(r=>r.type==="source_component"),t=new Set;for(const r of e)if(r.supplier_part_numbers)for(const i of Object.keys(r.supplier_part_numbers))t.add(i);return dt.jsx("div",{className:"rf-overflow-x-auto",children:dt.jsxs("table",{className:"rf-w-full rf-text-left rf-text-sm",children:[dt.jsx("thead",{children:dt.jsxs("tr",{className:"rf-border-b",children:[dt.jsx("th",{className:"rf-p-2",children:"Name"}),Array.from(t).map(r=>dt.jsx("th",{className:"rf-p-2 rf-capitalize",children:r},r))]})}),dt.jsx("tbody",{children:e.map(r=>dt.jsxs("tr",{className:"rf-border-b",children:[dt.jsx("td",{className:"rf-p-2",children:r.name}),Array.from(t).map(i=>{var a,o;return dt.jsx("td",{className:"rf-p-2",children:Ssn(i,((o=(a=r.supplier_part_numbers)==null?void 0:a[i])==null?void 0:o[0])||"")},i)})]},r.source_component_id))})]})})},wsn=({containerClassName:n,...e})=>{const t=yt.useRef(null),[r,i]=yt.useState(620);return yt.useLayoutEffect(()=>{const a=()=>{if(t.current){const s=t.current.clientHeight,l=window.innerHeight;i(Math.min(Math.max(s,620),l))}};a();const o=new ResizeObserver(a);return t.current&&o.observe(t.current),window.addEventListener("resize",a),()=>{o.disconnect(),window.removeEventListener("resize",a)}},[]),dt.jsx("div",{ref:t,className:n||"rf-w-full rf-h-full",children:dt.jsx(zZt,{...e,height:r})})},Tsn='*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }/*! tailwindcss v3.4.17 | MIT License | https://tailwindcss.com*/*,:after,:before{border:0 solid #e5e7eb;box-sizing:border-box}:after,:before{--tw-content:""}:host,html{line-height:1.5;-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-tap-highlight-color:transparent}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{color:inherit;font-family:inherit;font-feature-settings:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{color:#9ca3af;opacity:1}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]:where(:not([hidden=until-found])){display:none}:root{--radius:0.5rem}.rf-pointer-events-none{pointer-events:none}.rf-invisible{visibility:hidden}.rf-fixed{position:fixed}.rf-absolute{position:absolute}.rf-relative{position:relative}.rf-inset-0{inset:0}.-rf-left-2{left:-.5rem}.-rf-right-10{right:-2.5rem}.-rf-right-2{right:-.5rem}.-rf-right-4{right:-1rem}.-rf-right-6{right:-1.5rem}.-rf-right-7{right:-1.75rem}.-rf-right-8{right:-2rem}.-rf-right-9{right:-2.25rem}.rf-bottom-full{bottom:100%}.rf-left-0{left:0}.rf-left-1{left:.25rem}.rf-left-1\\/2{left:50%}.rf-left-2{left:.5rem}.rf-left-\\[50\\%\\]{left:50%}.rf-right-0{right:0}.rf-right-4{right:1rem}.rf-right-\\[4px\\]{right:4px}.rf-top-0{top:0}.rf-top-1{top:.25rem}.rf-top-2{top:.5rem}.rf-top-2\\.5{top:.625rem}.rf-top-\\[50\\%\\]{top:50%}.rf-top-\\[6px\\]{top:6px}.rf-z-50{z-index:50}.rf-z-\\[100\\]{z-index:100}.-rf-mx-1,.rf--mx-1{margin-left:-.25rem;margin-right:-.25rem}.rf-mx-1{margin-left:.25rem;margin-right:.25rem}.rf-mx-2{margin-left:.5rem;margin-right:.5rem}.rf-mx-auto{margin-left:auto;margin-right:auto}.rf-my-1{margin-bottom:.25rem;margin-top:.25rem}.rf-my-12{margin-bottom:3rem;margin-top:3rem}.rf-my-4{margin-bottom:1rem;margin-top:1rem}.rf-my-auto{margin-bottom:auto;margin-top:auto}.rf-mb-1{margin-bottom:.25rem}.rf-mb-12{margin-bottom:3rem}.rf-mb-2{margin-bottom:.5rem}.rf-mb-3{margin-bottom:.75rem}.rf-mb-4{margin-bottom:1rem}.rf-mb-6{margin-bottom:1.5rem}.rf-mb-8{margin-bottom:2rem}.rf-ml-1{margin-left:.25rem}.rf-ml-2{margin-left:.5rem}.rf-ml-auto{margin-left:auto}.rf-mr-1{margin-right:.25rem}.rf-mr-2{margin-right:.5rem}.rf-mt-0{margin-top:0}.rf-mt-0\\.5{margin-top:.125rem}.rf-mt-1{margin-top:.25rem}.rf-mt-2{margin-top:.5rem}.rf-mt-3{margin-top:.75rem}.rf-mt-4{margin-top:1rem}.rf-mt-5{margin-top:1.25rem}.rf-mt-auto{margin-top:auto}.rf-block{display:block}.rf-inline{display:inline}.rf-flex{display:flex}.rf-inline-flex{display:inline-flex}.rf-grid{display:grid}.rf-hidden{display:none}.rf-aspect-square{aspect-ratio:1/1}.rf-aspect-video{aspect-ratio:16/9}.rf-size-14{height:3.5rem;width:3.5rem}.rf-size-4{height:1rem;width:1rem}.\\!rf-h-2{height:.5rem!important}.\\!rf-h-2\\.5{height:.625rem!important}.\\!rf-h-3{height:.75rem!important}.\\!rf-h-full{height:100%!important}.rf-h-1{height:.25rem}.rf-h-10{height:2.5rem}.rf-h-12{height:3rem}.rf-h-2{height:.5rem}.rf-h-2\\.5{height:.625rem}.rf-h-3{height:.75rem}.rf-h-3\\.5{height:.875rem}.rf-h-4{height:1rem}.rf-h-5{height:1.25rem}.rf-h-6{height:1.5rem}.rf-h-60{height:15rem}.rf-h-64{height:16rem}.rf-h-8{height:2rem}.rf-h-9{height:2.25rem}.rf-h-\\[620px\\]{height:620px}.rf-h-\\[calc\\(100vh-52px\\)\\]{height:calc(100vh - 52px)}.rf-h-\\[calc\\(100vh-96px\\)\\]{height:calc(100vh - 96px)}.rf-h-\\[var\\(--radix-select-trigger-height\\)\\]{height:var(--radix-select-trigger-height)}.rf-h-fit{height:-moz-fit-content;height:fit-content}.rf-h-full{height:100%}.rf-h-px{height:1px}.\\!rf-max-h-\\[40vh\\]{max-height:40vh!important}.\\!rf-max-h-\\[70\\%\\]{max-height:70%!important}.rf-max-h-32{max-height:8rem}.rf-max-h-96{max-height:24rem}.rf-max-h-\\[500px\\]{max-height:500px}.rf-max-h-\\[90vh\\]{max-height:90vh}.rf-min-h-0{min-height:0}.rf-min-h-\\[200px\\]{min-height:200px}.rf-min-h-\\[620px\\]{min-height:620px}.rf-min-h-\\[calc\\(100vh-240px\\)\\]{min-height:calc(100vh - 240px)}.\\!rf-w-2{width:.5rem!important}.\\!rf-w-2\\.5{width:.625rem!important}.rf-w-1{width:.25rem}.rf-w-1\\/2{width:50%}.rf-w-11{width:2.75rem}.rf-w-11\\/12{width:91.666667%}.rf-w-12{width:3rem}.rf-w-16{width:4rem}.rf-w-2{width:.5rem}.rf-w-2\\.5{width:.625rem}.rf-w-3{width:.75rem}.rf-w-3\\.5{width:.875rem}.rf-w-32{width:8rem}.rf-w-4{width:1rem}.rf-w-5{width:1.25rem}.rf-w-6{width:1.5rem}.rf-w-64{width:16rem}.rf-w-72{width:18rem}.rf-w-8{width:2rem}.rf-w-9{width:2.25rem}.rf-w-96{width:24rem}.rf-w-fit{width:-moz-fit-content;width:fit-content}.rf-w-full{width:100%}.rf-min-w-10{min-width:2.5rem}.rf-min-w-16{min-width:4rem}.rf-min-w-\\[148px\\]{min-width:148px}.rf-min-w-\\[8rem\\]{min-width:8rem}.rf-min-w-\\[var\\(--radix-select-trigger-width\\)\\]{min-width:var(--radix-select-trigger-width)}.\\!rf-max-w-\\[60vw\\]{max-width:60vw!important}.\\!rf-max-w-\\[660px\\]{max-width:660px!important}.rf-max-w-2xl{max-width:42rem}.rf-max-w-3xl{max-width:48rem}.rf-max-w-5xl{max-width:64rem}.rf-max-w-full{max-width:100%}.rf-max-w-lg{max-width:32rem}.rf-max-w-md{max-width:28rem}.rf-max-w-xl{max-width:36rem}.rf-flex-1{flex:1 1 0%}.rf-flex-shrink-0,.rf-shrink-0{flex-shrink:0}.rf-flex-grow{flex-grow:1}.rf-table-auto{table-layout:auto}.-rf-translate-x-1{--tw-translate-x:-0.25rem}.-rf-translate-x-1,.-rf-translate-x-1\\/2{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-rf-translate-x-1\\/2{--tw-translate-x:-50%}.-rf-translate-y-1{--tw-translate-y:-0.25rem}.-rf-translate-y-1,.rf--translate-x-1{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rf--translate-x-1{--tw-translate-x:-0.25rem}.rf-translate-x-\\[-50\\%\\]{--tw-translate-x:-50%}.rf-translate-x-\\[-50\\%\\],.rf-translate-y-\\[-50\\%\\]{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rf-translate-y-\\[-50\\%\\]{--tw-translate-y:-50%}.rf-transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes rf-pulse{50%{opacity:.5}}.rf-animate-pulse{animation:rf-pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes rf-spin{to{transform:rotate(1turn)}}.rf-animate-spin{animation:rf-spin 1s linear infinite}.rf-cursor-default{cursor:default}.rf-cursor-not-allowed{cursor:not-allowed}.rf-cursor-pointer{cursor:pointer}.rf-select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.rf-grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.rf-grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.rf-flex-row{flex-direction:row}.rf-flex-col{flex-direction:column}.rf-flex-col-reverse{flex-direction:column-reverse}.rf-flex-wrap{flex-wrap:wrap}.rf-place-items-center{place-items:center}.rf-items-start{align-items:flex-start}.rf-items-end{align-items:flex-end}.rf-items-center{align-items:center}.rf-justify-end{justify-content:flex-end}.rf-justify-center{justify-content:center}.rf-justify-between{justify-content:space-between}.rf-gap-0{gap:0}.rf-gap-1{gap:.25rem}.rf-gap-2{gap:.5rem}.rf-gap-3{gap:.75rem}.rf-gap-4{gap:1rem}.rf-gap-5{gap:1.25rem}.rf-gap-6{gap:1.5rem}.rf-gap-8{gap:2rem}.rf-space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(.5rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(.5rem*var(--tw-space-x-reverse))}.rf-space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(.5rem*var(--tw-space-y-reverse));margin-top:calc(.5rem*(1 - var(--tw-space-y-reverse)))}.rf-space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(1rem*var(--tw-space-y-reverse));margin-top:calc(1rem*(1 - var(--tw-space-y-reverse)))}.rf-space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(1.5rem*var(--tw-space-y-reverse));margin-top:calc(1.5rem*(1 - var(--tw-space-y-reverse)))}.rf-divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse:0;border-bottom-width:calc(1px*var(--tw-divide-y-reverse));border-top-width:calc(1px*(1 - var(--tw-divide-y-reverse)))}.rf-overflow-auto{overflow:auto}.rf-overflow-hidden{overflow:hidden}.rf-overflow-visible{overflow:visible}.rf-overflow-x-auto{overflow-x:auto}.\\!rf-overflow-y-auto{overflow-y:auto!important}.rf-overflow-y-auto{overflow-y:auto}.\\!rf-overflow-x-hidden{overflow-x:hidden!important}.rf-overflow-x-hidden{overflow-x:hidden}.rf-overflow-x-clip{overflow-x:clip}.rf-truncate{overflow:hidden;text-overflow:ellipsis}.rf-truncate,.rf-whitespace-nowrap{white-space:nowrap}.rf-whitespace-pre-wrap{white-space:pre-wrap}.rf-break-words{overflow-wrap:break-word}.rf-rounded{border-radius:.25rem}.rf-rounded-2xl{border-radius:1rem}.rf-rounded-full{border-radius:9999px}.rf-rounded-lg{border-radius:var(--radius)}.rf-rounded-md{border-radius:calc(var(--radius) - 2px)}.rf-rounded-sm{border-radius:calc(var(--radius) - 4px)}.rf-rounded-xl{border-radius:.75rem}.rf-border{border-width:1px}.rf-border-b{border-bottom-width:1px}.rf-border-t{border-top-width:1px}.rf-border-blue-200{--tw-border-opacity:1;border-color:rgb(191 219 254/var(--tw-border-opacity,1))}.rf-border-blue-500{--tw-border-opacity:1;border-color:rgb(59 130 246/var(--tw-border-opacity,1))}.rf-border-blue-600{--tw-border-opacity:1;border-color:rgb(37 99 235/var(--tw-border-opacity,1))}.rf-border-gray-200{--tw-border-opacity:1;border-color:rgb(229 231 235/var(--tw-border-opacity,1))}.rf-border-gray-300{--tw-border-opacity:1;border-color:rgb(209 213 219/var(--tw-border-opacity,1))}.rf-border-green-200{--tw-border-opacity:1;border-color:rgb(187 247 208/var(--tw-border-opacity,1))}.rf-border-input{border-color:hsl(var(--input))}.rf-border-neutral-200{--tw-border-opacity:1;border-color:rgb(229 229 229/var(--tw-border-opacity,1))}.rf-border-primary{border-color:hsl(var(--primary))}.rf-border-red-200{--tw-border-opacity:1;border-color:rgb(254 202 202/var(--tw-border-opacity,1))}.rf-border-red-500{--tw-border-opacity:1;border-color:rgb(239 68 68/var(--tw-border-opacity,1))}.rf-border-zinc-200{--tw-border-opacity:1;border-color:rgb(228 228 231/var(--tw-border-opacity,1))}.rf-border-zinc-900{--tw-border-opacity:1;border-color:rgb(24 24 27/var(--tw-border-opacity,1))}.rf-bg-background{background-color:hsl(var(--background))}.rf-bg-black{--tw-bg-opacity:1;background-color:rgb(0 0 0/var(--tw-bg-opacity,1))}.rf-bg-black\\/80{background-color:rgba(0,0,0,.8)}.rf-bg-blue-100{--tw-bg-opacity:1;background-color:rgb(219 234 254/var(--tw-bg-opacity,1))}.rf-bg-blue-50{--tw-bg-opacity:1;background-color:rgb(239 246 255/var(--tw-bg-opacity,1))}.rf-bg-blue-500{--tw-bg-opacity:1;background-color:rgb(59 130 246/var(--tw-bg-opacity,1))}.rf-bg-blue-600{--tw-bg-opacity:1;background-color:rgb(37 99 235/var(--tw-bg-opacity,1))}.rf-bg-gray-100{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity,1))}.rf-bg-gray-300{--tw-bg-opacity:1;background-color:rgb(209 213 219/var(--tw-bg-opacity,1))}.rf-bg-gray-50{--tw-bg-opacity:1;background-color:rgb(249 250 251/var(--tw-bg-opacity,1))}.rf-bg-gray-500{--tw-bg-opacity:1;background-color:rgb(107 114 128/var(--tw-bg-opacity,1))}.rf-bg-gray-700{--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity,1))}.rf-bg-gray-800{--tw-bg-opacity:1;background-color:rgb(31 41 55/var(--tw-bg-opacity,1))}.rf-bg-gray-900{--tw-bg-opacity:1;background-color:rgb(17 24 39/var(--tw-bg-opacity,1))}.rf-bg-green-100{--tw-bg-opacity:1;background-color:rgb(220 252 231/var(--tw-bg-opacity,1))}.rf-bg-green-50{--tw-bg-opacity:1;background-color:rgb(240 253 244/var(--tw-bg-opacity,1))}.rf-bg-muted{background-color:hsl(var(--muted))}.rf-bg-neutral-100{--tw-bg-opacity:1;background-color:rgb(245 245 245/var(--tw-bg-opacity,1))}.rf-bg-neutral-50{--tw-bg-opacity:1;background-color:rgb(250 250 250/var(--tw-bg-opacity,1))}.rf-bg-neutral-800{--tw-bg-opacity:1;background-color:rgb(38 38 38/var(--tw-bg-opacity,1))}.rf-bg-neutral-900{--tw-bg-opacity:1;background-color:rgb(23 23 23/var(--tw-bg-opacity,1))}.rf-bg-orange-400{--tw-bg-opacity:1;background-color:rgb(251 146 60/var(--tw-bg-opacity,1))}.rf-bg-popover{background-color:hsl(var(--popover))}.rf-bg-red-100{--tw-bg-opacity:1;background-color:rgb(254 226 226/var(--tw-bg-opacity,1))}.rf-bg-red-50{--tw-bg-opacity:1;background-color:rgb(254 242 242/var(--tw-bg-opacity,1))}.rf-bg-red-500{--tw-bg-opacity:1;background-color:rgb(239 68 68/var(--tw-bg-opacity,1))}.rf-bg-red-900{--tw-bg-opacity:1;background-color:rgb(127 29 29/var(--tw-bg-opacity,1))}.rf-bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.rf-bg-yellow-100{--tw-bg-opacity:1;background-color:rgb(254 249 195/var(--tw-bg-opacity,1))}.rf-bg-zinc-100{--tw-bg-opacity:1;background-color:rgb(244 244 245/var(--tw-bg-opacity,1))}.rf-bg-zinc-200{--tw-bg-opacity:1;background-color:rgb(228 228 231/var(--tw-bg-opacity,1))}.rf-bg-zinc-50{--tw-bg-opacity:1;background-color:rgb(250 250 250/var(--tw-bg-opacity,1))}.rf-bg-zinc-800{--tw-bg-opacity:1;background-color:rgb(39 39 42/var(--tw-bg-opacity,1))}.rf-bg-zinc-900{--tw-bg-opacity:1;background-color:rgb(24 24 27/var(--tw-bg-opacity,1))}.rf-bg-opacity-50{--tw-bg-opacity:0.5}.rf-fill-current{fill:currentColor}.rf-object-contain{-o-object-fit:contain;object-fit:contain}.\\!rf-p-0{padding:0!important}.rf-p-0{padding:0}.rf-p-1{padding:.25rem}.rf-p-2{padding:.5rem}.rf-p-3{padding:.75rem}.rf-p-4{padding:1rem}.rf-p-5{padding:1.25rem}.rf-p-6{padding:1.5rem}.rf-p-8{padding:2rem}.rf-px-1{padding-left:.25rem;padding-right:.25rem}.rf-px-2{padding-left:.5rem;padding-right:.5rem}.rf-px-3{padding-left:.75rem;padding-right:.75rem}.rf-px-4{padding-left:1rem;padding-right:1rem}.rf-px-6{padding-left:1.5rem;padding-right:1.5rem}.rf-px-8{padding-left:2rem;padding-right:2rem}.rf-py-0{padding-bottom:0;padding-top:0}.rf-py-0\\.5{padding-bottom:.125rem;padding-top:.125rem}.rf-py-1{padding-bottom:.25rem;padding-top:.25rem}.rf-py-1\\.5{padding-bottom:.375rem;padding-top:.375rem}.rf-py-10{padding-bottom:2.5rem;padding-top:2.5rem}.rf-py-12{padding-bottom:3rem;padding-top:3rem}.rf-py-2{padding-bottom:.5rem;padding-top:.5rem}.rf-py-3{padding-bottom:.75rem;padding-top:.75rem}.rf-py-4{padding-bottom:1rem;padding-top:1rem}.rf-pb-0{padding-bottom:0}.rf-pb-3{padding-bottom:.75rem}.rf-pb-4{padding-bottom:1rem}.rf-pl-2{padding-left:.5rem}.rf-pl-4{padding-left:1rem}.rf-pl-8{padding-left:2rem}.rf-pr-2{padding-right:.5rem}.rf-pt-4{padding-top:1rem}.rf-text-left{text-align:left}.rf-text-center{text-align:center}.rf-text-right{text-align:right}.rf-font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.rf-text-2xl{font-size:1.5rem;line-height:2rem}.rf-text-3xl{font-size:1.875rem;line-height:2.25rem}.rf-text-\\[8px\\]{font-size:8px}.rf-text-base{font-size:1rem;line-height:1.5rem}.rf-text-lg{font-size:1.125rem;line-height:1.75rem}.rf-text-sm{font-size:.875rem;line-height:1.25rem}.rf-text-xl{font-size:1.25rem;line-height:1.75rem}.rf-text-xs{font-size:.75rem;line-height:1rem}.rf-font-bold{font-weight:700}.rf-font-medium{font-weight:500}.rf-font-semibold{font-weight:600}.rf-capitalize{text-transform:capitalize}.rf-tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.rf-leading-5{line-height:1.25rem}.rf-leading-none{line-height:1}.rf-leading-tight{line-height:1.25}.rf-tracking-widest{letter-spacing:.1em}.rf-text-black{--tw-text-opacity:1;color:rgb(0 0 0/var(--tw-text-opacity,1))}.rf-text-blue-500{--tw-text-opacity:1;color:rgb(59 130 246/var(--tw-text-opacity,1))}.rf-text-blue-600{--tw-text-opacity:1;color:rgb(37 99 235/var(--tw-text-opacity,1))}.rf-text-blue-700{--tw-text-opacity:1;color:rgb(29 78 216/var(--tw-text-opacity,1))}.rf-text-blue-800{--tw-text-opacity:1;color:rgb(30 64 175/var(--tw-text-opacity,1))}.rf-text-blue-900{--tw-text-opacity:1;color:rgb(30 58 138/var(--tw-text-opacity,1))}.rf-text-current{color:currentColor}.rf-text-gray-400{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity,1))}.rf-text-gray-500{--tw-text-opacity:1;color:rgb(107 114 128/var(--tw-text-opacity,1))}.rf-text-gray-600{--tw-text-opacity:1;color:rgb(75 85 99/var(--tw-text-opacity,1))}.rf-text-gray-700{--tw-text-opacity:1;color:rgb(55 65 81/var(--tw-text-opacity,1))}.rf-text-gray-800{--tw-text-opacity:1;color:rgb(31 41 55/var(--tw-text-opacity,1))}.rf-text-gray-900{--tw-text-opacity:1;color:rgb(17 24 39/var(--tw-text-opacity,1))}.rf-text-green-500{--tw-text-opacity:1;color:rgb(34 197 94/var(--tw-text-opacity,1))}.rf-text-green-600{--tw-text-opacity:1;color:rgb(22 163 74/var(--tw-text-opacity,1))}.rf-text-green-700{--tw-text-opacity:1;color:rgb(21 128 61/var(--tw-text-opacity,1))}.rf-text-green-800{--tw-text-opacity:1;color:rgb(22 101 52/var(--tw-text-opacity,1))}.rf-text-green-900{--tw-text-opacity:1;color:rgb(20 83 45/var(--tw-text-opacity,1))}.rf-text-muted-foreground{color:hsl(var(--muted-foreground))}.rf-text-neutral-50{--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.rf-text-neutral-500{--tw-text-opacity:1;color:rgb(115 115 115/var(--tw-text-opacity,1))}.rf-text-neutral-900{--tw-text-opacity:1;color:rgb(23 23 23/var(--tw-text-opacity,1))}.rf-text-neutral-950{--tw-text-opacity:1;color:rgb(10 10 10/var(--tw-text-opacity,1))}.rf-text-popover-foreground{color:hsl(var(--popover-foreground))}.rf-text-red-200{--tw-text-opacity:1;color:rgb(254 202 202/var(--tw-text-opacity,1))}.rf-text-red-300{--tw-text-opacity:1;color:rgb(252 165 165/var(--tw-text-opacity,1))}.rf-text-red-400{--tw-text-opacity:1;color:rgb(248 113 113/var(--tw-text-opacity,1))}.rf-text-red-500{--tw-text-opacity:1;color:rgb(239 68 68/var(--tw-text-opacity,1))}.rf-text-red-600{--tw-text-opacity:1;color:rgb(220 38 38/var(--tw-text-opacity,1))}.rf-text-red-700{--tw-text-opacity:1;color:rgb(185 28 28/var(--tw-text-opacity,1))}.rf-text-red-800{--tw-text-opacity:1;color:rgb(153 27 27/var(--tw-text-opacity,1))}.rf-text-red-900{--tw-text-opacity:1;color:rgb(127 29 29/var(--tw-text-opacity,1))}.rf-text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.rf-text-yellow-400{--tw-text-opacity:1;color:rgb(250 204 21/var(--tw-text-opacity,1))}.rf-text-yellow-500{--tw-text-opacity:1;color:rgb(234 179 8/var(--tw-text-opacity,1))}.rf-text-yellow-900{--tw-text-opacity:1;color:rgb(113 63 18/var(--tw-text-opacity,1))}.rf-text-zinc-200{--tw-text-opacity:1;color:rgb(228 228 231/var(--tw-text-opacity,1))}.rf-text-zinc-300{--tw-text-opacity:1;color:rgb(212 212 216/var(--tw-text-opacity,1))}.rf-text-zinc-400{--tw-text-opacity:1;color:rgb(161 161 170/var(--tw-text-opacity,1))}.rf-text-zinc-50{--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.rf-text-zinc-500{--tw-text-opacity:1;color:rgb(113 113 122/var(--tw-text-opacity,1))}.rf-text-zinc-900{--tw-text-opacity:1;color:rgb(24 24 27/var(--tw-text-opacity,1))}.rf-text-zinc-950{--tw-text-opacity:1;color:rgb(9 9 11/var(--tw-text-opacity,1))}.rf-underline{text-decoration-line:underline}.rf-line-through{text-decoration-line:line-through}.rf-underline-offset-4{text-underline-offset:4px}.rf-opacity-0{opacity:0}.rf-opacity-25{opacity:.25}.rf-opacity-30{opacity:.3}.rf-opacity-50{opacity:.5}.rf-opacity-60{opacity:.6}.rf-shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color)}.rf-shadow,.rf-shadow-lg{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.rf-shadow-lg{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color)}.rf-shadow-md{--tw-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),0 2px 4px -2px var(--tw-shadow-color)}.rf-shadow-md,.rf-shadow-sm{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.rf-shadow-sm{--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color)}.rf-outline-none{outline:2px solid transparent;outline-offset:2px}.rf-ring-2{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.rf-ring-blue-500{--tw-ring-opacity:1;--tw-ring-color:rgb(59 130 246/var(--tw-ring-opacity,1))}.rf-ring-primary{--tw-ring-color:hsl(var(--primary))}.rf-ring-offset-background{--tw-ring-offset-color:hsl(var(--background))}.rf-ring-offset-white{--tw-ring-offset-color:#fff}.rf-transition{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.rf-transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.rf-transition-colors{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1)}.rf-transition-opacity{transition-duration:.15s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}.rf-duration-200{transition-duration:.2s}.rf-ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}@keyframes enter{0%{opacity:var(--tw-enter-opacity,1);transform:translate3d(var(--tw-enter-translate-x,0),var(--tw-enter-translate-y,0),0) scale3d(var(--tw-enter-scale,1),var(--tw-enter-scale,1),var(--tw-enter-scale,1)) rotate(var(--tw-enter-rotate,0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity,1);transform:translate3d(var(--tw-exit-translate-x,0),var(--tw-exit-translate-y,0),0) scale3d(var(--tw-exit-scale,1),var(--tw-exit-scale,1),var(--tw-exit-scale,1)) rotate(var(--tw-exit-rotate,0))}}.rf-slide-in-from-left-1{--tw-enter-translate-x:-0.25rem}.rf-slide-out-to-left-1{--tw-exit-translate-x:-0.25rem}.rf-duration-200{animation-duration:.2s}.rf-ease-in-out{animation-timing-function:cubic-bezier(.4,0,.2,1)}.file\\:rf-border-0::file-selector-button{border-width:0}.file\\:rf-bg-transparent::file-selector-button{background-color:transparent}.file\\:rf-text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\\:rf-font-medium::file-selector-button{font-weight:500}.placeholder\\:rf-text-zinc-500::-moz-placeholder{--tw-text-opacity:1;color:rgb(113 113 122/var(--tw-text-opacity,1))}.placeholder\\:rf-text-zinc-500::placeholder{--tw-text-opacity:1;color:rgb(113 113 122/var(--tw-text-opacity,1))}.hover\\:rf-border-blue-300:hover{--tw-border-opacity:1;border-color:rgb(147 197 253/var(--tw-border-opacity,1))}.hover\\:\\!rf-bg-transparent:hover{background-color:transparent!important}.hover\\:rf-bg-blue-700:hover{--tw-bg-opacity:1;background-color:rgb(29 78 216/var(--tw-bg-opacity,1))}.hover\\:rf-bg-red-500\\/90:hover{background-color:rgba(239,68,68,.9)}.hover\\:rf-bg-zinc-100:hover{--tw-bg-opacity:1;background-color:rgb(244 244 245/var(--tw-bg-opacity,1))}.hover\\:rf-bg-zinc-100\\/80:hover{background-color:hsla(240,5%,96%,.8)}.hover\\:rf-bg-zinc-900\\/90:hover{background-color:rgba(24,24,27,.9)}.hover\\:rf-text-red-400:hover{--tw-text-opacity:1;color:rgb(248 113 113/var(--tw-text-opacity,1))}.hover\\:rf-text-zinc-900:hover{--tw-text-opacity:1;color:rgb(24 24 27/var(--tw-text-opacity,1))}.hover\\:rf-underline:hover{text-decoration-line:underline}.hover\\:rf-shadow-lg:hover{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.focus\\:rf-bg-gray-100:focus{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity,1))}.focus\\:rf-bg-zinc-100:focus{--tw-bg-opacity:1;background-color:rgb(244 244 245/var(--tw-bg-opacity,1))}.focus\\:rf-text-gray-900:focus{--tw-text-opacity:1;color:rgb(17 24 39/var(--tw-text-opacity,1))}.focus\\:rf-text-zinc-900:focus{--tw-text-opacity:1;color:rgb(24 24 27/var(--tw-text-opacity,1))}.focus\\:rf-outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\\:rf-ring-2:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus\\:rf-ring-ring:focus{--tw-ring-color:hsl(var(--ring))}.focus\\:rf-ring-offset-2:focus{--tw-ring-offset-width:2px}.focus-visible\\:rf-outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\\:rf-ring-1:focus-visible{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus-visible\\:rf-ring-2:focus-visible{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus-visible\\:rf-ring-zinc-950:focus-visible{--tw-ring-opacity:1;--tw-ring-color:rgb(9 9 11/var(--tw-ring-opacity,1))}.focus-visible\\:rf-ring-offset-2:focus-visible{--tw-ring-offset-width:2px}.disabled\\:rf-pointer-events-none:disabled{pointer-events:none}.disabled\\:rf-cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:rf-opacity-50:disabled{opacity:.5}.rf-group\\/bar:hover .group-hover\\/bar\\:rf-opacity-100{opacity:1}.data-\\[disabled\\]\\:rf-pointer-events-none[data-disabled]{pointer-events:none}.data-\\[side\\=bottom\\]\\:rf-translate-y-1[data-side=bottom]{--tw-translate-y:0.25rem}.data-\\[side\\=bottom\\]\\:rf-translate-y-1[data-side=bottom],.data-\\[side\\=left\\]\\:-rf-translate-x-1[data-side=left]{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[side\\=left\\]\\:-rf-translate-x-1[data-side=left]{--tw-translate-x:-0.25rem}.data-\\[side\\=right\\]\\:rf-translate-x-1[data-side=right]{--tw-translate-x:0.25rem}.data-\\[side\\=right\\]\\:rf-translate-x-1[data-side=right],.data-\\[side\\=top\\]\\:-rf-translate-y-1[data-side=top]{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[side\\=top\\]\\:-rf-translate-y-1[data-side=top]{--tw-translate-y:-0.25rem}.data-\\[state\\=active\\]\\:rf-bg-white[data-state=active]{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.data-\\[state\\=checked\\]\\:rf-bg-zinc-900[data-state=checked]{--tw-bg-opacity:1;background-color:rgb(24 24 27/var(--tw-bg-opacity,1))}.data-\\[state\\=open\\]\\:rf-bg-zinc-100[data-state=open]{--tw-bg-opacity:1;background-color:rgb(244 244 245/var(--tw-bg-opacity,1))}.data-\\[state\\=active\\]\\:rf-text-zinc-950[data-state=active]{--tw-text-opacity:1;color:rgb(9 9 11/var(--tw-text-opacity,1))}.data-\\[state\\=checked\\]\\:rf-text-zinc-50[data-state=checked]{--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.data-\\[disabled\\]\\:rf-opacity-50[data-disabled]{opacity:.5}.data-\\[state\\=active\\]\\:rf-shadow[data-state=active]{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.data-\\[state\\=open\\]\\:rf-animate-in[data-state=open]{animation-duration:.15s;animation-name:enter;--tw-enter-opacity:initial;--tw-enter-scale:initial;--tw-enter-rotate:initial;--tw-enter-translate-x:initial;--tw-enter-translate-y:initial}.data-\\[state\\=closed\\]\\:rf-animate-out[data-state=closed]{animation-duration:.15s;animation-name:exit;--tw-exit-opacity:initial;--tw-exit-scale:initial;--tw-exit-rotate:initial;--tw-exit-translate-x:initial;--tw-exit-translate-y:initial}.data-\\[state\\=closed\\]\\:rf-fade-out-0[data-state=closed]{--tw-exit-opacity:0}.data-\\[state\\=open\\]\\:rf-fade-in-0[data-state=open]{--tw-enter-opacity:0}.data-\\[state\\=closed\\]\\:rf-zoom-out-95[data-state=closed]{--tw-exit-scale:.95}.data-\\[state\\=open\\]\\:rf-zoom-in-95[data-state=open]{--tw-enter-scale:.95}.data-\\[side\\=bottom\\]\\:rf-slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y:-0.5rem}.data-\\[side\\=left\\]\\:rf-slide-in-from-right-2[data-side=left]{--tw-enter-translate-x:0.5rem}.data-\\[side\\=right\\]\\:rf-slide-in-from-left-2[data-side=right]{--tw-enter-translate-x:-0.5rem}.data-\\[side\\=top\\]\\:rf-slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y:0.5rem}.data-\\[state\\=closed\\]\\:rf-slide-out-to-left-1\\/2[data-state=closed]{--tw-exit-translate-x:-50%}.data-\\[state\\=closed\\]\\:rf-slide-out-to-top-\\[48\\%\\][data-state=closed]{--tw-exit-translate-y:-48%}.data-\\[state\\=open\\]\\:rf-slide-in-from-left-1\\/2[data-state=open]{--tw-enter-translate-x:-50%}.data-\\[state\\=open\\]\\:rf-slide-in-from-top-\\[48\\%\\][data-state=open]{--tw-enter-translate-y:-48%}.dark\\:rf-border-zinc-50:is(.rf-dark *){--tw-border-opacity:1;border-color:rgb(250 250 250/var(--tw-border-opacity,1))}.dark\\:rf-border-zinc-800:is(.rf-dark *){--tw-border-opacity:1;border-color:rgb(39 39 42/var(--tw-border-opacity,1))}.dark\\:rf-bg-red-900:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(127 29 29/var(--tw-bg-opacity,1))}.dark\\:rf-bg-zinc-50:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(250 250 250/var(--tw-bg-opacity,1))}.dark\\:rf-bg-zinc-800:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(39 39 42/var(--tw-bg-opacity,1))}.dark\\:rf-bg-zinc-950:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(9 9 11/var(--tw-bg-opacity,1))}.dark\\:rf-text-zinc-400:is(.rf-dark *){--tw-text-opacity:1;color:rgb(161 161 170/var(--tw-text-opacity,1))}.dark\\:rf-text-zinc-50:is(.rf-dark *){--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.dark\\:rf-text-zinc-900:is(.rf-dark *){--tw-text-opacity:1;color:rgb(24 24 27/var(--tw-text-opacity,1))}.dark\\:rf-placeholder-zinc-400:is(.rf-dark *)::-moz-placeholder{--tw-placeholder-opacity:1;color:rgb(161 161 170/var(--tw-placeholder-opacity,1))}.dark\\:rf-placeholder-zinc-400:is(.rf-dark *)::placeholder{--tw-placeholder-opacity:1;color:rgb(161 161 170/var(--tw-placeholder-opacity,1))}.dark\\:rf-ring-offset-zinc-950:is(.rf-dark *){--tw-ring-offset-color:#09090b}.dark\\:hover\\:rf-bg-red-900\\/90:hover:is(.rf-dark *){background-color:rgba(127,29,29,.9)}.dark\\:hover\\:rf-bg-zinc-50\\/90:hover:is(.rf-dark *){background-color:hsla(0,0%,98%,.9)}.dark\\:hover\\:rf-bg-zinc-800:hover:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(39 39 42/var(--tw-bg-opacity,1))}.dark\\:hover\\:rf-bg-zinc-800\\/80:hover:is(.rf-dark *){background-color:rgba(39,39,42,.8)}.dark\\:hover\\:rf-text-zinc-50:hover:is(.rf-dark *){--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.dark\\:focus\\:rf-bg-zinc-800:focus:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(39 39 42/var(--tw-bg-opacity,1))}.dark\\:focus\\:rf-text-zinc-50:focus:is(.rf-dark *){--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.dark\\:focus-visible\\:rf-ring-zinc-300:focus-visible:is(.rf-dark *){--tw-ring-opacity:1;--tw-ring-color:rgb(212 212 216/var(--tw-ring-opacity,1))}.dark\\:data-\\[state\\=active\\]\\:rf-bg-zinc-950[data-state=active]:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(9 9 11/var(--tw-bg-opacity,1))}.dark\\:data-\\[state\\=checked\\]\\:rf-bg-zinc-50[data-state=checked]:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(250 250 250/var(--tw-bg-opacity,1))}.dark\\:data-\\[state\\=open\\]\\:rf-bg-zinc-800[data-state=open]:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(39 39 42/var(--tw-bg-opacity,1))}.dark\\:data-\\[state\\=active\\]\\:rf-text-zinc-50[data-state=active]:is(.rf-dark *){--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.dark\\:data-\\[state\\=checked\\]\\:rf-text-zinc-900[data-state=checked]:is(.rf-dark *){--tw-text-opacity:1;color:rgb(24 24 27/var(--tw-text-opacity,1))}@media (min-width:640px){.sm\\:rf-mt-0{margin-top:0}.sm\\:rf-flex-row{flex-direction:row}.sm\\:rf-justify-end{justify-content:flex-end}.sm\\:rf-space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(.5rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(.5rem*var(--tw-space-x-reverse))}.sm\\:rf-rounded-lg{border-radius:var(--radius)}.sm\\:rf-text-left{text-align:left}}@media (min-width:768px){.md\\:rf-grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}.\\[\\&\\>span\\]\\:rf-line-clamp-1>span{display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:1}.\\[\\&\\>svg\\]\\:rf-size-4>svg{height:1rem;width:1rem}.\\[\\&\\>svg\\]\\:rf-shrink-0>svg{flex-shrink:0}.\\[\\&\\>svg\\]\\:rf-text-red-300>svg{--tw-text-opacity:1;color:rgb(252 165 165/var(--tw-text-opacity,1))}.\\[\\&\\>svg\\]\\:hover\\:rf-text-red-400:hover>svg{--tw-text-opacity:1;color:rgb(248 113 113/var(--tw-text-opacity,1))}.\\[\\&_svg\\]\\:rf-pointer-events-none svg{pointer-events:none}.\\[\\&_svg\\]\\:rf-size-4 svg{height:1rem;width:1rem}.\\[\\&_svg\\]\\:rf-shrink-0 svg{flex-shrink:0}',Msn=()=>{yt.useEffect(()=>{if(document.querySelector('style[data-styles="tscircuit-runframe"]'))return;const e=document.createElement("style");e.setAttribute("data-styles","tscircuit-runframe"),e.textContent=Tsn,document.head.appendChild(e)},[])},U$e=n=>`hsl(${Tb.indexOf(n)*137.5%360}, 70%, 50%)`,Csn=({phaseTimings:n})=>{if(!n)return null;const e=Object.values(n).reduce((t,r)=>t+r,0);return dt.jsxs("div",{className:"rf-space-y-2 rf-w-full rf-px-4",children:[dt.jsx("div",{className:"rf-relative rf-h-8 rf-flex rf-rounded-sm",children:Tb.map(t=>{const r=n[t]||0,i=r/e*100;return dt.jsx("div",{className:"rf-group/bar rf-relative rf-overflow-visible",style:{width:`${i}%`,backgroundColor:U$e(t)},children:dt.jsxs("div",{className:"rf-opacity-0 group-hover/bar:rf-opacity-100 rf-transition-opacity rf-absolute rf-bottom-full rf-left-1/2 rf-transform -rf-translate-x-1/2 rf-mb-2 rf-px-2 rf-py-1 rf-text-xs rf-whitespace-nowrap rf-rounded rf-bg-gray-900 rf-text-white rf-pointer-events-none",children:[t,": ",r.toFixed(1),"ms"]})},t)})}),dt.jsxs("div",{className:"rf-text-xs rf-text-gray-500",children:["Total: ",e.toFixed(2),"ms"]})]})},Rsn=({renderLog:n})=>{const[e,t]=yt.useState("chronological");if(!n)return dt.jsx("div",{className:"rf-p-4 rf-bg-gray-100 rf-rounded-md",children:"No render log, make sure this tab is open when you render (TODO add a rerender button here)"});const r=Object.entries((n==null?void 0:n.phaseTimings)??{});e==="chronological"?r.sort((a,o)=>Tb.indexOf(a[0])-Tb.indexOf(o[0])):r.sort((a,o)=>o[1]-a[1]);const i=r.reduce((a,[o,s])=>a+s,0);return dt.jsxs("div",{className:"rf-bg-white",children:[dt.jsxs("div",{className:"rf-flex rf-justify-between rf-items-center",children:[dt.jsx("div",{children:"Render Logs"}),dt.jsxs("div",{className:"rf-mb-4 rf-pr-2 rf-flex rf-text-xs rf-items-center",children:[dt.jsx("div",{className:"rf-mr-2",children:"Sort by:"}),dt.jsxs("select",{value:e,onChange:a=>t(a.target.value),className:"rf-px-2 rf-py-1 rf-border rf-rounded rf-text-xs",children:[dt.jsx("option",{value:"chronological",children:"Phase Order"}),dt.jsx("option",{value:"longest",children:"Duration"})]})]})]}),dt.jsx(Csn,{phaseTimings:n.phaseTimings}),dt.jsxs("table",{className:"rf-w-full rf-text-xs",children:[dt.jsx("thead",{children:dt.jsxs("tr",{children:[dt.jsx("th",{className:"rf-text-left rf-p-2",children:"Phase Order"}),dt.jsx("th",{className:"rf-text-left rf-p-2",children:"Phase"}),dt.jsx("th",{className:"rf-text-left rf-p-2",children:"Duration (ms)"})]})}),dt.jsx("tbody",{children:r.map(([a,o])=>dt.jsxs("tr",{children:[dt.jsx("td",{className:"rf-p-2",children:Tb.indexOf(a)}),dt.jsx("td",{className:"rf-p-2",children:a}),dt.jsx("td",{className:"rf-p-2",children:dt.jsx("div",{className:"rf-w-8",children:dt.jsx("div",{className:"rf-h-2 rf-rounded-sm",style:{backgroundColor:U$e(a),width:`${o/i*100}%`}})})}),dt.jsx("td",{className:"rf-p-2",children:dt.jsxs("div",{className:"rf-flex w-full",children:[dt.jsxs("span",{className:"rf-flex-grow",children:[o,"ms"]}),dt.jsxs("span",{className:"rf-text-gray-500 rf-pr-2",children:[(o/i*100).toFixed(1),"%"]})]})})]},a))})]})]})},Asn="0.0.383",Psn=["assembly","bom","circuit_json","errors","render_log"],Nsn=({code:n,onRunClicked:e=void 0,errorMessage:t,circuitJson:r,autoroutingGraphics:i,showRightHeaderContent:a=!0,showCodeTab:o=!1,codeTabContent:s,showJsonTab:l=!0,showRenderLogTab:c=!0,onActiveTabChange:u,renderLog:f,showImportAndFormatButtons:h=!0,className:y,headerClassName:x,leftHeaderContent:M,readOnly:S,isStreaming:E,autoroutingLog:A,onReportAutoroutingLog:O,isRunningCode:k,hasCodeChangedSinceLastRun:$,onEditEvent:Y,editEvents:Q,defaultActiveTab:K,autoRotate3dViewerDisabled:ie,showSchematicDebugGrid:ee=!1,showToggleFullScreen:de=!0,defaultToFullScreen:me=!1})=>{var Ue;Msn();const[_e,Me]=yt.useState(K??"pcb"),[Pe,Se]=yt.useState(me),Ce=yt.useCallback(ze=>{Me(ze),u==null||u(ze)},[u]),Ee=()=>{Se(!Pe)};return yt.useEffect(()=>{t&&Ce("errors")},[t]),yt.useEffect(()=>{(_e==="code"||_e==="errors")&&r&&!t&&Ce(K??"pcb")},[r]),dt.jsx("div",{className:Gy("flex flex-col relative rf-overflow-x-hidden",y),children:dt.jsx("div",{className:Gy("rf-md:sticky rf-md:top-2",Pe&&"rf-fixed rf-top-0 rf-left-0 rf-w-full rf-bg-white"),children:dt.jsxs(jZe,{value:_e,onValueChange:Ce,className:"rf-flex-grow rf-flex rf-flex-col",children:[dt.jsxs("div",{className:Gy("rf-flex rf-items-center rf-gap-2 rf-p-2 rf-pb-0",x),children:[M,M&&dt.jsx("div",{className:"rf-flex-grow"}),!M&&k&&dt.jsx(ije,{className:"rf-w-4 rf-h-4 rf-animate-spin"}),!M&&dt.jsx("div",{className:"rf-flex-grow"}),f&&f.progress!==1&&dt.jsxs("div",{className:"rf-flex rf-items-center rf-gap-2",children:[f.lastRenderEvent&&dt.jsx("div",{className:"rf-text-xs rf-text-gray-500",children:(Ue=f.lastRenderEvent)==null?void 0:Ue.type.split("renderable:renderLifecycle:")[1].split(":")[0]}),dt.jsx("div",{className:"rf-w-4 rf-h-4 rf-bg-blue-500 rf-opacity-50 rf-rounded-full rf-text-white",children:dt.jsx(ije,{className:"rf-w-4 rf-h-4 rf-animate-spin"})}),dt.jsxs("div",{className:"rf-text-xs rf-font-bold rf-text-gray-700 rf-tabular-nums",children:[((f.progress??0)*100).toFixed(1),"%"]})]}),a&&dt.jsxs(Gfe,{children:[o&&dt.jsx(K7,{value:"code",children:"Code"}),dt.jsxs(K7,{value:"pcb",className:"rf-whitespace-nowrap",children:[r&&dt.jsx("span",{className:Gy("rf-inline-flex rf-items-center rf-justify-center rf-w-2 rf-h-2 rf-mr-1 rf-text-xs rf-font-bold rf-text-white rf-rounded-full",$?"rf-bg-gray-500":"rf-bg-blue-500")}),"PCB"]}),dt.jsxs(K7,{value:"schematic",className:"rf-whitespace-nowrap",children:[r&&dt.jsx("span",{className:Gy("rf-inline-flex rf-items-center rf-justify-center rf-w-2 rf-h-2 rf-mr-1 rf-text-xs rf-font-bold rf-text-white rf-rounded-full",$?"rf-bg-gray-500":"rf-bg-blue-500")}),"Schematic"]}),dt.jsxs(K7,{value:"cad",children:[r&&dt.jsx("span",{className:Gy("inline-flex items-center justify-center w-2 h-2 mr-1 text-xs font-bold text-white rounded-full",$?"rf-bg-gray-500":"rf-bg-blue-500")}),"3D"]}),!["pcb","cad","schematic"].includes(_e)&&dt.jsx(K7,{value:_e,children:Vfe(_e)}),dt.jsxs(hVe,{children:[dt.jsx(mVe,{asChild:!0,children:dt.jsxs("div",{className:"rf-whitespace-nowrap rf-p-2 rf-mr-1 rf-cursor-pointer rf-relative",children:[dt.jsx(ZZt,{className:"rf-w-4 rf-h-4"}),t&&dt.jsx("span",{className:"rf-inline-flex rf-absolute rf-top-[6px] rf-right-[4px] rf-items-center rf-justify-center rf-w-1 rf-h-1 rf-ml-2 rf-text-[8px] rf-font-bold rf-text-white rf-bg-red-500 rf-rounded-full"})]})}),dt.jsxs(yce,{className:"rf-*:text-xs",children:[Psn.map(ze=>dt.jsxs(mF,{onSelect:()=>Ce(ze),children:[_e!==ze&&dt.jsx(rje,{className:"rf-w-3 rf-h-3 rf-opacity-30"}),_e===ze&&dt.jsx(nje,{className:"rf-w-3 rf-h-3"}),dt.jsx("div",{className:"rf-pr-2",children:Vfe(ze)}),ze==="errors"&&t&&dt.jsx("span",{className:"rf-inline-flex rf-items-center rf-justify-center rf-w-3 rf-h-3 rf-ml-2 rf-text-[8px] rf-font-bold rf-text-white rf-bg-red-500 rf-rounded-full",children:"1"})]},ze)),dt.jsx(mF,{disabled:!0,className:"rf-opacity-60 rf-cursor-default rf-select-none",children:dt.jsxs("div",{className:"rf-pr-2 rf-text-xs rf-text-gray-500",children:["@tscircuit/runframe@",Asn.split(".").map((ze,Fe)=>Fe===2?parseInt(ze)+1:ze).join(".")]})})]})]})]}),de&&dt.jsx($8,{onClick:Ee,variant:"ghost",children:Pe?dt.jsx(JZt,{size:16}):dt.jsx(QZt,{size:16})})]}),o&&dt.jsx(h4,{value:"code",className:"rf-flex-grow rf-overflow-hidden",children:dt.jsx("div",{className:"rf-h-full",children:s})}),dt.jsx(h4,{value:"pcb",children:dt.jsx("div",{className:Gy("rf-overflow-hidden",Pe?"rf-h-[calc(100vh-52px)]":"rf-h-[620px]"),children:dt.jsx(iT,{fallbackRender:({error:ze})=>dt.jsx("div",{className:"rf-mt-4 rf-bg-red-50 rf-rounded-md rf-border rf-border-red-200",children:dt.jsxs("div",{className:"rf-p-4",children:[dt.jsx("h3",{className:"rf-text-lg rf-font-semibold rf-text-red-800 rf-mb-3",children:"Error loading PCB viewer"}),dt.jsx("p",{className:"rf-text-xs rf-font-mono rf-whitespace-pre-wrap rf-text-red-600 rf-mt-2",children:(ze==null?void 0:ze.message)||"An unknown error occurred"})]})}),children:r?dt.jsx(wsn,{focusOnHover:!1,circuitJson:r,debugGraphics:i,containerClassName:Gy("rf-h-full rf-w-full",Pe?"rf-min-h-[calc(100vh-240px)]":"rf-min-h-[620px]"),onEditEventsChanged:ze=>{Y&&ze.forEach(Fe=>Y(Fe))}}):dt.jsx(k7,{onRunClicked:e})})})}),dt.jsx(h4,{value:"assembly",children:dt.jsx("div",{className:Gy("rf-overflow-auto",Pe?"rf-h-[calc(100vh-96px)]":"rf-h-[620px]"),children:dt.jsx(iT,{fallback:dt.jsx("div",{children:"Error loading Assembly"}),children:r?dt.jsx(gsn,{circuitJson:r,containerStyle:{height:"100%"},editingEnabled:!0,debugGrid:!0}):dt.jsx(k7,{onRunClicked:e})})})}),dt.jsx(h4,{value:"schematic",children:dt.jsx("div",{className:Gy("rf-overflow-auto",Pe?"rf-h-[calc(100vh-96px)]":"rf-h-[620px]"),children:dt.jsx(iT,{fallbackRender:({error:ze})=>dt.jsx("div",{className:"rf-mt-4 rf-bg-red-50 rf-rounded-md rf-border rf-border-red-200",children:dt.jsxs("div",{className:"rf-p-4",children:[dt.jsx("h3",{className:"rf-text-lg rf-font-semibold rf-text-red-800 rf-mb-3",children:"Error loading Schematic"}),dt.jsx("p",{className:"rf-text-xs rf-font-mono rf-whitespace-pre-wrap rf-text-red-600 rf-mt-2",children:(ze==null?void 0:ze.message)||"An unknown error occurred"})]})}),children:r?dt.jsx(msn,{circuitJson:r,containerStyle:{height:"100%"},editingEnabled:!0,onEditEvent:ze=>{Y==null||Y(ze)},debugGrid:ee}):dt.jsx(k7,{onRunClicked:e})})})}),dt.jsx(h4,{value:"cad",children:dt.jsx("div",{className:Gy("rf-overflow-auto",Pe?"rf-h-[calc(100vh-96px)]":"rf-h-[620px]"),children:dt.jsx(iT,{FallbackComponent:UZt,children:r?dt.jsx(TUt,{soup:r,autoRotateDisabled:ie}):dt.jsx(k7,{onRunClicked:e})})})}),dt.jsx(h4,{value:"bom",children:dt.jsx("div",{className:Gy("rf-overflow-auto",Pe?"rf-h-[calc(100vh-96px)]":"rf-h-[620px]"),children:dt.jsx(iT,{fallbackRender:({error:ze})=>dt.jsx("div",{className:"rf-mt-4 rf-bg-red-50 rf-rounded-md rf-border rf-border-red-200",children:dt.jsxs("div",{className:"rf-p-4",children:[dt.jsx("h3",{className:"rf-text-lg rf-font-semibold rf-text-red-800 rf-mb-3",children:"Error loading Bill of Materials"}),dt.jsx("p",{className:"rf-text-xs rf-font-mono rf-whitespace-pre-wrap rf-text-red-600 rf-mt-2",children:(ze==null?void 0:ze.message)||"An unknown error occurred"})]})}),children:r?dt.jsx(Esn,{circuitJson:r}):dt.jsx(k7,{onRunClicked:e})})})}),dt.jsx(h4,{value:"circuit_json",children:dt.jsx("div",{className:Gy("rf-overflow-auto",Pe?"rf-h-[calc(100vh-96px)]":"rf-h-[620px]"),children:dt.jsx(iT,{fallback:dt.jsx("div",{children:"Error loading JSON viewer"}),children:r?dt.jsx(bsn,{elements:r}):dt.jsx(k7,{onRunClicked:e})})})}),dt.jsx(h4,{value:"errors",children:dt.jsx("div",{className:Gy("rf-overflow-auto",Pe?"rf-h-[calc(100vh-96px)]":"rf-h-[620px]"),children:r||t?dt.jsx(Zen,{code:n,errorMessage:t,autoroutingLog:A,onReportAutoroutingLog:O}):dt.jsx(k7,{onRunClicked:e})})}),c&&dt.jsx(h4,{value:"render_log",children:dt.jsx(Rsn,{renderLog:f})})]})})})};ufe.createRoot(document.getElementById("root")).render(dt.jsx(Nsn,{defaultActiveTab:"cad",autoRotate3dViewerDisabled:!0,showRightHeaderContent:!1,circuitJson:window.CIRCUIT_JSON||{},...window.CIRCUIT_JSON_PREVIEW_PROPS||{}}))});
@@ -13422,7 +13422,7 @@ ${r.slice(0,2e3)}
13422
13422
  50% { opacity: 0.2; }
13423
13423
  100% { opacity: 0.6; }
13424
13424
  }
13425
- `,i.appendChild(D)}})}};a();const o=new MutationObserver(a);return o.observe(i,{childList:!0,subtree:!1,characterData:!1}),()=>{o.disconnect()}},[n,t,e,r])},gpn=Ay("schematic-viewer"),_pn=()=>{Ay.enable("schematic-viewer*")},xpn=gpn,bpn=n=>{const[e,t]=it.useState(0),[r,i]=it.useState(0);return it.useEffect(()=>{if(!n.current)return;const a=()=>{var l;const s=(l=n.current)==null?void 0:l.getBoundingClientRect();t((s==null?void 0:s.width)||0),i((s==null?void 0:s.height)||0)};a();const o=new ResizeObserver(a);return o.observe(n.current),window.addEventListener("resize",a),()=>{o.disconnect(),window.removeEventListener("resize",a)}},[]),{containerWidth:e,containerHeight:r}},Spn=xpn.extend("useComponentDragging"),wpn=({onEditEvent:n,editEvents:e=[],circuitJson:t,cancelDrag:r,svgToScreenProjection:i,realToSvgProjection:a,enabled:o=!1})=>{const[s,l]=it.useState(null),c=Wu(a,i),u=it.useRef(null),f=it.useRef(null),d=it.useRef(new Map);it.useEffect(()=>{e.forEach(b=>{"edit_event_type"in b&&b.edit_event_type==="edit_schematic_component_location"&&!b.in_progress&&d.current.set(b.schematic_component_id,{...b.new_center})})},[e]);const v=it.useCallback(b=>{if(!o)return;const R=b.target.closest('[data-circuit-json-type="schematic_component"]');if(!R)return;const D=R.getAttribute("data-schematic-component-id");if(!D)return;r&&r();const k=n1(t).schematic_component.get(D);if(!k)return;u.current={x:b.clientX,y:b.clientY};let G;const q=d.current.get(D);if(q)G={...q};else{const Y=KWe({editEvents:e,schematic_component_id:D});G={x:k.center.x+Y.x,y:k.center.y+Y.y},d.current.set(D,{...G})}const Z={edit_event_id:Math.random().toString(36).substr(2,9),edit_event_type:"edit_schematic_component_location",schematic_component_id:D,original_center:G,new_center:{...G},in_progress:!0,created_at:Date.now(),_element:R};f.current=Z,l(Z)},[r,o,t,e]),y=it.useCallback(b=>{if(!f.current||!u.current)return;const S={x:b.clientX-u.current.x,y:b.clientY-u.current.y},R={x:S.x/c.a,y:S.y/c.d},D={...f.current,new_center:{x:f.current.original_center.x+R.x,y:f.current.original_center.y+R.y}};f.current=D,l(D)},[c]),w=it.useCallback(()=>{if(!f.current)return;const b={...f.current,in_progress:!1};d.current.set(b.schematic_component_id,{...b.new_center}),Spn("handleMouseUp calling onEditEvent with new edit event",{newEditEvent:b}),n&&n(b),f.current=null,u.current=null,l(null)},[n]);return it.useEffect(()=>(window.addEventListener("mousemove",y),window.addEventListener("mouseup",w),()=>{window.removeEventListener("mousemove",y),window.removeEventListener("mouseup",w)}),[y,w]),{handleMouseDown:v,isDragging:!!f.current,activeEditEvent:s}},Epn=({onClick:n,active:e})=>Ye.jsx("div",{onClick:n,style:{position:"absolute",top:"16px",right:"16px",backgroundColor:e?"#4CAF50":"#fff",color:e?"#fff":"#000",padding:"8px",borderRadius:"4px",cursor:"pointer",boxShadow:"0 2px 4px rgba(0,0,0,0.1)",display:"flex",alignItems:"center",gap:"4px",zIndex:1e3},children:Ye.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[Ye.jsx("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),Ye.jsx("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"})]})}),Tpn=({circuitJson:n,containerStyle:e,editEvents:t=[],onEditEvent:r,defaultEditMode:i=!1,debugGrid:a=!1,editingEnabled:o=!1,debug:s=!1,clickToInteractEnabled:l=!1,colorOverrides:c})=>{s&&_pn();const[u,f]=it.useState(i),[d,v]=it.useState(!l),y=it.useRef(null),[w,b]=it.useState([]),S=it.useRef(n),R=ge=>`${(ge==null?void 0:ge.length)||0}_${(ge==null?void 0:ge.editCount)||0}`;it.useEffect(()=>{const ge=R(n),Te=R(S.current);ge!==Te&&(b([]),S.current=n)},[n]);const{ref:D,cancelDrag:k,transform:G}=QWe({onSetTransform(ge){y.current&&(y.current.style.transform=Y6(ge))},enabled:d}),{containerWidth:q,containerHeight:Z}=bpn(D),Y=it.useMemo(()=>!q||!Z?"":Lde(n,{width:q,height:Z||720,grid:a?{cellSize:1,labelCells:!0}:void 0,colorOverrides:c}),[n,q,Z]),ee=it.useMemo(()=>{var Te;if(!Y)return r9();const ge=(Te=Y.match(/data-real-to-screen-transform="([^"]+)"/))==null?void 0:Te[1];try{return CV(ge)}catch(be){return console.error(be),r9()}},[Y]),X=ge=>{b(Te=>[...Te,ge]),r&&r(ge)},ue=it.useMemo(()=>[...t,...w],[t,w]),{handleMouseDown:pe,isDragging:de,activeEditEvent:we}=wpn({onEditEvent:X,cancelDrag:k,realToSvgProjection:ee,svgToScreenProjection:G,circuitJson:n,editEvents:ue,enabled:u&&d});vpn({svgDivRef:y,editEvents:ue,realToSvgProjection:ee,svgToScreenProjection:G,activeEditEvent:we}),ypn({svgDivRef:y,circuitJson:n,activeEditEvent:we,editEvents:ue});const he=it.useMemo(()=>Ye.jsx("div",{ref:y,style:{pointerEvents:l?d?"auto":"none":"auto",transformOrigin:"0 0"},dangerouslySetInnerHTML:{__html:Y}}),[Y,d,l]);return Ye.jsxs("div",{ref:D,style:{position:"relative",backgroundColor:"#F5F1ED",overflow:"hidden",cursor:de?"grabbing":l&&!d?"pointer":"grab",minHeight:"300px",...e},onMouseDown:ge=>{if(l&&!d){ge.preventDefault(),ge.stopPropagation();return}pe(ge)},onMouseDownCapture:ge=>{if(l&&!d){ge.preventDefault(),ge.stopPropagation();return}},children:[!d&&l&&Ye.jsx("div",{onClick:ge=>{ge.preventDefault(),ge.stopPropagation(),v(!0)},style:{position:"absolute",inset:0,cursor:"pointer",zIndex:10,display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"all"},children:Ye.jsx("div",{style:{backgroundColor:"rgba(0, 0, 0, 0.8)",color:"white",padding:"12px 24px",borderRadius:"8px",fontSize:"16px",fontFamily:"sans-serif",pointerEvents:"none"},children:"Click to Interact"})}),o&&Ye.jsx(Epn,{active:u,onClick:()=>f(!u)}),he]})},Mpn=n=>{const[e,t]=it.useState(0),[r,i]=it.useState(0);return it.useEffect(()=>{if(!n.current)return;const a=()=>{var l;const s=(l=n.current)==null?void 0:l.getBoundingClientRect();t((s==null?void 0:s.width)||0),i((s==null?void 0:s.height)||0)};a();const o=new ResizeObserver(a);return o.observe(n.current),window.addEventListener("resize",a),()=>{o.disconnect(),window.removeEventListener("resize",a)}},[]),{containerWidth:e,containerHeight:r}};Ay("assembly-viewer");var Cpn=()=>{Ay.enable("assembly-viewer*")},Rpn=({circuitJson:n,containerStyle:e,debugGrid:t=!1,debug:r=!1})=>{r&&Cpn();const i=it.useRef(null),{ref:a}=QWe({onSetTransform(u){i.current&&(i.current.style.transform=Y6(u))}}),{containerWidth:o,containerHeight:s}=Mpn(a),l=it.useMemo(()=>!o||!s?"":$We(n,{width:o,height:s||720}),[n,o,s]);it.useMemo(()=>{var f;if(!l)return r9();const u=(f=l.match(/data-real-to-screen-transform="([^"]+)"/))==null?void 0:f[1];try{return CV(u)}catch(d){return console.error(d),r9()}},[l]);const c=it.useMemo(()=>Ye.jsx("div",{ref:i,style:{pointerEvents:"auto",transformOrigin:"0 0"},dangerouslySetInnerHTML:{__html:l}}),[l]);return Ye.jsx("div",{ref:a,style:{position:"relative",backgroundColor:"#F5F1ED",overflow:"hidden",minHeight:"300px",...e},children:c})};const JWe=["Always initialize your project using [tsci init](https://github.com/tscircuit/cli) before adding components.","Define reusable modules with cached routes using [<subcircuit />](https://docs.tscircuit.com/elements/subcircuit)","Run `tsci dev` on the command line to preview your boards before export","Use units like mm or mils consistently across your designs.","Quickly set footprints with the [footprint prop](https://docs.tscircuit.com/footprints/footprinter-strings)","Check out the guide on [ordering prototypes](https://docs.tscircuit.com/building-electronics/ordering-prototypes)","Use [net labels](https://docs.tscircuit.com/elements/net) and [group elements](https://docs.tscircuit.com/elements/group) to organize complex schematics.","You can manually drag components on the PCB and Schematic using [manual edits](https://docs.tscircuit.com/guides/manual-edits)","Every tscircuit module can export to [Circuit JSON](https://github.com/tscircuit/circuit-json), Gerbers, Pick'n'Place CSV files, Bill of Materials CSV and more","You can import components from [JLCPCB](https://docs.tscircuit.com/guides/importing-modules-and-chips/importing-from-jlcpcb) or [KiCad](https://docs.tscircuit.com/guides/importing-modules-and-chips/importing-from-kicad)","Any module you push to the [registry](https://tscircuit.com/trending) will have [simple image urls](https://docs.tscircuit.com/web-apis/image-generation-api) you can use display images on a website","The default [Parts Engine](https://docs.tscircuit.com/guides/platform-configuration) will automatically find parts from common vendors for your BOM",'[Pin selectors](https://docs.tscircuit.com/guides/using-sel-references) are similar to CSS selectors, ".R1 > .pin1" means "connect to the first pin of the component R1"',"You can use the [sel](https://docs.tscircuit.com/guides/using-sel-references) object to select pins in a type-safe way","Publish modules via the [registry](https://tscircuit.com/trending) for working with a team or sharing your work","[Explore tutorials](https://docs.tscircuit.com/category/tutorials) for real-world circuit design examples.","Upload your Circuit JSON to [circuitjson.com](https://circuitjson.com) for a quick preview.","You can display Circuit JSON in 3D, PCB or Schematic mode with the [<CircuitJsonPreview />](https://docs.tscircuit.com/elements/circuitjsonpreview) React component","Use a [<group />](https://docs.tscircuit.com/elements/group) element to move multiple components at once in a schematic or PCB layout.","Refer to the [GitHub Discussions page](https://github.com/tscircuit/tscircuit/discussions) to request features","You can customize the autorouter using the [autorouter prop](https://docs.tscircuit.com/elements/board#setting-the-autorouter)","Use the [<constraint />](https://docs.tscircuit.com/footprints/constraint) element to enforce geometric relationships in PCB designs.","Join the [Discord server](https://tscircuit.com/join) to discuss issues and get help directly from the community."],Apn=()=>{let n=JWe[Math.floor(Math.random()*JWe.length)];return n=n.replace(/</g,"&lt;"),n=n.replace(/>/g,"&gt;"),n=n.replace(new RegExp('(?<!href=")(?<!\\()(?<!\\]\\()(https?:\\/\\/[^\\s\\)\\]]+)',"g"),(e,t)=>`<a class="rf-text-blue-500 rf-underline" href="${e}" target="_blank">${e}</a>`),n=n.replace(/\[([^\]]+)\]\((https?:\/\/[^\)]+)\)/g,'<a class="rf-text-blue-500 rf-underline" href="$2" target="_blank">$1</a>'),n},xw=({onRunClicked:n})=>{const e=it.useMemo(()=>Apn(),[]);return Ye.jsxs("div",{className:"rf-flex rf-flex-col rf-items-center rf-justify-center rf-h-full rf-bg-gray-50 rf-text-gray-500 rf-p-4",children:[Ye.jsx(fin,{className:"rf-size-14 rf-mb-4"}),Ye.jsxs("p",{className:"rf-text-md rf-break-words rf-max-w-xl rf-text-center",children:["Tip: ",Ye.jsx("span",{dangerouslySetInnerHTML:{__html:e}})]}),n&&Ye.jsxs(rb,{className:"rf-mt-4 rf-bg-blue-600 rf-hover:bg-blue-500",onClick:n,children:["Run Code",Ye.jsx(g$e,{className:"rf-w-3 rf-h-3 rf-ml-2"})]})]})},wj=({text:n,onClick:e})=>Ye.jsx("span",{className:"rf-cursor-pointer rf-underline rf-text-blue-600 rf-mx-2",onClick:e,children:n}),Ej=n=>{var e;return Ye.jsxs("div",{className:"rf-leading-5",children:[Ye.jsx("div",{className:"rf-py-2 rf-font-bold",children:n.column.name}),Ye.jsx("div",{children:((e=n.field)==null?void 0:e.call(n))??Ye.jsx("input",{type:"text",className:"rf-border rf-rounded rf-p-1 rf-w-full",onChange:t=>{var r;(r=n.onTextChange)==null||r.call(n,t.target.value)}})})]})},Ppn=({open:n,children:e,title:t,onClose:r})=>n?Ye.jsx("div",{className:"rf-fixed rf-inset-0 rf-bg-black rf-bg-opacity-50 rf-flex rf-justify-center rf-items-center rf-z-50",onClick:r,children:Ye.jsxs("div",{className:"rf-bg-white rf-p-5 rf-rounded-lg rf-relative rf-w-11/12 rf-max-w-2xl",onClick:i=>{i.preventDefault(),i.stopPropagation()},children:[Ye.jsx("h2",{className:"rf-mt-0 rf-text-md rf-pb-4",children:t}),Ye.jsx("button",{type:"button",className:"rf-absolute rf-top-2 rf-right-4 rf-text-2xl rf-font-bold",onClick:r,children:"×"}),e]})}):null,Npn=({elements:n})=>{const[e,t]=it.useState({open:!1}),[r,i]=it.useReducer((u,f)=>({...u,...f}),{}),a=[...new Set(n.map(u=>u.type))],o=n.map(u=>{const f=u[`${u.type}_id`],d=Object.fromEntries(Object.entries(u).filter(([y])=>!(y===`${u.type}_id`||!y.endsWith("_id")))),v=Object.fromEntries(Object.entries(u).filter(([y])=>!y.endsWith("_id")));return{primary_id:f,other_ids:d,...v,_og_elm:u}}),s=o.map(u=>{let f="";const d=v=>{const y=Object.keys(v.other_ids).find(S=>S.startsWith("source_"));if(!y)return`.${v.name}`;const w=y.slice(0,-3),b=o.find(S=>S.type===w&&S.primary_id===v.other_ids[y]);return b?"name"in b?`${d(b)} > .${v.name}`:`#${b.primary_id} > .${v.name}`:`??? > .${v.name}`};return"name"in u&&(f=d(u)),{...u,selector_path:f}}),l=[{key:"primary_id",name:"primary_id",renderCell:u=>Ye.jsxs("div",{className:"rf-flex rf-items-center",children:[Ye.jsx(wj,{text:u.primary_id,onClick:()=>i({focused_id:u.primary_id,id_search:void 0,selector_search:void 0})}),Ye.jsx("span",{className:"rf-flex-grow"}),Ye.jsx(wj,{text:"(JSON)",onClick:()=>t({open:!0,element:u._og_elm,title:u.primary_id})})]}),renderHeaderCell:u=>Ye.jsx(Ej,{column:u,onTextChange:f=>i({id_search:f}),field:r.focused_id?()=>Ye.jsxs("div",{children:["Focus:"," ",Ye.jsx("span",{className:"rf-underline",children:r.focused_id}),Ye.jsx(wj,{text:"(unfocus)",onClick:()=>i({focused_id:void 0})})]}):void 0})},{key:"type",name:"type",renderHeaderCell:u=>Ye.jsx(Ej,{column:u,field:()=>Ye.jsxs("select",{onChange:f=>i({component_type_filter:f.target.value}),className:"rf-border rf-rounded rf-p-1 rf-w-full",children:[Ye.jsx("option",{value:"any",children:"any"},"any"),Ye.jsx("option",{value:"source",children:"source"},"source"),Ye.jsx("option",{value:"source/pcb",children:"source/pcb"},"source/pcb"),Ye.jsx("option",{value:"source/schematic",children:"source/schematic"},"source/schematic"),a.map(f=>Ye.jsx("option",{value:f,children:f},f))]})})},{key:"name",name:"name",renderHeaderCell:u=>Ye.jsx(Ej,{column:u,onTextChange:f=>i({name_search:f})})},{key:"selector_path",name:"selector_path",renderHeaderCell:u=>Ye.jsx(Ej,{column:u,onTextChange:f=>i({selector_search:f})})},{key:"other_ids",name:"other_ids",renderCell:u=>Ye.jsx("div",{className:"rf-space-x-2",children:Object.entries(u.other_ids).map(([f,d])=>Ye.jsx(wj,{text:d,onClick:()=>i({focused_id:d})},d))})}],c=s.filter(u=>{var f,d;return r.name_search?(d=(f=u.name)==null?void 0:f.toLowerCase())==null?void 0:d.includes(r.name_search.toLowerCase()):!0}).filter(u=>{var f;return!r.component_type_filter||r.component_type_filter==="any"?!0:r.component_type_filter==="source"?u.type.startsWith("source_"):r.component_type_filter==="source/pcb"?u.type.startsWith("source_")||u.type.startsWith("pcb_"):r.component_type_filter==="source/schematic"?u.type.startsWith("source_")||u.type.startsWith("schematic_"):(f=u.type)==null?void 0:f.includes(r.component_type_filter)}).filter(u=>r.selector_search?r.selector_search.split(" ").filter(d=>d.length>0).every(d=>{var v;return(v=u.selector_path)==null?void 0:v.includes(d)}):!0).filter(u=>{var f;return r.id_search?(f=u.primary_id)==null?void 0:f.includes(r.id_search):!0}).filter(u=>!!(!r.focused_id||u.primary_id===r.focused_id||Object.values(u.other_ids).includes(r.focused_id)));return Ye.jsxs("div",{className:"rf-font-mono rf-text-xs rf-bg-white",children:[Ye.jsx("div",{className:"rf-overflow-x-auto",children:Ye.jsxs("table",{className:"rf-table-auto rf-w-full rf-text-left",children:[Ye.jsx("thead",{children:Ye.jsx("tr",{children:l.map(u=>Ye.jsx("th",{className:"rf-px-4 rf-py-2 rf-border-b",children:u.renderHeaderCell?u.renderHeaderCell(u):u.name},u.key))})}),Ye.jsx("tbody",{children:c.map((u,f)=>Ye.jsx("tr",{className:"rf-hover:bg-gray-100",children:l.map(d=>Ye.jsx("td",{className:"rf-px-4 rf-py-2 rf-border-b",children:d.renderCell?d.renderCell(u):u[d.key]},d.key))},f))})]})}),Ye.jsx(Ppn,{open:e.open,onClose:()=>t({open:!1}),title:e.open?e.title:"",children:Ye.jsx("div",{className:"rf-bg-gray-800 rf-p-3 rf-text-white rf-rounded",children:Ye.jsx("pre",{className:"rf-whitespace-pre-wrap",children:e.open?JSON.stringify(e.element,null,2):""})})})]})},Dpn=(n,e)=>n==="jlcpcb"?Ye.jsx("a",{className:"rf-underline rf-text-blue-500",target:"_blank",rel:"noreferrer",href:`https://jlcpcb.com/partdetail/${e}`,children:e}):e,Lpn=({circuitJson:n})=>{const e=n.filter(r=>r.type==="source_component"),t=new Set;for(const r of e)if(r.supplier_part_numbers)for(const i of Object.keys(r.supplier_part_numbers))t.add(i);return Ye.jsx("div",{className:"rf-overflow-x-auto",children:Ye.jsxs("table",{className:"rf-w-full rf-text-left rf-text-sm",children:[Ye.jsx("thead",{children:Ye.jsxs("tr",{className:"rf-border-b",children:[Ye.jsx("th",{className:"rf-p-2",children:"Name"}),Array.from(t).map(r=>Ye.jsx("th",{className:"rf-p-2 rf-capitalize",children:r},r))]})}),Ye.jsx("tbody",{children:e.map(r=>Ye.jsxs("tr",{className:"rf-border-b",children:[Ye.jsx("td",{className:"rf-p-2",children:r.name}),Array.from(t).map(i=>{var a,o;return Ye.jsx("td",{className:"rf-p-2",children:Dpn(i,((o=(a=r.supplier_part_numbers)==null?void 0:a[i])==null?void 0:o[0])||"")},i)})]},r.source_component_id))})]})})},Opn=({containerClassName:n,...e})=>{const t=it.useRef(null),[r,i]=it.useState(620);return it.useLayoutEffect(()=>{const a=()=>{if(t.current){const s=t.current.clientHeight,l=window.innerHeight;i(Math.min(Math.max(s,620),l))}};a();const o=new ResizeObserver(a);return t.current&&o.observe(t.current),window.addEventListener("resize",a),()=>{o.disconnect(),window.removeEventListener("resize",a)}},[]),Ye.jsx("div",{ref:t,className:n||"rf-w-full rf-h-full",children:Ye.jsx(Yrn,{...e,height:r})})},zpn='*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }/*! tailwindcss v3.4.17 | MIT License | https://tailwindcss.com*/*,:after,:before{border:0 solid #e5e7eb;box-sizing:border-box}:after,:before{--tw-content:""}:host,html{line-height:1.5;-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-tap-highlight-color:transparent}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{color:inherit;font-family:inherit;font-feature-settings:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{color:#9ca3af;opacity:1}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]:where(:not([hidden=until-found])){display:none}:root{--radius:0.5rem}.rf-pointer-events-none{pointer-events:none}.rf-invisible{visibility:hidden}.rf-fixed{position:fixed}.rf-absolute{position:absolute}.rf-relative{position:relative}.rf-inset-0{inset:0}.-rf-left-2{left:-.5rem}.-rf-right-10{right:-2.5rem}.-rf-right-2{right:-.5rem}.-rf-right-4{right:-1rem}.-rf-right-6{right:-1.5rem}.-rf-right-7{right:-1.75rem}.-rf-right-8{right:-2rem}.-rf-right-9{right:-2.25rem}.rf-bottom-full{bottom:100%}.rf-left-0{left:0}.rf-left-1{left:.25rem}.rf-left-1\\/2{left:50%}.rf-left-2{left:.5rem}.rf-left-\\[50\\%\\]{left:50%}.rf-right-0{right:0}.rf-right-4{right:1rem}.rf-right-\\[4px\\]{right:4px}.rf-top-0{top:0}.rf-top-1{top:.25rem}.rf-top-2{top:.5rem}.rf-top-2\\.5{top:.625rem}.rf-top-\\[50\\%\\]{top:50%}.rf-top-\\[6px\\]{top:6px}.rf-z-50{z-index:50}.rf-z-\\[100\\]{z-index:100}.-rf-mx-1,.rf--mx-1{margin-left:-.25rem;margin-right:-.25rem}.rf-mx-1{margin-left:.25rem;margin-right:.25rem}.rf-mx-2{margin-left:.5rem;margin-right:.5rem}.rf-mx-auto{margin-left:auto;margin-right:auto}.rf-my-1{margin-bottom:.25rem;margin-top:.25rem}.rf-my-12{margin-bottom:3rem;margin-top:3rem}.rf-my-4{margin-bottom:1rem;margin-top:1rem}.rf-my-auto{margin-bottom:auto;margin-top:auto}.rf-mb-1{margin-bottom:.25rem}.rf-mb-12{margin-bottom:3rem}.rf-mb-2{margin-bottom:.5rem}.rf-mb-3{margin-bottom:.75rem}.rf-mb-4{margin-bottom:1rem}.rf-mb-6{margin-bottom:1.5rem}.rf-mb-8{margin-bottom:2rem}.rf-ml-1{margin-left:.25rem}.rf-ml-2{margin-left:.5rem}.rf-ml-auto{margin-left:auto}.rf-mr-1{margin-right:.25rem}.rf-mr-2{margin-right:.5rem}.rf-mt-0{margin-top:0}.rf-mt-0\\.5{margin-top:.125rem}.rf-mt-1{margin-top:.25rem}.rf-mt-2{margin-top:.5rem}.rf-mt-3{margin-top:.75rem}.rf-mt-4{margin-top:1rem}.rf-mt-5{margin-top:1.25rem}.rf-mt-auto{margin-top:auto}.rf-block{display:block}.rf-inline{display:inline}.rf-flex{display:flex}.rf-inline-flex{display:inline-flex}.rf-grid{display:grid}.rf-hidden{display:none}.rf-aspect-square{aspect-ratio:1/1}.rf-aspect-video{aspect-ratio:16/9}.rf-size-14{height:3.5rem;width:3.5rem}.rf-size-4{height:1rem;width:1rem}.\\!rf-h-2{height:.5rem!important}.\\!rf-h-2\\.5{height:.625rem!important}.\\!rf-h-3{height:.75rem!important}.\\!rf-h-full{height:100%!important}.rf-h-1{height:.25rem}.rf-h-10{height:2.5rem}.rf-h-12{height:3rem}.rf-h-2{height:.5rem}.rf-h-2\\.5{height:.625rem}.rf-h-3{height:.75rem}.rf-h-3\\.5{height:.875rem}.rf-h-4{height:1rem}.rf-h-5{height:1.25rem}.rf-h-6{height:1.5rem}.rf-h-60{height:15rem}.rf-h-64{height:16rem}.rf-h-8{height:2rem}.rf-h-9{height:2.25rem}.rf-h-\\[620px\\]{height:620px}.rf-h-\\[calc\\(100vh-52px\\)\\]{height:calc(100vh - 52px)}.rf-h-\\[calc\\(100vh-96px\\)\\]{height:calc(100vh - 96px)}.rf-h-\\[var\\(--radix-select-trigger-height\\)\\]{height:var(--radix-select-trigger-height)}.rf-h-fit{height:-moz-fit-content;height:fit-content}.rf-h-full{height:100%}.rf-h-px{height:1px}.\\!rf-max-h-\\[40vh\\]{max-height:40vh!important}.\\!rf-max-h-\\[70\\%\\]{max-height:70%!important}.rf-max-h-32{max-height:8rem}.rf-max-h-96{max-height:24rem}.rf-max-h-\\[500px\\]{max-height:500px}.rf-max-h-\\[90vh\\]{max-height:90vh}.rf-min-h-0{min-height:0}.rf-min-h-\\[200px\\]{min-height:200px}.rf-min-h-\\[620px\\]{min-height:620px}.rf-min-h-\\[calc\\(100vh-240px\\)\\]{min-height:calc(100vh - 240px)}.\\!rf-w-2{width:.5rem!important}.\\!rf-w-2\\.5{width:.625rem!important}.rf-w-1{width:.25rem}.rf-w-1\\/2{width:50%}.rf-w-11{width:2.75rem}.rf-w-11\\/12{width:91.666667%}.rf-w-12{width:3rem}.rf-w-16{width:4rem}.rf-w-2{width:.5rem}.rf-w-2\\.5{width:.625rem}.rf-w-3{width:.75rem}.rf-w-3\\.5{width:.875rem}.rf-w-32{width:8rem}.rf-w-4{width:1rem}.rf-w-5{width:1.25rem}.rf-w-6{width:1.5rem}.rf-w-64{width:16rem}.rf-w-72{width:18rem}.rf-w-8{width:2rem}.rf-w-9{width:2.25rem}.rf-w-96{width:24rem}.rf-w-fit{width:-moz-fit-content;width:fit-content}.rf-w-full{width:100%}.rf-min-w-10{min-width:2.5rem}.rf-min-w-16{min-width:4rem}.rf-min-w-\\[148px\\]{min-width:148px}.rf-min-w-\\[8rem\\]{min-width:8rem}.rf-min-w-\\[var\\(--radix-select-trigger-width\\)\\]{min-width:var(--radix-select-trigger-width)}.\\!rf-max-w-\\[60vw\\]{max-width:60vw!important}.\\!rf-max-w-\\[660px\\]{max-width:660px!important}.rf-max-w-2xl{max-width:42rem}.rf-max-w-3xl{max-width:48rem}.rf-max-w-5xl{max-width:64rem}.rf-max-w-full{max-width:100%}.rf-max-w-lg{max-width:32rem}.rf-max-w-md{max-width:28rem}.rf-max-w-xl{max-width:36rem}.rf-flex-1{flex:1 1 0%}.rf-flex-shrink-0,.rf-shrink-0{flex-shrink:0}.rf-flex-grow{flex-grow:1}.rf-table-auto{table-layout:auto}.-rf-translate-x-1{--tw-translate-x:-0.25rem}.-rf-translate-x-1,.-rf-translate-x-1\\/2{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-rf-translate-x-1\\/2{--tw-translate-x:-50%}.-rf-translate-y-1{--tw-translate-y:-0.25rem}.-rf-translate-y-1,.rf--translate-x-1{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rf--translate-x-1{--tw-translate-x:-0.25rem}.rf-translate-x-\\[-50\\%\\]{--tw-translate-x:-50%}.rf-translate-x-\\[-50\\%\\],.rf-translate-y-\\[-50\\%\\]{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rf-translate-y-\\[-50\\%\\]{--tw-translate-y:-50%}.rf-transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes rf-pulse{50%{opacity:.5}}.rf-animate-pulse{animation:rf-pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes rf-spin{to{transform:rotate(1turn)}}.rf-animate-spin{animation:rf-spin 1s linear infinite}.rf-cursor-default{cursor:default}.rf-cursor-not-allowed{cursor:not-allowed}.rf-cursor-pointer{cursor:pointer}.rf-select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.rf-grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.rf-grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.rf-flex-row{flex-direction:row}.rf-flex-col{flex-direction:column}.rf-flex-col-reverse{flex-direction:column-reverse}.rf-flex-wrap{flex-wrap:wrap}.rf-place-items-center{place-items:center}.rf-items-start{align-items:flex-start}.rf-items-end{align-items:flex-end}.rf-items-center{align-items:center}.rf-justify-end{justify-content:flex-end}.rf-justify-center{justify-content:center}.rf-justify-between{justify-content:space-between}.rf-gap-0{gap:0}.rf-gap-1{gap:.25rem}.rf-gap-2{gap:.5rem}.rf-gap-3{gap:.75rem}.rf-gap-4{gap:1rem}.rf-gap-5{gap:1.25rem}.rf-gap-6{gap:1.5rem}.rf-gap-8{gap:2rem}.rf-space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(.5rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(.5rem*var(--tw-space-x-reverse))}.rf-space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(.5rem*var(--tw-space-y-reverse));margin-top:calc(.5rem*(1 - var(--tw-space-y-reverse)))}.rf-space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(1rem*var(--tw-space-y-reverse));margin-top:calc(1rem*(1 - var(--tw-space-y-reverse)))}.rf-space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(1.5rem*var(--tw-space-y-reverse));margin-top:calc(1.5rem*(1 - var(--tw-space-y-reverse)))}.rf-divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse:0;border-bottom-width:calc(1px*var(--tw-divide-y-reverse));border-top-width:calc(1px*(1 - var(--tw-divide-y-reverse)))}.rf-overflow-auto{overflow:auto}.rf-overflow-hidden{overflow:hidden}.rf-overflow-visible{overflow:visible}.rf-overflow-x-auto{overflow-x:auto}.\\!rf-overflow-y-auto{overflow-y:auto!important}.rf-overflow-y-auto{overflow-y:auto}.\\!rf-overflow-x-hidden{overflow-x:hidden!important}.rf-overflow-x-hidden{overflow-x:hidden}.rf-overflow-x-clip{overflow-x:clip}.rf-truncate{overflow:hidden;text-overflow:ellipsis}.rf-truncate,.rf-whitespace-nowrap{white-space:nowrap}.rf-whitespace-pre-wrap{white-space:pre-wrap}.rf-break-words{overflow-wrap:break-word}.rf-rounded{border-radius:.25rem}.rf-rounded-2xl{border-radius:1rem}.rf-rounded-full{border-radius:9999px}.rf-rounded-lg{border-radius:var(--radius)}.rf-rounded-md{border-radius:calc(var(--radius) - 2px)}.rf-rounded-sm{border-radius:calc(var(--radius) - 4px)}.rf-rounded-xl{border-radius:.75rem}.rf-border{border-width:1px}.rf-border-b{border-bottom-width:1px}.rf-border-t{border-top-width:1px}.rf-border-blue-200{--tw-border-opacity:1;border-color:rgb(191 219 254/var(--tw-border-opacity,1))}.rf-border-blue-500{--tw-border-opacity:1;border-color:rgb(59 130 246/var(--tw-border-opacity,1))}.rf-border-blue-600{--tw-border-opacity:1;border-color:rgb(37 99 235/var(--tw-border-opacity,1))}.rf-border-gray-200{--tw-border-opacity:1;border-color:rgb(229 231 235/var(--tw-border-opacity,1))}.rf-border-gray-300{--tw-border-opacity:1;border-color:rgb(209 213 219/var(--tw-border-opacity,1))}.rf-border-green-200{--tw-border-opacity:1;border-color:rgb(187 247 208/var(--tw-border-opacity,1))}.rf-border-input{border-color:hsl(var(--input))}.rf-border-neutral-200{--tw-border-opacity:1;border-color:rgb(229 229 229/var(--tw-border-opacity,1))}.rf-border-primary{border-color:hsl(var(--primary))}.rf-border-red-200{--tw-border-opacity:1;border-color:rgb(254 202 202/var(--tw-border-opacity,1))}.rf-border-red-500{--tw-border-opacity:1;border-color:rgb(239 68 68/var(--tw-border-opacity,1))}.rf-border-zinc-200{--tw-border-opacity:1;border-color:rgb(228 228 231/var(--tw-border-opacity,1))}.rf-border-zinc-900{--tw-border-opacity:1;border-color:rgb(24 24 27/var(--tw-border-opacity,1))}.rf-bg-background{background-color:hsl(var(--background))}.rf-bg-black{--tw-bg-opacity:1;background-color:rgb(0 0 0/var(--tw-bg-opacity,1))}.rf-bg-black\\/80{background-color:rgba(0,0,0,.8)}.rf-bg-blue-100{--tw-bg-opacity:1;background-color:rgb(219 234 254/var(--tw-bg-opacity,1))}.rf-bg-blue-50{--tw-bg-opacity:1;background-color:rgb(239 246 255/var(--tw-bg-opacity,1))}.rf-bg-blue-500{--tw-bg-opacity:1;background-color:rgb(59 130 246/var(--tw-bg-opacity,1))}.rf-bg-blue-600{--tw-bg-opacity:1;background-color:rgb(37 99 235/var(--tw-bg-opacity,1))}.rf-bg-gray-100{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity,1))}.rf-bg-gray-300{--tw-bg-opacity:1;background-color:rgb(209 213 219/var(--tw-bg-opacity,1))}.rf-bg-gray-50{--tw-bg-opacity:1;background-color:rgb(249 250 251/var(--tw-bg-opacity,1))}.rf-bg-gray-500{--tw-bg-opacity:1;background-color:rgb(107 114 128/var(--tw-bg-opacity,1))}.rf-bg-gray-700{--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity,1))}.rf-bg-gray-800{--tw-bg-opacity:1;background-color:rgb(31 41 55/var(--tw-bg-opacity,1))}.rf-bg-gray-900{--tw-bg-opacity:1;background-color:rgb(17 24 39/var(--tw-bg-opacity,1))}.rf-bg-green-100{--tw-bg-opacity:1;background-color:rgb(220 252 231/var(--tw-bg-opacity,1))}.rf-bg-green-50{--tw-bg-opacity:1;background-color:rgb(240 253 244/var(--tw-bg-opacity,1))}.rf-bg-muted{background-color:hsl(var(--muted))}.rf-bg-neutral-100{--tw-bg-opacity:1;background-color:rgb(245 245 245/var(--tw-bg-opacity,1))}.rf-bg-neutral-50{--tw-bg-opacity:1;background-color:rgb(250 250 250/var(--tw-bg-opacity,1))}.rf-bg-neutral-800{--tw-bg-opacity:1;background-color:rgb(38 38 38/var(--tw-bg-opacity,1))}.rf-bg-neutral-900{--tw-bg-opacity:1;background-color:rgb(23 23 23/var(--tw-bg-opacity,1))}.rf-bg-orange-400{--tw-bg-opacity:1;background-color:rgb(251 146 60/var(--tw-bg-opacity,1))}.rf-bg-popover{background-color:hsl(var(--popover))}.rf-bg-red-100{--tw-bg-opacity:1;background-color:rgb(254 226 226/var(--tw-bg-opacity,1))}.rf-bg-red-50{--tw-bg-opacity:1;background-color:rgb(254 242 242/var(--tw-bg-opacity,1))}.rf-bg-red-500{--tw-bg-opacity:1;background-color:rgb(239 68 68/var(--tw-bg-opacity,1))}.rf-bg-red-900{--tw-bg-opacity:1;background-color:rgb(127 29 29/var(--tw-bg-opacity,1))}.rf-bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.rf-bg-yellow-100{--tw-bg-opacity:1;background-color:rgb(254 249 195/var(--tw-bg-opacity,1))}.rf-bg-zinc-100{--tw-bg-opacity:1;background-color:rgb(244 244 245/var(--tw-bg-opacity,1))}.rf-bg-zinc-200{--tw-bg-opacity:1;background-color:rgb(228 228 231/var(--tw-bg-opacity,1))}.rf-bg-zinc-50{--tw-bg-opacity:1;background-color:rgb(250 250 250/var(--tw-bg-opacity,1))}.rf-bg-zinc-800{--tw-bg-opacity:1;background-color:rgb(39 39 42/var(--tw-bg-opacity,1))}.rf-bg-zinc-900{--tw-bg-opacity:1;background-color:rgb(24 24 27/var(--tw-bg-opacity,1))}.rf-bg-opacity-50{--tw-bg-opacity:0.5}.rf-fill-current{fill:currentColor}.rf-object-contain{-o-object-fit:contain;object-fit:contain}.\\!rf-p-0{padding:0!important}.rf-p-0{padding:0}.rf-p-1{padding:.25rem}.rf-p-2{padding:.5rem}.rf-p-3{padding:.75rem}.rf-p-4{padding:1rem}.rf-p-5{padding:1.25rem}.rf-p-6{padding:1.5rem}.rf-p-8{padding:2rem}.rf-px-1{padding-left:.25rem;padding-right:.25rem}.rf-px-2{padding-left:.5rem;padding-right:.5rem}.rf-px-3{padding-left:.75rem;padding-right:.75rem}.rf-px-4{padding-left:1rem;padding-right:1rem}.rf-px-6{padding-left:1.5rem;padding-right:1.5rem}.rf-px-8{padding-left:2rem;padding-right:2rem}.rf-py-0{padding-bottom:0;padding-top:0}.rf-py-0\\.5{padding-bottom:.125rem;padding-top:.125rem}.rf-py-1{padding-bottom:.25rem;padding-top:.25rem}.rf-py-1\\.5{padding-bottom:.375rem;padding-top:.375rem}.rf-py-10{padding-bottom:2.5rem;padding-top:2.5rem}.rf-py-12{padding-bottom:3rem;padding-top:3rem}.rf-py-2{padding-bottom:.5rem;padding-top:.5rem}.rf-py-3{padding-bottom:.75rem;padding-top:.75rem}.rf-py-4{padding-bottom:1rem;padding-top:1rem}.rf-pb-0{padding-bottom:0}.rf-pb-3{padding-bottom:.75rem}.rf-pb-4{padding-bottom:1rem}.rf-pl-2{padding-left:.5rem}.rf-pl-4{padding-left:1rem}.rf-pl-8{padding-left:2rem}.rf-pr-2{padding-right:.5rem}.rf-pt-4{padding-top:1rem}.rf-text-left{text-align:left}.rf-text-center{text-align:center}.rf-text-right{text-align:right}.rf-font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.rf-text-2xl{font-size:1.5rem;line-height:2rem}.rf-text-3xl{font-size:1.875rem;line-height:2.25rem}.rf-text-\\[8px\\]{font-size:8px}.rf-text-base{font-size:1rem;line-height:1.5rem}.rf-text-lg{font-size:1.125rem;line-height:1.75rem}.rf-text-sm{font-size:.875rem;line-height:1.25rem}.rf-text-xl{font-size:1.25rem;line-height:1.75rem}.rf-text-xs{font-size:.75rem;line-height:1rem}.rf-font-bold{font-weight:700}.rf-font-medium{font-weight:500}.rf-font-semibold{font-weight:600}.rf-capitalize{text-transform:capitalize}.rf-tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.rf-leading-5{line-height:1.25rem}.rf-leading-none{line-height:1}.rf-leading-tight{line-height:1.25}.rf-tracking-widest{letter-spacing:.1em}.rf-text-black{--tw-text-opacity:1;color:rgb(0 0 0/var(--tw-text-opacity,1))}.rf-text-blue-500{--tw-text-opacity:1;color:rgb(59 130 246/var(--tw-text-opacity,1))}.rf-text-blue-600{--tw-text-opacity:1;color:rgb(37 99 235/var(--tw-text-opacity,1))}.rf-text-blue-700{--tw-text-opacity:1;color:rgb(29 78 216/var(--tw-text-opacity,1))}.rf-text-blue-800{--tw-text-opacity:1;color:rgb(30 64 175/var(--tw-text-opacity,1))}.rf-text-blue-900{--tw-text-opacity:1;color:rgb(30 58 138/var(--tw-text-opacity,1))}.rf-text-current{color:currentColor}.rf-text-gray-400{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity,1))}.rf-text-gray-500{--tw-text-opacity:1;color:rgb(107 114 128/var(--tw-text-opacity,1))}.rf-text-gray-600{--tw-text-opacity:1;color:rgb(75 85 99/var(--tw-text-opacity,1))}.rf-text-gray-700{--tw-text-opacity:1;color:rgb(55 65 81/var(--tw-text-opacity,1))}.rf-text-gray-800{--tw-text-opacity:1;color:rgb(31 41 55/var(--tw-text-opacity,1))}.rf-text-gray-900{--tw-text-opacity:1;color:rgb(17 24 39/var(--tw-text-opacity,1))}.rf-text-green-500{--tw-text-opacity:1;color:rgb(34 197 94/var(--tw-text-opacity,1))}.rf-text-green-600{--tw-text-opacity:1;color:rgb(22 163 74/var(--tw-text-opacity,1))}.rf-text-green-700{--tw-text-opacity:1;color:rgb(21 128 61/var(--tw-text-opacity,1))}.rf-text-green-800{--tw-text-opacity:1;color:rgb(22 101 52/var(--tw-text-opacity,1))}.rf-text-green-900{--tw-text-opacity:1;color:rgb(20 83 45/var(--tw-text-opacity,1))}.rf-text-muted-foreground{color:hsl(var(--muted-foreground))}.rf-text-neutral-50{--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.rf-text-neutral-500{--tw-text-opacity:1;color:rgb(115 115 115/var(--tw-text-opacity,1))}.rf-text-neutral-900{--tw-text-opacity:1;color:rgb(23 23 23/var(--tw-text-opacity,1))}.rf-text-neutral-950{--tw-text-opacity:1;color:rgb(10 10 10/var(--tw-text-opacity,1))}.rf-text-popover-foreground{color:hsl(var(--popover-foreground))}.rf-text-red-200{--tw-text-opacity:1;color:rgb(254 202 202/var(--tw-text-opacity,1))}.rf-text-red-300{--tw-text-opacity:1;color:rgb(252 165 165/var(--tw-text-opacity,1))}.rf-text-red-400{--tw-text-opacity:1;color:rgb(248 113 113/var(--tw-text-opacity,1))}.rf-text-red-500{--tw-text-opacity:1;color:rgb(239 68 68/var(--tw-text-opacity,1))}.rf-text-red-600{--tw-text-opacity:1;color:rgb(220 38 38/var(--tw-text-opacity,1))}.rf-text-red-700{--tw-text-opacity:1;color:rgb(185 28 28/var(--tw-text-opacity,1))}.rf-text-red-800{--tw-text-opacity:1;color:rgb(153 27 27/var(--tw-text-opacity,1))}.rf-text-red-900{--tw-text-opacity:1;color:rgb(127 29 29/var(--tw-text-opacity,1))}.rf-text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.rf-text-yellow-400{--tw-text-opacity:1;color:rgb(250 204 21/var(--tw-text-opacity,1))}.rf-text-yellow-500{--tw-text-opacity:1;color:rgb(234 179 8/var(--tw-text-opacity,1))}.rf-text-yellow-900{--tw-text-opacity:1;color:rgb(113 63 18/var(--tw-text-opacity,1))}.rf-text-zinc-200{--tw-text-opacity:1;color:rgb(228 228 231/var(--tw-text-opacity,1))}.rf-text-zinc-300{--tw-text-opacity:1;color:rgb(212 212 216/var(--tw-text-opacity,1))}.rf-text-zinc-400{--tw-text-opacity:1;color:rgb(161 161 170/var(--tw-text-opacity,1))}.rf-text-zinc-50{--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.rf-text-zinc-500{--tw-text-opacity:1;color:rgb(113 113 122/var(--tw-text-opacity,1))}.rf-text-zinc-900{--tw-text-opacity:1;color:rgb(24 24 27/var(--tw-text-opacity,1))}.rf-text-zinc-950{--tw-text-opacity:1;color:rgb(9 9 11/var(--tw-text-opacity,1))}.rf-underline{text-decoration-line:underline}.rf-line-through{text-decoration-line:line-through}.rf-underline-offset-4{text-underline-offset:4px}.rf-opacity-0{opacity:0}.rf-opacity-25{opacity:.25}.rf-opacity-30{opacity:.3}.rf-opacity-50{opacity:.5}.rf-opacity-60{opacity:.6}.rf-shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color)}.rf-shadow,.rf-shadow-lg{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.rf-shadow-lg{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color)}.rf-shadow-md{--tw-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),0 2px 4px -2px var(--tw-shadow-color)}.rf-shadow-md,.rf-shadow-sm{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.rf-shadow-sm{--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color)}.rf-outline-none{outline:2px solid transparent;outline-offset:2px}.rf-ring-2{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.rf-ring-blue-500{--tw-ring-opacity:1;--tw-ring-color:rgb(59 130 246/var(--tw-ring-opacity,1))}.rf-ring-primary{--tw-ring-color:hsl(var(--primary))}.rf-ring-offset-background{--tw-ring-offset-color:hsl(var(--background))}.rf-ring-offset-white{--tw-ring-offset-color:#fff}.rf-transition{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.rf-transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.rf-transition-colors{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1)}.rf-transition-opacity{transition-duration:.15s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}.rf-duration-200{transition-duration:.2s}.rf-ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}@keyframes enter{0%{opacity:var(--tw-enter-opacity,1);transform:translate3d(var(--tw-enter-translate-x,0),var(--tw-enter-translate-y,0),0) scale3d(var(--tw-enter-scale,1),var(--tw-enter-scale,1),var(--tw-enter-scale,1)) rotate(var(--tw-enter-rotate,0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity,1);transform:translate3d(var(--tw-exit-translate-x,0),var(--tw-exit-translate-y,0),0) scale3d(var(--tw-exit-scale,1),var(--tw-exit-scale,1),var(--tw-exit-scale,1)) rotate(var(--tw-exit-rotate,0))}}.rf-slide-in-from-left-1{--tw-enter-translate-x:-0.25rem}.rf-slide-out-to-left-1{--tw-exit-translate-x:-0.25rem}.rf-duration-200{animation-duration:.2s}.rf-ease-in-out{animation-timing-function:cubic-bezier(.4,0,.2,1)}.file\\:rf-border-0::file-selector-button{border-width:0}.file\\:rf-bg-transparent::file-selector-button{background-color:transparent}.file\\:rf-text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\\:rf-font-medium::file-selector-button{font-weight:500}.placeholder\\:rf-text-zinc-500::-moz-placeholder{--tw-text-opacity:1;color:rgb(113 113 122/var(--tw-text-opacity,1))}.placeholder\\:rf-text-zinc-500::placeholder{--tw-text-opacity:1;color:rgb(113 113 122/var(--tw-text-opacity,1))}.hover\\:rf-border-blue-300:hover{--tw-border-opacity:1;border-color:rgb(147 197 253/var(--tw-border-opacity,1))}.hover\\:\\!rf-bg-transparent:hover{background-color:transparent!important}.hover\\:rf-bg-blue-700:hover{--tw-bg-opacity:1;background-color:rgb(29 78 216/var(--tw-bg-opacity,1))}.hover\\:rf-bg-red-500\\/90:hover{background-color:rgba(239,68,68,.9)}.hover\\:rf-bg-zinc-100:hover{--tw-bg-opacity:1;background-color:rgb(244 244 245/var(--tw-bg-opacity,1))}.hover\\:rf-bg-zinc-100\\/80:hover{background-color:hsla(240,5%,96%,.8)}.hover\\:rf-bg-zinc-900\\/90:hover{background-color:rgba(24,24,27,.9)}.hover\\:rf-text-red-400:hover{--tw-text-opacity:1;color:rgb(248 113 113/var(--tw-text-opacity,1))}.hover\\:rf-text-zinc-900:hover{--tw-text-opacity:1;color:rgb(24 24 27/var(--tw-text-opacity,1))}.hover\\:rf-underline:hover{text-decoration-line:underline}.hover\\:rf-shadow-lg:hover{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.focus\\:rf-bg-gray-100:focus{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity,1))}.focus\\:rf-bg-zinc-100:focus{--tw-bg-opacity:1;background-color:rgb(244 244 245/var(--tw-bg-opacity,1))}.focus\\:rf-text-gray-900:focus{--tw-text-opacity:1;color:rgb(17 24 39/var(--tw-text-opacity,1))}.focus\\:rf-text-zinc-900:focus{--tw-text-opacity:1;color:rgb(24 24 27/var(--tw-text-opacity,1))}.focus\\:rf-outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\\:rf-ring-2:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus\\:rf-ring-ring:focus{--tw-ring-color:hsl(var(--ring))}.focus\\:rf-ring-offset-2:focus{--tw-ring-offset-width:2px}.focus-visible\\:rf-outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\\:rf-ring-1:focus-visible{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus-visible\\:rf-ring-2:focus-visible{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus-visible\\:rf-ring-zinc-950:focus-visible{--tw-ring-opacity:1;--tw-ring-color:rgb(9 9 11/var(--tw-ring-opacity,1))}.focus-visible\\:rf-ring-offset-2:focus-visible{--tw-ring-offset-width:2px}.disabled\\:rf-pointer-events-none:disabled{pointer-events:none}.disabled\\:rf-cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:rf-opacity-50:disabled{opacity:.5}.rf-group\\/bar:hover .group-hover\\/bar\\:rf-opacity-100{opacity:1}.data-\\[disabled\\]\\:rf-pointer-events-none[data-disabled]{pointer-events:none}.data-\\[side\\=bottom\\]\\:rf-translate-y-1[data-side=bottom]{--tw-translate-y:0.25rem}.data-\\[side\\=bottom\\]\\:rf-translate-y-1[data-side=bottom],.data-\\[side\\=left\\]\\:-rf-translate-x-1[data-side=left]{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[side\\=left\\]\\:-rf-translate-x-1[data-side=left]{--tw-translate-x:-0.25rem}.data-\\[side\\=right\\]\\:rf-translate-x-1[data-side=right]{--tw-translate-x:0.25rem}.data-\\[side\\=right\\]\\:rf-translate-x-1[data-side=right],.data-\\[side\\=top\\]\\:-rf-translate-y-1[data-side=top]{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[side\\=top\\]\\:-rf-translate-y-1[data-side=top]{--tw-translate-y:-0.25rem}.data-\\[state\\=active\\]\\:rf-bg-white[data-state=active]{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.data-\\[state\\=checked\\]\\:rf-bg-zinc-900[data-state=checked]{--tw-bg-opacity:1;background-color:rgb(24 24 27/var(--tw-bg-opacity,1))}.data-\\[state\\=open\\]\\:rf-bg-zinc-100[data-state=open]{--tw-bg-opacity:1;background-color:rgb(244 244 245/var(--tw-bg-opacity,1))}.data-\\[state\\=active\\]\\:rf-text-zinc-950[data-state=active]{--tw-text-opacity:1;color:rgb(9 9 11/var(--tw-text-opacity,1))}.data-\\[state\\=checked\\]\\:rf-text-zinc-50[data-state=checked]{--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.data-\\[disabled\\]\\:rf-opacity-50[data-disabled]{opacity:.5}.data-\\[state\\=active\\]\\:rf-shadow[data-state=active]{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.data-\\[state\\=open\\]\\:rf-animate-in[data-state=open]{animation-duration:.15s;animation-name:enter;--tw-enter-opacity:initial;--tw-enter-scale:initial;--tw-enter-rotate:initial;--tw-enter-translate-x:initial;--tw-enter-translate-y:initial}.data-\\[state\\=closed\\]\\:rf-animate-out[data-state=closed]{animation-duration:.15s;animation-name:exit;--tw-exit-opacity:initial;--tw-exit-scale:initial;--tw-exit-rotate:initial;--tw-exit-translate-x:initial;--tw-exit-translate-y:initial}.data-\\[state\\=closed\\]\\:rf-fade-out-0[data-state=closed]{--tw-exit-opacity:0}.data-\\[state\\=open\\]\\:rf-fade-in-0[data-state=open]{--tw-enter-opacity:0}.data-\\[state\\=closed\\]\\:rf-zoom-out-95[data-state=closed]{--tw-exit-scale:.95}.data-\\[state\\=open\\]\\:rf-zoom-in-95[data-state=open]{--tw-enter-scale:.95}.data-\\[side\\=bottom\\]\\:rf-slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y:-0.5rem}.data-\\[side\\=left\\]\\:rf-slide-in-from-right-2[data-side=left]{--tw-enter-translate-x:0.5rem}.data-\\[side\\=right\\]\\:rf-slide-in-from-left-2[data-side=right]{--tw-enter-translate-x:-0.5rem}.data-\\[side\\=top\\]\\:rf-slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y:0.5rem}.data-\\[state\\=closed\\]\\:rf-slide-out-to-left-1\\/2[data-state=closed]{--tw-exit-translate-x:-50%}.data-\\[state\\=closed\\]\\:rf-slide-out-to-top-\\[48\\%\\][data-state=closed]{--tw-exit-translate-y:-48%}.data-\\[state\\=open\\]\\:rf-slide-in-from-left-1\\/2[data-state=open]{--tw-enter-translate-x:-50%}.data-\\[state\\=open\\]\\:rf-slide-in-from-top-\\[48\\%\\][data-state=open]{--tw-enter-translate-y:-48%}.dark\\:rf-border-zinc-50:is(.rf-dark *){--tw-border-opacity:1;border-color:rgb(250 250 250/var(--tw-border-opacity,1))}.dark\\:rf-border-zinc-800:is(.rf-dark *){--tw-border-opacity:1;border-color:rgb(39 39 42/var(--tw-border-opacity,1))}.dark\\:rf-bg-red-900:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(127 29 29/var(--tw-bg-opacity,1))}.dark\\:rf-bg-zinc-50:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(250 250 250/var(--tw-bg-opacity,1))}.dark\\:rf-bg-zinc-800:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(39 39 42/var(--tw-bg-opacity,1))}.dark\\:rf-bg-zinc-950:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(9 9 11/var(--tw-bg-opacity,1))}.dark\\:rf-text-zinc-400:is(.rf-dark *){--tw-text-opacity:1;color:rgb(161 161 170/var(--tw-text-opacity,1))}.dark\\:rf-text-zinc-50:is(.rf-dark *){--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.dark\\:rf-text-zinc-900:is(.rf-dark *){--tw-text-opacity:1;color:rgb(24 24 27/var(--tw-text-opacity,1))}.dark\\:rf-placeholder-zinc-400:is(.rf-dark *)::-moz-placeholder{--tw-placeholder-opacity:1;color:rgb(161 161 170/var(--tw-placeholder-opacity,1))}.dark\\:rf-placeholder-zinc-400:is(.rf-dark *)::placeholder{--tw-placeholder-opacity:1;color:rgb(161 161 170/var(--tw-placeholder-opacity,1))}.dark\\:rf-ring-offset-zinc-950:is(.rf-dark *){--tw-ring-offset-color:#09090b}.dark\\:hover\\:rf-bg-red-900\\/90:hover:is(.rf-dark *){background-color:rgba(127,29,29,.9)}.dark\\:hover\\:rf-bg-zinc-50\\/90:hover:is(.rf-dark *){background-color:hsla(0,0%,98%,.9)}.dark\\:hover\\:rf-bg-zinc-800:hover:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(39 39 42/var(--tw-bg-opacity,1))}.dark\\:hover\\:rf-bg-zinc-800\\/80:hover:is(.rf-dark *){background-color:rgba(39,39,42,.8)}.dark\\:hover\\:rf-text-zinc-50:hover:is(.rf-dark *){--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.dark\\:focus\\:rf-bg-zinc-800:focus:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(39 39 42/var(--tw-bg-opacity,1))}.dark\\:focus\\:rf-text-zinc-50:focus:is(.rf-dark *){--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.dark\\:focus-visible\\:rf-ring-zinc-300:focus-visible:is(.rf-dark *){--tw-ring-opacity:1;--tw-ring-color:rgb(212 212 216/var(--tw-ring-opacity,1))}.dark\\:data-\\[state\\=active\\]\\:rf-bg-zinc-950[data-state=active]:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(9 9 11/var(--tw-bg-opacity,1))}.dark\\:data-\\[state\\=checked\\]\\:rf-bg-zinc-50[data-state=checked]:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(250 250 250/var(--tw-bg-opacity,1))}.dark\\:data-\\[state\\=open\\]\\:rf-bg-zinc-800[data-state=open]:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(39 39 42/var(--tw-bg-opacity,1))}.dark\\:data-\\[state\\=active\\]\\:rf-text-zinc-50[data-state=active]:is(.rf-dark *){--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.dark\\:data-\\[state\\=checked\\]\\:rf-text-zinc-900[data-state=checked]:is(.rf-dark *){--tw-text-opacity:1;color:rgb(24 24 27/var(--tw-text-opacity,1))}@media (min-width:640px){.sm\\:rf-mt-0{margin-top:0}.sm\\:rf-flex-row{flex-direction:row}.sm\\:rf-justify-end{justify-content:flex-end}.sm\\:rf-space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(.5rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(.5rem*var(--tw-space-x-reverse))}.sm\\:rf-rounded-lg{border-radius:var(--radius)}.sm\\:rf-text-left{text-align:left}}@media (min-width:768px){.md\\:rf-grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}.\\[\\&\\>span\\]\\:rf-line-clamp-1>span{display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:1}.\\[\\&\\>svg\\]\\:rf-size-4>svg{height:1rem;width:1rem}.\\[\\&\\>svg\\]\\:rf-shrink-0>svg{flex-shrink:0}.\\[\\&\\>svg\\]\\:rf-text-red-300>svg{--tw-text-opacity:1;color:rgb(252 165 165/var(--tw-text-opacity,1))}.\\[\\&\\>svg\\]\\:hover\\:rf-text-red-400:hover>svg{--tw-text-opacity:1;color:rgb(248 113 113/var(--tw-text-opacity,1))}.\\[\\&_svg\\]\\:rf-pointer-events-none svg{pointer-events:none}.\\[\\&_svg\\]\\:rf-size-4 svg{height:1rem;width:1rem}.\\[\\&_svg\\]\\:rf-shrink-0 svg{flex-shrink:0}',Upn=()=>{it.useEffect(()=>{if(document.querySelector('style[data-styles="tscircuit-runframe"]'))return;const e=document.createElement("style");e.setAttribute("data-styles","tscircuit-runframe"),e.textContent=zpn,document.head.appendChild(e)},[])},eZe=n=>`hsl(${s3.indexOf(n)*137.5%360}, 70%, 50%)`,kpn=({phaseTimings:n})=>{if(!n)return null;const e=Object.values(n).reduce((t,r)=>t+r,0);return Ye.jsxs("div",{className:"rf-space-y-2 rf-w-full rf-px-4",children:[Ye.jsx("div",{className:"rf-relative rf-h-8 rf-flex rf-rounded-sm",children:s3.map(t=>{const r=n[t]||0,i=r/e*100;return Ye.jsx("div",{className:"rf-group/bar rf-relative rf-overflow-visible",style:{width:`${i}%`,backgroundColor:eZe(t)},children:Ye.jsxs("div",{className:"rf-opacity-0 group-hover/bar:rf-opacity-100 rf-transition-opacity rf-absolute rf-bottom-full rf-left-1/2 rf-transform -rf-translate-x-1/2 rf-mb-2 rf-px-2 rf-py-1 rf-text-xs rf-whitespace-nowrap rf-rounded rf-bg-gray-900 rf-text-white rf-pointer-events-none",children:[t,": ",r.toFixed(1),"ms"]})},t)})}),Ye.jsxs("div",{className:"rf-text-xs rf-text-gray-500",children:["Total: ",e.toFixed(2),"ms"]})]})},Ipn=({renderLog:n})=>{const[e,t]=it.useState("chronological");if(!n)return Ye.jsx("div",{className:"rf-p-4 rf-bg-gray-100 rf-rounded-md",children:"No render log, make sure this tab is open when you render (TODO add a rerender button here)"});const r=Object.entries((n==null?void 0:n.phaseTimings)??{});e==="chronological"?r.sort((a,o)=>s3.indexOf(a[0])-s3.indexOf(o[0])):r.sort((a,o)=>o[1]-a[1]);const i=r.reduce((a,[o,s])=>a+s,0);return Ye.jsxs("div",{className:"rf-bg-white",children:[Ye.jsxs("div",{className:"rf-flex rf-justify-between rf-items-center",children:[Ye.jsx("div",{children:"Render Logs"}),Ye.jsxs("div",{className:"rf-mb-4 rf-pr-2 rf-flex rf-text-xs rf-items-center",children:[Ye.jsx("div",{className:"rf-mr-2",children:"Sort by:"}),Ye.jsxs("select",{value:e,onChange:a=>t(a.target.value),className:"rf-px-2 rf-py-1 rf-border rf-rounded rf-text-xs",children:[Ye.jsx("option",{value:"chronological",children:"Phase Order"}),Ye.jsx("option",{value:"longest",children:"Duration"})]})]})]}),Ye.jsx(kpn,{phaseTimings:n.phaseTimings}),Ye.jsxs("table",{className:"rf-w-full rf-text-xs",children:[Ye.jsx("thead",{children:Ye.jsxs("tr",{children:[Ye.jsx("th",{className:"rf-text-left rf-p-2",children:"Phase Order"}),Ye.jsx("th",{className:"rf-text-left rf-p-2",children:"Phase"}),Ye.jsx("th",{className:"rf-text-left rf-p-2",children:"Duration (ms)"})]})}),Ye.jsx("tbody",{children:r.map(([a,o])=>Ye.jsxs("tr",{children:[Ye.jsx("td",{className:"rf-p-2",children:s3.indexOf(a)}),Ye.jsx("td",{className:"rf-p-2",children:a}),Ye.jsx("td",{className:"rf-p-2",children:Ye.jsx("div",{className:"rf-w-8",children:Ye.jsx("div",{className:"rf-h-2 rf-rounded-sm",style:{backgroundColor:eZe(a),width:`${o/i*100}%`}})})}),Ye.jsx("td",{className:"rf-p-2",children:Ye.jsxs("div",{className:"rf-flex w-full",children:[Ye.jsxs("span",{className:"rf-flex-grow",children:[o,"ms"]}),Ye.jsxs("span",{className:"rf-text-gray-500 rf-pr-2",children:[(o/i*100).toFixed(1),"%"]})]})})]},a))})]})]})},Fpn="0.0.381",Bpn=["assembly","bom","circuit_json","errors","render_log"],jpn=({code:n,onRunClicked:e=void 0,errorMessage:t,circuitJson:r,autoroutingGraphics:i,showRightHeaderContent:a=!0,showCodeTab:o=!1,codeTabContent:s,showJsonTab:l=!0,showRenderLogTab:c=!0,onActiveTabChange:u,renderLog:f,showImportAndFormatButtons:d=!0,className:v,headerClassName:y,leftHeaderContent:w,readOnly:b,isStreaming:S,autoroutingLog:R,onReportAutoroutingLog:D,isRunningCode:k,hasCodeChangedSinceLastRun:G,onEditEvent:q,editEvents:Z,defaultActiveTab:Y,autoRotate3dViewerDisabled:ee,showSchematicDebugGrid:X=!1,showToggleFullScreen:ue=!0,defaultToFullScreen:pe=!1})=>{var Oe;Upn();const[de,we]=it.useState(Y??"pcb"),[he,ge]=it.useState(pe),Te=it.useCallback(Ne=>{we(Ne),u==null||u(Ne)},[u]),be=()=>{ge(!he)};return it.useEffect(()=>{t&&Te("errors")},[t]),it.useEffect(()=>{(de==="code"||de==="errors")&&r&&!t&&Te(Y??"pcb")},[r]),Ye.jsx("div",{className:ih("flex flex-col relative rf-overflow-x-hidden",v),children:Ye.jsx("div",{className:ih("rf-md:sticky rf-md:top-2",he&&"rf-fixed rf-top-0 rf-left-0 rf-w-full rf-bg-white"),children:Ye.jsxs(Nxe,{value:de,onValueChange:Te,className:"rf-flex-grow rf-flex rf-flex-col",children:[Ye.jsxs("div",{className:ih("rf-flex rf-items-center rf-gap-2 rf-p-2 rf-pb-0",y),children:[w,w&&Ye.jsx("div",{className:"rf-flex-grow"}),!w&&k&&Ye.jsx(WT,{className:"rf-w-4 rf-h-4 rf-animate-spin"}),!w&&Ye.jsx("div",{className:"rf-flex-grow"}),f&&f.progress!==1&&Ye.jsxs("div",{className:"rf-flex rf-items-center rf-gap-2",children:[f.lastRenderEvent&&Ye.jsx("div",{className:"rf-text-xs rf-text-gray-500",children:(Oe=f.lastRenderEvent)==null?void 0:Oe.type.split("renderable:renderLifecycle:")[1].split(":")[0]}),Ye.jsx("div",{className:"rf-w-4 rf-h-4 rf-bg-blue-500 rf-opacity-50 rf-rounded-full rf-text-white",children:Ye.jsx(WT,{className:"rf-w-4 rf-h-4 rf-animate-spin"})}),Ye.jsxs("div",{className:"rf-text-xs rf-font-bold rf-text-gray-700 rf-tabular-nums",children:[((f.progress??0)*100).toFixed(1),"%"]})]}),a&&Ye.jsxs(kq,{children:[o&&Ye.jsx(W8,{value:"code",children:"Code"}),Ye.jsxs(W8,{value:"pcb",className:"rf-whitespace-nowrap",children:[r&&Ye.jsx("span",{className:ih("rf-inline-flex rf-items-center rf-justify-center rf-w-2 rf-h-2 rf-mr-1 rf-text-xs rf-font-bold rf-text-white rf-rounded-full",G?"rf-bg-gray-500":"rf-bg-blue-500")}),"PCB"]}),Ye.jsxs(W8,{value:"schematic",className:"rf-whitespace-nowrap",children:[r&&Ye.jsx("span",{className:ih("rf-inline-flex rf-items-center rf-justify-center rf-w-2 rf-h-2 rf-mr-1 rf-text-xs rf-font-bold rf-text-white rf-rounded-full",G?"rf-bg-gray-500":"rf-bg-blue-500")}),"Schematic"]}),Ye.jsxs(W8,{value:"cad",children:[r&&Ye.jsx("span",{className:ih("inline-flex items-center justify-center w-2 h-2 mr-1 text-xs font-bold text-white rounded-full",G?"rf-bg-gray-500":"rf-bg-blue-500")}),"3D"]}),!["pcb","cad","schematic"].includes(de)&&Ye.jsx(W8,{value:de,children:Pxe(de)}),Ye.jsxs(pfe,{children:[Ye.jsx(hfe,{asChild:!0,children:Ye.jsxs("div",{className:"rf-whitespace-nowrap rf-p-2 rf-mr-1 rf-cursor-pointer rf-relative",children:[Ye.jsx(lin,{className:"rf-w-4 rf-h-4"}),t&&Ye.jsx("span",{className:"rf-inline-flex rf-absolute rf-top-[6px] rf-right-[4px] rf-items-center rf-justify-center rf-w-1 rf-h-1 rf-ml-2 rf-text-[8px] rf-font-bold rf-text-white rf-bg-red-500 rf-rounded-full"})]})}),Ye.jsxs(gB,{className:"rf-*:text-xs",children:[Bpn.map(Ne=>Ye.jsxs(w4,{onSelect:()=>Te(Ne),children:[de!==Ne&&Ye.jsx(y$e,{className:"rf-w-3 rf-h-3 rf-opacity-30"}),de===Ne&&Ye.jsx(bue,{className:"rf-w-3 rf-h-3"}),Ye.jsx("div",{className:"rf-pr-2",children:Pxe(Ne)}),Ne==="errors"&&t&&Ye.jsx("span",{className:"rf-inline-flex rf-items-center rf-justify-center rf-w-3 rf-h-3 rf-ml-2 rf-text-[8px] rf-font-bold rf-text-white rf-bg-red-500 rf-rounded-full",children:"1"})]},Ne)),Ye.jsx(w4,{disabled:!0,className:"rf-opacity-60 rf-cursor-default rf-select-none",children:Ye.jsxs("div",{className:"rf-pr-2 rf-text-xs rf-text-gray-500",children:["@tscircuit/runframe@",Fpn.split(".").map((Ne,Ie)=>Ie===2?parseInt(Ne)+1:Ne).join(".")]})})]})]})]}),ue&&Ye.jsx(rb,{onClick:be,variant:"ghost",children:he?Ye.jsx(din,{size:16}):Ye.jsx(uin,{size:16})})]}),o&&Ye.jsx(q4,{value:"code",className:"rf-flex-grow rf-overflow-hidden",children:Ye.jsx("div",{className:"rf-h-full",children:s})}),Ye.jsx(q4,{value:"pcb",children:Ye.jsx("div",{className:ih("rf-overflow-hidden",he?"rf-h-[calc(100vh-52px)]":"rf-h-[620px]"),children:Ye.jsx(XT,{fallbackRender:({error:Ne})=>Ye.jsx("div",{className:"rf-mt-4 rf-bg-red-50 rf-rounded-md rf-border rf-border-red-200",children:Ye.jsxs("div",{className:"rf-p-4",children:[Ye.jsx("h3",{className:"rf-text-lg rf-font-semibold rf-text-red-800 rf-mb-3",children:"Error loading PCB viewer"}),Ye.jsx("p",{className:"rf-text-xs rf-font-mono rf-whitespace-pre-wrap rf-text-red-600 rf-mt-2",children:(Ne==null?void 0:Ne.message)||"An unknown error occurred"})]})}),children:r?Ye.jsx(Opn,{focusOnHover:!1,circuitJson:r,debugGraphics:i,containerClassName:ih("rf-h-full rf-w-full",he?"rf-min-h-[calc(100vh-240px)]":"rf-min-h-[620px]"),onEditEventsChanged:Ne=>{q&&Ne.forEach(Ie=>q(Ie))}}):Ye.jsx(xw,{onRunClicked:e})})})}),Ye.jsx(q4,{value:"assembly",children:Ye.jsx("div",{className:ih("rf-overflow-auto",he?"rf-h-[calc(100vh-96px)]":"rf-h-[620px]"),children:Ye.jsx(XT,{fallback:Ye.jsx("div",{children:"Error loading Assembly"}),children:r?Ye.jsx(Rpn,{circuitJson:r,containerStyle:{height:"100%"},editingEnabled:!0,debugGrid:!0}):Ye.jsx(xw,{onRunClicked:e})})})}),Ye.jsx(q4,{value:"schematic",children:Ye.jsx("div",{className:ih("rf-overflow-auto",he?"rf-h-[calc(100vh-96px)]":"rf-h-[620px]"),children:Ye.jsx(XT,{fallbackRender:({error:Ne})=>Ye.jsx("div",{className:"rf-mt-4 rf-bg-red-50 rf-rounded-md rf-border rf-border-red-200",children:Ye.jsxs("div",{className:"rf-p-4",children:[Ye.jsx("h3",{className:"rf-text-lg rf-font-semibold rf-text-red-800 rf-mb-3",children:"Error loading Schematic"}),Ye.jsx("p",{className:"rf-text-xs rf-font-mono rf-whitespace-pre-wrap rf-text-red-600 rf-mt-2",children:(Ne==null?void 0:Ne.message)||"An unknown error occurred"})]})}),children:r?Ye.jsx(Tpn,{circuitJson:r,containerStyle:{height:"100%"},editingEnabled:!0,onEditEvent:Ne=>{q==null||q(Ne)},debugGrid:X}):Ye.jsx(xw,{onRunClicked:e})})})}),Ye.jsx(q4,{value:"cad",children:Ye.jsx("div",{className:ih("rf-overflow-auto",he?"rf-h-[calc(100vh-96px)]":"rf-h-[620px]"),children:Ye.jsx(XT,{FallbackComponent:Xrn,children:r?Ye.jsx(kJt,{soup:r,autoRotateDisabled:ee}):Ye.jsx(xw,{onRunClicked:e})})})}),Ye.jsx(q4,{value:"bom",children:Ye.jsx("div",{className:ih("rf-overflow-auto",he?"rf-h-[calc(100vh-96px)]":"rf-h-[620px]"),children:Ye.jsx(XT,{fallbackRender:({error:Ne})=>Ye.jsx("div",{className:"rf-mt-4 rf-bg-red-50 rf-rounded-md rf-border rf-border-red-200",children:Ye.jsxs("div",{className:"rf-p-4",children:[Ye.jsx("h3",{className:"rf-text-lg rf-font-semibold rf-text-red-800 rf-mb-3",children:"Error loading Bill of Materials"}),Ye.jsx("p",{className:"rf-text-xs rf-font-mono rf-whitespace-pre-wrap rf-text-red-600 rf-mt-2",children:(Ne==null?void 0:Ne.message)||"An unknown error occurred"})]})}),children:r?Ye.jsx(Lpn,{circuitJson:r}):Ye.jsx(xw,{onRunClicked:e})})})}),Ye.jsx(q4,{value:"circuit_json",children:Ye.jsx("div",{className:ih("rf-overflow-auto",he?"rf-h-[calc(100vh-96px)]":"rf-h-[620px]"),children:Ye.jsx(XT,{fallback:Ye.jsx("div",{children:"Error loading JSON viewer"}),children:r?Ye.jsx(Npn,{elements:r}):Ye.jsx(xw,{onRunClicked:e})})})}),Ye.jsx(q4,{value:"errors",children:Ye.jsx("div",{className:ih("rf-overflow-auto",he?"rf-h-[calc(100vh-96px)]":"rf-h-[620px]"),children:r||t?Ye.jsx(oln,{code:n,errorMessage:t,autoroutingLog:R,onReportAutoroutingLog:D}):Ye.jsx(xw,{onRunClicked:e})})}),c&&Ye.jsx(q4,{value:"render_log",children:Ye.jsx(Ipn,{renderLog:f})})]})})})};var Tj="Dialog",[tZe,nZe]=BS(Tj),[Hpn,E4]=tZe(Tj),rZe=n=>{const{__scopeDialog:e,children:t,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=n,s=it.useRef(null),l=it.useRef(null),[c,u]=cE({prop:r,defaultProp:i??!1,onChange:a,caller:Tj});return Ye.jsx(Hpn,{scope:e,triggerRef:s,contentRef:l,contentId:jS(),titleId:jS(),descriptionId:jS(),open:c,onOpenChange:u,onOpenToggle:it.useCallback(()=>u(f=>!f),[u]),modal:o,children:t})};rZe.displayName=Tj;var iZe="DialogTrigger",aZe=it.forwardRef((n,e)=>{const{__scopeDialog:t,...r}=n,i=E4(iZe,t),a=nx(e,i.triggerRef);return Ye.jsx(w9.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Fde(i.open),...r,ref:a,onClick:Pp(n.onClick,i.onOpenToggle)})});aZe.displayName=iZe;var kde="DialogPortal",[Vpn,oZe]=tZe(kde,{forceMount:void 0}),sZe=n=>{const{__scopeDialog:e,forceMount:t,children:r,container:i}=n,a=E4(kde,e);return Ye.jsx(Vpn,{scope:e,forceMount:t,children:it.Children.map(r,o=>Ye.jsx($4,{present:t||a.open,children:Ye.jsx(Que,{asChild:!0,container:i,children:o})}))})};sZe.displayName=kde;var Mj="DialogOverlay",lZe=it.forwardRef((n,e)=>{const t=oZe(Mj,n.__scopeDialog),{forceMount:r=t.forceMount,...i}=n,a=E4(Mj,n.__scopeDialog);return a.modal?Ye.jsx($4,{present:r||a.open,children:Ye.jsx(Gpn,{...i,ref:e})}):null});lZe.displayName=Mj;var $pn=lE("DialogOverlay.RemoveScroll"),Gpn=it.forwardRef((n,e)=>{const{__scopeDialog:t,...r}=n,i=E4(Mj,t);return Ye.jsx(rfe,{as:$pn,allowPinchZoom:!0,shards:[i.contentRef],children:Ye.jsx(w9.div,{"data-state":Fde(i.open),...r,ref:e,style:{pointerEvents:"auto",...r.style}})})}),bw="DialogContent",cZe=it.forwardRef((n,e)=>{const t=oZe(bw,n.__scopeDialog),{forceMount:r=t.forceMount,...i}=n,a=E4(bw,n.__scopeDialog);return Ye.jsx($4,{present:r||a.open,children:a.modal?Ye.jsx(qpn,{...i,ref:e}):Ye.jsx(Ypn,{...i,ref:e})})});cZe.displayName=bw;var qpn=it.forwardRef((n,e)=>{const t=E4(bw,n.__scopeDialog),r=it.useRef(null),i=nx(e,t.contentRef,r);return it.useEffect(()=>{const a=r.current;if(a)return SGe(a)},[]),Ye.jsx(uZe,{...n,ref:i,trapFocus:t.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Pp(n.onCloseAutoFocus,a=>{var o;a.preventDefault(),(o=t.triggerRef.current)==null||o.focus()}),onPointerDownOutside:Pp(n.onPointerDownOutside,a=>{const o=a.detail.originalEvent,s=o.button===0&&o.ctrlKey===!0;(o.button===2||s)&&a.preventDefault()}),onFocusOutside:Pp(n.onFocusOutside,a=>a.preventDefault())})}),Ypn=it.forwardRef((n,e)=>{const t=E4(bw,n.__scopeDialog),r=it.useRef(!1),i=it.useRef(!1);return Ye.jsx(uZe,{...n,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var o,s;(o=n.onCloseAutoFocus)==null||o.call(n,a),a.defaultPrevented||(r.current||(s=t.triggerRef.current)==null||s.focus(),a.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:a=>{var l,c;(l=n.onInteractOutside)==null||l.call(n,a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const o=a.target;((c=t.triggerRef.current)==null?void 0:c.contains(o))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&i.current&&a.preventDefault()}})}),uZe=it.forwardRef((n,e)=>{const{__scopeDialog:t,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=n,s=E4(bw,t),l=it.useRef(null),c=nx(e,l);return k$e(),Ye.jsxs(Ye.Fragment,{children:[Ye.jsx(Uue,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:Ye.jsx(Due,{role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":Fde(s.open),...o,ref:c,onDismiss:()=>s.onOpenChange(!1)})}),Ye.jsxs(Ye.Fragment,{children:[Ye.jsx(Wpn,{titleId:s.titleId}),Ye.jsx(Qpn,{contentRef:l,descriptionId:s.descriptionId})]})]})}),Ide="DialogTitle",fZe=it.forwardRef((n,e)=>{const{__scopeDialog:t,...r}=n,i=E4(Ide,t);return Ye.jsx(w9.h2,{id:i.titleId,...r,ref:e})});fZe.displayName=Ide;var dZe="DialogDescription",pZe=it.forwardRef((n,e)=>{const{__scopeDialog:t,...r}=n,i=E4(dZe,t);return Ye.jsx(w9.p,{id:i.descriptionId,...r,ref:e})});pZe.displayName=dZe;var hZe="DialogClose",mZe=it.forwardRef((n,e)=>{const{__scopeDialog:t,...r}=n,i=E4(hZe,t);return Ye.jsx(w9.button,{type:"button",...r,ref:e,onClick:Pp(n.onClick,()=>i.onOpenChange(!1))})});mZe.displayName=hZe;function Fde(n){return n?"open":"closed"}var vZe="DialogTitleWarning",[Xpn,yZe]=d9t(vZe,{contentName:bw,titleName:Ide,docsSlug:"dialog"}),Wpn=({titleId:n})=>{const e=yZe(vZe),t=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users.
13425
+ `,i.appendChild(D)}})}};a();const o=new MutationObserver(a);return o.observe(i,{childList:!0,subtree:!1,characterData:!1}),()=>{o.disconnect()}},[n,t,e,r])},gpn=Ay("schematic-viewer"),_pn=()=>{Ay.enable("schematic-viewer*")},xpn=gpn,bpn=n=>{const[e,t]=it.useState(0),[r,i]=it.useState(0);return it.useEffect(()=>{if(!n.current)return;const a=()=>{var l;const s=(l=n.current)==null?void 0:l.getBoundingClientRect();t((s==null?void 0:s.width)||0),i((s==null?void 0:s.height)||0)};a();const o=new ResizeObserver(a);return o.observe(n.current),window.addEventListener("resize",a),()=>{o.disconnect(),window.removeEventListener("resize",a)}},[]),{containerWidth:e,containerHeight:r}},Spn=xpn.extend("useComponentDragging"),wpn=({onEditEvent:n,editEvents:e=[],circuitJson:t,cancelDrag:r,svgToScreenProjection:i,realToSvgProjection:a,enabled:o=!1})=>{const[s,l]=it.useState(null),c=Wu(a,i),u=it.useRef(null),f=it.useRef(null),d=it.useRef(new Map);it.useEffect(()=>{e.forEach(b=>{"edit_event_type"in b&&b.edit_event_type==="edit_schematic_component_location"&&!b.in_progress&&d.current.set(b.schematic_component_id,{...b.new_center})})},[e]);const v=it.useCallback(b=>{if(!o)return;const R=b.target.closest('[data-circuit-json-type="schematic_component"]');if(!R)return;const D=R.getAttribute("data-schematic-component-id");if(!D)return;r&&r();const k=n1(t).schematic_component.get(D);if(!k)return;u.current={x:b.clientX,y:b.clientY};let G;const q=d.current.get(D);if(q)G={...q};else{const Y=KWe({editEvents:e,schematic_component_id:D});G={x:k.center.x+Y.x,y:k.center.y+Y.y},d.current.set(D,{...G})}const Z={edit_event_id:Math.random().toString(36).substr(2,9),edit_event_type:"edit_schematic_component_location",schematic_component_id:D,original_center:G,new_center:{...G},in_progress:!0,created_at:Date.now(),_element:R};f.current=Z,l(Z)},[r,o,t,e]),y=it.useCallback(b=>{if(!f.current||!u.current)return;const S={x:b.clientX-u.current.x,y:b.clientY-u.current.y},R={x:S.x/c.a,y:S.y/c.d},D={...f.current,new_center:{x:f.current.original_center.x+R.x,y:f.current.original_center.y+R.y}};f.current=D,l(D)},[c]),w=it.useCallback(()=>{if(!f.current)return;const b={...f.current,in_progress:!1};d.current.set(b.schematic_component_id,{...b.new_center}),Spn("handleMouseUp calling onEditEvent with new edit event",{newEditEvent:b}),n&&n(b),f.current=null,u.current=null,l(null)},[n]);return it.useEffect(()=>(window.addEventListener("mousemove",y),window.addEventListener("mouseup",w),()=>{window.removeEventListener("mousemove",y),window.removeEventListener("mouseup",w)}),[y,w]),{handleMouseDown:v,isDragging:!!f.current,activeEditEvent:s}},Epn=({onClick:n,active:e})=>Ye.jsx("div",{onClick:n,style:{position:"absolute",top:"16px",right:"16px",backgroundColor:e?"#4CAF50":"#fff",color:e?"#fff":"#000",padding:"8px",borderRadius:"4px",cursor:"pointer",boxShadow:"0 2px 4px rgba(0,0,0,0.1)",display:"flex",alignItems:"center",gap:"4px",zIndex:1e3},children:Ye.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[Ye.jsx("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),Ye.jsx("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"})]})}),Tpn=({circuitJson:n,containerStyle:e,editEvents:t=[],onEditEvent:r,defaultEditMode:i=!1,debugGrid:a=!1,editingEnabled:o=!1,debug:s=!1,clickToInteractEnabled:l=!1,colorOverrides:c})=>{s&&_pn();const[u,f]=it.useState(i),[d,v]=it.useState(!l),y=it.useRef(null),[w,b]=it.useState([]),S=it.useRef(n),R=ge=>`${(ge==null?void 0:ge.length)||0}_${(ge==null?void 0:ge.editCount)||0}`;it.useEffect(()=>{const ge=R(n),Te=R(S.current);ge!==Te&&(b([]),S.current=n)},[n]);const{ref:D,cancelDrag:k,transform:G}=QWe({onSetTransform(ge){y.current&&(y.current.style.transform=Y6(ge))},enabled:d}),{containerWidth:q,containerHeight:Z}=bpn(D),Y=it.useMemo(()=>!q||!Z?"":Lde(n,{width:q,height:Z||720,grid:a?{cellSize:1,labelCells:!0}:void 0,colorOverrides:c}),[n,q,Z]),ee=it.useMemo(()=>{var Te;if(!Y)return r9();const ge=(Te=Y.match(/data-real-to-screen-transform="([^"]+)"/))==null?void 0:Te[1];try{return CV(ge)}catch(be){return console.error(be),r9()}},[Y]),X=ge=>{b(Te=>[...Te,ge]),r&&r(ge)},ue=it.useMemo(()=>[...t,...w],[t,w]),{handleMouseDown:pe,isDragging:de,activeEditEvent:we}=wpn({onEditEvent:X,cancelDrag:k,realToSvgProjection:ee,svgToScreenProjection:G,circuitJson:n,editEvents:ue,enabled:u&&d});vpn({svgDivRef:y,editEvents:ue,realToSvgProjection:ee,svgToScreenProjection:G,activeEditEvent:we}),ypn({svgDivRef:y,circuitJson:n,activeEditEvent:we,editEvents:ue});const he=it.useMemo(()=>Ye.jsx("div",{ref:y,style:{pointerEvents:l?d?"auto":"none":"auto",transformOrigin:"0 0"},dangerouslySetInnerHTML:{__html:Y}}),[Y,d,l]);return Ye.jsxs("div",{ref:D,style:{position:"relative",backgroundColor:"#F5F1ED",overflow:"hidden",cursor:de?"grabbing":l&&!d?"pointer":"grab",minHeight:"300px",...e},onMouseDown:ge=>{if(l&&!d){ge.preventDefault(),ge.stopPropagation();return}pe(ge)},onMouseDownCapture:ge=>{if(l&&!d){ge.preventDefault(),ge.stopPropagation();return}},children:[!d&&l&&Ye.jsx("div",{onClick:ge=>{ge.preventDefault(),ge.stopPropagation(),v(!0)},style:{position:"absolute",inset:0,cursor:"pointer",zIndex:10,display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"all"},children:Ye.jsx("div",{style:{backgroundColor:"rgba(0, 0, 0, 0.8)",color:"white",padding:"12px 24px",borderRadius:"8px",fontSize:"16px",fontFamily:"sans-serif",pointerEvents:"none"},children:"Click to Interact"})}),o&&Ye.jsx(Epn,{active:u,onClick:()=>f(!u)}),he]})},Mpn=n=>{const[e,t]=it.useState(0),[r,i]=it.useState(0);return it.useEffect(()=>{if(!n.current)return;const a=()=>{var l;const s=(l=n.current)==null?void 0:l.getBoundingClientRect();t((s==null?void 0:s.width)||0),i((s==null?void 0:s.height)||0)};a();const o=new ResizeObserver(a);return o.observe(n.current),window.addEventListener("resize",a),()=>{o.disconnect(),window.removeEventListener("resize",a)}},[]),{containerWidth:e,containerHeight:r}};Ay("assembly-viewer");var Cpn=()=>{Ay.enable("assembly-viewer*")},Rpn=({circuitJson:n,containerStyle:e,debugGrid:t=!1,debug:r=!1})=>{r&&Cpn();const i=it.useRef(null),{ref:a}=QWe({onSetTransform(u){i.current&&(i.current.style.transform=Y6(u))}}),{containerWidth:o,containerHeight:s}=Mpn(a),l=it.useMemo(()=>!o||!s?"":$We(n,{width:o,height:s||720}),[n,o,s]);it.useMemo(()=>{var f;if(!l)return r9();const u=(f=l.match(/data-real-to-screen-transform="([^"]+)"/))==null?void 0:f[1];try{return CV(u)}catch(d){return console.error(d),r9()}},[l]);const c=it.useMemo(()=>Ye.jsx("div",{ref:i,style:{pointerEvents:"auto",transformOrigin:"0 0"},dangerouslySetInnerHTML:{__html:l}}),[l]);return Ye.jsx("div",{ref:a,style:{position:"relative",backgroundColor:"#F5F1ED",overflow:"hidden",minHeight:"300px",...e},children:c})};const JWe=["Always initialize your project using [tsci init](https://github.com/tscircuit/cli) before adding components.","Define reusable modules with cached routes using [<subcircuit />](https://docs.tscircuit.com/elements/subcircuit)","Run `tsci dev` on the command line to preview your boards before export","Use units like mm or mils consistently across your designs.","Quickly set footprints with the [footprint prop](https://docs.tscircuit.com/footprints/footprinter-strings)","Check out the guide on [ordering prototypes](https://docs.tscircuit.com/building-electronics/ordering-prototypes)","Use [net labels](https://docs.tscircuit.com/elements/net) and [group elements](https://docs.tscircuit.com/elements/group) to organize complex schematics.","You can manually drag components on the PCB and Schematic using [manual edits](https://docs.tscircuit.com/guides/manual-edits)","Every tscircuit module can export to [Circuit JSON](https://github.com/tscircuit/circuit-json), Gerbers, Pick'n'Place CSV files, Bill of Materials CSV and more","You can import components from [JLCPCB](https://docs.tscircuit.com/guides/importing-modules-and-chips/importing-from-jlcpcb) or [KiCad](https://docs.tscircuit.com/guides/importing-modules-and-chips/importing-from-kicad)","Any module you push to the [registry](https://tscircuit.com/trending) will have [simple image urls](https://docs.tscircuit.com/web-apis/image-generation-api) you can use display images on a website","The default [Parts Engine](https://docs.tscircuit.com/guides/platform-configuration) will automatically find parts from common vendors for your BOM",'[Pin selectors](https://docs.tscircuit.com/guides/using-sel-references) are similar to CSS selectors, ".R1 > .pin1" means "connect to the first pin of the component R1"',"You can use the [sel](https://docs.tscircuit.com/guides/using-sel-references) object to select pins in a type-safe way","Publish modules via the [registry](https://tscircuit.com/trending) for working with a team or sharing your work","[Explore tutorials](https://docs.tscircuit.com/category/tutorials) for real-world circuit design examples.","Upload your Circuit JSON to [circuitjson.com](https://circuitjson.com) for a quick preview.","You can display Circuit JSON in 3D, PCB or Schematic mode with the [<CircuitJsonPreview />](https://docs.tscircuit.com/elements/circuitjsonpreview) React component","Use a [<group />](https://docs.tscircuit.com/elements/group) element to move multiple components at once in a schematic or PCB layout.","Refer to the [GitHub Discussions page](https://github.com/tscircuit/tscircuit/discussions) to request features","You can customize the autorouter using the [autorouter prop](https://docs.tscircuit.com/elements/board#setting-the-autorouter)","Use the [<constraint />](https://docs.tscircuit.com/footprints/constraint) element to enforce geometric relationships in PCB designs.","Join the [Discord server](https://tscircuit.com/join) to discuss issues and get help directly from the community."],Apn=(()=>{let n=JWe[Math.floor(Math.random()*JWe.length)];return n=n.replace(/</g,"&lt;"),n=n.replace(/>/g,"&gt;"),n=n.replace(new RegExp('(?<!href=")(?<!\\()(?<!\\]\\()(https?:\\/\\/[^\\s\\)\\]]+)',"g"),(e,t)=>`<a class="rf-text-blue-500 rf-underline" href="${e}" target="_blank">${e}</a>`),n=n.replace(/\[([^\]]+)\]\((https?:\/\/[^\)]+)\)/g,'<a class="rf-text-blue-500 rf-underline" href="$2" target="_blank">$1</a>'),n})(),xw=({onRunClicked:n})=>Ye.jsxs("div",{className:"rf-flex rf-flex-col rf-items-center rf-justify-center rf-h-full rf-bg-gray-50 rf-text-gray-500 rf-p-4",children:[Ye.jsx(fin,{className:"rf-size-14 rf-mb-4"}),Ye.jsxs("p",{className:"rf-text-md rf-break-words rf-max-w-xl rf-text-center",children:["Tip: ",Ye.jsx("span",{dangerouslySetInnerHTML:{__html:Apn}})]}),n&&Ye.jsxs(rb,{className:"rf-mt-4 rf-bg-blue-600 rf-hover:bg-blue-500",onClick:n,children:["Run Code",Ye.jsx(g$e,{className:"rf-w-3 rf-h-3 rf-ml-2"})]})]}),wj=({text:n,onClick:e})=>Ye.jsx("span",{className:"rf-cursor-pointer rf-underline rf-text-blue-600 rf-mx-2",onClick:e,children:n}),Ej=n=>{var e;return Ye.jsxs("div",{className:"rf-leading-5",children:[Ye.jsx("div",{className:"rf-py-2 rf-font-bold",children:n.column.name}),Ye.jsx("div",{children:((e=n.field)==null?void 0:e.call(n))??Ye.jsx("input",{type:"text",className:"rf-border rf-rounded rf-p-1 rf-w-full",onChange:t=>{var r;(r=n.onTextChange)==null||r.call(n,t.target.value)}})})]})},Ppn=({open:n,children:e,title:t,onClose:r})=>n?Ye.jsx("div",{className:"rf-fixed rf-inset-0 rf-bg-black rf-bg-opacity-50 rf-flex rf-justify-center rf-items-center rf-z-50",onClick:r,children:Ye.jsxs("div",{className:"rf-bg-white rf-p-5 rf-rounded-lg rf-relative rf-w-11/12 rf-max-w-2xl",onClick:i=>{i.preventDefault(),i.stopPropagation()},children:[Ye.jsx("h2",{className:"rf-mt-0 rf-text-md rf-pb-4",children:t}),Ye.jsx("button",{type:"button",className:"rf-absolute rf-top-2 rf-right-4 rf-text-2xl rf-font-bold",onClick:r,children:"×"}),e]})}):null,Npn=({elements:n})=>{const[e,t]=it.useState({open:!1}),[r,i]=it.useReducer((u,f)=>({...u,...f}),{}),a=[...new Set(n.map(u=>u.type))],o=n.map(u=>{const f=u[`${u.type}_id`],d=Object.fromEntries(Object.entries(u).filter(([y])=>!(y===`${u.type}_id`||!y.endsWith("_id")))),v=Object.fromEntries(Object.entries(u).filter(([y])=>!y.endsWith("_id")));return{primary_id:f,other_ids:d,...v,_og_elm:u}}),s=o.map(u=>{let f="";const d=v=>{const y=Object.keys(v.other_ids).find(S=>S.startsWith("source_"));if(!y)return`.${v.name}`;const w=y.slice(0,-3),b=o.find(S=>S.type===w&&S.primary_id===v.other_ids[y]);return b?"name"in b?`${d(b)} > .${v.name}`:`#${b.primary_id} > .${v.name}`:`??? > .${v.name}`};return"name"in u&&(f=d(u)),{...u,selector_path:f}}),l=[{key:"primary_id",name:"primary_id",renderCell:u=>Ye.jsxs("div",{className:"rf-flex rf-items-center",children:[Ye.jsx(wj,{text:u.primary_id,onClick:()=>i({focused_id:u.primary_id,id_search:void 0,selector_search:void 0})}),Ye.jsx("span",{className:"rf-flex-grow"}),Ye.jsx(wj,{text:"(JSON)",onClick:()=>t({open:!0,element:u._og_elm,title:u.primary_id})})]}),renderHeaderCell:u=>Ye.jsx(Ej,{column:u,onTextChange:f=>i({id_search:f}),field:r.focused_id?()=>Ye.jsxs("div",{children:["Focus:"," ",Ye.jsx("span",{className:"rf-underline",children:r.focused_id}),Ye.jsx(wj,{text:"(unfocus)",onClick:()=>i({focused_id:void 0})})]}):void 0})},{key:"type",name:"type",renderHeaderCell:u=>Ye.jsx(Ej,{column:u,field:()=>Ye.jsxs("select",{onChange:f=>i({component_type_filter:f.target.value}),className:"rf-border rf-rounded rf-p-1 rf-w-full",children:[Ye.jsx("option",{value:"any",children:"any"},"any"),Ye.jsx("option",{value:"source",children:"source"},"source"),Ye.jsx("option",{value:"source/pcb",children:"source/pcb"},"source/pcb"),Ye.jsx("option",{value:"source/schematic",children:"source/schematic"},"source/schematic"),a.map(f=>Ye.jsx("option",{value:f,children:f},f))]})})},{key:"name",name:"name",renderHeaderCell:u=>Ye.jsx(Ej,{column:u,onTextChange:f=>i({name_search:f})})},{key:"selector_path",name:"selector_path",renderHeaderCell:u=>Ye.jsx(Ej,{column:u,onTextChange:f=>i({selector_search:f})})},{key:"other_ids",name:"other_ids",renderCell:u=>Ye.jsx("div",{className:"rf-space-x-2",children:Object.entries(u.other_ids).map(([f,d])=>Ye.jsx(wj,{text:d,onClick:()=>i({focused_id:d})},d))})}],c=s.filter(u=>{var f,d;return r.name_search?(d=(f=u.name)==null?void 0:f.toLowerCase())==null?void 0:d.includes(r.name_search.toLowerCase()):!0}).filter(u=>{var f;return!r.component_type_filter||r.component_type_filter==="any"?!0:r.component_type_filter==="source"?u.type.startsWith("source_"):r.component_type_filter==="source/pcb"?u.type.startsWith("source_")||u.type.startsWith("pcb_"):r.component_type_filter==="source/schematic"?u.type.startsWith("source_")||u.type.startsWith("schematic_"):(f=u.type)==null?void 0:f.includes(r.component_type_filter)}).filter(u=>r.selector_search?r.selector_search.split(" ").filter(d=>d.length>0).every(d=>{var v;return(v=u.selector_path)==null?void 0:v.includes(d)}):!0).filter(u=>{var f;return r.id_search?(f=u.primary_id)==null?void 0:f.includes(r.id_search):!0}).filter(u=>!!(!r.focused_id||u.primary_id===r.focused_id||Object.values(u.other_ids).includes(r.focused_id)));return Ye.jsxs("div",{className:"rf-font-mono rf-text-xs rf-bg-white",children:[Ye.jsx("div",{className:"rf-overflow-x-auto",children:Ye.jsxs("table",{className:"rf-table-auto rf-w-full rf-text-left",children:[Ye.jsx("thead",{children:Ye.jsx("tr",{children:l.map(u=>Ye.jsx("th",{className:"rf-px-4 rf-py-2 rf-border-b",children:u.renderHeaderCell?u.renderHeaderCell(u):u.name},u.key))})}),Ye.jsx("tbody",{children:c.map((u,f)=>Ye.jsx("tr",{className:"rf-hover:bg-gray-100",children:l.map(d=>Ye.jsx("td",{className:"rf-px-4 rf-py-2 rf-border-b",children:d.renderCell?d.renderCell(u):u[d.key]},d.key))},f))})]})}),Ye.jsx(Ppn,{open:e.open,onClose:()=>t({open:!1}),title:e.open?e.title:"",children:Ye.jsx("div",{className:"rf-bg-gray-800 rf-p-3 rf-text-white rf-rounded",children:Ye.jsx("pre",{className:"rf-whitespace-pre-wrap",children:e.open?JSON.stringify(e.element,null,2):""})})})]})},Dpn=(n,e)=>n==="jlcpcb"?Ye.jsx("a",{className:"rf-underline rf-text-blue-500",target:"_blank",rel:"noreferrer",href:`https://jlcpcb.com/partdetail/${e}`,children:e}):e,Lpn=({circuitJson:n})=>{const e=n.filter(r=>r.type==="source_component"),t=new Set;for(const r of e)if(r.supplier_part_numbers)for(const i of Object.keys(r.supplier_part_numbers))t.add(i);return Ye.jsx("div",{className:"rf-overflow-x-auto",children:Ye.jsxs("table",{className:"rf-w-full rf-text-left rf-text-sm",children:[Ye.jsx("thead",{children:Ye.jsxs("tr",{className:"rf-border-b",children:[Ye.jsx("th",{className:"rf-p-2",children:"Name"}),Array.from(t).map(r=>Ye.jsx("th",{className:"rf-p-2 rf-capitalize",children:r},r))]})}),Ye.jsx("tbody",{children:e.map(r=>Ye.jsxs("tr",{className:"rf-border-b",children:[Ye.jsx("td",{className:"rf-p-2",children:r.name}),Array.from(t).map(i=>{var a,o;return Ye.jsx("td",{className:"rf-p-2",children:Dpn(i,((o=(a=r.supplier_part_numbers)==null?void 0:a[i])==null?void 0:o[0])||"")},i)})]},r.source_component_id))})]})})},Opn=({containerClassName:n,...e})=>{const t=it.useRef(null),[r,i]=it.useState(620);return it.useLayoutEffect(()=>{const a=()=>{if(t.current){const s=t.current.clientHeight,l=window.innerHeight;i(Math.min(Math.max(s,620),l))}};a();const o=new ResizeObserver(a);return t.current&&o.observe(t.current),window.addEventListener("resize",a),()=>{o.disconnect(),window.removeEventListener("resize",a)}},[]),Ye.jsx("div",{ref:t,className:n||"rf-w-full rf-h-full",children:Ye.jsx(Yrn,{...e,height:r})})},zpn='*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }/*! tailwindcss v3.4.17 | MIT License | https://tailwindcss.com*/*,:after,:before{border:0 solid #e5e7eb;box-sizing:border-box}:after,:before{--tw-content:""}:host,html{line-height:1.5;-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-tap-highlight-color:transparent}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{color:inherit;font-family:inherit;font-feature-settings:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{color:#9ca3af;opacity:1}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]:where(:not([hidden=until-found])){display:none}:root{--radius:0.5rem}.rf-pointer-events-none{pointer-events:none}.rf-invisible{visibility:hidden}.rf-fixed{position:fixed}.rf-absolute{position:absolute}.rf-relative{position:relative}.rf-inset-0{inset:0}.-rf-left-2{left:-.5rem}.-rf-right-10{right:-2.5rem}.-rf-right-2{right:-.5rem}.-rf-right-4{right:-1rem}.-rf-right-6{right:-1.5rem}.-rf-right-7{right:-1.75rem}.-rf-right-8{right:-2rem}.-rf-right-9{right:-2.25rem}.rf-bottom-full{bottom:100%}.rf-left-0{left:0}.rf-left-1{left:.25rem}.rf-left-1\\/2{left:50%}.rf-left-2{left:.5rem}.rf-left-\\[50\\%\\]{left:50%}.rf-right-0{right:0}.rf-right-4{right:1rem}.rf-right-\\[4px\\]{right:4px}.rf-top-0{top:0}.rf-top-1{top:.25rem}.rf-top-2{top:.5rem}.rf-top-2\\.5{top:.625rem}.rf-top-\\[50\\%\\]{top:50%}.rf-top-\\[6px\\]{top:6px}.rf-z-50{z-index:50}.rf-z-\\[100\\]{z-index:100}.-rf-mx-1,.rf--mx-1{margin-left:-.25rem;margin-right:-.25rem}.rf-mx-1{margin-left:.25rem;margin-right:.25rem}.rf-mx-2{margin-left:.5rem;margin-right:.5rem}.rf-mx-auto{margin-left:auto;margin-right:auto}.rf-my-1{margin-bottom:.25rem;margin-top:.25rem}.rf-my-12{margin-bottom:3rem;margin-top:3rem}.rf-my-4{margin-bottom:1rem;margin-top:1rem}.rf-my-auto{margin-bottom:auto;margin-top:auto}.rf-mb-1{margin-bottom:.25rem}.rf-mb-12{margin-bottom:3rem}.rf-mb-2{margin-bottom:.5rem}.rf-mb-3{margin-bottom:.75rem}.rf-mb-4{margin-bottom:1rem}.rf-mb-6{margin-bottom:1.5rem}.rf-mb-8{margin-bottom:2rem}.rf-ml-1{margin-left:.25rem}.rf-ml-2{margin-left:.5rem}.rf-ml-auto{margin-left:auto}.rf-mr-1{margin-right:.25rem}.rf-mr-2{margin-right:.5rem}.rf-mt-0{margin-top:0}.rf-mt-0\\.5{margin-top:.125rem}.rf-mt-1{margin-top:.25rem}.rf-mt-2{margin-top:.5rem}.rf-mt-3{margin-top:.75rem}.rf-mt-4{margin-top:1rem}.rf-mt-5{margin-top:1.25rem}.rf-mt-auto{margin-top:auto}.rf-block{display:block}.rf-inline{display:inline}.rf-flex{display:flex}.rf-inline-flex{display:inline-flex}.rf-grid{display:grid}.rf-hidden{display:none}.rf-aspect-square{aspect-ratio:1/1}.rf-aspect-video{aspect-ratio:16/9}.rf-size-14{height:3.5rem;width:3.5rem}.rf-size-4{height:1rem;width:1rem}.\\!rf-h-2{height:.5rem!important}.\\!rf-h-2\\.5{height:.625rem!important}.\\!rf-h-3{height:.75rem!important}.\\!rf-h-full{height:100%!important}.rf-h-1{height:.25rem}.rf-h-10{height:2.5rem}.rf-h-12{height:3rem}.rf-h-2{height:.5rem}.rf-h-2\\.5{height:.625rem}.rf-h-3{height:.75rem}.rf-h-3\\.5{height:.875rem}.rf-h-4{height:1rem}.rf-h-5{height:1.25rem}.rf-h-6{height:1.5rem}.rf-h-60{height:15rem}.rf-h-64{height:16rem}.rf-h-8{height:2rem}.rf-h-9{height:2.25rem}.rf-h-\\[620px\\]{height:620px}.rf-h-\\[calc\\(100vh-52px\\)\\]{height:calc(100vh - 52px)}.rf-h-\\[calc\\(100vh-96px\\)\\]{height:calc(100vh - 96px)}.rf-h-\\[var\\(--radix-select-trigger-height\\)\\]{height:var(--radix-select-trigger-height)}.rf-h-fit{height:-moz-fit-content;height:fit-content}.rf-h-full{height:100%}.rf-h-px{height:1px}.\\!rf-max-h-\\[40vh\\]{max-height:40vh!important}.\\!rf-max-h-\\[70\\%\\]{max-height:70%!important}.rf-max-h-32{max-height:8rem}.rf-max-h-96{max-height:24rem}.rf-max-h-\\[500px\\]{max-height:500px}.rf-max-h-\\[90vh\\]{max-height:90vh}.rf-min-h-0{min-height:0}.rf-min-h-\\[200px\\]{min-height:200px}.rf-min-h-\\[620px\\]{min-height:620px}.rf-min-h-\\[calc\\(100vh-240px\\)\\]{min-height:calc(100vh - 240px)}.\\!rf-w-2{width:.5rem!important}.\\!rf-w-2\\.5{width:.625rem!important}.rf-w-1{width:.25rem}.rf-w-1\\/2{width:50%}.rf-w-11{width:2.75rem}.rf-w-11\\/12{width:91.666667%}.rf-w-12{width:3rem}.rf-w-16{width:4rem}.rf-w-2{width:.5rem}.rf-w-2\\.5{width:.625rem}.rf-w-3{width:.75rem}.rf-w-3\\.5{width:.875rem}.rf-w-32{width:8rem}.rf-w-4{width:1rem}.rf-w-5{width:1.25rem}.rf-w-6{width:1.5rem}.rf-w-64{width:16rem}.rf-w-72{width:18rem}.rf-w-8{width:2rem}.rf-w-9{width:2.25rem}.rf-w-96{width:24rem}.rf-w-fit{width:-moz-fit-content;width:fit-content}.rf-w-full{width:100%}.rf-min-w-10{min-width:2.5rem}.rf-min-w-16{min-width:4rem}.rf-min-w-\\[148px\\]{min-width:148px}.rf-min-w-\\[8rem\\]{min-width:8rem}.rf-min-w-\\[var\\(--radix-select-trigger-width\\)\\]{min-width:var(--radix-select-trigger-width)}.\\!rf-max-w-\\[60vw\\]{max-width:60vw!important}.\\!rf-max-w-\\[660px\\]{max-width:660px!important}.rf-max-w-2xl{max-width:42rem}.rf-max-w-3xl{max-width:48rem}.rf-max-w-5xl{max-width:64rem}.rf-max-w-full{max-width:100%}.rf-max-w-lg{max-width:32rem}.rf-max-w-md{max-width:28rem}.rf-max-w-xl{max-width:36rem}.rf-flex-1{flex:1 1 0%}.rf-flex-shrink-0,.rf-shrink-0{flex-shrink:0}.rf-flex-grow{flex-grow:1}.rf-table-auto{table-layout:auto}.-rf-translate-x-1{--tw-translate-x:-0.25rem}.-rf-translate-x-1,.-rf-translate-x-1\\/2{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-rf-translate-x-1\\/2{--tw-translate-x:-50%}.-rf-translate-y-1{--tw-translate-y:-0.25rem}.-rf-translate-y-1,.rf--translate-x-1{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rf--translate-x-1{--tw-translate-x:-0.25rem}.rf-translate-x-\\[-50\\%\\]{--tw-translate-x:-50%}.rf-translate-x-\\[-50\\%\\],.rf-translate-y-\\[-50\\%\\]{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rf-translate-y-\\[-50\\%\\]{--tw-translate-y:-50%}.rf-transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes rf-pulse{50%{opacity:.5}}.rf-animate-pulse{animation:rf-pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes rf-spin{to{transform:rotate(1turn)}}.rf-animate-spin{animation:rf-spin 1s linear infinite}.rf-cursor-default{cursor:default}.rf-cursor-not-allowed{cursor:not-allowed}.rf-cursor-pointer{cursor:pointer}.rf-select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.rf-grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.rf-grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.rf-flex-row{flex-direction:row}.rf-flex-col{flex-direction:column}.rf-flex-col-reverse{flex-direction:column-reverse}.rf-flex-wrap{flex-wrap:wrap}.rf-place-items-center{place-items:center}.rf-items-start{align-items:flex-start}.rf-items-end{align-items:flex-end}.rf-items-center{align-items:center}.rf-justify-end{justify-content:flex-end}.rf-justify-center{justify-content:center}.rf-justify-between{justify-content:space-between}.rf-gap-0{gap:0}.rf-gap-1{gap:.25rem}.rf-gap-2{gap:.5rem}.rf-gap-3{gap:.75rem}.rf-gap-4{gap:1rem}.rf-gap-5{gap:1.25rem}.rf-gap-6{gap:1.5rem}.rf-gap-8{gap:2rem}.rf-space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(.5rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(.5rem*var(--tw-space-x-reverse))}.rf-space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(.5rem*var(--tw-space-y-reverse));margin-top:calc(.5rem*(1 - var(--tw-space-y-reverse)))}.rf-space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(1rem*var(--tw-space-y-reverse));margin-top:calc(1rem*(1 - var(--tw-space-y-reverse)))}.rf-space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(1.5rem*var(--tw-space-y-reverse));margin-top:calc(1.5rem*(1 - var(--tw-space-y-reverse)))}.rf-divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse:0;border-bottom-width:calc(1px*var(--tw-divide-y-reverse));border-top-width:calc(1px*(1 - var(--tw-divide-y-reverse)))}.rf-overflow-auto{overflow:auto}.rf-overflow-hidden{overflow:hidden}.rf-overflow-visible{overflow:visible}.rf-overflow-x-auto{overflow-x:auto}.\\!rf-overflow-y-auto{overflow-y:auto!important}.rf-overflow-y-auto{overflow-y:auto}.\\!rf-overflow-x-hidden{overflow-x:hidden!important}.rf-overflow-x-hidden{overflow-x:hidden}.rf-overflow-x-clip{overflow-x:clip}.rf-truncate{overflow:hidden;text-overflow:ellipsis}.rf-truncate,.rf-whitespace-nowrap{white-space:nowrap}.rf-whitespace-pre-wrap{white-space:pre-wrap}.rf-break-words{overflow-wrap:break-word}.rf-rounded{border-radius:.25rem}.rf-rounded-2xl{border-radius:1rem}.rf-rounded-full{border-radius:9999px}.rf-rounded-lg{border-radius:var(--radius)}.rf-rounded-md{border-radius:calc(var(--radius) - 2px)}.rf-rounded-sm{border-radius:calc(var(--radius) - 4px)}.rf-rounded-xl{border-radius:.75rem}.rf-border{border-width:1px}.rf-border-b{border-bottom-width:1px}.rf-border-t{border-top-width:1px}.rf-border-blue-200{--tw-border-opacity:1;border-color:rgb(191 219 254/var(--tw-border-opacity,1))}.rf-border-blue-500{--tw-border-opacity:1;border-color:rgb(59 130 246/var(--tw-border-opacity,1))}.rf-border-blue-600{--tw-border-opacity:1;border-color:rgb(37 99 235/var(--tw-border-opacity,1))}.rf-border-gray-200{--tw-border-opacity:1;border-color:rgb(229 231 235/var(--tw-border-opacity,1))}.rf-border-gray-300{--tw-border-opacity:1;border-color:rgb(209 213 219/var(--tw-border-opacity,1))}.rf-border-green-200{--tw-border-opacity:1;border-color:rgb(187 247 208/var(--tw-border-opacity,1))}.rf-border-input{border-color:hsl(var(--input))}.rf-border-neutral-200{--tw-border-opacity:1;border-color:rgb(229 229 229/var(--tw-border-opacity,1))}.rf-border-primary{border-color:hsl(var(--primary))}.rf-border-red-200{--tw-border-opacity:1;border-color:rgb(254 202 202/var(--tw-border-opacity,1))}.rf-border-red-500{--tw-border-opacity:1;border-color:rgb(239 68 68/var(--tw-border-opacity,1))}.rf-border-zinc-200{--tw-border-opacity:1;border-color:rgb(228 228 231/var(--tw-border-opacity,1))}.rf-border-zinc-900{--tw-border-opacity:1;border-color:rgb(24 24 27/var(--tw-border-opacity,1))}.rf-bg-background{background-color:hsl(var(--background))}.rf-bg-black{--tw-bg-opacity:1;background-color:rgb(0 0 0/var(--tw-bg-opacity,1))}.rf-bg-black\\/80{background-color:rgba(0,0,0,.8)}.rf-bg-blue-100{--tw-bg-opacity:1;background-color:rgb(219 234 254/var(--tw-bg-opacity,1))}.rf-bg-blue-50{--tw-bg-opacity:1;background-color:rgb(239 246 255/var(--tw-bg-opacity,1))}.rf-bg-blue-500{--tw-bg-opacity:1;background-color:rgb(59 130 246/var(--tw-bg-opacity,1))}.rf-bg-blue-600{--tw-bg-opacity:1;background-color:rgb(37 99 235/var(--tw-bg-opacity,1))}.rf-bg-gray-100{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity,1))}.rf-bg-gray-300{--tw-bg-opacity:1;background-color:rgb(209 213 219/var(--tw-bg-opacity,1))}.rf-bg-gray-50{--tw-bg-opacity:1;background-color:rgb(249 250 251/var(--tw-bg-opacity,1))}.rf-bg-gray-500{--tw-bg-opacity:1;background-color:rgb(107 114 128/var(--tw-bg-opacity,1))}.rf-bg-gray-700{--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity,1))}.rf-bg-gray-800{--tw-bg-opacity:1;background-color:rgb(31 41 55/var(--tw-bg-opacity,1))}.rf-bg-gray-900{--tw-bg-opacity:1;background-color:rgb(17 24 39/var(--tw-bg-opacity,1))}.rf-bg-green-100{--tw-bg-opacity:1;background-color:rgb(220 252 231/var(--tw-bg-opacity,1))}.rf-bg-green-50{--tw-bg-opacity:1;background-color:rgb(240 253 244/var(--tw-bg-opacity,1))}.rf-bg-muted{background-color:hsl(var(--muted))}.rf-bg-neutral-100{--tw-bg-opacity:1;background-color:rgb(245 245 245/var(--tw-bg-opacity,1))}.rf-bg-neutral-50{--tw-bg-opacity:1;background-color:rgb(250 250 250/var(--tw-bg-opacity,1))}.rf-bg-neutral-800{--tw-bg-opacity:1;background-color:rgb(38 38 38/var(--tw-bg-opacity,1))}.rf-bg-neutral-900{--tw-bg-opacity:1;background-color:rgb(23 23 23/var(--tw-bg-opacity,1))}.rf-bg-orange-400{--tw-bg-opacity:1;background-color:rgb(251 146 60/var(--tw-bg-opacity,1))}.rf-bg-popover{background-color:hsl(var(--popover))}.rf-bg-red-100{--tw-bg-opacity:1;background-color:rgb(254 226 226/var(--tw-bg-opacity,1))}.rf-bg-red-50{--tw-bg-opacity:1;background-color:rgb(254 242 242/var(--tw-bg-opacity,1))}.rf-bg-red-500{--tw-bg-opacity:1;background-color:rgb(239 68 68/var(--tw-bg-opacity,1))}.rf-bg-red-900{--tw-bg-opacity:1;background-color:rgb(127 29 29/var(--tw-bg-opacity,1))}.rf-bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.rf-bg-yellow-100{--tw-bg-opacity:1;background-color:rgb(254 249 195/var(--tw-bg-opacity,1))}.rf-bg-zinc-100{--tw-bg-opacity:1;background-color:rgb(244 244 245/var(--tw-bg-opacity,1))}.rf-bg-zinc-200{--tw-bg-opacity:1;background-color:rgb(228 228 231/var(--tw-bg-opacity,1))}.rf-bg-zinc-50{--tw-bg-opacity:1;background-color:rgb(250 250 250/var(--tw-bg-opacity,1))}.rf-bg-zinc-800{--tw-bg-opacity:1;background-color:rgb(39 39 42/var(--tw-bg-opacity,1))}.rf-bg-zinc-900{--tw-bg-opacity:1;background-color:rgb(24 24 27/var(--tw-bg-opacity,1))}.rf-bg-opacity-50{--tw-bg-opacity:0.5}.rf-fill-current{fill:currentColor}.rf-object-contain{-o-object-fit:contain;object-fit:contain}.\\!rf-p-0{padding:0!important}.rf-p-0{padding:0}.rf-p-1{padding:.25rem}.rf-p-2{padding:.5rem}.rf-p-3{padding:.75rem}.rf-p-4{padding:1rem}.rf-p-5{padding:1.25rem}.rf-p-6{padding:1.5rem}.rf-p-8{padding:2rem}.rf-px-1{padding-left:.25rem;padding-right:.25rem}.rf-px-2{padding-left:.5rem;padding-right:.5rem}.rf-px-3{padding-left:.75rem;padding-right:.75rem}.rf-px-4{padding-left:1rem;padding-right:1rem}.rf-px-6{padding-left:1.5rem;padding-right:1.5rem}.rf-px-8{padding-left:2rem;padding-right:2rem}.rf-py-0{padding-bottom:0;padding-top:0}.rf-py-0\\.5{padding-bottom:.125rem;padding-top:.125rem}.rf-py-1{padding-bottom:.25rem;padding-top:.25rem}.rf-py-1\\.5{padding-bottom:.375rem;padding-top:.375rem}.rf-py-10{padding-bottom:2.5rem;padding-top:2.5rem}.rf-py-12{padding-bottom:3rem;padding-top:3rem}.rf-py-2{padding-bottom:.5rem;padding-top:.5rem}.rf-py-3{padding-bottom:.75rem;padding-top:.75rem}.rf-py-4{padding-bottom:1rem;padding-top:1rem}.rf-pb-0{padding-bottom:0}.rf-pb-3{padding-bottom:.75rem}.rf-pb-4{padding-bottom:1rem}.rf-pl-2{padding-left:.5rem}.rf-pl-4{padding-left:1rem}.rf-pl-8{padding-left:2rem}.rf-pr-2{padding-right:.5rem}.rf-pt-4{padding-top:1rem}.rf-text-left{text-align:left}.rf-text-center{text-align:center}.rf-text-right{text-align:right}.rf-font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.rf-text-2xl{font-size:1.5rem;line-height:2rem}.rf-text-3xl{font-size:1.875rem;line-height:2.25rem}.rf-text-\\[8px\\]{font-size:8px}.rf-text-base{font-size:1rem;line-height:1.5rem}.rf-text-lg{font-size:1.125rem;line-height:1.75rem}.rf-text-sm{font-size:.875rem;line-height:1.25rem}.rf-text-xl{font-size:1.25rem;line-height:1.75rem}.rf-text-xs{font-size:.75rem;line-height:1rem}.rf-font-bold{font-weight:700}.rf-font-medium{font-weight:500}.rf-font-semibold{font-weight:600}.rf-capitalize{text-transform:capitalize}.rf-tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.rf-leading-5{line-height:1.25rem}.rf-leading-none{line-height:1}.rf-leading-tight{line-height:1.25}.rf-tracking-widest{letter-spacing:.1em}.rf-text-black{--tw-text-opacity:1;color:rgb(0 0 0/var(--tw-text-opacity,1))}.rf-text-blue-500{--tw-text-opacity:1;color:rgb(59 130 246/var(--tw-text-opacity,1))}.rf-text-blue-600{--tw-text-opacity:1;color:rgb(37 99 235/var(--tw-text-opacity,1))}.rf-text-blue-700{--tw-text-opacity:1;color:rgb(29 78 216/var(--tw-text-opacity,1))}.rf-text-blue-800{--tw-text-opacity:1;color:rgb(30 64 175/var(--tw-text-opacity,1))}.rf-text-blue-900{--tw-text-opacity:1;color:rgb(30 58 138/var(--tw-text-opacity,1))}.rf-text-current{color:currentColor}.rf-text-gray-400{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity,1))}.rf-text-gray-500{--tw-text-opacity:1;color:rgb(107 114 128/var(--tw-text-opacity,1))}.rf-text-gray-600{--tw-text-opacity:1;color:rgb(75 85 99/var(--tw-text-opacity,1))}.rf-text-gray-700{--tw-text-opacity:1;color:rgb(55 65 81/var(--tw-text-opacity,1))}.rf-text-gray-800{--tw-text-opacity:1;color:rgb(31 41 55/var(--tw-text-opacity,1))}.rf-text-gray-900{--tw-text-opacity:1;color:rgb(17 24 39/var(--tw-text-opacity,1))}.rf-text-green-500{--tw-text-opacity:1;color:rgb(34 197 94/var(--tw-text-opacity,1))}.rf-text-green-600{--tw-text-opacity:1;color:rgb(22 163 74/var(--tw-text-opacity,1))}.rf-text-green-700{--tw-text-opacity:1;color:rgb(21 128 61/var(--tw-text-opacity,1))}.rf-text-green-800{--tw-text-opacity:1;color:rgb(22 101 52/var(--tw-text-opacity,1))}.rf-text-green-900{--tw-text-opacity:1;color:rgb(20 83 45/var(--tw-text-opacity,1))}.rf-text-muted-foreground{color:hsl(var(--muted-foreground))}.rf-text-neutral-50{--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.rf-text-neutral-500{--tw-text-opacity:1;color:rgb(115 115 115/var(--tw-text-opacity,1))}.rf-text-neutral-900{--tw-text-opacity:1;color:rgb(23 23 23/var(--tw-text-opacity,1))}.rf-text-neutral-950{--tw-text-opacity:1;color:rgb(10 10 10/var(--tw-text-opacity,1))}.rf-text-popover-foreground{color:hsl(var(--popover-foreground))}.rf-text-red-200{--tw-text-opacity:1;color:rgb(254 202 202/var(--tw-text-opacity,1))}.rf-text-red-300{--tw-text-opacity:1;color:rgb(252 165 165/var(--tw-text-opacity,1))}.rf-text-red-400{--tw-text-opacity:1;color:rgb(248 113 113/var(--tw-text-opacity,1))}.rf-text-red-500{--tw-text-opacity:1;color:rgb(239 68 68/var(--tw-text-opacity,1))}.rf-text-red-600{--tw-text-opacity:1;color:rgb(220 38 38/var(--tw-text-opacity,1))}.rf-text-red-700{--tw-text-opacity:1;color:rgb(185 28 28/var(--tw-text-opacity,1))}.rf-text-red-800{--tw-text-opacity:1;color:rgb(153 27 27/var(--tw-text-opacity,1))}.rf-text-red-900{--tw-text-opacity:1;color:rgb(127 29 29/var(--tw-text-opacity,1))}.rf-text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.rf-text-yellow-400{--tw-text-opacity:1;color:rgb(250 204 21/var(--tw-text-opacity,1))}.rf-text-yellow-500{--tw-text-opacity:1;color:rgb(234 179 8/var(--tw-text-opacity,1))}.rf-text-yellow-900{--tw-text-opacity:1;color:rgb(113 63 18/var(--tw-text-opacity,1))}.rf-text-zinc-200{--tw-text-opacity:1;color:rgb(228 228 231/var(--tw-text-opacity,1))}.rf-text-zinc-300{--tw-text-opacity:1;color:rgb(212 212 216/var(--tw-text-opacity,1))}.rf-text-zinc-400{--tw-text-opacity:1;color:rgb(161 161 170/var(--tw-text-opacity,1))}.rf-text-zinc-50{--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.rf-text-zinc-500{--tw-text-opacity:1;color:rgb(113 113 122/var(--tw-text-opacity,1))}.rf-text-zinc-900{--tw-text-opacity:1;color:rgb(24 24 27/var(--tw-text-opacity,1))}.rf-text-zinc-950{--tw-text-opacity:1;color:rgb(9 9 11/var(--tw-text-opacity,1))}.rf-underline{text-decoration-line:underline}.rf-line-through{text-decoration-line:line-through}.rf-underline-offset-4{text-underline-offset:4px}.rf-opacity-0{opacity:0}.rf-opacity-25{opacity:.25}.rf-opacity-30{opacity:.3}.rf-opacity-50{opacity:.5}.rf-opacity-60{opacity:.6}.rf-shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color)}.rf-shadow,.rf-shadow-lg{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.rf-shadow-lg{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color)}.rf-shadow-md{--tw-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),0 2px 4px -2px var(--tw-shadow-color)}.rf-shadow-md,.rf-shadow-sm{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.rf-shadow-sm{--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color)}.rf-outline-none{outline:2px solid transparent;outline-offset:2px}.rf-ring-2{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.rf-ring-blue-500{--tw-ring-opacity:1;--tw-ring-color:rgb(59 130 246/var(--tw-ring-opacity,1))}.rf-ring-primary{--tw-ring-color:hsl(var(--primary))}.rf-ring-offset-background{--tw-ring-offset-color:hsl(var(--background))}.rf-ring-offset-white{--tw-ring-offset-color:#fff}.rf-transition{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.rf-transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.rf-transition-colors{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1)}.rf-transition-opacity{transition-duration:.15s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}.rf-duration-200{transition-duration:.2s}.rf-ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}@keyframes enter{0%{opacity:var(--tw-enter-opacity,1);transform:translate3d(var(--tw-enter-translate-x,0),var(--tw-enter-translate-y,0),0) scale3d(var(--tw-enter-scale,1),var(--tw-enter-scale,1),var(--tw-enter-scale,1)) rotate(var(--tw-enter-rotate,0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity,1);transform:translate3d(var(--tw-exit-translate-x,0),var(--tw-exit-translate-y,0),0) scale3d(var(--tw-exit-scale,1),var(--tw-exit-scale,1),var(--tw-exit-scale,1)) rotate(var(--tw-exit-rotate,0))}}.rf-slide-in-from-left-1{--tw-enter-translate-x:-0.25rem}.rf-slide-out-to-left-1{--tw-exit-translate-x:-0.25rem}.rf-duration-200{animation-duration:.2s}.rf-ease-in-out{animation-timing-function:cubic-bezier(.4,0,.2,1)}.file\\:rf-border-0::file-selector-button{border-width:0}.file\\:rf-bg-transparent::file-selector-button{background-color:transparent}.file\\:rf-text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\\:rf-font-medium::file-selector-button{font-weight:500}.placeholder\\:rf-text-zinc-500::-moz-placeholder{--tw-text-opacity:1;color:rgb(113 113 122/var(--tw-text-opacity,1))}.placeholder\\:rf-text-zinc-500::placeholder{--tw-text-opacity:1;color:rgb(113 113 122/var(--tw-text-opacity,1))}.hover\\:rf-border-blue-300:hover{--tw-border-opacity:1;border-color:rgb(147 197 253/var(--tw-border-opacity,1))}.hover\\:\\!rf-bg-transparent:hover{background-color:transparent!important}.hover\\:rf-bg-blue-700:hover{--tw-bg-opacity:1;background-color:rgb(29 78 216/var(--tw-bg-opacity,1))}.hover\\:rf-bg-red-500\\/90:hover{background-color:rgba(239,68,68,.9)}.hover\\:rf-bg-zinc-100:hover{--tw-bg-opacity:1;background-color:rgb(244 244 245/var(--tw-bg-opacity,1))}.hover\\:rf-bg-zinc-100\\/80:hover{background-color:hsla(240,5%,96%,.8)}.hover\\:rf-bg-zinc-900\\/90:hover{background-color:rgba(24,24,27,.9)}.hover\\:rf-text-red-400:hover{--tw-text-opacity:1;color:rgb(248 113 113/var(--tw-text-opacity,1))}.hover\\:rf-text-zinc-900:hover{--tw-text-opacity:1;color:rgb(24 24 27/var(--tw-text-opacity,1))}.hover\\:rf-underline:hover{text-decoration-line:underline}.hover\\:rf-shadow-lg:hover{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.focus\\:rf-bg-gray-100:focus{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity,1))}.focus\\:rf-bg-zinc-100:focus{--tw-bg-opacity:1;background-color:rgb(244 244 245/var(--tw-bg-opacity,1))}.focus\\:rf-text-gray-900:focus{--tw-text-opacity:1;color:rgb(17 24 39/var(--tw-text-opacity,1))}.focus\\:rf-text-zinc-900:focus{--tw-text-opacity:1;color:rgb(24 24 27/var(--tw-text-opacity,1))}.focus\\:rf-outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\\:rf-ring-2:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus\\:rf-ring-ring:focus{--tw-ring-color:hsl(var(--ring))}.focus\\:rf-ring-offset-2:focus{--tw-ring-offset-width:2px}.focus-visible\\:rf-outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\\:rf-ring-1:focus-visible{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus-visible\\:rf-ring-2:focus-visible{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus-visible\\:rf-ring-zinc-950:focus-visible{--tw-ring-opacity:1;--tw-ring-color:rgb(9 9 11/var(--tw-ring-opacity,1))}.focus-visible\\:rf-ring-offset-2:focus-visible{--tw-ring-offset-width:2px}.disabled\\:rf-pointer-events-none:disabled{pointer-events:none}.disabled\\:rf-cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:rf-opacity-50:disabled{opacity:.5}.rf-group\\/bar:hover .group-hover\\/bar\\:rf-opacity-100{opacity:1}.data-\\[disabled\\]\\:rf-pointer-events-none[data-disabled]{pointer-events:none}.data-\\[side\\=bottom\\]\\:rf-translate-y-1[data-side=bottom]{--tw-translate-y:0.25rem}.data-\\[side\\=bottom\\]\\:rf-translate-y-1[data-side=bottom],.data-\\[side\\=left\\]\\:-rf-translate-x-1[data-side=left]{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[side\\=left\\]\\:-rf-translate-x-1[data-side=left]{--tw-translate-x:-0.25rem}.data-\\[side\\=right\\]\\:rf-translate-x-1[data-side=right]{--tw-translate-x:0.25rem}.data-\\[side\\=right\\]\\:rf-translate-x-1[data-side=right],.data-\\[side\\=top\\]\\:-rf-translate-y-1[data-side=top]{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[side\\=top\\]\\:-rf-translate-y-1[data-side=top]{--tw-translate-y:-0.25rem}.data-\\[state\\=active\\]\\:rf-bg-white[data-state=active]{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.data-\\[state\\=checked\\]\\:rf-bg-zinc-900[data-state=checked]{--tw-bg-opacity:1;background-color:rgb(24 24 27/var(--tw-bg-opacity,1))}.data-\\[state\\=open\\]\\:rf-bg-zinc-100[data-state=open]{--tw-bg-opacity:1;background-color:rgb(244 244 245/var(--tw-bg-opacity,1))}.data-\\[state\\=active\\]\\:rf-text-zinc-950[data-state=active]{--tw-text-opacity:1;color:rgb(9 9 11/var(--tw-text-opacity,1))}.data-\\[state\\=checked\\]\\:rf-text-zinc-50[data-state=checked]{--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.data-\\[disabled\\]\\:rf-opacity-50[data-disabled]{opacity:.5}.data-\\[state\\=active\\]\\:rf-shadow[data-state=active]{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.data-\\[state\\=open\\]\\:rf-animate-in[data-state=open]{animation-duration:.15s;animation-name:enter;--tw-enter-opacity:initial;--tw-enter-scale:initial;--tw-enter-rotate:initial;--tw-enter-translate-x:initial;--tw-enter-translate-y:initial}.data-\\[state\\=closed\\]\\:rf-animate-out[data-state=closed]{animation-duration:.15s;animation-name:exit;--tw-exit-opacity:initial;--tw-exit-scale:initial;--tw-exit-rotate:initial;--tw-exit-translate-x:initial;--tw-exit-translate-y:initial}.data-\\[state\\=closed\\]\\:rf-fade-out-0[data-state=closed]{--tw-exit-opacity:0}.data-\\[state\\=open\\]\\:rf-fade-in-0[data-state=open]{--tw-enter-opacity:0}.data-\\[state\\=closed\\]\\:rf-zoom-out-95[data-state=closed]{--tw-exit-scale:.95}.data-\\[state\\=open\\]\\:rf-zoom-in-95[data-state=open]{--tw-enter-scale:.95}.data-\\[side\\=bottom\\]\\:rf-slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y:-0.5rem}.data-\\[side\\=left\\]\\:rf-slide-in-from-right-2[data-side=left]{--tw-enter-translate-x:0.5rem}.data-\\[side\\=right\\]\\:rf-slide-in-from-left-2[data-side=right]{--tw-enter-translate-x:-0.5rem}.data-\\[side\\=top\\]\\:rf-slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y:0.5rem}.data-\\[state\\=closed\\]\\:rf-slide-out-to-left-1\\/2[data-state=closed]{--tw-exit-translate-x:-50%}.data-\\[state\\=closed\\]\\:rf-slide-out-to-top-\\[48\\%\\][data-state=closed]{--tw-exit-translate-y:-48%}.data-\\[state\\=open\\]\\:rf-slide-in-from-left-1\\/2[data-state=open]{--tw-enter-translate-x:-50%}.data-\\[state\\=open\\]\\:rf-slide-in-from-top-\\[48\\%\\][data-state=open]{--tw-enter-translate-y:-48%}.dark\\:rf-border-zinc-50:is(.rf-dark *){--tw-border-opacity:1;border-color:rgb(250 250 250/var(--tw-border-opacity,1))}.dark\\:rf-border-zinc-800:is(.rf-dark *){--tw-border-opacity:1;border-color:rgb(39 39 42/var(--tw-border-opacity,1))}.dark\\:rf-bg-red-900:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(127 29 29/var(--tw-bg-opacity,1))}.dark\\:rf-bg-zinc-50:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(250 250 250/var(--tw-bg-opacity,1))}.dark\\:rf-bg-zinc-800:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(39 39 42/var(--tw-bg-opacity,1))}.dark\\:rf-bg-zinc-950:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(9 9 11/var(--tw-bg-opacity,1))}.dark\\:rf-text-zinc-400:is(.rf-dark *){--tw-text-opacity:1;color:rgb(161 161 170/var(--tw-text-opacity,1))}.dark\\:rf-text-zinc-50:is(.rf-dark *){--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.dark\\:rf-text-zinc-900:is(.rf-dark *){--tw-text-opacity:1;color:rgb(24 24 27/var(--tw-text-opacity,1))}.dark\\:rf-placeholder-zinc-400:is(.rf-dark *)::-moz-placeholder{--tw-placeholder-opacity:1;color:rgb(161 161 170/var(--tw-placeholder-opacity,1))}.dark\\:rf-placeholder-zinc-400:is(.rf-dark *)::placeholder{--tw-placeholder-opacity:1;color:rgb(161 161 170/var(--tw-placeholder-opacity,1))}.dark\\:rf-ring-offset-zinc-950:is(.rf-dark *){--tw-ring-offset-color:#09090b}.dark\\:hover\\:rf-bg-red-900\\/90:hover:is(.rf-dark *){background-color:rgba(127,29,29,.9)}.dark\\:hover\\:rf-bg-zinc-50\\/90:hover:is(.rf-dark *){background-color:hsla(0,0%,98%,.9)}.dark\\:hover\\:rf-bg-zinc-800:hover:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(39 39 42/var(--tw-bg-opacity,1))}.dark\\:hover\\:rf-bg-zinc-800\\/80:hover:is(.rf-dark *){background-color:rgba(39,39,42,.8)}.dark\\:hover\\:rf-text-zinc-50:hover:is(.rf-dark *){--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.dark\\:focus\\:rf-bg-zinc-800:focus:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(39 39 42/var(--tw-bg-opacity,1))}.dark\\:focus\\:rf-text-zinc-50:focus:is(.rf-dark *){--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.dark\\:focus-visible\\:rf-ring-zinc-300:focus-visible:is(.rf-dark *){--tw-ring-opacity:1;--tw-ring-color:rgb(212 212 216/var(--tw-ring-opacity,1))}.dark\\:data-\\[state\\=active\\]\\:rf-bg-zinc-950[data-state=active]:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(9 9 11/var(--tw-bg-opacity,1))}.dark\\:data-\\[state\\=checked\\]\\:rf-bg-zinc-50[data-state=checked]:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(250 250 250/var(--tw-bg-opacity,1))}.dark\\:data-\\[state\\=open\\]\\:rf-bg-zinc-800[data-state=open]:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(39 39 42/var(--tw-bg-opacity,1))}.dark\\:data-\\[state\\=active\\]\\:rf-text-zinc-50[data-state=active]:is(.rf-dark *){--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.dark\\:data-\\[state\\=checked\\]\\:rf-text-zinc-900[data-state=checked]:is(.rf-dark *){--tw-text-opacity:1;color:rgb(24 24 27/var(--tw-text-opacity,1))}@media (min-width:640px){.sm\\:rf-mt-0{margin-top:0}.sm\\:rf-flex-row{flex-direction:row}.sm\\:rf-justify-end{justify-content:flex-end}.sm\\:rf-space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(.5rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(.5rem*var(--tw-space-x-reverse))}.sm\\:rf-rounded-lg{border-radius:var(--radius)}.sm\\:rf-text-left{text-align:left}}@media (min-width:768px){.md\\:rf-grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}.\\[\\&\\>span\\]\\:rf-line-clamp-1>span{display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:1}.\\[\\&\\>svg\\]\\:rf-size-4>svg{height:1rem;width:1rem}.\\[\\&\\>svg\\]\\:rf-shrink-0>svg{flex-shrink:0}.\\[\\&\\>svg\\]\\:rf-text-red-300>svg{--tw-text-opacity:1;color:rgb(252 165 165/var(--tw-text-opacity,1))}.\\[\\&\\>svg\\]\\:hover\\:rf-text-red-400:hover>svg{--tw-text-opacity:1;color:rgb(248 113 113/var(--tw-text-opacity,1))}.\\[\\&_svg\\]\\:rf-pointer-events-none svg{pointer-events:none}.\\[\\&_svg\\]\\:rf-size-4 svg{height:1rem;width:1rem}.\\[\\&_svg\\]\\:rf-shrink-0 svg{flex-shrink:0}',Upn=()=>{it.useEffect(()=>{if(document.querySelector('style[data-styles="tscircuit-runframe"]'))return;const e=document.createElement("style");e.setAttribute("data-styles","tscircuit-runframe"),e.textContent=zpn,document.head.appendChild(e)},[])},eZe=n=>`hsl(${s3.indexOf(n)*137.5%360}, 70%, 50%)`,kpn=({phaseTimings:n})=>{if(!n)return null;const e=Object.values(n).reduce((t,r)=>t+r,0);return Ye.jsxs("div",{className:"rf-space-y-2 rf-w-full rf-px-4",children:[Ye.jsx("div",{className:"rf-relative rf-h-8 rf-flex rf-rounded-sm",children:s3.map(t=>{const r=n[t]||0,i=r/e*100;return Ye.jsx("div",{className:"rf-group/bar rf-relative rf-overflow-visible",style:{width:`${i}%`,backgroundColor:eZe(t)},children:Ye.jsxs("div",{className:"rf-opacity-0 group-hover/bar:rf-opacity-100 rf-transition-opacity rf-absolute rf-bottom-full rf-left-1/2 rf-transform -rf-translate-x-1/2 rf-mb-2 rf-px-2 rf-py-1 rf-text-xs rf-whitespace-nowrap rf-rounded rf-bg-gray-900 rf-text-white rf-pointer-events-none",children:[t,": ",r.toFixed(1),"ms"]})},t)})}),Ye.jsxs("div",{className:"rf-text-xs rf-text-gray-500",children:["Total: ",e.toFixed(2),"ms"]})]})},Ipn=({renderLog:n})=>{const[e,t]=it.useState("chronological");if(!n)return Ye.jsx("div",{className:"rf-p-4 rf-bg-gray-100 rf-rounded-md",children:"No render log, make sure this tab is open when you render (TODO add a rerender button here)"});const r=Object.entries((n==null?void 0:n.phaseTimings)??{});e==="chronological"?r.sort((a,o)=>s3.indexOf(a[0])-s3.indexOf(o[0])):r.sort((a,o)=>o[1]-a[1]);const i=r.reduce((a,[o,s])=>a+s,0);return Ye.jsxs("div",{className:"rf-bg-white",children:[Ye.jsxs("div",{className:"rf-flex rf-justify-between rf-items-center",children:[Ye.jsx("div",{children:"Render Logs"}),Ye.jsxs("div",{className:"rf-mb-4 rf-pr-2 rf-flex rf-text-xs rf-items-center",children:[Ye.jsx("div",{className:"rf-mr-2",children:"Sort by:"}),Ye.jsxs("select",{value:e,onChange:a=>t(a.target.value),className:"rf-px-2 rf-py-1 rf-border rf-rounded rf-text-xs",children:[Ye.jsx("option",{value:"chronological",children:"Phase Order"}),Ye.jsx("option",{value:"longest",children:"Duration"})]})]})]}),Ye.jsx(kpn,{phaseTimings:n.phaseTimings}),Ye.jsxs("table",{className:"rf-w-full rf-text-xs",children:[Ye.jsx("thead",{children:Ye.jsxs("tr",{children:[Ye.jsx("th",{className:"rf-text-left rf-p-2",children:"Phase Order"}),Ye.jsx("th",{className:"rf-text-left rf-p-2",children:"Phase"}),Ye.jsx("th",{className:"rf-text-left rf-p-2",children:"Duration (ms)"})]})}),Ye.jsx("tbody",{children:r.map(([a,o])=>Ye.jsxs("tr",{children:[Ye.jsx("td",{className:"rf-p-2",children:s3.indexOf(a)}),Ye.jsx("td",{className:"rf-p-2",children:a}),Ye.jsx("td",{className:"rf-p-2",children:Ye.jsx("div",{className:"rf-w-8",children:Ye.jsx("div",{className:"rf-h-2 rf-rounded-sm",style:{backgroundColor:eZe(a),width:`${o/i*100}%`}})})}),Ye.jsx("td",{className:"rf-p-2",children:Ye.jsxs("div",{className:"rf-flex w-full",children:[Ye.jsxs("span",{className:"rf-flex-grow",children:[o,"ms"]}),Ye.jsxs("span",{className:"rf-text-gray-500 rf-pr-2",children:[(o/i*100).toFixed(1),"%"]})]})})]},a))})]})]})},Fpn="0.0.383",Bpn=["assembly","bom","circuit_json","errors","render_log"],jpn=({code:n,onRunClicked:e=void 0,errorMessage:t,circuitJson:r,autoroutingGraphics:i,showRightHeaderContent:a=!0,showCodeTab:o=!1,codeTabContent:s,showJsonTab:l=!0,showRenderLogTab:c=!0,onActiveTabChange:u,renderLog:f,showImportAndFormatButtons:d=!0,className:v,headerClassName:y,leftHeaderContent:w,readOnly:b,isStreaming:S,autoroutingLog:R,onReportAutoroutingLog:D,isRunningCode:k,hasCodeChangedSinceLastRun:G,onEditEvent:q,editEvents:Z,defaultActiveTab:Y,autoRotate3dViewerDisabled:ee,showSchematicDebugGrid:X=!1,showToggleFullScreen:ue=!0,defaultToFullScreen:pe=!1})=>{var Oe;Upn();const[de,we]=it.useState(Y??"pcb"),[he,ge]=it.useState(pe),Te=it.useCallback(Ne=>{we(Ne),u==null||u(Ne)},[u]),be=()=>{ge(!he)};return it.useEffect(()=>{t&&Te("errors")},[t]),it.useEffect(()=>{(de==="code"||de==="errors")&&r&&!t&&Te(Y??"pcb")},[r]),Ye.jsx("div",{className:ih("flex flex-col relative rf-overflow-x-hidden",v),children:Ye.jsx("div",{className:ih("rf-md:sticky rf-md:top-2",he&&"rf-fixed rf-top-0 rf-left-0 rf-w-full rf-bg-white"),children:Ye.jsxs(Nxe,{value:de,onValueChange:Te,className:"rf-flex-grow rf-flex rf-flex-col",children:[Ye.jsxs("div",{className:ih("rf-flex rf-items-center rf-gap-2 rf-p-2 rf-pb-0",y),children:[w,w&&Ye.jsx("div",{className:"rf-flex-grow"}),!w&&k&&Ye.jsx(WT,{className:"rf-w-4 rf-h-4 rf-animate-spin"}),!w&&Ye.jsx("div",{className:"rf-flex-grow"}),f&&f.progress!==1&&Ye.jsxs("div",{className:"rf-flex rf-items-center rf-gap-2",children:[f.lastRenderEvent&&Ye.jsx("div",{className:"rf-text-xs rf-text-gray-500",children:(Oe=f.lastRenderEvent)==null?void 0:Oe.type.split("renderable:renderLifecycle:")[1].split(":")[0]}),Ye.jsx("div",{className:"rf-w-4 rf-h-4 rf-bg-blue-500 rf-opacity-50 rf-rounded-full rf-text-white",children:Ye.jsx(WT,{className:"rf-w-4 rf-h-4 rf-animate-spin"})}),Ye.jsxs("div",{className:"rf-text-xs rf-font-bold rf-text-gray-700 rf-tabular-nums",children:[((f.progress??0)*100).toFixed(1),"%"]})]}),a&&Ye.jsxs(kq,{children:[o&&Ye.jsx(W8,{value:"code",children:"Code"}),Ye.jsxs(W8,{value:"pcb",className:"rf-whitespace-nowrap",children:[r&&Ye.jsx("span",{className:ih("rf-inline-flex rf-items-center rf-justify-center rf-w-2 rf-h-2 rf-mr-1 rf-text-xs rf-font-bold rf-text-white rf-rounded-full",G?"rf-bg-gray-500":"rf-bg-blue-500")}),"PCB"]}),Ye.jsxs(W8,{value:"schematic",className:"rf-whitespace-nowrap",children:[r&&Ye.jsx("span",{className:ih("rf-inline-flex rf-items-center rf-justify-center rf-w-2 rf-h-2 rf-mr-1 rf-text-xs rf-font-bold rf-text-white rf-rounded-full",G?"rf-bg-gray-500":"rf-bg-blue-500")}),"Schematic"]}),Ye.jsxs(W8,{value:"cad",children:[r&&Ye.jsx("span",{className:ih("inline-flex items-center justify-center w-2 h-2 mr-1 text-xs font-bold text-white rounded-full",G?"rf-bg-gray-500":"rf-bg-blue-500")}),"3D"]}),!["pcb","cad","schematic"].includes(de)&&Ye.jsx(W8,{value:de,children:Pxe(de)}),Ye.jsxs(pfe,{children:[Ye.jsx(hfe,{asChild:!0,children:Ye.jsxs("div",{className:"rf-whitespace-nowrap rf-p-2 rf-mr-1 rf-cursor-pointer rf-relative",children:[Ye.jsx(lin,{className:"rf-w-4 rf-h-4"}),t&&Ye.jsx("span",{className:"rf-inline-flex rf-absolute rf-top-[6px] rf-right-[4px] rf-items-center rf-justify-center rf-w-1 rf-h-1 rf-ml-2 rf-text-[8px] rf-font-bold rf-text-white rf-bg-red-500 rf-rounded-full"})]})}),Ye.jsxs(gB,{className:"rf-*:text-xs",children:[Bpn.map(Ne=>Ye.jsxs(w4,{onSelect:()=>Te(Ne),children:[de!==Ne&&Ye.jsx(y$e,{className:"rf-w-3 rf-h-3 rf-opacity-30"}),de===Ne&&Ye.jsx(bue,{className:"rf-w-3 rf-h-3"}),Ye.jsx("div",{className:"rf-pr-2",children:Pxe(Ne)}),Ne==="errors"&&t&&Ye.jsx("span",{className:"rf-inline-flex rf-items-center rf-justify-center rf-w-3 rf-h-3 rf-ml-2 rf-text-[8px] rf-font-bold rf-text-white rf-bg-red-500 rf-rounded-full",children:"1"})]},Ne)),Ye.jsx(w4,{disabled:!0,className:"rf-opacity-60 rf-cursor-default rf-select-none",children:Ye.jsxs("div",{className:"rf-pr-2 rf-text-xs rf-text-gray-500",children:["@tscircuit/runframe@",Fpn.split(".").map((Ne,Ie)=>Ie===2?parseInt(Ne)+1:Ne).join(".")]})})]})]})]}),ue&&Ye.jsx(rb,{onClick:be,variant:"ghost",children:he?Ye.jsx(din,{size:16}):Ye.jsx(uin,{size:16})})]}),o&&Ye.jsx(q4,{value:"code",className:"rf-flex-grow rf-overflow-hidden",children:Ye.jsx("div",{className:"rf-h-full",children:s})}),Ye.jsx(q4,{value:"pcb",children:Ye.jsx("div",{className:ih("rf-overflow-hidden",he?"rf-h-[calc(100vh-52px)]":"rf-h-[620px]"),children:Ye.jsx(XT,{fallbackRender:({error:Ne})=>Ye.jsx("div",{className:"rf-mt-4 rf-bg-red-50 rf-rounded-md rf-border rf-border-red-200",children:Ye.jsxs("div",{className:"rf-p-4",children:[Ye.jsx("h3",{className:"rf-text-lg rf-font-semibold rf-text-red-800 rf-mb-3",children:"Error loading PCB viewer"}),Ye.jsx("p",{className:"rf-text-xs rf-font-mono rf-whitespace-pre-wrap rf-text-red-600 rf-mt-2",children:(Ne==null?void 0:Ne.message)||"An unknown error occurred"})]})}),children:r?Ye.jsx(Opn,{focusOnHover:!1,circuitJson:r,debugGraphics:i,containerClassName:ih("rf-h-full rf-w-full",he?"rf-min-h-[calc(100vh-240px)]":"rf-min-h-[620px]"),onEditEventsChanged:Ne=>{q&&Ne.forEach(Ie=>q(Ie))}}):Ye.jsx(xw,{onRunClicked:e})})})}),Ye.jsx(q4,{value:"assembly",children:Ye.jsx("div",{className:ih("rf-overflow-auto",he?"rf-h-[calc(100vh-96px)]":"rf-h-[620px]"),children:Ye.jsx(XT,{fallback:Ye.jsx("div",{children:"Error loading Assembly"}),children:r?Ye.jsx(Rpn,{circuitJson:r,containerStyle:{height:"100%"},editingEnabled:!0,debugGrid:!0}):Ye.jsx(xw,{onRunClicked:e})})})}),Ye.jsx(q4,{value:"schematic",children:Ye.jsx("div",{className:ih("rf-overflow-auto",he?"rf-h-[calc(100vh-96px)]":"rf-h-[620px]"),children:Ye.jsx(XT,{fallbackRender:({error:Ne})=>Ye.jsx("div",{className:"rf-mt-4 rf-bg-red-50 rf-rounded-md rf-border rf-border-red-200",children:Ye.jsxs("div",{className:"rf-p-4",children:[Ye.jsx("h3",{className:"rf-text-lg rf-font-semibold rf-text-red-800 rf-mb-3",children:"Error loading Schematic"}),Ye.jsx("p",{className:"rf-text-xs rf-font-mono rf-whitespace-pre-wrap rf-text-red-600 rf-mt-2",children:(Ne==null?void 0:Ne.message)||"An unknown error occurred"})]})}),children:r?Ye.jsx(Tpn,{circuitJson:r,containerStyle:{height:"100%"},editingEnabled:!0,onEditEvent:Ne=>{q==null||q(Ne)},debugGrid:X}):Ye.jsx(xw,{onRunClicked:e})})})}),Ye.jsx(q4,{value:"cad",children:Ye.jsx("div",{className:ih("rf-overflow-auto",he?"rf-h-[calc(100vh-96px)]":"rf-h-[620px]"),children:Ye.jsx(XT,{FallbackComponent:Xrn,children:r?Ye.jsx(kJt,{soup:r,autoRotateDisabled:ee}):Ye.jsx(xw,{onRunClicked:e})})})}),Ye.jsx(q4,{value:"bom",children:Ye.jsx("div",{className:ih("rf-overflow-auto",he?"rf-h-[calc(100vh-96px)]":"rf-h-[620px]"),children:Ye.jsx(XT,{fallbackRender:({error:Ne})=>Ye.jsx("div",{className:"rf-mt-4 rf-bg-red-50 rf-rounded-md rf-border rf-border-red-200",children:Ye.jsxs("div",{className:"rf-p-4",children:[Ye.jsx("h3",{className:"rf-text-lg rf-font-semibold rf-text-red-800 rf-mb-3",children:"Error loading Bill of Materials"}),Ye.jsx("p",{className:"rf-text-xs rf-font-mono rf-whitespace-pre-wrap rf-text-red-600 rf-mt-2",children:(Ne==null?void 0:Ne.message)||"An unknown error occurred"})]})}),children:r?Ye.jsx(Lpn,{circuitJson:r}):Ye.jsx(xw,{onRunClicked:e})})})}),Ye.jsx(q4,{value:"circuit_json",children:Ye.jsx("div",{className:ih("rf-overflow-auto",he?"rf-h-[calc(100vh-96px)]":"rf-h-[620px]"),children:Ye.jsx(XT,{fallback:Ye.jsx("div",{children:"Error loading JSON viewer"}),children:r?Ye.jsx(Npn,{elements:r}):Ye.jsx(xw,{onRunClicked:e})})})}),Ye.jsx(q4,{value:"errors",children:Ye.jsx("div",{className:ih("rf-overflow-auto",he?"rf-h-[calc(100vh-96px)]":"rf-h-[620px]"),children:r||t?Ye.jsx(oln,{code:n,errorMessage:t,autoroutingLog:R,onReportAutoroutingLog:D}):Ye.jsx(xw,{onRunClicked:e})})}),c&&Ye.jsx(q4,{value:"render_log",children:Ye.jsx(Ipn,{renderLog:f})})]})})})};var Tj="Dialog",[tZe,nZe]=BS(Tj),[Hpn,E4]=tZe(Tj),rZe=n=>{const{__scopeDialog:e,children:t,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=n,s=it.useRef(null),l=it.useRef(null),[c,u]=cE({prop:r,defaultProp:i??!1,onChange:a,caller:Tj});return Ye.jsx(Hpn,{scope:e,triggerRef:s,contentRef:l,contentId:jS(),titleId:jS(),descriptionId:jS(),open:c,onOpenChange:u,onOpenToggle:it.useCallback(()=>u(f=>!f),[u]),modal:o,children:t})};rZe.displayName=Tj;var iZe="DialogTrigger",aZe=it.forwardRef((n,e)=>{const{__scopeDialog:t,...r}=n,i=E4(iZe,t),a=nx(e,i.triggerRef);return Ye.jsx(w9.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Fde(i.open),...r,ref:a,onClick:Pp(n.onClick,i.onOpenToggle)})});aZe.displayName=iZe;var kde="DialogPortal",[Vpn,oZe]=tZe(kde,{forceMount:void 0}),sZe=n=>{const{__scopeDialog:e,forceMount:t,children:r,container:i}=n,a=E4(kde,e);return Ye.jsx(Vpn,{scope:e,forceMount:t,children:it.Children.map(r,o=>Ye.jsx($4,{present:t||a.open,children:Ye.jsx(Que,{asChild:!0,container:i,children:o})}))})};sZe.displayName=kde;var Mj="DialogOverlay",lZe=it.forwardRef((n,e)=>{const t=oZe(Mj,n.__scopeDialog),{forceMount:r=t.forceMount,...i}=n,a=E4(Mj,n.__scopeDialog);return a.modal?Ye.jsx($4,{present:r||a.open,children:Ye.jsx(Gpn,{...i,ref:e})}):null});lZe.displayName=Mj;var $pn=lE("DialogOverlay.RemoveScroll"),Gpn=it.forwardRef((n,e)=>{const{__scopeDialog:t,...r}=n,i=E4(Mj,t);return Ye.jsx(rfe,{as:$pn,allowPinchZoom:!0,shards:[i.contentRef],children:Ye.jsx(w9.div,{"data-state":Fde(i.open),...r,ref:e,style:{pointerEvents:"auto",...r.style}})})}),bw="DialogContent",cZe=it.forwardRef((n,e)=>{const t=oZe(bw,n.__scopeDialog),{forceMount:r=t.forceMount,...i}=n,a=E4(bw,n.__scopeDialog);return Ye.jsx($4,{present:r||a.open,children:a.modal?Ye.jsx(qpn,{...i,ref:e}):Ye.jsx(Ypn,{...i,ref:e})})});cZe.displayName=bw;var qpn=it.forwardRef((n,e)=>{const t=E4(bw,n.__scopeDialog),r=it.useRef(null),i=nx(e,t.contentRef,r);return it.useEffect(()=>{const a=r.current;if(a)return SGe(a)},[]),Ye.jsx(uZe,{...n,ref:i,trapFocus:t.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Pp(n.onCloseAutoFocus,a=>{var o;a.preventDefault(),(o=t.triggerRef.current)==null||o.focus()}),onPointerDownOutside:Pp(n.onPointerDownOutside,a=>{const o=a.detail.originalEvent,s=o.button===0&&o.ctrlKey===!0;(o.button===2||s)&&a.preventDefault()}),onFocusOutside:Pp(n.onFocusOutside,a=>a.preventDefault())})}),Ypn=it.forwardRef((n,e)=>{const t=E4(bw,n.__scopeDialog),r=it.useRef(!1),i=it.useRef(!1);return Ye.jsx(uZe,{...n,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var o,s;(o=n.onCloseAutoFocus)==null||o.call(n,a),a.defaultPrevented||(r.current||(s=t.triggerRef.current)==null||s.focus(),a.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:a=>{var l,c;(l=n.onInteractOutside)==null||l.call(n,a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const o=a.target;((c=t.triggerRef.current)==null?void 0:c.contains(o))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&i.current&&a.preventDefault()}})}),uZe=it.forwardRef((n,e)=>{const{__scopeDialog:t,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=n,s=E4(bw,t),l=it.useRef(null),c=nx(e,l);return k$e(),Ye.jsxs(Ye.Fragment,{children:[Ye.jsx(Uue,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:Ye.jsx(Due,{role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":Fde(s.open),...o,ref:c,onDismiss:()=>s.onOpenChange(!1)})}),Ye.jsxs(Ye.Fragment,{children:[Ye.jsx(Wpn,{titleId:s.titleId}),Ye.jsx(Qpn,{contentRef:l,descriptionId:s.descriptionId})]})]})}),Ide="DialogTitle",fZe=it.forwardRef((n,e)=>{const{__scopeDialog:t,...r}=n,i=E4(Ide,t);return Ye.jsx(w9.h2,{id:i.titleId,...r,ref:e})});fZe.displayName=Ide;var dZe="DialogDescription",pZe=it.forwardRef((n,e)=>{const{__scopeDialog:t,...r}=n,i=E4(dZe,t);return Ye.jsx(w9.p,{id:i.descriptionId,...r,ref:e})});pZe.displayName=dZe;var hZe="DialogClose",mZe=it.forwardRef((n,e)=>{const{__scopeDialog:t,...r}=n,i=E4(hZe,t);return Ye.jsx(w9.button,{type:"button",...r,ref:e,onClick:Pp(n.onClick,()=>i.onOpenChange(!1))})});mZe.displayName=hZe;function Fde(n){return n?"open":"closed"}var vZe="DialogTitleWarning",[Xpn,yZe]=d9t(vZe,{contentName:bw,titleName:Ide,docsSlug:"dialog"}),Wpn=({titleId:n})=>{const e=yZe(vZe),t=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users.
13426
13426
 
13427
13427
  If you want to hide the \`${e.titleName}\`, you can wrap it with our VisuallyHidden component.
13428
13428
 
@@ -13606,13 +13606,13 @@ to {
13606
13606
  * @license
13607
13607
  * Copyright 2019 Google LLC
13608
13608
  * SPDX-License-Identifier: Apache-2.0
13609
- */const rQe=Symbol("Comlink.proxy"),Wmn=Symbol("Comlink.endpoint"),iQe=Symbol("Comlink.releaseProxy"),n0e=Symbol("Comlink.finalizer"),Vj=Symbol("Comlink.thrown"),aQe=n=>typeof n=="object"&&n!==null||typeof n=="function",Zmn={canHandle:n=>aQe(n)&&n[rQe],serialize(n){const{port1:e,port2:t}=new MessageChannel;return sQe(n,e),[t,[t]]},deserialize(n){return n.start(),cQe(n)}},Qmn={canHandle:n=>aQe(n)&&Vj in n,serialize({value:n}){let e;return n instanceof Error?e={isError:!0,value:{message:n.message,name:n.name,stack:n.stack}}:e={isError:!1,value:n},[e,[]]},deserialize(n){throw n.isError?Object.assign(new Error(n.value.message),n.value):n.value}},oQe=new Map([["proxy",Zmn],["throw",Qmn]]);function Kmn(n,e){for(const t of n)if(e===t||t==="*"||t instanceof RegExp&&t.test(e))return!0;return!1}function sQe(n,e=globalThis,t=["*"]){e.addEventListener("message",function r(i){if(!i||!i.data)return;if(!Kmn(t,i.origin)){console.warn(`Invalid origin '${i.origin}' for comlink proxy`);return}const{id:a,type:o,path:s}=Object.assign({path:[]},i.data),l=(i.data.argumentList||[]).map(Tw);let c;try{const u=s.slice(0,-1).reduce((d,v)=>d[v],n),f=s.reduce((d,v)=>d[v],n);switch(o){case"GET":c=f;break;case"SET":u[s.slice(-1)[0]]=Tw(i.data.value),c=!0;break;case"APPLY":c=f.apply(u,l);break;case"CONSTRUCT":{const d=new f(...l);c=pQe(d)}break;case"ENDPOINT":{const{port1:d,port2:v}=new MessageChannel;sQe(n,v),c=r1n(d,[d])}break;case"RELEASE":c=void 0;break;default:return}}catch(u){c={value:u,[Vj]:0}}Promise.resolve(c).catch(u=>({value:u,[Vj]:0})).then(u=>{const[f,d]=Yj(u);e.postMessage(Object.assign(Object.assign({},f),{id:a}),d),o==="RELEASE"&&(e.removeEventListener("message",r),lQe(e),n0e in n&&typeof n[n0e]=="function"&&n[n0e]())}).catch(u=>{const[f,d]=Yj({value:new TypeError("Unserializable return value"),[Vj]:0});e.postMessage(Object.assign(Object.assign({},f),{id:a}),d)})}),e.start&&e.start()}function Jmn(n){return n.constructor.name==="MessagePort"}function lQe(n){Jmn(n)&&n.close()}function cQe(n,e){const t=new Map;return n.addEventListener("message",function(i){const{data:a}=i;if(!a||!a.id)return;const o=t.get(a.id);if(o)try{o(a)}finally{t.delete(a.id)}}),r0e(n,t,[],e)}function $j(n){if(n)throw new Error("Proxy has been released and is not useable")}function uQe(n){return lM(n,new Map,{type:"RELEASE"}).then(()=>{lQe(n)})}const Gj=new WeakMap,qj="FinalizationRegistry"in globalThis&&new FinalizationRegistry(n=>{const e=(Gj.get(n)||0)-1;Gj.set(n,e),e===0&&uQe(n)});function e1n(n,e){const t=(Gj.get(e)||0)+1;Gj.set(e,t),qj&&qj.register(n,e,n)}function t1n(n){qj&&qj.unregister(n)}function r0e(n,e,t=[],r=function(){}){let i=!1;const a=new Proxy(r,{get(o,s){if($j(i),s===iQe)return()=>{t1n(a),uQe(n),e.clear(),i=!0};if(s==="then"){if(t.length===0)return{then:()=>a};const l=lM(n,e,{type:"GET",path:t.map(c=>c.toString())}).then(Tw);return l.then.bind(l)}return r0e(n,e,[...t,s])},set(o,s,l){$j(i);const[c,u]=Yj(l);return lM(n,e,{type:"SET",path:[...t,s].map(f=>f.toString()),value:c},u).then(Tw)},apply(o,s,l){$j(i);const c=t[t.length-1];if(c===Wmn)return lM(n,e,{type:"ENDPOINT"}).then(Tw);if(c==="bind")return r0e(n,e,t.slice(0,-1));const[u,f]=fQe(l);return lM(n,e,{type:"APPLY",path:t.map(d=>d.toString()),argumentList:u},f).then(Tw)},construct(o,s){$j(i);const[l,c]=fQe(s);return lM(n,e,{type:"CONSTRUCT",path:t.map(u=>u.toString()),argumentList:l},c).then(Tw)}});return e1n(a,n),a}function n1n(n){return Array.prototype.concat.apply([],n)}function fQe(n){const e=n.map(Yj);return[e.map(t=>t[0]),n1n(e.map(t=>t[1]))]}const dQe=new WeakMap;function r1n(n,e){return dQe.set(n,e),n}function pQe(n){return Object.assign(n,{[rQe]:!0})}function Yj(n){for(const[e,t]of oQe)if(t.canHandle(n)){const[r,i]=t.serialize(n);return[{type:"HANDLER",name:e,value:r},i]}return[{type:"RAW",value:n},dQe.get(n)||[]]}function Tw(n){switch(n.type){case"HANDLER":return oQe.get(n.name).deserialize(n.value);case"RAW":return n.value}}function lM(n,e,t,r){return new Promise(i=>{const a=i1n();e.set(a,i),n.start&&n.start(),n.postMessage(Object.assign({id:a},t),r)})}function i1n(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}var a1n=async n=>{console.log("[Worker] Creating circuit web worker with config:",n);let e=n.webWorkerBlobUrl??n.webWorkerUrl;if(!e){const o=`https://cdn.jsdelivr.net/npm/@tscircuit/eval@${n.evalVersion??"latest"}/dist/webworker/entrypoint.js`,s=await fetch(o).then(l=>l.blob());e=URL.createObjectURL(s)}const t=new Worker(e,{type:"module"}),r=cQe(t);n.snippetsApiBaseUrl&&await r.setSnippetsApiBaseUrl(n.snippetsApiBaseUrl);let i=!1;return{clearEventListeners:r.clearEventListeners.bind(r),execute:async(...o)=>{if(i)throw new Error("CircuitWebWorker was terminated, can't execute");return r.execute.bind(r)(...o)},executeWithFsMap:async(...o)=>{if(i)throw new Error("CircuitWebWorker was terminated, can't executeWithFsMap");return r.executeWithFsMap.bind(r)(...o)},renderUntilSettled:r.renderUntilSettled.bind(r),getCircuitJson:r.getCircuitJson.bind(r),on:(o,s)=>{const l=pQe(s);r.on(o,l)},kill:async()=>{r[iQe](),t.terminate(),i=!0}}};const hQe=n=>{const e={};if(!n)return e;for(const r of s3)e[r]=0;const t=new Map;for(const r of n){const[,,i,a]=r.type.split(":");if(a==="start"){t.set(`${i}:${r.renderId}`,r);continue}if(a==="end"){const o=t.get(`${i}:${r.renderId}`);if(o){const s=r.createdAt-o.createdAt;e[i]=(e[i]||0)+s}}}return e},o1n=(n,e)=>{const t={};for(const[r,i]of n.entries()){const a=e.get(r);a!==i&&(t[r]={old:i,new:a})}for(const[r,i]of e.entries())n.has(r)||(t[r]={old:void 0,new:i});return t},mQe=X_e()(W_e(n=>({lastRunEvalVersion:void 0,setLastRunEvalVersion:e=>{n({lastRunEvalVersion:e})}}),{name:"runframe-runner-store"}));function s1n(){const n=it.useRef(Promise.resolve()),e=it.useRef(!1),t=it.useCallback(async i=>{await n.current;let a;const o=new Promise(s=>{a=s});try{return n.current=o,e.current=!0,await i()}finally{e.current=!1,a()}},[]),r=it.useCallback(()=>e.current,[]);return{runWithMutex:t,isLocked:r}}const l1n=26,z6=Ay("run-frame:RunFrame"),c1n=n=>{const[e,t]=i4(X=>[X.circuitJson,X.setCircuitJson]),[r,i]=it.useState(null),[a,o]=it.useState(null),[s,l]=it.useReducer((X,ue)=>X+1,0),c=mQe(X=>X.setLastRunEvalVersion),u=it.useRef(0),f=s1n(),[d,v]=it.useState(!1);it.useEffect(()=>{const X=ue=>{(ue.ctrlKey||ue.metaKey)&&ue.key==="Enter"&&!d&&l(1)};return window.addEventListener("keydown",X),()=>window.removeEventListener("keydown",X)},[d]);const[y,w]=it.useState(null),[b,S]=it.useState({}),[R,D]=it.useState(n.defaultActiveTab??"pcb");it.useEffect(()=>{n.debug&&Ay.enable("run-frame*")},[n.debug]);const k=n.fsMap instanceof Map?n.fsMap:Object.entries(n.fsMap??{}).reduce((X,[ue,pe])=>X.set(ue,pe),new Map),G=it.useRef(null),q=it.useRef(null);it.useEffect(()=>{const X=k instanceof Map?Object.fromEntries(k.entries()):k;if(!X||Object.keys(X).length===0){i({error:"No files provided. Please provide at least one file with code to execute.",stack:""}),v(!1);return}const ue=n.showRunButton&&s!==u.current;if(G.current&&e){const de=o1n(G.current,k);if(Object.keys(de).length>0)z6("code changes detected");else if(q.current!==n.entrypoint)z6("render triggered by entrypoint change");else if(!ue){z6("render triggered without changes to fsMap, skipping");return}}if(n.showRunButton&&s===u.current)return;G.current=k,q.current=n.entrypoint??null,u.current=s,v(!0);const pe=async()=>{var Ae,Ge,Ke,ut,mt,Pt;z6("running render worker"),i(null);const de={progress:0};let we=n.evalVersion??"latest";if(!globalThis.runFrameWorker&&n.forceLatestEvalVersion)try{const Bt=await fetch("https://data.jsdelivr.com/v1/package/npm/@tscircuit/eval");if(Bt.ok){const Qt=await Bt.json();(Ae=Qt.tags)!=null&&Ae.latest&&(we=Qt.tags.latest,c(we))}}catch{}const he=globalThis.runFrameWorker??await a1n({evalVersion:we,webWorkerBlobUrl:n.evalWebWorkerBlobUrl,verbose:!0});globalThis.runFrameWorker=he,(Ge=n.onRenderStarted)==null||Ge.call(n);const ge=k instanceof Map?Object.fromEntries(k.entries()):k,Te=new Set;let be=Date.now();if(he.on("autorouting:start",Bt=>{S({...b,[Bt.componentDisplayName]:{simpleRouteJson:Bt.simpleRouteJson}})}),he.on("renderable:renderLifecycle:anyEvent",Bt=>{de.lastRenderEvent=Bt,de.eventsProcessed=(de.eventsProcessed??0)+1,Te.has(Bt.renderId)||Te.add(Bt.renderId);const Qt=Te.size*l1n*2,Sn=de.eventsProcessed>Te.size*2,cn=de.eventsProcessed/Qt,un=1-Math.exp(-cn*3);de.progress=Sn?un:(1-Math.exp(-(de.eventsProcessed??0)/1e3))*.05,R==="render_log"&&(de.renderEvents=de.renderEvents??[],Bt.createdAt=Date.now(),de.renderEvents.push(Bt),Date.now()-be>500&&(de.phaseTimings=hQe(de.renderEvents??[]),be=Date.now())),w({...de})}),he.on("autorouting:progress",Bt=>{o(Bt.debugGraphics)}),!(await he.executeWithFsMap({entrypoint:n.entrypoint,fsMap:ge}).then(()=>({success:!0})).catch(Bt=>{var Sn;const Qt=Bt.message.replace("Error: ","");return(Sn=n.onError)==null||Sn.call(n,Bt),i({error:Qt,stack:Bt.stack}),console.error(Bt),{success:!1}})).success){v(!1);return}const Ne=he.renderUntilSettled();z6("waiting for initial circuit json...");let Ie=await he.getCircuitJson().catch(Bt=>{var Qt;return z6("error getting initial circuit json",Bt),(Qt=n.onError)==null||Qt.call(n,Bt),i({error:Bt.message,stack:Bt.stack}),v(!1),null});Ie&&(z6("got initial circuit json"),t(Ie),(Ke=n.onCircuitJsonChange)==null||Ke.call(n,Ie),(ut=n.onInitialRender)==null||ut.call(n,{circuitJson:Ie}),await Ne,z6("getting final circuit json"),Ie=await he.getCircuitJson(),(mt=n.onCircuitJsonChange)==null||mt.call(n,Ie),t(Ie),(Pt=n.onRenderFinished)==null||Pt.call(n,{circuitJson:Ie}),o({}),R==="render_log"&&(de.phaseTimings=hQe(de.renderEvents??[])),de.progress=1,w({...de}),v(!1))};f.runWithMutex(pe)},[n.fsMap,n.entrypoint,s,n.evalVersion]);const Z=it.useRef(null),Y=it.useRef(null),ee=X=>{if(!X||X===null){console.warn("[RunFrame] handleEditEvent received null or undefined event.");return}X.in_progress?(Z.current=X,Y.current&&(clearTimeout(Y.current),Y.current=null)):(Y.current&&clearTimeout(Y.current),Y.current=setTimeout(()=>{var pe;const ue=X||Z.current;(pe=n.onEditEvent)==null||pe.call(n,ue),Z.current=null,Y.current=null},100))};return Ye.jsx(jpn,{defaultActiveTab:n.defaultActiveTab,showToggleFullScreen:n.showToggleFullScreen,autoroutingGraphics:a,autoroutingLog:b,onReportAutoroutingLog:n.onReportAutoroutingLog,leftHeaderContent:Ye.jsxs(Ye.Fragment,{children:[n.showRunButton&&Ye.jsxs("div",{className:"rf-relative rf-inline-flex",children:[Ye.jsxs("button",{type:"button",onClick:()=>{l(1)},className:"rf-flex rf-items-center rf-gap-2 rf-px-4 rf-py-2 rf-bg-blue-600 hover:rf-bg-blue-700 rf-text-white rf-rounded-md disabled:rf-opacity-50 transition-colors duration-200",disabled:d,children:["Run"," ",d?Ye.jsx(WT,{className:"rf-w-3 rf-h-3 rf-animate-spin"}):Ye.jsx(g$e,{className:"rf-w-3 rf-h-3"})]}),d&&Ye.jsx("div",{className:"rf-flex rf-items-center rf-ml-1",children:Ye.jsx(rb,{onClick:X=>{X.stopPropagation(),v(!1),globalThis.runFrameWorker&&(globalThis.runFrameWorker.kill(),globalThis.runFrameWorker=null)},variant:"ghost",size:"icon",className:"rf-text-red-300 hover:rf-text-red-400 hover:!rf-bg-transparent [&>svg]:rf-text-red-300 [&>svg]:hover:rf-text-red-400 rf-flex rf-items-center rf-justify-center",children:Ye.jsx(min,{className:"!rf-h-2.5 !rf-w-2.5",fill:"currentColor",stroke:"currentColor"})})})]}),n.leftHeaderContent]}),onActiveTabChange:D,circuitJson:e,renderLog:y,isRunningCode:d,errorMessage:r==null?void 0:r.error,onEditEvent:ee,editEvents:n.editEvents,defaultToFullScreen:n.defaultToFullScreen})};function u1n(n,e){const[t,r]=it.useState(()=>{try{const i=window.localStorage.getItem(n);return i?JSON.parse(i):e}catch(i){return console.error("Error reading from localStorage:",i),e}});return it.useEffect(()=>{try{window.localStorage.setItem(n,JSON.stringify(t))}catch(i){console.error("Error writing to localStorage:",i)}},[n,t]),[t,r]}const f1n=({snippetNames:n,onSelect:e,onCancel:t,isOpen:r})=>{const[i,a]=it.useState(""),[o,s]=it.useState("");if(!r)return null;const l=n.filter(f=>f.toLowerCase().includes(o.toLowerCase())),c=o&&!n.includes(o),u=f=>{f.key==="Enter"&&(l.length===1?a(l[0]):c&&a(o))};return Ye.jsx("div",{className:"rf-fixed rf-inset-0 rf-bg-black rf-bg-opacity-50 rf-flex rf-items-center rf-justify-center rf-z-[100]",children:Ye.jsxs("div",{className:"rf-bg-white rf-rounded-lg rf-p-6 rf-w-96",children:[Ye.jsx("h2",{className:"rf-text-lg rf-font-semibold rf-mb-4",children:"Select Snippet"}),Ye.jsx("input",{type:"text",className:"rf-w-full rf-px-4 rf-py-2 rf-border rf-rounded rf-mb-4",placeholder:"Search snippets or new snippet name...",value:o,onChange:f=>s(f.target.value),onKeyDown:u}),Ye.jsxs("div",{className:"rf-h-60 rf-overflow-y-auto",children:[l.map(f=>Ye.jsx("button",{type:"button",className:`w-full text-left px-4 py-2 rounded hover:bg-gray-100 ${i===f?"bg-blue-50":""}`,onClick:()=>a(f),children:f},f)),c&&Ye.jsxs("button",{type:"button",className:`w-full text-left px-4 py-2 rounded hover:bg-gray-100 text-blue-500 ${i===o?"bg-blue-50":""}`,onClick:()=>a(o),children:['Create new "',o,'"']})]}),Ye.jsxs("div",{className:"rf-mt-4 rf-flex rf-justify-end rf-gap-2",children:[Ye.jsx("button",{type:"button",className:"rf-px-4 rf-py-2 rf-text-gray-600 rf-hover:text-gray-800",onClick:t,children:"Cancel"}),Ye.jsx("button",{type:"button",className:"rf-px-4 rf-py-2 rf-bg-blue-500 rf-text-white rf-rounded rf-hover:bg-blue-600 rf-disabled:opacity-50",onClick:()=>i&&e(i),disabled:!i,children:i===o?`Create "${i}"`:`Save to ${i}`})]})]})})},d1n=n=>{const e=it.useRef(null),t=i4(r=>r.recentEvents);it.useEffect(()=>{if(t.length===0)return;const r=t[0];r.event_id!==e.current&&(n(r),e.current=r.event_id)},[t,n])};var vQe="AlertDialog",[p1n,Ibn]=BS(vQe,[nZe]),E8=nZe(),yQe=n=>{const{__scopeAlertDialog:e,...t}=n,r=E8(e);return Ye.jsx(gZe,{...r,...t,modal:!0})};yQe.displayName=vQe;var h1n="AlertDialogTrigger",m1n=it.forwardRef((n,e)=>{const{__scopeAlertDialog:t,...r}=n,i=E8(t);return Ye.jsx(Kpn,{...i,...r,ref:e})});m1n.displayName=h1n;var v1n="AlertDialogPortal",gQe=n=>{const{__scopeAlertDialog:e,...t}=n,r=E8(e);return Ye.jsx(_Ze,{...r,...t})};gQe.displayName=v1n;var y1n="AlertDialogOverlay",_Qe=it.forwardRef((n,e)=>{const{__scopeAlertDialog:t,...r}=n,i=E8(t);return Ye.jsx(Bde,{...i,...r,ref:e})});_Qe.displayName=y1n;var cM="AlertDialogContent",[g1n,_1n]=p1n(cM),x1n=v9t("AlertDialogContent"),xQe=it.forwardRef((n,e)=>{const{__scopeAlertDialog:t,children:r,...i}=n,a=E8(t),o=it.useRef(null),s=nx(e,o),l=it.useRef(null);return Ye.jsx(Xpn,{contentName:cM,titleName:bQe,docsSlug:"alert-dialog",children:Ye.jsx(g1n,{scope:t,cancelRef:l,children:Ye.jsxs(jde,{role:"alertdialog",...a,...i,ref:s,onOpenAutoFocus:Pp(i.onOpenAutoFocus,c=>{var u;c.preventDefault(),(u=l.current)==null||u.focus({preventScroll:!0})}),onPointerDownOutside:c=>c.preventDefault(),onInteractOutside:c=>c.preventDefault(),children:[Ye.jsx(x1n,{children:r}),Ye.jsx(S1n,{contentRef:o})]})})})});xQe.displayName=cM;var bQe="AlertDialogTitle",SQe=it.forwardRef((n,e)=>{const{__scopeAlertDialog:t,...r}=n,i=E8(t);return Ye.jsx(Hde,{...i,...r,ref:e})});SQe.displayName=bQe;var wQe="AlertDialogDescription",EQe=it.forwardRef((n,e)=>{const{__scopeAlertDialog:t,...r}=n,i=E8(t);return Ye.jsx(Vde,{...i,...r,ref:e})});EQe.displayName=wQe;var b1n="AlertDialogAction",TQe=it.forwardRef((n,e)=>{const{__scopeAlertDialog:t,...r}=n,i=E8(t);return Ye.jsx(xZe,{...i,...r,ref:e})});TQe.displayName=b1n;var MQe="AlertDialogCancel",CQe=it.forwardRef((n,e)=>{const{__scopeAlertDialog:t,...r}=n,{cancelRef:i}=_1n(MQe,t),a=E8(t),o=nx(e,i);return Ye.jsx(xZe,{...a,...r,ref:o})});CQe.displayName=MQe;var S1n=({contentRef:n})=>{const e=`\`${cM}\` requires a description for the component to be accessible for screen reader users.
13609
+ */const rQe=Symbol("Comlink.proxy"),Wmn=Symbol("Comlink.endpoint"),iQe=Symbol("Comlink.releaseProxy"),n0e=Symbol("Comlink.finalizer"),Vj=Symbol("Comlink.thrown"),aQe=n=>typeof n=="object"&&n!==null||typeof n=="function",Zmn={canHandle:n=>aQe(n)&&n[rQe],serialize(n){const{port1:e,port2:t}=new MessageChannel;return sQe(n,e),[t,[t]]},deserialize(n){return n.start(),cQe(n)}},Qmn={canHandle:n=>aQe(n)&&Vj in n,serialize({value:n}){let e;return n instanceof Error?e={isError:!0,value:{message:n.message,name:n.name,stack:n.stack}}:e={isError:!1,value:n},[e,[]]},deserialize(n){throw n.isError?Object.assign(new Error(n.value.message),n.value):n.value}},oQe=new Map([["proxy",Zmn],["throw",Qmn]]);function Kmn(n,e){for(const t of n)if(e===t||t==="*"||t instanceof RegExp&&t.test(e))return!0;return!1}function sQe(n,e=globalThis,t=["*"]){e.addEventListener("message",function r(i){if(!i||!i.data)return;if(!Kmn(t,i.origin)){console.warn(`Invalid origin '${i.origin}' for comlink proxy`);return}const{id:a,type:o,path:s}=Object.assign({path:[]},i.data),l=(i.data.argumentList||[]).map(Tw);let c;try{const u=s.slice(0,-1).reduce((d,v)=>d[v],n),f=s.reduce((d,v)=>d[v],n);switch(o){case"GET":c=f;break;case"SET":u[s.slice(-1)[0]]=Tw(i.data.value),c=!0;break;case"APPLY":c=f.apply(u,l);break;case"CONSTRUCT":{const d=new f(...l);c=pQe(d)}break;case"ENDPOINT":{const{port1:d,port2:v}=new MessageChannel;sQe(n,v),c=r1n(d,[d])}break;case"RELEASE":c=void 0;break;default:return}}catch(u){c={value:u,[Vj]:0}}Promise.resolve(c).catch(u=>({value:u,[Vj]:0})).then(u=>{const[f,d]=Yj(u);e.postMessage(Object.assign(Object.assign({},f),{id:a}),d),o==="RELEASE"&&(e.removeEventListener("message",r),lQe(e),n0e in n&&typeof n[n0e]=="function"&&n[n0e]())}).catch(u=>{const[f,d]=Yj({value:new TypeError("Unserializable return value"),[Vj]:0});e.postMessage(Object.assign(Object.assign({},f),{id:a}),d)})}),e.start&&e.start()}function Jmn(n){return n.constructor.name==="MessagePort"}function lQe(n){Jmn(n)&&n.close()}function cQe(n,e){const t=new Map;return n.addEventListener("message",function(i){const{data:a}=i;if(!a||!a.id)return;const o=t.get(a.id);if(o)try{o(a)}finally{t.delete(a.id)}}),r0e(n,t,[],e)}function $j(n){if(n)throw new Error("Proxy has been released and is not useable")}function uQe(n){return lM(n,new Map,{type:"RELEASE"}).then(()=>{lQe(n)})}const Gj=new WeakMap,qj="FinalizationRegistry"in globalThis&&new FinalizationRegistry(n=>{const e=(Gj.get(n)||0)-1;Gj.set(n,e),e===0&&uQe(n)});function e1n(n,e){const t=(Gj.get(e)||0)+1;Gj.set(e,t),qj&&qj.register(n,e,n)}function t1n(n){qj&&qj.unregister(n)}function r0e(n,e,t=[],r=function(){}){let i=!1;const a=new Proxy(r,{get(o,s){if($j(i),s===iQe)return()=>{t1n(a),uQe(n),e.clear(),i=!0};if(s==="then"){if(t.length===0)return{then:()=>a};const l=lM(n,e,{type:"GET",path:t.map(c=>c.toString())}).then(Tw);return l.then.bind(l)}return r0e(n,e,[...t,s])},set(o,s,l){$j(i);const[c,u]=Yj(l);return lM(n,e,{type:"SET",path:[...t,s].map(f=>f.toString()),value:c},u).then(Tw)},apply(o,s,l){$j(i);const c=t[t.length-1];if(c===Wmn)return lM(n,e,{type:"ENDPOINT"}).then(Tw);if(c==="bind")return r0e(n,e,t.slice(0,-1));const[u,f]=fQe(l);return lM(n,e,{type:"APPLY",path:t.map(d=>d.toString()),argumentList:u},f).then(Tw)},construct(o,s){$j(i);const[l,c]=fQe(s);return lM(n,e,{type:"CONSTRUCT",path:t.map(u=>u.toString()),argumentList:l},c).then(Tw)}});return e1n(a,n),a}function n1n(n){return Array.prototype.concat.apply([],n)}function fQe(n){const e=n.map(Yj);return[e.map(t=>t[0]),n1n(e.map(t=>t[1]))]}const dQe=new WeakMap;function r1n(n,e){return dQe.set(n,e),n}function pQe(n){return Object.assign(n,{[rQe]:!0})}function Yj(n){for(const[e,t]of oQe)if(t.canHandle(n)){const[r,i]=t.serialize(n);return[{type:"HANDLER",name:e,value:r},i]}return[{type:"RAW",value:n},dQe.get(n)||[]]}function Tw(n){switch(n.type){case"HANDLER":return oQe.get(n.name).deserialize(n.value);case"RAW":return n.value}}function lM(n,e,t,r){return new Promise(i=>{const a=i1n();e.set(a,i),n.start&&n.start(),n.postMessage(Object.assign({id:a},t),r)})}function i1n(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}var a1n=async n=>{console.log("[Worker] Creating circuit web worker with config:",n);let e=n.webWorkerBlobUrl??n.webWorkerUrl;if(!e){const o=`https://cdn.jsdelivr.net/npm/@tscircuit/eval@${n.evalVersion??"latest"}/dist/webworker/entrypoint.js`,s=await fetch(o).then(l=>l.blob());e=URL.createObjectURL(s)}const t=new Worker(e,{type:"module"}),r=cQe(t);n.snippetsApiBaseUrl&&await r.setSnippetsApiBaseUrl(n.snippetsApiBaseUrl);let i=!1;return{clearEventListeners:r.clearEventListeners.bind(r),execute:async(...o)=>{if(i)throw new Error("CircuitWebWorker was terminated, can't execute");return r.execute.bind(r)(...o)},executeWithFsMap:async(...o)=>{if(i)throw new Error("CircuitWebWorker was terminated, can't executeWithFsMap");return r.executeWithFsMap.bind(r)(...o)},renderUntilSettled:r.renderUntilSettled.bind(r),getCircuitJson:r.getCircuitJson.bind(r),on:(o,s)=>{const l=pQe(s);r.on(o,l)},kill:async()=>{r[iQe](),t.terminate(),i=!0}}};const hQe=n=>{const e={};if(!n)return e;for(const r of s3)e[r]=0;const t=new Map;for(const r of n){const[,,i,a]=r.type.split(":");if(a==="start"){t.set(`${i}:${r.renderId}`,r);continue}if(a==="end"){const o=t.get(`${i}:${r.renderId}`);if(o){const s=r.createdAt-o.createdAt;e[i]=(e[i]||0)+s}}}return e},o1n=(n,e)=>{const t={};for(const[r,i]of n.entries()){const a=e.get(r);a!==i&&(t[r]={old:i,new:a})}for(const[r,i]of e.entries())n.has(r)||(t[r]={old:void 0,new:i});return t},mQe=X_e()(W_e(n=>({lastRunEvalVersion:void 0,setLastRunEvalVersion:e=>{n({lastRunEvalVersion:e})}}),{name:"runframe-runner-store"}));function s1n(){const n=it.useRef(Promise.resolve()),e=it.useRef(!1),t=it.useCallback(async i=>{await n.current;let a;const o=new Promise(s=>{a=s});try{return n.current=o,e.current=!0,await i()}finally{e.current=!1,a()}},[]),r=it.useCallback(()=>e.current,[]);return{runWithMutex:t,isLocked:r}}const l1n=26,z6=Ay("run-frame:RunFrame"),c1n=n=>{const[e,t]=i4(X=>[X.circuitJson,X.setCircuitJson]),[r,i]=it.useState(null),[a,o]=it.useState(null),[s,l]=it.useReducer((X,ue)=>X+1,0),c=mQe(X=>X.setLastRunEvalVersion),u=it.useRef(0),f=s1n(),[d,v]=it.useState(!1);it.useEffect(()=>{const X=ue=>{(ue.ctrlKey||ue.metaKey)&&ue.key==="Enter"&&!d&&l(1)};return window.addEventListener("keydown",X),()=>window.removeEventListener("keydown",X)},[d]);const[y,w]=it.useState(null),[b,S]=it.useState({}),[R,D]=it.useState(n.defaultActiveTab??"pcb");it.useEffect(()=>{n.debug&&Ay.enable("run-frame*")},[n.debug]);const k=n.fsMap instanceof Map?n.fsMap:Object.entries(n.fsMap??{}).reduce((X,[ue,pe])=>X.set(ue,pe),new Map),G=it.useRef(null),q=it.useRef(null);it.useEffect(()=>{const X=k instanceof Map?Object.fromEntries(k.entries()):k;if(!X||Object.keys(X).length===0){i({error:"No files provided. Please provide at least one file with code to execute.",stack:""}),v(!1);return}const ue=n.showRunButton&&s!==u.current;if(G.current&&e){const de=o1n(G.current,k);if(Object.keys(de).length>0)z6("code changes detected");else if(q.current!==n.entrypoint)z6("render triggered by entrypoint change");else if(!ue){z6("render triggered without changes to fsMap, skipping");return}}if(n.showRunButton&&s===u.current)return;G.current=k,q.current=n.entrypoint??null,u.current=s,v(!0);const pe=async()=>{var Ae,Ge,Ke,ut,mt,Pt;z6("running render worker"),i(null);const de={progress:0};let we=n.evalVersion??"latest";if(!globalThis.runFrameWorker&&n.forceLatestEvalVersion)try{const Bt=await fetch("https://data.jsdelivr.com/v1/package/npm/@tscircuit/eval");if(Bt.ok){const Qt=await Bt.json();(Ae=Qt.tags)!=null&&Ae.latest&&(we=Qt.tags.latest,c(we))}}catch{}const he=globalThis.runFrameWorker??await a1n({evalVersion:we,webWorkerBlobUrl:n.evalWebWorkerBlobUrl,verbose:!0});globalThis.runFrameWorker=he,(Ge=n.onRenderStarted)==null||Ge.call(n);const ge=k instanceof Map?Object.fromEntries(k.entries()):k,Te=new Set;let be=Date.now();if(he.on("autorouting:start",Bt=>{S({...b,[Bt.componentDisplayName]:{simpleRouteJson:Bt.simpleRouteJson}})}),he.on("renderable:renderLifecycle:anyEvent",Bt=>{de.lastRenderEvent=Bt,de.eventsProcessed=(de.eventsProcessed??0)+1,Te.has(Bt.renderId)||Te.add(Bt.renderId);const Qt=Te.size*l1n*2,Sn=de.eventsProcessed>Te.size*2,cn=de.eventsProcessed/Qt,un=1-Math.exp(-cn*3);de.progress=Sn?un:(1-Math.exp(-(de.eventsProcessed??0)/1e3))*.05,R==="render_log"&&(de.renderEvents=de.renderEvents??[],Bt.createdAt=Date.now(),de.renderEvents.push(Bt),Date.now()-be>500&&(de.phaseTimings=hQe(de.renderEvents??[]),be=Date.now())),w({...de})}),he.on("autorouting:progress",Bt=>{o(Bt.debugGraphics)}),!(await he.executeWithFsMap({entrypoint:n.entrypoint,fsMap:ge}).then(()=>({success:!0})).catch(Bt=>{var Sn;const Qt=Bt.message.replace("Error: ","");return(Sn=n.onError)==null||Sn.call(n,Bt),i({error:Qt,stack:Bt.stack}),console.error(Bt),{success:!1}})).success){v(!1);return}const Ne=he.renderUntilSettled();z6("waiting for initial circuit json...");let Ie=await he.getCircuitJson().catch(Bt=>{var Qt;return z6("error getting initial circuit json",Bt),(Qt=n.onError)==null||Qt.call(n,Bt),i({error:Bt.message,stack:Bt.stack}),v(!1),null});Ie&&(z6("got initial circuit json"),t(Ie),(Ke=n.onCircuitJsonChange)==null||Ke.call(n,Ie),(ut=n.onInitialRender)==null||ut.call(n,{circuitJson:Ie}),await Ne,z6("getting final circuit json"),Ie=await he.getCircuitJson(),(mt=n.onCircuitJsonChange)==null||mt.call(n,Ie),t(Ie),(Pt=n.onRenderFinished)==null||Pt.call(n,{circuitJson:Ie}),o({}),R==="render_log"&&(de.phaseTimings=hQe(de.renderEvents??[])),de.progress=1,w({...de}),v(!1))};f.runWithMutex(pe)},[n.fsMap,n.entrypoint,s,n.evalVersion]);const Z=it.useRef(null),Y=it.useRef(null),ee=X=>{if(!X||X===null){console.warn("[RunFrame] handleEditEvent received null or undefined event.");return}X.in_progress?(Z.current=X,Y.current&&(clearTimeout(Y.current),Y.current=null)):(Y.current&&clearTimeout(Y.current),Y.current=setTimeout(()=>{var pe;const ue=X||Z.current;(pe=n.onEditEvent)==null||pe.call(n,ue),Z.current=null,Y.current=null},100))};return Ye.jsx(jpn,{defaultActiveTab:n.defaultActiveTab,showToggleFullScreen:n.showToggleFullScreen,autoroutingGraphics:a,autoroutingLog:b,onReportAutoroutingLog:n.onReportAutoroutingLog,leftHeaderContent:Ye.jsxs(Ye.Fragment,{children:[n.showRunButton&&Ye.jsxs("div",{className:"rf-relative rf-inline-flex",children:[Ye.jsxs("button",{type:"button",onClick:()=>{l(1)},className:"rf-flex rf-items-center rf-gap-2 rf-px-4 rf-py-2 rf-bg-blue-600 hover:rf-bg-blue-700 rf-text-white rf-rounded-md disabled:rf-opacity-50 transition-colors duration-200",disabled:d,children:["Run"," ",d?Ye.jsx(WT,{className:"rf-w-3 rf-h-3 rf-animate-spin"}):Ye.jsx(g$e,{className:"rf-w-3 rf-h-3"})]}),d&&Ye.jsx("div",{className:"rf-flex rf-items-center rf-ml-1",children:Ye.jsx(rb,{onClick:X=>{X.stopPropagation(),v(!1),globalThis.runFrameWorker&&(globalThis.runFrameWorker.kill(),globalThis.runFrameWorker=null)},variant:"ghost",size:"icon",className:"rf-text-red-300 hover:rf-text-red-400 hover:!rf-bg-transparent [&>svg]:rf-text-red-300 [&>svg]:hover:rf-text-red-400 rf-flex rf-items-center rf-justify-center",children:Ye.jsx(min,{className:"!rf-h-2.5 !rf-w-2.5",fill:"currentColor",stroke:"currentColor"})})})]}),n.leftHeaderContent]}),onActiveTabChange:D,circuitJson:e,renderLog:y,isRunningCode:d,errorMessage:r==null?void 0:r.error,onEditEvent:ee,editEvents:n.editEvents,defaultToFullScreen:n.defaultToFullScreen})};function u1n(n,e){const[t,r]=it.useState(()=>{try{const i=window.localStorage.getItem(n);return i?JSON.parse(i):e}catch(i){return console.error("Error reading from localStorage:",i),e}});return it.useEffect(()=>{try{window.localStorage.setItem(n,JSON.stringify(t))}catch(i){console.error("Error writing to localStorage:",i)}},[n,t]),[t,r]}const f1n=({snippetNames:n,onSelect:e,onCancel:t,isOpen:r})=>{const[i,a]=it.useState(""),[o,s]=it.useState("");if(!r)return null;const l=n.filter(f=>f.toLowerCase().includes(o.toLowerCase())),c=o&&!n.includes(o),u=f=>{f.key==="Enter"&&(l.length===1?a(l[0]):c&&a(o))};return Ye.jsx("div",{className:"rf-fixed rf-inset-0 rf-bg-black rf-bg-opacity-50 rf-flex rf-items-center rf-justify-center rf-z-[100]",children:Ye.jsxs("div",{className:"rf-bg-white rf-rounded-lg rf-p-6 rf-w-96",children:[Ye.jsx("h2",{className:"rf-text-lg rf-font-semibold rf-mb-4",children:"Select Snippet"}),Ye.jsx("input",{type:"text",className:"rf-w-full rf-px-4 rf-py-2 rf-border rf-rounded rf-mb-4",placeholder:"Search snippets or new snippet name...",value:o,onChange:f=>s(f.target.value),onKeyDown:u}),Ye.jsxs("div",{className:"rf-h-60 rf-overflow-y-auto",children:[l.map(f=>Ye.jsx("button",{type:"button",className:`w-full text-left px-4 py-2 rounded hover:bg-gray-100 ${i===f?"bg-blue-50":""}`,onClick:()=>a(f),children:f},f)),c&&Ye.jsxs("button",{type:"button",className:`w-full text-left px-4 py-2 rounded hover:bg-gray-100 text-blue-500 ${i===o?"bg-blue-50":""}`,onClick:()=>a(o),children:['Create new "',o,'"']})]}),Ye.jsxs("div",{className:"rf-mt-4 rf-flex rf-justify-end rf-gap-2",children:[Ye.jsx("button",{type:"button",className:"rf-px-4 rf-py-2 rf-text-gray-600 rf-hover:text-gray-800",onClick:t,children:"Cancel"}),Ye.jsx("button",{type:"button",className:"rf-px-4 rf-py-2 rf-bg-blue-500 rf-text-white rf-rounded rf-hover:bg-blue-600 rf-disabled:opacity-50",onClick:()=>i&&e(i),disabled:!i,children:i===o?`Create "${i}"`:`Save to ${i}`})]})]})})},d1n=n=>{const e=it.useRef(null),t=i4(r=>r.recentEvents);it.useEffect(()=>{if(t.length===0)return;const r=t[0];r.event_id!==e.current&&(n(r),e.current=r.event_id)},[t,n])};var vQe="AlertDialog",[p1n,Fbn]=BS(vQe,[nZe]),E8=nZe(),yQe=n=>{const{__scopeAlertDialog:e,...t}=n,r=E8(e);return Ye.jsx(gZe,{...r,...t,modal:!0})};yQe.displayName=vQe;var h1n="AlertDialogTrigger",m1n=it.forwardRef((n,e)=>{const{__scopeAlertDialog:t,...r}=n,i=E8(t);return Ye.jsx(Kpn,{...i,...r,ref:e})});m1n.displayName=h1n;var v1n="AlertDialogPortal",gQe=n=>{const{__scopeAlertDialog:e,...t}=n,r=E8(e);return Ye.jsx(_Ze,{...r,...t})};gQe.displayName=v1n;var y1n="AlertDialogOverlay",_Qe=it.forwardRef((n,e)=>{const{__scopeAlertDialog:t,...r}=n,i=E8(t);return Ye.jsx(Bde,{...i,...r,ref:e})});_Qe.displayName=y1n;var cM="AlertDialogContent",[g1n,_1n]=p1n(cM),x1n=v9t("AlertDialogContent"),xQe=it.forwardRef((n,e)=>{const{__scopeAlertDialog:t,children:r,...i}=n,a=E8(t),o=it.useRef(null),s=nx(e,o),l=it.useRef(null);return Ye.jsx(Xpn,{contentName:cM,titleName:bQe,docsSlug:"alert-dialog",children:Ye.jsx(g1n,{scope:t,cancelRef:l,children:Ye.jsxs(jde,{role:"alertdialog",...a,...i,ref:s,onOpenAutoFocus:Pp(i.onOpenAutoFocus,c=>{var u;c.preventDefault(),(u=l.current)==null||u.focus({preventScroll:!0})}),onPointerDownOutside:c=>c.preventDefault(),onInteractOutside:c=>c.preventDefault(),children:[Ye.jsx(x1n,{children:r}),Ye.jsx(S1n,{contentRef:o})]})})})});xQe.displayName=cM;var bQe="AlertDialogTitle",SQe=it.forwardRef((n,e)=>{const{__scopeAlertDialog:t,...r}=n,i=E8(t);return Ye.jsx(Hde,{...i,...r,ref:e})});SQe.displayName=bQe;var wQe="AlertDialogDescription",EQe=it.forwardRef((n,e)=>{const{__scopeAlertDialog:t,...r}=n,i=E8(t);return Ye.jsx(Vde,{...i,...r,ref:e})});EQe.displayName=wQe;var b1n="AlertDialogAction",TQe=it.forwardRef((n,e)=>{const{__scopeAlertDialog:t,...r}=n,i=E8(t);return Ye.jsx(xZe,{...i,...r,ref:e})});TQe.displayName=b1n;var MQe="AlertDialogCancel",CQe=it.forwardRef((n,e)=>{const{__scopeAlertDialog:t,...r}=n,{cancelRef:i}=_1n(MQe,t),a=E8(t),o=nx(e,i);return Ye.jsx(xZe,{...a,...r,ref:o})});CQe.displayName=MQe;var S1n=({contentRef:n})=>{const e=`\`${cM}\` requires a description for the component to be accessible for screen reader users.
13610
13610
 
13611
13611
  You can add a description to the \`${cM}\` by passing a \`${wQe}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
13612
13612
 
13613
13613
  Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${cM}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
13614
13614
 
13615
- For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return it.useEffect(()=>{var r;document.getElementById((r=n.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(e)},[e,n]),null},w1n=yQe,E1n=gQe,RQe=_Qe,AQe=xQe,PQe=TQe,NQe=CQe,DQe=SQe,LQe=EQe;const i0e=w1n,T1n=E1n,OQe=it.forwardRef(({className:n,...e},t)=>Ye.jsx(RQe,{className:ih("rf-fixed rf-inset-0 rf-z-50 rf-bg-black/80 data-[state=open]:rf-animate-in data-[state=closed]:rf-animate-out data-[state=closed]:rf-fade-out-0 data-[state=open]:rf-fade-in-0",n),...e,ref:t}));OQe.displayName=RQe.displayName;const Xj=it.forwardRef(({className:n,...e},t)=>Ye.jsxs(T1n,{children:[Ye.jsx(OQe,{}),Ye.jsx(AQe,{ref:t,className:ih("rf-fixed rf-left-[50%] rf-top-[50%] rf-z-50 rf-grid rf-w-full rf-max-w-lg rf-translate-x-[-50%] rf-translate-y-[-50%] rf-gap-4 rf-border rf-border-zinc-200 rf-bg-white rf-p-6 rf-shadow-lg rf-duration-200 data-[state=open]:rf-animate-in data-[state=closed]:rf-animate-out data-[state=closed]:rf-fade-out-0 data-[state=open]:rf-fade-in-0 data-[state=closed]:rf-zoom-out-95 data-[state=open]:rf-zoom-in-95 data-[state=closed]:rf-slide-out-to-left-1/2 data-[state=closed]:rf-slide-out-to-top-[48%] data-[state=open]:rf-slide-in-from-left-1/2 data-[state=open]:rf-slide-in-from-top-[48%] sm:rf-rounded-lg dark:rf-border-zinc-800 dark:rf-bg-zinc-950",n),...e})]}));Xj.displayName=AQe.displayName;const Wj=({className:n,...e})=>Ye.jsx("div",{className:ih("rf-flex rf-flex-col rf-space-y-2 rf-text-center sm:rf-text-left",n),...e});Wj.displayName="AlertDialogHeader";const a0e=({className:n,...e})=>Ye.jsx("div",{className:ih("rf-flex rf-flex-col-reverse sm:rf-flex-row sm:rf-justify-end sm:rf-space-x-2",n),...e});a0e.displayName="AlertDialogFooter";const Zj=it.forwardRef(({className:n,...e},t)=>Ye.jsx(DQe,{ref:t,className:ih("rf-text-lg rf-font-semibold",n),...e}));Zj.displayName=DQe.displayName;const Qj=it.forwardRef(({className:n,...e},t)=>Ye.jsx(LQe,{ref:t,className:ih("rf-text-sm rf-text-zinc-500 dark:rf-text-zinc-400",n),...e}));Qj.displayName=LQe.displayName;const M1n=it.forwardRef(({className:n,...e},t)=>Ye.jsx(PQe,{ref:t,className:ih(Sue(),n),...e}));M1n.displayName=PQe.displayName;const o0e=it.forwardRef(({className:n,...e},t)=>Ye.jsx(NQe,{ref:t,className:ih(Sue({variant:"outline"}),"rf-mt-2 sm:rf-mt-0",n),...e}));o0e.displayName=NQe.displayName;function C1n(n){const e=it.useRef({value:n,previous:n});return it.useMemo(()=>(e.current.value!==n&&(e.current.previous=e.current.value,e.current.value=n),e.current.previous),[n])}var Kj="Checkbox",[R1n,Fbn]=BS(Kj),[A1n,P1n]=R1n(Kj),zQe=it.forwardRef((n,e)=>{const{__scopeCheckbox:t,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:l="on",onCheckedChange:c,form:u,...f}=n,[d,v]=it.useState(null),y=nx(e,k=>v(k)),w=it.useRef(!1),b=d?u||!!d.closest("form"):!0,[S,R]=cE({prop:i,defaultProp:a??!1,onChange:c,caller:Kj}),D=it.useRef(S);return it.useEffect(()=>{const k=d==null?void 0:d.form;if(k){const G=()=>R(D.current);return k.addEventListener("reset",G),()=>k.removeEventListener("reset",G)}},[d,R]),Ye.jsxs(A1n,{scope:t,state:S,disabled:s,children:[Ye.jsx(w9.button,{type:"button",role:"checkbox","aria-checked":U6(S)?"mixed":S,"aria-required":o,"data-state":FQe(S),"data-disabled":s?"":void 0,disabled:s,value:l,...f,ref:y,onKeyDown:Pp(n.onKeyDown,k=>{k.key==="Enter"&&k.preventDefault()}),onClick:Pp(n.onClick,k=>{R(G=>U6(G)?!0:!G),b&&(w.current=k.isPropagationStopped(),w.current||k.stopPropagation())})}),b&&Ye.jsx(IQe,{control:d,bubbles:!w.current,name:r,value:l,checked:S,required:o,disabled:s,form:u,style:{transform:"translateX(-100%)"},defaultChecked:U6(a)?!1:a})]})});zQe.displayName=Kj;var UQe="CheckboxIndicator",kQe=it.forwardRef((n,e)=>{const{__scopeCheckbox:t,forceMount:r,...i}=n,a=P1n(UQe,t);return Ye.jsx($4,{present:r||U6(a.state)||a.state===!0,children:Ye.jsx(w9.span,{"data-state":FQe(a.state),"data-disabled":a.disabled?"":void 0,...i,ref:e,style:{pointerEvents:"none",...n.style}})})});kQe.displayName=UQe;var N1n="CheckboxBubbleInput",IQe=it.forwardRef(({__scopeCheckbox:n,control:e,checked:t,bubbles:r=!0,defaultChecked:i,...a},o)=>{const s=it.useRef(null),l=nx(s,o),c=C1n(t),u=cGe(e);it.useEffect(()=>{const d=s.current;if(!d)return;const v=window.HTMLInputElement.prototype,w=Object.getOwnPropertyDescriptor(v,"checked").set;if(c!==t&&w){const b=new Event("click",{bubbles:r});d.indeterminate=U6(t),w.call(d,U6(t)?!1:t),d.dispatchEvent(b)}},[c,t,r]);const f=it.useRef(U6(t)?!1:t);return Ye.jsx(w9.input,{type:"checkbox","aria-hidden":!0,defaultChecked:i??f.current,...a,tabIndex:-1,ref:l,style:{...a.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});IQe.displayName=N1n;function U6(n){return n==="indeterminate"}function FQe(n){return U6(n)?"indeterminate":n?"checked":"unchecked"}var BQe=zQe,D1n=kQe;const jQe=it.forwardRef(({className:n,...e},t)=>Ye.jsx(BQe,{ref:t,className:ih("rf-peer rf-h-4 rf-w-4 rf-shrink-0 rf-rounded-sm rf-border rf-border-zinc-200 rf-border-zinc-900 rf-shadow focus-visible:rf-outline-none focus-visible:rf-ring-1 focus-visible:rf-ring-zinc-950 disabled:rf-cursor-not-allowed disabled:rf-opacity-50 data-[state=checked]:rf-bg-zinc-900 data-[state=checked]:rf-text-zinc-50 dark:rf-border-zinc-800 dark:rf-border-zinc-50 dark:focus-visible:rf-ring-zinc-300 dark:data-[state=checked]:rf-bg-zinc-50 dark:data-[state=checked]:rf-text-zinc-900",n),...e,children:Ye.jsx(D1n,{className:ih("rf-flex rf-items-center rf-justify-center rf-text-current"),children:Ye.jsx(bue,{className:"rf-h-4 rf-w-4"})})}));jQe.displayName=BQe.displayName;const HQe=it.forwardRef(({className:n,type:e,...t},r)=>Ye.jsx("input",{type:e,className:ih("rf-flex rf-h-9 rf-w-full rf-rounded-md rf-border rf-border-zinc-200 rf-bg-white rf-px-3 rf-py-1 rf-text-sm rf-shadow-sm rf-transition-colors file:rf-border-0 file:rf-bg-transparent file:rf-text-sm file:rf-font-medium placeholder:rf-text-zinc-500 focus-visible:rf-outline-none focus-visible:rf-ring-1 focus-visible:rf-ring-zinc-950 disabled:rf-cursor-not-allowed disabled:rf-opacity-50 dark:rf-border-zinc-800 dark:rf-bg-zinc-950 dark:rf-placeholder-zinc-400 dark:focus-visible:rf-ring-zinc-300",n),ref:r,...t}));HQe.displayName="Input";const L1n=async(n,e=10)=>{try{const t=encodeURIComponent(n),r=await fetch(`https://jlcsearch.tscircuit.com/api/search?limit=${e}&q=${t}`);if(!r.ok)throw new Error(`JLC API error: ${r.status} ${r.statusText}`);return(await r.json()).components||[]}catch(t){throw console.error("Error searching JLC components:",t),t}},O1n=n=>({id:`jlc-${n.lcsc}`,name:n.mfr,description:n.description,source:"jlcpcb",partNumber:`C${n.lcsc}`,package:n.package,price:n.price}),z1n=async(n,e=10)=>{try{const t=encodeURIComponent(n),r=await fetch(`https://registry-api.tscircuit.com/snippets/search?q=${t}&limit=${e}`);if(!r.ok)throw new Error(`tscircuit Registry API error: ${r.status} ${r.statusText}`);return(await r.json()).snippets||[]}catch(t){throw console.error("Error searching tscircuit components:",t),t}},U1n=n=>({id:`tscircuit-${n.snippet_id}`,name:n.unscoped_name,description:n.description||`Component by ${n.owner_name}`,source:"tscircuit.com",partNumber:n.name,previewUrl:n.preview_url,code:n.code,owner:n.owner_name}),k1n=({isOpen:n,onClose:e,onImport:t})=>{const[r,i]=it.useState(""),[a,o]=it.useState([]),[s,l]=it.useState(!1),[c,u]=it.useState(!1),[f,d]=it.useState(null),[v,y]=it.useState("tscircuit.com"),[w,b]=it.useState(!1),[S,R]=it.useState(null),D=async()=>{if(!r.trim())return;u(!0);const q=/^C\d+/.test(r);q&&y("jlcpcb");try{if(v==="jlcpcb"){const Z=q?r.substring(1):r,ee=(await L1n(Z,10)).map(O1n);o(ee)}else{const Y=(await z1n(r,10)).map(U1n);o(Y)}}catch(Z){console.error("Error searching components:",Z),o([])}finally{u(!1),l(!0)}},k=q=>{q.key==="Enter"&&D()};it.useEffect(()=>{o([]),d(null)},[v]);const G=q=>{R(q),b(!0)};return Ye.jsxs(i0e,{open:n,onOpenChange:()=>e(),children:[Ye.jsxs(Xj,{className:"rf-max-w-3xl rf-w-full rf-max-h-[90vh] rf-overflow-y-auto rf-flex rf-flex-col",children:[Ye.jsxs(Wj,{children:[Ye.jsx(Zj,{children:"Import Component"}),Ye.jsx(Qj,{children:"Search for components from tscircuit.com or JLCPCB parts library."})]}),Ye.jsxs(Nxe,{value:v,onValueChange:q=>y(q),children:[Ye.jsxs(kq,{className:"rf-grid rf-w-full rf-grid-cols-2",children:[Ye.jsx(W8,{value:"tscircuit.com",children:"tscircuit.com"}),Ye.jsx(W8,{value:"jlcpcb",children:"JLCPCB Parts"})]}),Ye.jsxs("div",{className:"rf-flex rf-items-center rf-gap-2 rf-mt-4",children:[Ye.jsxs("div",{className:"rf-relative rf-flex-grow",children:[Ye.jsx(hin,{className:"rf-absolute rf-left-2 rf-top-2.5 rf-h-4 rf-w-4 rf-text-muted-foreground"}),Ye.jsx(HQe,{placeholder:v==="tscircuit.com"?"Search components...":"Search JLCPCB parts (e.g. C14663)...",className:"rf-pl-8",value:r,onChange:q=>i(q.target.value),onKeyDown:k})]}),Ye.jsx(rb,{onClick:D,disabled:c,children:c?Ye.jsx(WT,{className:"rf-h-4 rf-w-4 rf-animate-spin"}):"Search"})]}),Ye.jsx("div",{className:"rf-mt-4 rf-flex-1 rf-min-h-[200px] !rf-max-h-[40vh] !rf-overflow-y-auto rf-border rf-rounded-md",children:a.length>0?Ye.jsx("div",{className:"rf-divide-y",children:a.map(q=>Ye.jsxs("div",{className:`rf-p-3 rf-flex rf-items-center rf-justify-between rf-cursor-pointer hover:rf-bg-zinc-100 ${(f==null?void 0:f.id)===q.id?"rf-bg-zinc-100":""}`,onClick:()=>d(q),children:[Ye.jsxs("div",{children:[Ye.jsx("div",{className:"rf-font-medium",children:q.name}),Ye.jsxs("div",{className:"rf-text-sm rf-text-zinc-500",children:[q.partNumber&&Ye.jsx("span",{className:"rf-mr-2",children:q.partNumber}),q.description]})]}),Ye.jsx("div",{className:"rf-flex rf-gap-2",children:q.source==="tscircuit.com"&&Ye.jsx(rb,{variant:"outline",size:"sm",onClick:Z=>{Z.stopPropagation(),G(q)},children:"See Details"})})]},q.id))}):c?Ye.jsxs("div",{className:"rf-p-8 rf-text-center rf-text-zinc-500",children:[Ye.jsx(WT,{className:"rf-h-8 rf-w-8 rf-animate-spin rf-mx-auto rf-mb-2"}),Ye.jsx("p",{children:"Searching..."})]}):Ye.jsx("div",{className:"rf-p-8 rf-text-center rf-text-zinc-500",children:s?"No results found":"Enter a search term to find components"})})]}),Ye.jsxs(a0e,{children:[Ye.jsx(o0e,{onClick:e,children:"Cancel"}),Ye.jsx(rb,{onClick:()=>{f&&(t(f),e())},disabled:!f,children:"Import Component"})]})]}),Ye.jsx(i0e,{open:w,onOpenChange:b,children:Ye.jsxs(Xj,{className:"!rf-max-h-[70%] !rf-overflow-y-auto rf-flex rf-flex-col !rf-max-w-[60vw] !rf-overflow-x-hidden",children:[Ye.jsxs(Wj,{children:[Ye.jsx(Zj,{children:S==null?void 0:S.name}),Ye.jsx(Qj,{children:"Detailed information about the selected component"}),Ye.jsxs("div",{className:"rf-text-sm rf-text-muted-foreground",children:[(S==null?void 0:S.partNumber)&&Ye.jsx("div",{className:"rf-font-mono rf-text-sm rf-mb-2",children:S.partNumber}),S==null?void 0:S.description]})]}),(S==null?void 0:S.source)==="jlcpcb"&&Ye.jsxs("div",{className:"rf-my-4 rf-border rf-rounded-md rf-p-4",children:[Ye.jsx("div",{className:"rf-text-sm rf-font-medium rf-mb-2",children:"JLCPCB Details"}),Ye.jsxs("div",{className:"rf-grid rf-grid-cols-2 rf-gap-2",children:[S.package&&Ye.jsxs("div",{className:"rf-flex rf-flex-col",children:[Ye.jsx("span",{className:"rf-text-xs rf-text-zinc-500",children:"Package"}),Ye.jsx("span",{className:"rf-font-medium",children:S.package})]}),S.price!==void 0&&Ye.jsxs("div",{className:"rf-flex rf-flex-col",children:[Ye.jsx("span",{className:"rf-text-xs rf-text-zinc-500",children:"Price"}),Ye.jsxs("span",{className:"rf-font-medium",children:["$",S.price.toFixed(4)]})]})]})]}),(S==null?void 0:S.source)==="tscircuit.com"&&Ye.jsxs("div",{className:"rf-my-4 rf-border rf-rounded-md rf-p-4 !rf-max-w-[60vw] !rf-overflow-x-hidden",children:[Ye.jsx("div",{className:"rf-text-sm rf-font-medium rf-mb-2",children:"tscircuit Details"}),Ye.jsx("div",{className:"rf-grid rf-grid-cols-2 rf-gap-2",children:S.owner&&Ye.jsxs("div",{className:"rf-flex rf-flex-col",children:[Ye.jsx("span",{className:"rf-text-xs rf-text-zinc-500",children:"Owner"}),Ye.jsx("span",{className:"rf-font-medium",children:S.owner})]})}),S.code&&Ye.jsxs("div",{className:"rf-mt-2",children:[Ye.jsx("div",{className:"rf-text-xs rf-text-zinc-500 rf-mb-1",children:"Code Preview"}),Ye.jsxs("pre",{className:"rf-bg-zinc-50 rf-p-2 rf-rounded rf-text-xs rf-font-mono rf-max-h-32 rf-overflow-y-auto",children:[S.code.substring(0,500),S.code.length>500&&"..."]})]})]}),Ye.jsxs("div",{className:"rf-my-4 rf-border rf-rounded-md rf-p-4",children:[Ye.jsx("div",{className:"rf-text-sm rf-font-medium rf-mb-2",children:"Preview"}),(S==null?void 0:S.source)==="tscircuit.com"&&S.code?Ye.jsx("div",{className:"rf-flex rf-justify-center",children:Ye.jsx("div",{className:"rf-border rf-rounded rf-p-4 rf-bg-zinc-50",children:Ye.jsx("img",{src:zin(S.code,"pcb"),alt:S.name,className:"rf-w-full rf-aspect-video rf-object-contain"})})}):Ye.jsx("div",{className:"rf-text-center rf-text-zinc-500 rf-p-4",children:"No preview available"})]}),Ye.jsxs("div",{className:"rf-flex rf-justify-between",children:[Ye.jsxs(rb,{variant:"outline",size:"sm",className:"rf-gap-1",onClick:()=>{const q=(S==null?void 0:S.source)==="jlcpcb"?`https://jlcpcb.com/partdetail/${S.partNumber}`:`https://tscircuit.com/${S.owner}/${S==null?void 0:S.name.split("/").pop()}`;window.open(q,"_blank")},children:["View on"," ",(S==null?void 0:S.source)==="jlcpcb"?"JLCPCB":"tscircuit.com"," ",Ye.jsx(cin,{className:"rf-h-3 rf-w-3"})]}),Ye.jsx(rb,{onClick:()=>{b(!1),S&&(t(S),e())},children:"Import Component"})]})]})})]})};function Jj(n){throw new Error('Could not dynamically require "'+n+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var s0e={exports:{}},VQe;function I1n(){return VQe||(VQe=1,function(n,e){var t={process:{env:{}}};/*!
13615
+ For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return it.useEffect(()=>{var r;document.getElementById((r=n.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(e)},[e,n]),null},w1n=yQe,E1n=gQe,RQe=_Qe,AQe=xQe,PQe=TQe,NQe=CQe,DQe=SQe,LQe=EQe;const i0e=w1n,T1n=E1n,OQe=it.forwardRef(({className:n,...e},t)=>Ye.jsx(RQe,{className:ih("rf-fixed rf-inset-0 rf-z-50 rf-bg-black/80 data-[state=open]:rf-animate-in data-[state=closed]:rf-animate-out data-[state=closed]:rf-fade-out-0 data-[state=open]:rf-fade-in-0",n),...e,ref:t}));OQe.displayName=RQe.displayName;const Xj=it.forwardRef(({className:n,...e},t)=>Ye.jsxs(T1n,{children:[Ye.jsx(OQe,{}),Ye.jsx(AQe,{ref:t,className:ih("rf-fixed rf-left-[50%] rf-top-[50%] rf-z-50 rf-grid rf-w-full rf-max-w-lg rf-translate-x-[-50%] rf-translate-y-[-50%] rf-gap-4 rf-border rf-border-zinc-200 rf-bg-white rf-p-6 rf-shadow-lg rf-duration-200 data-[state=open]:rf-animate-in data-[state=closed]:rf-animate-out data-[state=closed]:rf-fade-out-0 data-[state=open]:rf-fade-in-0 data-[state=closed]:rf-zoom-out-95 data-[state=open]:rf-zoom-in-95 data-[state=closed]:rf-slide-out-to-left-1/2 data-[state=closed]:rf-slide-out-to-top-[48%] data-[state=open]:rf-slide-in-from-left-1/2 data-[state=open]:rf-slide-in-from-top-[48%] sm:rf-rounded-lg dark:rf-border-zinc-800 dark:rf-bg-zinc-950",n),...e})]}));Xj.displayName=AQe.displayName;const Wj=({className:n,...e})=>Ye.jsx("div",{className:ih("rf-flex rf-flex-col rf-space-y-2 rf-text-center sm:rf-text-left",n),...e});Wj.displayName="AlertDialogHeader";const a0e=({className:n,...e})=>Ye.jsx("div",{className:ih("rf-flex rf-flex-col-reverse sm:rf-flex-row sm:rf-justify-end sm:rf-space-x-2",n),...e});a0e.displayName="AlertDialogFooter";const Zj=it.forwardRef(({className:n,...e},t)=>Ye.jsx(DQe,{ref:t,className:ih("rf-text-lg rf-font-semibold",n),...e}));Zj.displayName=DQe.displayName;const Qj=it.forwardRef(({className:n,...e},t)=>Ye.jsx(LQe,{ref:t,className:ih("rf-text-sm rf-text-zinc-500 dark:rf-text-zinc-400",n),...e}));Qj.displayName=LQe.displayName;const M1n=it.forwardRef(({className:n,...e},t)=>Ye.jsx(PQe,{ref:t,className:ih(Sue(),n),...e}));M1n.displayName=PQe.displayName;const o0e=it.forwardRef(({className:n,...e},t)=>Ye.jsx(NQe,{ref:t,className:ih(Sue({variant:"outline"}),"rf-mt-2 sm:rf-mt-0",n),...e}));o0e.displayName=NQe.displayName;function C1n(n){const e=it.useRef({value:n,previous:n});return it.useMemo(()=>(e.current.value!==n&&(e.current.previous=e.current.value,e.current.value=n),e.current.previous),[n])}var Kj="Checkbox",[R1n,Bbn]=BS(Kj),[A1n,P1n]=R1n(Kj),zQe=it.forwardRef((n,e)=>{const{__scopeCheckbox:t,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:l="on",onCheckedChange:c,form:u,...f}=n,[d,v]=it.useState(null),y=nx(e,k=>v(k)),w=it.useRef(!1),b=d?u||!!d.closest("form"):!0,[S,R]=cE({prop:i,defaultProp:a??!1,onChange:c,caller:Kj}),D=it.useRef(S);return it.useEffect(()=>{const k=d==null?void 0:d.form;if(k){const G=()=>R(D.current);return k.addEventListener("reset",G),()=>k.removeEventListener("reset",G)}},[d,R]),Ye.jsxs(A1n,{scope:t,state:S,disabled:s,children:[Ye.jsx(w9.button,{type:"button",role:"checkbox","aria-checked":U6(S)?"mixed":S,"aria-required":o,"data-state":FQe(S),"data-disabled":s?"":void 0,disabled:s,value:l,...f,ref:y,onKeyDown:Pp(n.onKeyDown,k=>{k.key==="Enter"&&k.preventDefault()}),onClick:Pp(n.onClick,k=>{R(G=>U6(G)?!0:!G),b&&(w.current=k.isPropagationStopped(),w.current||k.stopPropagation())})}),b&&Ye.jsx(IQe,{control:d,bubbles:!w.current,name:r,value:l,checked:S,required:o,disabled:s,form:u,style:{transform:"translateX(-100%)"},defaultChecked:U6(a)?!1:a})]})});zQe.displayName=Kj;var UQe="CheckboxIndicator",kQe=it.forwardRef((n,e)=>{const{__scopeCheckbox:t,forceMount:r,...i}=n,a=P1n(UQe,t);return Ye.jsx($4,{present:r||U6(a.state)||a.state===!0,children:Ye.jsx(w9.span,{"data-state":FQe(a.state),"data-disabled":a.disabled?"":void 0,...i,ref:e,style:{pointerEvents:"none",...n.style}})})});kQe.displayName=UQe;var N1n="CheckboxBubbleInput",IQe=it.forwardRef(({__scopeCheckbox:n,control:e,checked:t,bubbles:r=!0,defaultChecked:i,...a},o)=>{const s=it.useRef(null),l=nx(s,o),c=C1n(t),u=cGe(e);it.useEffect(()=>{const d=s.current;if(!d)return;const v=window.HTMLInputElement.prototype,w=Object.getOwnPropertyDescriptor(v,"checked").set;if(c!==t&&w){const b=new Event("click",{bubbles:r});d.indeterminate=U6(t),w.call(d,U6(t)?!1:t),d.dispatchEvent(b)}},[c,t,r]);const f=it.useRef(U6(t)?!1:t);return Ye.jsx(w9.input,{type:"checkbox","aria-hidden":!0,defaultChecked:i??f.current,...a,tabIndex:-1,ref:l,style:{...a.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});IQe.displayName=N1n;function U6(n){return n==="indeterminate"}function FQe(n){return U6(n)?"indeterminate":n?"checked":"unchecked"}var BQe=zQe,D1n=kQe;const jQe=it.forwardRef(({className:n,...e},t)=>Ye.jsx(BQe,{ref:t,className:ih("rf-peer rf-h-4 rf-w-4 rf-shrink-0 rf-rounded-sm rf-border rf-border-zinc-200 rf-border-zinc-900 rf-shadow focus-visible:rf-outline-none focus-visible:rf-ring-1 focus-visible:rf-ring-zinc-950 disabled:rf-cursor-not-allowed disabled:rf-opacity-50 data-[state=checked]:rf-bg-zinc-900 data-[state=checked]:rf-text-zinc-50 dark:rf-border-zinc-800 dark:rf-border-zinc-50 dark:focus-visible:rf-ring-zinc-300 dark:data-[state=checked]:rf-bg-zinc-50 dark:data-[state=checked]:rf-text-zinc-900",n),...e,children:Ye.jsx(D1n,{className:ih("rf-flex rf-items-center rf-justify-center rf-text-current"),children:Ye.jsx(bue,{className:"rf-h-4 rf-w-4"})})}));jQe.displayName=BQe.displayName;const HQe=it.forwardRef(({className:n,type:e,...t},r)=>Ye.jsx("input",{type:e,className:ih("rf-flex rf-h-9 rf-w-full rf-rounded-md rf-border rf-border-zinc-200 rf-bg-white rf-px-3 rf-py-1 rf-text-sm rf-shadow-sm rf-transition-colors file:rf-border-0 file:rf-bg-transparent file:rf-text-sm file:rf-font-medium placeholder:rf-text-zinc-500 focus-visible:rf-outline-none focus-visible:rf-ring-1 focus-visible:rf-ring-zinc-950 disabled:rf-cursor-not-allowed disabled:rf-opacity-50 dark:rf-border-zinc-800 dark:rf-bg-zinc-950 dark:rf-placeholder-zinc-400 dark:focus-visible:rf-ring-zinc-300",n),ref:r,...t}));HQe.displayName="Input";const L1n=async(n,e=10)=>{try{const t=encodeURIComponent(n),r=await fetch(`https://jlcsearch.tscircuit.com/api/search?limit=${e}&q=${t}`);if(!r.ok)throw new Error(`JLC API error: ${r.status} ${r.statusText}`);return(await r.json()).components||[]}catch(t){throw console.error("Error searching JLC components:",t),t}},O1n=n=>({id:`jlc-${n.lcsc}`,name:n.mfr,description:n.description,source:"jlcpcb",partNumber:`C${n.lcsc}`,package:n.package,price:n.price}),z1n=async(n,e=10)=>{try{const t=encodeURIComponent(n),r=await fetch(`https://registry-api.tscircuit.com/snippets/search?q=${t}&limit=${e}`);if(!r.ok)throw new Error(`tscircuit Registry API error: ${r.status} ${r.statusText}`);return(await r.json()).snippets||[]}catch(t){throw console.error("Error searching tscircuit components:",t),t}},U1n=n=>({id:`tscircuit-${n.snippet_id}`,name:n.unscoped_name,description:n.description||`Component by ${n.owner_name}`,source:"tscircuit.com",partNumber:n.name,previewUrl:n.preview_url,code:n.code,owner:n.owner_name}),k1n=({isOpen:n,onClose:e,onImport:t})=>{const[r,i]=it.useState(""),[a,o]=it.useState([]),[s,l]=it.useState(!1),[c,u]=it.useState(!1),[f,d]=it.useState(null),[v,y]=it.useState("tscircuit.com"),[w,b]=it.useState(!1),[S,R]=it.useState(null),D=async()=>{if(!r.trim())return;u(!0);const q=/^C\d+/.test(r);q&&y("jlcpcb");try{if(v==="jlcpcb"){const Z=q?r.substring(1):r,ee=(await L1n(Z,10)).map(O1n);o(ee)}else{const Y=(await z1n(r,10)).map(U1n);o(Y)}}catch(Z){console.error("Error searching components:",Z),o([])}finally{u(!1),l(!0)}},k=q=>{q.key==="Enter"&&D()};it.useEffect(()=>{o([]),d(null)},[v]);const G=q=>{R(q),b(!0)};return Ye.jsxs(i0e,{open:n,onOpenChange:()=>e(),children:[Ye.jsxs(Xj,{className:"rf-max-w-3xl rf-w-full rf-max-h-[90vh] rf-overflow-y-auto rf-flex rf-flex-col",children:[Ye.jsxs(Wj,{children:[Ye.jsx(Zj,{children:"Import Component"}),Ye.jsx(Qj,{children:"Search for components from tscircuit.com or JLCPCB parts library."})]}),Ye.jsxs(Nxe,{value:v,onValueChange:q=>y(q),children:[Ye.jsxs(kq,{className:"rf-grid rf-w-full rf-grid-cols-2",children:[Ye.jsx(W8,{value:"tscircuit.com",children:"tscircuit.com"}),Ye.jsx(W8,{value:"jlcpcb",children:"JLCPCB Parts"})]}),Ye.jsxs("div",{className:"rf-flex rf-items-center rf-gap-2 rf-mt-4",children:[Ye.jsxs("div",{className:"rf-relative rf-flex-grow",children:[Ye.jsx(hin,{className:"rf-absolute rf-left-2 rf-top-2.5 rf-h-4 rf-w-4 rf-text-muted-foreground"}),Ye.jsx(HQe,{placeholder:v==="tscircuit.com"?"Search components...":"Search JLCPCB parts (e.g. C14663)...",className:"rf-pl-8",value:r,onChange:q=>i(q.target.value),onKeyDown:k})]}),Ye.jsx(rb,{onClick:D,disabled:c,children:c?Ye.jsx(WT,{className:"rf-h-4 rf-w-4 rf-animate-spin"}):"Search"})]}),Ye.jsx("div",{className:"rf-mt-4 rf-flex-1 rf-min-h-[200px] !rf-max-h-[40vh] !rf-overflow-y-auto rf-border rf-rounded-md",children:a.length>0?Ye.jsx("div",{className:"rf-divide-y",children:a.map(q=>Ye.jsxs("div",{className:`rf-p-3 rf-flex rf-items-center rf-justify-between rf-cursor-pointer hover:rf-bg-zinc-100 ${(f==null?void 0:f.id)===q.id?"rf-bg-zinc-100":""}`,onClick:()=>d(q),children:[Ye.jsxs("div",{children:[Ye.jsx("div",{className:"rf-font-medium",children:q.name}),Ye.jsxs("div",{className:"rf-text-sm rf-text-zinc-500",children:[q.partNumber&&Ye.jsx("span",{className:"rf-mr-2",children:q.partNumber}),q.description]})]}),Ye.jsx("div",{className:"rf-flex rf-gap-2",children:q.source==="tscircuit.com"&&Ye.jsx(rb,{variant:"outline",size:"sm",onClick:Z=>{Z.stopPropagation(),G(q)},children:"See Details"})})]},q.id))}):c?Ye.jsxs("div",{className:"rf-p-8 rf-text-center rf-text-zinc-500",children:[Ye.jsx(WT,{className:"rf-h-8 rf-w-8 rf-animate-spin rf-mx-auto rf-mb-2"}),Ye.jsx("p",{children:"Searching..."})]}):Ye.jsx("div",{className:"rf-p-8 rf-text-center rf-text-zinc-500",children:s?"No results found":"Enter a search term to find components"})})]}),Ye.jsxs(a0e,{children:[Ye.jsx(o0e,{onClick:e,children:"Cancel"}),Ye.jsx(rb,{onClick:()=>{f&&(t(f),e())},disabled:!f,children:"Import Component"})]})]}),Ye.jsx(i0e,{open:w,onOpenChange:b,children:Ye.jsxs(Xj,{className:"!rf-max-h-[70%] !rf-overflow-y-auto rf-flex rf-flex-col !rf-max-w-[60vw] !rf-overflow-x-hidden",children:[Ye.jsxs(Wj,{children:[Ye.jsx(Zj,{children:S==null?void 0:S.name}),Ye.jsx(Qj,{children:"Detailed information about the selected component"}),Ye.jsxs("div",{className:"rf-text-sm rf-text-muted-foreground",children:[(S==null?void 0:S.partNumber)&&Ye.jsx("div",{className:"rf-font-mono rf-text-sm rf-mb-2",children:S.partNumber}),S==null?void 0:S.description]})]}),(S==null?void 0:S.source)==="jlcpcb"&&Ye.jsxs("div",{className:"rf-my-4 rf-border rf-rounded-md rf-p-4",children:[Ye.jsx("div",{className:"rf-text-sm rf-font-medium rf-mb-2",children:"JLCPCB Details"}),Ye.jsxs("div",{className:"rf-grid rf-grid-cols-2 rf-gap-2",children:[S.package&&Ye.jsxs("div",{className:"rf-flex rf-flex-col",children:[Ye.jsx("span",{className:"rf-text-xs rf-text-zinc-500",children:"Package"}),Ye.jsx("span",{className:"rf-font-medium",children:S.package})]}),S.price!==void 0&&Ye.jsxs("div",{className:"rf-flex rf-flex-col",children:[Ye.jsx("span",{className:"rf-text-xs rf-text-zinc-500",children:"Price"}),Ye.jsxs("span",{className:"rf-font-medium",children:["$",S.price.toFixed(4)]})]})]})]}),(S==null?void 0:S.source)==="tscircuit.com"&&Ye.jsxs("div",{className:"rf-my-4 rf-border rf-rounded-md rf-p-4 !rf-max-w-[60vw] !rf-overflow-x-hidden",children:[Ye.jsx("div",{className:"rf-text-sm rf-font-medium rf-mb-2",children:"tscircuit Details"}),Ye.jsx("div",{className:"rf-grid rf-grid-cols-2 rf-gap-2",children:S.owner&&Ye.jsxs("div",{className:"rf-flex rf-flex-col",children:[Ye.jsx("span",{className:"rf-text-xs rf-text-zinc-500",children:"Owner"}),Ye.jsx("span",{className:"rf-font-medium",children:S.owner})]})}),S.code&&Ye.jsxs("div",{className:"rf-mt-2",children:[Ye.jsx("div",{className:"rf-text-xs rf-text-zinc-500 rf-mb-1",children:"Code Preview"}),Ye.jsxs("pre",{className:"rf-bg-zinc-50 rf-p-2 rf-rounded rf-text-xs rf-font-mono rf-max-h-32 rf-overflow-y-auto",children:[S.code.substring(0,500),S.code.length>500&&"..."]})]})]}),Ye.jsxs("div",{className:"rf-my-4 rf-border rf-rounded-md rf-p-4",children:[Ye.jsx("div",{className:"rf-text-sm rf-font-medium rf-mb-2",children:"Preview"}),(S==null?void 0:S.source)==="tscircuit.com"&&S.code?Ye.jsx("div",{className:"rf-flex rf-justify-center",children:Ye.jsx("div",{className:"rf-border rf-rounded rf-p-4 rf-bg-zinc-50",children:Ye.jsx("img",{src:zin(S.code,"pcb"),alt:S.name,className:"rf-w-full rf-aspect-video rf-object-contain"})})}):Ye.jsx("div",{className:"rf-text-center rf-text-zinc-500 rf-p-4",children:"No preview available"})]}),Ye.jsxs("div",{className:"rf-flex rf-justify-between",children:[Ye.jsxs(rb,{variant:"outline",size:"sm",className:"rf-gap-1",onClick:()=>{const q=(S==null?void 0:S.source)==="jlcpcb"?`https://jlcpcb.com/partdetail/${S.partNumber}`:`https://tscircuit.com/${S.owner}/${S==null?void 0:S.name.split("/").pop()}`;window.open(q,"_blank")},children:["View on"," ",(S==null?void 0:S.source)==="jlcpcb"?"JLCPCB":"tscircuit.com"," ",Ye.jsx(cin,{className:"rf-h-3 rf-w-3"})]}),Ye.jsx(rb,{onClick:()=>{b(!1),S&&(t(S),e())},children:"Import Component"})]})]})})]})};function Jj(n){throw new Error('Could not dynamically require "'+n+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var s0e={exports:{}},VQe;function I1n(){return VQe||(VQe=1,function(n,e){var t={process:{env:{}}};/*!
13616
13616
 
13617
13617
  JSZip v3.10.1 - A JavaScript class for generating and reading zip files
13618
13618
  <http://stuartk.com/jszip>
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@tscircuit/runframe",
3
3
  "main": "dist/preview.js",
4
4
  "type": "module",
5
- "version": "0.0.382",
5
+ "version": "0.0.384",
6
6
  "exports": {
7
7
  ".": "./dist/preview.js",
8
8
  "./preview": "./dist/preview.js",
@@ -32,7 +32,7 @@
32
32
  "devDependencies": {
33
33
  "@babel/standalone": "^7.26.10",
34
34
  "@biomejs/biome": "^1.9.4",
35
- "@tscircuit/fake-snippets": "^0.0.55",
35
+ "@tscircuit/fake-snippets": "^0.0.56",
36
36
  "@types/bun": "latest",
37
37
  "@types/debug": "^4.1.12",
38
38
  "@types/react": "18",