@tscircuit/runframe 0.0.711 → 0.0.713

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.
@@ -1261,7 +1261,7 @@ var useErrorTelemetry = ({
1261
1261
  };
1262
1262
 
1263
1263
  // package.json
1264
- var version = "0.0.710";
1264
+ var version = "0.0.712";
1265
1265
 
1266
1266
  // lib/components/RunFrame/runner-store/use-runner-store.ts
1267
1267
  import { create } from "zustand";
package/dist/preview.js CHANGED
@@ -8,7 +8,7 @@ import {
8
8
  linkify,
9
9
  useOrderDialog,
10
10
  useOrderDialogCli
11
- } from "./chunk-HGFFR6FS.js";
11
+ } from "./chunk-7DHFHS75.js";
12
12
  export {
13
13
  BomTable,
14
14
  CadViewer,
package/dist/runner.js CHANGED
@@ -37,7 +37,7 @@ import {
37
37
  useOrderDialogCli,
38
38
  useRunFrameStore,
39
39
  useRunnerStore
40
- } from "./chunk-HGFFR6FS.js";
40
+ } from "./chunk-7DHFHS75.js";
41
41
 
42
42
  // lib/components/RunFrame/RunFrame.tsx
43
43
  import { createCircuitWebWorker } from "@tscircuit/eval/worker";
@@ -13238,7 +13238,7 @@ ${P.type}: ${se}
13238
13238
  * Copyright (c) 2015 Jon Schlinkert, contributors.
13239
13239
  * Licensed under the MIT license.
13240
13240
  */var Zue,nze;function TJt(){if(nze)return Zue;nze=1;var r=eze(),e=NJt();return Zue=function t(n,i){var a=r(n);if(a!=="object"&&a!=="array")throw new Error("expected an object");var o=[];a==="object"&&(n=e(n,i),o={});for(var s in n)if(n.hasOwnProperty(s)){var l=n[s];r(l)==="object"||r(l)==="array"?o[s]=t(l,i):o[s]=l}return o},Zue}TJt();var que={exports:{}},rze;function PJt(){return rze||(rze=1,function(r){var e=Object.prototype.hasOwnProperty,t="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(t=!1));function i(o,s,l){this.fn=o,this.context=s,this.once=l||!1}function a(){this._events=new n,this._eventsCount=0}a.prototype.eventNames=function(){var s=[],l,c;if(this._eventsCount===0)return s;for(c in l=this._events)e.call(l,c)&&s.push(t?c.slice(1):c);return Object.getOwnPropertySymbols?s.concat(Object.getOwnPropertySymbols(l)):s},a.prototype.listeners=function(s,l){var c=t?t+s:s,u=this._events[c];if(l)return!!u;if(!u)return[];if(u.fn)return[u.fn];for(var A=0,d=u.length,h=new Array(d);A<d;A++)h[A]=u[A].fn;return h},a.prototype.emit=function(s,l,c,u,A,d){var h=t?t+s:s;if(!this._events[h])return!1;var m=this._events[h],C=arguments.length,E,_;if(m.fn){switch(m.once&&this.removeListener(s,m.fn,void 0,!0),C){case 1:return m.fn.call(m.context),!0;case 2:return m.fn.call(m.context,l),!0;case 3:return m.fn.call(m.context,l,c),!0;case 4:return m.fn.call(m.context,l,c,u),!0;case 5:return m.fn.call(m.context,l,c,u,A),!0;case 6:return m.fn.call(m.context,l,c,u,A,d),!0}for(_=1,E=new Array(C-1);_<C;_++)E[_-1]=arguments[_];m.fn.apply(m.context,E)}else{var B=m.length,w;for(_=0;_<B;_++)switch(m[_].once&&this.removeListener(s,m[_].fn,void 0,!0),C){case 1:m[_].fn.call(m[_].context);break;case 2:m[_].fn.call(m[_].context,l);break;case 3:m[_].fn.call(m[_].context,l,c);break;case 4:m[_].fn.call(m[_].context,l,c,u);break;default:if(!E)for(w=1,E=new Array(C-1);w<C;w++)E[w-1]=arguments[w];m[_].fn.apply(m[_].context,E)}}return!0},a.prototype.on=function(s,l,c){var u=new i(l,c||this),A=t?t+s:s;return this._events[A]?this._events[A].fn?this._events[A]=[this._events[A],u]:this._events[A].push(u):(this._events[A]=u,this._eventsCount++),this},a.prototype.once=function(s,l,c){var u=new i(l,c||this,!0),A=t?t+s:s;return this._events[A]?this._events[A].fn?this._events[A]=[this._events[A],u]:this._events[A].push(u):(this._events[A]=u,this._eventsCount++),this},a.prototype.removeListener=function(s,l,c,u){var A=t?t+s:s;if(!this._events[A])return this;if(!l)return--this._eventsCount===0?this._events=new n:delete this._events[A],this;var d=this._events[A];if(d.fn)d.fn===l&&(!u||d.once)&&(!c||d.context===c)&&(--this._eventsCount===0?this._events=new n:delete this._events[A]);else{for(var h=0,m=[],C=d.length;h<C;h++)(d[h].fn!==l||u&&!d[h].once||c&&d[h].context!==c)&&m.push(d[h]);m.length?this._events[A]=m.length===1?m[0]:m:--this._eventsCount===0?this._events=new n:delete this._events[A]}return this},a.prototype.removeAllListeners=function(s){var l;return s?(l=t?t+s:s,this._events[l]&&(--this._eventsCount===0?this._events=new n:delete this._events[l])):(this._events=new n,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prototype.setMaxListeners=function(){return this},a.prefixed=t,a.EventEmitter=a,r.exports=a}(que)),que.exports}var Xue={exports:{}},ize;function kJt(){return ize||(ize=1,function(r){var e=Object.prototype.hasOwnProperty,t="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(t=!1));function i(o,s,l){this.fn=o,this.context=s,this.once=l||!1}function a(){this._events=new n,this._eventsCount=0}a.prototype.eventNames=function(){var s=[],l,c;if(this._eventsCount===0)return s;for(c in l=this._events)e.call(l,c)&&s.push(t?c.slice(1):c);return Object.getOwnPropertySymbols?s.concat(Object.getOwnPropertySymbols(l)):s},a.prototype.listeners=function(s,l){var c=t?t+s:s,u=this._events[c];if(l)return!!u;if(!u)return[];if(u.fn)return[u.fn];for(var A=0,d=u.length,h=new Array(d);A<d;A++)h[A]=u[A].fn;return h},a.prototype.emit=function(s,l,c,u,A,d){var h=t?t+s:s;if(!this._events[h])return!1;var m=this._events[h],C=arguments.length,E,_;if(m.fn){switch(m.once&&this.removeListener(s,m.fn,void 0,!0),C){case 1:return m.fn.call(m.context),!0;case 2:return m.fn.call(m.context,l),!0;case 3:return m.fn.call(m.context,l,c),!0;case 4:return m.fn.call(m.context,l,c,u),!0;case 5:return m.fn.call(m.context,l,c,u,A),!0;case 6:return m.fn.call(m.context,l,c,u,A,d),!0}for(_=1,E=new Array(C-1);_<C;_++)E[_-1]=arguments[_];m.fn.apply(m.context,E)}else{var B=m.length,w;for(_=0;_<B;_++)switch(m[_].once&&this.removeListener(s,m[_].fn,void 0,!0),C){case 1:m[_].fn.call(m[_].context);break;case 2:m[_].fn.call(m[_].context,l);break;case 3:m[_].fn.call(m[_].context,l,c);break;case 4:m[_].fn.call(m[_].context,l,c,u);break;default:if(!E)for(w=1,E=new Array(C-1);w<C;w++)E[w-1]=arguments[w];m[_].fn.apply(m[_].context,E)}}return!0},a.prototype.on=function(s,l,c){var u=new i(l,c||this),A=t?t+s:s;return this._events[A]?this._events[A].fn?this._events[A]=[this._events[A],u]:this._events[A].push(u):(this._events[A]=u,this._eventsCount++),this},a.prototype.once=function(s,l,c){var u=new i(l,c||this,!0),A=t?t+s:s;return this._events[A]?this._events[A].fn?this._events[A]=[this._events[A],u]:this._events[A].push(u):(this._events[A]=u,this._eventsCount++),this},a.prototype.removeListener=function(s,l,c,u){var A=t?t+s:s;if(!this._events[A])return this;if(!l)return--this._eventsCount===0?this._events=new n:delete this._events[A],this;var d=this._events[A];if(d.fn)d.fn===l&&(!u||d.once)&&(!c||d.context===c)&&(--this._eventsCount===0?this._events=new n:delete this._events[A]);else{for(var h=0,m=[],C=d.length;h<C;h++)(d[h].fn!==l||u&&!d[h].once||c&&d[h].context!==c)&&m.push(d[h]);m.length?this._events[A]=m.length===1?m[0]:m:--this._eventsCount===0?this._events=new n:delete this._events[A]}return this},a.prototype.removeAllListeners=function(s){var l;return s?(l=t?t+s:s,this._events[l]&&(--this._eventsCount===0?this._events=new n:delete this._events[l])):(this._events=new n,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prototype.setMaxListeners=function(){return this},a.prefixed=t,a.EventEmitter=a,r.exports=a}(Xue)),Xue.exports}var $ue,aze;function UJt(){if(aze)return $ue;aze=1;function r(c,u,A){return u in c?Object.defineProperty(c,u,{value:A,enumerable:!0,configurable:!0,writable:!0}):c[u]=A,c}var e=kJt(),t=function(){},n={data:"state-data",cdata:"state-cdata",tagBegin:"state-tag-begin",tagName:"state-tag-name",tagEnd:"state-tag-end",attributeNameStart:"state-attribute-name-start",attributeName:"state-attribute-name",attributeNameEnd:"state-attribute-name-end",attributeValueBegin:"state-attribute-value-begin",attributeValue:"state-attribute-value"},i={lt:"action-lt",gt:"action-gt",space:"action-space",equal:"action-equal",quote:"action-quote",slash:"action-slash",char:"action-char",error:"action-error"},a={text:"text",openTag:"open-tag",closeTag:"close-tag",attributeName:"attribute-name",attributeValue:"attribute-value"},o={" ":i.space," ":i.space,"\n":i.space,"\r":i.space,"<":i.lt,">":i.gt,'"':i.quote,"'":i.quote,"=":i.equal,"/":i.slash},s=function(u){return o[u]||i.char},l=function(u){var A,d,h,m,C,E,_,B,w,P;u=Object.assign({debug:!1},u);var O=new e,G=n.data,Y="",K="",Z="",V="",se="",ie="",de=function(fe,Ie){if(!(K[0]==="?"||K[0]==="!")){var ye={type:fe,value:Ie};u.debug&&console.log("emit:",ye),O.emit("data",ye)}};O.stateMachine=(P={},r(P,n.data,(A={},r(A,i.lt,function(){Y.trim()&&de(a.text,Y),K="",se=!1,G=n.tagBegin}),r(A,i.char,function(xe){Y+=xe}),A)),r(P,n.cdata,r({},i.char,function(xe){Y+=xe,Y.substr(-3)==="]]>"&&(de(a.text,Y.slice(0,-3)),Y="",G=n.data)})),r(P,n.tagBegin,(d={},r(d,i.space,t),r(d,i.char,function(xe){K=xe,G=n.tagName}),r(d,i.slash,function(){K="",se=!0}),d)),r(P,n.tagName,(h={},r(h,i.space,function(){se?G=n.tagEnd:(G=n.attributeNameStart,de(a.openTag,K))}),r(h,i.gt,function(){de(se?a.closeTag:a.openTag,K),Y="",G=n.data}),r(h,i.slash,function(){G=n.tagEnd,de(a.openTag,K)}),r(h,i.char,function(xe){K+=xe,K==="![CDATA["&&(G=n.cdata,Y="",K="")}),h)),r(P,n.tagEnd,(m={},r(m,i.gt,function(){de(a.closeTag,K),Y="",G=n.data}),r(m,i.char,t),m)),r(P,n.attributeNameStart,(C={},r(C,i.char,function(xe){Z=xe,G=n.attributeName}),r(C,i.gt,function(){Y="",G=n.data}),r(C,i.space,t),r(C,i.slash,function(){se=!0,G=n.tagEnd}),C)),r(P,n.attributeName,(E={},r(E,i.space,function(){G=n.attributeNameEnd}),r(E,i.equal,function(){de(a.attributeName,Z),G=n.attributeValueBegin}),r(E,i.gt,function(){V="",de(a.attributeName,Z),de(a.attributeValue,V),Y="",G=n.data}),r(E,i.slash,function(){se=!0,V="",de(a.attributeName,Z),de(a.attributeValue,V),G=n.tagEnd}),r(E,i.char,function(xe){Z+=xe}),E)),r(P,n.attributeNameEnd,(_={},r(_,i.space,t),r(_,i.equal,function(){de(a.attributeName,Z),G=n.attributeValueBegin}),r(_,i.gt,function(){V="",de(a.attributeName,Z),de(a.attributeValue,V),Y="",G=n.data}),r(_,i.char,function(xe){V="",de(a.attributeName,Z),de(a.attributeValue,V),Z=xe,G=n.attributeName}),_)),r(P,n.attributeValueBegin,(B={},r(B,i.space,t),r(B,i.quote,function(xe){ie=xe,V="",G=n.attributeValue}),r(B,i.gt,function(){V="",de(a.attributeValue,V),Y="",G=n.data}),r(B,i.char,function(xe){ie="",V=xe,G=n.attributeValue}),B)),r(P,n.attributeValue,(w={},r(w,i.space,function(xe){ie?V+=xe:(de(a.attributeValue,V),G=n.attributeNameStart)}),r(w,i.quote,function(xe){ie===xe?(de(a.attributeValue,V),G=n.attributeNameStart):V+=xe}),r(w,i.gt,function(xe){ie?V+=xe:(de(a.attributeValue,V),Y="",G=n.data)}),r(w,i.slash,function(xe){ie?V+=xe:(de(a.attributeValue,V),se=!0,G=n.tagEnd)}),r(w,i.char,function(xe){V+=xe}),w)),P);var Ce=function(fe){u.debug&&console.log(G,fe);var Ie=O.stateMachine[G],ye=Ie[s(fe)]||Ie[i.error]||Ie[i.char];ye(fe)};return O.write=function(xe){for(var fe=xe.length,Ie=0;Ie<fe;Ie++)Ce(xe[Ie])},O};return $ue={State:n,Action:i,Type:a,create:l},$ue}var eAe,oze;function FJt(){if(oze)return eAe;oze=1;var r=PJt(),e=UJt(),t=e.Type,n={element:"element",text:"text"},i=function(l){return Object.assign({name:"",type:n.element,value:"",parent:null,attributes:{},children:[]},l)},a=function(l){l=Object.assign({stream:!1,parentNodes:!0,doneEvent:"done",tagPrefix:"tag:",emitTopLevelOnly:!1,debug:!1},l);var c=void 0,u=void 0,A=void 0,d=void 0,h=new r,m=function(E){switch(E.type){case t.openTag:if(A===null)A=u,A.name=E.value;else{var _=i({name:E.value,parent:A});A.children.push(_),A=_}break;case t.closeTag:var B=A.parent;if(l.parentNodes||(A.parent=null),A.name!==E.value)break;l.stream&&B===u&&(u.children=[],A.parent=null),(!l.emitTopLevelOnly||B===u)&&(h.emit(l.tagPrefix+A.name,A),h.emit("tag",A.name,A)),A===u&&(c.removeAllListeners("data"),h.emit(l.doneEvent,A),u=null),A=B;break;case t.text:A&&A.children.push(i({type:n.text,value:E.value,parent:l.parentNodes?A:null}));break;case t.attributeName:d=E.value,A.attributes[d]="";break;case t.attributeValue:A.attributes[d]=E.value;break}};return h.reset=function(){c=e.create({debug:l.debug}),c.on("data",m),u=i(),A=null,d="",h.parse=c.write},h.reset(),h},o=function(l,c){c=Object.assign({},c,{stream:!1,tagPrefix:":"});var u=a(c),A=void 0;return u.on("done",function(d){A=d}),u.parse(l),A};return eAe={parseSync:o,create:a,NodeType:n},eAe}FJt();var LJt=function(e){if(e){var t=String(e);return/[&<>]/.test(t)?"<![CDATA[".concat(t.replace(/]]>/,"]]]]><![CDATA[>"),"]]>"):t}return""},GJt=function(e){return String(e).replace(/&/g,"&amp;").replace(/'/g,"&apos;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")},Az=function r(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.transformAttr,i=n===void 0?function(h,m,C){return"".concat(h,'="').concat(C(m),'"')}:n,a=t.transformNode,o=a===void 0?function(h){return h}:a,s=t.selfClose,l=s===void 0?!0:s;if(Array.isArray(e))return e.map(function(h){return r(h,{transformAttr:i,selfClose:l,transformNode:o})}).join("");var c=o(e);if(c.type==="text")return LJt(c.value);var u="";for(var A in c.attributes){var d=i(A,c.attributes[A],GJt,c.name);u+=d?" ".concat(d):""}return c.children&&c.children.length>0||!l?"<".concat(c.name).concat(u,">").concat(r(c.children,{transformAttr:i,transformNode:o,selfClose:l}),"</").concat(c.name,">"):"<".concat(c.name).concat(u,"/>")};function OJt(r,e,t){var d;const{transform:n,shouldDrawErrors:i}=t;if(!i)return[];const{pcb_port_ids:a}=r,o=e.find(h=>h.type==="pcb_port"&&h.pcb_port_id===(a==null?void 0:a[0])),s=e.find(h=>h.type==="pcb_port"&&h.pcb_port_id===(a==null?void 0:a[1]));if(!o||!s){const h=(d=r.message)==null?void 0:d.match(/pcb_via\[#?(pcb_via_\d+)\]/),m=h==null?void 0:h[1],C=e.find(E=>E.type==="pcb_via"&&E.pcb_via_id===m);if(C&&C.type==="pcb_via")return zJt(r,C,t);if(r.center){const E=qr(n,{x:r.center.x,y:r.center.y});return[{name:"rect",type:"element",attributes:{x:(E.x-5).toString(),y:(E.y-5).toString(),width:"10",height:"10",fill:"red",transform:`rotate(45 ${E.x} ${E.y})`},children:[],value:""},{name:"text",type:"element",attributes:{x:E.x.toString(),y:(E.y-15).toString(),fill:"red","font-family":"sans-serif","font-size":"12","text-anchor":"middle"},children:[{type:"text",value:r.message||"Pcb Trace Error",name:"",attributes:{},children:[]}],value:""}]}else return[]}const l=qr(n,{x:o.x,y:o.y}),c=qr(n,{x:s.x,y:s.y}),u={x:(l.x+c.x)/2,y:(l.y+c.y)/2};return isNaN(l.x)||isNaN(l.y)||isNaN(c.x)||isNaN(c.y)||isNaN(u.x)||isNaN(u.y)?[]:[{name:"line",type:"element",attributes:{x1:l.x.toString(),y1:l.y.toString(),x2:u.x.toString(),y2:u.y.toString(),stroke:"red","stroke-width":"1.5","stroke-dasharray":"2,2"},children:[],value:""},{name:"line",type:"element",attributes:{x1:u.x.toString(),y1:u.y.toString(),x2:c.x.toString(),y2:c.y.toString(),stroke:"red","stroke-width":"1.5","stroke-dasharray":"2,2"},children:[],value:""},{name:"rect",type:"element",attributes:{x:(u.x-5).toString(),y:(u.y-5).toString(),width:"10",height:"10",fill:"red",transform:`rotate(45 ${u.x} ${u.y})`},children:[],value:""},{name:"text",type:"element",attributes:{x:u.x.toString(),y:(u.y-15).toString(),fill:"red","font-family":"sans-serif","font-size":"12","text-anchor":"middle"},children:[{type:"text",value:r.message||"Pcb Trace Error",name:"",attributes:{},children:[]}],value:""}]}function zJt(r,e,t){const{transform:n}=t;if(r.center&&e){const i=qr(n,{x:r.center.x,y:r.center.y}),a=qr(n,{x:e.x,y:e.y}),o=a.x-i.x,s=a.y-i.y,l=Math.sqrt(o*o+s*s),c=Math.atan2(s,o)*180/Math.PI,A=l+10*2,d=20,h=(i.x+a.x)/2,m=(i.y+a.y)/2;return[{name:"rect",type:"element",attributes:{x:(h-A/2).toString(),y:(m-d/2).toString(),width:A.toString(),height:d.toString(),fill:"none",stroke:"red","stroke-width":"1","stroke-dasharray":"3,2",transform:`rotate(${c} ${h} ${m})`},children:[],value:""},{name:"rect",type:"element",attributes:{x:(h-5).toString(),y:(m-5).toString(),width:"10",height:"10",fill:"red",transform:`rotate(45 ${h} ${m})`},children:[],value:""},{name:"text",type:"element",attributes:{x:h.toString(),y:(m-d/2-5).toString(),fill:"red","font-family":"sans-serif","font-size":"12","text-anchor":"middle"},children:[{type:"text",value:r.message||"Pcb Trace Error",name:"",attributes:{},children:[]}],value:""}]}return[]}function HJt(r,e){const{transform:t,layer:n}=e;if(!r.route||!Array.isArray(r.route))return[];const i=r.route[0],a=r.route[r.route.length-1],o=i.x===a.x&&i.y===a.y,s=r.route.slice(0,o?-1:void 0).map((l,c)=>{const[u,A]=qr(t,[l.x,l.y]);return c===0?`M ${u} ${A}`:`L ${u} ${A}`}).join(" ")+(o?" Z":"");return[{name:"path",type:"element",attributes:{class:"pcb-fabrication-note-path",stroke:r.color||"rgba(255,255,255,0.5)",fill:"none",d:s,"stroke-width":(r.stroke_width*Math.abs(t.a)).toString(),"data-pcb-component-id":r.pcb_component_id,"data-pcb-fabrication-note-path-id":r.pcb_fabrication_note_path_id},value:"",children:[]}]}function YJt(r,e){const{transform:t,layer:n}=e,{anchor_position:i,anchor_alignment:a,text:o,font_size:s=1,layer:l="top",color:c}=r;if(n&&l!==n)return[];if(!i||typeof i.x!="number"||typeof i.y!="number")return console.error("Invalid anchor_position:",i),[];const[u,A]=qr(t,[i.x,i.y]),d=s*Math.abs(t.a),h=tA(df(u,A),SB(Math.PI/180));return[{name:"text",type:"element",attributes:{x:"0",y:"0","font-family":"Arial, sans-serif","font-size":d.toString(),"text-anchor":"middle","dominant-baseline":"central",transform:n2(h),class:"pcb-fabrication-note-text",fill:c||"rgba(255,255,255,0.5)"},children:[{type:"text",value:o,name:"",attributes:{},children:[]}],value:""}]}function VJt(r,e){const{transform:t,colorMap:n}=e,[i,a]=qr(t,[r.x,r.y]);if(r.shape==="pill"){const o=r.outer_width*Math.abs(t.a),s=r.outer_height*Math.abs(t.a),l=r.hole_width*Math.abs(t.a),c=r.hole_height*Math.abs(t.a),u=o/2,A=l/2,d=s-o;return[{name:"g",type:"element",children:[{name:"path",type:"element",attributes:{class:"pcb-hole-outer",fill:n.copper.top,d:`M${i-u},${a-d/2} v${d} a${u},${u} 0 0 0 ${o},0 v-${d} a${u},${u} 0 0 0 -${o},0 z`},value:"",children:[]},{name:"path",type:"element",attributes:{class:"pcb-hole-inner",fill:n.drill,d:`M${i-A},${a-(c-l)/2} v${c-l} a${A},${A} 0 0 0 ${l},0 v-${c-l} a${A},${A} 0 0 0 -${l},0 z`},value:"",children:[]}],value:"",attributes:{}}]}if(r.shape==="circle"){const o=r.outer_diameter*Math.abs(t.a),s=r.outer_diameter*Math.abs(t.a),l=r.hole_diameter*Math.abs(t.a),c=r.hole_diameter*Math.abs(t.a),u=Math.min(o,s)/2,A=Math.min(l,c)/2;return[{name:"g",type:"element",children:[{name:"circle",type:"element",attributes:{class:"pcb-hole-outer",fill:n.copper.top,cx:i.toString(),cy:a.toString(),r:u.toString()},value:"",children:[]},{name:"circle",type:"element",attributes:{class:"pcb-hole-inner",fill:n.drill,cx:i.toString(),cy:a.toString(),r:A.toString()},value:"",children:[]}],value:"",attributes:{}}]}if(r.shape==="circular_hole_with_rect_pad"){const o=r.hole_diameter*Math.abs(t.a),s=r.rect_pad_width*Math.abs(t.a),l=r.rect_pad_height*Math.abs(t.a),c=o/2;return[{name:"g",type:"element",children:[{name:"rect",type:"element",attributes:{class:"pcb-hole-outer-pad",fill:n.copper.top,x:(i-s/2).toString(),y:(a-l/2).toString(),width:s.toString(),height:l.toString()},value:"",children:[]},{name:"circle",type:"element",attributes:{class:"pcb-hole-inner",fill:n.drill,cx:i.toString(),cy:a.toString(),r:c.toString()},value:"",children:[]}],value:"",attributes:{}}]}if(r.shape==="pill_hole_with_rect_pad"){const o=r.rect_pad_width*Math.abs(t.a),s=r.rect_pad_height*Math.abs(t.a),l=r.hole_height*Math.abs(t.a),c=r.hole_width*Math.abs(t.a),u=Math.min(l,c)/2;return[{name:"g",type:"element",children:[{name:"rect",type:"element",attributes:{class:"pcb-hole-outer-pad",fill:n.copper.top,x:(i-o/2).toString(),y:(a-s/2).toString(),width:o.toString(),height:s.toString()},value:"",children:[]},{name:"rect",type:"element",attributes:{class:"pcb-hole-inner",fill:n.drill,x:(i-c/2).toString(),y:(a-l/2).toString(),width:c.toString(),height:l.toString(),rx:u.toString(),ry:u.toString()},value:"",children:[]}],value:"",attributes:{}}]}return[]}function KJt(r,e){const{transform:t,layer:n,colorMap:i}=e;if(!r.route||!Array.isArray(r.route))return[];let a=r.route.map((u,A)=>{const[d,h]=qr(t,[u.x,u.y]);return A===0?`M ${d} ${h}`:`L ${d} ${h}`}).join(" ");const o=r.route[0],s=r.route[r.route.length-1];o&&s&&o.x===s.x&&o.y===s.y&&(a+=" Z");const l=r.layer||"top";if(n&&l!==n)return[];const c=l==="bottom"?i.silkscreen.bottom:i.silkscreen.top;return[{name:"path",type:"element",attributes:{class:`pcb-silkscreen pcb-silkscreen-${l}`,d:a,fill:"none",stroke:c,"stroke-width":(r.stroke_width*Math.abs(t.a)).toString(),"stroke-linecap":"round","stroke-linejoin":"round","data-pcb-component-id":r.pcb_component_id,"data-pcb-silkscreen-path-id":r.pcb_silkscreen_path_id},value:"",children:[]}]}function jJt(r,e){const{transform:t,layer:n,colorMap:i}=e,{anchor_position:a,text:o,font_size:s=1,layer:l="top",ccw_rotation:c=0,anchor_alignment:u="center"}=r;if(n&&l!==n)return[];if(!a||typeof a.x!="number"||typeof a.y!="number")return console.error("Invalid anchor_position:",a),[];const[A,d]=qr(t,[a.x,a.y]),h=s*Math.abs(t.a);let m="middle",C="central",E=0,_=0;switch(u){case"top_left":m="start",C="text-before-edge";break;case"top_center":m="middle",C="text-before-edge";break;case"top_right":m="end",C="text-before-edge";break;case"center_left":m="start",C="central";break;case"center_right":m="end",C="central";break;case"bottom_left":m="start",C="text-after-edge";break;case"bottom_center":m="middle",C="text-after-edge";break;case"bottom_right":m="end",C="text-after-edge";break;case"center":default:m="middle",C="central";break}const B=tA(df(A,d),SB(c*Math.PI/180),...l==="bottom"?[PE(-1,1)]:[]),w=l==="bottom"?i.silkscreen.bottom:i.silkscreen.top,P=o.split(`
13241
- `),O=P.length===1?[{type:"text",value:o,name:"",attributes:{},children:[]}]:P.map((Y,K)=>({type:"element",name:"tspan",value:"",attributes:{x:"0",...K>0?{dy:h.toString()}:{}},children:[{type:"text",value:Y,name:"",attributes:{},children:[]}]}));return[{name:"text",type:"element",attributes:{x:"0",y:"0",dx:E.toString(),dy:_.toString(),fill:w,"font-family":"Arial, sans-serif","font-size":h.toString(),"text-anchor":m,"dominant-baseline":C,transform:n2(B),class:`pcb-silkscreen-text pcb-silkscreen-${l}`,"data-pcb-silkscreen-text-id":r.pcb_component_id,stroke:"none"},children:O,value:""}]}function JJt(r,e){const{transform:t,layer:n,colorMap:i}=e,{center:a,width:o,height:s,layer:l="top",pcb_silkscreen_rect_id:c,stroke_width:u,is_filled:A,has_stroke:d,is_stroke_dashed:h}=r;if(n&&l!==n)return[];if(!a||typeof a.x!="number"||typeof a.y!="number"||typeof o!="number"||typeof s!="number")return console.error("Invalid rectangle data:",{center:a,width:o,height:s}),[];const[m,C]=qr(t,[a.x,a.y]),E=o*Math.abs(t.a),_=s*Math.abs(t.d),B=u*Math.abs(t.a),w=l==="bottom"?i.silkscreen.bottom:i.silkscreen.top,P={x:(m-E/2).toString(),y:(C-_/2).toString(),width:E.toString(),height:_.toString(),class:`pcb-silkscreen-rect pcb-silkscreen-${l}`,"data-pcb-silkscreen-rect-id":c};P.fill=A?w:"none";let O;if(d===void 0?O=B>0:O=d,O){if(P.stroke=w,P["stroke-width"]=B.toString(),h){const Y=.1*Math.abs(t.a),K=.05*Math.abs(t.a);P["stroke-dasharray"]=`${Y} ${K}`}}else P.stroke="none";return[{name:"rect",type:"element",attributes:P,value:"",children:[]}]}function WJt(r,e){const{transform:t,layer:n,colorMap:i}=e,{center:a,radius:o,layer:s="top",pcb_silkscreen_circle_id:l,stroke_width:c=1}=r;if(n&&s!==n)return[];if(!a||typeof a.x!="number"||typeof a.y!="number"||typeof o!="number")return console.error("Invalid PCB Silkscreen Circle data:",{center:a,radius:o}),[];const[u,A]=qr(t,[a.x,a.y]),d=o*Math.abs(t.a),h=c*Math.abs(t.a),m=s==="bottom"?i.silkscreen.bottom:i.silkscreen.top;return[{name:"circle",type:"element",attributes:{cx:u.toString(),cy:A.toString(),r:d.toString(),class:`pcb-silkscreen-circle pcb-silkscreen-${s}`,stroke:m,"stroke-width":h.toString(),"data-pcb-silkscreen-circle-id":l},value:"",children:[]}]}function ZJt(r,e){const{transform:t,layer:n,colorMap:i}=e,{x1:a,y1:o,x2:s,y2:l,stroke_width:c,layer:u="top",pcb_silkscreen_line_id:A}=r;if(n&&u!==n)return[];if(typeof a!="number"||typeof o!="number"||typeof s!="number"||typeof l!="number")return console.error("Invalid coordinates:",{x1:a,y1:o,x2:s,y2:l}),[];const[d,h]=qr(t,[a,o]),[m,C]=qr(t,[s,l]),E=c*Math.abs(t.a),_=u==="bottom"?i.silkscreen.bottom:i.silkscreen.top;return[{name:"line",type:"element",attributes:{x1:d.toString(),y1:h.toString(),x2:m.toString(),y2:C.toString(),stroke:_,"stroke-width":E.toString(),class:`pcb-silkscreen-line pcb-silkscreen-${u}`,"data-pcb-silkscreen-line-id":A},value:"",children:[]}]}function qJt(r){const e=[];for(let t=0;t<r.length-1;t++)e.push([r[t],r[t+1]]);return e}var sx={copper:{top:"rgb(200, 52, 52)",bottom:"rgb(77, 127, 196)"},soldermask:{top:"rgb(200, 52, 52)",bottom:"rgb(77, 127, 196)"},drill:"#FF26E2",silkscreen:{top:"#f2eda1",bottom:"#5da9e9"},boardOutline:"rgba(255, 255, 255, 0.5)",debugComponent:{fill:null,stroke:null}};sx.drill,sx.silkscreen.top,sx.silkscreen.bottom,sx.copper.top,sx.copper.bottom;function U3(r,e=sx){return e.copper[r]??"white"}var XJt={bottom:"rgb(105, 105, 105)",top:"rgb(105, 105, 105)"};function dz(r){return XJt[r]??"rgb(105, 105, 105)"}function $Jt(r,e){const{transform:t,layer:n,colorMap:i}=e;if(!r.route||!Array.isArray(r.route)||r.route.length<2)return[];const a=qJt(r.route),o=[];for(const[s,l]of a){const c=qr(t,[s.x,s.y]),u=qr(t,[l.x,l.y]),A="layer"in s?s.layer:"layer"in l?l.layer:null;if(!A||n&&A!==n)continue;const d=i.soldermask[A]??U3(A,i),h="width"in s?s.width:"width"in l?l.width:null,m={name:"path",type:"element",value:"",children:[],attributes:{class:"pcb-trace",stroke:d,fill:"none",d:`M ${c[0]} ${c[1]} L ${u[0]} ${u[1]}`,"stroke-width":h?(h*Math.abs(t.a)).toString():"0.3","stroke-linecap":"round","stroke-linejoin":"round","shape-rendering":"crispEdges","data-layer":A}};o.push(m)}return o.sort((s,l)=>{const c=s.attributes["data-layer"],u=l.attributes["data-layer"];return c==="bottom"&&u!=="bottom"?-1:c==="top"&&u!=="top"?1:0}),o}function eWt(r,e){const{transform:t,layer:n,colorMap:i}=e;if(n&&r.layer!==n)return[];if(r.shape==="rect"||r.shape==="rotated_rect"){const a=r.width*Math.abs(t.a),o=r.height*Math.abs(t.d),[s,l]=qr(t,[r.x,r.y]);return r.shape==="rotated_rect"&&r.ccw_rotation?[{name:"rect",type:"element",attributes:{class:"pcb-pad",fill:U3(r.layer,i),x:(-a/2).toString(),y:(-o/2).toString(),width:a.toString(),height:o.toString(),transform:`translate(${s} ${l}) rotate(${-r.ccw_rotation})`,"data-layer":r.layer}}]:[{name:"rect",type:"element",attributes:{class:"pcb-pad",fill:U3(r.layer,i),x:(s-a/2).toString(),y:(l-o/2).toString(),width:a.toString(),height:o.toString(),"data-layer":r.layer}}]}if(r.shape==="pill"){const a=r.width*Math.abs(t.a),o=r.height*Math.abs(t.d),s=r.radius*Math.abs(t.a),[l,c]=qr(t,[r.x,r.y]);return[{name:"rect",type:"element",attributes:{class:"pcb-pad",fill:U3(r.layer,i),x:(l-a/2).toString(),y:(c-o/2).toString(),width:a.toString(),height:o.toString(),rx:s.toString(),ry:s.toString(),"data-layer":r.layer}}]}if(r.shape==="circle"){const a=r.radius*Math.abs(t.a),[o,s]=qr(t,[r.x,r.y]);return[{name:"circle",type:"element",attributes:{class:"pcb-pad",fill:U3(r.layer,i),cx:o.toString(),cy:s.toString(),r:a.toString(),"data-layer":r.layer}}]}if(r.shape==="polygon"){const a=(r.points??[]).map(o=>qr(t,[o.x,o.y]));return[{name:"polygon",type:"element",attributes:{class:"pcb-pad",fill:U3(r.layer),points:a.map(o=>o.join(",")).join(" "),"data-layer":r.layer}}]}return[]}function sze(r,e){const{transform:t,colorMap:n}=e,{width:i,height:a,center:o,outline:s}=r;let l;if(s&&Array.isArray(s)&&s.length>=3)l=s.map((c,u)=>{const[A,d]=qr(t,[c.x,c.y]);return u===0?`M ${A} ${d}`:`L ${A} ${d}`}).join(" ");else{const c=i/2,u=a/2,A=qr(t,[o.x-c,o.y-u]),d=qr(t,[o.x+c,o.y-u]),h=qr(t,[o.x+c,o.y+u]),m=qr(t,[o.x-c,o.y+u]);l=`M ${A[0]} ${A[1]} L ${d[0]} ${d[1]} L ${h[0]} ${h[1]} L ${m[0]} ${m[1]}`}return l+=" Z",[{name:"path",type:"element",value:"",children:[],attributes:{class:"pcb-board",d:l,fill:"none",stroke:n.boardOutline,"stroke-width":(.1*Math.abs(t.a)).toString()}}]}function tWt(r,e){const{transform:t,colorMap:n}=e,[i,a]=qr(t,[r.x,r.y]),o=r.outer_diameter*Math.abs(t.a),s=r.outer_diameter*Math.abs(t.a),l=r.hole_diameter*Math.abs(t.a),c=r.hole_diameter*Math.abs(t.a),u=Math.min(o,s)/2,A=Math.min(l,c)/2;return{name:"g",type:"element",children:[{name:"circle",type:"element",attributes:{class:"pcb-hole-outer",fill:n.copper.top,cx:i.toString(),cy:a.toString(),r:u.toString()}},{name:"circle",type:"element",attributes:{class:"pcb-hole-inner",fill:n.drill,cx:i.toString(),cy:a.toString(),r:A.toString()}}]}}function nWt(r,e){const{transform:t,colorMap:n}=e,[i,a]=qr(t,[r.x,r.y]);if(r.hole_shape==="circle"||r.hole_shape==="square"){const o=r.hole_diameter*Math.abs(t.a),s=o/2;return r.hole_shape==="circle"?[{name:"circle",type:"element",attributes:{class:"pcb-hole",cx:i.toString(),cy:a.toString(),r:s.toString(),fill:n.drill},children:[],value:""}]:[{name:"rect",type:"element",attributes:{class:"pcb-hole",x:(i-s).toString(),y:(a-s).toString(),width:o.toString(),height:o.toString(),fill:n.drill},children:[],value:""}]}if(r.hole_shape==="oval"){const o=r.hole_width*Math.abs(t.a),s=r.hole_height*Math.abs(t.a),l=o/2,c=s/2;return[{name:"ellipse",type:"element",attributes:{class:"pcb-hole",cx:i.toString(),cy:a.toString(),rx:l.toString(),ry:c.toString(),fill:n.drill},children:[],value:""}]}return[]}var rWt=(r,e)=>{const t=D_(e).pcb_smtpad.get(r);if(t&&"x"in t&&"y"in t)return{x:t.x,y:t.y};const n=D_(e).pcb_plated_hole.get(r);return n&&"x"in n&&"y"in n?{x:n.x,y:n.y}:null},iWt=(r,e,t,n)=>{const i=t.getIdsConnectedToNet(e);let a=null,o=1/0;for(const s of i){const l=rWt(s,n);if(l){const c=r.x-l.x,u=r.y-l.y,A=Math.sqrt(c*c+u*u);A>0&&A<o&&(o=A,a=l)}}return a};function aWt(r,e){const{transform:t}=e,n=vQ(r),i=r.filter(l=>l.type==="pcb_port"),a=r.filter(l=>l.type==="source_trace"),o=[];i.forEach((l,c)=>{const u=l.pcb_port_id;if(!u)return;const A=n.getNetConnectedToId(u);if(!A)return;let d=!1;const h=D_(r).source_port.getWhere({pcb_port_id:u});if(h&&h.source_port_id){const E=h.source_port_id;for(const _ of a)if(Array.isArray(_.connected_source_port_ids)&&_.connected_source_port_ids.includes(E)&&Array.isArray(_.connected_source_net_ids)&&_.connected_source_net_ids.length>0){d=!0;break}}const m={x:l.x,y:l.y},C=iWt(m,A,n,r);C&&o.push({key:`${u}-${c}`,startPoint:m,endPoint:C,isInNet:d})});const s=[];for(const l of o){const c=qr(t,[l.startPoint.x,l.startPoint.y]),u=qr(t,[l.endPoint.x,l.endPoint.y]),A={x1:c[0].toString(),y1:c[1].toString(),x2:u[0].toString(),y2:u[1].toString(),stroke:"white","stroke-width":"1","stroke-dasharray":"6,6"};s.push({name:"line",type:"element",attributes:A,value:"",children:[]})}return s}function oWt(r,e){const{transform:t,colorMap:n}=e;if(r.shape==="rect"){const i=r,[a,o]=qr(t,[i.center.x,i.center.y]),s=i.width*Math.abs(t.a),l=i.height*Math.abs(t.d),c=-(i.rotation??0);return[{name:"rect",type:"element",attributes:{class:"pcb-cutout pcb-cutout-rect",x:(-s/2).toString(),y:(-l/2).toString(),width:s.toString(),height:l.toString(),fill:n.drill,transform:n2(tA(df(a,o),SB(c*Math.PI/180)))},children:[],value:""}]}if(r.shape==="circle"){const i=r,[a,o]=qr(t,[i.center.x,i.center.y]),s=i.radius*Math.abs(t.a);return[{name:"circle",type:"element",attributes:{class:"pcb-cutout pcb-cutout-circle",cx:a.toString(),cy:o.toString(),r:s.toString(),fill:n.drill},children:[],value:""}]}if(r.shape==="polygon"){const i=r;return!i.points||i.points.length===0?[]:[{name:"polygon",type:"element",attributes:{class:"pcb-cutout pcb-cutout-polygon",points:i.points.map(s=>qr(t,[s.x,s.y])).map(s=>`${s[0]},${s[1]}`).join(" "),fill:n.drill},children:[],value:""}]}return[]}function sWt(r,e){var d,h;const{transform:t}=e,{center:n,width:i,height:a,rotation:o=0}=r,[s,l]=qr(t,[n.x,n.y]),c=i*Math.abs(t.a),u=a*Math.abs(t.d),A=`translate(${s}, ${l}) rotate(${-o}) scale(1, -1)`;return!((d=e.colorMap.debugComponent)!=null&&d.fill)&&!((h=e.colorMap.debugComponent)!=null&&h.stroke)?[]:[{name:"g",type:"element",attributes:{transform:A},children:[{name:"rect",type:"element",attributes:{class:"pcb-component",x:(-c/2).toString(),y:(-u/2).toString(),width:c.toString(),height:u.toString(),fill:e.colorMap.debugComponent.fill??"transparent",stroke:e.colorMap.debugComponent.stroke??"transparent"}}],value:""}]}function aP(r){const e=r.find(t=>t.type==="project_software_metadata"||t.type==="source_project_metadata");return e==null?void 0:e.software_used_string}var lWt={version:"0.0.171"},oP=lWt.version,lze=["pcb_trace_error","pcb_plated_hole","pcb_fabrication_note_text","pcb_fabrication_note_path","pcb_silkscreen_text","pcb_silkscreen_path","pcb_via","pcb_cutout","pcb_smtpad","pcb_trace","pcb_component","pcb_board"];function cze(r,e){var Ft,et,yt,_t,Ot,Xt,kt,Wn;const t=(e==null?void 0:e.drawPaddingOutsideBoard)??!0,n=e==null?void 0:e.layer,i=e==null?void 0:e.colorOverrides,a={copper:{top:((Ft=i==null?void 0:i.copper)==null?void 0:Ft.top)??sx.copper.top,bottom:((et=i==null?void 0:i.copper)==null?void 0:et.bottom)??sx.copper.bottom},drill:(i==null?void 0:i.drill)??sx.drill,silkscreen:{top:((yt=i==null?void 0:i.silkscreen)==null?void 0:yt.top)??sx.silkscreen.top,bottom:((_t=i==null?void 0:i.silkscreen)==null?void 0:_t.bottom)??sx.silkscreen.bottom},boardOutline:(i==null?void 0:i.boardOutline)??sx.boardOutline,soldermask:{top:((Ot=i==null?void 0:i.soldermask)==null?void 0:Ot.top)??sx.soldermask.top,bottom:((Xt=i==null?void 0:i.soldermask)==null?void 0:Xt.bottom)??sx.soldermask.bottom},debugComponent:{fill:((kt=i==null?void 0:i.debugComponent)==null?void 0:kt.fill)??sx.debugComponent.fill,stroke:((Wn=i==null?void 0:i.debugComponent)==null?void 0:Wn.stroke)??sx.debugComponent.stroke}};let o=Number.POSITIVE_INFINITY,s=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY,c=Number.NEGATIVE_INFINITY,u=Number.POSITIVE_INFINITY,A=Number.POSITIVE_INFINITY,d=Number.NEGATIVE_INFINITY,h=Number.NEGATIVE_INFINITY;for(const un of r)if(un.type==="pcb_board")un.outline&&Array.isArray(un.outline)&&un.outline.length>=3?(qe(un.outline),ft(un.outline)):"center"in un&&"width"in un&&"height"in un&&(Ne(un.center,un.width,un.height),nt(un.center,un.width,un.height));else if("x"in un&&"y"in un)Ne({x:un.x,y:un.y},0,0);else if(un.type==="pcb_smtpad"){const Zt=un;Zt.shape==="rect"||Zt.shape==="rotated_rect"||Zt.shape==="pill"?Ne({x:Zt.x,y:Zt.y},Zt.width,Zt.height):Zt.shape==="circle"?Ne({x:Zt.x,y:Zt.y},Zt.radius*2,Zt.radius*2):Zt.shape==="polygon"&&It(Zt.points)}else"route"in un?It(un.route):(un.type==="pcb_silkscreen_text"||un.type==="pcb_silkscreen_rect"||un.type==="pcb_silkscreen_circle"||un.type==="pcb_silkscreen_line")&&Ut(un);const m=t?1:0,C=t||!isFinite(u)?o:u,E=t||!isFinite(A)?s:A,_=t||!isFinite(d)?l:d,B=t||!isFinite(h)?c:h,w=_-C+2*m,P=B-E+2*m;let O=(e==null?void 0:e.width)??800,G=(e==null?void 0:e.height)??600;if(e!=null&&e.matchBoardAspectRatio){const un=d-u,Zt=h-A;if(un>0&&Zt>0){const tr=un/Zt;e!=null&&e.width&&!(e!=null&&e.height)?G=e.width/tr:e!=null&&e.height&&!(e!=null&&e.width)?O=e.height*tr:G=O/tr}}const Y=[];for(const un of r)"route"in un&&un.route!==void 0&&Y.push(un.route);const K=O/w,Z=G/P,V=Math.min(K,Z),se=(O-w*V)/2,ie=(G-P*V)/2,de=tA(df(se-C*V+m*V,G-ie+E*V-m*V),PE(V,-V)),Ce={transform:de,layer:n,shouldDrawErrors:e==null?void 0:e.shouldDrawErrors,drawPaddingOutsideBoard:t,colorMap:a};function xe(un){if(un.type==="pcb_smtpad")return un.layer==="top"||un.layer==="bottom"?un.layer:void 0;if(un.type==="pcb_trace")for(const Zt of un.route??[]){const tr="layer"in Zt&&Zt.layer||"from_layer"in Zt&&Zt.from_layer||"to_layer"in Zt&&Zt.to_layer||void 0;if(tr==="top"||tr==="bottom")return tr}}function fe(un){return un.type==="pcb_trace"||un.type==="pcb_smtpad"}let Ie=r.sort((un,Zt)=>{const tr=xe(un),Nr=xe(Zt);if(fe(un)&&fe(Zt)&&tr!==Nr){if(tr==="top")return 1;if(Nr==="top"||tr==="bottom")return-1;if(Nr==="bottom")return 1}return(lze.indexOf(Zt.type)??9999)-(lze.indexOf(un.type)??9999)}).flatMap(un=>cWt({elm:un,circuitJson:r,ctx:Ce}));for(const un of r)if("stroke_width"in un){String(V*un.stroke_width);break}if(e!=null&&e.shouldDrawRatsNest){const un=aWt(r,Ce);Ie=Ie.concat(un)}const ye=[{name:"style",type:"element",value:"",attributes:{},children:[{type:"text",value:"",name:"",attributes:{},children:[]}]},{name:"rect",type:"element",value:"",attributes:{class:"boundary",x:"0",y:"0",fill:(e==null?void 0:e.backgroundColor)??"#000",width:O.toString(),height:G.toString()},children:[]}];t&&ye.push(uWt(de,o,s,l,c)),ye.push(...Ie);const Me=aP(r),Qe=oP,Ue={name:"svg",type:"element",attributes:{xmlns:"http://www.w3.org/2000/svg",width:O.toString(),height:G.toString(),...Me&&{"data-software-used-string":Me},...(e==null?void 0:e.includeVersion)&&{"data-circuit-to-svg-version":Qe}},value:"",children:ye.filter(un=>un!==null)};try{return Az(Ue)}catch(un){throw console.error("Error stringifying SVG object:",un),un}function Ne(un,Zt,tr){const Nr=Zt/2,cr=tr/2;o=Math.min(o,un.x-Nr),s=Math.min(s,un.y-cr),l=Math.max(l,un.x+Nr),c=Math.max(c,un.y+cr)}function nt(un,Zt,tr){const Nr=Zt/2,cr=tr/2;u=Math.min(u,un.x-Nr),A=Math.min(A,un.y-cr),d=Math.max(d,un.x+Nr),h=Math.max(h,un.y+cr)}function qe(un){for(const Zt of un)o=Math.min(o,Zt.x),s=Math.min(s,Zt.y),l=Math.max(l,Zt.x),c=Math.max(c,Zt.y)}function ft(un){for(const Zt of un)u=Math.min(u,Zt.x),A=Math.min(A,Zt.y),d=Math.max(d,Zt.x),h=Math.max(h,Zt.y)}function It(un){for(const Zt of un)o=Math.min(o,Zt.x),s=Math.min(s,Zt.y),l=Math.max(l,Zt.x),c=Math.max(c,Zt.y)}function Ut(un){if(un.type==="pcb_silkscreen_text")Ne(un.anchor_position,0,0);else if(un.type==="pcb_silkscreen_path")It(un.route);else if(un.type==="pcb_silkscreen_rect")Ne(un.center,un.width,un.height);else if(un.type==="pcb_silkscreen_circle")Ne(un.center,un.radius*2,un.radius*2);else if(un.type==="pcb_silkscreen_line")Ne({x:un.x1,y:un.y1},0,0),Ne({x:un.x2,y:un.y2},0,0);else if(un.type==="pcb_cutout"){const Zt=un;Zt.shape==="rect"?Ne(Zt.center,Zt.width,Zt.height):Zt.shape==="circle"?Ne(Zt.center,Zt.radius*2,Zt.radius*2):Zt.shape==="polygon"&&It(Zt.points)}}}function cWt({elm:r,circuitJson:e,ctx:t}){switch(r.type){case"pcb_trace_error":return OJt(r,e,t).filter(Boolean);case"pcb_component":return sWt(r,t).filter(Boolean);case"pcb_trace":return $Jt(r,t);case"pcb_plated_hole":return VJt(r,t).filter(Boolean);case"pcb_hole":return nWt(r,t);case"pcb_smtpad":return eWt(r,t);case"pcb_silkscreen_text":return jJt(r,t);case"pcb_silkscreen_rect":return JJt(r,t);case"pcb_silkscreen_circle":return WJt(r,t);case"pcb_silkscreen_line":return ZJt(r,t);case"pcb_fabrication_note_path":return HJt(r,t);case"pcb_fabrication_note_text":return YJt(r,t);case"pcb_silkscreen_path":return KJt(r,t);case"pcb_board":return t.drawPaddingOutsideBoard?sze(r,t):[];case"pcb_via":return tWt(r,t);case"pcb_cutout":return oWt(r,t);default:return[]}}function uWt(r,e,t,n,i){const[a,o]=qr(r,[e,t]),[s,l]=qr(r,[n,i]),c=Math.abs(s-a),u=Math.abs(l-o),A=Math.min(a,s),d=Math.min(o,l);return{name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-boundary",fill:"none",stroke:"#fff","stroke-width":"0.3",x:A.toString(),y:d.toString(),width:c.toString(),height:u.toString()}}}var AWt=cze,fz={fill:"none",stroke:"rgb(0,0,0)",strokeOpacity:"0.8",strokeWidthFactor:.2};function dWt(r,e,t={}){const{width:n,height:i,center:a,outline:o}=r;let s;if(o&&Array.isArray(o)&&o.length>=3)s=o.map((l,c)=>{const[u,A]=qr(e,[l.x,l.y]);return c===0?`M ${u} ${A}`:`L ${u} ${A}`}).join(" ");else{const l=n/2,c=i/2,u=qr(e,[a.x-l,a.y-c]),A=qr(e,[a.x+l,a.y-c]),d=qr(e,[a.x+l,a.y+c]),h=qr(e,[a.x-l,a.y+c]);s=`M ${u[0]} ${u[1]} L ${A[0]} ${A[1]} L ${d[0]} ${d[1]} L ${h[0]} ${h[1]}`}return s+=" Z",[{name:"path",type:"element",value:"",children:[],attributes:{class:"pcb-board",d:s,fill:t.fill??fz.fill,stroke:t.stroke??fz.stroke,"stroke-opacity":t.strokeOpacity??fz.strokeOpacity,"stroke-width":((t.strokeWidthFactor??fz.strokeWidthFactor)*Math.abs(e.a)).toString()}}]}var fWt={pin_number:.15,negated_pin_number:.15*.8,reference_designator:.18,manufacturer_number:.18,net_label:.18,error:.05},F3=(r,e)=>e??fWt[r],QQ=(r,e,t)=>Math.abs(r.a)*F3(e,t);function hWt(r,e){const{elm:t,portPosition:n,name:i,arePinsInterchangeable:a}=r,{transform:o}=e,{center:s,width:l,height:c,rotation:u=0,layer:A="top"}=t;if(!s||typeof l!="number"||typeof c!="number")return null;const[d,h]=qr(o,[s.x,s.y]),[m,C]=qr(o,[n.x,n.y]),E=l*Math.abs(o.a),_=c*Math.abs(o.d),B=C>h,w=m<d,P=[pWt(E,_,u,A),gWt(E,_,i??"")];return a||P.push(mWt(E,_,u,A,B,w)),{name:"g",type:"element",value:"",attributes:{transform:`translate(${d}, ${h}) scale(1, -1)`},children:P}}function pWt(r,e,t,n){const i=r/2,a=e/2;return{name:"path",type:"element",attributes:{class:"assembly-component",d:yWt(i,a,t),"stroke-width":.8.toFixed(2),transform:`rotate(${-t})`,"stroke-dasharray":n==="bottom"?"2,2":""},value:"",children:[]}}function gWt(r,e,t,n){const i=Math.min(r,e),l=Math.min(58,Math.max(3,i*.8)),c=e>r;return{name:"text",type:"element",attributes:{x:"0",y:"0",class:"assembly-component-label","text-anchor":"middle",dy:".10em",style:"pointer-events: none","font-size":`${l.toFixed(1)}px`,transform:c?"rotate(90) scale(1, -1)":"scale(1, -1)"},children:[{type:"text",value:t||"",name:"",attributes:{},children:[]}],value:""}}function mWt(r,e,t,n,i,a){const o=r/2,s=e/2,l=Math.min(o,s)*.5;let c;return i&&a?c=[[-o,-s],[-o+l,-s],[-o,-s+l]]:i&&!a?c=[[o,-s],[o-l,-s],[o,-s+l]]:!i&&a?c=[[-o,s],[-o+l,s],[-o,s-l]]:c=[[o,s],[o-l,s],[o,s-l]],{name:"polygon",type:"element",attributes:{class:"assembly-pin1-indicator",points:c.map(A=>A.join(",")).join(" "),fill:"#333",stroke:"none",transform:`rotate(${-t})`},value:"",children:[]}}function yWt(r,e,t){const n=(s,l,c)=>{const u=Math.PI/180*c,A=Math.cos(u),d=Math.sin(u);return[s*A-l*d,s*d+l*A]};return`${[[-r,-e],[r,-e],[r,e],[-r,e]].map(([s,l])=>n(s,l,t)).map(([s,l],c)=>c===0?`M${s},${l}`:`L${s},${l}`).join(" ")} Z`}var tAe="rgb(190, 190, 190)";function vWt(r,e){const{transform:t}=e,[n,i]=qr(t,[r.x,r.y]);if(r.hole_shape==="circle"||r.hole_shape==="square"){const a=r.hole_diameter*Math.abs(t.a),o=a/2;return r.hole_shape==="circle"?[{name:"circle",type:"element",attributes:{class:"assembly-hole",cx:n.toString(),cy:i.toString(),r:o.toString(),fill:tAe},children:[],value:""}]:[{name:"rect",type:"element",attributes:{class:"assembly-hole",x:(n-o).toString(),y:(i-o).toString(),width:a.toString(),height:a.toString(),fill:tAe},children:[],value:""}]}if(r.hole_shape==="oval"){const a=r.hole_width*Math.abs(t.a),o=r.hole_height*Math.abs(t.a),s=a/2,l=o/2;return[{name:"ellipse",type:"element",attributes:{class:"assembly-hole",cx:n.toString(),cy:i.toString(),rx:s.toString(),ry:l.toString(),fill:tAe},children:[],value:""}]}return[]}var hz="rgb(210, 210, 210)",pz="rgb(190, 190, 190)";function IWt(r,e){const{transform:t}=e,[n,i]=qr(t,[r.x,r.y]);if(r.shape==="pill"){const a=r.outer_width*Math.abs(t.a),o=r.outer_height*Math.abs(t.a),s=r.hole_width*Math.abs(t.a),l=r.hole_height*Math.abs(t.a),c=a/2,u=o-a,A=s/2;return[{name:"g",type:"element",children:[{name:"path",type:"element",attributes:{class:"assembly-hole-outer",fill:hz,d:`M${n-c},${i-u/2} v${u} a${c},${c} 0 0 0 ${a},0 v-${u} a${c},${c} 0 0 0 -${a},0 z`},value:"",children:[]},{name:"path",type:"element",attributes:{class:"assembly-hole-inner",fill:pz,d:`M${n-A},${i-(l-s)/2} v${l-s} a${A},${A} 0 0 0 ${s},0 v-${l-s} a${A},${A} 0 0 0 -${s},0 z`},value:"",children:[]}],value:"",attributes:{}}]}if(r.shape==="circle"){const a=r.outer_diameter*Math.abs(t.a),o=r.outer_diameter*Math.abs(t.a),s=r.hole_diameter*Math.abs(t.a),l=r.hole_diameter*Math.abs(t.a),c=Math.min(a,o)/2,u=Math.min(s,l)/2;return[{name:"g",type:"element",children:[{name:"circle",type:"element",attributes:{class:"assembly-hole-outer",fill:hz,cx:n.toString(),cy:i.toString(),r:c.toString()},value:"",children:[]},{name:"circle",type:"element",attributes:{class:"assembly-hole-inner",fill:pz,cx:n.toString(),cy:i.toString(),r:u.toString()},value:"",children:[]}],value:"",attributes:{}}]}if(r.shape==="circular_hole_with_rect_pad"){const a=r.hole_diameter*Math.abs(t.a),o=r.rect_pad_width*Math.abs(t.a),s=r.rect_pad_height*Math.abs(t.a),l=a/2;return[{name:"g",type:"element",children:[{name:"rect",type:"element",attributes:{class:"assembly-hole-outer-pad",fill:hz,x:(n-o/2).toString(),y:(i-s/2).toString(),width:o.toString(),height:s.toString()},value:"",children:[]},{name:"circle",type:"element",attributes:{class:"assembly-hole-inner",fill:pz,cx:n.toString(),cy:i.toString(),r:l.toString()},value:"",children:[]}],value:"",attributes:{}}]}if(r.shape==="pill_hole_with_rect_pad"){const a=r.rect_pad_width*Math.abs(t.a),o=r.rect_pad_height*Math.abs(t.a),s=r.hole_height*Math.abs(t.a),l=r.hole_width*Math.abs(t.a),c=Math.min(s,l)/2;return[{name:"g",type:"element",children:[{name:"rect",type:"element",attributes:{class:"assembly-hole-outer-pad",fill:hz,x:(n-a/2).toString(),y:(i-o/2).toString(),width:a.toString(),height:o.toString()},value:"",children:[]},{name:"rect",type:"element",attributes:{class:"assembly-hole-inner",fill:pz,x:(n-l/2).toString(),y:(i-s/2).toString(),width:l.toString(),height:s.toString(),rx:c.toString(),ry:c.toString()},value:"",children:[]}],value:"",attributes:{}}]}return[]}var sP="rgb(210, 210, 210)";function CWt(r,e){const{transform:t}=e;if(r.shape==="rect"||r.shape==="rotated_rect"){const n=r.width*Math.abs(t.a),i=r.height*Math.abs(t.d),[a,o]=qr(t,[r.x,r.y]);return r.shape==="rotated_rect"&&r.ccw_rotation?[{name:"rect",type:"element",attributes:{class:"assembly-pad",fill:sP,x:(-n/2).toString(),y:(-i/2).toString(),width:n.toString(),height:i.toString(),transform:`translate(${a} ${o}) rotate(${-r.ccw_rotation})`,"data-layer":r.layer},value:"",children:[]}]:[{name:"rect",type:"element",attributes:{class:"assembly-pad",fill:sP,x:(a-n/2).toString(),y:(o-i/2).toString(),width:n.toString(),height:i.toString(),"data-layer":r.layer},value:"",children:[]}]}if(r.shape==="pill"){const n=r.width*Math.abs(t.a),i=r.height*Math.abs(t.d),a=r.radius*Math.abs(t.a),[o,s]=qr(t,[r.x,r.y]);return[{name:"rect",type:"element",attributes:{class:"assembly-pad",fill:sP,x:(o-n/2).toString(),y:(s-i/2).toString(),width:n.toString(),height:i.toString(),rx:a.toString(),ry:a.toString(),"data-layer":r.layer},value:"",children:[]}]}if(r.shape==="circle"){const n=r.radius*Math.abs(t.a),[i,a]=qr(t,[r.x,r.y]);return[{name:"circle",type:"element",attributes:{class:"assembly-pad",fill:sP,cx:i.toString(),cy:a.toString(),r:n.toString(),"data-layer":r.layer},value:"",children:[]}]}if(r.shape==="polygon"){const n=(r.points??[]).map(i=>qr(t,[i.x,i.y]));return[{name:"polygon",type:"element",attributes:{class:"assembly-pad",fill:sP,points:n.map(i=>i.join(",")).join(" "),"data-layer":r.layer},value:"",children:[]}]}return[]}var uze=["pcb_component","pcb_smtpad","pcb_hole","pcb_plated_hole","pcb_board"];function Aze(r,e){let t=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY,a=Number.NEGATIVE_INFINITY;for(const G of r)if(G.type==="pcb_board"){const Y=G.center,K=G.width||0,Z=G.height||0;t=Math.min(t,Y.x-K/2),n=Math.min(n,Y.y-Z/2),i=Math.max(i,Y.x+K/2),a=Math.max(a,Y.y+Z/2)}const o=1,s=i-t+2*o,l=a-n+2*o,c=(e==null?void 0:e.width)??800,u=(e==null?void 0:e.height)??600,A=c/s,d=u/l,h=Math.min(A,d),m=(c-s*h)/2,C=(u-l*h)/2,E=tA(df(m-t*h+o*h,u-C+n*h-o*h),PE(h,-h)),_={transform:E},B=r.sort((G,Y)=>(uze.indexOf(Y.type)??9999)-(uze.indexOf(G.type)??9999)).flatMap(G=>EWt(G,_,r)),w=aP(r),P=oP,O={name:"svg",type:"element",attributes:{xmlns:"http://www.w3.org/2000/svg",width:c.toString(),height:u.toString(),...w&&{"data-software-used-string":w},...(e==null?void 0:e.includeVersion)&&{"data-circuit-to-svg-version":P}},value:"",children:[{name:"style",type:"element",children:[{type:"text",value:`
13241
+ `),O=P.length===1?[{type:"text",value:o,name:"",attributes:{},children:[]}]:P.map((Y,K)=>({type:"element",name:"tspan",value:"",attributes:{x:"0",...K>0?{dy:h.toString()}:{}},children:[{type:"text",value:Y,name:"",attributes:{},children:[]}]}));return[{name:"text",type:"element",attributes:{x:"0",y:"0",dx:E.toString(),dy:_.toString(),fill:w,"font-family":"Arial, sans-serif","font-size":h.toString(),"text-anchor":m,"dominant-baseline":C,transform:n2(B),class:`pcb-silkscreen-text pcb-silkscreen-${l}`,"data-pcb-silkscreen-text-id":r.pcb_component_id,stroke:"none"},children:O,value:""}]}function JJt(r,e){const{transform:t,layer:n,colorMap:i}=e,{center:a,width:o,height:s,layer:l="top",pcb_silkscreen_rect_id:c,stroke_width:u,is_filled:A,has_stroke:d,is_stroke_dashed:h}=r;if(n&&l!==n)return[];if(!a||typeof a.x!="number"||typeof a.y!="number"||typeof o!="number"||typeof s!="number")return console.error("Invalid rectangle data:",{center:a,width:o,height:s}),[];const[m,C]=qr(t,[a.x,a.y]),E=o*Math.abs(t.a),_=s*Math.abs(t.d),B=u*Math.abs(t.a),w=l==="bottom"?i.silkscreen.bottom:i.silkscreen.top,P={x:(m-E/2).toString(),y:(C-_/2).toString(),width:E.toString(),height:_.toString(),class:`pcb-silkscreen-rect pcb-silkscreen-${l}`,"data-pcb-silkscreen-rect-id":c};P.fill=A?w:"none";let O;if(d===void 0?O=B>0:O=d,O){if(P.stroke=w,P["stroke-width"]=B.toString(),h){const Y=.1*Math.abs(t.a),K=.05*Math.abs(t.a);P["stroke-dasharray"]=`${Y} ${K}`}}else P.stroke="none";return[{name:"rect",type:"element",attributes:P,value:"",children:[]}]}function WJt(r,e){const{transform:t,layer:n,colorMap:i}=e,{center:a,radius:o,layer:s="top",pcb_silkscreen_circle_id:l,stroke_width:c=1}=r;if(n&&s!==n)return[];if(!a||typeof a.x!="number"||typeof a.y!="number"||typeof o!="number")return console.error("Invalid PCB Silkscreen Circle data:",{center:a,radius:o}),[];const[u,A]=qr(t,[a.x,a.y]),d=o*Math.abs(t.a),h=c*Math.abs(t.a),m=s==="bottom"?i.silkscreen.bottom:i.silkscreen.top;return[{name:"circle",type:"element",attributes:{cx:u.toString(),cy:A.toString(),r:d.toString(),class:`pcb-silkscreen-circle pcb-silkscreen-${s}`,stroke:m,"stroke-width":h.toString(),"data-pcb-silkscreen-circle-id":l},value:"",children:[]}]}function ZJt(r,e){const{transform:t,layer:n,colorMap:i}=e,{x1:a,y1:o,x2:s,y2:l,stroke_width:c,layer:u="top",pcb_silkscreen_line_id:A}=r;if(n&&u!==n)return[];if(typeof a!="number"||typeof o!="number"||typeof s!="number"||typeof l!="number")return console.error("Invalid coordinates:",{x1:a,y1:o,x2:s,y2:l}),[];const[d,h]=qr(t,[a,o]),[m,C]=qr(t,[s,l]),E=c*Math.abs(t.a),_=u==="bottom"?i.silkscreen.bottom:i.silkscreen.top;return[{name:"line",type:"element",attributes:{x1:d.toString(),y1:h.toString(),x2:m.toString(),y2:C.toString(),stroke:_,"stroke-width":E.toString(),class:`pcb-silkscreen-line pcb-silkscreen-${u}`,"data-pcb-silkscreen-line-id":A},value:"",children:[]}]}function qJt(r){const e=[];for(let t=0;t<r.length-1;t++)e.push([r[t],r[t+1]]);return e}var sx={copper:{top:"rgb(200, 52, 52)",bottom:"rgb(77, 127, 196)"},soldermask:{top:"rgb(200, 52, 52)",bottom:"rgb(77, 127, 196)"},drill:"#FF26E2",silkscreen:{top:"#f2eda1",bottom:"#5da9e9"},boardOutline:"rgba(255, 255, 255, 0.5)",debugComponent:{fill:null,stroke:null}};sx.drill,sx.silkscreen.top,sx.silkscreen.bottom,sx.copper.top,sx.copper.bottom;function U3(r,e=sx){return e.copper[r]??"white"}var XJt={bottom:"rgb(105, 105, 105)",top:"rgb(105, 105, 105)"};function dz(r){return XJt[r]??"rgb(105, 105, 105)"}function $Jt(r,e){const{transform:t,layer:n,colorMap:i}=e;if(!r.route||!Array.isArray(r.route)||r.route.length<2)return[];const a=qJt(r.route),o=[];for(const[s,l]of a){const c=qr(t,[s.x,s.y]),u=qr(t,[l.x,l.y]),A="layer"in s?s.layer:"layer"in l?l.layer:null;if(!A||n&&A!==n)continue;const d=i.soldermask[A]??U3(A,i),h="width"in s?s.width:"width"in l?l.width:null,m={name:"path",type:"element",value:"",children:[],attributes:{class:"pcb-trace",stroke:d,fill:"none",d:`M ${c[0]} ${c[1]} L ${u[0]} ${u[1]}`,"stroke-width":h?(h*Math.abs(t.a)).toString():"0.3","stroke-linecap":"round","stroke-linejoin":"round","shape-rendering":"crispEdges","data-layer":A}};o.push(m)}return o.sort((s,l)=>{const c=s.attributes["data-layer"],u=l.attributes["data-layer"];return c==="bottom"&&u!=="bottom"?-1:c==="top"&&u!=="top"?1:0}),o}function eWt(r,e){const{transform:t,layer:n,colorMap:i}=e;if(n&&r.layer!==n)return[];if(r.shape==="rect"||r.shape==="rotated_rect"){const a=r.width*Math.abs(t.a),o=r.height*Math.abs(t.d),[s,l]=qr(t,[r.x,r.y]);return r.shape==="rotated_rect"&&r.ccw_rotation?[{name:"rect",type:"element",attributes:{class:"pcb-pad",fill:U3(r.layer,i),x:(-a/2).toString(),y:(-o/2).toString(),width:a.toString(),height:o.toString(),transform:`translate(${s} ${l}) rotate(${-r.ccw_rotation})`,"data-layer":r.layer}}]:[{name:"rect",type:"element",attributes:{class:"pcb-pad",fill:U3(r.layer,i),x:(s-a/2).toString(),y:(l-o/2).toString(),width:a.toString(),height:o.toString(),"data-layer":r.layer}}]}if(r.shape==="pill"){const a=r.width*Math.abs(t.a),o=r.height*Math.abs(t.d),s=r.radius*Math.abs(t.a),[l,c]=qr(t,[r.x,r.y]);return[{name:"rect",type:"element",attributes:{class:"pcb-pad",fill:U3(r.layer,i),x:(l-a/2).toString(),y:(c-o/2).toString(),width:a.toString(),height:o.toString(),rx:s.toString(),ry:s.toString(),"data-layer":r.layer}}]}if(r.shape==="circle"){const a=r.radius*Math.abs(t.a),[o,s]=qr(t,[r.x,r.y]);return[{name:"circle",type:"element",attributes:{class:"pcb-pad",fill:U3(r.layer,i),cx:o.toString(),cy:s.toString(),r:a.toString(),"data-layer":r.layer}}]}if(r.shape==="polygon"){const a=(r.points??[]).map(o=>qr(t,[o.x,o.y]));return[{name:"polygon",type:"element",attributes:{class:"pcb-pad",fill:U3(r.layer),points:a.map(o=>o.join(",")).join(" "),"data-layer":r.layer}}]}return[]}function sze(r,e){const{transform:t,colorMap:n}=e,{width:i,height:a,center:o,outline:s}=r;let l;if(s&&Array.isArray(s)&&s.length>=3)l=s.map((c,u)=>{const[A,d]=qr(t,[c.x,c.y]);return u===0?`M ${A} ${d}`:`L ${A} ${d}`}).join(" ");else{const c=i/2,u=a/2,A=qr(t,[o.x-c,o.y-u]),d=qr(t,[o.x+c,o.y-u]),h=qr(t,[o.x+c,o.y+u]),m=qr(t,[o.x-c,o.y+u]);l=`M ${A[0]} ${A[1]} L ${d[0]} ${d[1]} L ${h[0]} ${h[1]} L ${m[0]} ${m[1]}`}return l+=" Z",[{name:"path",type:"element",value:"",children:[],attributes:{class:"pcb-board",d:l,fill:"none",stroke:n.boardOutline,"stroke-width":(.1*Math.abs(t.a)).toString()}}]}function tWt(r,e){const{transform:t,colorMap:n}=e,[i,a]=qr(t,[r.x,r.y]),o=r.outer_diameter*Math.abs(t.a),s=r.outer_diameter*Math.abs(t.a),l=r.hole_diameter*Math.abs(t.a),c=r.hole_diameter*Math.abs(t.a),u=Math.min(o,s)/2,A=Math.min(l,c)/2;return{name:"g",type:"element",children:[{name:"circle",type:"element",attributes:{class:"pcb-hole-outer",fill:n.copper.top,cx:i.toString(),cy:a.toString(),r:u.toString()}},{name:"circle",type:"element",attributes:{class:"pcb-hole-inner",fill:n.drill,cx:i.toString(),cy:a.toString(),r:A.toString()}}]}}function nWt(r,e){const{transform:t,colorMap:n}=e,[i,a]=qr(t,[r.x,r.y]);if(r.hole_shape==="circle"||r.hole_shape==="square"){const o=r.hole_diameter*Math.abs(t.a),s=o/2;return r.hole_shape==="circle"?[{name:"circle",type:"element",attributes:{class:"pcb-hole",cx:i.toString(),cy:a.toString(),r:s.toString(),fill:n.drill},children:[],value:""}]:[{name:"rect",type:"element",attributes:{class:"pcb-hole",x:(i-s).toString(),y:(a-s).toString(),width:o.toString(),height:o.toString(),fill:n.drill},children:[],value:""}]}if(r.hole_shape==="oval"){const o=r.hole_width*Math.abs(t.a),s=r.hole_height*Math.abs(t.a),l=o/2,c=s/2;return[{name:"ellipse",type:"element",attributes:{class:"pcb-hole",cx:i.toString(),cy:a.toString(),rx:l.toString(),ry:c.toString(),fill:n.drill},children:[],value:""}]}return[]}var rWt=(r,e)=>{const t=D_(e).pcb_smtpad.get(r);if(t&&"x"in t&&"y"in t)return{x:t.x,y:t.y};const n=D_(e).pcb_plated_hole.get(r);return n&&"x"in n&&"y"in n?{x:n.x,y:n.y}:null},iWt=(r,e,t,n)=>{const i=t.getIdsConnectedToNet(e);let a=null,o=1/0;for(const s of i){const l=rWt(s,n);if(l){const c=r.x-l.x,u=r.y-l.y,A=Math.sqrt(c*c+u*u);A>0&&A<o&&(o=A,a=l)}}return a};function aWt(r,e){const{transform:t}=e,n=vQ(r),i=r.filter(l=>l.type==="pcb_port"),a=r.filter(l=>l.type==="source_trace"),o=[];i.forEach((l,c)=>{const u=l.pcb_port_id;if(!u)return;const A=n.getNetConnectedToId(u);if(!A)return;let d=!1;const h=D_(r).source_port.getWhere({pcb_port_id:u});if(h&&h.source_port_id){const E=h.source_port_id;for(const _ of a)if(Array.isArray(_.connected_source_port_ids)&&_.connected_source_port_ids.includes(E)&&Array.isArray(_.connected_source_net_ids)&&_.connected_source_net_ids.length>0){d=!0;break}}const m={x:l.x,y:l.y},C=iWt(m,A,n,r);C&&o.push({key:`${u}-${c}`,startPoint:m,endPoint:C,isInNet:d})});const s=[];for(const l of o){const c=qr(t,[l.startPoint.x,l.startPoint.y]),u=qr(t,[l.endPoint.x,l.endPoint.y]),A={x1:c[0].toString(),y1:c[1].toString(),x2:u[0].toString(),y2:u[1].toString(),stroke:"white","stroke-width":"1","stroke-dasharray":"6,6"};s.push({name:"line",type:"element",attributes:A,value:"",children:[]})}return s}function oWt(r,e){const{transform:t,colorMap:n}=e;if(r.shape==="rect"){const i=r,[a,o]=qr(t,[i.center.x,i.center.y]),s=i.width*Math.abs(t.a),l=i.height*Math.abs(t.d),c=-(i.rotation??0);return[{name:"rect",type:"element",attributes:{class:"pcb-cutout pcb-cutout-rect",x:(-s/2).toString(),y:(-l/2).toString(),width:s.toString(),height:l.toString(),fill:n.drill,transform:n2(tA(df(a,o),SB(c*Math.PI/180)))},children:[],value:""}]}if(r.shape==="circle"){const i=r,[a,o]=qr(t,[i.center.x,i.center.y]),s=i.radius*Math.abs(t.a);return[{name:"circle",type:"element",attributes:{class:"pcb-cutout pcb-cutout-circle",cx:a.toString(),cy:o.toString(),r:s.toString(),fill:n.drill},children:[],value:""}]}if(r.shape==="polygon"){const i=r;return!i.points||i.points.length===0?[]:[{name:"polygon",type:"element",attributes:{class:"pcb-cutout pcb-cutout-polygon",points:i.points.map(s=>qr(t,[s.x,s.y])).map(s=>`${s[0]},${s[1]}`).join(" "),fill:n.drill},children:[],value:""}]}return[]}function sWt(r,e){var d,h;const{transform:t}=e,{center:n,width:i,height:a,rotation:o=0}=r,[s,l]=qr(t,[n.x,n.y]),c=i*Math.abs(t.a),u=a*Math.abs(t.d),A=`translate(${s}, ${l}) rotate(${-o}) scale(1, -1)`;return!((d=e.colorMap.debugComponent)!=null&&d.fill)&&!((h=e.colorMap.debugComponent)!=null&&h.stroke)?[]:[{name:"g",type:"element",attributes:{transform:A},children:[{name:"rect",type:"element",attributes:{class:"pcb-component",x:(-c/2).toString(),y:(-u/2).toString(),width:c.toString(),height:u.toString(),fill:e.colorMap.debugComponent.fill??"transparent",stroke:e.colorMap.debugComponent.stroke??"transparent"}}],value:""}]}function aP(r){const e=r.find(t=>t.type==="project_software_metadata"||t.type==="source_project_metadata");return e==null?void 0:e.software_used_string}var lWt={version:"0.0.172"},oP=lWt.version,lze=["pcb_trace_error","pcb_plated_hole","pcb_fabrication_note_text","pcb_fabrication_note_path","pcb_silkscreen_text","pcb_silkscreen_path","pcb_via","pcb_cutout","pcb_smtpad","pcb_trace","pcb_component","pcb_board"];function cze(r,e){var Ft,et,yt,_t,Ot,Xt,kt,Wn;const t=(e==null?void 0:e.drawPaddingOutsideBoard)??!0,n=e==null?void 0:e.layer,i=e==null?void 0:e.colorOverrides,a={copper:{top:((Ft=i==null?void 0:i.copper)==null?void 0:Ft.top)??sx.copper.top,bottom:((et=i==null?void 0:i.copper)==null?void 0:et.bottom)??sx.copper.bottom},drill:(i==null?void 0:i.drill)??sx.drill,silkscreen:{top:((yt=i==null?void 0:i.silkscreen)==null?void 0:yt.top)??sx.silkscreen.top,bottom:((_t=i==null?void 0:i.silkscreen)==null?void 0:_t.bottom)??sx.silkscreen.bottom},boardOutline:(i==null?void 0:i.boardOutline)??sx.boardOutline,soldermask:{top:((Ot=i==null?void 0:i.soldermask)==null?void 0:Ot.top)??sx.soldermask.top,bottom:((Xt=i==null?void 0:i.soldermask)==null?void 0:Xt.bottom)??sx.soldermask.bottom},debugComponent:{fill:((kt=i==null?void 0:i.debugComponent)==null?void 0:kt.fill)??sx.debugComponent.fill,stroke:((Wn=i==null?void 0:i.debugComponent)==null?void 0:Wn.stroke)??sx.debugComponent.stroke}};let o=Number.POSITIVE_INFINITY,s=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY,c=Number.NEGATIVE_INFINITY,u=Number.POSITIVE_INFINITY,A=Number.POSITIVE_INFINITY,d=Number.NEGATIVE_INFINITY,h=Number.NEGATIVE_INFINITY;for(const un of r)if(un.type==="pcb_board")un.outline&&Array.isArray(un.outline)&&un.outline.length>=3?(qe(un.outline),ft(un.outline)):"center"in un&&"width"in un&&"height"in un&&(Ne(un.center,un.width,un.height),nt(un.center,un.width,un.height));else if("x"in un&&"y"in un)Ne({x:un.x,y:un.y},0,0);else if(un.type==="pcb_smtpad"){const Zt=un;Zt.shape==="rect"||Zt.shape==="rotated_rect"||Zt.shape==="pill"?Ne({x:Zt.x,y:Zt.y},Zt.width,Zt.height):Zt.shape==="circle"?Ne({x:Zt.x,y:Zt.y},Zt.radius*2,Zt.radius*2):Zt.shape==="polygon"&&It(Zt.points)}else"route"in un?It(un.route):(un.type==="pcb_silkscreen_text"||un.type==="pcb_silkscreen_rect"||un.type==="pcb_silkscreen_circle"||un.type==="pcb_silkscreen_line")&&Ut(un);const m=t?1:0,C=t||!isFinite(u)?o:u,E=t||!isFinite(A)?s:A,_=t||!isFinite(d)?l:d,B=t||!isFinite(h)?c:h,w=_-C+2*m,P=B-E+2*m;let O=(e==null?void 0:e.width)??800,G=(e==null?void 0:e.height)??600;if(e!=null&&e.matchBoardAspectRatio){const un=d-u,Zt=h-A;if(un>0&&Zt>0){const tr=un/Zt;e!=null&&e.width&&!(e!=null&&e.height)?G=e.width/tr:e!=null&&e.height&&!(e!=null&&e.width)?O=e.height*tr:G=O/tr}}const Y=[];for(const un of r)"route"in un&&un.route!==void 0&&Y.push(un.route);const K=O/w,Z=G/P,V=Math.min(K,Z),se=(O-w*V)/2,ie=(G-P*V)/2,de=tA(df(se-C*V+m*V,G-ie+E*V-m*V),PE(V,-V)),Ce={transform:de,layer:n,shouldDrawErrors:e==null?void 0:e.shouldDrawErrors,drawPaddingOutsideBoard:t,colorMap:a};function xe(un){if(un.type==="pcb_smtpad")return un.layer==="top"||un.layer==="bottom"?un.layer:void 0;if(un.type==="pcb_trace")for(const Zt of un.route??[]){const tr="layer"in Zt&&Zt.layer||"from_layer"in Zt&&Zt.from_layer||"to_layer"in Zt&&Zt.to_layer||void 0;if(tr==="top"||tr==="bottom")return tr}}function fe(un){return un.type==="pcb_trace"||un.type==="pcb_smtpad"}let Ie=r.sort((un,Zt)=>{const tr=xe(un),Nr=xe(Zt);if(fe(un)&&fe(Zt)&&tr!==Nr){if(tr==="top")return 1;if(Nr==="top"||tr==="bottom")return-1;if(Nr==="bottom")return 1}return(lze.indexOf(Zt.type)??9999)-(lze.indexOf(un.type)??9999)}).flatMap(un=>cWt({elm:un,circuitJson:r,ctx:Ce}));for(const un of r)if("stroke_width"in un){String(V*un.stroke_width);break}if(e!=null&&e.shouldDrawRatsNest){const un=aWt(r,Ce);Ie=Ie.concat(un)}const ye=[{name:"style",type:"element",value:"",attributes:{},children:[{type:"text",value:"",name:"",attributes:{},children:[]}]},{name:"rect",type:"element",value:"",attributes:{class:"boundary",x:"0",y:"0",fill:(e==null?void 0:e.backgroundColor)??"#000",width:O.toString(),height:G.toString()},children:[]}];t&&ye.push(uWt(de,o,s,l,c)),ye.push(...Ie);const Me=aP(r),Qe=oP,Ue={name:"svg",type:"element",attributes:{xmlns:"http://www.w3.org/2000/svg",width:O.toString(),height:G.toString(),...Me&&{"data-software-used-string":Me},...(e==null?void 0:e.includeVersion)&&{"data-circuit-to-svg-version":Qe}},value:"",children:ye.filter(un=>un!==null)};try{return Az(Ue)}catch(un){throw console.error("Error stringifying SVG object:",un),un}function Ne(un,Zt,tr){const Nr=Zt/2,cr=tr/2;o=Math.min(o,un.x-Nr),s=Math.min(s,un.y-cr),l=Math.max(l,un.x+Nr),c=Math.max(c,un.y+cr)}function nt(un,Zt,tr){const Nr=Zt/2,cr=tr/2;u=Math.min(u,un.x-Nr),A=Math.min(A,un.y-cr),d=Math.max(d,un.x+Nr),h=Math.max(h,un.y+cr)}function qe(un){for(const Zt of un)o=Math.min(o,Zt.x),s=Math.min(s,Zt.y),l=Math.max(l,Zt.x),c=Math.max(c,Zt.y)}function ft(un){for(const Zt of un)u=Math.min(u,Zt.x),A=Math.min(A,Zt.y),d=Math.max(d,Zt.x),h=Math.max(h,Zt.y)}function It(un){for(const Zt of un)o=Math.min(o,Zt.x),s=Math.min(s,Zt.y),l=Math.max(l,Zt.x),c=Math.max(c,Zt.y)}function Ut(un){if(un.type==="pcb_silkscreen_text")Ne(un.anchor_position,0,0);else if(un.type==="pcb_silkscreen_path")It(un.route);else if(un.type==="pcb_silkscreen_rect")Ne(un.center,un.width,un.height);else if(un.type==="pcb_silkscreen_circle")Ne(un.center,un.radius*2,un.radius*2);else if(un.type==="pcb_silkscreen_line")Ne({x:un.x1,y:un.y1},0,0),Ne({x:un.x2,y:un.y2},0,0);else if(un.type==="pcb_cutout"){const Zt=un;Zt.shape==="rect"?Ne(Zt.center,Zt.width,Zt.height):Zt.shape==="circle"?Ne(Zt.center,Zt.radius*2,Zt.radius*2):Zt.shape==="polygon"&&It(Zt.points)}}}function cWt({elm:r,circuitJson:e,ctx:t}){switch(r.type){case"pcb_trace_error":return OJt(r,e,t).filter(Boolean);case"pcb_component":return sWt(r,t).filter(Boolean);case"pcb_trace":return $Jt(r,t);case"pcb_plated_hole":return VJt(r,t).filter(Boolean);case"pcb_hole":return nWt(r,t);case"pcb_smtpad":return eWt(r,t);case"pcb_silkscreen_text":return jJt(r,t);case"pcb_silkscreen_rect":return JJt(r,t);case"pcb_silkscreen_circle":return WJt(r,t);case"pcb_silkscreen_line":return ZJt(r,t);case"pcb_fabrication_note_path":return HJt(r,t);case"pcb_fabrication_note_text":return YJt(r,t);case"pcb_silkscreen_path":return KJt(r,t);case"pcb_board":return t.drawPaddingOutsideBoard?sze(r,t):[];case"pcb_via":return tWt(r,t);case"pcb_cutout":return oWt(r,t);default:return[]}}function uWt(r,e,t,n,i){const[a,o]=qr(r,[e,t]),[s,l]=qr(r,[n,i]),c=Math.abs(s-a),u=Math.abs(l-o),A=Math.min(a,s),d=Math.min(o,l);return{name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-boundary",fill:"none",stroke:"#fff","stroke-width":"0.3",x:A.toString(),y:d.toString(),width:c.toString(),height:u.toString()}}}var AWt=cze,fz={fill:"none",stroke:"rgb(0,0,0)",strokeOpacity:"0.8",strokeWidthFactor:.2};function dWt(r,e,t={}){const{width:n,height:i,center:a,outline:o}=r;let s;if(o&&Array.isArray(o)&&o.length>=3)s=o.map((l,c)=>{const[u,A]=qr(e,[l.x,l.y]);return c===0?`M ${u} ${A}`:`L ${u} ${A}`}).join(" ");else{const l=n/2,c=i/2,u=qr(e,[a.x-l,a.y-c]),A=qr(e,[a.x+l,a.y-c]),d=qr(e,[a.x+l,a.y+c]),h=qr(e,[a.x-l,a.y+c]);s=`M ${u[0]} ${u[1]} L ${A[0]} ${A[1]} L ${d[0]} ${d[1]} L ${h[0]} ${h[1]}`}return s+=" Z",[{name:"path",type:"element",value:"",children:[],attributes:{class:"pcb-board",d:s,fill:t.fill??fz.fill,stroke:t.stroke??fz.stroke,"stroke-opacity":t.strokeOpacity??fz.strokeOpacity,"stroke-width":((t.strokeWidthFactor??fz.strokeWidthFactor)*Math.abs(e.a)).toString()}}]}var fWt={pin_number:.15,negated_pin_number:.15*.8,reference_designator:.18,manufacturer_number:.18,net_label:.18,error:.05},F3=(r,e)=>e??fWt[r],QQ=(r,e,t)=>Math.abs(r.a)*F3(e,t);function hWt(r,e){const{elm:t,portPosition:n,name:i,arePinsInterchangeable:a}=r,{transform:o}=e,{center:s,width:l,height:c,rotation:u=0,layer:A="top"}=t;if(!s||typeof l!="number"||typeof c!="number")return null;const[d,h]=qr(o,[s.x,s.y]),[m,C]=qr(o,[n.x,n.y]),E=l*Math.abs(o.a),_=c*Math.abs(o.d),B=C>h,w=m<d,P=[pWt(E,_,u,A),gWt(E,_,i??"")];return a||P.push(mWt(E,_,u,A,B,w)),{name:"g",type:"element",value:"",attributes:{transform:`translate(${d}, ${h}) scale(1, -1)`},children:P}}function pWt(r,e,t,n){const i=r/2,a=e/2;return{name:"path",type:"element",attributes:{class:"assembly-component",d:yWt(i,a,t),"stroke-width":.8.toFixed(2),transform:`rotate(${-t})`,"stroke-dasharray":n==="bottom"?"2,2":""},value:"",children:[]}}function gWt(r,e,t,n){const i=Math.min(r,e),l=Math.min(58,Math.max(3,i*.8)),c=e>r;return{name:"text",type:"element",attributes:{x:"0",y:"0",class:"assembly-component-label","text-anchor":"middle",dy:".10em",style:"pointer-events: none","font-size":`${l.toFixed(1)}px`,transform:c?"rotate(90) scale(1, -1)":"scale(1, -1)"},children:[{type:"text",value:t||"",name:"",attributes:{},children:[]}],value:""}}function mWt(r,e,t,n,i,a){const o=r/2,s=e/2,l=Math.min(o,s)*.5;let c;return i&&a?c=[[-o,-s],[-o+l,-s],[-o,-s+l]]:i&&!a?c=[[o,-s],[o-l,-s],[o,-s+l]]:!i&&a?c=[[-o,s],[-o+l,s],[-o,s-l]]:c=[[o,s],[o-l,s],[o,s-l]],{name:"polygon",type:"element",attributes:{class:"assembly-pin1-indicator",points:c.map(A=>A.join(",")).join(" "),fill:"#333",stroke:"none",transform:`rotate(${-t})`},value:"",children:[]}}function yWt(r,e,t){const n=(s,l,c)=>{const u=Math.PI/180*c,A=Math.cos(u),d=Math.sin(u);return[s*A-l*d,s*d+l*A]};return`${[[-r,-e],[r,-e],[r,e],[-r,e]].map(([s,l])=>n(s,l,t)).map(([s,l],c)=>c===0?`M${s},${l}`:`L${s},${l}`).join(" ")} Z`}var tAe="rgb(190, 190, 190)";function vWt(r,e){const{transform:t}=e,[n,i]=qr(t,[r.x,r.y]);if(r.hole_shape==="circle"||r.hole_shape==="square"){const a=r.hole_diameter*Math.abs(t.a),o=a/2;return r.hole_shape==="circle"?[{name:"circle",type:"element",attributes:{class:"assembly-hole",cx:n.toString(),cy:i.toString(),r:o.toString(),fill:tAe},children:[],value:""}]:[{name:"rect",type:"element",attributes:{class:"assembly-hole",x:(n-o).toString(),y:(i-o).toString(),width:a.toString(),height:a.toString(),fill:tAe},children:[],value:""}]}if(r.hole_shape==="oval"){const a=r.hole_width*Math.abs(t.a),o=r.hole_height*Math.abs(t.a),s=a/2,l=o/2;return[{name:"ellipse",type:"element",attributes:{class:"assembly-hole",cx:n.toString(),cy:i.toString(),rx:s.toString(),ry:l.toString(),fill:tAe},children:[],value:""}]}return[]}var hz="rgb(210, 210, 210)",pz="rgb(190, 190, 190)";function IWt(r,e){const{transform:t}=e,[n,i]=qr(t,[r.x,r.y]);if(r.shape==="pill"){const a=r.outer_width*Math.abs(t.a),o=r.outer_height*Math.abs(t.a),s=r.hole_width*Math.abs(t.a),l=r.hole_height*Math.abs(t.a),c=a/2,u=o-a,A=s/2;return[{name:"g",type:"element",children:[{name:"path",type:"element",attributes:{class:"assembly-hole-outer",fill:hz,d:`M${n-c},${i-u/2} v${u} a${c},${c} 0 0 0 ${a},0 v-${u} a${c},${c} 0 0 0 -${a},0 z`},value:"",children:[]},{name:"path",type:"element",attributes:{class:"assembly-hole-inner",fill:pz,d:`M${n-A},${i-(l-s)/2} v${l-s} a${A},${A} 0 0 0 ${s},0 v-${l-s} a${A},${A} 0 0 0 -${s},0 z`},value:"",children:[]}],value:"",attributes:{}}]}if(r.shape==="circle"){const a=r.outer_diameter*Math.abs(t.a),o=r.outer_diameter*Math.abs(t.a),s=r.hole_diameter*Math.abs(t.a),l=r.hole_diameter*Math.abs(t.a),c=Math.min(a,o)/2,u=Math.min(s,l)/2;return[{name:"g",type:"element",children:[{name:"circle",type:"element",attributes:{class:"assembly-hole-outer",fill:hz,cx:n.toString(),cy:i.toString(),r:c.toString()},value:"",children:[]},{name:"circle",type:"element",attributes:{class:"assembly-hole-inner",fill:pz,cx:n.toString(),cy:i.toString(),r:u.toString()},value:"",children:[]}],value:"",attributes:{}}]}if(r.shape==="circular_hole_with_rect_pad"){const a=r.hole_diameter*Math.abs(t.a),o=r.rect_pad_width*Math.abs(t.a),s=r.rect_pad_height*Math.abs(t.a),l=a/2;return[{name:"g",type:"element",children:[{name:"rect",type:"element",attributes:{class:"assembly-hole-outer-pad",fill:hz,x:(n-o/2).toString(),y:(i-s/2).toString(),width:o.toString(),height:s.toString()},value:"",children:[]},{name:"circle",type:"element",attributes:{class:"assembly-hole-inner",fill:pz,cx:n.toString(),cy:i.toString(),r:l.toString()},value:"",children:[]}],value:"",attributes:{}}]}if(r.shape==="pill_hole_with_rect_pad"){const a=r.rect_pad_width*Math.abs(t.a),o=r.rect_pad_height*Math.abs(t.a),s=r.hole_height*Math.abs(t.a),l=r.hole_width*Math.abs(t.a),c=Math.min(s,l)/2;return[{name:"g",type:"element",children:[{name:"rect",type:"element",attributes:{class:"assembly-hole-outer-pad",fill:hz,x:(n-a/2).toString(),y:(i-o/2).toString(),width:a.toString(),height:o.toString()},value:"",children:[]},{name:"rect",type:"element",attributes:{class:"assembly-hole-inner",fill:pz,x:(n-l/2).toString(),y:(i-s/2).toString(),width:l.toString(),height:s.toString(),rx:c.toString(),ry:c.toString()},value:"",children:[]}],value:"",attributes:{}}]}return[]}var sP="rgb(210, 210, 210)";function CWt(r,e){const{transform:t}=e;if(r.shape==="rect"||r.shape==="rotated_rect"){const n=r.width*Math.abs(t.a),i=r.height*Math.abs(t.d),[a,o]=qr(t,[r.x,r.y]);return r.shape==="rotated_rect"&&r.ccw_rotation?[{name:"rect",type:"element",attributes:{class:"assembly-pad",fill:sP,x:(-n/2).toString(),y:(-i/2).toString(),width:n.toString(),height:i.toString(),transform:`translate(${a} ${o}) rotate(${-r.ccw_rotation})`,"data-layer":r.layer},value:"",children:[]}]:[{name:"rect",type:"element",attributes:{class:"assembly-pad",fill:sP,x:(a-n/2).toString(),y:(o-i/2).toString(),width:n.toString(),height:i.toString(),"data-layer":r.layer},value:"",children:[]}]}if(r.shape==="pill"){const n=r.width*Math.abs(t.a),i=r.height*Math.abs(t.d),a=r.radius*Math.abs(t.a),[o,s]=qr(t,[r.x,r.y]);return[{name:"rect",type:"element",attributes:{class:"assembly-pad",fill:sP,x:(o-n/2).toString(),y:(s-i/2).toString(),width:n.toString(),height:i.toString(),rx:a.toString(),ry:a.toString(),"data-layer":r.layer},value:"",children:[]}]}if(r.shape==="circle"){const n=r.radius*Math.abs(t.a),[i,a]=qr(t,[r.x,r.y]);return[{name:"circle",type:"element",attributes:{class:"assembly-pad",fill:sP,cx:i.toString(),cy:a.toString(),r:n.toString(),"data-layer":r.layer},value:"",children:[]}]}if(r.shape==="polygon"){const n=(r.points??[]).map(i=>qr(t,[i.x,i.y]));return[{name:"polygon",type:"element",attributes:{class:"assembly-pad",fill:sP,points:n.map(i=>i.join(",")).join(" "),"data-layer":r.layer},value:"",children:[]}]}return[]}var uze=["pcb_component","pcb_smtpad","pcb_hole","pcb_plated_hole","pcb_board"];function Aze(r,e){let t=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY,a=Number.NEGATIVE_INFINITY;for(const G of r)if(G.type==="pcb_board"){const Y=G.center,K=G.width||0,Z=G.height||0;t=Math.min(t,Y.x-K/2),n=Math.min(n,Y.y-Z/2),i=Math.max(i,Y.x+K/2),a=Math.max(a,Y.y+Z/2)}const o=1,s=i-t+2*o,l=a-n+2*o,c=(e==null?void 0:e.width)??800,u=(e==null?void 0:e.height)??600,A=c/s,d=u/l,h=Math.min(A,d),m=(c-s*h)/2,C=(u-l*h)/2,E=tA(df(m-t*h+o*h,u-C+n*h-o*h),PE(h,-h)),_={transform:E},B=r.sort((G,Y)=>(uze.indexOf(Y.type)??9999)-(uze.indexOf(G.type)??9999)).flatMap(G=>EWt(G,_,r)),w=aP(r),P=oP,O={name:"svg",type:"element",attributes:{xmlns:"http://www.w3.org/2000/svg",width:c.toString(),height:u.toString(),...w&&{"data-software-used-string":w},...(e==null?void 0:e.includeVersion)&&{"data-circuit-to-svg-version":P}},value:"",children:[{name:"style",type:"element",children:[{type:"text",value:`
13242
13242
  .assembly-component {
13243
13243
  fill: none;
13244
13244
  stroke: #000;
@@ -13475,7 +13475,7 @@ $1`).replace(/>(\s*)(?=<!--\s*\/)/g,"> ")}return WAe}TXt();function LHe(r,e,t,n=
13475
13475
  &:hover {
13476
13476
  background-color: rgba(255, 255, 255, 0.1);
13477
13477
  }
13478
- `,onClick:n=>{n.stopPropagation(),t()},children:[ct.jsx("input",{type:"checkbox",checked:e}),ct.jsx("span",{style:{color:"#eee"},children:r})]}),snn=({children:r,elements:e})=>{const[t,n]=gE(K=>[K.is_mouse_over_container,K.setIsMouseOverContainer]),[i,a]=ht.useState(!1),[o,s]=ht.useState(!1),[l,c]=ht.useState(!1),[u,A]=gE(K=>[K.selected_layer,K.selectLayer]),[d,h,m,C,E,_]=gE(K=>[K.in_move_footprint_mode,K.in_draw_trace_mode,K.is_showing_rats_nest,K.is_showing_multiple_traces_length,K.is_showing_autorouting,K.is_showing_drc_errors]),B=gE(K=>K.setEditMode),w=gE(K=>K.setIsShowingRatsNest),P=gE(K=>K.setIsShowingMultipleTracesLength),O=gE(K=>K.setIsShowingAutorouting),G=gE(K=>K.setIsShowingDrcErrors);e9("1",()=>A("top")),e9("2",()=>A("bottom")),e9("3",()=>A("inner1")),e9("4",()=>A("inner2")),e9("5",()=>A("inner3")),e9("6",()=>A("inner4")),e9("7",()=>A("inner5")),e9("8",()=>A("inner6"));const Y=(e==null?void 0:e.filter(K=>K.type.includes("error")).length)??0;return ct.jsxs("div",{style:{position:"relative"},onMouseEnter:()=>{n(!0)},onMouseLeave:K=>{n(!1),s(!1)},children:[r,ct.jsxs("div",{style:{position:"absolute",bottom:4,right:8,pointerEvents:"none",color:"white",fontSize:11,opacity:t?.5:0,transition:"opacity 1s",transitionDelay:"2s",fontFamily:"sans-serif"},children:["@tscircuit/pcb-viewer@",ann.version]}),ct.jsxs("div",{style:{position:"absolute",opacity:t?1:0,top:16,left:16,transition:t?"opacity 100ms linear":"opacity 1s linear",zIndex:Hx.toolbarOverlay,color:"red",display:"flex",fontSize:12,height:100,fontFamily:"sans-serif"},children:[ct.jsxs(t5,{onClick:()=>{s(!o)},onMouseLeave:()=>{o&&s(!1)},children:[ct.jsxs("div",{children:["layer:"," ",ct.jsx("span",{style:{marginLeft:2,fontWeight:500,color:e5[u]},children:u})]}),o&&ct.jsx("div",{style:{marginTop:4,minWidth:120},children:Mde.map(K=>K.replace(/-/g,"")).map(K=>ct.jsx(onn,{name:K,selected:K===u,onClick:()=>{A(K.replace(/-/,""))}},K))})]}),ct.jsxs(t5,{style:Y>0?{color:"red"}:{},onClick:()=>c(!l),onMouseLeave:()=>c(!1),children:[ct.jsxs("div",{children:[Y," errors"]}),l&&ct.jsx("div",{style:{display:"grid",gridTemplateColumns:"100px 300px"},children:e==null?void 0:e.filter(K=>K.type.includes("error")).map((K,Z)=>ct.jsxs(ht.Fragment,{children:[ct.jsx("div",{children:K.error_type}),ct.jsx("div",{children:K.message})]},Z))})]}),ct.jsx(t5,{style:{},onClick:()=>{B(h?"off":"draw_trace")},children:ct.jsxs("div",{children:[h?"✖ ":"","Edit Traces"]})}),ct.jsx(t5,{style:{},onClick:()=>{B(d?"off":"move_footprint")},children:ct.jsxs("div",{children:[d?"✖ ":"","Move Components"]})}),ct.jsx(t5,{style:{},onClick:()=>{w(!m)},children:ct.jsxs("div",{children:[m?"✖ ":"","Rats Nest"]})}),ct.jsx(t5,{onClick:()=>{a(!i)},children:ct.jsxs("div",{children:[ct.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px"},children:["View"," ",ct.jsx("span",{style:{fontSize:"8px",transform:i?"rotate(180deg)":"rotate(0)",transition:"transform 0.1s ease",display:"inline-block"},children:"▼"})]}),i&&ct.jsxs("div",{style:{marginTop:4,minWidth:120},children:[ct.jsx(kde,{label:"Show All Trace Lengths",checked:C,onClick:()=>{P(!C)}}),ct.jsx(kde,{label:"Show Autorouting Animation",checked:E,onClick:()=>{O(!E)}}),ct.jsx(kde,{label:"Show DRC Errors",checked:_,onClick:()=>{G(!_)}})]})]})})]})]})},lnn=r=>{const{transform:e,elements:t}=r,[n,i]=ht.useMemo(()=>{const c=r.elements.flatMap(A=>vtn(A,r.elements)),u=vQ(r.elements);return[c,u]},[r.elements]),[a,o]=ht.useState({drawingObjectIdsWithMouseOver:new Set,primitiveIdsInMousedOverNet:[]}),s=ht.useMemo(()=>mtn({primitivesWithoutInteractionMetadata:n,drawingObjectIdsWithMouseOver:a.drawingObjectIdsWithMouseOver,primitiveIdsInMousedOverNet:a.primitiveIdsInMousedOverNet}),[n,a]),l=ht.useCallback(c=>{var d,h;const u=[];for(const m of c)if(m._element){const C=i.getNetConnectedToId("pcb_port_id"in m._element?(d=m._element)==null?void 0:d.pcb_port_id:"pcb_trace_id"in m._element?(h=m._element)==null?void 0:h.pcb_trace_id:"");u.push(...i.getIdsConnectedToNet(C))}const A=new Set(c.map(m=>m._pcb_drawing_object_id));o({drawingObjectIdsWithMouseOver:A,primitiveIdsInMousedOverNet:u})},[i]);return ct.jsx(rnn,{elements:t,transform:e,primitives:n,onMouseHoverOverPrimitives:l,children:ct.jsx(Gtn,{disabled:!r.allowEditing,transform:e,soup:t,cancelPanDrag:r.cancelPanDrag,onCreateEditEvent:r.onCreateEditEvent,onModifyEditEvent:r.onModifyEditEvent,children:ct.jsx(Ytn,{disabled:!r.allowEditing,transform:e,soup:t,cancelPanDrag:r.cancelPanDrag,onCreateEditEvent:r.onCreateEditEvent,onModifyEditEvent:r.onModifyEditEvent,children:ct.jsx(Ftn,{transform:e,focusOnHover:r.focusOnHover,children:ct.jsx(snn,{elements:t,children:ct.jsx(jtn,{transform:e,elements:t,children:ct.jsx(inn,{transform:e,soup:t,children:ct.jsx(ktn,{transform:e,debugGraphics:r.debugGraphics,children:ct.jsx(Utn,{transform:e,elements:t,children:ct.jsx(Ptn,{transform:e,primitives:s,width:r.width,height:r.height,grid:r.grid})})})})})})})})})})},cnn=tA(df(400,300),PE(40,-40)),unn=({circuitJson:r,debugGraphics:e,height:t=600,initialState:n,allowEditing:i=!0,editEvents:a,onEditEventsChanged:o,focusOnHover:s=!1,clickToInteractEnabled:l=!1})=>{const[c,u]=ht.useState(!l),[A,d]=Tde(),[h,m]=ht.useState(cnn),{ref:C,setTransform:E,cancelDrag:_}=gtn({transform:h,onSetTransform:m,enabled:c});let[B,w]=ht.useState([]);B=a??B;const P=ht.useRef(!1),O=ht.useRef(null),G=`${(r==null?void 0:r.length)||0}_${(r==null?void 0:r.editCount)||0}`,Y=()=>{const ie=(d==null?void 0:d.width)>0?d:{width:500,height:500},{center:de,width:Ce,height:xe}=Z.some(ye=>ye.type.startsWith("pcb_"))?otn(Z.filter(ye=>ye.type.startsWith("pcb_"))):{center:{x:0,y:0},width:.001,height:.001},fe=Math.min((ie.width??0)/Ce,(ie.height??0)/xe,100)*.75,Ie=tA(df((ie.width??0)/2,(ie.height??0)/2),PE(fe,-fe,0,0),df(-de.x,-de.y));E(Ie)};ht.useEffect(()=>{d!=null&&d.width&&r&&r.length!==0&&(P.current||(Y(),P.current=!0))},[r,d]);const K=ht.useMemo(()=>(r==null?void 0:r.filter(ie=>ie.type.startsWith("pcb_")||ie.type.startsWith("source_")))??[],[G]),Z=ht.useMemo(()=>vqt({circuitJson:K,editEvents:B}),[K,B]),V=ie=>{w([...B,ie]),o==null||o([...B,ie])},se=ie=>{const de=B.map(Ce=>Ce.edit_event_id===ie.edit_event_id?{...Ce,...ie}:Ce);w(de),o==null||o(de)};return ct.jsxs("div",{ref:C,style:{position:"relative"},children:[ct.jsx("div",{ref:A,children:ct.jsxs(ltn,{initialState:n,children:[ct.jsx(lnn,{transform:h,height:t,width:d.width,allowEditing:i,focusOnHover:s,cancelPanDrag:_,onCreateEditEvent:V,onModifyEditEvent:se,grid:{spacing:1,view_window:{left:0,right:d.width||500,top:t,bottom:0}},elements:Z,debugGraphics:e},d.width),ct.jsx(utn,{})]})}),l&&!c&&ct.jsx("div",{onClick:()=>{u(!0),Y()},onTouchStart:ie=>{const de=ie.touches[0];O.current={x:de.clientX,y:de.clientY}},onTouchEnd:ie=>{const de=ie.changedTouches[0],Ce=O.current;if(!Ce)return;const xe=Math.abs(de.clientX-Ce.x),fe=Math.abs(de.clientY-Ce.y);xe<10&&fe<10&&(ie.preventDefault(),u(!0),Y()),O.current=null},style:{position:"absolute",inset:0,cursor:"pointer",zIndex:Hx.clickToInteractOverlay,display:"flex",alignItems:"center",justifyContent:"center",touchAction:"pan-x pan-y pinch-zoom"},children:ct.jsx("div",{style:{backgroundColor:"rgba(0, 0, 0, 0.8)",color:"white",padding:"12px 24px",borderRadius:"8px",fontSize:"16px",pointerEvents:"none"},children:typeof window<"u"&&("ontouchstart"in window||navigator.maxTouchPoints>0)?"Touch to Interact":"Click to Interact"})})]})};const Ann=({containerClassName:r,...e})=>{const t=ht.useRef(null),[n,i]=ht.useState(620);return ht.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)}},[]),ct.jsx("div",{ref:t,className:r||"rf-w-full rf-h-full",children:ct.jsx(unn,{...e,height:n})})},dnn='*,: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-\\[101\\]{z-index:101!important}.rf-z-50{z-index:50}.rf-z-\\[100\\]{z-index:100}.rf-order-1{order:1}.rf-order-2{order:2}.rf-order-3{order:3}.rf-m-1{margin:.25rem}.rf-m-6{margin:1.5rem}.-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-4{margin-left:1rem;margin-right:1rem}.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-\\[400px\\]{height:400px}.rf-h-\\[calc\\(100vh-52px\\)\\]{height:calc(100vh - 52px)}.rf-h-\\[var\\(--radix-select-trigger-height\\)\\]{height:var(--radix-select-trigger-height)}.rf-h-auto{height:auto}.rf-h-fit{height:-moz-fit-content;height:fit-content}.rf-h-full{height:100%}.rf-h-px{height:1px}.rf-h-screen{height:100vh}.\\!rf-max-h-\\[40vh\\]{max-height:40vh!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-max-h-full{max-height:100%}.rf-min-h-0{min-height:0}.rf-min-h-\\[200px\\]{min-height:200px}.rf-min-h-\\[300px\\]{min-height:300px}.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-48{width:12rem}.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-\\[95\\%\\]{width:95%}.rf-w-fit{width:-moz-fit-content;width:fit-content}.rf-w-full{width:100%}.rf-min-w-0{min-width:0}.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-\\[660px\\]{max-width:660px!important}.rf-max-w-2xl{max-width:42rem}.rf-max-w-3xl{max-width:48rem}.rf-max-w-4xl{max-width:56rem}.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-none{max-width:none}.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-items-stretch{align-items:stretch}.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-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(.75rem*var(--tw-space-y-reverse));margin-top:calc(.75rem*(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}.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-orange-200{--tw-border-opacity:1;border-color:rgb(254 215 170/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-200{--tw-bg-opacity:1;background-color:rgb(229 231 235/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-400{--tw-bg-opacity:1;background-color:rgb(156 163 175/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-orange-50{--tw-bg-opacity:1;background-color:rgb(255 247 237/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-object-cover{-o-object-fit:cover;object-fit:cover}.\\!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-py-8{padding-bottom:2rem;padding-top:2rem}.rf-pb-0{padding-bottom:0}.rf-pb-2{padding-bottom:.5rem}.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-2{padding-top:.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-uppercase{text-transform:uppercase}.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-relaxed{line-height:1.625}.rf-leading-tight{line-height:1.25}.rf-tracking-wide{letter-spacing:.025em}.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-orange-500{--tw-text-opacity:1;color:rgb(249 115 22/var(--tw-text-opacity,1))}.rf-text-orange-600{--tw-text-opacity:1;color:rgb(234 88 12/var(--tw-text-opacity,1))}.rf-text-orange-800{--tw-text-opacity:1;color:rgb(154 52 18/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-opacity-75{opacity:.75}.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}.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-order-1{order:1}.sm\\:rf-order-2{order:2}.sm\\:rf-mt-0{margin-top:0}.sm\\:rf-inline{display:inline}.sm\\:rf-hidden{display:none}.sm\\:rf-w-auto{width:auto}.sm\\:rf-flex-row{flex-direction:row}.sm\\:rf-items-center{align-items:center}.sm\\:rf-justify-end{justify-content:flex-end}.sm\\:rf-gap-3{gap:.75rem}.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-px-4{padding-left:1rem;padding-right:1rem}.sm\\:rf-text-left{text-align:left}.sm\\:rf-text-sm{font-size:.875rem;line-height:1.25rem}.sm\\:rf-text-xl{font-size:1.25rem;line-height:1.75rem}}@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}',fnn=()=>{ht.useEffect(()=>{if(document.querySelector('style[data-styles="tscircuit-runframe"]'))return;const e=document.createElement("style");e.setAttribute("data-styles","tscircuit-runframe"),e.textContent=dnn,document.head.appendChild(e)},[])},hnn=r=>{ht.useEffect(()=>(r?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[r])},eKe=r=>`hsl(${zb.indexOf(r)*137.5%360}, 70%, 50%)`,pnn=({phaseTimings:r})=>{if(!r)return null;const e=Object.values(r).reduce((t,n)=>t+n,0);return ct.jsxs("div",{className:"rf-space-y-2 rf-w-full rf-px-4",children:[ct.jsx("div",{className:"rf-relative rf-h-8 rf-flex rf-rounded-sm",children:zb.map(t=>{const n=r[t]||0,i=n/e*100;return ct.jsx("div",{className:"rf-group/bar rf-relative rf-overflow-visible",style:{width:`${i}%`,backgroundColor:eKe(t)},children:ct.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,": ",n.toFixed(1),"ms"]})},t)})}),ct.jsxs("div",{className:"rf-text-xs rf-text-gray-500",children:["Total: ",e.toFixed(2),"ms"]})]})},gnn=({renderLog:r})=>{const[e,t]=ht.useState("chronological");if(!r)return ct.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 n=Object.entries((r==null?void 0:r.phaseTimings)??{});e==="chronological"?n.sort((a,o)=>zb.indexOf(a[0])-zb.indexOf(o[0])):n.sort((a,o)=>o[1]-a[1]);const i=n.reduce((a,[o,s])=>a+s,0);return ct.jsxs("div",{className:"rf-bg-white",children:[ct.jsxs("div",{className:"rf-flex rf-justify-between rf-items-center",children:[ct.jsx("div",{children:"Render Logs"}),ct.jsxs("div",{className:"rf-mb-4 rf-pr-2 rf-flex rf-text-xs rf-items-center",children:[ct.jsx("div",{className:"rf-mr-2",children:"Sort by:"}),ct.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:[ct.jsx("option",{value:"chronological",children:"Phase Order"}),ct.jsx("option",{value:"longest",children:"Duration"})]})]})]}),ct.jsx(pnn,{phaseTimings:r.phaseTimings}),ct.jsxs("table",{className:"rf-w-full rf-text-xs",children:[ct.jsx("thead",{children:ct.jsxs("tr",{children:[ct.jsx("th",{className:"rf-text-left rf-p-2",children:"Phase Order"}),ct.jsx("th",{className:"rf-text-left rf-p-2",children:"Phase"}),ct.jsx("th",{className:"rf-text-left rf-p-2",children:"Duration (ms)"})]})}),ct.jsx("tbody",{children:n.map(([a,o])=>ct.jsxs("tr",{children:[ct.jsx("td",{className:"rf-p-2",children:zb.indexOf(a)}),ct.jsx("td",{className:"rf-p-2",children:a}),ct.jsx("td",{className:"rf-p-2",children:ct.jsx("div",{className:"rf-w-8",children:ct.jsx("div",{className:"rf-h-2 rf-rounded-sm",style:{backgroundColor:eKe(a),width:`${o/i*100}%`}})})}),ct.jsx("td",{className:"rf-p-2",children:ct.jsxs("div",{className:"rf-flex w-full",children:[ct.jsxs("span",{className:"rf-flex-grow",children:[o,"ms"]}),ct.jsxs("span",{className:"rf-text-gray-500 rf-pr-2",children:[(o/i*100).toFixed(1),"%"]})]})})]},a))})]})]})},mnn=({errorMessage:r,errorStack:e,circuitJsonErrors:t})=>{ht.useEffect(()=>{if(r){const n=new Error(r);e&&(n.stack=e);try{t8.captureException(n)}catch{}}},[r,e]),ht.useEffect(()=>{if(t&&t.length>0)for(const n of t){const i=new Error(n.message||"Circuit JSON Error");n.stack&&(i.stack=n.stack);try{t8.captureException(i,{error_type:n.type})}catch{}}},[t])},ynn="0.0.710",Ude={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1},Fde=new Map,sH=r=>{const e=Fde.get(r);return e?Object.fromEntries(Object.entries(e.stores).map(([t,n])=>[t,n.getState()])):{}},vnn=(r,e,t)=>{if(r===void 0)return{type:"untracked",connection:e.connect(t)};const n=Fde.get(t.name);if(n)return{type:"tracked",store:r,...n};const i={connection:e.connect(t),stores:{}};return Fde.set(t.name,i),{type:"tracked",store:r,...i}},Inn=(r,e={})=>(t,n,i)=>{const{enabled:a,anonymousActionType:o,store:s,...l}=e;let c;try{c=(a??(Ude?"production":void 0)!=="production")&&window.__REDUX_DEVTOOLS_EXTENSION__}catch{}if(!c)return(Ude?"production":void 0)!=="production"&&a&&console.warn("[zustand devtools middleware] Please install/enable Redux devtools extension"),r(t,n,i);const{connection:u,...A}=vnn(s,c,l);let d=!0;i.setState=(C,E,_)=>{const B=t(C,E);if(!d)return B;const w=_===void 0?{type:o||"anonymous"}:typeof _=="string"?{type:_}:_;return s===void 0?(u==null||u.send(w,n()),B):(u==null||u.send({...w,type:`${s}/${w.type}`},{...sH(l.name),[s]:i.getState()}),B)};const h=(...C)=>{const E=d;d=!1,t(...C),d=E},m=r(i.setState,n,i);if(A.type==="untracked"?u==null||u.init(m):(A.stores[A.store]=i,u==null||u.init(Object.fromEntries(Object.entries(A.stores).map(([C,E])=>[C,C===A.store?m:E.getState()])))),i.dispatchFromDevtools&&typeof i.dispatch=="function"){let C=!1;const E=i.dispatch;i.dispatch=(..._)=>{(Ude?"production":void 0)!=="production"&&_[0].type==="__setState"&&!C&&(console.warn('[zustand devtools middleware] "__setState" action type is reserved to set state from the devtools. Avoid using it.'),C=!0),E(..._)}}return u.subscribe(C=>{var E;switch(C.type){case"ACTION":if(typeof C.payload!="string"){console.error("[zustand devtools middleware] Unsupported action format");return}return Lde(C.payload,_=>{if(_.type==="__setState"){if(s===void 0){h(_.state);return}Object.keys(_.state).length!==1&&console.error(`
13478
+ `,onClick:n=>{n.stopPropagation(),t()},children:[ct.jsx("input",{type:"checkbox",checked:e}),ct.jsx("span",{style:{color:"#eee"},children:r})]}),snn=({children:r,elements:e})=>{const[t,n]=gE(K=>[K.is_mouse_over_container,K.setIsMouseOverContainer]),[i,a]=ht.useState(!1),[o,s]=ht.useState(!1),[l,c]=ht.useState(!1),[u,A]=gE(K=>[K.selected_layer,K.selectLayer]),[d,h,m,C,E,_]=gE(K=>[K.in_move_footprint_mode,K.in_draw_trace_mode,K.is_showing_rats_nest,K.is_showing_multiple_traces_length,K.is_showing_autorouting,K.is_showing_drc_errors]),B=gE(K=>K.setEditMode),w=gE(K=>K.setIsShowingRatsNest),P=gE(K=>K.setIsShowingMultipleTracesLength),O=gE(K=>K.setIsShowingAutorouting),G=gE(K=>K.setIsShowingDrcErrors);e9("1",()=>A("top")),e9("2",()=>A("bottom")),e9("3",()=>A("inner1")),e9("4",()=>A("inner2")),e9("5",()=>A("inner3")),e9("6",()=>A("inner4")),e9("7",()=>A("inner5")),e9("8",()=>A("inner6"));const Y=(e==null?void 0:e.filter(K=>K.type.includes("error")).length)??0;return ct.jsxs("div",{style:{position:"relative"},onMouseEnter:()=>{n(!0)},onMouseLeave:K=>{n(!1),s(!1)},children:[r,ct.jsxs("div",{style:{position:"absolute",bottom:4,right:8,pointerEvents:"none",color:"white",fontSize:11,opacity:t?.5:0,transition:"opacity 1s",transitionDelay:"2s",fontFamily:"sans-serif"},children:["@tscircuit/pcb-viewer@",ann.version]}),ct.jsxs("div",{style:{position:"absolute",opacity:t?1:0,top:16,left:16,transition:t?"opacity 100ms linear":"opacity 1s linear",zIndex:Hx.toolbarOverlay,color:"red",display:"flex",fontSize:12,height:100,fontFamily:"sans-serif"},children:[ct.jsxs(t5,{onClick:()=>{s(!o)},onMouseLeave:()=>{o&&s(!1)},children:[ct.jsxs("div",{children:["layer:"," ",ct.jsx("span",{style:{marginLeft:2,fontWeight:500,color:e5[u]},children:u})]}),o&&ct.jsx("div",{style:{marginTop:4,minWidth:120},children:Mde.map(K=>K.replace(/-/g,"")).map(K=>ct.jsx(onn,{name:K,selected:K===u,onClick:()=>{A(K.replace(/-/,""))}},K))})]}),ct.jsxs(t5,{style:Y>0?{color:"red"}:{},onClick:()=>c(!l),onMouseLeave:()=>c(!1),children:[ct.jsxs("div",{children:[Y," errors"]}),l&&ct.jsx("div",{style:{display:"grid",gridTemplateColumns:"100px 300px"},children:e==null?void 0:e.filter(K=>K.type.includes("error")).map((K,Z)=>ct.jsxs(ht.Fragment,{children:[ct.jsx("div",{children:K.error_type}),ct.jsx("div",{children:K.message})]},Z))})]}),ct.jsx(t5,{style:{},onClick:()=>{B(h?"off":"draw_trace")},children:ct.jsxs("div",{children:[h?"✖ ":"","Edit Traces"]})}),ct.jsx(t5,{style:{},onClick:()=>{B(d?"off":"move_footprint")},children:ct.jsxs("div",{children:[d?"✖ ":"","Move Components"]})}),ct.jsx(t5,{style:{},onClick:()=>{w(!m)},children:ct.jsxs("div",{children:[m?"✖ ":"","Rats Nest"]})}),ct.jsx(t5,{onClick:()=>{a(!i)},children:ct.jsxs("div",{children:[ct.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px"},children:["View"," ",ct.jsx("span",{style:{fontSize:"8px",transform:i?"rotate(180deg)":"rotate(0)",transition:"transform 0.1s ease",display:"inline-block"},children:"▼"})]}),i&&ct.jsxs("div",{style:{marginTop:4,minWidth:120},children:[ct.jsx(kde,{label:"Show All Trace Lengths",checked:C,onClick:()=>{P(!C)}}),ct.jsx(kde,{label:"Show Autorouting Animation",checked:E,onClick:()=>{O(!E)}}),ct.jsx(kde,{label:"Show DRC Errors",checked:_,onClick:()=>{G(!_)}})]})]})})]})]})},lnn=r=>{const{transform:e,elements:t}=r,[n,i]=ht.useMemo(()=>{const c=r.elements.flatMap(A=>vtn(A,r.elements)),u=vQ(r.elements);return[c,u]},[r.elements]),[a,o]=ht.useState({drawingObjectIdsWithMouseOver:new Set,primitiveIdsInMousedOverNet:[]}),s=ht.useMemo(()=>mtn({primitivesWithoutInteractionMetadata:n,drawingObjectIdsWithMouseOver:a.drawingObjectIdsWithMouseOver,primitiveIdsInMousedOverNet:a.primitiveIdsInMousedOverNet}),[n,a]),l=ht.useCallback(c=>{var d,h;const u=[];for(const m of c)if(m._element){const C=i.getNetConnectedToId("pcb_port_id"in m._element?(d=m._element)==null?void 0:d.pcb_port_id:"pcb_trace_id"in m._element?(h=m._element)==null?void 0:h.pcb_trace_id:"");u.push(...i.getIdsConnectedToNet(C))}const A=new Set(c.map(m=>m._pcb_drawing_object_id));o({drawingObjectIdsWithMouseOver:A,primitiveIdsInMousedOverNet:u})},[i]);return ct.jsx(rnn,{elements:t,transform:e,primitives:n,onMouseHoverOverPrimitives:l,children:ct.jsx(Gtn,{disabled:!r.allowEditing,transform:e,soup:t,cancelPanDrag:r.cancelPanDrag,onCreateEditEvent:r.onCreateEditEvent,onModifyEditEvent:r.onModifyEditEvent,children:ct.jsx(Ytn,{disabled:!r.allowEditing,transform:e,soup:t,cancelPanDrag:r.cancelPanDrag,onCreateEditEvent:r.onCreateEditEvent,onModifyEditEvent:r.onModifyEditEvent,children:ct.jsx(Ftn,{transform:e,focusOnHover:r.focusOnHover,children:ct.jsx(snn,{elements:t,children:ct.jsx(jtn,{transform:e,elements:t,children:ct.jsx(inn,{transform:e,soup:t,children:ct.jsx(ktn,{transform:e,debugGraphics:r.debugGraphics,children:ct.jsx(Utn,{transform:e,elements:t,children:ct.jsx(Ptn,{transform:e,primitives:s,width:r.width,height:r.height,grid:r.grid})})})})})})})})})})},cnn=tA(df(400,300),PE(40,-40)),unn=({circuitJson:r,debugGraphics:e,height:t=600,initialState:n,allowEditing:i=!0,editEvents:a,onEditEventsChanged:o,focusOnHover:s=!1,clickToInteractEnabled:l=!1})=>{const[c,u]=ht.useState(!l),[A,d]=Tde(),[h,m]=ht.useState(cnn),{ref:C,setTransform:E,cancelDrag:_}=gtn({transform:h,onSetTransform:m,enabled:c});let[B,w]=ht.useState([]);B=a??B;const P=ht.useRef(!1),O=ht.useRef(null),G=`${(r==null?void 0:r.length)||0}_${(r==null?void 0:r.editCount)||0}`,Y=()=>{const ie=(d==null?void 0:d.width)>0?d:{width:500,height:500},{center:de,width:Ce,height:xe}=Z.some(ye=>ye.type.startsWith("pcb_"))?otn(Z.filter(ye=>ye.type.startsWith("pcb_"))):{center:{x:0,y:0},width:.001,height:.001},fe=Math.min((ie.width??0)/Ce,(ie.height??0)/xe,100)*.75,Ie=tA(df((ie.width??0)/2,(ie.height??0)/2),PE(fe,-fe,0,0),df(-de.x,-de.y));E(Ie)};ht.useEffect(()=>{d!=null&&d.width&&r&&r.length!==0&&(P.current||(Y(),P.current=!0))},[r,d]);const K=ht.useMemo(()=>(r==null?void 0:r.filter(ie=>ie.type.startsWith("pcb_")||ie.type.startsWith("source_")))??[],[G]),Z=ht.useMemo(()=>vqt({circuitJson:K,editEvents:B}),[K,B]),V=ie=>{w([...B,ie]),o==null||o([...B,ie])},se=ie=>{const de=B.map(Ce=>Ce.edit_event_id===ie.edit_event_id?{...Ce,...ie}:Ce);w(de),o==null||o(de)};return ct.jsxs("div",{ref:C,style:{position:"relative"},children:[ct.jsx("div",{ref:A,children:ct.jsxs(ltn,{initialState:n,children:[ct.jsx(lnn,{transform:h,height:t,width:d.width,allowEditing:i,focusOnHover:s,cancelPanDrag:_,onCreateEditEvent:V,onModifyEditEvent:se,grid:{spacing:1,view_window:{left:0,right:d.width||500,top:t,bottom:0}},elements:Z,debugGraphics:e},d.width),ct.jsx(utn,{})]})}),l&&!c&&ct.jsx("div",{onClick:()=>{u(!0),Y()},onTouchStart:ie=>{const de=ie.touches[0];O.current={x:de.clientX,y:de.clientY}},onTouchEnd:ie=>{const de=ie.changedTouches[0],Ce=O.current;if(!Ce)return;const xe=Math.abs(de.clientX-Ce.x),fe=Math.abs(de.clientY-Ce.y);xe<10&&fe<10&&(ie.preventDefault(),u(!0),Y()),O.current=null},style:{position:"absolute",inset:0,cursor:"pointer",zIndex:Hx.clickToInteractOverlay,display:"flex",alignItems:"center",justifyContent:"center",touchAction:"pan-x pan-y pinch-zoom"},children:ct.jsx("div",{style:{backgroundColor:"rgba(0, 0, 0, 0.8)",color:"white",padding:"12px 24px",borderRadius:"8px",fontSize:"16px",pointerEvents:"none"},children:typeof window<"u"&&("ontouchstart"in window||navigator.maxTouchPoints>0)?"Touch to Interact":"Click to Interact"})})]})};const Ann=({containerClassName:r,...e})=>{const t=ht.useRef(null),[n,i]=ht.useState(620);return ht.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)}},[]),ct.jsx("div",{ref:t,className:r||"rf-w-full rf-h-full",children:ct.jsx(unn,{...e,height:n})})},dnn='*,: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-\\[101\\]{z-index:101!important}.rf-z-50{z-index:50}.rf-z-\\[100\\]{z-index:100}.rf-order-1{order:1}.rf-order-2{order:2}.rf-order-3{order:3}.rf-m-1{margin:.25rem}.rf-m-6{margin:1.5rem}.-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-4{margin-left:1rem;margin-right:1rem}.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-\\[400px\\]{height:400px}.rf-h-\\[calc\\(100vh-52px\\)\\]{height:calc(100vh - 52px)}.rf-h-\\[var\\(--radix-select-trigger-height\\)\\]{height:var(--radix-select-trigger-height)}.rf-h-auto{height:auto}.rf-h-fit{height:-moz-fit-content;height:fit-content}.rf-h-full{height:100%}.rf-h-px{height:1px}.rf-h-screen{height:100vh}.\\!rf-max-h-\\[40vh\\]{max-height:40vh!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-max-h-full{max-height:100%}.rf-min-h-0{min-height:0}.rf-min-h-\\[200px\\]{min-height:200px}.rf-min-h-\\[300px\\]{min-height:300px}.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-48{width:12rem}.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-\\[95\\%\\]{width:95%}.rf-w-fit{width:-moz-fit-content;width:fit-content}.rf-w-full{width:100%}.rf-min-w-0{min-width:0}.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-\\[660px\\]{max-width:660px!important}.rf-max-w-2xl{max-width:42rem}.rf-max-w-3xl{max-width:48rem}.rf-max-w-4xl{max-width:56rem}.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-none{max-width:none}.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-items-stretch{align-items:stretch}.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-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(.75rem*var(--tw-space-y-reverse));margin-top:calc(.75rem*(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}.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-orange-200{--tw-border-opacity:1;border-color:rgb(254 215 170/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-200{--tw-bg-opacity:1;background-color:rgb(229 231 235/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-400{--tw-bg-opacity:1;background-color:rgb(156 163 175/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-orange-50{--tw-bg-opacity:1;background-color:rgb(255 247 237/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-object-cover{-o-object-fit:cover;object-fit:cover}.\\!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-py-8{padding-bottom:2rem;padding-top:2rem}.rf-pb-0{padding-bottom:0}.rf-pb-2{padding-bottom:.5rem}.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-2{padding-top:.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-uppercase{text-transform:uppercase}.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-relaxed{line-height:1.625}.rf-leading-tight{line-height:1.25}.rf-tracking-wide{letter-spacing:.025em}.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-orange-500{--tw-text-opacity:1;color:rgb(249 115 22/var(--tw-text-opacity,1))}.rf-text-orange-600{--tw-text-opacity:1;color:rgb(234 88 12/var(--tw-text-opacity,1))}.rf-text-orange-800{--tw-text-opacity:1;color:rgb(154 52 18/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-opacity-75{opacity:.75}.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}.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-order-1{order:1}.sm\\:rf-order-2{order:2}.sm\\:rf-mt-0{margin-top:0}.sm\\:rf-inline{display:inline}.sm\\:rf-hidden{display:none}.sm\\:rf-w-auto{width:auto}.sm\\:rf-flex-row{flex-direction:row}.sm\\:rf-items-center{align-items:center}.sm\\:rf-justify-end{justify-content:flex-end}.sm\\:rf-gap-3{gap:.75rem}.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-px-4{padding-left:1rem;padding-right:1rem}.sm\\:rf-text-left{text-align:left}.sm\\:rf-text-sm{font-size:.875rem;line-height:1.25rem}.sm\\:rf-text-xl{font-size:1.25rem;line-height:1.75rem}}@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}',fnn=()=>{ht.useEffect(()=>{if(document.querySelector('style[data-styles="tscircuit-runframe"]'))return;const e=document.createElement("style");e.setAttribute("data-styles","tscircuit-runframe"),e.textContent=dnn,document.head.appendChild(e)},[])},hnn=r=>{ht.useEffect(()=>(r?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[r])},eKe=r=>`hsl(${zb.indexOf(r)*137.5%360}, 70%, 50%)`,pnn=({phaseTimings:r})=>{if(!r)return null;const e=Object.values(r).reduce((t,n)=>t+n,0);return ct.jsxs("div",{className:"rf-space-y-2 rf-w-full rf-px-4",children:[ct.jsx("div",{className:"rf-relative rf-h-8 rf-flex rf-rounded-sm",children:zb.map(t=>{const n=r[t]||0,i=n/e*100;return ct.jsx("div",{className:"rf-group/bar rf-relative rf-overflow-visible",style:{width:`${i}%`,backgroundColor:eKe(t)},children:ct.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,": ",n.toFixed(1),"ms"]})},t)})}),ct.jsxs("div",{className:"rf-text-xs rf-text-gray-500",children:["Total: ",e.toFixed(2),"ms"]})]})},gnn=({renderLog:r})=>{const[e,t]=ht.useState("chronological");if(!r)return ct.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 n=Object.entries((r==null?void 0:r.phaseTimings)??{});e==="chronological"?n.sort((a,o)=>zb.indexOf(a[0])-zb.indexOf(o[0])):n.sort((a,o)=>o[1]-a[1]);const i=n.reduce((a,[o,s])=>a+s,0);return ct.jsxs("div",{className:"rf-bg-white",children:[ct.jsxs("div",{className:"rf-flex rf-justify-between rf-items-center",children:[ct.jsx("div",{children:"Render Logs"}),ct.jsxs("div",{className:"rf-mb-4 rf-pr-2 rf-flex rf-text-xs rf-items-center",children:[ct.jsx("div",{className:"rf-mr-2",children:"Sort by:"}),ct.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:[ct.jsx("option",{value:"chronological",children:"Phase Order"}),ct.jsx("option",{value:"longest",children:"Duration"})]})]})]}),ct.jsx(pnn,{phaseTimings:r.phaseTimings}),ct.jsxs("table",{className:"rf-w-full rf-text-xs",children:[ct.jsx("thead",{children:ct.jsxs("tr",{children:[ct.jsx("th",{className:"rf-text-left rf-p-2",children:"Phase Order"}),ct.jsx("th",{className:"rf-text-left rf-p-2",children:"Phase"}),ct.jsx("th",{className:"rf-text-left rf-p-2",children:"Duration (ms)"})]})}),ct.jsx("tbody",{children:n.map(([a,o])=>ct.jsxs("tr",{children:[ct.jsx("td",{className:"rf-p-2",children:zb.indexOf(a)}),ct.jsx("td",{className:"rf-p-2",children:a}),ct.jsx("td",{className:"rf-p-2",children:ct.jsx("div",{className:"rf-w-8",children:ct.jsx("div",{className:"rf-h-2 rf-rounded-sm",style:{backgroundColor:eKe(a),width:`${o/i*100}%`}})})}),ct.jsx("td",{className:"rf-p-2",children:ct.jsxs("div",{className:"rf-flex w-full",children:[ct.jsxs("span",{className:"rf-flex-grow",children:[o,"ms"]}),ct.jsxs("span",{className:"rf-text-gray-500 rf-pr-2",children:[(o/i*100).toFixed(1),"%"]})]})})]},a))})]})]})},mnn=({errorMessage:r,errorStack:e,circuitJsonErrors:t})=>{ht.useEffect(()=>{if(r){const n=new Error(r);e&&(n.stack=e);try{t8.captureException(n)}catch{}}},[r,e]),ht.useEffect(()=>{if(t&&t.length>0)for(const n of t){const i=new Error(n.message||"Circuit JSON Error");n.stack&&(i.stack=n.stack);try{t8.captureException(i,{error_type:n.type})}catch{}}},[t])},ynn="0.0.712",Ude={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1},Fde=new Map,sH=r=>{const e=Fde.get(r);return e?Object.fromEntries(Object.entries(e.stores).map(([t,n])=>[t,n.getState()])):{}},vnn=(r,e,t)=>{if(r===void 0)return{type:"untracked",connection:e.connect(t)};const n=Fde.get(t.name);if(n)return{type:"tracked",store:r,...n};const i={connection:e.connect(t),stores:{}};return Fde.set(t.name,i),{type:"tracked",store:r,...i}},Inn=(r,e={})=>(t,n,i)=>{const{enabled:a,anonymousActionType:o,store:s,...l}=e;let c;try{c=(a??(Ude?"production":void 0)!=="production")&&window.__REDUX_DEVTOOLS_EXTENSION__}catch{}if(!c)return(Ude?"production":void 0)!=="production"&&a&&console.warn("[zustand devtools middleware] Please install/enable Redux devtools extension"),r(t,n,i);const{connection:u,...A}=vnn(s,c,l);let d=!0;i.setState=(C,E,_)=>{const B=t(C,E);if(!d)return B;const w=_===void 0?{type:o||"anonymous"}:typeof _=="string"?{type:_}:_;return s===void 0?(u==null||u.send(w,n()),B):(u==null||u.send({...w,type:`${s}/${w.type}`},{...sH(l.name),[s]:i.getState()}),B)};const h=(...C)=>{const E=d;d=!1,t(...C),d=E},m=r(i.setState,n,i);if(A.type==="untracked"?u==null||u.init(m):(A.stores[A.store]=i,u==null||u.init(Object.fromEntries(Object.entries(A.stores).map(([C,E])=>[C,C===A.store?m:E.getState()])))),i.dispatchFromDevtools&&typeof i.dispatch=="function"){let C=!1;const E=i.dispatch;i.dispatch=(..._)=>{(Ude?"production":void 0)!=="production"&&_[0].type==="__setState"&&!C&&(console.warn('[zustand devtools middleware] "__setState" action type is reserved to set state from the devtools. Avoid using it.'),C=!0),E(..._)}}return u.subscribe(C=>{var E;switch(C.type){case"ACTION":if(typeof C.payload!="string"){console.error("[zustand devtools middleware] Unsupported action format");return}return Lde(C.payload,_=>{if(_.type==="__setState"){if(s===void 0){h(_.state);return}Object.keys(_.state).length!==1&&console.error(`
13479
13479
  [zustand devtools middleware] Unsupported __setState action format.
13480
13480
  When using 'store' option in devtools(), the 'state' should have only one key, which is a value of 'store' that was passed in devtools(),
13481
13481
  and value of this only key should be a state object. Example: { "type": "__setState", "state": { "abc123Store": { "foo": "bar" } } }