frameos-editor 2026.9.3 → 2026.9.5
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.
- package/dist/index.html +1 -1
- package/dist/static/{chunk-GC2ASTCL.js → chunk-HFUAHA4L.js} +2 -2
- package/dist/static/{editor-WEHW5FNP.js → editor-OFDYQZV4.js} +2 -2
- package/dist/static/editor.js +2 -2
- package/dist/static/{lib-WKRXLP56.js → lib-KUGKN4SQ.js} +2 -2
- package/dist/static/lib.js +2 -2
- package/dist/static/{mount-LJFTHBQE.js → mount-GJK3E4QX.js} +2 -2
- package/dist/static/mount.js +2 -2
- package/package.json +1 -1
package/dist/index.html
CHANGED
|
@@ -26,6 +26,6 @@
|
|
|
26
26
|
<div id="root"></div>
|
|
27
27
|
<div id="modal" style="position: absolute; z-index: 10"></div>
|
|
28
28
|
<div id="popper" style="position: absolute; z-index: 80"></div>
|
|
29
|
-
<script type="module" src="./static/editor-
|
|
29
|
+
<script type="module" src="./static/editor-OFDYQZV4.js"></script>
|
|
30
30
|
</body>
|
|
31
31
|
</html>
|
|
@@ -11564,7 +11564,7 @@ export function get(app: FrameOSApp, context: FrameOSContext) {
|
|
|
11564
11564
|
}
|
|
11565
11565
|
]
|
|
11566
11566
|
}
|
|
11567
|
-
`}};var TO={code:"Code",render:"Render",logic:"Logic",data:"Data"};function zve(e){return{...Ove,...e,...IO}}var ul=(0,R_.kea)([(0,R_.path)(["src","models","appsModel"]),(0,Hve.loaders)(({values:e})=>({apps:[{},{loadApps:async()=>{try{let t=await Se("/api/apps");if(!t.ok)throw new Error("Failed to fetch apps");let n=await t.json();return zve(n.apps)}catch(t){return wh(t),zve(e.apps)}}}]})),(0,R_.afterMount)(({actions:e})=>{e.loadApps()})]);var N_=["app.ts","app.js","app.tsx","app.jsx"],EX=Object.keys(IO);function lA(e){return!!e&&e.startsWith("repo/")}function _h(e){return!!e&&EX.includes(e)}function D_(e){return!!e&&N_.some(t=>!!e[t])}function cA(e){return!!(e?.["app.nim"]||e?.["config.nim"])}function _f(e){return cA(e)&&!D_(e)}function AO(e){return Object.values(e.apps??{}).some(t=>_f(t.sources))?!0:(e.nodes??[]).some(t=>{if(t.type==="app"){let n=t.data;return _f(n?.sources)||_f(e.apps?.[n?.keyword??""]?.sources)}if(t.type==="code"){let n=t.data;return!!n?.code?.trim()&&!n?.codeJS?.trim()}return t.type==="source"})}function Uve(e){if(!e?.["config.json"])return{};try{let t=JSON.parse(e["config.json"]);return typeof t=="object"&&t?t:{}}catch{return{}}}function Vve(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0))}function O0(e){return e?.origin??e?.source}function I$e(e){return!!e&&Object.keys(e).length>0}function jve(e){if(!e)return;if(sA[e])return e;if(!lA(e))return;let t=e.split("/").filter(Boolean),n=t[t.length-1],r=n?`repo/apps/code/${n}`:void 0;return r&&sA[r]?r:void 0}function T$e(e){let t=jve(e),n=t?sA[t]:void 0;return n?{...n}:void 0}function dA(e,t){let{source:n,...r}=e,o=O0(e)||t,i=jve(o),a=I$e(e.sources)?e.sources:T$e(o)||e.sources||{};return Vve({...r,origin:i||o,sources:a})}function Hl(e){return Object.fromEntries(Object.entries(e??{}).map(([t,n])=>[t,dA(n,t)]))}function dd(e){let t=Uve(e.sources),n=O0(e);return{name:e.name||t.name||n||"Scene app",category:e.category||t.category,description:e.description||t.description,version:e.version||t.version,settings:e.settings||t.settings,apt:e.apt||t.apt,fields:e.fields||t.fields,output:e.output||t.output,cache:e.cache||t.cache,origin:n}}function IX(e){return Object.fromEntries(Object.entries(Hl(e?.apps)).map(([t,n])=>[t,dd(n)]))}function Wve(e,t){return{...e,...IX(t)}}function TX(e){let t=O0(e);if(!t)return null;let n=t.split("/");return n[0]==="repo"&&n[1]==="apps"&&n[2]?n[2]:n[0]==="repo"&&n[1]?n[1]:n[0]==="scene"?"scene":n[0]||null}function uA(e,t){let n=TX(e);return`${t?`${t}: `:""}${e.name}${n?` [${n}]`:""}`}async function AX(e){let t=sA[e]??Bve[e];if(t)return{...t};let n=await Se(`/api/apps/source?keyword=${encodeURIComponent(e)}`);return n.ok?await n.json():{}}function L_(e,t,n){let r=t.split("/").filter(Boolean),i=(r[r.length-1]||n?.name||"app").replace(/[^a-zA-Z0-9_-]+/g,"-").replace(/(^-|-$)/g,"")||"app";if(!e[i])return i;let a=2,s=`${i}-${a}`;for(;e[s];)a+=1,s=`${i}-${a}`;return s}function FO(e,t,n,r){let o=Uve(n),i=O0(r)||O0(t)||(lA(e)?e:void 0),{source:a,...s}=r??{};return Vve({...s,origin:i,name:o.name||r?.name||t?.name||e,category:o.category||r?.category||t?.category,description:o.description||r?.description||t?.description,version:o.version||r?.version||t?.version,settings:o.settings||r?.settings||t?.settings,apt:o.apt||r?.apt||t?.apt,fields:o.fields||r?.fields||t?.fields,output:o.output||r?.output||t?.output,cache:o.cache||r?.cache||t?.cache,sources:n})}async function RO(e,t,n){if(!lA(t))return{sceneApps:e,keyword:t,app:n??null};let r=await AX(t),o=L_(e,t,n),i=FO(o,n,r,{origin:O0(n)||t});return{sceneApps:{...e,[o]:i},keyword:o,app:dd(i)}}function NO(e,t,n,r=!1,o){let i=Hl(n),a=r&&Object.values(i).some(s=>cA(s.sources));return e?.map(s=>s.id===t?{...s,apps:i,...o?{nodes:o}:{},settings:a&&s.settings?.execution!=="compiled"?{...s.settings,execution:"compiled"}:s.settings}:s)}var DO={openAI:{title:"OpenAI",tagLabel:"OpenAI API key missing",description:"The OpenAI API key is used within OpenAI apps on frames.",fields:[{label:"API key for frames",secret:!0,path:["openAI","apiKey"]}]},unsplash:{title:"Unsplash",tagLabel:"Unsplash access key missing",fields:[{label:"Access key",secret:!0,path:["unsplash","accessKey"]}]},homeAssistant:{title:"Home Assistant",tagLabel:"Home Assistant access token missing",fields:[{label:"Home assistant URL",path:["homeAssistant","url"]},{label:"Access token (Profile \u2192 Long-Lived Access Tokens)",secret:!0,path:["homeAssistant","accessToken"]}]},immich:{title:"Immich",tagLabel:"Immich API key missing",fields:[{label:"Server URL",path:["immich","url"]},{label:"API key (Account Settings \u2192 API Keys)",secret:!0,path:["immich","apiKey"]}]},github:{title:"GitHub",tagLabel:"GitHub personal access token missing",freeLimitedUsage:!0,fields:[{label:"API key",secret:!0,path:["github","api_key"]}]},frameOS:{title:"FrameOS Gallery",tagLabel:"FrameOS Gallery API key missing",fields:[{label:"API key",secret:!0,path:["frameOS","apiKey"]}]}};function A$e(e,t){if(t){if(e[t])return e[t];if(!t.includes("/")){let n=Object.keys(e).find(r=>r.endsWith(`/${t}`));if(n)return e[n]}}}function B0(e,t){let n=new Set;for(let r of e??[])for(let o of r.nodes??[])if(o.type==="app"){let i=o.data?.keyword,a=i?r.apps?.[i]:void 0,s=a?dd(a):A$e(t,i);for(let l of s?.settings??[])DO[l]&&n.add(l)}return Array.from(n)}function F$e(e){return"blob"in e?null:"templateId"in e?{template_id:e.templateId}:"url"in e?{url:e.url}:{source_scene_id:e.sourceSceneId,...e.sourceFrameId!==void 0?{source_frame_id:e.sourceFrameId}:{}}}var LO=class extends Error{status;constructor(t,n){super(t),this.name="SceneImageError",this.status=n}};async function R$e(e){try{let t=await e.json();if(t?.detail)return String(t.detail)}catch{}return`unexpected status ${e.status}`}async function N$e(e,t,n){let r=F$e(n),o=r?await Se(`/api/frames/${e}/scene_images/${t}/copy`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)}):await Se(`/api/frames/${e}/scene_images/${t}`,{method:"POST",body:n.blob});if(!o.ok)throw new LO(await R$e(o),o.status);Av.actions.updateEntityImage(`frames/${e}`,`scene_images/${t}`)}function FX(e,t,n,r){let o=r instanceof Error?r.message:String(r);console.error(`Failed to copy the scene ${n}`,r),Rt.actions.startTask({frameId:e,kind:"sceneImage",title:`Copying the scene ${n}`,detail:null,sceneId:t}),Rt.actions.taskFailed({frameId:e,kind:"sceneImage",sceneId:t,detail:`${o}. The scene tile stays blank until the frame renders it.`})}async function MO(e,t,n,r={}){let o=r.label??"preview image";if(!(!t.length||!n)&&!(Tt()&&!("blob"in n)))try{await Promise.all(t.map(i=>N$e(e,i,n)))}catch(i){if(r.ignoreMissingSource&&i instanceof LO&&i.status===404)return;FX(e,t[0],o,i)}}var nJ=M(fSe(),1),mSe=90,VJe=90,jJe=120,WJe=64,qJe=56,hSe=50,TSe=70,KJe=44,hA=40,JX=40,QX=24,GJe=16,gSe=0,bSe=180,ZX=120,$Je=hA,ASe=32,YJe=24;var ySe=16,XJe=35,JJe=64,QJe=340,ZJe=140,eQe=8,tQe=49,rJ=16,vSe=rJ+12,nQe=50,rQe=38,oQe=30,iQe=39,aQe=67,sQe=48,lQe=32,wSe=200,oJ=18,cQe=260,dQe=180,xSe=200,FSe=340,uQe=2200,pQe=6,fQe=119,RSe=260,eJ=100,mQe=72,hQe=8,gQe=120,bQe=91,UO=7,yQe=22,NSe=40,Lv=4,vQe=TSe,wQe=60,xQe=28,iJ=1e3;function vo(e){return{width:e.width??cQe,height:e.height??dQe}}function VO(e){if(typeof e=="number"&&Number.isFinite(e))return e;if(typeof e=="string"){let t=Number.parseFloat(e);return Number.isFinite(t)?t:null}return null}function SQe(e){let t=e.data??{},n=t.codeArgs??[],r=t.codeOutputs??[],o=(t.codeJS??t.code??"").trim(),i=o?o.split(/\r?\n/):[""],a=i.reduce((m,h)=>Math.max(m,h.length),0),s=[...n,...r].reduce((m,h)=>Math.max(m,h.name.length*UO+eJ),xSe),l=n.reduce((m,h)=>m+h.name.length*UO+mQe+hQe,gQe),d=n.length>pQe?uQe:FSe,c=Math.min(d,Math.max(xSe,s,l,a*UO+eJ)),u=Math.max(1,Math.floor((c-eJ/2)/UO)),p=i.reduce((m,h)=>m+Math.max(1,Math.ceil(h.length/u)),0),f=Math.min(RSe,Math.max(fQe,bQe+p*yQe));return{width:Math.round(c),height:Math.round(f)}}function _Qe(e){if(e.type!=="code")return e;let t=SQe(e),n=VO(e.width)??VO(e.style?.width),r=VO(e.height)??VO(e.style?.height),o=n!==null&&n>FSe?Math.max(n,t.width):t.width,i=r!==null&&r>RSe?Math.max(r,t.height):t.height,a={...e.style??{},width:o,height:i};return{...e,width:o,height:i,style:a}}function WO(e){return e?e.startsWith("fieldInput/")?e.slice(11):e.startsWith("codeField/")?e.slice(10):e.startsWith("field/")?e.slice(6):null:null}function DSe(e){return WO(e)?.replace(/\[.*$/,"")??null}function SSe(e){let t=LSe(e);return t.length===0?null:t.reduce((n,r,o)=>n+r/iJ**o,0)}function LSe(e){let t=WO(e);return t?Array.from(t.matchAll(/\[(\d+)\]/g)).map(n=>Number(n[1])):[]}function CQe(e){return e.sourceHandle==="next"||e.targetHandle==="prev"||e.type==="appNodeEdge"}function kh(e){if(e.type!=="app")return!1;let t=e.data?.keyword;return typeof t=="string"&&t.startsWith("data/")}function _Se(e,t){if(e.type!=="app")return!1;if(t>1)return!0;let n=e.data?.keyword;return typeof n=="string"&&(n.startsWith("data/")||n.startsWith("logic/"))}function kQe(e){return e.type==="event"||e.type==="dispatch"||e.type==="source"}function tJ(e){return e.position.x+vo(e).width/2}function M_(e){let t=vo(e);return{left:e.position.x,right:e.position.x+t.width,top:e.position.y,bottom:e.position.y+t.height}}function P_(e,t){return{left:Math.min(e.left,t.left),right:Math.max(e.right,t.right),top:Math.min(e.top,t.top),bottom:Math.max(e.bottom,t.bottom)}}function CSe(e,t){return{left:e.left+t.x,right:e.right+t.x,top:e.top+t.y,bottom:e.bottom+t.y}}function kSe(e,t){if(e.type==="state")return kh(t)?ASe:eQe;if(kh(e)&&kh(t))return tQe;let n=vo(t);return e.type==="code"&&n.width<=QJe?JJe:XJe}function jO(e,t){let n=vo(t);return e.type==="state"?kh(t)?oJ:n.height>=wSe?lQe:sQe:kh(e)&&kh(t)?rQe:e.type==="code"?n.height<=ZJe?aQe:n.height>=wSe?oQe:iQe:nQe}function ud(e,t,n){let r=WO(t);if(!r)return Number.MAX_SAFE_INTEGER;let o=n[e]??[],i=DSe(t),a=SSe(t)??0,s=o.indexOf(r);if(s>=0)return s*iJ+a;let l=i?o.indexOf(i):-1;if(l>=0)return l*iJ+a;let d=SSe(t);return d!==null?d:Number.MAX_SAFE_INTEGER}function EQe(e,t,n){let r=WO(t);if(!r)return null;let o=n[e.id]??[],i=DSe(t),a=o.indexOf(r),s=a>=0?a:i?o.indexOf(i):-1;if(s<0)return null;let{width:l}=vo(e),d=t?.startsWith("codeField/")?NSe:KJe,c=Math.max(l-d*2,1),u=Math.max(o.length-1,1);return d+c*s/u}function MSe(e,t,n){let{width:r}=vo(e);return t==="prev"?0:t==="next"?r:e.type==="code"&&t==="fieldOutput"?NSe:EQe(e,t,n)??r/2}function ESe(e,t,n){return e.position.x+MSe(e,t,n)}function ISe(e,t){let n=[...e].sort((r,o)=>r.desiredCenterX-o.desiredCenterX||r.order-o.order||(r.node.type??"").localeCompare(o.node.type??"")||r.node.id.localeCompare(o.node.id)).map(r=>{let{width:o}=vo(r.node);return{...r,width:o,left:r.desiredCenterX-o/2}});for(let r=1;r<n.length;r+=1){let o=n[r-1],i=n[r];i.left=Math.max(i.left,o.left+o.width+t)}if(n.length>1){let r=Math.min(...n.map(l=>l.desiredCenterX-l.width/2)),o=Math.max(...n.map(l=>l.desiredCenterX+l.width/2)),i=Math.min(...n.map(l=>l.left)),a=Math.max(...n.map(l=>l.left+l.width)),s=(r+o)/2-(i+a)/2;n.forEach(l=>{l.left+=s})}return new Map(n.map(r=>[r.node.id,r.left]))}function IQe(e,t){if(!t.has(e))return t.add(e),e;let n=2;for(;t.has(`${e}-${n}`);)n+=1;let r=`${e}-${n}`;return t.add(r),r}function TQe(e,t){let n=e.reduce((l,d)=>(l[d.id]=d,l),{}),r=new Set(e.map(l=>l.id)),o=new WeakMap;t.forEach((l,d)=>{o.set(l,d)});let i=t.reduce((l,d)=>{let c=n[d.source],u=n[d.target],p=d.targetHandle?.startsWith("fieldInput/")||d.targetHandle?.startsWith("codeField/");return c?.type!=="state"||!u||u.type!=="app"&&u.type!=="code"||d.sourceHandle!=="fieldOutput"||!p||(l[d.source]=[...l[d.source]??[],d]),l},{}),a=[],s=new WeakMap;return Object.entries(i).forEach(([l,d])=>{let c=n[l];if(!c)return;let u=d.reduce((f,m)=>(f[m.target]=[...f[m.target]??[],m],f),{}),p=Object.entries(u).sort(([f,m],[h,g])=>(o.get(m[0])??0)-(o.get(g[0])??0)||f.localeCompare(h));p.length<=1||p.slice(1).forEach(([f,m])=>{let h=IQe(`${l}__for__${f}`,r),{id:g,selected:b,dragging:y,positionAbsolute:w,...v}=c;a.push({...v,id:h,position:{...c.position},selected:!1,dragging:!1}),m.forEach(x=>{s.set(x,h)})})}),a.length===0?{nodes:e,edges:t}:{nodes:[...e,...a],edges:t.map(l=>{let d=s.get(l);return d?{...l,source:d}:l})}}function qO(e,t,n={}){let r=TQe(e,t);return{nodes:AQe(r.nodes,r.edges,n),edges:r.edges}}function AQe(e,t,n={}){if(!e.length)return e;let r=n.fieldOrderByNodeId??{},o=e.map(_Qe),i=new Set;t.forEach(G=>{G.sourceHandle==="next"&&i.add(G.source),G.targetHandle==="prev"&&i.add(G.target)});let a=o.filter(G=>kQe(G)||G.type==="app"&&!kh(G)&&i.has(G.id)),s=o.reduce((G,J)=>(G[J.id]=J,G),{}),l=new Set(a.map(G=>G.id)),d=t.filter(G=>l.has(G.source)&&l.has(G.target)&&CQe(G)),c=t.reduce((G,J)=>(!J.source||!J.target||(G[J.source]=[...G[J.source]??[],J]),G),{}),u=t.reduce((G,J)=>(!J.source||!J.target||(G[J.target]=[...G[J.target]??[],J]),G),{}),p=new WeakMap;t.forEach((G,J)=>{p.set(G,J)});let f=new Map(a.map((G,J)=>[G.id,J])),m=[...d].sort((G,J)=>(f.get(G.source)??0)-(f.get(J.source)??0)||ud(G.source,G.sourceHandle,r)-ud(J.source,J.sourceHandle,r)||ud(G.target,G.targetHandle,r)-ud(J.target,J.targetHandle,r)||G.target.localeCompare(J.target));if(!a.length)return e;let h=new Map(a.map(G=>[G.id,G.id])),g=G=>{let J=h.get(G);if(!J||J===G)return G;let oe=g(J);return h.set(G,oe),oe},b=(G,J)=>{let oe=g(G),ce=g(J);oe!==ce&&h.set(ce,oe)};m.forEach(G=>{b(G.source,G.target)});let y=G=>l.has(G)?g(G):null,w=new nJ.default.graphlib.Graph({multigraph:!0});w.setGraph({rankdir:"LR",nodesep:mSe,ranksep:VJe,edgesep:25}),w.setDefaultEdgeLabel(()=>({})),a.forEach(G=>{let{width:J,height:oe}=vo(G);w.setNode(G.id,{width:J,height:oe,rank:G.type==="event"||G.type==="source"?"min":void 0})}),m.forEach(G=>{!G.source||!G.target||G.source===G.target||w.setEdge(G.source,G.target)}),nJ.default.layout(w);let v=new Map;a.forEach(G=>{let J=w.node(G.id);if(!J)return;let{width:oe,height:ce}=vo(G);v.set(G.id,{x:J.x-oe/2,y:J.y-ce/2})});let x=(G,J,oe=new Set)=>{if(oe.has(G))return;oe.add(G);let ce=v.get(G);ce&&v.set(G,{x:ce.x+J.x,y:ce.y+J.y}),m.filter(We=>We.source===G).forEach(We=>{x(We.target,J,oe)})},S=m.reduce((G,J)=>(!J.sourceHandle?.startsWith("field/")||J.targetHandle!=="prev"||(G[J.source]=[...G[J.source]??[],J]),G),{}),C=new Set(Object.values(S).flatMap(G=>G.length>1?G.map(J=>J.target):[])),T=m.reduce((G,J)=>(G[J.target]=[...G[J.target]??[],J],G),{}),F=new Map,I=(G,J=new Set)=>{if(F.has(G))return F.get(G)??null;if(!l.has(G))return F.set(G,null),null;if(C.has(G))return F.set(G,G),G;if(J.has(G))return null;J.add(G);for(let oe of T[G]??[]){let ce=I(oe.source,new Set(J));if(ce)return F.set(G,ce),ce}return F.set(G,null),null},L=new Map,z=(G,J=new Set)=>{let oe=L.get(G);if(oe)return new Set(oe);let ce=new Set;return J.has(G)||(J.add(G),l.has(G)&&ce.add(G),m.filter(We=>We.source===G).forEach(We=>{z(We.target,new Set(J)).forEach(Fe=>ce.add(Fe))}),L.set(G,new Set(ce))),ce},V=new Map,R=(G,J=new Set)=>{let oe=V.get(G);if(oe)return new Set(oe);let ce=new Set;return J.has(G)||(J.add(G),l.has(G)?ce.add(G):(c[G]??[]).forEach(Fe=>{R(Fe.target,new Set(J)).forEach(at=>ce.add(at))}),V.set(G,new Set(ce))),ce},j=(G,J)=>{if(!J)return!0;let oe=R(G);return oe.size===0||[...oe].every(ce=>J.has(ce))},W=G=>R(G).size>1,$=(G,J)=>Array.from((u[G]??[]).filter(oe=>oe.source&&oe.target&&!l.has(oe.source)&&j(oe.source,J)&&(oe.targetHandle?.startsWith("fieldInput/")||oe.targetHandle?.startsWith("codeField/"))).sort((oe,ce)=>ud(G,oe.targetHandle,r)-ud(G,ce.targetHandle,r)||(p.get(oe)??0)-(p.get(ce)??0)||oe.source.localeCompare(ce.source)).reduce((oe,ce)=>(oe.has(ce.source)||oe.set(ce.source,ce),oe),new Map).values()),pe=(G,J=new Set,oe)=>{let ce=s[G];if(!ce)return{left:0,right:0,top:0,bottom:0};let We=vo(ce),Fe={left:0,right:We.width,top:0,bottom:We.height};if(J.has(G))return Fe;J.add(G);let at=0,yt=null;return $(G,oe).forEach((Xt,Ut)=>{let pn=s[Xt.source];if(!pn)return;let Fr=vo(pn),hr=jO(pn,ce),pi=kSe(pn,ce),Gs=at-(Ut===0?hr:0)-Fr.height,Mr=Math.min(-pi-rJ*Ut,yt?yt.left-vSe:Number.POSITIVE_INFINITY),jo=CSe(pe(pn.id,new Set(J),oe),{x:Mr,y:Gs});Fe=P_(Fe,jo),yt=yt?P_(yt,jo):jo,at=jo.top-oJ}),Fe},O=(G,J,oe=new Set)=>{let ce=v.get(G);if(!ce)return pe(G,new Set,J);let We=pe(G,new Set,J);return oe.has(G)||(oe.add(G),m.filter(Fe=>Fe.source===G).forEach(Fe=>{let at=v.get(Fe.target);at&&(We=P_(We,CSe(O(Fe.target,J,new Set(oe)),{x:at.x-ce.x,y:at.y-ce.y})))})),We};Object.entries(S).forEach(([G,J])=>{if(J.length<2)return;let oe=a.find(zt=>zt.id===G),ce=v.get(G);if(!oe||!ce)return;let We=new Set,Fe=J.map((zt,da)=>({edge:zt,index:da,pathIndexes:LSe(zt.sourceHandle)})),at=Fe.every(({pathIndexes:zt})=>zt.length>=2),yt=at?Array.from(new Set(Fe.map(({pathIndexes:zt})=>zt[0]))).sort((zt,da)=>zt-da):[],Xt=at?Array.from(new Set(Fe.map(({pathIndexes:zt})=>zt[1]))).sort((zt,da)=>zt-da):[],Ut=at&&Fe.length>3&&(yt.length===1||Xt.length===1),pn=at&&!Ut,Fr=Math.max(1,Math.ceil(Math.sqrt(Fe.length))),hr=Fe.map(({edge:zt,index:da,pathIndexes:$s})=>{let xd=s[zt.target],Pw=v.get(zt.target);if(!xd||!Pw)return null;let sk=pn?yt.indexOf($s[0]):Math.floor(da/Fr),Ow=pn?Xt.indexOf($s[1]):da%Fr,Zf=O(zt.target,z(zt.target));return{edge:zt,targetPosition:Pw,row:sk,column:Ow,footprint:Zf,footprintWidth:Zf.right-Zf.left,footprintHeight:Zf.bottom-Zf.top}}).filter(zt=>zt!==null&&zt.row>=0&&zt.column>=0);if(hr.length===0)return;let pi=Math.max(...hr.map(zt=>zt.column))+1,Gs=Math.max(...hr.map(zt=>zt.row))+1,Mr=Array.from({length:pi},()=>0),jo=Array.from({length:Gs},()=>0);hr.forEach(zt=>{Mr[zt.column]=Math.max(Mr[zt.column],zt.footprintWidth),jo[zt.row]=Math.max(jo[zt.row],zt.footprintHeight)});let ji=pn?jJe:WJe,wd=pn?mSe:qJe,Mb=Mr.reduce((zt,da,$s)=>{let xd=$s===0?0:zt[$s-1]+Mr[$s-1]+ji;return zt.push(xd),zt},[]),Pb=jo.reduce((zt,da,$s)=>{let xd=$s===0?0:zt[$s-1]+jo[$s-1]+wd;return zt.push(xd),zt},[]),vp=jo.reduce((zt,da)=>zt+da,0)+Math.max(0,Gs-1)*wd,Ob=vo(oe),ik=ce.x+Ob.width+ji,ak=ce.y+Ob.height/2-vp/2;hr.forEach(zt=>{let da=ik+Mb[zt.column]+(Mr[zt.column]-zt.footprintWidth)/2,$s=ak+Pb[zt.row]+(jo[zt.row]-zt.footprintHeight)/2,xd={x:da-zt.footprint.left,y:$s-zt.footprint.top};x(zt.edge.target,{x:xd.x-zt.targetPosition.x,y:xd.y-zt.targetPosition.y},We)})});let D=new Map,Y=(G,J=new Set)=>{if(D.has(G))return D.get(G)??null;if(l.has(G))return D.set(G,G),G;if(J.has(G))return null;J.add(G);for(let oe of c[G]??[]){let ce=Y(oe.target,J);if(ce)return D.set(G,ce),ce}for(let oe of u[G]??[]){let ce=Y(oe.source,J);if(ce)return D.set(G,ce),ce}return D.set(G,null),null},Q=new Map,U=(G,J,oe=new Set)=>{let ce=`${G}:${J}`;if(Q.has(ce))return Q.get(ce)??0;if(G===J)return Q.set(ce,0),0;if(oe.has(G))return 0;oe.add(G);let We=0;for(let Fe of c[G]??[]){let at=U(Fe.target,J,oe);(at>0||Fe.target===J)&&(We=Math.max(We,at+1))}return Q.set(ce,We),We},te=o.filter(G=>!l.has(G.id)).reduce((G,J)=>{let oe=Y(J.id);return oe&&(G[oe]=[...G[oe]??[],J]),G},{}),me=o.map(G=>{let J=v.get(G.id);return J?{...G,position:{...J}}:G}).reduce((G,J)=>(G[J.id]=J,G),{}),Pe=(()=>{let G=t.reduce((oe,ce)=>{if(!ce.source||!ce.target||!ce.targetHandle?.startsWith("fieldInput/"))return oe;let We=s[ce.source],Fe=s[ce.target];return We?.type!=="state"||Fe?.type!=="app"||(oe[ce.target]=[...oe[ce.target]??[],ce]),oe},{}),J=new Map;return Object.entries(G).forEach(([oe,ce])=>{let We=s[oe],Fe=new Set(ce.map(at=>at.source));!We||!_Se(We,Fe.size)||Fe.forEach(at=>{J.set(at,oe)})}),J})(),Ye=new Map,Oe=(G,J)=>{let oe=Ye.get(J);return oe?G===J?0:oe.get(G)??1:G===J?0:1},fe=(G,J,oe)=>{let ce=[],We=(Fe,at,yt,Xt)=>{let Ut=me[at]??s[at];if(!Ut)return;let pn=Oe(at,J),Fr=pn===oe-1?0:pn<oe?1:2;if(Fr>1)return;let{width:hr}=vo(G);ce.push({centerX:ESe(Ut,yt,r)-MSe(G,Xt,r)+hr/2,order:ud(at,yt,r),priority:Fr})};for(let Fe of c[G.id]??[])We(Fe,Fe.target,Fe.targetHandle,Fe.sourceHandle);for(let Fe of u[G.id]??[])We(Fe,Fe.source,Fe.sourceHandle,Fe.targetHandle);if(ce.length===0){let Fe=me[J]??s[J];return{centerX:tJ(Fe||G),order:Number.MAX_SAFE_INTEGER}}return ce.sort((Fe,at)=>Fe.priority-at.priority||Fe.order-at.order||Fe.centerX-at.centerX),{centerX:ce[0].centerX,order:ce[0].order}};Object.entries(te).forEach(([G,J])=>{let oe=me[G]??s[G];if(!oe)return;let ce=new Map;J.forEach(at=>{ce.set(at.id,Math.max(1,U(at.id,G)))}),Ye.set(G,ce);let We=Math.max(...ce.values(),1),Fe=oe.position.y-hSe;for(let at=1;at<=We;at+=1){let yt=J.filter(hr=>ce.get(hr.id)===at&&!Pe.has(hr.id));if(yt.length===0)continue;let Xt=Math.max(...yt.map(hr=>vo(hr).height)),Ut=Fe-Xt,pn=yt.map(hr=>{let pi=fe(hr,G,at);return{node:hr,desiredCenterX:pi.centerX,order:pi.order}}),Fr=ISe(pn,TSe);yt.forEach(hr=>{let pi=vo(hr);me[hr.id]={...hr,position:{x:Fr.get(hr.id)??tJ(oe)-pi.width/2,y:Ut+Xt-pi.height}}}),Fe=Ut-hSe}});let _t=(G,J,oe,ce)=>{let We=vo(G),Fe=vo(J);return G.position.x<J.position.x+Fe.width+oe&&G.position.x+We.width+oe>J.position.x&&G.position.y<J.position.y+Fe.height+ce&&G.position.y+We.height+ce>J.position.y},we=(G,J)=>{me[G.id]={...G,position:J}},je=(G,J)=>{G.forEach(oe=>{let ce=me[oe]??s[oe];ce&&we(ce,{x:ce.position.x+J.x,y:ce.position.y+J.y})})},lt=new Map,jt=G=>!!(G.source&&G.target&&!l.has(G.source)&&(G.targetHandle?.startsWith("fieldInput/")||G.targetHandle?.startsWith("codeField/"))),Xe=t.reduce((G,J)=>(jt(J)&&(G[J.target]=[...G[J.target]??[],J]),G),{}),De=(G,J)=>Array.from((Xe[G]??[]).filter(oe=>j(oe.source,J)).sort((oe,ce)=>ud(G,oe.targetHandle,r)-ud(G,ce.targetHandle,r)||(p.get(oe)??0)-(p.get(ce)??0)||oe.source.localeCompare(ce.source)).reduce((oe,ce)=>(oe.has(ce.source)||oe.set(ce.source,ce),oe),new Map).values()),sn=(G,J)=>{let oe=G.position.y;return J.forEach((ce,We)=>{let Fe=me[ce.source]??s[ce.source];if(!Fe)return;let at=vo(Fe),yt=We===0?jO(Fe,G):0;oe=oe-yt-at.height-ySe}),oe},nr=(G,J=new Set,oe)=>{let ce=me[G]??s[G];if(!ce)return null;let We=M_(ce);return J.has(G)||(J.add(G),De(G,oe).forEach(Fe=>{let at=me[Fe.source]??s[Fe.source];if(!at||l.has(at.id))return;let yt=nr(at.id,new Set(J),oe);yt&&(We=P_(We,yt))})),We},Da=(G,J=new Set,oe)=>{if(J.has(G))return;J.add(G);let ce=me[G]??s[G];if(!ce)return;let We=De(G,oe),Fe=We.filter(Ut=>Pe.get(Ut.source)===G),at=We.filter(Ut=>{let pn=me[Ut.source]??s[Ut.source];return pn&&!l.has(pn.id)&&Pe.get(pn.id)!==G});if(ce.type==="code"&&at.length>Lv)return;let yt=Fe.length>0?sn(ce,Fe):ce.position.y,Xt=null;at.forEach((Ut,pn)=>{let Fr=me[Ut.source]??s[Ut.source];if(!Fr)return;let hr=vo(Fr),pi=jO(Fr,ce),Gs=kSe(Fr,ce),Mr=yt-(pn===0?pi:0)-hr.height,jo=Math.min(ce.position.x-Gs-rJ*pn,Xt?Xt.left-vSe:Number.POSITIVE_INFINITY);we(Fr,{x:jo,y:Mr}),Da(Fr.id,new Set(J),oe);let ji=nr(Fr.id,new Set(J),oe);ji&&(Xt=Xt?P_(Xt,ji):ji),yt=(ji?.top??Mr)-oJ})},La=()=>{a.map(G=>me[G.id]??G).sort((G,J)=>G.position.x-J.position.x||G.position.y-J.position.y||(f.get(G.id)??0)-(f.get(J.id)??0)||G.id.localeCompare(J.id)).forEach(G=>{Da(G.id,new Set,z(G.id))})},Vi=()=>{let G=new Map;return a.forEach(J=>{let oe=I(J.id)??J.id,ce=G.get(oe)??new Set;ce.add(J.id),G.set(oe,ce)}),o.forEach(J=>{if(l.has(J.id)||W(J.id))return;let oe=Y(J.id);if(!oe||!l.has(oe))return;let ce=I(oe)??oe,We=G.get(ce)??new Set;We.add(J.id),G.set(ce,We)}),G},ni=(G,J)=>G.top<J.bottom+gSe&&G.bottom+gSe>J.top,Ee=(G,J)=>{let oe=0;return G.forEach(ce=>{let We=me[ce]??s[ce];if(!We)return;let Fe=M_(We);J.forEach(at=>{let yt=me[at]??s[at];if(!yt)return;let Xt=M_(yt);!(Fe.left<Xt.right&&Fe.right>Xt.left)||!ni(Fe,Xt)||(oe=Math.max(oe,Xt.right+GJe-Fe.left))})}),oe},Ke=G=>Array.from(G).map(J=>me[J]??s[J]).filter(J=>!!J).map(M_).reduce((J,oe)=>J?P_(J,oe):oe,null),Lt=G=>Math.min(...Array.from(G).map(J=>f.get(J)??Number.MAX_SAFE_INTEGER)),cn=G=>{let J=Array.from(G).find(oe=>l.has(oe));return J?y(J):null},rr=()=>{let G=Vi(),J=[];Array.from(G.values()).sort((oe,ce)=>{let We=Ke(oe),Fe=Ke(ce);return(We?.left??0)-(Fe?.left??0)||(We?.top??0)-(Fe?.top??0)||Lt(oe)-Lt(ce)}).forEach(oe=>{let ce=cn(oe);for(let We=0;We<QX;We+=1){let Fe=J.filter(at=>at.componentId===ce).reduce((at,yt)=>Math.max(at,Ee(oe,yt.nodeIds)),0);if(Fe<=0)break;je(oe,{x:Fe,y:0})}J.push({nodeIds:oe,componentId:ce})})},Tr=()=>{let G=new Map;return a.forEach(J=>{let oe=y(J.id);if(!oe)return;let ce=G.get(oe)??new Set;ce.add(J.id),G.set(oe,ce)}),o.forEach(J=>{if(l.has(J.id))return;let oe=Y(J.id),ce=oe?y(oe):null;if(!ce)return;let We=G.get(ce)??new Set;We.add(J.id),G.set(ce,We)}),G},ri=(G,J)=>{let oe=0;return G.forEach(ce=>{let We=me[ce]??s[ce];if(!We)return;let Fe=M_(We);J.forEach(at=>{let yt=me[at]??s[at];if(!yt)return;let Xt=M_(yt),Ut=Fe.left<Xt.right+bSe&&Fe.right+bSe>Xt.left,pn=Fe.top<Xt.bottom+ZX&&Fe.bottom+ZX>Xt.top;!Ut||!pn||(oe=Math.max(oe,Xt.bottom+ZX-Fe.top))})}),oe},Vo=()=>{let G=Array.from(Tr().values()).sort((oe,ce)=>{let We=Ke(oe),Fe=Ke(ce);return(We?.top??0)-(Fe?.top??0)||(We?.left??0)-(Fe?.left??0)||Lt(oe)-Lt(ce)}),J=[];G.forEach(oe=>{for(let ce=0;ce<QX;ce+=1){let We=J.reduce((Fe,at)=>Math.max(Fe,ri(oe,at.nodeIds)),0);if(We<=0)break;je(oe,{x:0,y:We})}J.push({nodeIds:oe})})},Ai=()=>{let G=t.reduce((J,oe)=>{if(!oe.source||!oe.target||!oe.targetHandle?.startsWith("codeField/"))return J;let ce=me[oe.source]??s[oe.source],We=me[oe.target]??s[oe.target];return!ce||We?.type!=="code"||l.has(ce.id)||(J[oe.target]=[...J[oe.target]??[],oe]),J},{});Object.entries(G).forEach(([J,oe])=>{if(oe.length<=Lv)return;let ce=me[J]??s[J];if(!ce)return;let We=Array.from(oe.sort((Ut,pn)=>ud(J,Ut.targetHandle,r)-ud(J,pn.targetHandle,r)||(p.get(Ut)??0)-(p.get(pn)??0)||Ut.source.localeCompare(pn.source)).reduce((Ut,pn)=>(Ut.has(pn.source)||Ut.set(pn.source,pn),Ut),new Map).values()),Fe=We.filter(Ut=>(me[Ut.source]??s[Ut.source])?.type==="state"),at=We.filter(Ut=>(me[Ut.source]??s[Ut.source])?.type!=="state"),yt=[];for(let Ut=0;Ut<Fe.length;Ut+=Lv)yt.push(Fe.slice(Ut,Ut+Lv));for(let Ut=0;Ut<at.length;Ut+=Lv)yt.push(at.slice(Ut,Ut+Lv));let Xt=ce.position.y-wQe;for(let[Ut,pn]of yt.entries()){let Fr=pn.map((Mr,jo)=>{let ji=me[Mr.source]??s[Mr.source];return ji?{node:ji,desiredCenterX:ESe(ce,Mr.targetHandle,r),order:Ut*Lv+jo}:null}).filter(Mr=>Mr!==null);if(Fr.length===0)continue;let hr=Math.max(...Fr.map(Mr=>vo(Mr.node).height)),pi=Xt-hr,Gs=ISe(Fr,vQe);Fr.forEach(Mr=>{let jo=vo(Mr.node);we(Mr.node,{x:Gs.get(Mr.node.id)??Mr.desiredCenterX-jo.width/2,y:pi+hr-jo.height})}),Xt=pi-xQe}})},ca=()=>{t.filter(J=>{let oe=me[J.source]??s[J.source],ce=me[J.target]??s[J.target];return oe&&ce&&kh(oe)&&ce.type==="app"&&!kh(ce)&&R(oe.id).size===0&&!l.has(oe.id)&&!l.has(ce.id)&&J.sourceHandle==="fieldOutput"&&!!J.targetHandle?.startsWith("fieldInput/")}).sort((J,oe)=>{let ce=Y(J.source),We=Y(oe.source),Fe=ce?Oe(J.source,ce):0,at=We?Oe(oe.source,We):0;return Fe-at||J.source.localeCompare(oe.source)}).forEach(J=>{let oe=me[J.source]??s[J.source],ce=me[J.target]??s[J.target];if(!oe||!ce)return;let We=vo(oe),Fe=vo(ce);we(oe,{x:ce.position.x-We.width-$Je,y:ce.position.y+(Fe.height-We.height)/2})})},Ar=()=>{lt.clear();let G=t.reduce((J,oe)=>{if(!oe.source||!oe.target||!oe.targetHandle?.startsWith("fieldInput/"))return J;let ce=me[oe.source]??s[oe.source],We=me[oe.target]??s[oe.target];return ce?.type!=="state"||We?.type!=="app"||(J[oe.target]=[...J[oe.target]??[],oe]),J},{});Object.entries(G).forEach(([J,oe])=>{let ce=me[J]??s[J];if(!ce)return;let Fe=Array.from(oe.sort((yt,Xt)=>ud(J,yt.targetHandle,r)-ud(J,Xt.targetHandle,r)||(p.get(yt)??0)-(p.get(Xt)??0)||yt.source.localeCompare(Xt.source)).reduce((yt,Xt)=>(yt.has(Xt.source)||yt.set(Xt.source,Xt),yt),new Map).values()).map(yt=>me[yt.source]??s[yt.source]).filter(yt=>!!yt);if(Fe.length===0||!_Se(ce,Fe.length))return;let at=ce.position.y;Fe.forEach((yt,Xt)=>{let Ut=vo(yt),pn=Xt===0?jO(yt,ce):0,Fr=at-pn-Ut.height;lt.set(yt.id,J),we(yt,{x:ce.position.x-ASe-YJe*Xt,y:Fr}),at=Fr-ySe})})},oi=()=>{let G=o.map(oe=>oe.id).filter(oe=>l.has(oe)).sort((oe,ce)=>{let We=me[oe]??s[oe],Fe=me[ce]??s[ce];return We.position.y-Fe.position.y||We.position.x-Fe.position.x||oe.localeCompare(ce)}),J=o.map(oe=>oe.id).filter(oe=>!l.has(oe)).sort((oe,ce)=>{let We=me[oe]??s[oe],Fe=me[ce]??s[ce];return We.position.y-Fe.position.y||We.position.x-Fe.position.x||oe.localeCompare(ce)});for(let oe=0;oe<QX;oe+=1){let ce=!1;for(let We of J){let Fe=me[We]??s[We],at=vo(Fe);for(let yt of G){let Xt=me[yt]??s[yt],Ut=lt.has(Fe.id),pn=lt.get(Fe.id)===yt;if(!_t(Fe,Xt,Ut&&!pn?0:hA,Ut&&!pn?0:JX))continue;let pi=Xt.position.y-at.height-JX;pi<Fe.position.y&&(we(Fe,{x:Fe.position.x,y:pi}),ce=!0)}}for(let We=0;We<J.length;We+=1)for(let Fe=We+1;Fe<J.length;Fe+=1){let at=me[J[We]]??s[J[We]],yt=me[J[Fe]]??s[J[Fe]],Xt=lt.get(at.id),Ut=lt.get(yt.id),pn=Xt&&Xt===Ut,Fr=Xt===yt.id||Ut===at.id,hr=pn||Fr;if(!_t(at,yt,hr?0:hA,hr?0:JX))continue;let Mr=lt.has(at.id),jo=lt.has(yt.id),[ji,wd]=Mr!==jo?Mr?[at,yt]:[yt,at]:at.position.x<=yt.position.x?[at,yt]:[yt,at],Mb=vo(ji),Pb=vo(wd),vp=wd.position.x<ji.position.x?ji.position.x-Pb.width-hA:ji.position.x+Mb.width+hA;we(wd,{x:vp,y:wd.position.y}),ce=!0}if(!ce)break}};return ca(),Ai(),Ar(),oi(),ca(),Ai(),Ar(),oi(),Ai(),Ar(),La(),ca(),Ar(),Ai(),rr(),Vo(),o.map(G=>me[G.id]??G)}function KO(e){let t=new Uint8Array(e);if(window.crypto&&window.crypto.getRandomValues)window.crypto.getRandomValues(t);else for(let o=0;o<t.length;o++)t[o]=Math.floor(Math.random()*256);let n=Array.from(t);return btoa(String.fromCharCode.apply(null,n)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}var ql=M(J_e(),1);function Q_e(e){return[{name:"commonName",value:e}]}function gnt(e){let t=e.split(".");return t.length===4&&t.every(n=>/^\d+$/.test(n)&&Number(n)>=0&&Number(n)<=255)}function bnt(e){return gnt(e)||e.includes(":")&&/^[0-9a-fA-F:.]+$/.test(e)}function ynt(e){let t=[{type:2,value:"localhost"},{type:7,ip:"127.0.0.1"}];return e&&t.push(bnt(e)?{type:7,ip:e}:{type:2,value:e}),[{name:"subjectAltName",altNames:t}]}function Z_e(){return`01${ql.util.bytesToHex(ql.random.getBytesSync(15))}`}function eCe(e,t){return new Date(e.getTime()+t*24*60*60*1e3)}function tCe(e){return e.toISOString().replace("Z","+00:00")}function nCe(e){let t=e.trim(),n=new Date,r=new Date(n.getTime()-300*1e3),o=ql.pki.rsa.generateKeyPair({bits:2048,e:65537}),i=ql.pki.createCertificate();i.publicKey=o.publicKey,i.serialNumber=Z_e(),i.validity.notBefore=r,i.validity.notAfter=eCe(n,3650);let a=Q_e(`FrameOS Frame CA (${t||"frame"})`);i.setSubject(a),i.setIssuer(a),i.setExtensions([{name:"basicConstraints",cA:!0,critical:!0},{name:"keyUsage",digitalSignature:!0,keyCertSign:!0,cRLSign:!0,critical:!0}]),i.sign(o.privateKey,ql.md.sha256.create());let s=ql.pki.rsa.generateKeyPair({bits:2048,e:65537}),l=ql.pki.createCertificate();return l.publicKey=s.publicKey,l.serialNumber=Z_e(),l.validity.notBefore=r,l.validity.notAfter=eCe(n,825),l.setSubject(Q_e(t||"frame.local")),l.setIssuer(i.subject.attributes),l.setExtensions([...ynt(t),{name:"basicConstraints",cA:!1,critical:!0},{name:"extKeyUsage",serverAuth:!0},{name:"keyUsage",digitalSignature:!0,keyEncipherment:!0,critical:!0}]),l.sign(o.privateKey,ql.md.sha256.create()),{certs:{server:ql.pki.certificateToPem(l),server_key:ql.pki.privateKeyToPem(s.privateKey),client_ca:ql.pki.certificateToPem(i)},server_cert_not_valid_after:tCe(l.validity.notAfter),client_ca_cert_not_valid_after:tCe(i.validity.notAfter)}}function vnt(e,t){return(e.name||e.id).localeCompare(t.name||t.id,void 0,{numeric:!0,sensitivity:"base"})||String(e.id).localeCompare(String(t.id))}function rCe(e){return[...e].toSorted(vnt)}var Q_={frameos:"2026.9.3+9a032fcb607dcc2ec67e22fab380217bd4557186",editor:"2026.9.3+4004e50d0c6a63b0b732f0f8d6e55c6b20b6ae3d",remote:"2026.9.3+a22d2f4dbdb936e9de7dd9f32559dba15fdbc1ad",docker:"2026.9.3+c12667acee0ef57360baef28f746d588b6bbabc1"};var ggn=[{value:"",label:"Prefer binaries, build from source if needed"},{value:"precompiled",label:`Install precompiled binaries (version ${Q_.frameos.split("+")[0]})`},{value:"static",label:"Build from source - single binary (legacy: needs a build environment)"}];function E4(e){return e==="shared"||e==="shared-scenes"?"static":e==="static"||e==="precompiled"?e:"precompiled"}function NA(e){return e==="embedded"}function as(e,t){return NA(t)?"interpreted":e?.settings?.execution??"interpreted"}function DA(e,t){return as(e,t)!=="interpreted"}function oCe(e){let t=e?.settings?.execution;return t==="compiled"||t==="interpreted"?t:"interpreted"}var lQ="https://scenes.frameos.net/nim-converter",iCe="Preview runs the interpreter: this scene's Nim code nodes and Nim apps are not executed here. Convert the scene to JavaScript to see it whole.",xnt=`This makes the scene compiled (legacy): it will need a full FrameOS source build on every deploy.
|
|
11567
|
+
`}};var TO={code:"Code",render:"Render",logic:"Logic",data:"Data"};function zve(e){return{...Ove,...e,...IO}}var ul=(0,R_.kea)([(0,R_.path)(["src","models","appsModel"]),(0,Hve.loaders)(({values:e})=>({apps:[{},{loadApps:async()=>{try{let t=await Se("/api/apps");if(!t.ok)throw new Error("Failed to fetch apps");let n=await t.json();return zve(n.apps)}catch(t){return wh(t),zve(e.apps)}}}]})),(0,R_.afterMount)(({actions:e})=>{e.loadApps()})]);var N_=["app.ts","app.js","app.tsx","app.jsx"],EX=Object.keys(IO);function lA(e){return!!e&&e.startsWith("repo/")}function _h(e){return!!e&&EX.includes(e)}function D_(e){return!!e&&N_.some(t=>!!e[t])}function cA(e){return!!(e?.["app.nim"]||e?.["config.nim"])}function _f(e){return cA(e)&&!D_(e)}function AO(e){return Object.values(e.apps??{}).some(t=>_f(t.sources))?!0:(e.nodes??[]).some(t=>{if(t.type==="app"){let n=t.data;return _f(n?.sources)||_f(e.apps?.[n?.keyword??""]?.sources)}if(t.type==="code"){let n=t.data;return!!n?.code?.trim()&&!n?.codeJS?.trim()}return t.type==="source"})}function Uve(e){if(!e?.["config.json"])return{};try{let t=JSON.parse(e["config.json"]);return typeof t=="object"&&t?t:{}}catch{return{}}}function Vve(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0))}function O0(e){return e?.origin??e?.source}function I$e(e){return!!e&&Object.keys(e).length>0}function jve(e){if(!e)return;if(sA[e])return e;if(!lA(e))return;let t=e.split("/").filter(Boolean),n=t[t.length-1],r=n?`repo/apps/code/${n}`:void 0;return r&&sA[r]?r:void 0}function T$e(e){let t=jve(e),n=t?sA[t]:void 0;return n?{...n}:void 0}function dA(e,t){let{source:n,...r}=e,o=O0(e)||t,i=jve(o),a=I$e(e.sources)?e.sources:T$e(o)||e.sources||{};return Vve({...r,origin:i||o,sources:a})}function Hl(e){return Object.fromEntries(Object.entries(e??{}).map(([t,n])=>[t,dA(n,t)]))}function dd(e){let t=Uve(e.sources),n=O0(e);return{name:e.name||t.name||n||"Scene app",category:e.category||t.category,description:e.description||t.description,version:e.version||t.version,settings:e.settings||t.settings,apt:e.apt||t.apt,fields:e.fields||t.fields,output:e.output||t.output,cache:e.cache||t.cache,origin:n}}function IX(e){return Object.fromEntries(Object.entries(Hl(e?.apps)).map(([t,n])=>[t,dd(n)]))}function Wve(e,t){return{...e,...IX(t)}}function TX(e){let t=O0(e);if(!t)return null;let n=t.split("/");return n[0]==="repo"&&n[1]==="apps"&&n[2]?n[2]:n[0]==="repo"&&n[1]?n[1]:n[0]==="scene"?"scene":n[0]||null}function uA(e,t){let n=TX(e);return`${t?`${t}: `:""}${e.name}${n?` [${n}]`:""}`}async function AX(e){let t=sA[e]??Bve[e];if(t)return{...t};let n=await Se(`/api/apps/source?keyword=${encodeURIComponent(e)}`);return n.ok?await n.json():{}}function L_(e,t,n){let r=t.split("/").filter(Boolean),i=(r[r.length-1]||n?.name||"app").replace(/[^a-zA-Z0-9_-]+/g,"-").replace(/(^-|-$)/g,"")||"app";if(!e[i])return i;let a=2,s=`${i}-${a}`;for(;e[s];)a+=1,s=`${i}-${a}`;return s}function FO(e,t,n,r){let o=Uve(n),i=O0(r)||O0(t)||(lA(e)?e:void 0),{source:a,...s}=r??{};return Vve({...s,origin:i,name:o.name||r?.name||t?.name||e,category:o.category||r?.category||t?.category,description:o.description||r?.description||t?.description,version:o.version||r?.version||t?.version,settings:o.settings||r?.settings||t?.settings,apt:o.apt||r?.apt||t?.apt,fields:o.fields||r?.fields||t?.fields,output:o.output||r?.output||t?.output,cache:o.cache||r?.cache||t?.cache,sources:n})}async function RO(e,t,n){if(!lA(t))return{sceneApps:e,keyword:t,app:n??null};let r=await AX(t),o=L_(e,t,n),i=FO(o,n,r,{origin:O0(n)||t});return{sceneApps:{...e,[o]:i},keyword:o,app:dd(i)}}function NO(e,t,n,r=!1,o){let i=Hl(n),a=r&&Object.values(i).some(s=>cA(s.sources));return e?.map(s=>s.id===t?{...s,apps:i,...o?{nodes:o}:{},settings:a&&s.settings?.execution!=="compiled"?{...s.settings,execution:"compiled"}:s.settings}:s)}var DO={openAI:{title:"OpenAI",tagLabel:"OpenAI API key missing",description:"The OpenAI API key is used within OpenAI apps on frames.",fields:[{label:"API key for frames",secret:!0,path:["openAI","apiKey"]}]},unsplash:{title:"Unsplash",tagLabel:"Unsplash access key missing",fields:[{label:"Access key",secret:!0,path:["unsplash","accessKey"]}]},homeAssistant:{title:"Home Assistant",tagLabel:"Home Assistant access token missing",fields:[{label:"Home assistant URL",path:["homeAssistant","url"]},{label:"Access token (Profile \u2192 Long-Lived Access Tokens)",secret:!0,path:["homeAssistant","accessToken"]}]},immich:{title:"Immich",tagLabel:"Immich API key missing",fields:[{label:"Server URL",path:["immich","url"]},{label:"API key (Account Settings \u2192 API Keys)",secret:!0,path:["immich","apiKey"]}]},github:{title:"GitHub",tagLabel:"GitHub personal access token missing",freeLimitedUsage:!0,fields:[{label:"API key",secret:!0,path:["github","api_key"]}]},frameOS:{title:"FrameOS Gallery",tagLabel:"FrameOS Gallery API key missing",fields:[{label:"API key",secret:!0,path:["frameOS","apiKey"]}]}};function A$e(e,t){if(t){if(e[t])return e[t];if(!t.includes("/")){let n=Object.keys(e).find(r=>r.endsWith(`/${t}`));if(n)return e[n]}}}function B0(e,t){let n=new Set;for(let r of e??[])for(let o of r.nodes??[])if(o.type==="app"){let i=o.data?.keyword,a=i?r.apps?.[i]:void 0,s=a?dd(a):A$e(t,i);for(let l of s?.settings??[])DO[l]&&n.add(l)}return Array.from(n)}function F$e(e){return"blob"in e?null:"templateId"in e?{template_id:e.templateId}:"url"in e?{url:e.url}:{source_scene_id:e.sourceSceneId,...e.sourceFrameId!==void 0?{source_frame_id:e.sourceFrameId}:{}}}var LO=class extends Error{status;constructor(t,n){super(t),this.name="SceneImageError",this.status=n}};async function R$e(e){try{let t=await e.json();if(t?.detail)return String(t.detail)}catch{}return`unexpected status ${e.status}`}async function N$e(e,t,n){let r=F$e(n),o=r?await Se(`/api/frames/${e}/scene_images/${t}/copy`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)}):await Se(`/api/frames/${e}/scene_images/${t}`,{method:"POST",body:n.blob});if(!o.ok)throw new LO(await R$e(o),o.status);Av.actions.updateEntityImage(`frames/${e}`,`scene_images/${t}`)}function FX(e,t,n,r){let o=r instanceof Error?r.message:String(r);console.error(`Failed to copy the scene ${n}`,r),Rt.actions.startTask({frameId:e,kind:"sceneImage",title:`Copying the scene ${n}`,detail:null,sceneId:t}),Rt.actions.taskFailed({frameId:e,kind:"sceneImage",sceneId:t,detail:`${o}. The scene tile stays blank until the frame renders it.`})}async function MO(e,t,n,r={}){let o=r.label??"preview image";if(!(!t.length||!n)&&!(Tt()&&!("blob"in n)))try{await Promise.all(t.map(i=>N$e(e,i,n)))}catch(i){if(r.ignoreMissingSource&&i instanceof LO&&i.status===404)return;FX(e,t[0],o,i)}}var nJ=M(fSe(),1),mSe=90,VJe=90,jJe=120,WJe=64,qJe=56,hSe=50,TSe=70,KJe=44,hA=40,JX=40,QX=24,GJe=16,gSe=0,bSe=180,ZX=120,$Je=hA,ASe=32,YJe=24;var ySe=16,XJe=35,JJe=64,QJe=340,ZJe=140,eQe=8,tQe=49,rJ=16,vSe=rJ+12,nQe=50,rQe=38,oQe=30,iQe=39,aQe=67,sQe=48,lQe=32,wSe=200,oJ=18,cQe=260,dQe=180,xSe=200,FSe=340,uQe=2200,pQe=6,fQe=119,RSe=260,eJ=100,mQe=72,hQe=8,gQe=120,bQe=91,UO=7,yQe=22,NSe=40,Lv=4,vQe=TSe,wQe=60,xQe=28,iJ=1e3;function vo(e){return{width:e.width??cQe,height:e.height??dQe}}function VO(e){if(typeof e=="number"&&Number.isFinite(e))return e;if(typeof e=="string"){let t=Number.parseFloat(e);return Number.isFinite(t)?t:null}return null}function SQe(e){let t=e.data??{},n=t.codeArgs??[],r=t.codeOutputs??[],o=(t.codeJS??t.code??"").trim(),i=o?o.split(/\r?\n/):[""],a=i.reduce((m,h)=>Math.max(m,h.length),0),s=[...n,...r].reduce((m,h)=>Math.max(m,h.name.length*UO+eJ),xSe),l=n.reduce((m,h)=>m+h.name.length*UO+mQe+hQe,gQe),d=n.length>pQe?uQe:FSe,c=Math.min(d,Math.max(xSe,s,l,a*UO+eJ)),u=Math.max(1,Math.floor((c-eJ/2)/UO)),p=i.reduce((m,h)=>m+Math.max(1,Math.ceil(h.length/u)),0),f=Math.min(RSe,Math.max(fQe,bQe+p*yQe));return{width:Math.round(c),height:Math.round(f)}}function _Qe(e){if(e.type!=="code")return e;let t=SQe(e),n=VO(e.width)??VO(e.style?.width),r=VO(e.height)??VO(e.style?.height),o=n!==null&&n>FSe?Math.max(n,t.width):t.width,i=r!==null&&r>RSe?Math.max(r,t.height):t.height,a={...e.style??{},width:o,height:i};return{...e,width:o,height:i,style:a}}function WO(e){return e?e.startsWith("fieldInput/")?e.slice(11):e.startsWith("codeField/")?e.slice(10):e.startsWith("field/")?e.slice(6):null:null}function DSe(e){return WO(e)?.replace(/\[.*$/,"")??null}function SSe(e){let t=LSe(e);return t.length===0?null:t.reduce((n,r,o)=>n+r/iJ**o,0)}function LSe(e){let t=WO(e);return t?Array.from(t.matchAll(/\[(\d+)\]/g)).map(n=>Number(n[1])):[]}function CQe(e){return e.sourceHandle==="next"||e.targetHandle==="prev"||e.type==="appNodeEdge"}function kh(e){if(e.type!=="app")return!1;let t=e.data?.keyword;return typeof t=="string"&&t.startsWith("data/")}function _Se(e,t){if(e.type!=="app")return!1;if(t>1)return!0;let n=e.data?.keyword;return typeof n=="string"&&(n.startsWith("data/")||n.startsWith("logic/"))}function kQe(e){return e.type==="event"||e.type==="dispatch"||e.type==="source"}function tJ(e){return e.position.x+vo(e).width/2}function M_(e){let t=vo(e);return{left:e.position.x,right:e.position.x+t.width,top:e.position.y,bottom:e.position.y+t.height}}function P_(e,t){return{left:Math.min(e.left,t.left),right:Math.max(e.right,t.right),top:Math.min(e.top,t.top),bottom:Math.max(e.bottom,t.bottom)}}function CSe(e,t){return{left:e.left+t.x,right:e.right+t.x,top:e.top+t.y,bottom:e.bottom+t.y}}function kSe(e,t){if(e.type==="state")return kh(t)?ASe:eQe;if(kh(e)&&kh(t))return tQe;let n=vo(t);return e.type==="code"&&n.width<=QJe?JJe:XJe}function jO(e,t){let n=vo(t);return e.type==="state"?kh(t)?oJ:n.height>=wSe?lQe:sQe:kh(e)&&kh(t)?rQe:e.type==="code"?n.height<=ZJe?aQe:n.height>=wSe?oQe:iQe:nQe}function ud(e,t,n){let r=WO(t);if(!r)return Number.MAX_SAFE_INTEGER;let o=n[e]??[],i=DSe(t),a=SSe(t)??0,s=o.indexOf(r);if(s>=0)return s*iJ+a;let l=i?o.indexOf(i):-1;if(l>=0)return l*iJ+a;let d=SSe(t);return d!==null?d:Number.MAX_SAFE_INTEGER}function EQe(e,t,n){let r=WO(t);if(!r)return null;let o=n[e.id]??[],i=DSe(t),a=o.indexOf(r),s=a>=0?a:i?o.indexOf(i):-1;if(s<0)return null;let{width:l}=vo(e),d=t?.startsWith("codeField/")?NSe:KJe,c=Math.max(l-d*2,1),u=Math.max(o.length-1,1);return d+c*s/u}function MSe(e,t,n){let{width:r}=vo(e);return t==="prev"?0:t==="next"?r:e.type==="code"&&t==="fieldOutput"?NSe:EQe(e,t,n)??r/2}function ESe(e,t,n){return e.position.x+MSe(e,t,n)}function ISe(e,t){let n=[...e].sort((r,o)=>r.desiredCenterX-o.desiredCenterX||r.order-o.order||(r.node.type??"").localeCompare(o.node.type??"")||r.node.id.localeCompare(o.node.id)).map(r=>{let{width:o}=vo(r.node);return{...r,width:o,left:r.desiredCenterX-o/2}});for(let r=1;r<n.length;r+=1){let o=n[r-1],i=n[r];i.left=Math.max(i.left,o.left+o.width+t)}if(n.length>1){let r=Math.min(...n.map(l=>l.desiredCenterX-l.width/2)),o=Math.max(...n.map(l=>l.desiredCenterX+l.width/2)),i=Math.min(...n.map(l=>l.left)),a=Math.max(...n.map(l=>l.left+l.width)),s=(r+o)/2-(i+a)/2;n.forEach(l=>{l.left+=s})}return new Map(n.map(r=>[r.node.id,r.left]))}function IQe(e,t){if(!t.has(e))return t.add(e),e;let n=2;for(;t.has(`${e}-${n}`);)n+=1;let r=`${e}-${n}`;return t.add(r),r}function TQe(e,t){let n=e.reduce((l,d)=>(l[d.id]=d,l),{}),r=new Set(e.map(l=>l.id)),o=new WeakMap;t.forEach((l,d)=>{o.set(l,d)});let i=t.reduce((l,d)=>{let c=n[d.source],u=n[d.target],p=d.targetHandle?.startsWith("fieldInput/")||d.targetHandle?.startsWith("codeField/");return c?.type!=="state"||!u||u.type!=="app"&&u.type!=="code"||d.sourceHandle!=="fieldOutput"||!p||(l[d.source]=[...l[d.source]??[],d]),l},{}),a=[],s=new WeakMap;return Object.entries(i).forEach(([l,d])=>{let c=n[l];if(!c)return;let u=d.reduce((f,m)=>(f[m.target]=[...f[m.target]??[],m],f),{}),p=Object.entries(u).sort(([f,m],[h,g])=>(o.get(m[0])??0)-(o.get(g[0])??0)||f.localeCompare(h));p.length<=1||p.slice(1).forEach(([f,m])=>{let h=IQe(`${l}__for__${f}`,r),{id:g,selected:b,dragging:y,positionAbsolute:w,...v}=c;a.push({...v,id:h,position:{...c.position},selected:!1,dragging:!1}),m.forEach(x=>{s.set(x,h)})})}),a.length===0?{nodes:e,edges:t}:{nodes:[...e,...a],edges:t.map(l=>{let d=s.get(l);return d?{...l,source:d}:l})}}function qO(e,t,n={}){let r=TQe(e,t);return{nodes:AQe(r.nodes,r.edges,n),edges:r.edges}}function AQe(e,t,n={}){if(!e.length)return e;let r=n.fieldOrderByNodeId??{},o=e.map(_Qe),i=new Set;t.forEach(G=>{G.sourceHandle==="next"&&i.add(G.source),G.targetHandle==="prev"&&i.add(G.target)});let a=o.filter(G=>kQe(G)||G.type==="app"&&!kh(G)&&i.has(G.id)),s=o.reduce((G,J)=>(G[J.id]=J,G),{}),l=new Set(a.map(G=>G.id)),d=t.filter(G=>l.has(G.source)&&l.has(G.target)&&CQe(G)),c=t.reduce((G,J)=>(!J.source||!J.target||(G[J.source]=[...G[J.source]??[],J]),G),{}),u=t.reduce((G,J)=>(!J.source||!J.target||(G[J.target]=[...G[J.target]??[],J]),G),{}),p=new WeakMap;t.forEach((G,J)=>{p.set(G,J)});let f=new Map(a.map((G,J)=>[G.id,J])),m=[...d].sort((G,J)=>(f.get(G.source)??0)-(f.get(J.source)??0)||ud(G.source,G.sourceHandle,r)-ud(J.source,J.sourceHandle,r)||ud(G.target,G.targetHandle,r)-ud(J.target,J.targetHandle,r)||G.target.localeCompare(J.target));if(!a.length)return e;let h=new Map(a.map(G=>[G.id,G.id])),g=G=>{let J=h.get(G);if(!J||J===G)return G;let oe=g(J);return h.set(G,oe),oe},b=(G,J)=>{let oe=g(G),ce=g(J);oe!==ce&&h.set(ce,oe)};m.forEach(G=>{b(G.source,G.target)});let y=G=>l.has(G)?g(G):null,w=new nJ.default.graphlib.Graph({multigraph:!0});w.setGraph({rankdir:"LR",nodesep:mSe,ranksep:VJe,edgesep:25}),w.setDefaultEdgeLabel(()=>({})),a.forEach(G=>{let{width:J,height:oe}=vo(G);w.setNode(G.id,{width:J,height:oe,rank:G.type==="event"||G.type==="source"?"min":void 0})}),m.forEach(G=>{!G.source||!G.target||G.source===G.target||w.setEdge(G.source,G.target)}),nJ.default.layout(w);let v=new Map;a.forEach(G=>{let J=w.node(G.id);if(!J)return;let{width:oe,height:ce}=vo(G);v.set(G.id,{x:J.x-oe/2,y:J.y-ce/2})});let x=(G,J,oe=new Set)=>{if(oe.has(G))return;oe.add(G);let ce=v.get(G);ce&&v.set(G,{x:ce.x+J.x,y:ce.y+J.y}),m.filter(We=>We.source===G).forEach(We=>{x(We.target,J,oe)})},S=m.reduce((G,J)=>(!J.sourceHandle?.startsWith("field/")||J.targetHandle!=="prev"||(G[J.source]=[...G[J.source]??[],J]),G),{}),C=new Set(Object.values(S).flatMap(G=>G.length>1?G.map(J=>J.target):[])),T=m.reduce((G,J)=>(G[J.target]=[...G[J.target]??[],J],G),{}),F=new Map,I=(G,J=new Set)=>{if(F.has(G))return F.get(G)??null;if(!l.has(G))return F.set(G,null),null;if(C.has(G))return F.set(G,G),G;if(J.has(G))return null;J.add(G);for(let oe of T[G]??[]){let ce=I(oe.source,new Set(J));if(ce)return F.set(G,ce),ce}return F.set(G,null),null},L=new Map,z=(G,J=new Set)=>{let oe=L.get(G);if(oe)return new Set(oe);let ce=new Set;return J.has(G)||(J.add(G),l.has(G)&&ce.add(G),m.filter(We=>We.source===G).forEach(We=>{z(We.target,new Set(J)).forEach(Fe=>ce.add(Fe))}),L.set(G,new Set(ce))),ce},V=new Map,R=(G,J=new Set)=>{let oe=V.get(G);if(oe)return new Set(oe);let ce=new Set;return J.has(G)||(J.add(G),l.has(G)?ce.add(G):(c[G]??[]).forEach(Fe=>{R(Fe.target,new Set(J)).forEach(at=>ce.add(at))}),V.set(G,new Set(ce))),ce},j=(G,J)=>{if(!J)return!0;let oe=R(G);return oe.size===0||[...oe].every(ce=>J.has(ce))},W=G=>R(G).size>1,$=(G,J)=>Array.from((u[G]??[]).filter(oe=>oe.source&&oe.target&&!l.has(oe.source)&&j(oe.source,J)&&(oe.targetHandle?.startsWith("fieldInput/")||oe.targetHandle?.startsWith("codeField/"))).sort((oe,ce)=>ud(G,oe.targetHandle,r)-ud(G,ce.targetHandle,r)||(p.get(oe)??0)-(p.get(ce)??0)||oe.source.localeCompare(ce.source)).reduce((oe,ce)=>(oe.has(ce.source)||oe.set(ce.source,ce),oe),new Map).values()),pe=(G,J=new Set,oe)=>{let ce=s[G];if(!ce)return{left:0,right:0,top:0,bottom:0};let We=vo(ce),Fe={left:0,right:We.width,top:0,bottom:We.height};if(J.has(G))return Fe;J.add(G);let at=0,yt=null;return $(G,oe).forEach((Xt,Ut)=>{let pn=s[Xt.source];if(!pn)return;let Fr=vo(pn),hr=jO(pn,ce),pi=kSe(pn,ce),Gs=at-(Ut===0?hr:0)-Fr.height,Mr=Math.min(-pi-rJ*Ut,yt?yt.left-vSe:Number.POSITIVE_INFINITY),jo=CSe(pe(pn.id,new Set(J),oe),{x:Mr,y:Gs});Fe=P_(Fe,jo),yt=yt?P_(yt,jo):jo,at=jo.top-oJ}),Fe},O=(G,J,oe=new Set)=>{let ce=v.get(G);if(!ce)return pe(G,new Set,J);let We=pe(G,new Set,J);return oe.has(G)||(oe.add(G),m.filter(Fe=>Fe.source===G).forEach(Fe=>{let at=v.get(Fe.target);at&&(We=P_(We,CSe(O(Fe.target,J,new Set(oe)),{x:at.x-ce.x,y:at.y-ce.y})))})),We};Object.entries(S).forEach(([G,J])=>{if(J.length<2)return;let oe=a.find(zt=>zt.id===G),ce=v.get(G);if(!oe||!ce)return;let We=new Set,Fe=J.map((zt,da)=>({edge:zt,index:da,pathIndexes:LSe(zt.sourceHandle)})),at=Fe.every(({pathIndexes:zt})=>zt.length>=2),yt=at?Array.from(new Set(Fe.map(({pathIndexes:zt})=>zt[0]))).sort((zt,da)=>zt-da):[],Xt=at?Array.from(new Set(Fe.map(({pathIndexes:zt})=>zt[1]))).sort((zt,da)=>zt-da):[],Ut=at&&Fe.length>3&&(yt.length===1||Xt.length===1),pn=at&&!Ut,Fr=Math.max(1,Math.ceil(Math.sqrt(Fe.length))),hr=Fe.map(({edge:zt,index:da,pathIndexes:$s})=>{let xd=s[zt.target],Pw=v.get(zt.target);if(!xd||!Pw)return null;let sk=pn?yt.indexOf($s[0]):Math.floor(da/Fr),Ow=pn?Xt.indexOf($s[1]):da%Fr,Zf=O(zt.target,z(zt.target));return{edge:zt,targetPosition:Pw,row:sk,column:Ow,footprint:Zf,footprintWidth:Zf.right-Zf.left,footprintHeight:Zf.bottom-Zf.top}}).filter(zt=>zt!==null&&zt.row>=0&&zt.column>=0);if(hr.length===0)return;let pi=Math.max(...hr.map(zt=>zt.column))+1,Gs=Math.max(...hr.map(zt=>zt.row))+1,Mr=Array.from({length:pi},()=>0),jo=Array.from({length:Gs},()=>0);hr.forEach(zt=>{Mr[zt.column]=Math.max(Mr[zt.column],zt.footprintWidth),jo[zt.row]=Math.max(jo[zt.row],zt.footprintHeight)});let ji=pn?jJe:WJe,wd=pn?mSe:qJe,Mb=Mr.reduce((zt,da,$s)=>{let xd=$s===0?0:zt[$s-1]+Mr[$s-1]+ji;return zt.push(xd),zt},[]),Pb=jo.reduce((zt,da,$s)=>{let xd=$s===0?0:zt[$s-1]+jo[$s-1]+wd;return zt.push(xd),zt},[]),vp=jo.reduce((zt,da)=>zt+da,0)+Math.max(0,Gs-1)*wd,Ob=vo(oe),ik=ce.x+Ob.width+ji,ak=ce.y+Ob.height/2-vp/2;hr.forEach(zt=>{let da=ik+Mb[zt.column]+(Mr[zt.column]-zt.footprintWidth)/2,$s=ak+Pb[zt.row]+(jo[zt.row]-zt.footprintHeight)/2,xd={x:da-zt.footprint.left,y:$s-zt.footprint.top};x(zt.edge.target,{x:xd.x-zt.targetPosition.x,y:xd.y-zt.targetPosition.y},We)})});let D=new Map,Y=(G,J=new Set)=>{if(D.has(G))return D.get(G)??null;if(l.has(G))return D.set(G,G),G;if(J.has(G))return null;J.add(G);for(let oe of c[G]??[]){let ce=Y(oe.target,J);if(ce)return D.set(G,ce),ce}for(let oe of u[G]??[]){let ce=Y(oe.source,J);if(ce)return D.set(G,ce),ce}return D.set(G,null),null},Q=new Map,U=(G,J,oe=new Set)=>{let ce=`${G}:${J}`;if(Q.has(ce))return Q.get(ce)??0;if(G===J)return Q.set(ce,0),0;if(oe.has(G))return 0;oe.add(G);let We=0;for(let Fe of c[G]??[]){let at=U(Fe.target,J,oe);(at>0||Fe.target===J)&&(We=Math.max(We,at+1))}return Q.set(ce,We),We},te=o.filter(G=>!l.has(G.id)).reduce((G,J)=>{let oe=Y(J.id);return oe&&(G[oe]=[...G[oe]??[],J]),G},{}),me=o.map(G=>{let J=v.get(G.id);return J?{...G,position:{...J}}:G}).reduce((G,J)=>(G[J.id]=J,G),{}),Pe=(()=>{let G=t.reduce((oe,ce)=>{if(!ce.source||!ce.target||!ce.targetHandle?.startsWith("fieldInput/"))return oe;let We=s[ce.source],Fe=s[ce.target];return We?.type!=="state"||Fe?.type!=="app"||(oe[ce.target]=[...oe[ce.target]??[],ce]),oe},{}),J=new Map;return Object.entries(G).forEach(([oe,ce])=>{let We=s[oe],Fe=new Set(ce.map(at=>at.source));!We||!_Se(We,Fe.size)||Fe.forEach(at=>{J.set(at,oe)})}),J})(),Ye=new Map,Oe=(G,J)=>{let oe=Ye.get(J);return oe?G===J?0:oe.get(G)??1:G===J?0:1},fe=(G,J,oe)=>{let ce=[],We=(Fe,at,yt,Xt)=>{let Ut=me[at]??s[at];if(!Ut)return;let pn=Oe(at,J),Fr=pn===oe-1?0:pn<oe?1:2;if(Fr>1)return;let{width:hr}=vo(G);ce.push({centerX:ESe(Ut,yt,r)-MSe(G,Xt,r)+hr/2,order:ud(at,yt,r),priority:Fr})};for(let Fe of c[G.id]??[])We(Fe,Fe.target,Fe.targetHandle,Fe.sourceHandle);for(let Fe of u[G.id]??[])We(Fe,Fe.source,Fe.sourceHandle,Fe.targetHandle);if(ce.length===0){let Fe=me[J]??s[J];return{centerX:tJ(Fe||G),order:Number.MAX_SAFE_INTEGER}}return ce.sort((Fe,at)=>Fe.priority-at.priority||Fe.order-at.order||Fe.centerX-at.centerX),{centerX:ce[0].centerX,order:ce[0].order}};Object.entries(te).forEach(([G,J])=>{let oe=me[G]??s[G];if(!oe)return;let ce=new Map;J.forEach(at=>{ce.set(at.id,Math.max(1,U(at.id,G)))}),Ye.set(G,ce);let We=Math.max(...ce.values(),1),Fe=oe.position.y-hSe;for(let at=1;at<=We;at+=1){let yt=J.filter(hr=>ce.get(hr.id)===at&&!Pe.has(hr.id));if(yt.length===0)continue;let Xt=Math.max(...yt.map(hr=>vo(hr).height)),Ut=Fe-Xt,pn=yt.map(hr=>{let pi=fe(hr,G,at);return{node:hr,desiredCenterX:pi.centerX,order:pi.order}}),Fr=ISe(pn,TSe);yt.forEach(hr=>{let pi=vo(hr);me[hr.id]={...hr,position:{x:Fr.get(hr.id)??tJ(oe)-pi.width/2,y:Ut+Xt-pi.height}}}),Fe=Ut-hSe}});let _t=(G,J,oe,ce)=>{let We=vo(G),Fe=vo(J);return G.position.x<J.position.x+Fe.width+oe&&G.position.x+We.width+oe>J.position.x&&G.position.y<J.position.y+Fe.height+ce&&G.position.y+We.height+ce>J.position.y},we=(G,J)=>{me[G.id]={...G,position:J}},je=(G,J)=>{G.forEach(oe=>{let ce=me[oe]??s[oe];ce&&we(ce,{x:ce.position.x+J.x,y:ce.position.y+J.y})})},lt=new Map,jt=G=>!!(G.source&&G.target&&!l.has(G.source)&&(G.targetHandle?.startsWith("fieldInput/")||G.targetHandle?.startsWith("codeField/"))),Xe=t.reduce((G,J)=>(jt(J)&&(G[J.target]=[...G[J.target]??[],J]),G),{}),De=(G,J)=>Array.from((Xe[G]??[]).filter(oe=>j(oe.source,J)).sort((oe,ce)=>ud(G,oe.targetHandle,r)-ud(G,ce.targetHandle,r)||(p.get(oe)??0)-(p.get(ce)??0)||oe.source.localeCompare(ce.source)).reduce((oe,ce)=>(oe.has(ce.source)||oe.set(ce.source,ce),oe),new Map).values()),sn=(G,J)=>{let oe=G.position.y;return J.forEach((ce,We)=>{let Fe=me[ce.source]??s[ce.source];if(!Fe)return;let at=vo(Fe),yt=We===0?jO(Fe,G):0;oe=oe-yt-at.height-ySe}),oe},nr=(G,J=new Set,oe)=>{let ce=me[G]??s[G];if(!ce)return null;let We=M_(ce);return J.has(G)||(J.add(G),De(G,oe).forEach(Fe=>{let at=me[Fe.source]??s[Fe.source];if(!at||l.has(at.id))return;let yt=nr(at.id,new Set(J),oe);yt&&(We=P_(We,yt))})),We},Da=(G,J=new Set,oe)=>{if(J.has(G))return;J.add(G);let ce=me[G]??s[G];if(!ce)return;let We=De(G,oe),Fe=We.filter(Ut=>Pe.get(Ut.source)===G),at=We.filter(Ut=>{let pn=me[Ut.source]??s[Ut.source];return pn&&!l.has(pn.id)&&Pe.get(pn.id)!==G});if(ce.type==="code"&&at.length>Lv)return;let yt=Fe.length>0?sn(ce,Fe):ce.position.y,Xt=null;at.forEach((Ut,pn)=>{let Fr=me[Ut.source]??s[Ut.source];if(!Fr)return;let hr=vo(Fr),pi=jO(Fr,ce),Gs=kSe(Fr,ce),Mr=yt-(pn===0?pi:0)-hr.height,jo=Math.min(ce.position.x-Gs-rJ*pn,Xt?Xt.left-vSe:Number.POSITIVE_INFINITY);we(Fr,{x:jo,y:Mr}),Da(Fr.id,new Set(J),oe);let ji=nr(Fr.id,new Set(J),oe);ji&&(Xt=Xt?P_(Xt,ji):ji),yt=(ji?.top??Mr)-oJ})},La=()=>{a.map(G=>me[G.id]??G).sort((G,J)=>G.position.x-J.position.x||G.position.y-J.position.y||(f.get(G.id)??0)-(f.get(J.id)??0)||G.id.localeCompare(J.id)).forEach(G=>{Da(G.id,new Set,z(G.id))})},Vi=()=>{let G=new Map;return a.forEach(J=>{let oe=I(J.id)??J.id,ce=G.get(oe)??new Set;ce.add(J.id),G.set(oe,ce)}),o.forEach(J=>{if(l.has(J.id)||W(J.id))return;let oe=Y(J.id);if(!oe||!l.has(oe))return;let ce=I(oe)??oe,We=G.get(ce)??new Set;We.add(J.id),G.set(ce,We)}),G},ni=(G,J)=>G.top<J.bottom+gSe&&G.bottom+gSe>J.top,Ee=(G,J)=>{let oe=0;return G.forEach(ce=>{let We=me[ce]??s[ce];if(!We)return;let Fe=M_(We);J.forEach(at=>{let yt=me[at]??s[at];if(!yt)return;let Xt=M_(yt);!(Fe.left<Xt.right&&Fe.right>Xt.left)||!ni(Fe,Xt)||(oe=Math.max(oe,Xt.right+GJe-Fe.left))})}),oe},Ke=G=>Array.from(G).map(J=>me[J]??s[J]).filter(J=>!!J).map(M_).reduce((J,oe)=>J?P_(J,oe):oe,null),Lt=G=>Math.min(...Array.from(G).map(J=>f.get(J)??Number.MAX_SAFE_INTEGER)),cn=G=>{let J=Array.from(G).find(oe=>l.has(oe));return J?y(J):null},rr=()=>{let G=Vi(),J=[];Array.from(G.values()).sort((oe,ce)=>{let We=Ke(oe),Fe=Ke(ce);return(We?.left??0)-(Fe?.left??0)||(We?.top??0)-(Fe?.top??0)||Lt(oe)-Lt(ce)}).forEach(oe=>{let ce=cn(oe);for(let We=0;We<QX;We+=1){let Fe=J.filter(at=>at.componentId===ce).reduce((at,yt)=>Math.max(at,Ee(oe,yt.nodeIds)),0);if(Fe<=0)break;je(oe,{x:Fe,y:0})}J.push({nodeIds:oe,componentId:ce})})},Tr=()=>{let G=new Map;return a.forEach(J=>{let oe=y(J.id);if(!oe)return;let ce=G.get(oe)??new Set;ce.add(J.id),G.set(oe,ce)}),o.forEach(J=>{if(l.has(J.id))return;let oe=Y(J.id),ce=oe?y(oe):null;if(!ce)return;let We=G.get(ce)??new Set;We.add(J.id),G.set(ce,We)}),G},ri=(G,J)=>{let oe=0;return G.forEach(ce=>{let We=me[ce]??s[ce];if(!We)return;let Fe=M_(We);J.forEach(at=>{let yt=me[at]??s[at];if(!yt)return;let Xt=M_(yt),Ut=Fe.left<Xt.right+bSe&&Fe.right+bSe>Xt.left,pn=Fe.top<Xt.bottom+ZX&&Fe.bottom+ZX>Xt.top;!Ut||!pn||(oe=Math.max(oe,Xt.bottom+ZX-Fe.top))})}),oe},Vo=()=>{let G=Array.from(Tr().values()).sort((oe,ce)=>{let We=Ke(oe),Fe=Ke(ce);return(We?.top??0)-(Fe?.top??0)||(We?.left??0)-(Fe?.left??0)||Lt(oe)-Lt(ce)}),J=[];G.forEach(oe=>{for(let ce=0;ce<QX;ce+=1){let We=J.reduce((Fe,at)=>Math.max(Fe,ri(oe,at.nodeIds)),0);if(We<=0)break;je(oe,{x:0,y:We})}J.push({nodeIds:oe})})},Ai=()=>{let G=t.reduce((J,oe)=>{if(!oe.source||!oe.target||!oe.targetHandle?.startsWith("codeField/"))return J;let ce=me[oe.source]??s[oe.source],We=me[oe.target]??s[oe.target];return!ce||We?.type!=="code"||l.has(ce.id)||(J[oe.target]=[...J[oe.target]??[],oe]),J},{});Object.entries(G).forEach(([J,oe])=>{if(oe.length<=Lv)return;let ce=me[J]??s[J];if(!ce)return;let We=Array.from(oe.sort((Ut,pn)=>ud(J,Ut.targetHandle,r)-ud(J,pn.targetHandle,r)||(p.get(Ut)??0)-(p.get(pn)??0)||Ut.source.localeCompare(pn.source)).reduce((Ut,pn)=>(Ut.has(pn.source)||Ut.set(pn.source,pn),Ut),new Map).values()),Fe=We.filter(Ut=>(me[Ut.source]??s[Ut.source])?.type==="state"),at=We.filter(Ut=>(me[Ut.source]??s[Ut.source])?.type!=="state"),yt=[];for(let Ut=0;Ut<Fe.length;Ut+=Lv)yt.push(Fe.slice(Ut,Ut+Lv));for(let Ut=0;Ut<at.length;Ut+=Lv)yt.push(at.slice(Ut,Ut+Lv));let Xt=ce.position.y-wQe;for(let[Ut,pn]of yt.entries()){let Fr=pn.map((Mr,jo)=>{let ji=me[Mr.source]??s[Mr.source];return ji?{node:ji,desiredCenterX:ESe(ce,Mr.targetHandle,r),order:Ut*Lv+jo}:null}).filter(Mr=>Mr!==null);if(Fr.length===0)continue;let hr=Math.max(...Fr.map(Mr=>vo(Mr.node).height)),pi=Xt-hr,Gs=ISe(Fr,vQe);Fr.forEach(Mr=>{let jo=vo(Mr.node);we(Mr.node,{x:Gs.get(Mr.node.id)??Mr.desiredCenterX-jo.width/2,y:pi+hr-jo.height})}),Xt=pi-xQe}})},ca=()=>{t.filter(J=>{let oe=me[J.source]??s[J.source],ce=me[J.target]??s[J.target];return oe&&ce&&kh(oe)&&ce.type==="app"&&!kh(ce)&&R(oe.id).size===0&&!l.has(oe.id)&&!l.has(ce.id)&&J.sourceHandle==="fieldOutput"&&!!J.targetHandle?.startsWith("fieldInput/")}).sort((J,oe)=>{let ce=Y(J.source),We=Y(oe.source),Fe=ce?Oe(J.source,ce):0,at=We?Oe(oe.source,We):0;return Fe-at||J.source.localeCompare(oe.source)}).forEach(J=>{let oe=me[J.source]??s[J.source],ce=me[J.target]??s[J.target];if(!oe||!ce)return;let We=vo(oe),Fe=vo(ce);we(oe,{x:ce.position.x-We.width-$Je,y:ce.position.y+(Fe.height-We.height)/2})})},Ar=()=>{lt.clear();let G=t.reduce((J,oe)=>{if(!oe.source||!oe.target||!oe.targetHandle?.startsWith("fieldInput/"))return J;let ce=me[oe.source]??s[oe.source],We=me[oe.target]??s[oe.target];return ce?.type!=="state"||We?.type!=="app"||(J[oe.target]=[...J[oe.target]??[],oe]),J},{});Object.entries(G).forEach(([J,oe])=>{let ce=me[J]??s[J];if(!ce)return;let Fe=Array.from(oe.sort((yt,Xt)=>ud(J,yt.targetHandle,r)-ud(J,Xt.targetHandle,r)||(p.get(yt)??0)-(p.get(Xt)??0)||yt.source.localeCompare(Xt.source)).reduce((yt,Xt)=>(yt.has(Xt.source)||yt.set(Xt.source,Xt),yt),new Map).values()).map(yt=>me[yt.source]??s[yt.source]).filter(yt=>!!yt);if(Fe.length===0||!_Se(ce,Fe.length))return;let at=ce.position.y;Fe.forEach((yt,Xt)=>{let Ut=vo(yt),pn=Xt===0?jO(yt,ce):0,Fr=at-pn-Ut.height;lt.set(yt.id,J),we(yt,{x:ce.position.x-ASe-YJe*Xt,y:Fr}),at=Fr-ySe})})},oi=()=>{let G=o.map(oe=>oe.id).filter(oe=>l.has(oe)).sort((oe,ce)=>{let We=me[oe]??s[oe],Fe=me[ce]??s[ce];return We.position.y-Fe.position.y||We.position.x-Fe.position.x||oe.localeCompare(ce)}),J=o.map(oe=>oe.id).filter(oe=>!l.has(oe)).sort((oe,ce)=>{let We=me[oe]??s[oe],Fe=me[ce]??s[ce];return We.position.y-Fe.position.y||We.position.x-Fe.position.x||oe.localeCompare(ce)});for(let oe=0;oe<QX;oe+=1){let ce=!1;for(let We of J){let Fe=me[We]??s[We],at=vo(Fe);for(let yt of G){let Xt=me[yt]??s[yt],Ut=lt.has(Fe.id),pn=lt.get(Fe.id)===yt;if(!_t(Fe,Xt,Ut&&!pn?0:hA,Ut&&!pn?0:JX))continue;let pi=Xt.position.y-at.height-JX;pi<Fe.position.y&&(we(Fe,{x:Fe.position.x,y:pi}),ce=!0)}}for(let We=0;We<J.length;We+=1)for(let Fe=We+1;Fe<J.length;Fe+=1){let at=me[J[We]]??s[J[We]],yt=me[J[Fe]]??s[J[Fe]],Xt=lt.get(at.id),Ut=lt.get(yt.id),pn=Xt&&Xt===Ut,Fr=Xt===yt.id||Ut===at.id,hr=pn||Fr;if(!_t(at,yt,hr?0:hA,hr?0:JX))continue;let Mr=lt.has(at.id),jo=lt.has(yt.id),[ji,wd]=Mr!==jo?Mr?[at,yt]:[yt,at]:at.position.x<=yt.position.x?[at,yt]:[yt,at],Mb=vo(ji),Pb=vo(wd),vp=wd.position.x<ji.position.x?ji.position.x-Pb.width-hA:ji.position.x+Mb.width+hA;we(wd,{x:vp,y:wd.position.y}),ce=!0}if(!ce)break}};return ca(),Ai(),Ar(),oi(),ca(),Ai(),Ar(),oi(),Ai(),Ar(),La(),ca(),Ar(),Ai(),rr(),Vo(),o.map(G=>me[G.id]??G)}function KO(e){let t=new Uint8Array(e);if(window.crypto&&window.crypto.getRandomValues)window.crypto.getRandomValues(t);else for(let o=0;o<t.length;o++)t[o]=Math.floor(Math.random()*256);let n=Array.from(t);return btoa(String.fromCharCode.apply(null,n)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}var ql=M(J_e(),1);function Q_e(e){return[{name:"commonName",value:e}]}function gnt(e){let t=e.split(".");return t.length===4&&t.every(n=>/^\d+$/.test(n)&&Number(n)>=0&&Number(n)<=255)}function bnt(e){return gnt(e)||e.includes(":")&&/^[0-9a-fA-F:.]+$/.test(e)}function ynt(e){let t=[{type:2,value:"localhost"},{type:7,ip:"127.0.0.1"}];return e&&t.push(bnt(e)?{type:7,ip:e}:{type:2,value:e}),[{name:"subjectAltName",altNames:t}]}function Z_e(){return`01${ql.util.bytesToHex(ql.random.getBytesSync(15))}`}function eCe(e,t){return new Date(e.getTime()+t*24*60*60*1e3)}function tCe(e){return e.toISOString().replace("Z","+00:00")}function nCe(e){let t=e.trim(),n=new Date,r=new Date(n.getTime()-300*1e3),o=ql.pki.rsa.generateKeyPair({bits:2048,e:65537}),i=ql.pki.createCertificate();i.publicKey=o.publicKey,i.serialNumber=Z_e(),i.validity.notBefore=r,i.validity.notAfter=eCe(n,3650);let a=Q_e(`FrameOS Frame CA (${t||"frame"})`);i.setSubject(a),i.setIssuer(a),i.setExtensions([{name:"basicConstraints",cA:!0,critical:!0},{name:"keyUsage",digitalSignature:!0,keyCertSign:!0,cRLSign:!0,critical:!0}]),i.sign(o.privateKey,ql.md.sha256.create());let s=ql.pki.rsa.generateKeyPair({bits:2048,e:65537}),l=ql.pki.createCertificate();return l.publicKey=s.publicKey,l.serialNumber=Z_e(),l.validity.notBefore=r,l.validity.notAfter=eCe(n,825),l.setSubject(Q_e(t||"frame.local")),l.setIssuer(i.subject.attributes),l.setExtensions([...ynt(t),{name:"basicConstraints",cA:!1,critical:!0},{name:"extKeyUsage",serverAuth:!0},{name:"keyUsage",digitalSignature:!0,keyEncipherment:!0,critical:!0}]),l.sign(o.privateKey,ql.md.sha256.create()),{certs:{server:ql.pki.certificateToPem(l),server_key:ql.pki.privateKeyToPem(s.privateKey),client_ca:ql.pki.certificateToPem(i)},server_cert_not_valid_after:tCe(l.validity.notAfter),client_ca_cert_not_valid_after:tCe(i.validity.notAfter)}}function vnt(e,t){return(e.name||e.id).localeCompare(t.name||t.id,void 0,{numeric:!0,sensitivity:"base"})||String(e.id).localeCompare(String(t.id))}function rCe(e){return[...e].toSorted(vnt)}var Q_={frameos:"2026.9.5+e0ee71ef10d953fd834de06c4483561da8cf9aed",editor:"2026.9.5+b78a3455fb7e56a2474ca1b54cc55de5cbc3ece7",remote:"2026.9.3+a22d2f4dbdb936e9de7dd9f32559dba15fdbc1ad",docker:"2026.9.5+087277afc6de3924b8912f8d7bebe11baa023698"};var ggn=[{value:"",label:"Prefer binaries, build from source if needed"},{value:"precompiled",label:`Install precompiled binaries (version ${Q_.frameos.split("+")[0]})`},{value:"static",label:"Build from source - single binary (legacy: needs a build environment)"}];function E4(e){return e==="shared"||e==="shared-scenes"?"static":e==="static"||e==="precompiled"?e:"precompiled"}function NA(e){return e==="embedded"}function as(e,t){return NA(t)?"interpreted":e?.settings?.execution??"interpreted"}function DA(e,t){return as(e,t)!=="interpreted"}function oCe(e){let t=e?.settings?.execution;return t==="compiled"||t==="interpreted"?t:"interpreted"}var lQ="https://scenes.frameos.net/nim-converter",iCe="Preview runs the interpreter: this scene's Nim code nodes and Nim apps are not executed here. Convert the scene to JavaScript to see it whole.",xnt=`This makes the scene compiled (legacy): it will need a full FrameOS source build on every deploy.
|
|
11568
11568
|
|
|
11569
11569
|
Keep it interpreted instead and convert it to an interpreted scene at ${lQ}?
|
|
11570
11570
|
|
|
@@ -11913,4 +11913,4 @@ monaco-editor/esm/vs/language/json/monaco.contribution.js:
|
|
|
11913
11913
|
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
|
11914
11914
|
*-----------------------------------------------------------------------------*)
|
|
11915
11915
|
*/
|
|
11916
|
-
//# sourceMappingURL=chunk-
|
|
11916
|
+
//# sourceMappingURL=chunk-HFUAHA4L.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as i,b as e,c as t,d as r}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=editor-
|
|
1
|
+
import{a as i,b as e,c as t,d as r}from"./chunk-HFUAHA4L.js";import"./chunk-3BLCY6UO.js";import"./chunk-UQ47VFV7.js";import"./chunk-YVLZL2DF.js";import"./chunk-LJLSS6VP.js";import"./chunk-IO5HD6LR.js";import"./chunk-ISGRWLZB.js";import"./chunk-CMJLLXM5.js";import"./chunk-S7YZLIQ2.js";import"./chunk-QOR6RVYK.js";import"./chunk-IGSWCXWL.js";import"./chunk-XY25BMCC.js";import"./chunk-MYJDNFHV.js";import"./chunk-XX6D4PCV.js";import"./chunk-FFF5XN2E.js";import"./chunk-4E35PBBI.js";import"./chunk-I5YU2QOB.js";import"./chunk-NMLR6BBX.js";import"./chunk-OZMHIOOM.js";import"./chunk-VY54N476.js";import"./chunk-IAT3SH6V.js";import"./chunk-NKBKRXAI.js";import"./chunk-7WRUHYVT.js";import"./chunk-UQ2OIIDY.js";import"./chunk-SYSYBEFC.js";import"./chunk-P7EAYOW2.js";import"./chunk-UE65FKDK.js";import"./chunk-XRXYPYNZ.js";import"./chunk-2AMRXN7J.js";import"./chunk-MQ6GXGQP.js";import"./chunk-WXJNV4KM.js";import"./chunk-MMFEMX4D.js";import"./chunk-JMW7BC3H.js";import"./chunk-RIEQ6JT2.js";import"./chunk-76H6TNVU.js";import"./chunk-3PWLJ7VB.js";import"./chunk-RUT5KRF7.js";import"./chunk-PRLZJXP3.js";import"./chunk-UHBPDWMK.js";import"./chunk-PF2U73FX.js";import"./chunk-NLF7C362.js";import"./chunk-DNNQJI7D.js";import"./chunk-HYBSLNBW.js";import"./chunk-XA5PSH3Z.js";import"./chunk-BQIQDJSQ.js";import"./chunk-Q677WDQ5.js";import"./chunk-GQZ2XFQS.js";import"./chunk-6JGNP3CG.js";import"./chunk-KNM3LS47.js";import"./chunk-TQXNETKV.js";import"./chunk-K7SEZQEV.js";import"./chunk-35SNHSYE.js";import"./chunk-KI45N7NV.js";import"./chunk-YZMIVIZ5.js";import"./chunk-EXFFRG4T.js";import"./chunk-6ZBQJK6J.js";import"./chunk-2CR2MHW5.js";import"./chunk-YEUXEZFN.js";import"./chunk-GIOZPKCU.js";import"./chunk-RSVXJNBI.js";import"./chunk-6SG4JVGQ.js";import"./chunk-TOACPXU7.js";import"./chunk-OMEEZ2KP.js";import"./chunk-GQHVCGHB.js";import"./chunk-T24SSVPV.js";import"./chunk-T6RP4BD5.js";import"./chunk-4WRNN7GJ.js";import"./chunk-RUZ27PU2.js";import"./chunk-U5PEY4LZ.js";import"./chunk-ANIO6SZU.js";import"./chunk-7FDFD2RA.js";import"./chunk-2BO64G4N.js";import"./chunk-QFJGXGHG.js";import"./chunk-HCICVWA5.js";import"./chunk-SDHBPXRH.js";import"./chunk-7PUP564T.js";import"./chunk-FTRSNC63.js";import"./chunk-45FHXPEV.js";import"./chunk-LJCV6PN4.js";import"./chunk-YO6OY3Y3.js";import"./chunk-R7WVBZOR.js";import"./chunk-YA2PAOL6.js";import"./chunk-UMBBSV56.js";import"./chunk-KWJBJL5V.js";import"./chunk-YAIRCXNW.js";import"./chunk-5LOLNRAG.js";import"./chunk-OHNXNH3I.js";import"./chunk-YY6U53S3.js";import"./chunk-KDVTGBVQ.js";import"./chunk-NM5KCVND.js";import"./chunk-M52Y7THK.js";import"./chunk-UXYDP2GA.js";import"./chunk-5XO4Z6GR.js";import"./chunk-JQHJLBQS.js";import"./chunk-T3C76GSG.js";import"./chunk-ERWUOBST.js";import"./chunk-XMK64KOA.js";import"./chunk-XC57KLDG.js";import"./chunk-BQAFRR3J.js";import"./chunk-SJKWNSPY.js";import"./chunk-UZILS5FV.js";import"./chunk-BJQMVKVY.js";import"./chunk-3T3ARG3E.js";import"./chunk-5EHDUP6F.js";import"./chunk-R3CIFBZ5.js";import"./chunk-HV5HARVF.js";import"./chunk-TR4FEZFI.js";import"./chunk-2EHDYPYD.js";import"./chunk-DHGVBQ7P.js";import"./chunk-VSSLVNAR.js";import"./chunk-3PV5T5XU.js";import"./chunk-MTA7GLUS.js";import"./chunk-VTLK6Q27.js";import"./chunk-MBGDWTMS.js";import"./chunk-5QCMYUDE.js";import"./chunk-FMFLZD4C.js";import"./chunk-TRRBPBPW.js";import"./chunk-OJ3POHII.js";import"./chunk-MQZSDER5.js";import"./chunk-AO6PVYSP.js";import"./chunk-HUSYQ7O4.js";import"./chunk-WJVGIUKU.js";import"./chunk-2HSKHBQ3.js";import"./chunk-JF4IGMKP.js";import"./chunk-PEGTBE7W.js";import"./chunk-BROXBG6H.js";import"./chunk-7SX4UPLE.js";import"./chunk-ZFPGT7UB.js";import"./chunk-EKY6EZHW.js";import"./chunk-ZUBO4ZEH.js";import"./chunk-R53F7DXM.js";import"./chunk-K4DA7VO4.js";import"./chunk-QOEI2BB3.js";import"./chunk-ILLKJPPP.js";import"./chunk-LUKWWQ4Q.js";import"./chunk-UX2VV7NR.js";import"./chunk-NYPIF35V.js";import"./chunk-HDCXYMSE.js";import"./chunk-BJ5KKFRX.js";import"./chunk-35GGXXL4.js";import"./chunk-5HFCOS36.js";import"./chunk-BJ2H527R.js";import"./chunk-EXJ3TYPN.js";import"./chunk-22JI2C23.js";import"./chunk-FIBLU6JW.js";import"./chunk-PBWK4RSZ.js";import"./chunk-T4NNGQKH.js";import"./chunk-Y7GVIX2K.js";import"./chunk-UFBZ5RUP.js";import"./chunk-J43IOAV2.js";import"./chunk-G6BUUK3X.js";import"./chunk-RAQFCDSA.js";import"./chunk-GHOBFR25.js";import"./chunk-LEY7YUND.js";import"./chunk-VAW5CAKL.js";import"./chunk-W4T2JBHA.js";import"./chunk-6VNLT34U.js";import"./chunk-PKMWTI6A.js";import"./chunk-V3O2HLLM.js";import"./chunk-2CK4H4PK.js";import"./chunk-KN2A4UI3.js";import"./chunk-2DVAQSTR.js";import"./chunk-TMZXKUJ7.js";import"./chunk-4ZWCIZGW.js";import"./chunk-ZCHP3MYE.js";import"./chunk-ITXPPIKB.js";import"./chunk-JCKQGVLY.js";import"./chunk-SRASGVKV.js";import"./chunk-5TETHXKM.js";import"./chunk-GZPBQVE7.js";import"./chunk-B2GEUQZK.js";import"./chunk-C7WBA5UQ.js";import"./chunk-IZBV4PHK.js";import"./chunk-M2SCIUFO.js";import"./chunk-PGDMHBNI.js";import"./chunk-TIYOD65A.js";import"./chunk-PKANRYX6.js";import"./chunk-WLNBEVIM.js";import"./chunk-N45EUFA3.js";import"./chunk-DO57ZZNQ.js";import"./chunk-UTGGNDEF.js";import"./chunk-HE75YTAD.js";import"./chunk-TG4FTNP7.js";import"./chunk-VPAZW4IE.js";import"./chunk-QS2GJJXN.js";import"./chunk-MUJL7FQJ.js";import"./chunk-EKULWSLH.js";import"./chunk-KFMQ6GVV.js";import"./chunk-QPHGFD2Y.js";import"./chunk-HP4P4Z2R.js";import"./chunk-RSVFNNQ3.js";import"./chunk-XGBDEWZH.js";import"./chunk-NIZ3DLMN.js";import"./chunk-XPNMKQBN.js";import"./chunk-2VFZQK6H.js";import"./chunk-B4MC4X6R.js";import"./chunk-ZS3FCIDW.js";import"./chunk-JIPHTHEV.js";import"./chunk-EO6ZVYAU.js";import"./chunk-QHFNREED.js";import"./chunk-QTGI3NVE.js";import"./chunk-PUR6MQ67.js";import"./chunk-WLGZI23G.js";import"./chunk-BCZI2XYX.js";import"./chunk-OW25EIRT.js";import"./chunk-72VW33X6.js";import"./chunk-TTRVH5FY.js";import"./chunk-SVUYFOZB.js";import"./chunk-C4UW2SIM.js";import"./chunk-AG7KROZ7.js";import"./chunk-DNTASBVS.js";import"./chunk-FOT4BL2J.js";import"./chunk-ZTZIWYY7.js";import"./chunk-XIBMFQYW.js";import"./chunk-2JIMXGVJ.js";import"./chunk-W7UDHTT3.js";import"./chunk-Y6EQGSOI.js";import"./chunk-FF6M56TZ.js";import"./chunk-AITXKHH2.js";import"./chunk-2CMV52NX.js";import"./chunk-ZHSIL7EQ.js";import"./chunk-UCNHTX5Z.js";import"./chunk-OWNULEI4.js";import"./chunk-5HXEWEG7.js";import"./chunk-D7NTWXPI.js";import"./chunk-CW2G3GTX.js";import"./chunk-VPMBH7ED.js";import"./chunk-RBAETNMK.js";import"./chunk-6DJ3CL5E.js";import"./chunk-D4ZCQ4ZB.js";import"./chunk-SLMOCOVC.js";import"./chunk-WA3SGGGN.js";import"./chunk-ATTGRJIS.js";import"./chunk-I72JNYAW.js";import"./chunk-AMJO5MXW.js";import"./chunk-LERWLC26.js";import"./chunk-VBQRXBKN.js";import"./chunk-N7U6FF65.js";import"./chunk-UDQ657MP.js";import"./chunk-FNMPMXLQ.js";import"./chunk-SMV4XGKK.js";import"./chunk-2IXING64.js";import"./chunk-SFFASEUX.js";import"./chunk-TSAMHA74.js";import"./chunk-RNLPRU3L.js";import"./chunk-CCFDPXNH.js";import"./chunk-WTXODJNE.js";import"./chunk-HKVEG3TJ.js";import"./chunk-3Z2SL3LO.js";import"./chunk-A2J4PCL3.js";import"./chunk-ZAL7QAHA.js";import"./chunk-LSMPUXCK.js";import"./chunk-ZLXR3HBB.js";import"./chunk-MLFFVQ4H.js";import"./chunk-H7ZYEXEY.js";import"./chunk-6MVDPGZ3.js";import"./chunk-OUZK3JE3.js";import"./chunk-I4YHVXUS.js";import"./chunk-XAPIUMOF.js";import"./chunk-ILONVRIF.js";import"./chunk-VHQT6GPD.js";import"./chunk-JMTINDL5.js";import"./chunk-NKKHM6BH.js";import"./chunk-335U7CYZ.js";import"./chunk-L2TNAAQN.js";import"./chunk-WWRVMGI5.js";import"./chunk-ZJQQ5HGS.js";import"./chunk-YUQEO6UE.js";import"./chunk-KPGFYNDA.js";import"./chunk-CW3J33TN.js";import"./chunk-2HPZX3VT.js";import"./chunk-H2EJ2FXO.js";import"./chunk-27K5BE5C.js";import"./chunk-L6ZOAPPM.js";import"./chunk-2JMILQ6B.js";import"./chunk-FWGXBW4L.js";import"./chunk-GB2W6K7K.js";import"./chunk-MHSPATEG.js";import"./chunk-FODM75CC.js";import"./chunk-GZ3APDMX.js";import"./chunk-M4R7TXHA.js";import"./chunk-HPCIGI5Y.js";import"./chunk-F2I44VCA.js";import"./chunk-OJ7LTCWX.js";import"./chunk-XOIR265Z.js";import"./chunk-JDEUN4XM.js";import"./chunk-YKPUVWML.js";import"./chunk-KULXXWBI.js";import"./chunk-3U5632TD.js";import"./chunk-QQJTKUTN.js";import"./chunk-BJLZZSSQ.js";import"./chunk-B65HAB74.js";import"./chunk-FTY3DS4C.js";import"./chunk-5P6WZP6E.js";import"./chunk-2PXTM6RE.js";import"./chunk-AR6BFW4D.js";import"./chunk-U2LA4WCV.js";import"./chunk-L23DVICG.js";import"./chunk-77IJP7IA.js";import"./chunk-PEQWA434.js";import"./chunk-JQPBSXCG.js";import"./chunk-LYRW73XL.js";import"./chunk-ALC3I3V2.js";import{d as o}from"./chunk-A34ONGYR.js";var m=o(i(),1);var d=o(t(),1);e({memoryRouter:!0});m.default.createRoot(document.getElementById("root")).render((0,d.jsx)(r,{}));
|
|
2
|
+
//# sourceMappingURL=editor-OFDYQZV4.js.map
|
package/dist/static/editor.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as i,b as e,c as t,d as r}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=editor-
|
|
1
|
+
import{a as i,b as e,c as t,d as r}from"./chunk-HFUAHA4L.js";import"./chunk-3BLCY6UO.js";import"./chunk-UQ47VFV7.js";import"./chunk-YVLZL2DF.js";import"./chunk-LJLSS6VP.js";import"./chunk-IO5HD6LR.js";import"./chunk-ISGRWLZB.js";import"./chunk-CMJLLXM5.js";import"./chunk-S7YZLIQ2.js";import"./chunk-QOR6RVYK.js";import"./chunk-IGSWCXWL.js";import"./chunk-XY25BMCC.js";import"./chunk-MYJDNFHV.js";import"./chunk-XX6D4PCV.js";import"./chunk-FFF5XN2E.js";import"./chunk-4E35PBBI.js";import"./chunk-I5YU2QOB.js";import"./chunk-NMLR6BBX.js";import"./chunk-OZMHIOOM.js";import"./chunk-VY54N476.js";import"./chunk-IAT3SH6V.js";import"./chunk-NKBKRXAI.js";import"./chunk-7WRUHYVT.js";import"./chunk-UQ2OIIDY.js";import"./chunk-SYSYBEFC.js";import"./chunk-P7EAYOW2.js";import"./chunk-UE65FKDK.js";import"./chunk-XRXYPYNZ.js";import"./chunk-2AMRXN7J.js";import"./chunk-MQ6GXGQP.js";import"./chunk-WXJNV4KM.js";import"./chunk-MMFEMX4D.js";import"./chunk-JMW7BC3H.js";import"./chunk-RIEQ6JT2.js";import"./chunk-76H6TNVU.js";import"./chunk-3PWLJ7VB.js";import"./chunk-RUT5KRF7.js";import"./chunk-PRLZJXP3.js";import"./chunk-UHBPDWMK.js";import"./chunk-PF2U73FX.js";import"./chunk-NLF7C362.js";import"./chunk-DNNQJI7D.js";import"./chunk-HYBSLNBW.js";import"./chunk-XA5PSH3Z.js";import"./chunk-BQIQDJSQ.js";import"./chunk-Q677WDQ5.js";import"./chunk-GQZ2XFQS.js";import"./chunk-6JGNP3CG.js";import"./chunk-KNM3LS47.js";import"./chunk-TQXNETKV.js";import"./chunk-K7SEZQEV.js";import"./chunk-35SNHSYE.js";import"./chunk-KI45N7NV.js";import"./chunk-YZMIVIZ5.js";import"./chunk-EXFFRG4T.js";import"./chunk-6ZBQJK6J.js";import"./chunk-2CR2MHW5.js";import"./chunk-YEUXEZFN.js";import"./chunk-GIOZPKCU.js";import"./chunk-RSVXJNBI.js";import"./chunk-6SG4JVGQ.js";import"./chunk-TOACPXU7.js";import"./chunk-OMEEZ2KP.js";import"./chunk-GQHVCGHB.js";import"./chunk-T24SSVPV.js";import"./chunk-T6RP4BD5.js";import"./chunk-4WRNN7GJ.js";import"./chunk-RUZ27PU2.js";import"./chunk-U5PEY4LZ.js";import"./chunk-ANIO6SZU.js";import"./chunk-7FDFD2RA.js";import"./chunk-2BO64G4N.js";import"./chunk-QFJGXGHG.js";import"./chunk-HCICVWA5.js";import"./chunk-SDHBPXRH.js";import"./chunk-7PUP564T.js";import"./chunk-FTRSNC63.js";import"./chunk-45FHXPEV.js";import"./chunk-LJCV6PN4.js";import"./chunk-YO6OY3Y3.js";import"./chunk-R7WVBZOR.js";import"./chunk-YA2PAOL6.js";import"./chunk-UMBBSV56.js";import"./chunk-KWJBJL5V.js";import"./chunk-YAIRCXNW.js";import"./chunk-5LOLNRAG.js";import"./chunk-OHNXNH3I.js";import"./chunk-YY6U53S3.js";import"./chunk-KDVTGBVQ.js";import"./chunk-NM5KCVND.js";import"./chunk-M52Y7THK.js";import"./chunk-UXYDP2GA.js";import"./chunk-5XO4Z6GR.js";import"./chunk-JQHJLBQS.js";import"./chunk-T3C76GSG.js";import"./chunk-ERWUOBST.js";import"./chunk-XMK64KOA.js";import"./chunk-XC57KLDG.js";import"./chunk-BQAFRR3J.js";import"./chunk-SJKWNSPY.js";import"./chunk-UZILS5FV.js";import"./chunk-BJQMVKVY.js";import"./chunk-3T3ARG3E.js";import"./chunk-5EHDUP6F.js";import"./chunk-R3CIFBZ5.js";import"./chunk-HV5HARVF.js";import"./chunk-TR4FEZFI.js";import"./chunk-2EHDYPYD.js";import"./chunk-DHGVBQ7P.js";import"./chunk-VSSLVNAR.js";import"./chunk-3PV5T5XU.js";import"./chunk-MTA7GLUS.js";import"./chunk-VTLK6Q27.js";import"./chunk-MBGDWTMS.js";import"./chunk-5QCMYUDE.js";import"./chunk-FMFLZD4C.js";import"./chunk-TRRBPBPW.js";import"./chunk-OJ3POHII.js";import"./chunk-MQZSDER5.js";import"./chunk-AO6PVYSP.js";import"./chunk-HUSYQ7O4.js";import"./chunk-WJVGIUKU.js";import"./chunk-2HSKHBQ3.js";import"./chunk-JF4IGMKP.js";import"./chunk-PEGTBE7W.js";import"./chunk-BROXBG6H.js";import"./chunk-7SX4UPLE.js";import"./chunk-ZFPGT7UB.js";import"./chunk-EKY6EZHW.js";import"./chunk-ZUBO4ZEH.js";import"./chunk-R53F7DXM.js";import"./chunk-K4DA7VO4.js";import"./chunk-QOEI2BB3.js";import"./chunk-ILLKJPPP.js";import"./chunk-LUKWWQ4Q.js";import"./chunk-UX2VV7NR.js";import"./chunk-NYPIF35V.js";import"./chunk-HDCXYMSE.js";import"./chunk-BJ5KKFRX.js";import"./chunk-35GGXXL4.js";import"./chunk-5HFCOS36.js";import"./chunk-BJ2H527R.js";import"./chunk-EXJ3TYPN.js";import"./chunk-22JI2C23.js";import"./chunk-FIBLU6JW.js";import"./chunk-PBWK4RSZ.js";import"./chunk-T4NNGQKH.js";import"./chunk-Y7GVIX2K.js";import"./chunk-UFBZ5RUP.js";import"./chunk-J43IOAV2.js";import"./chunk-G6BUUK3X.js";import"./chunk-RAQFCDSA.js";import"./chunk-GHOBFR25.js";import"./chunk-LEY7YUND.js";import"./chunk-VAW5CAKL.js";import"./chunk-W4T2JBHA.js";import"./chunk-6VNLT34U.js";import"./chunk-PKMWTI6A.js";import"./chunk-V3O2HLLM.js";import"./chunk-2CK4H4PK.js";import"./chunk-KN2A4UI3.js";import"./chunk-2DVAQSTR.js";import"./chunk-TMZXKUJ7.js";import"./chunk-4ZWCIZGW.js";import"./chunk-ZCHP3MYE.js";import"./chunk-ITXPPIKB.js";import"./chunk-JCKQGVLY.js";import"./chunk-SRASGVKV.js";import"./chunk-5TETHXKM.js";import"./chunk-GZPBQVE7.js";import"./chunk-B2GEUQZK.js";import"./chunk-C7WBA5UQ.js";import"./chunk-IZBV4PHK.js";import"./chunk-M2SCIUFO.js";import"./chunk-PGDMHBNI.js";import"./chunk-TIYOD65A.js";import"./chunk-PKANRYX6.js";import"./chunk-WLNBEVIM.js";import"./chunk-N45EUFA3.js";import"./chunk-DO57ZZNQ.js";import"./chunk-UTGGNDEF.js";import"./chunk-HE75YTAD.js";import"./chunk-TG4FTNP7.js";import"./chunk-VPAZW4IE.js";import"./chunk-QS2GJJXN.js";import"./chunk-MUJL7FQJ.js";import"./chunk-EKULWSLH.js";import"./chunk-KFMQ6GVV.js";import"./chunk-QPHGFD2Y.js";import"./chunk-HP4P4Z2R.js";import"./chunk-RSVFNNQ3.js";import"./chunk-XGBDEWZH.js";import"./chunk-NIZ3DLMN.js";import"./chunk-XPNMKQBN.js";import"./chunk-2VFZQK6H.js";import"./chunk-B4MC4X6R.js";import"./chunk-ZS3FCIDW.js";import"./chunk-JIPHTHEV.js";import"./chunk-EO6ZVYAU.js";import"./chunk-QHFNREED.js";import"./chunk-QTGI3NVE.js";import"./chunk-PUR6MQ67.js";import"./chunk-WLGZI23G.js";import"./chunk-BCZI2XYX.js";import"./chunk-OW25EIRT.js";import"./chunk-72VW33X6.js";import"./chunk-TTRVH5FY.js";import"./chunk-SVUYFOZB.js";import"./chunk-C4UW2SIM.js";import"./chunk-AG7KROZ7.js";import"./chunk-DNTASBVS.js";import"./chunk-FOT4BL2J.js";import"./chunk-ZTZIWYY7.js";import"./chunk-XIBMFQYW.js";import"./chunk-2JIMXGVJ.js";import"./chunk-W7UDHTT3.js";import"./chunk-Y6EQGSOI.js";import"./chunk-FF6M56TZ.js";import"./chunk-AITXKHH2.js";import"./chunk-2CMV52NX.js";import"./chunk-ZHSIL7EQ.js";import"./chunk-UCNHTX5Z.js";import"./chunk-OWNULEI4.js";import"./chunk-5HXEWEG7.js";import"./chunk-D7NTWXPI.js";import"./chunk-CW2G3GTX.js";import"./chunk-VPMBH7ED.js";import"./chunk-RBAETNMK.js";import"./chunk-6DJ3CL5E.js";import"./chunk-D4ZCQ4ZB.js";import"./chunk-SLMOCOVC.js";import"./chunk-WA3SGGGN.js";import"./chunk-ATTGRJIS.js";import"./chunk-I72JNYAW.js";import"./chunk-AMJO5MXW.js";import"./chunk-LERWLC26.js";import"./chunk-VBQRXBKN.js";import"./chunk-N7U6FF65.js";import"./chunk-UDQ657MP.js";import"./chunk-FNMPMXLQ.js";import"./chunk-SMV4XGKK.js";import"./chunk-2IXING64.js";import"./chunk-SFFASEUX.js";import"./chunk-TSAMHA74.js";import"./chunk-RNLPRU3L.js";import"./chunk-CCFDPXNH.js";import"./chunk-WTXODJNE.js";import"./chunk-HKVEG3TJ.js";import"./chunk-3Z2SL3LO.js";import"./chunk-A2J4PCL3.js";import"./chunk-ZAL7QAHA.js";import"./chunk-LSMPUXCK.js";import"./chunk-ZLXR3HBB.js";import"./chunk-MLFFVQ4H.js";import"./chunk-H7ZYEXEY.js";import"./chunk-6MVDPGZ3.js";import"./chunk-OUZK3JE3.js";import"./chunk-I4YHVXUS.js";import"./chunk-XAPIUMOF.js";import"./chunk-ILONVRIF.js";import"./chunk-VHQT6GPD.js";import"./chunk-JMTINDL5.js";import"./chunk-NKKHM6BH.js";import"./chunk-335U7CYZ.js";import"./chunk-L2TNAAQN.js";import"./chunk-WWRVMGI5.js";import"./chunk-ZJQQ5HGS.js";import"./chunk-YUQEO6UE.js";import"./chunk-KPGFYNDA.js";import"./chunk-CW3J33TN.js";import"./chunk-2HPZX3VT.js";import"./chunk-H2EJ2FXO.js";import"./chunk-27K5BE5C.js";import"./chunk-L6ZOAPPM.js";import"./chunk-2JMILQ6B.js";import"./chunk-FWGXBW4L.js";import"./chunk-GB2W6K7K.js";import"./chunk-MHSPATEG.js";import"./chunk-FODM75CC.js";import"./chunk-GZ3APDMX.js";import"./chunk-M4R7TXHA.js";import"./chunk-HPCIGI5Y.js";import"./chunk-F2I44VCA.js";import"./chunk-OJ7LTCWX.js";import"./chunk-XOIR265Z.js";import"./chunk-JDEUN4XM.js";import"./chunk-YKPUVWML.js";import"./chunk-KULXXWBI.js";import"./chunk-3U5632TD.js";import"./chunk-QQJTKUTN.js";import"./chunk-BJLZZSSQ.js";import"./chunk-B65HAB74.js";import"./chunk-FTY3DS4C.js";import"./chunk-5P6WZP6E.js";import"./chunk-2PXTM6RE.js";import"./chunk-AR6BFW4D.js";import"./chunk-U2LA4WCV.js";import"./chunk-L23DVICG.js";import"./chunk-77IJP7IA.js";import"./chunk-PEQWA434.js";import"./chunk-JQPBSXCG.js";import"./chunk-LYRW73XL.js";import"./chunk-ALC3I3V2.js";import{d as o}from"./chunk-A34ONGYR.js";var m=o(i(),1);var d=o(t(),1);e({memoryRouter:!0});m.default.createRoot(document.getElementById("root")).render((0,d.jsx)(r,{}));
|
|
2
|
+
//# sourceMappingURL=editor-OFDYQZV4.js.map
|
|
@@ -12536,7 +12536,7 @@ export function get(app: FrameOSApp, context: FrameOSContext) {
|
|
|
12536
12536
|
}
|
|
12537
12537
|
]
|
|
12538
12538
|
}
|
|
12539
|
-
`}};var Hoe={code:"Code",render:"Render",logic:"Logic",data:"Data"};function bit(n){return{...mit,...n,...Woe}}var $u=(0,AR.kea)([(0,AR.path)(["src","models","appsModel"]),(0,vit.loaders)(({values:n})=>({apps:[{},{loadApps:async()=>{try{let e=await tt("/api/apps");if(!e.ok)throw new Error("Failed to fetch apps");let t=await e.json();return bit(t.apps)}catch(e){return sw(e),bit(n.apps)}}}]})),(0,AR.afterMount)(({actions:n})=>{n.loadApps()})]);var DR=["app.ts","app.js","app.tsx","app.jsx"],$Le=Object.keys(Woe);function K6(n){return!!n&&n.startsWith("repo/")}function cw(n){return!!n&&$Le.includes(n)}function NR(n){return!!n&&DR.some(e=>!!n[e])}function Y6(n){return!!(n?.["app.nim"]||n?.["config.nim"])}function Xv(n){return Y6(n)&&!NR(n)}function Voe(n){return Object.values(n.apps??{}).some(e=>Xv(e.sources))?!0:(n.nodes??[]).some(e=>{if(e.type==="app"){let t=e.data;return Xv(t?.sources)||Xv(n.apps?.[t?.keyword??""]?.sources)}if(e.type==="code"){let t=e.data;return!!t?.code?.trim()&&!t?.codeJS?.trim()}return e.type==="source"})}function yit(n){if(!n?.["config.json"])return{};try{let e=JSON.parse(n["config.json"]);return typeof e=="object"&&e?e:{}}catch{return{}}}function _it(n){return Object.fromEntries(Object.entries(n).filter(([,e])=>e!==void 0))}function $1(n){return n?.origin??n?.source}function uXt(n){return!!n&&Object.keys(n).length>0}function wit(n){if(!n)return;if(G6[n])return n;if(!K6(n))return;let e=n.split("/").filter(Boolean),t=e[e.length-1],r=t?`repo/apps/code/${t}`:void 0;return r&&G6[r]?r:void 0}function hXt(n){let e=wit(n),t=e?G6[e]:void 0;return t?{...t}:void 0}function X6(n,e){let{source:t,...r}=n,i=$1(n)||e,o=wit(i),s=uXt(n.sources)?n.sources:hXt(i)||n.sources||{};return _it({...r,origin:o||i,sources:s})}function Rh(n){return Object.fromEntries(Object.entries(n??{}).map(([e,t])=>[e,X6(t,e)]))}function Uf(n){let e=yit(n.sources),t=$1(n);return{name:n.name||e.name||t||"Scene app",category:n.category||e.category,description:n.description||e.description,version:n.version||e.version,settings:n.settings||e.settings,apt:n.apt||e.apt,fields:n.fields||e.fields,output:n.output||e.output,cache:n.cache||e.cache,origin:t}}function qLe(n){return Object.fromEntries(Object.entries(Rh(n?.apps)).map(([e,t])=>[e,Uf(t)]))}function xit(n,e){return{...n,...qLe(e)}}function GLe(n){let e=$1(n);if(!e)return null;let t=e.split("/");return t[0]==="repo"&&t[1]==="apps"&&t[2]?t[2]:t[0]==="repo"&&t[1]?t[1]:t[0]==="scene"?"scene":t[0]||null}function Z6(n,e){let t=GLe(n);return`${e?`${e}: `:""}${n.name}${t?` [${t}]`:""}`}async function KLe(n){let e=G6[n]??git[n];if(e)return{...e};let t=await tt(`/api/apps/source?keyword=${encodeURIComponent(n)}`);return t.ok?await t.json():{}}function RR(n,e,t){let r=e.split("/").filter(Boolean),o=(r[r.length-1]||t?.name||"app").replace(/[^a-zA-Z0-9_-]+/g,"-").replace(/(^-|-$)/g,"")||"app";if(!n[o])return o;let s=2,a=`${o}-${s}`;for(;n[a];)s+=1,a=`${o}-${s}`;return a}function Uoe(n,e,t,r){let i=yit(t),o=$1(r)||$1(e)||(K6(n)?n:void 0),{source:s,...a}=r??{};return _it({...a,origin:o,name:i.name||r?.name||e?.name||n,category:i.category||r?.category||e?.category,description:i.description||r?.description||e?.description,version:i.version||r?.version||e?.version,settings:i.settings||r?.settings||e?.settings,apt:i.apt||r?.apt||e?.apt,fields:i.fields||r?.fields||e?.fields,output:i.output||r?.output||e?.output,cache:i.cache||r?.cache||e?.cache,sources:t})}async function joe(n,e,t){if(!K6(e))return{sceneApps:n,keyword:e,app:t??null};let r=await KLe(e),i=RR(n,e,t),o=Uoe(i,t,r,{origin:$1(t)||e});return{sceneApps:{...n,[i]:o},keyword:i,app:Uf(o)}}function $oe(n,e,t,r=!1,i){let o=Rh(t),s=r&&Object.values(o).some(a=>Y6(a.sources));return n?.map(a=>a.id===e?{...a,apps:o,...i?{nodes:i}:{},settings:s&&a.settings?.execution!=="compiled"?{...a.settings,execution:"compiled"}:a.settings}:a)}var qoe={openAI:{title:"OpenAI",tagLabel:"OpenAI API key missing",description:"The OpenAI API key is used within OpenAI apps on frames.",fields:[{label:"API key for frames",secret:!0,path:["openAI","apiKey"]}]},unsplash:{title:"Unsplash",tagLabel:"Unsplash access key missing",fields:[{label:"Access key",secret:!0,path:["unsplash","accessKey"]}]},homeAssistant:{title:"Home Assistant",tagLabel:"Home Assistant access token missing",fields:[{label:"Home assistant URL",path:["homeAssistant","url"]},{label:"Access token (Profile \u2192 Long-Lived Access Tokens)",secret:!0,path:["homeAssistant","accessToken"]}]},immich:{title:"Immich",tagLabel:"Immich API key missing",fields:[{label:"Server URL",path:["immich","url"]},{label:"API key (Account Settings \u2192 API Keys)",secret:!0,path:["immich","apiKey"]}]},github:{title:"GitHub",tagLabel:"GitHub personal access token missing",freeLimitedUsage:!0,fields:[{label:"API key",secret:!0,path:["github","api_key"]}]},frameOS:{title:"FrameOS Gallery",tagLabel:"FrameOS Gallery API key missing",fields:[{label:"API key",secret:!0,path:["frameOS","apiKey"]}]}};function pXt(n,e){if(e){if(n[e])return n[e];if(!e.includes("/")){let t=Object.keys(n).find(r=>r.endsWith(`/${e}`));if(t)return n[t]}}}function q1(n,e){let t=new Set;for(let r of n??[])for(let i of r.nodes??[])if(i.type==="app"){let o=i.data?.keyword,s=o?r.apps?.[o]:void 0,a=s?Uf(s):pXt(e,o);for(let l of a?.settings??[])qoe[l]&&t.add(l)}return Array.from(t)}function fXt(n){return"blob"in n?null:"templateId"in n?{template_id:n.templateId}:"url"in n?{url:n.url}:{source_scene_id:n.sourceSceneId,...n.sourceFrameId!==void 0?{source_frame_id:n.sourceFrameId}:{}}}var Goe=class extends Error{status;constructor(e,t){super(e),this.name="SceneImageError",this.status=t}};async function mXt(n){try{let e=await n.json();if(e?.detail)return String(e.detail)}catch{}return`unexpected status ${n.status}`}async function gXt(n,e,t){let r=fXt(t),i=r?await tt(`/api/frames/${n}/scene_images/${e}/copy`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)}):await tt(`/api/frames/${n}/scene_images/${e}`,{method:"POST",body:t.blob});if(!i.ok)throw new Goe(await mXt(i),i.status);tT.actions.updateEntityImage(`frames/${n}`,`scene_images/${e}`)}function YLe(n,e,t,r){let i=r instanceof Error?r.message:String(r);console.error(`Failed to copy the scene ${t}`,r),$n.actions.startTask({frameId:n,kind:"sceneImage",title:`Copying the scene ${t}`,detail:null,sceneId:e}),$n.actions.taskFailed({frameId:n,kind:"sceneImage",sceneId:e,detail:`${i}. The scene tile stays blank until the frame renders it.`})}async function Koe(n,e,t,r={}){let i=r.label??"preview image";if(!(!e.length||!t)&&!(Hn()&&!("blob"in t)))try{await Promise.all(e.map(o=>gXt(n,o,t)))}catch(o){if(r.ignoreMissingSource&&o instanceof Goe&&o.status===404)return;YLe(n,e[0],i,o)}}var wAe=St($st(),1),qst=90,EQt=90,IQt=120,TQt=64,LQt=56,Gst=50,sat=70,AQt=44,t8=40,gAe=40,bAe=24,DQt=16,Kst=0,Yst=180,vAe=120,NQt=t8,aat=32,RQt=24;var Xst=16,FQt=35,OQt=64,MQt=340,PQt=140,BQt=8,zQt=49,xAe=16,Zst=xAe+12,WQt=50,HQt=38,VQt=30,UQt=39,jQt=67,$Qt=48,qQt=32,Jst=200,SAe=18,GQt=260,KQt=180,Qst=200,lat=340,YQt=2200,XQt=6,ZQt=119,cat=260,yAe=100,JQt=72,QQt=8,een=120,ten=91,ese=7,nen=22,dat=40,sT=4,ren=sat,ien=60,oen=28,CAe=1e3;function Ls(n){return{width:n.width??GQt,height:n.height??KQt}}function tse(n){if(typeof n=="number"&&Number.isFinite(n))return n;if(typeof n=="string"){let e=Number.parseFloat(n);return Number.isFinite(e)?e:null}return null}function sen(n){let e=n.data??{},t=e.codeArgs??[],r=e.codeOutputs??[],i=(e.codeJS??e.code??"").trim(),o=i?i.split(/\r?\n/):[""],s=o.reduce((f,m)=>Math.max(f,m.length),0),a=[...t,...r].reduce((f,m)=>Math.max(f,m.name.length*ese+yAe),Qst),l=t.reduce((f,m)=>f+m.name.length*ese+JQt+QQt,een),c=t.length>XQt?YQt:lat,d=Math.min(c,Math.max(Qst,a,l,s*ese+yAe)),u=Math.max(1,Math.floor((d-yAe/2)/ese)),h=o.reduce((f,m)=>f+Math.max(1,Math.ceil(m.length/u)),0),p=Math.min(cat,Math.max(ZQt,ten+h*nen));return{width:Math.round(d),height:Math.round(p)}}function aen(n){if(n.type!=="code")return n;let e=sen(n),t=tse(n.width)??tse(n.style?.width),r=tse(n.height)??tse(n.style?.height),i=t!==null&&t>lat?Math.max(t,e.width):e.width,o=r!==null&&r>cat?Math.max(r,e.height):e.height,s={...n.style??{},width:i,height:o};return{...n,width:i,height:o,style:s}}function rse(n){return n?n.startsWith("fieldInput/")?n.slice(11):n.startsWith("codeField/")?n.slice(10):n.startsWith("field/")?n.slice(6):null:null}function uat(n){return rse(n)?.replace(/\[.*$/,"")??null}function eat(n){let e=hat(n);return e.length===0?null:e.reduce((t,r,i)=>t+r/CAe**i,0)}function hat(n){let e=rse(n);return e?Array.from(e.matchAll(/\[(\d+)\]/g)).map(t=>Number(t[1])):[]}function len(n){return n.sourceHandle==="next"||n.targetHandle==="prev"||n.type==="appNodeEdge"}function uw(n){if(n.type!=="app")return!1;let e=n.data?.keyword;return typeof e=="string"&&e.startsWith("data/")}function tat(n,e){if(n.type!=="app")return!1;if(e>1)return!0;let t=n.data?.keyword;return typeof t=="string"&&(t.startsWith("data/")||t.startsWith("logic/"))}function cen(n){return n.type==="event"||n.type==="dispatch"||n.type==="source"}function _Ae(n){return n.position.x+Ls(n).width/2}function FR(n){let e=Ls(n);return{left:n.position.x,right:n.position.x+e.width,top:n.position.y,bottom:n.position.y+e.height}}function OR(n,e){return{left:Math.min(n.left,e.left),right:Math.max(n.right,e.right),top:Math.min(n.top,e.top),bottom:Math.max(n.bottom,e.bottom)}}function nat(n,e){return{left:n.left+e.x,right:n.right+e.x,top:n.top+e.y,bottom:n.bottom+e.y}}function rat(n,e){if(n.type==="state")return uw(e)?aat:BQt;if(uw(n)&&uw(e))return zQt;let t=Ls(e);return n.type==="code"&&t.width<=MQt?OQt:FQt}function nse(n,e){let t=Ls(e);return n.type==="state"?uw(e)?SAe:t.height>=Jst?qQt:$Qt:uw(n)&&uw(e)?HQt:n.type==="code"?t.height<=PQt?jQt:t.height>=Jst?VQt:UQt:WQt}function jf(n,e,t){let r=rse(e);if(!r)return Number.MAX_SAFE_INTEGER;let i=t[n]??[],o=uat(e),s=eat(e)??0,a=i.indexOf(r);if(a>=0)return a*CAe+s;let l=o?i.indexOf(o):-1;if(l>=0)return l*CAe+s;let c=eat(e);return c!==null?c:Number.MAX_SAFE_INTEGER}function den(n,e,t){let r=rse(e);if(!r)return null;let i=t[n.id]??[],o=uat(e),s=i.indexOf(r),a=s>=0?s:o?i.indexOf(o):-1;if(a<0)return null;let{width:l}=Ls(n),c=e?.startsWith("codeField/")?dat:AQt,d=Math.max(l-c*2,1),u=Math.max(i.length-1,1);return c+d*a/u}function pat(n,e,t){let{width:r}=Ls(n);return e==="prev"?0:e==="next"?r:n.type==="code"&&e==="fieldOutput"?dat:den(n,e,t)??r/2}function iat(n,e,t){return n.position.x+pat(n,e,t)}function oat(n,e){let t=[...n].sort((r,i)=>r.desiredCenterX-i.desiredCenterX||r.order-i.order||(r.node.type??"").localeCompare(i.node.type??"")||r.node.id.localeCompare(i.node.id)).map(r=>{let{width:i}=Ls(r.node);return{...r,width:i,left:r.desiredCenterX-i/2}});for(let r=1;r<t.length;r+=1){let i=t[r-1],o=t[r];o.left=Math.max(o.left,i.left+i.width+e)}if(t.length>1){let r=Math.min(...t.map(l=>l.desiredCenterX-l.width/2)),i=Math.max(...t.map(l=>l.desiredCenterX+l.width/2)),o=Math.min(...t.map(l=>l.left)),s=Math.max(...t.map(l=>l.left+l.width)),a=(r+i)/2-(o+s)/2;t.forEach(l=>{l.left+=a})}return new Map(t.map(r=>[r.node.id,r.left]))}function uen(n,e){if(!e.has(n))return e.add(n),n;let t=2;for(;e.has(`${n}-${t}`);)t+=1;let r=`${n}-${t}`;return e.add(r),r}function hen(n,e){let t=n.reduce((l,c)=>(l[c.id]=c,l),{}),r=new Set(n.map(l=>l.id)),i=new WeakMap;e.forEach((l,c)=>{i.set(l,c)});let o=e.reduce((l,c)=>{let d=t[c.source],u=t[c.target],h=c.targetHandle?.startsWith("fieldInput/")||c.targetHandle?.startsWith("codeField/");return d?.type!=="state"||!u||u.type!=="app"&&u.type!=="code"||c.sourceHandle!=="fieldOutput"||!h||(l[c.source]=[...l[c.source]??[],c]),l},{}),s=[],a=new WeakMap;return Object.entries(o).forEach(([l,c])=>{let d=t[l];if(!d)return;let u=c.reduce((p,f)=>(p[f.target]=[...p[f.target]??[],f],p),{}),h=Object.entries(u).sort(([p,f],[m,g])=>(i.get(f[0])??0)-(i.get(g[0])??0)||p.localeCompare(m));h.length<=1||h.slice(1).forEach(([p,f])=>{let m=uen(`${l}__for__${p}`,r),{id:g,selected:b,dragging:v,positionAbsolute:y,..._}=d;s.push({..._,id:m,position:{...d.position},selected:!1,dragging:!1}),f.forEach(x=>{a.set(x,m)})})}),s.length===0?{nodes:n,edges:e}:{nodes:[...n,...s],edges:e.map(l=>{let c=a.get(l);return c?{...l,source:c}:l})}}function ise(n,e,t={}){let r=hen(n,e);return{nodes:pen(r.nodes,r.edges,t),edges:r.edges}}function pen(n,e,t={}){if(!n.length)return n;let r=t.fieldOrderByNodeId??{},i=n.map(aen),o=new Set;e.forEach(le=>{le.sourceHandle==="next"&&o.add(le.source),le.targetHandle==="prev"&&o.add(le.target)});let s=i.filter(le=>cen(le)||le.type==="app"&&!uw(le)&&o.has(le.id)),a=i.reduce((le,ce)=>(le[ce.id]=ce,le),{}),l=new Set(s.map(le=>le.id)),c=e.filter(le=>l.has(le.source)&&l.has(le.target)&&len(le)),d=e.reduce((le,ce)=>(!ce.source||!ce.target||(le[ce.source]=[...le[ce.source]??[],ce]),le),{}),u=e.reduce((le,ce)=>(!ce.source||!ce.target||(le[ce.target]=[...le[ce.target]??[],ce]),le),{}),h=new WeakMap;e.forEach((le,ce)=>{h.set(le,ce)});let p=new Map(s.map((le,ce)=>[le.id,ce])),f=[...c].sort((le,ce)=>(p.get(le.source)??0)-(p.get(ce.source)??0)||jf(le.source,le.sourceHandle,r)-jf(ce.source,ce.sourceHandle,r)||jf(le.target,le.targetHandle,r)-jf(ce.target,ce.targetHandle,r)||le.target.localeCompare(ce.target));if(!s.length)return n;let m=new Map(s.map(le=>[le.id,le.id])),g=le=>{let ce=m.get(le);if(!ce||ce===le)return le;let be=g(ce);return m.set(le,be),be},b=(le,ce)=>{let be=g(le),Ne=g(ce);be!==Ne&&m.set(Ne,be)};f.forEach(le=>{b(le.source,le.target)});let v=le=>l.has(le)?g(le):null,y=new wAe.default.graphlib.Graph({multigraph:!0});y.setGraph({rankdir:"LR",nodesep:qst,ranksep:EQt,edgesep:25}),y.setDefaultEdgeLabel(()=>({})),s.forEach(le=>{let{width:ce,height:be}=Ls(le);y.setNode(le.id,{width:ce,height:be,rank:le.type==="event"||le.type==="source"?"min":void 0})}),f.forEach(le=>{!le.source||!le.target||le.source===le.target||y.setEdge(le.source,le.target)}),wAe.default.layout(y);let _=new Map;s.forEach(le=>{let ce=y.node(le.id);if(!ce)return;let{width:be,height:Ne}=Ls(le);_.set(le.id,{x:ce.x-be/2,y:ce.y-Ne/2})});let x=(le,ce,be=new Set)=>{if(be.has(le))return;be.add(le);let Ne=_.get(le);Ne&&_.set(le,{x:Ne.x+ce.x,y:Ne.y+ce.y}),f.filter(Dt=>Dt.source===le).forEach(Dt=>{x(Dt.target,ce,be)})},S=f.reduce((le,ce)=>(!ce.sourceHandle?.startsWith("field/")||ce.targetHandle!=="prev"||(le[ce.source]=[...le[ce.source]??[],ce]),le),{}),k=new Set(Object.values(S).flatMap(le=>le.length>1?le.map(ce=>ce.target):[])),I=f.reduce((le,ce)=>(le[ce.target]=[...le[ce.target]??[],ce],le),{}),L=new Map,A=(le,ce=new Set)=>{if(L.has(le))return L.get(le)??null;if(!l.has(le))return L.set(le,null),null;if(k.has(le))return L.set(le,le),le;if(ce.has(le))return null;ce.add(le);for(let be of I[le]??[]){let Ne=A(be.source,new Set(ce));if(Ne)return L.set(le,Ne),Ne}return L.set(le,null),null},N=new Map,R=(le,ce=new Set)=>{let be=N.get(le);if(be)return new Set(be);let Ne=new Set;return ce.has(le)||(ce.add(le),l.has(le)&&Ne.add(le),f.filter(Dt=>Dt.source===le).forEach(Dt=>{R(Dt.target,new Set(ce)).forEach(lt=>Ne.add(lt))}),N.set(le,new Set(Ne))),Ne},F=new Map,D=(le,ce=new Set)=>{let be=F.get(le);if(be)return new Set(be);let Ne=new Set;return ce.has(le)||(ce.add(le),l.has(le)?Ne.add(le):(d[le]??[]).forEach(lt=>{D(lt.target,new Set(ce)).forEach(Kt=>Ne.add(Kt))}),F.set(le,new Set(Ne))),Ne},H=(le,ce)=>{if(!ce)return!0;let be=D(le);return be.size===0||[...be].every(Ne=>ce.has(Ne))},j=le=>D(le).size>1,K=(le,ce)=>Array.from((u[le]??[]).filter(be=>be.source&&be.target&&!l.has(be.source)&&H(be.source,ce)&&(be.targetHandle?.startsWith("fieldInput/")||be.targetHandle?.startsWith("codeField/"))).sort((be,Ne)=>jf(le,be.targetHandle,r)-jf(le,Ne.targetHandle,r)||(h.get(be)??0)-(h.get(Ne)??0)||be.source.localeCompare(Ne.source)).reduce((be,Ne)=>(be.has(Ne.source)||be.set(Ne.source,Ne),be),new Map).values()),de=(le,ce=new Set,be)=>{let Ne=a[le];if(!Ne)return{left:0,right:0,top:0,bottom:0};let Dt=Ls(Ne),lt={left:0,right:Dt.width,top:0,bottom:Dt.height};if(ce.has(le))return lt;ce.add(le);let Kt=0,cn=null;return K(le,be).forEach((Zn,zn)=>{let fr=a[Zn.source];if(!fr)return;let Oi=Ls(fr),jr=nse(fr,Ne),bs=rat(fr,Ne),Fa=Kt-(zn===0?jr:0)-Oi.height,Mi=Math.min(-bs-xAe*zn,cn?cn.left-Zst:Number.POSITIVE_INFINITY),Ns=nat(de(fr.id,new Set(ce),be),{x:Mi,y:Fa});lt=OR(lt,Ns),cn=cn?OR(cn,Ns):Ns,Kt=Ns.top-SAe}),lt},V=(le,ce,be=new Set)=>{let Ne=_.get(le);if(!Ne)return de(le,new Set,ce);let Dt=de(le,new Set,ce);return be.has(le)||(be.add(le),f.filter(lt=>lt.source===le).forEach(lt=>{let Kt=_.get(lt.target);Kt&&(Dt=OR(Dt,nat(V(lt.target,ce,new Set(be)),{x:Kt.x-Ne.x,y:Kt.y-Ne.y})))})),Dt};Object.entries(S).forEach(([le,ce])=>{if(ce.length<2)return;let be=s.find(ge=>ge.id===le),Ne=_.get(le);if(!be||!Ne)return;let Dt=new Set,lt=ce.map((ge,Nt)=>({edge:ge,index:Nt,pathIndexes:hat(ge.sourceHandle)})),Kt=lt.every(({pathIndexes:ge})=>ge.length>=2),cn=Kt?Array.from(new Set(lt.map(({pathIndexes:ge})=>ge[0]))).sort((ge,Nt)=>ge-Nt):[],Zn=Kt?Array.from(new Set(lt.map(({pathIndexes:ge})=>ge[1]))).sort((ge,Nt)=>ge-Nt):[],zn=Kt&<.length>3&&(cn.length===1||Zn.length===1),fr=Kt&&!zn,Oi=Math.max(1,Math.ceil(Math.sqrt(lt.length))),jr=lt.map(({edge:ge,index:Nt,pathIndexes:Jt})=>{let pi=a[ge.target],Ks=_.get(ge.target);if(!pi||!Ks)return null;let jc=fr?cn.indexOf(Jt[0]):Math.floor(Nt/Oi),ts=fr?Zn.indexOf(Jt[1]):Nt%Oi,Il=V(ge.target,R(ge.target));return{edge:ge,targetPosition:Ks,row:jc,column:ts,footprint:Il,footprintWidth:Il.right-Il.left,footprintHeight:Il.bottom-Il.top}}).filter(ge=>ge!==null&&ge.row>=0&&ge.column>=0);if(jr.length===0)return;let bs=Math.max(...jr.map(ge=>ge.column))+1,Fa=Math.max(...jr.map(ge=>ge.row))+1,Mi=Array.from({length:bs},()=>0),Ns=Array.from({length:Fa},()=>0);jr.forEach(ge=>{Mi[ge.column]=Math.max(Mi[ge.column],ge.footprintWidth),Ns[ge.row]=Math.max(Ns[ge.row],ge.footprintHeight)});let Gs=fr?IQt:TQt,Oa=fr?qst:LQt,Jb=Mi.reduce((ge,Nt,Jt)=>{let pi=Jt===0?0:ge[Jt-1]+Mi[Jt-1]+Gs;return ge.push(pi),ge},[]),Qb=Ns.reduce((ge,Nt,Jt)=>{let pi=Jt===0?0:ge[Jt-1]+Ns[Jt-1]+Oa;return ge.push(pi),ge},[]),Yp=Ns.reduce((ge,Nt)=>ge+Nt,0)+Math.max(0,Fa-1)*Oa,e0=Ls(be),WC=Ne.x+e0.width+Gs,tr=Ne.y+e0.height/2-Yp/2;jr.forEach(ge=>{let Nt=WC+Jb[ge.column]+(Mi[ge.column]-ge.footprintWidth)/2,Jt=tr+Qb[ge.row]+(Ns[ge.row]-ge.footprintHeight)/2,pi={x:Nt-ge.footprint.left,y:Jt-ge.footprint.top};x(ge.edge.target,{x:pi.x-ge.targetPosition.x,y:pi.y-ge.targetPosition.y},Dt)})});let z=new Map,te=(le,ce=new Set)=>{if(z.has(le))return z.get(le)??null;if(l.has(le))return z.set(le,le),le;if(ce.has(le))return null;ce.add(le);for(let be of d[le]??[]){let Ne=te(be.target,ce);if(Ne)return z.set(le,Ne),Ne}for(let be of u[le]??[]){let Ne=te(be.source,ce);if(Ne)return z.set(le,Ne),Ne}return z.set(le,null),null},oe=new Map,U=(le,ce,be=new Set)=>{let Ne=`${le}:${ce}`;if(oe.has(Ne))return oe.get(Ne)??0;if(le===ce)return oe.set(Ne,0),0;if(be.has(le))return 0;be.add(le);let Dt=0;for(let lt of d[le]??[]){let Kt=U(lt.target,ce,be);(Kt>0||lt.target===ce)&&(Dt=Math.max(Dt,Kt+1))}return oe.set(Ne,Dt),Dt},me=i.filter(le=>!l.has(le.id)).reduce((le,ce)=>{let be=te(ce.id);return be&&(le[be]=[...le[be]??[],ce]),le},{}),Be=i.map(le=>{let ce=_.get(le.id);return ce?{...le,position:{...ce}}:le}).reduce((le,ce)=>(le[ce.id]=ce,le),{}),ft=(()=>{let le=e.reduce((be,Ne)=>{if(!Ne.source||!Ne.target||!Ne.targetHandle?.startsWith("fieldInput/"))return be;let Dt=a[Ne.source],lt=a[Ne.target];return Dt?.type!=="state"||lt?.type!=="app"||(be[Ne.target]=[...be[Ne.target]??[],Ne]),be},{}),ce=new Map;return Object.entries(le).forEach(([be,Ne])=>{let Dt=a[be],lt=new Set(Ne.map(Kt=>Kt.source));!Dt||!tat(Dt,lt.size)||lt.forEach(Kt=>{ce.set(Kt,be)})}),ce})(),kt=new Map,Ue=(le,ce)=>{let be=kt.get(ce);return be?le===ce?0:be.get(le)??1:le===ce?0:1},Re=(le,ce,be)=>{let Ne=[],Dt=(lt,Kt,cn,Zn)=>{let zn=Be[Kt]??a[Kt];if(!zn)return;let fr=Ue(Kt,ce),Oi=fr===be-1?0:fr<be?1:2;if(Oi>1)return;let{width:jr}=Ls(le);Ne.push({centerX:iat(zn,cn,r)-pat(le,Zn,r)+jr/2,order:jf(Kt,cn,r),priority:Oi})};for(let lt of d[le.id]??[])Dt(lt,lt.target,lt.targetHandle,lt.sourceHandle);for(let lt of u[le.id]??[])Dt(lt,lt.source,lt.sourceHandle,lt.targetHandle);if(Ne.length===0){let lt=Be[ce]??a[ce];return{centerX:_Ae(lt||le),order:Number.MAX_SAFE_INTEGER}}return Ne.sort((lt,Kt)=>lt.priority-Kt.priority||lt.order-Kt.order||lt.centerX-Kt.centerX),{centerX:Ne[0].centerX,order:Ne[0].order}};Object.entries(me).forEach(([le,ce])=>{let be=Be[le]??a[le];if(!be)return;let Ne=new Map;ce.forEach(Kt=>{Ne.set(Kt.id,Math.max(1,U(Kt.id,le)))}),kt.set(le,Ne);let Dt=Math.max(...Ne.values(),1),lt=be.position.y-Gst;for(let Kt=1;Kt<=Dt;Kt+=1){let cn=ce.filter(jr=>Ne.get(jr.id)===Kt&&!ft.has(jr.id));if(cn.length===0)continue;let Zn=Math.max(...cn.map(jr=>Ls(jr).height)),zn=lt-Zn,fr=cn.map(jr=>{let bs=Re(jr,le,Kt);return{node:jr,desiredCenterX:bs.centerX,order:bs.order}}),Oi=oat(fr,sat);cn.forEach(jr=>{let bs=Ls(jr);Be[jr.id]={...jr,position:{x:Oi.get(jr.id)??_Ae(be)-bs.width/2,y:zn+Zn-bs.height}}}),lt=zn-Gst}});let rn=(le,ce,be,Ne)=>{let Dt=Ls(le),lt=Ls(ce);return le.position.x<ce.position.x+lt.width+be&&le.position.x+Dt.width+be>ce.position.x&&le.position.y<ce.position.y+lt.height+Ne&&le.position.y+Dt.height+Ne>ce.position.y},Ge=(le,ce)=>{Be[le.id]={...le,position:ce}},Lt=(le,ce)=>{le.forEach(be=>{let Ne=Be[be]??a[be];Ne&&Ge(Ne,{x:Ne.position.x+ce.x,y:Ne.position.y+ce.y})})},Pt=new Map,On=le=>!!(le.source&&le.target&&!l.has(le.source)&&(le.targetHandle?.startsWith("fieldInput/")||le.targetHandle?.startsWith("codeField/"))),Wt=e.reduce((le,ce)=>(On(ce)&&(le[ce.target]=[...le[ce.target]??[],ce]),le),{}),Et=(le,ce)=>Array.from((Wt[le]??[]).filter(be=>H(be.source,ce)).sort((be,Ne)=>jf(le,be.targetHandle,r)-jf(le,Ne.targetHandle,r)||(h.get(be)??0)-(h.get(Ne)??0)||be.source.localeCompare(Ne.source)).reduce((be,Ne)=>(be.has(Ne.source)||be.set(Ne.source,Ne),be),new Map).values()),Ae=(le,ce)=>{let be=le.position.y;return ce.forEach((Ne,Dt)=>{let lt=Be[Ne.source]??a[Ne.source];if(!lt)return;let Kt=Ls(lt),cn=Dt===0?nse(lt,le):0;be=be-cn-Kt.height-Xst}),be},ke=(le,ce=new Set,be)=>{let Ne=Be[le]??a[le];if(!Ne)return null;let Dt=FR(Ne);return ce.has(le)||(ce.add(le),Et(le,be).forEach(lt=>{let Kt=Be[lt.source]??a[lt.source];if(!Kt||l.has(Kt.id))return;let cn=ke(Kt.id,new Set(ce),be);cn&&(Dt=OR(Dt,cn))})),Dt},Te=(le,ce=new Set,be)=>{if(ce.has(le))return;ce.add(le);let Ne=Be[le]??a[le];if(!Ne)return;let Dt=Et(le,be),lt=Dt.filter(zn=>ft.get(zn.source)===le),Kt=Dt.filter(zn=>{let fr=Be[zn.source]??a[zn.source];return fr&&!l.has(fr.id)&&ft.get(fr.id)!==le});if(Ne.type==="code"&&Kt.length>sT)return;let cn=lt.length>0?Ae(Ne,lt):Ne.position.y,Zn=null;Kt.forEach((zn,fr)=>{let Oi=Be[zn.source]??a[zn.source];if(!Oi)return;let jr=Ls(Oi),bs=nse(Oi,Ne),Fa=rat(Oi,Ne),Mi=cn-(fr===0?bs:0)-jr.height,Ns=Math.min(Ne.position.x-Fa-xAe*fr,Zn?Zn.left-Zst:Number.POSITIVE_INFINITY);Ge(Oi,{x:Ns,y:Mi}),Te(Oi.id,new Set(ce),be);let Gs=ke(Oi.id,new Set(ce),be);Gs&&(Zn=Zn?OR(Zn,Gs):Gs),cn=(Gs?.top??Mi)-SAe})},Q=()=>{s.map(le=>Be[le.id]??le).sort((le,ce)=>le.position.x-ce.position.x||le.position.y-ce.position.y||(p.get(le.id)??0)-(p.get(ce.id)??0)||le.id.localeCompare(ce.id)).forEach(le=>{Te(le.id,new Set,R(le.id))})},se=()=>{let le=new Map;return s.forEach(ce=>{let be=A(ce.id)??ce.id,Ne=le.get(be)??new Set;Ne.add(ce.id),le.set(be,Ne)}),i.forEach(ce=>{if(l.has(ce.id)||j(ce.id))return;let be=te(ce.id);if(!be||!l.has(be))return;let Ne=A(be)??be,Dt=le.get(Ne)??new Set;Dt.add(ce.id),le.set(Ne,Dt)}),le},ve=(le,ce)=>le.top<ce.bottom+Kst&&le.bottom+Kst>ce.top,X=(le,ce)=>{let be=0;return le.forEach(Ne=>{let Dt=Be[Ne]??a[Ne];if(!Dt)return;let lt=FR(Dt);ce.forEach(Kt=>{let cn=Be[Kt]??a[Kt];if(!cn)return;let Zn=FR(cn);!(lt.left<Zn.right&<.right>Zn.left)||!ve(lt,Zn)||(be=Math.max(be,Zn.right+DQt-lt.left))})}),be},fe=le=>Array.from(le).map(ce=>Be[ce]??a[ce]).filter(ce=>!!ce).map(FR).reduce((ce,be)=>ce?OR(ce,be):be,null),ze=le=>Math.min(...Array.from(le).map(ce=>p.get(ce)??Number.MAX_SAFE_INTEGER)),dt=le=>{let ce=Array.from(le).find(be=>l.has(be));return ce?v(ce):null},Tt=()=>{let le=se(),ce=[];Array.from(le.values()).sort((be,Ne)=>{let Dt=fe(be),lt=fe(Ne);return(Dt?.left??0)-(lt?.left??0)||(Dt?.top??0)-(lt?.top??0)||ze(be)-ze(Ne)}).forEach(be=>{let Ne=dt(be);for(let Dt=0;Dt<bAe;Dt+=1){let lt=ce.filter(Kt=>Kt.componentId===Ne).reduce((Kt,cn)=>Math.max(Kt,X(be,cn.nodeIds)),0);if(lt<=0)break;Lt(be,{x:lt,y:0})}ce.push({nodeIds:be,componentId:Ne})})},qt=()=>{let le=new Map;return s.forEach(ce=>{let be=v(ce.id);if(!be)return;let Ne=le.get(be)??new Set;Ne.add(ce.id),le.set(be,Ne)}),i.forEach(ce=>{if(l.has(ce.id))return;let be=te(ce.id),Ne=be?v(be):null;if(!Ne)return;let Dt=le.get(Ne)??new Set;Dt.add(ce.id),le.set(Ne,Dt)}),le},nn=(le,ce)=>{let be=0;return le.forEach(Ne=>{let Dt=Be[Ne]??a[Ne];if(!Dt)return;let lt=FR(Dt);ce.forEach(Kt=>{let cn=Be[Kt]??a[Kt];if(!cn)return;let Zn=FR(cn),zn=lt.left<Zn.right+Yst&<.right+Yst>Zn.left,fr=lt.top<Zn.bottom+vAe&<.bottom+vAe>Zn.top;!zn||!fr||(be=Math.max(be,Zn.bottom+vAe-lt.top))})}),be},ir=()=>{let le=Array.from(qt().values()).sort((be,Ne)=>{let Dt=fe(be),lt=fe(Ne);return(Dt?.top??0)-(lt?.top??0)||(Dt?.left??0)-(lt?.left??0)||ze(be)-ze(Ne)}),ce=[];le.forEach(be=>{for(let Ne=0;Ne<bAe;Ne+=1){let Dt=ce.reduce((lt,Kt)=>Math.max(lt,nn(be,Kt.nodeIds)),0);if(Dt<=0)break;Lt(be,{x:0,y:Dt})}ce.push({nodeIds:be})})},sr=()=>{let le=e.reduce((ce,be)=>{if(!be.source||!be.target||!be.targetHandle?.startsWith("codeField/"))return ce;let Ne=Be[be.source]??a[be.source],Dt=Be[be.target]??a[be.target];return!Ne||Dt?.type!=="code"||l.has(Ne.id)||(ce[be.target]=[...ce[be.target]??[],be]),ce},{});Object.entries(le).forEach(([ce,be])=>{if(be.length<=sT)return;let Ne=Be[ce]??a[ce];if(!Ne)return;let Dt=Array.from(be.sort((zn,fr)=>jf(ce,zn.targetHandle,r)-jf(ce,fr.targetHandle,r)||(h.get(zn)??0)-(h.get(fr)??0)||zn.source.localeCompare(fr.source)).reduce((zn,fr)=>(zn.has(fr.source)||zn.set(fr.source,fr),zn),new Map).values()),lt=Dt.filter(zn=>(Be[zn.source]??a[zn.source])?.type==="state"),Kt=Dt.filter(zn=>(Be[zn.source]??a[zn.source])?.type!=="state"),cn=[];for(let zn=0;zn<lt.length;zn+=sT)cn.push(lt.slice(zn,zn+sT));for(let zn=0;zn<Kt.length;zn+=sT)cn.push(Kt.slice(zn,zn+sT));let Zn=Ne.position.y-ien;for(let[zn,fr]of cn.entries()){let Oi=fr.map((Mi,Ns)=>{let Gs=Be[Mi.source]??a[Mi.source];return Gs?{node:Gs,desiredCenterX:iat(Ne,Mi.targetHandle,r),order:zn*sT+Ns}:null}).filter(Mi=>Mi!==null);if(Oi.length===0)continue;let jr=Math.max(...Oi.map(Mi=>Ls(Mi.node).height)),bs=Zn-jr,Fa=oat(Oi,ren);Oi.forEach(Mi=>{let Ns=Ls(Mi.node);Ge(Mi.node,{x:Fa.get(Mi.node.id)??Mi.desiredCenterX-Ns.width/2,y:bs+jr-Ns.height})}),Zn=bs-oen}})},Zt=()=>{e.filter(ce=>{let be=Be[ce.source]??a[ce.source],Ne=Be[ce.target]??a[ce.target];return be&&Ne&&uw(be)&&Ne.type==="app"&&!uw(Ne)&&D(be.id).size===0&&!l.has(be.id)&&!l.has(Ne.id)&&ce.sourceHandle==="fieldOutput"&&!!ce.targetHandle?.startsWith("fieldInput/")}).sort((ce,be)=>{let Ne=te(ce.source),Dt=te(be.source),lt=Ne?Ue(ce.source,Ne):0,Kt=Dt?Ue(be.source,Dt):0;return lt-Kt||ce.source.localeCompare(be.source)}).forEach(ce=>{let be=Be[ce.source]??a[ce.source],Ne=Be[ce.target]??a[ce.target];if(!be||!Ne)return;let Dt=Ls(be),lt=Ls(Ne);Ge(be,{x:Ne.position.x-Dt.width-NQt,y:Ne.position.y+(lt.height-Dt.height)/2})})},er=()=>{Pt.clear();let le=e.reduce((ce,be)=>{if(!be.source||!be.target||!be.targetHandle?.startsWith("fieldInput/"))return ce;let Ne=Be[be.source]??a[be.source],Dt=Be[be.target]??a[be.target];return Ne?.type!=="state"||Dt?.type!=="app"||(ce[be.target]=[...ce[be.target]??[],be]),ce},{});Object.entries(le).forEach(([ce,be])=>{let Ne=Be[ce]??a[ce];if(!Ne)return;let lt=Array.from(be.sort((cn,Zn)=>jf(ce,cn.targetHandle,r)-jf(ce,Zn.targetHandle,r)||(h.get(cn)??0)-(h.get(Zn)??0)||cn.source.localeCompare(Zn.source)).reduce((cn,Zn)=>(cn.has(Zn.source)||cn.set(Zn.source,Zn),cn),new Map).values()).map(cn=>Be[cn.source]??a[cn.source]).filter(cn=>!!cn);if(lt.length===0||!tat(Ne,lt.length))return;let Kt=Ne.position.y;lt.forEach((cn,Zn)=>{let zn=Ls(cn),fr=Zn===0?nse(cn,Ne):0,Oi=Kt-fr-zn.height;Pt.set(cn.id,ce),Ge(cn,{x:Ne.position.x-aat-RQt*Zn,y:Oi}),Kt=Oi-Xst})})},Er=()=>{let le=i.map(be=>be.id).filter(be=>l.has(be)).sort((be,Ne)=>{let Dt=Be[be]??a[be],lt=Be[Ne]??a[Ne];return Dt.position.y-lt.position.y||Dt.position.x-lt.position.x||be.localeCompare(Ne)}),ce=i.map(be=>be.id).filter(be=>!l.has(be)).sort((be,Ne)=>{let Dt=Be[be]??a[be],lt=Be[Ne]??a[Ne];return Dt.position.y-lt.position.y||Dt.position.x-lt.position.x||be.localeCompare(Ne)});for(let be=0;be<bAe;be+=1){let Ne=!1;for(let Dt of ce){let lt=Be[Dt]??a[Dt],Kt=Ls(lt);for(let cn of le){let Zn=Be[cn]??a[cn],zn=Pt.has(lt.id),fr=Pt.get(lt.id)===cn;if(!rn(lt,Zn,zn&&!fr?0:t8,zn&&!fr?0:gAe))continue;let bs=Zn.position.y-Kt.height-gAe;bs<lt.position.y&&(Ge(lt,{x:lt.position.x,y:bs}),Ne=!0)}}for(let Dt=0;Dt<ce.length;Dt+=1)for(let lt=Dt+1;lt<ce.length;lt+=1){let Kt=Be[ce[Dt]]??a[ce[Dt]],cn=Be[ce[lt]]??a[ce[lt]],Zn=Pt.get(Kt.id),zn=Pt.get(cn.id),fr=Zn&&Zn===zn,Oi=Zn===cn.id||zn===Kt.id,jr=fr||Oi;if(!rn(Kt,cn,jr?0:t8,jr?0:gAe))continue;let Mi=Pt.has(Kt.id),Ns=Pt.has(cn.id),[Gs,Oa]=Mi!==Ns?Mi?[Kt,cn]:[cn,Kt]:Kt.position.x<=cn.position.x?[Kt,cn]:[cn,Kt],Jb=Ls(Gs),Qb=Ls(Oa),Yp=Oa.position.x<Gs.position.x?Gs.position.x-Qb.width-t8:Gs.position.x+Jb.width+t8;Ge(Oa,{x:Yp,y:Oa.position.y}),Ne=!0}if(!Ne)break}};return Zt(),sr(),er(),Er(),Zt(),sr(),er(),Er(),sr(),er(),Q(),Zt(),er(),sr(),Tt(),ir(),i.map(le=>Be[le.id]??le)}function ose(n){let e=new Uint8Array(n);if(window.crypto&&window.crypto.getRandomValues)window.crypto.getRandomValues(e);else for(let i=0;i<e.length;i++)e[i]=Math.floor(Math.random()*256);let t=Array.from(e);return btoa(String.fromCharCode.apply(null,t)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}var Bh=St(Lct(),1);function Act(n){return[{name:"commonName",value:n}]}function Jrn(n){let e=n.split(".");return e.length===4&&e.every(t=>/^\d+$/.test(t)&&Number(t)>=0&&Number(t)<=255)}function Qrn(n){return Jrn(n)||n.includes(":")&&/^[0-9a-fA-F:.]+$/.test(n)}function ein(n){let e=[{type:2,value:"localhost"},{type:7,ip:"127.0.0.1"}];return n&&e.push(Qrn(n)?{type:7,ip:n}:{type:2,value:n}),[{name:"subjectAltName",altNames:e}]}function Dct(){return`01${Bh.util.bytesToHex(Bh.random.getBytesSync(15))}`}function Nct(n,e){return new Date(n.getTime()+e*24*60*60*1e3)}function Rct(n){return n.toISOString().replace("Z","+00:00")}function Fct(n){let e=n.trim(),t=new Date,r=new Date(t.getTime()-300*1e3),i=Bh.pki.rsa.generateKeyPair({bits:2048,e:65537}),o=Bh.pki.createCertificate();o.publicKey=i.publicKey,o.serialNumber=Dct(),o.validity.notBefore=r,o.validity.notAfter=Nct(t,3650);let s=Act(`FrameOS Frame CA (${e||"frame"})`);o.setSubject(s),o.setIssuer(s),o.setExtensions([{name:"basicConstraints",cA:!0,critical:!0},{name:"keyUsage",digitalSignature:!0,keyCertSign:!0,cRLSign:!0,critical:!0}]),o.sign(i.privateKey,Bh.md.sha256.create());let a=Bh.pki.rsa.generateKeyPair({bits:2048,e:65537}),l=Bh.pki.createCertificate();return l.publicKey=a.publicKey,l.serialNumber=Dct(),l.validity.notBefore=r,l.validity.notAfter=Nct(t,825),l.setSubject(Act(e||"frame.local")),l.setIssuer(o.subject.attributes),l.setExtensions([...ein(e),{name:"basicConstraints",cA:!1,critical:!0},{name:"extKeyUsage",serverAuth:!0},{name:"keyUsage",digitalSignature:!0,keyEncipherment:!0,critical:!0}]),l.sign(i.privateKey,Bh.md.sha256.create()),{certs:{server:Bh.pki.certificateToPem(l),server_key:Bh.pki.privateKeyToPem(a.privateKey),client_ca:Bh.pki.certificateToPem(o)},server_cert_not_valid_after:Rct(l.validity.notAfter),client_ca_cert_not_valid_after:Rct(o.validity.notAfter)}}function tin(n,e){return(n.name||n.id).localeCompare(e.name||e.id,void 0,{numeric:!0,sensitivity:"base"})||String(n.id).localeCompare(String(e.id))}function Oct(n){return[...n].toSorted(tin)}var ZR={frameos:"2026.9.3+9a032fcb607dcc2ec67e22fab380217bd4557186",editor:"2026.9.3+4004e50d0c6a63b0b732f0f8d6e55c6b20b6ae3d",remote:"2026.9.3+a22d2f4dbdb936e9de7dd9f32559dba15fdbc1ad",docker:"2026.9.3+c12667acee0ef57360baef28f746d588b6bbabc1"};var Hdi=[{value:"",label:"Prefer binaries, build from source if needed"},{value:"precompiled",label:`Install precompiled binaries (version ${ZR.frameos.split("+")[0]})`},{value:"static",label:"Build from source - single binary (legacy: needs a build environment)"}];function zse(n){return n==="shared"||n==="shared-scenes"?"static":n==="static"||n==="precompiled"?n:"precompiled"}function v8(n){return n==="embedded"}function Ed(n,e){return v8(e)?"interpreted":n?.settings?.execution??"interpreted"}function y8(n,e){return Ed(n,e)!=="interpreted"}function Mct(n){let e=n?.settings?.execution;return e==="compiled"||e==="interpreted"?e:"interpreted"}var I2e="https://scenes.frameos.net/nim-converter",Pct="Preview runs the interpreter: this scene's Nim code nodes and Nim apps are not executed here. Convert the scene to JavaScript to see it whole.",rin=`This makes the scene compiled (legacy): it will need a full FrameOS source build on every deploy.
|
|
12539
|
+
`}};var Hoe={code:"Code",render:"Render",logic:"Logic",data:"Data"};function bit(n){return{...mit,...n,...Woe}}var $u=(0,AR.kea)([(0,AR.path)(["src","models","appsModel"]),(0,vit.loaders)(({values:n})=>({apps:[{},{loadApps:async()=>{try{let e=await tt("/api/apps");if(!e.ok)throw new Error("Failed to fetch apps");let t=await e.json();return bit(t.apps)}catch(e){return sw(e),bit(n.apps)}}}]})),(0,AR.afterMount)(({actions:n})=>{n.loadApps()})]);var DR=["app.ts","app.js","app.tsx","app.jsx"],$Le=Object.keys(Woe);function K6(n){return!!n&&n.startsWith("repo/")}function cw(n){return!!n&&$Le.includes(n)}function NR(n){return!!n&&DR.some(e=>!!n[e])}function Y6(n){return!!(n?.["app.nim"]||n?.["config.nim"])}function Xv(n){return Y6(n)&&!NR(n)}function Voe(n){return Object.values(n.apps??{}).some(e=>Xv(e.sources))?!0:(n.nodes??[]).some(e=>{if(e.type==="app"){let t=e.data;return Xv(t?.sources)||Xv(n.apps?.[t?.keyword??""]?.sources)}if(e.type==="code"){let t=e.data;return!!t?.code?.trim()&&!t?.codeJS?.trim()}return e.type==="source"})}function yit(n){if(!n?.["config.json"])return{};try{let e=JSON.parse(n["config.json"]);return typeof e=="object"&&e?e:{}}catch{return{}}}function _it(n){return Object.fromEntries(Object.entries(n).filter(([,e])=>e!==void 0))}function $1(n){return n?.origin??n?.source}function uXt(n){return!!n&&Object.keys(n).length>0}function wit(n){if(!n)return;if(G6[n])return n;if(!K6(n))return;let e=n.split("/").filter(Boolean),t=e[e.length-1],r=t?`repo/apps/code/${t}`:void 0;return r&&G6[r]?r:void 0}function hXt(n){let e=wit(n),t=e?G6[e]:void 0;return t?{...t}:void 0}function X6(n,e){let{source:t,...r}=n,i=$1(n)||e,o=wit(i),s=uXt(n.sources)?n.sources:hXt(i)||n.sources||{};return _it({...r,origin:o||i,sources:s})}function Rh(n){return Object.fromEntries(Object.entries(n??{}).map(([e,t])=>[e,X6(t,e)]))}function Uf(n){let e=yit(n.sources),t=$1(n);return{name:n.name||e.name||t||"Scene app",category:n.category||e.category,description:n.description||e.description,version:n.version||e.version,settings:n.settings||e.settings,apt:n.apt||e.apt,fields:n.fields||e.fields,output:n.output||e.output,cache:n.cache||e.cache,origin:t}}function qLe(n){return Object.fromEntries(Object.entries(Rh(n?.apps)).map(([e,t])=>[e,Uf(t)]))}function xit(n,e){return{...n,...qLe(e)}}function GLe(n){let e=$1(n);if(!e)return null;let t=e.split("/");return t[0]==="repo"&&t[1]==="apps"&&t[2]?t[2]:t[0]==="repo"&&t[1]?t[1]:t[0]==="scene"?"scene":t[0]||null}function Z6(n,e){let t=GLe(n);return`${e?`${e}: `:""}${n.name}${t?` [${t}]`:""}`}async function KLe(n){let e=G6[n]??git[n];if(e)return{...e};let t=await tt(`/api/apps/source?keyword=${encodeURIComponent(n)}`);return t.ok?await t.json():{}}function RR(n,e,t){let r=e.split("/").filter(Boolean),o=(r[r.length-1]||t?.name||"app").replace(/[^a-zA-Z0-9_-]+/g,"-").replace(/(^-|-$)/g,"")||"app";if(!n[o])return o;let s=2,a=`${o}-${s}`;for(;n[a];)s+=1,a=`${o}-${s}`;return a}function Uoe(n,e,t,r){let i=yit(t),o=$1(r)||$1(e)||(K6(n)?n:void 0),{source:s,...a}=r??{};return _it({...a,origin:o,name:i.name||r?.name||e?.name||n,category:i.category||r?.category||e?.category,description:i.description||r?.description||e?.description,version:i.version||r?.version||e?.version,settings:i.settings||r?.settings||e?.settings,apt:i.apt||r?.apt||e?.apt,fields:i.fields||r?.fields||e?.fields,output:i.output||r?.output||e?.output,cache:i.cache||r?.cache||e?.cache,sources:t})}async function joe(n,e,t){if(!K6(e))return{sceneApps:n,keyword:e,app:t??null};let r=await KLe(e),i=RR(n,e,t),o=Uoe(i,t,r,{origin:$1(t)||e});return{sceneApps:{...n,[i]:o},keyword:i,app:Uf(o)}}function $oe(n,e,t,r=!1,i){let o=Rh(t),s=r&&Object.values(o).some(a=>Y6(a.sources));return n?.map(a=>a.id===e?{...a,apps:o,...i?{nodes:i}:{},settings:s&&a.settings?.execution!=="compiled"?{...a.settings,execution:"compiled"}:a.settings}:a)}var qoe={openAI:{title:"OpenAI",tagLabel:"OpenAI API key missing",description:"The OpenAI API key is used within OpenAI apps on frames.",fields:[{label:"API key for frames",secret:!0,path:["openAI","apiKey"]}]},unsplash:{title:"Unsplash",tagLabel:"Unsplash access key missing",fields:[{label:"Access key",secret:!0,path:["unsplash","accessKey"]}]},homeAssistant:{title:"Home Assistant",tagLabel:"Home Assistant access token missing",fields:[{label:"Home assistant URL",path:["homeAssistant","url"]},{label:"Access token (Profile \u2192 Long-Lived Access Tokens)",secret:!0,path:["homeAssistant","accessToken"]}]},immich:{title:"Immich",tagLabel:"Immich API key missing",fields:[{label:"Server URL",path:["immich","url"]},{label:"API key (Account Settings \u2192 API Keys)",secret:!0,path:["immich","apiKey"]}]},github:{title:"GitHub",tagLabel:"GitHub personal access token missing",freeLimitedUsage:!0,fields:[{label:"API key",secret:!0,path:["github","api_key"]}]},frameOS:{title:"FrameOS Gallery",tagLabel:"FrameOS Gallery API key missing",fields:[{label:"API key",secret:!0,path:["frameOS","apiKey"]}]}};function pXt(n,e){if(e){if(n[e])return n[e];if(!e.includes("/")){let t=Object.keys(n).find(r=>r.endsWith(`/${e}`));if(t)return n[t]}}}function q1(n,e){let t=new Set;for(let r of n??[])for(let i of r.nodes??[])if(i.type==="app"){let o=i.data?.keyword,s=o?r.apps?.[o]:void 0,a=s?Uf(s):pXt(e,o);for(let l of a?.settings??[])qoe[l]&&t.add(l)}return Array.from(t)}function fXt(n){return"blob"in n?null:"templateId"in n?{template_id:n.templateId}:"url"in n?{url:n.url}:{source_scene_id:n.sourceSceneId,...n.sourceFrameId!==void 0?{source_frame_id:n.sourceFrameId}:{}}}var Goe=class extends Error{status;constructor(e,t){super(e),this.name="SceneImageError",this.status=t}};async function mXt(n){try{let e=await n.json();if(e?.detail)return String(e.detail)}catch{}return`unexpected status ${n.status}`}async function gXt(n,e,t){let r=fXt(t),i=r?await tt(`/api/frames/${n}/scene_images/${e}/copy`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)}):await tt(`/api/frames/${n}/scene_images/${e}`,{method:"POST",body:t.blob});if(!i.ok)throw new Goe(await mXt(i),i.status);tT.actions.updateEntityImage(`frames/${n}`,`scene_images/${e}`)}function YLe(n,e,t,r){let i=r instanceof Error?r.message:String(r);console.error(`Failed to copy the scene ${t}`,r),$n.actions.startTask({frameId:n,kind:"sceneImage",title:`Copying the scene ${t}`,detail:null,sceneId:e}),$n.actions.taskFailed({frameId:n,kind:"sceneImage",sceneId:e,detail:`${i}. The scene tile stays blank until the frame renders it.`})}async function Koe(n,e,t,r={}){let i=r.label??"preview image";if(!(!e.length||!t)&&!(Hn()&&!("blob"in t)))try{await Promise.all(e.map(o=>gXt(n,o,t)))}catch(o){if(r.ignoreMissingSource&&o instanceof Goe&&o.status===404)return;YLe(n,e[0],i,o)}}var wAe=St($st(),1),qst=90,EQt=90,IQt=120,TQt=64,LQt=56,Gst=50,sat=70,AQt=44,t8=40,gAe=40,bAe=24,DQt=16,Kst=0,Yst=180,vAe=120,NQt=t8,aat=32,RQt=24;var Xst=16,FQt=35,OQt=64,MQt=340,PQt=140,BQt=8,zQt=49,xAe=16,Zst=xAe+12,WQt=50,HQt=38,VQt=30,UQt=39,jQt=67,$Qt=48,qQt=32,Jst=200,SAe=18,GQt=260,KQt=180,Qst=200,lat=340,YQt=2200,XQt=6,ZQt=119,cat=260,yAe=100,JQt=72,QQt=8,een=120,ten=91,ese=7,nen=22,dat=40,sT=4,ren=sat,ien=60,oen=28,CAe=1e3;function Ls(n){return{width:n.width??GQt,height:n.height??KQt}}function tse(n){if(typeof n=="number"&&Number.isFinite(n))return n;if(typeof n=="string"){let e=Number.parseFloat(n);return Number.isFinite(e)?e:null}return null}function sen(n){let e=n.data??{},t=e.codeArgs??[],r=e.codeOutputs??[],i=(e.codeJS??e.code??"").trim(),o=i?i.split(/\r?\n/):[""],s=o.reduce((f,m)=>Math.max(f,m.length),0),a=[...t,...r].reduce((f,m)=>Math.max(f,m.name.length*ese+yAe),Qst),l=t.reduce((f,m)=>f+m.name.length*ese+JQt+QQt,een),c=t.length>XQt?YQt:lat,d=Math.min(c,Math.max(Qst,a,l,s*ese+yAe)),u=Math.max(1,Math.floor((d-yAe/2)/ese)),h=o.reduce((f,m)=>f+Math.max(1,Math.ceil(m.length/u)),0),p=Math.min(cat,Math.max(ZQt,ten+h*nen));return{width:Math.round(d),height:Math.round(p)}}function aen(n){if(n.type!=="code")return n;let e=sen(n),t=tse(n.width)??tse(n.style?.width),r=tse(n.height)??tse(n.style?.height),i=t!==null&&t>lat?Math.max(t,e.width):e.width,o=r!==null&&r>cat?Math.max(r,e.height):e.height,s={...n.style??{},width:i,height:o};return{...n,width:i,height:o,style:s}}function rse(n){return n?n.startsWith("fieldInput/")?n.slice(11):n.startsWith("codeField/")?n.slice(10):n.startsWith("field/")?n.slice(6):null:null}function uat(n){return rse(n)?.replace(/\[.*$/,"")??null}function eat(n){let e=hat(n);return e.length===0?null:e.reduce((t,r,i)=>t+r/CAe**i,0)}function hat(n){let e=rse(n);return e?Array.from(e.matchAll(/\[(\d+)\]/g)).map(t=>Number(t[1])):[]}function len(n){return n.sourceHandle==="next"||n.targetHandle==="prev"||n.type==="appNodeEdge"}function uw(n){if(n.type!=="app")return!1;let e=n.data?.keyword;return typeof e=="string"&&e.startsWith("data/")}function tat(n,e){if(n.type!=="app")return!1;if(e>1)return!0;let t=n.data?.keyword;return typeof t=="string"&&(t.startsWith("data/")||t.startsWith("logic/"))}function cen(n){return n.type==="event"||n.type==="dispatch"||n.type==="source"}function _Ae(n){return n.position.x+Ls(n).width/2}function FR(n){let e=Ls(n);return{left:n.position.x,right:n.position.x+e.width,top:n.position.y,bottom:n.position.y+e.height}}function OR(n,e){return{left:Math.min(n.left,e.left),right:Math.max(n.right,e.right),top:Math.min(n.top,e.top),bottom:Math.max(n.bottom,e.bottom)}}function nat(n,e){return{left:n.left+e.x,right:n.right+e.x,top:n.top+e.y,bottom:n.bottom+e.y}}function rat(n,e){if(n.type==="state")return uw(e)?aat:BQt;if(uw(n)&&uw(e))return zQt;let t=Ls(e);return n.type==="code"&&t.width<=MQt?OQt:FQt}function nse(n,e){let t=Ls(e);return n.type==="state"?uw(e)?SAe:t.height>=Jst?qQt:$Qt:uw(n)&&uw(e)?HQt:n.type==="code"?t.height<=PQt?jQt:t.height>=Jst?VQt:UQt:WQt}function jf(n,e,t){let r=rse(e);if(!r)return Number.MAX_SAFE_INTEGER;let i=t[n]??[],o=uat(e),s=eat(e)??0,a=i.indexOf(r);if(a>=0)return a*CAe+s;let l=o?i.indexOf(o):-1;if(l>=0)return l*CAe+s;let c=eat(e);return c!==null?c:Number.MAX_SAFE_INTEGER}function den(n,e,t){let r=rse(e);if(!r)return null;let i=t[n.id]??[],o=uat(e),s=i.indexOf(r),a=s>=0?s:o?i.indexOf(o):-1;if(a<0)return null;let{width:l}=Ls(n),c=e?.startsWith("codeField/")?dat:AQt,d=Math.max(l-c*2,1),u=Math.max(i.length-1,1);return c+d*a/u}function pat(n,e,t){let{width:r}=Ls(n);return e==="prev"?0:e==="next"?r:n.type==="code"&&e==="fieldOutput"?dat:den(n,e,t)??r/2}function iat(n,e,t){return n.position.x+pat(n,e,t)}function oat(n,e){let t=[...n].sort((r,i)=>r.desiredCenterX-i.desiredCenterX||r.order-i.order||(r.node.type??"").localeCompare(i.node.type??"")||r.node.id.localeCompare(i.node.id)).map(r=>{let{width:i}=Ls(r.node);return{...r,width:i,left:r.desiredCenterX-i/2}});for(let r=1;r<t.length;r+=1){let i=t[r-1],o=t[r];o.left=Math.max(o.left,i.left+i.width+e)}if(t.length>1){let r=Math.min(...t.map(l=>l.desiredCenterX-l.width/2)),i=Math.max(...t.map(l=>l.desiredCenterX+l.width/2)),o=Math.min(...t.map(l=>l.left)),s=Math.max(...t.map(l=>l.left+l.width)),a=(r+i)/2-(o+s)/2;t.forEach(l=>{l.left+=a})}return new Map(t.map(r=>[r.node.id,r.left]))}function uen(n,e){if(!e.has(n))return e.add(n),n;let t=2;for(;e.has(`${n}-${t}`);)t+=1;let r=`${n}-${t}`;return e.add(r),r}function hen(n,e){let t=n.reduce((l,c)=>(l[c.id]=c,l),{}),r=new Set(n.map(l=>l.id)),i=new WeakMap;e.forEach((l,c)=>{i.set(l,c)});let o=e.reduce((l,c)=>{let d=t[c.source],u=t[c.target],h=c.targetHandle?.startsWith("fieldInput/")||c.targetHandle?.startsWith("codeField/");return d?.type!=="state"||!u||u.type!=="app"&&u.type!=="code"||c.sourceHandle!=="fieldOutput"||!h||(l[c.source]=[...l[c.source]??[],c]),l},{}),s=[],a=new WeakMap;return Object.entries(o).forEach(([l,c])=>{let d=t[l];if(!d)return;let u=c.reduce((p,f)=>(p[f.target]=[...p[f.target]??[],f],p),{}),h=Object.entries(u).sort(([p,f],[m,g])=>(i.get(f[0])??0)-(i.get(g[0])??0)||p.localeCompare(m));h.length<=1||h.slice(1).forEach(([p,f])=>{let m=uen(`${l}__for__${p}`,r),{id:g,selected:b,dragging:v,positionAbsolute:y,..._}=d;s.push({..._,id:m,position:{...d.position},selected:!1,dragging:!1}),f.forEach(x=>{a.set(x,m)})})}),s.length===0?{nodes:n,edges:e}:{nodes:[...n,...s],edges:e.map(l=>{let c=a.get(l);return c?{...l,source:c}:l})}}function ise(n,e,t={}){let r=hen(n,e);return{nodes:pen(r.nodes,r.edges,t),edges:r.edges}}function pen(n,e,t={}){if(!n.length)return n;let r=t.fieldOrderByNodeId??{},i=n.map(aen),o=new Set;e.forEach(le=>{le.sourceHandle==="next"&&o.add(le.source),le.targetHandle==="prev"&&o.add(le.target)});let s=i.filter(le=>cen(le)||le.type==="app"&&!uw(le)&&o.has(le.id)),a=i.reduce((le,ce)=>(le[ce.id]=ce,le),{}),l=new Set(s.map(le=>le.id)),c=e.filter(le=>l.has(le.source)&&l.has(le.target)&&len(le)),d=e.reduce((le,ce)=>(!ce.source||!ce.target||(le[ce.source]=[...le[ce.source]??[],ce]),le),{}),u=e.reduce((le,ce)=>(!ce.source||!ce.target||(le[ce.target]=[...le[ce.target]??[],ce]),le),{}),h=new WeakMap;e.forEach((le,ce)=>{h.set(le,ce)});let p=new Map(s.map((le,ce)=>[le.id,ce])),f=[...c].sort((le,ce)=>(p.get(le.source)??0)-(p.get(ce.source)??0)||jf(le.source,le.sourceHandle,r)-jf(ce.source,ce.sourceHandle,r)||jf(le.target,le.targetHandle,r)-jf(ce.target,ce.targetHandle,r)||le.target.localeCompare(ce.target));if(!s.length)return n;let m=new Map(s.map(le=>[le.id,le.id])),g=le=>{let ce=m.get(le);if(!ce||ce===le)return le;let be=g(ce);return m.set(le,be),be},b=(le,ce)=>{let be=g(le),Ne=g(ce);be!==Ne&&m.set(Ne,be)};f.forEach(le=>{b(le.source,le.target)});let v=le=>l.has(le)?g(le):null,y=new wAe.default.graphlib.Graph({multigraph:!0});y.setGraph({rankdir:"LR",nodesep:qst,ranksep:EQt,edgesep:25}),y.setDefaultEdgeLabel(()=>({})),s.forEach(le=>{let{width:ce,height:be}=Ls(le);y.setNode(le.id,{width:ce,height:be,rank:le.type==="event"||le.type==="source"?"min":void 0})}),f.forEach(le=>{!le.source||!le.target||le.source===le.target||y.setEdge(le.source,le.target)}),wAe.default.layout(y);let _=new Map;s.forEach(le=>{let ce=y.node(le.id);if(!ce)return;let{width:be,height:Ne}=Ls(le);_.set(le.id,{x:ce.x-be/2,y:ce.y-Ne/2})});let x=(le,ce,be=new Set)=>{if(be.has(le))return;be.add(le);let Ne=_.get(le);Ne&&_.set(le,{x:Ne.x+ce.x,y:Ne.y+ce.y}),f.filter(Dt=>Dt.source===le).forEach(Dt=>{x(Dt.target,ce,be)})},S=f.reduce((le,ce)=>(!ce.sourceHandle?.startsWith("field/")||ce.targetHandle!=="prev"||(le[ce.source]=[...le[ce.source]??[],ce]),le),{}),k=new Set(Object.values(S).flatMap(le=>le.length>1?le.map(ce=>ce.target):[])),I=f.reduce((le,ce)=>(le[ce.target]=[...le[ce.target]??[],ce],le),{}),L=new Map,A=(le,ce=new Set)=>{if(L.has(le))return L.get(le)??null;if(!l.has(le))return L.set(le,null),null;if(k.has(le))return L.set(le,le),le;if(ce.has(le))return null;ce.add(le);for(let be of I[le]??[]){let Ne=A(be.source,new Set(ce));if(Ne)return L.set(le,Ne),Ne}return L.set(le,null),null},N=new Map,R=(le,ce=new Set)=>{let be=N.get(le);if(be)return new Set(be);let Ne=new Set;return ce.has(le)||(ce.add(le),l.has(le)&&Ne.add(le),f.filter(Dt=>Dt.source===le).forEach(Dt=>{R(Dt.target,new Set(ce)).forEach(lt=>Ne.add(lt))}),N.set(le,new Set(Ne))),Ne},F=new Map,D=(le,ce=new Set)=>{let be=F.get(le);if(be)return new Set(be);let Ne=new Set;return ce.has(le)||(ce.add(le),l.has(le)?Ne.add(le):(d[le]??[]).forEach(lt=>{D(lt.target,new Set(ce)).forEach(Kt=>Ne.add(Kt))}),F.set(le,new Set(Ne))),Ne},H=(le,ce)=>{if(!ce)return!0;let be=D(le);return be.size===0||[...be].every(Ne=>ce.has(Ne))},j=le=>D(le).size>1,K=(le,ce)=>Array.from((u[le]??[]).filter(be=>be.source&&be.target&&!l.has(be.source)&&H(be.source,ce)&&(be.targetHandle?.startsWith("fieldInput/")||be.targetHandle?.startsWith("codeField/"))).sort((be,Ne)=>jf(le,be.targetHandle,r)-jf(le,Ne.targetHandle,r)||(h.get(be)??0)-(h.get(Ne)??0)||be.source.localeCompare(Ne.source)).reduce((be,Ne)=>(be.has(Ne.source)||be.set(Ne.source,Ne),be),new Map).values()),de=(le,ce=new Set,be)=>{let Ne=a[le];if(!Ne)return{left:0,right:0,top:0,bottom:0};let Dt=Ls(Ne),lt={left:0,right:Dt.width,top:0,bottom:Dt.height};if(ce.has(le))return lt;ce.add(le);let Kt=0,cn=null;return K(le,be).forEach((Zn,zn)=>{let fr=a[Zn.source];if(!fr)return;let Oi=Ls(fr),jr=nse(fr,Ne),bs=rat(fr,Ne),Fa=Kt-(zn===0?jr:0)-Oi.height,Mi=Math.min(-bs-xAe*zn,cn?cn.left-Zst:Number.POSITIVE_INFINITY),Ns=nat(de(fr.id,new Set(ce),be),{x:Mi,y:Fa});lt=OR(lt,Ns),cn=cn?OR(cn,Ns):Ns,Kt=Ns.top-SAe}),lt},V=(le,ce,be=new Set)=>{let Ne=_.get(le);if(!Ne)return de(le,new Set,ce);let Dt=de(le,new Set,ce);return be.has(le)||(be.add(le),f.filter(lt=>lt.source===le).forEach(lt=>{let Kt=_.get(lt.target);Kt&&(Dt=OR(Dt,nat(V(lt.target,ce,new Set(be)),{x:Kt.x-Ne.x,y:Kt.y-Ne.y})))})),Dt};Object.entries(S).forEach(([le,ce])=>{if(ce.length<2)return;let be=s.find(ge=>ge.id===le),Ne=_.get(le);if(!be||!Ne)return;let Dt=new Set,lt=ce.map((ge,Nt)=>({edge:ge,index:Nt,pathIndexes:hat(ge.sourceHandle)})),Kt=lt.every(({pathIndexes:ge})=>ge.length>=2),cn=Kt?Array.from(new Set(lt.map(({pathIndexes:ge})=>ge[0]))).sort((ge,Nt)=>ge-Nt):[],Zn=Kt?Array.from(new Set(lt.map(({pathIndexes:ge})=>ge[1]))).sort((ge,Nt)=>ge-Nt):[],zn=Kt&<.length>3&&(cn.length===1||Zn.length===1),fr=Kt&&!zn,Oi=Math.max(1,Math.ceil(Math.sqrt(lt.length))),jr=lt.map(({edge:ge,index:Nt,pathIndexes:Jt})=>{let pi=a[ge.target],Ks=_.get(ge.target);if(!pi||!Ks)return null;let jc=fr?cn.indexOf(Jt[0]):Math.floor(Nt/Oi),ts=fr?Zn.indexOf(Jt[1]):Nt%Oi,Il=V(ge.target,R(ge.target));return{edge:ge,targetPosition:Ks,row:jc,column:ts,footprint:Il,footprintWidth:Il.right-Il.left,footprintHeight:Il.bottom-Il.top}}).filter(ge=>ge!==null&&ge.row>=0&&ge.column>=0);if(jr.length===0)return;let bs=Math.max(...jr.map(ge=>ge.column))+1,Fa=Math.max(...jr.map(ge=>ge.row))+1,Mi=Array.from({length:bs},()=>0),Ns=Array.from({length:Fa},()=>0);jr.forEach(ge=>{Mi[ge.column]=Math.max(Mi[ge.column],ge.footprintWidth),Ns[ge.row]=Math.max(Ns[ge.row],ge.footprintHeight)});let Gs=fr?IQt:TQt,Oa=fr?qst:LQt,Jb=Mi.reduce((ge,Nt,Jt)=>{let pi=Jt===0?0:ge[Jt-1]+Mi[Jt-1]+Gs;return ge.push(pi),ge},[]),Qb=Ns.reduce((ge,Nt,Jt)=>{let pi=Jt===0?0:ge[Jt-1]+Ns[Jt-1]+Oa;return ge.push(pi),ge},[]),Yp=Ns.reduce((ge,Nt)=>ge+Nt,0)+Math.max(0,Fa-1)*Oa,e0=Ls(be),WC=Ne.x+e0.width+Gs,tr=Ne.y+e0.height/2-Yp/2;jr.forEach(ge=>{let Nt=WC+Jb[ge.column]+(Mi[ge.column]-ge.footprintWidth)/2,Jt=tr+Qb[ge.row]+(Ns[ge.row]-ge.footprintHeight)/2,pi={x:Nt-ge.footprint.left,y:Jt-ge.footprint.top};x(ge.edge.target,{x:pi.x-ge.targetPosition.x,y:pi.y-ge.targetPosition.y},Dt)})});let z=new Map,te=(le,ce=new Set)=>{if(z.has(le))return z.get(le)??null;if(l.has(le))return z.set(le,le),le;if(ce.has(le))return null;ce.add(le);for(let be of d[le]??[]){let Ne=te(be.target,ce);if(Ne)return z.set(le,Ne),Ne}for(let be of u[le]??[]){let Ne=te(be.source,ce);if(Ne)return z.set(le,Ne),Ne}return z.set(le,null),null},oe=new Map,U=(le,ce,be=new Set)=>{let Ne=`${le}:${ce}`;if(oe.has(Ne))return oe.get(Ne)??0;if(le===ce)return oe.set(Ne,0),0;if(be.has(le))return 0;be.add(le);let Dt=0;for(let lt of d[le]??[]){let Kt=U(lt.target,ce,be);(Kt>0||lt.target===ce)&&(Dt=Math.max(Dt,Kt+1))}return oe.set(Ne,Dt),Dt},me=i.filter(le=>!l.has(le.id)).reduce((le,ce)=>{let be=te(ce.id);return be&&(le[be]=[...le[be]??[],ce]),le},{}),Be=i.map(le=>{let ce=_.get(le.id);return ce?{...le,position:{...ce}}:le}).reduce((le,ce)=>(le[ce.id]=ce,le),{}),ft=(()=>{let le=e.reduce((be,Ne)=>{if(!Ne.source||!Ne.target||!Ne.targetHandle?.startsWith("fieldInput/"))return be;let Dt=a[Ne.source],lt=a[Ne.target];return Dt?.type!=="state"||lt?.type!=="app"||(be[Ne.target]=[...be[Ne.target]??[],Ne]),be},{}),ce=new Map;return Object.entries(le).forEach(([be,Ne])=>{let Dt=a[be],lt=new Set(Ne.map(Kt=>Kt.source));!Dt||!tat(Dt,lt.size)||lt.forEach(Kt=>{ce.set(Kt,be)})}),ce})(),kt=new Map,Ue=(le,ce)=>{let be=kt.get(ce);return be?le===ce?0:be.get(le)??1:le===ce?0:1},Re=(le,ce,be)=>{let Ne=[],Dt=(lt,Kt,cn,Zn)=>{let zn=Be[Kt]??a[Kt];if(!zn)return;let fr=Ue(Kt,ce),Oi=fr===be-1?0:fr<be?1:2;if(Oi>1)return;let{width:jr}=Ls(le);Ne.push({centerX:iat(zn,cn,r)-pat(le,Zn,r)+jr/2,order:jf(Kt,cn,r),priority:Oi})};for(let lt of d[le.id]??[])Dt(lt,lt.target,lt.targetHandle,lt.sourceHandle);for(let lt of u[le.id]??[])Dt(lt,lt.source,lt.sourceHandle,lt.targetHandle);if(Ne.length===0){let lt=Be[ce]??a[ce];return{centerX:_Ae(lt||le),order:Number.MAX_SAFE_INTEGER}}return Ne.sort((lt,Kt)=>lt.priority-Kt.priority||lt.order-Kt.order||lt.centerX-Kt.centerX),{centerX:Ne[0].centerX,order:Ne[0].order}};Object.entries(me).forEach(([le,ce])=>{let be=Be[le]??a[le];if(!be)return;let Ne=new Map;ce.forEach(Kt=>{Ne.set(Kt.id,Math.max(1,U(Kt.id,le)))}),kt.set(le,Ne);let Dt=Math.max(...Ne.values(),1),lt=be.position.y-Gst;for(let Kt=1;Kt<=Dt;Kt+=1){let cn=ce.filter(jr=>Ne.get(jr.id)===Kt&&!ft.has(jr.id));if(cn.length===0)continue;let Zn=Math.max(...cn.map(jr=>Ls(jr).height)),zn=lt-Zn,fr=cn.map(jr=>{let bs=Re(jr,le,Kt);return{node:jr,desiredCenterX:bs.centerX,order:bs.order}}),Oi=oat(fr,sat);cn.forEach(jr=>{let bs=Ls(jr);Be[jr.id]={...jr,position:{x:Oi.get(jr.id)??_Ae(be)-bs.width/2,y:zn+Zn-bs.height}}}),lt=zn-Gst}});let rn=(le,ce,be,Ne)=>{let Dt=Ls(le),lt=Ls(ce);return le.position.x<ce.position.x+lt.width+be&&le.position.x+Dt.width+be>ce.position.x&&le.position.y<ce.position.y+lt.height+Ne&&le.position.y+Dt.height+Ne>ce.position.y},Ge=(le,ce)=>{Be[le.id]={...le,position:ce}},Lt=(le,ce)=>{le.forEach(be=>{let Ne=Be[be]??a[be];Ne&&Ge(Ne,{x:Ne.position.x+ce.x,y:Ne.position.y+ce.y})})},Pt=new Map,On=le=>!!(le.source&&le.target&&!l.has(le.source)&&(le.targetHandle?.startsWith("fieldInput/")||le.targetHandle?.startsWith("codeField/"))),Wt=e.reduce((le,ce)=>(On(ce)&&(le[ce.target]=[...le[ce.target]??[],ce]),le),{}),Et=(le,ce)=>Array.from((Wt[le]??[]).filter(be=>H(be.source,ce)).sort((be,Ne)=>jf(le,be.targetHandle,r)-jf(le,Ne.targetHandle,r)||(h.get(be)??0)-(h.get(Ne)??0)||be.source.localeCompare(Ne.source)).reduce((be,Ne)=>(be.has(Ne.source)||be.set(Ne.source,Ne),be),new Map).values()),Ae=(le,ce)=>{let be=le.position.y;return ce.forEach((Ne,Dt)=>{let lt=Be[Ne.source]??a[Ne.source];if(!lt)return;let Kt=Ls(lt),cn=Dt===0?nse(lt,le):0;be=be-cn-Kt.height-Xst}),be},ke=(le,ce=new Set,be)=>{let Ne=Be[le]??a[le];if(!Ne)return null;let Dt=FR(Ne);return ce.has(le)||(ce.add(le),Et(le,be).forEach(lt=>{let Kt=Be[lt.source]??a[lt.source];if(!Kt||l.has(Kt.id))return;let cn=ke(Kt.id,new Set(ce),be);cn&&(Dt=OR(Dt,cn))})),Dt},Te=(le,ce=new Set,be)=>{if(ce.has(le))return;ce.add(le);let Ne=Be[le]??a[le];if(!Ne)return;let Dt=Et(le,be),lt=Dt.filter(zn=>ft.get(zn.source)===le),Kt=Dt.filter(zn=>{let fr=Be[zn.source]??a[zn.source];return fr&&!l.has(fr.id)&&ft.get(fr.id)!==le});if(Ne.type==="code"&&Kt.length>sT)return;let cn=lt.length>0?Ae(Ne,lt):Ne.position.y,Zn=null;Kt.forEach((zn,fr)=>{let Oi=Be[zn.source]??a[zn.source];if(!Oi)return;let jr=Ls(Oi),bs=nse(Oi,Ne),Fa=rat(Oi,Ne),Mi=cn-(fr===0?bs:0)-jr.height,Ns=Math.min(Ne.position.x-Fa-xAe*fr,Zn?Zn.left-Zst:Number.POSITIVE_INFINITY);Ge(Oi,{x:Ns,y:Mi}),Te(Oi.id,new Set(ce),be);let Gs=ke(Oi.id,new Set(ce),be);Gs&&(Zn=Zn?OR(Zn,Gs):Gs),cn=(Gs?.top??Mi)-SAe})},Q=()=>{s.map(le=>Be[le.id]??le).sort((le,ce)=>le.position.x-ce.position.x||le.position.y-ce.position.y||(p.get(le.id)??0)-(p.get(ce.id)??0)||le.id.localeCompare(ce.id)).forEach(le=>{Te(le.id,new Set,R(le.id))})},se=()=>{let le=new Map;return s.forEach(ce=>{let be=A(ce.id)??ce.id,Ne=le.get(be)??new Set;Ne.add(ce.id),le.set(be,Ne)}),i.forEach(ce=>{if(l.has(ce.id)||j(ce.id))return;let be=te(ce.id);if(!be||!l.has(be))return;let Ne=A(be)??be,Dt=le.get(Ne)??new Set;Dt.add(ce.id),le.set(Ne,Dt)}),le},ve=(le,ce)=>le.top<ce.bottom+Kst&&le.bottom+Kst>ce.top,X=(le,ce)=>{let be=0;return le.forEach(Ne=>{let Dt=Be[Ne]??a[Ne];if(!Dt)return;let lt=FR(Dt);ce.forEach(Kt=>{let cn=Be[Kt]??a[Kt];if(!cn)return;let Zn=FR(cn);!(lt.left<Zn.right&<.right>Zn.left)||!ve(lt,Zn)||(be=Math.max(be,Zn.right+DQt-lt.left))})}),be},fe=le=>Array.from(le).map(ce=>Be[ce]??a[ce]).filter(ce=>!!ce).map(FR).reduce((ce,be)=>ce?OR(ce,be):be,null),ze=le=>Math.min(...Array.from(le).map(ce=>p.get(ce)??Number.MAX_SAFE_INTEGER)),dt=le=>{let ce=Array.from(le).find(be=>l.has(be));return ce?v(ce):null},Tt=()=>{let le=se(),ce=[];Array.from(le.values()).sort((be,Ne)=>{let Dt=fe(be),lt=fe(Ne);return(Dt?.left??0)-(lt?.left??0)||(Dt?.top??0)-(lt?.top??0)||ze(be)-ze(Ne)}).forEach(be=>{let Ne=dt(be);for(let Dt=0;Dt<bAe;Dt+=1){let lt=ce.filter(Kt=>Kt.componentId===Ne).reduce((Kt,cn)=>Math.max(Kt,X(be,cn.nodeIds)),0);if(lt<=0)break;Lt(be,{x:lt,y:0})}ce.push({nodeIds:be,componentId:Ne})})},qt=()=>{let le=new Map;return s.forEach(ce=>{let be=v(ce.id);if(!be)return;let Ne=le.get(be)??new Set;Ne.add(ce.id),le.set(be,Ne)}),i.forEach(ce=>{if(l.has(ce.id))return;let be=te(ce.id),Ne=be?v(be):null;if(!Ne)return;let Dt=le.get(Ne)??new Set;Dt.add(ce.id),le.set(Ne,Dt)}),le},nn=(le,ce)=>{let be=0;return le.forEach(Ne=>{let Dt=Be[Ne]??a[Ne];if(!Dt)return;let lt=FR(Dt);ce.forEach(Kt=>{let cn=Be[Kt]??a[Kt];if(!cn)return;let Zn=FR(cn),zn=lt.left<Zn.right+Yst&<.right+Yst>Zn.left,fr=lt.top<Zn.bottom+vAe&<.bottom+vAe>Zn.top;!zn||!fr||(be=Math.max(be,Zn.bottom+vAe-lt.top))})}),be},ir=()=>{let le=Array.from(qt().values()).sort((be,Ne)=>{let Dt=fe(be),lt=fe(Ne);return(Dt?.top??0)-(lt?.top??0)||(Dt?.left??0)-(lt?.left??0)||ze(be)-ze(Ne)}),ce=[];le.forEach(be=>{for(let Ne=0;Ne<bAe;Ne+=1){let Dt=ce.reduce((lt,Kt)=>Math.max(lt,nn(be,Kt.nodeIds)),0);if(Dt<=0)break;Lt(be,{x:0,y:Dt})}ce.push({nodeIds:be})})},sr=()=>{let le=e.reduce((ce,be)=>{if(!be.source||!be.target||!be.targetHandle?.startsWith("codeField/"))return ce;let Ne=Be[be.source]??a[be.source],Dt=Be[be.target]??a[be.target];return!Ne||Dt?.type!=="code"||l.has(Ne.id)||(ce[be.target]=[...ce[be.target]??[],be]),ce},{});Object.entries(le).forEach(([ce,be])=>{if(be.length<=sT)return;let Ne=Be[ce]??a[ce];if(!Ne)return;let Dt=Array.from(be.sort((zn,fr)=>jf(ce,zn.targetHandle,r)-jf(ce,fr.targetHandle,r)||(h.get(zn)??0)-(h.get(fr)??0)||zn.source.localeCompare(fr.source)).reduce((zn,fr)=>(zn.has(fr.source)||zn.set(fr.source,fr),zn),new Map).values()),lt=Dt.filter(zn=>(Be[zn.source]??a[zn.source])?.type==="state"),Kt=Dt.filter(zn=>(Be[zn.source]??a[zn.source])?.type!=="state"),cn=[];for(let zn=0;zn<lt.length;zn+=sT)cn.push(lt.slice(zn,zn+sT));for(let zn=0;zn<Kt.length;zn+=sT)cn.push(Kt.slice(zn,zn+sT));let Zn=Ne.position.y-ien;for(let[zn,fr]of cn.entries()){let Oi=fr.map((Mi,Ns)=>{let Gs=Be[Mi.source]??a[Mi.source];return Gs?{node:Gs,desiredCenterX:iat(Ne,Mi.targetHandle,r),order:zn*sT+Ns}:null}).filter(Mi=>Mi!==null);if(Oi.length===0)continue;let jr=Math.max(...Oi.map(Mi=>Ls(Mi.node).height)),bs=Zn-jr,Fa=oat(Oi,ren);Oi.forEach(Mi=>{let Ns=Ls(Mi.node);Ge(Mi.node,{x:Fa.get(Mi.node.id)??Mi.desiredCenterX-Ns.width/2,y:bs+jr-Ns.height})}),Zn=bs-oen}})},Zt=()=>{e.filter(ce=>{let be=Be[ce.source]??a[ce.source],Ne=Be[ce.target]??a[ce.target];return be&&Ne&&uw(be)&&Ne.type==="app"&&!uw(Ne)&&D(be.id).size===0&&!l.has(be.id)&&!l.has(Ne.id)&&ce.sourceHandle==="fieldOutput"&&!!ce.targetHandle?.startsWith("fieldInput/")}).sort((ce,be)=>{let Ne=te(ce.source),Dt=te(be.source),lt=Ne?Ue(ce.source,Ne):0,Kt=Dt?Ue(be.source,Dt):0;return lt-Kt||ce.source.localeCompare(be.source)}).forEach(ce=>{let be=Be[ce.source]??a[ce.source],Ne=Be[ce.target]??a[ce.target];if(!be||!Ne)return;let Dt=Ls(be),lt=Ls(Ne);Ge(be,{x:Ne.position.x-Dt.width-NQt,y:Ne.position.y+(lt.height-Dt.height)/2})})},er=()=>{Pt.clear();let le=e.reduce((ce,be)=>{if(!be.source||!be.target||!be.targetHandle?.startsWith("fieldInput/"))return ce;let Ne=Be[be.source]??a[be.source],Dt=Be[be.target]??a[be.target];return Ne?.type!=="state"||Dt?.type!=="app"||(ce[be.target]=[...ce[be.target]??[],be]),ce},{});Object.entries(le).forEach(([ce,be])=>{let Ne=Be[ce]??a[ce];if(!Ne)return;let lt=Array.from(be.sort((cn,Zn)=>jf(ce,cn.targetHandle,r)-jf(ce,Zn.targetHandle,r)||(h.get(cn)??0)-(h.get(Zn)??0)||cn.source.localeCompare(Zn.source)).reduce((cn,Zn)=>(cn.has(Zn.source)||cn.set(Zn.source,Zn),cn),new Map).values()).map(cn=>Be[cn.source]??a[cn.source]).filter(cn=>!!cn);if(lt.length===0||!tat(Ne,lt.length))return;let Kt=Ne.position.y;lt.forEach((cn,Zn)=>{let zn=Ls(cn),fr=Zn===0?nse(cn,Ne):0,Oi=Kt-fr-zn.height;Pt.set(cn.id,ce),Ge(cn,{x:Ne.position.x-aat-RQt*Zn,y:Oi}),Kt=Oi-Xst})})},Er=()=>{let le=i.map(be=>be.id).filter(be=>l.has(be)).sort((be,Ne)=>{let Dt=Be[be]??a[be],lt=Be[Ne]??a[Ne];return Dt.position.y-lt.position.y||Dt.position.x-lt.position.x||be.localeCompare(Ne)}),ce=i.map(be=>be.id).filter(be=>!l.has(be)).sort((be,Ne)=>{let Dt=Be[be]??a[be],lt=Be[Ne]??a[Ne];return Dt.position.y-lt.position.y||Dt.position.x-lt.position.x||be.localeCompare(Ne)});for(let be=0;be<bAe;be+=1){let Ne=!1;for(let Dt of ce){let lt=Be[Dt]??a[Dt],Kt=Ls(lt);for(let cn of le){let Zn=Be[cn]??a[cn],zn=Pt.has(lt.id),fr=Pt.get(lt.id)===cn;if(!rn(lt,Zn,zn&&!fr?0:t8,zn&&!fr?0:gAe))continue;let bs=Zn.position.y-Kt.height-gAe;bs<lt.position.y&&(Ge(lt,{x:lt.position.x,y:bs}),Ne=!0)}}for(let Dt=0;Dt<ce.length;Dt+=1)for(let lt=Dt+1;lt<ce.length;lt+=1){let Kt=Be[ce[Dt]]??a[ce[Dt]],cn=Be[ce[lt]]??a[ce[lt]],Zn=Pt.get(Kt.id),zn=Pt.get(cn.id),fr=Zn&&Zn===zn,Oi=Zn===cn.id||zn===Kt.id,jr=fr||Oi;if(!rn(Kt,cn,jr?0:t8,jr?0:gAe))continue;let Mi=Pt.has(Kt.id),Ns=Pt.has(cn.id),[Gs,Oa]=Mi!==Ns?Mi?[Kt,cn]:[cn,Kt]:Kt.position.x<=cn.position.x?[Kt,cn]:[cn,Kt],Jb=Ls(Gs),Qb=Ls(Oa),Yp=Oa.position.x<Gs.position.x?Gs.position.x-Qb.width-t8:Gs.position.x+Jb.width+t8;Ge(Oa,{x:Yp,y:Oa.position.y}),Ne=!0}if(!Ne)break}};return Zt(),sr(),er(),Er(),Zt(),sr(),er(),Er(),sr(),er(),Q(),Zt(),er(),sr(),Tt(),ir(),i.map(le=>Be[le.id]??le)}function ose(n){let e=new Uint8Array(n);if(window.crypto&&window.crypto.getRandomValues)window.crypto.getRandomValues(e);else for(let i=0;i<e.length;i++)e[i]=Math.floor(Math.random()*256);let t=Array.from(e);return btoa(String.fromCharCode.apply(null,t)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}var Bh=St(Lct(),1);function Act(n){return[{name:"commonName",value:n}]}function Jrn(n){let e=n.split(".");return e.length===4&&e.every(t=>/^\d+$/.test(t)&&Number(t)>=0&&Number(t)<=255)}function Qrn(n){return Jrn(n)||n.includes(":")&&/^[0-9a-fA-F:.]+$/.test(n)}function ein(n){let e=[{type:2,value:"localhost"},{type:7,ip:"127.0.0.1"}];return n&&e.push(Qrn(n)?{type:7,ip:n}:{type:2,value:n}),[{name:"subjectAltName",altNames:e}]}function Dct(){return`01${Bh.util.bytesToHex(Bh.random.getBytesSync(15))}`}function Nct(n,e){return new Date(n.getTime()+e*24*60*60*1e3)}function Rct(n){return n.toISOString().replace("Z","+00:00")}function Fct(n){let e=n.trim(),t=new Date,r=new Date(t.getTime()-300*1e3),i=Bh.pki.rsa.generateKeyPair({bits:2048,e:65537}),o=Bh.pki.createCertificate();o.publicKey=i.publicKey,o.serialNumber=Dct(),o.validity.notBefore=r,o.validity.notAfter=Nct(t,3650);let s=Act(`FrameOS Frame CA (${e||"frame"})`);o.setSubject(s),o.setIssuer(s),o.setExtensions([{name:"basicConstraints",cA:!0,critical:!0},{name:"keyUsage",digitalSignature:!0,keyCertSign:!0,cRLSign:!0,critical:!0}]),o.sign(i.privateKey,Bh.md.sha256.create());let a=Bh.pki.rsa.generateKeyPair({bits:2048,e:65537}),l=Bh.pki.createCertificate();return l.publicKey=a.publicKey,l.serialNumber=Dct(),l.validity.notBefore=r,l.validity.notAfter=Nct(t,825),l.setSubject(Act(e||"frame.local")),l.setIssuer(o.subject.attributes),l.setExtensions([...ein(e),{name:"basicConstraints",cA:!1,critical:!0},{name:"extKeyUsage",serverAuth:!0},{name:"keyUsage",digitalSignature:!0,keyEncipherment:!0,critical:!0}]),l.sign(i.privateKey,Bh.md.sha256.create()),{certs:{server:Bh.pki.certificateToPem(l),server_key:Bh.pki.privateKeyToPem(a.privateKey),client_ca:Bh.pki.certificateToPem(o)},server_cert_not_valid_after:Rct(l.validity.notAfter),client_ca_cert_not_valid_after:Rct(o.validity.notAfter)}}function tin(n,e){return(n.name||n.id).localeCompare(e.name||e.id,void 0,{numeric:!0,sensitivity:"base"})||String(n.id).localeCompare(String(e.id))}function Oct(n){return[...n].toSorted(tin)}var ZR={frameos:"2026.9.5+e0ee71ef10d953fd834de06c4483561da8cf9aed",editor:"2026.9.5+b78a3455fb7e56a2474ca1b54cc55de5cbc3ece7",remote:"2026.9.3+a22d2f4dbdb936e9de7dd9f32559dba15fdbc1ad",docker:"2026.9.5+087277afc6de3924b8912f8d7bebe11baa023698"};var Hdi=[{value:"",label:"Prefer binaries, build from source if needed"},{value:"precompiled",label:`Install precompiled binaries (version ${ZR.frameos.split("+")[0]})`},{value:"static",label:"Build from source - single binary (legacy: needs a build environment)"}];function zse(n){return n==="shared"||n==="shared-scenes"?"static":n==="static"||n==="precompiled"?n:"precompiled"}function v8(n){return n==="embedded"}function Ed(n,e){return v8(e)?"interpreted":n?.settings?.execution??"interpreted"}function y8(n,e){return Ed(n,e)!=="interpreted"}function Mct(n){let e=n?.settings?.execution;return e==="compiled"||e==="interpreted"?e:"interpreted"}var I2e="https://scenes.frameos.net/nim-converter",Pct="Preview runs the interpreter: this scene's Nim code nodes and Nim apps are not executed here. Convert the scene to JavaScript to see it whole.",rin=`This makes the scene compiled (legacy): it will need a full FrameOS source build on every deploy.
|
|
12540
12540
|
|
|
12541
12541
|
Keep it interpreted instead and convert it to an interpreted scene at ${I2e}?
|
|
12542
12542
|
|
|
@@ -12928,4 +12928,4 @@ use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.productio
|
|
|
12928
12928
|
* LICENSE file in the root directory of this source tree.
|
|
12929
12929
|
*)
|
|
12930
12930
|
*/
|
|
12931
|
-
//# sourceMappingURL=lib-
|
|
12931
|
+
//# sourceMappingURL=lib-KUGKN4SQ.js.map
|
package/dist/static/lib.js
CHANGED
|
@@ -12536,7 +12536,7 @@ export function get(app: FrameOSApp, context: FrameOSContext) {
|
|
|
12536
12536
|
}
|
|
12537
12537
|
]
|
|
12538
12538
|
}
|
|
12539
|
-
`}};var Hoe={code:"Code",render:"Render",logic:"Logic",data:"Data"};function bit(n){return{...mit,...n,...Woe}}var $u=(0,AR.kea)([(0,AR.path)(["src","models","appsModel"]),(0,vit.loaders)(({values:n})=>({apps:[{},{loadApps:async()=>{try{let e=await tt("/api/apps");if(!e.ok)throw new Error("Failed to fetch apps");let t=await e.json();return bit(t.apps)}catch(e){return sw(e),bit(n.apps)}}}]})),(0,AR.afterMount)(({actions:n})=>{n.loadApps()})]);var DR=["app.ts","app.js","app.tsx","app.jsx"],$Le=Object.keys(Woe);function K6(n){return!!n&&n.startsWith("repo/")}function cw(n){return!!n&&$Le.includes(n)}function NR(n){return!!n&&DR.some(e=>!!n[e])}function Y6(n){return!!(n?.["app.nim"]||n?.["config.nim"])}function Xv(n){return Y6(n)&&!NR(n)}function Voe(n){return Object.values(n.apps??{}).some(e=>Xv(e.sources))?!0:(n.nodes??[]).some(e=>{if(e.type==="app"){let t=e.data;return Xv(t?.sources)||Xv(n.apps?.[t?.keyword??""]?.sources)}if(e.type==="code"){let t=e.data;return!!t?.code?.trim()&&!t?.codeJS?.trim()}return e.type==="source"})}function yit(n){if(!n?.["config.json"])return{};try{let e=JSON.parse(n["config.json"]);return typeof e=="object"&&e?e:{}}catch{return{}}}function _it(n){return Object.fromEntries(Object.entries(n).filter(([,e])=>e!==void 0))}function $1(n){return n?.origin??n?.source}function uXt(n){return!!n&&Object.keys(n).length>0}function wit(n){if(!n)return;if(G6[n])return n;if(!K6(n))return;let e=n.split("/").filter(Boolean),t=e[e.length-1],r=t?`repo/apps/code/${t}`:void 0;return r&&G6[r]?r:void 0}function hXt(n){let e=wit(n),t=e?G6[e]:void 0;return t?{...t}:void 0}function X6(n,e){let{source:t,...r}=n,i=$1(n)||e,o=wit(i),s=uXt(n.sources)?n.sources:hXt(i)||n.sources||{};return _it({...r,origin:o||i,sources:s})}function Rh(n){return Object.fromEntries(Object.entries(n??{}).map(([e,t])=>[e,X6(t,e)]))}function Uf(n){let e=yit(n.sources),t=$1(n);return{name:n.name||e.name||t||"Scene app",category:n.category||e.category,description:n.description||e.description,version:n.version||e.version,settings:n.settings||e.settings,apt:n.apt||e.apt,fields:n.fields||e.fields,output:n.output||e.output,cache:n.cache||e.cache,origin:t}}function qLe(n){return Object.fromEntries(Object.entries(Rh(n?.apps)).map(([e,t])=>[e,Uf(t)]))}function xit(n,e){return{...n,...qLe(e)}}function GLe(n){let e=$1(n);if(!e)return null;let t=e.split("/");return t[0]==="repo"&&t[1]==="apps"&&t[2]?t[2]:t[0]==="repo"&&t[1]?t[1]:t[0]==="scene"?"scene":t[0]||null}function Z6(n,e){let t=GLe(n);return`${e?`${e}: `:""}${n.name}${t?` [${t}]`:""}`}async function KLe(n){let e=G6[n]??git[n];if(e)return{...e};let t=await tt(`/api/apps/source?keyword=${encodeURIComponent(n)}`);return t.ok?await t.json():{}}function RR(n,e,t){let r=e.split("/").filter(Boolean),o=(r[r.length-1]||t?.name||"app").replace(/[^a-zA-Z0-9_-]+/g,"-").replace(/(^-|-$)/g,"")||"app";if(!n[o])return o;let s=2,a=`${o}-${s}`;for(;n[a];)s+=1,a=`${o}-${s}`;return a}function Uoe(n,e,t,r){let i=yit(t),o=$1(r)||$1(e)||(K6(n)?n:void 0),{source:s,...a}=r??{};return _it({...a,origin:o,name:i.name||r?.name||e?.name||n,category:i.category||r?.category||e?.category,description:i.description||r?.description||e?.description,version:i.version||r?.version||e?.version,settings:i.settings||r?.settings||e?.settings,apt:i.apt||r?.apt||e?.apt,fields:i.fields||r?.fields||e?.fields,output:i.output||r?.output||e?.output,cache:i.cache||r?.cache||e?.cache,sources:t})}async function joe(n,e,t){if(!K6(e))return{sceneApps:n,keyword:e,app:t??null};let r=await KLe(e),i=RR(n,e,t),o=Uoe(i,t,r,{origin:$1(t)||e});return{sceneApps:{...n,[i]:o},keyword:i,app:Uf(o)}}function $oe(n,e,t,r=!1,i){let o=Rh(t),s=r&&Object.values(o).some(a=>Y6(a.sources));return n?.map(a=>a.id===e?{...a,apps:o,...i?{nodes:i}:{},settings:s&&a.settings?.execution!=="compiled"?{...a.settings,execution:"compiled"}:a.settings}:a)}var qoe={openAI:{title:"OpenAI",tagLabel:"OpenAI API key missing",description:"The OpenAI API key is used within OpenAI apps on frames.",fields:[{label:"API key for frames",secret:!0,path:["openAI","apiKey"]}]},unsplash:{title:"Unsplash",tagLabel:"Unsplash access key missing",fields:[{label:"Access key",secret:!0,path:["unsplash","accessKey"]}]},homeAssistant:{title:"Home Assistant",tagLabel:"Home Assistant access token missing",fields:[{label:"Home assistant URL",path:["homeAssistant","url"]},{label:"Access token (Profile \u2192 Long-Lived Access Tokens)",secret:!0,path:["homeAssistant","accessToken"]}]},immich:{title:"Immich",tagLabel:"Immich API key missing",fields:[{label:"Server URL",path:["immich","url"]},{label:"API key (Account Settings \u2192 API Keys)",secret:!0,path:["immich","apiKey"]}]},github:{title:"GitHub",tagLabel:"GitHub personal access token missing",freeLimitedUsage:!0,fields:[{label:"API key",secret:!0,path:["github","api_key"]}]},frameOS:{title:"FrameOS Gallery",tagLabel:"FrameOS Gallery API key missing",fields:[{label:"API key",secret:!0,path:["frameOS","apiKey"]}]}};function pXt(n,e){if(e){if(n[e])return n[e];if(!e.includes("/")){let t=Object.keys(n).find(r=>r.endsWith(`/${e}`));if(t)return n[t]}}}function q1(n,e){let t=new Set;for(let r of n??[])for(let i of r.nodes??[])if(i.type==="app"){let o=i.data?.keyword,s=o?r.apps?.[o]:void 0,a=s?Uf(s):pXt(e,o);for(let l of a?.settings??[])qoe[l]&&t.add(l)}return Array.from(t)}function fXt(n){return"blob"in n?null:"templateId"in n?{template_id:n.templateId}:"url"in n?{url:n.url}:{source_scene_id:n.sourceSceneId,...n.sourceFrameId!==void 0?{source_frame_id:n.sourceFrameId}:{}}}var Goe=class extends Error{status;constructor(e,t){super(e),this.name="SceneImageError",this.status=t}};async function mXt(n){try{let e=await n.json();if(e?.detail)return String(e.detail)}catch{}return`unexpected status ${n.status}`}async function gXt(n,e,t){let r=fXt(t),i=r?await tt(`/api/frames/${n}/scene_images/${e}/copy`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)}):await tt(`/api/frames/${n}/scene_images/${e}`,{method:"POST",body:t.blob});if(!i.ok)throw new Goe(await mXt(i),i.status);tT.actions.updateEntityImage(`frames/${n}`,`scene_images/${e}`)}function YLe(n,e,t,r){let i=r instanceof Error?r.message:String(r);console.error(`Failed to copy the scene ${t}`,r),$n.actions.startTask({frameId:n,kind:"sceneImage",title:`Copying the scene ${t}`,detail:null,sceneId:e}),$n.actions.taskFailed({frameId:n,kind:"sceneImage",sceneId:e,detail:`${i}. The scene tile stays blank until the frame renders it.`})}async function Koe(n,e,t,r={}){let i=r.label??"preview image";if(!(!e.length||!t)&&!(Hn()&&!("blob"in t)))try{await Promise.all(e.map(o=>gXt(n,o,t)))}catch(o){if(r.ignoreMissingSource&&o instanceof Goe&&o.status===404)return;YLe(n,e[0],i,o)}}var wAe=St($st(),1),qst=90,EQt=90,IQt=120,TQt=64,LQt=56,Gst=50,sat=70,AQt=44,t8=40,gAe=40,bAe=24,DQt=16,Kst=0,Yst=180,vAe=120,NQt=t8,aat=32,RQt=24;var Xst=16,FQt=35,OQt=64,MQt=340,PQt=140,BQt=8,zQt=49,xAe=16,Zst=xAe+12,WQt=50,HQt=38,VQt=30,UQt=39,jQt=67,$Qt=48,qQt=32,Jst=200,SAe=18,GQt=260,KQt=180,Qst=200,lat=340,YQt=2200,XQt=6,ZQt=119,cat=260,yAe=100,JQt=72,QQt=8,een=120,ten=91,ese=7,nen=22,dat=40,sT=4,ren=sat,ien=60,oen=28,CAe=1e3;function Ls(n){return{width:n.width??GQt,height:n.height??KQt}}function tse(n){if(typeof n=="number"&&Number.isFinite(n))return n;if(typeof n=="string"){let e=Number.parseFloat(n);return Number.isFinite(e)?e:null}return null}function sen(n){let e=n.data??{},t=e.codeArgs??[],r=e.codeOutputs??[],i=(e.codeJS??e.code??"").trim(),o=i?i.split(/\r?\n/):[""],s=o.reduce((f,m)=>Math.max(f,m.length),0),a=[...t,...r].reduce((f,m)=>Math.max(f,m.name.length*ese+yAe),Qst),l=t.reduce((f,m)=>f+m.name.length*ese+JQt+QQt,een),c=t.length>XQt?YQt:lat,d=Math.min(c,Math.max(Qst,a,l,s*ese+yAe)),u=Math.max(1,Math.floor((d-yAe/2)/ese)),h=o.reduce((f,m)=>f+Math.max(1,Math.ceil(m.length/u)),0),p=Math.min(cat,Math.max(ZQt,ten+h*nen));return{width:Math.round(d),height:Math.round(p)}}function aen(n){if(n.type!=="code")return n;let e=sen(n),t=tse(n.width)??tse(n.style?.width),r=tse(n.height)??tse(n.style?.height),i=t!==null&&t>lat?Math.max(t,e.width):e.width,o=r!==null&&r>cat?Math.max(r,e.height):e.height,s={...n.style??{},width:i,height:o};return{...n,width:i,height:o,style:s}}function rse(n){return n?n.startsWith("fieldInput/")?n.slice(11):n.startsWith("codeField/")?n.slice(10):n.startsWith("field/")?n.slice(6):null:null}function uat(n){return rse(n)?.replace(/\[.*$/,"")??null}function eat(n){let e=hat(n);return e.length===0?null:e.reduce((t,r,i)=>t+r/CAe**i,0)}function hat(n){let e=rse(n);return e?Array.from(e.matchAll(/\[(\d+)\]/g)).map(t=>Number(t[1])):[]}function len(n){return n.sourceHandle==="next"||n.targetHandle==="prev"||n.type==="appNodeEdge"}function uw(n){if(n.type!=="app")return!1;let e=n.data?.keyword;return typeof e=="string"&&e.startsWith("data/")}function tat(n,e){if(n.type!=="app")return!1;if(e>1)return!0;let t=n.data?.keyword;return typeof t=="string"&&(t.startsWith("data/")||t.startsWith("logic/"))}function cen(n){return n.type==="event"||n.type==="dispatch"||n.type==="source"}function _Ae(n){return n.position.x+Ls(n).width/2}function FR(n){let e=Ls(n);return{left:n.position.x,right:n.position.x+e.width,top:n.position.y,bottom:n.position.y+e.height}}function OR(n,e){return{left:Math.min(n.left,e.left),right:Math.max(n.right,e.right),top:Math.min(n.top,e.top),bottom:Math.max(n.bottom,e.bottom)}}function nat(n,e){return{left:n.left+e.x,right:n.right+e.x,top:n.top+e.y,bottom:n.bottom+e.y}}function rat(n,e){if(n.type==="state")return uw(e)?aat:BQt;if(uw(n)&&uw(e))return zQt;let t=Ls(e);return n.type==="code"&&t.width<=MQt?OQt:FQt}function nse(n,e){let t=Ls(e);return n.type==="state"?uw(e)?SAe:t.height>=Jst?qQt:$Qt:uw(n)&&uw(e)?HQt:n.type==="code"?t.height<=PQt?jQt:t.height>=Jst?VQt:UQt:WQt}function jf(n,e,t){let r=rse(e);if(!r)return Number.MAX_SAFE_INTEGER;let i=t[n]??[],o=uat(e),s=eat(e)??0,a=i.indexOf(r);if(a>=0)return a*CAe+s;let l=o?i.indexOf(o):-1;if(l>=0)return l*CAe+s;let c=eat(e);return c!==null?c:Number.MAX_SAFE_INTEGER}function den(n,e,t){let r=rse(e);if(!r)return null;let i=t[n.id]??[],o=uat(e),s=i.indexOf(r),a=s>=0?s:o?i.indexOf(o):-1;if(a<0)return null;let{width:l}=Ls(n),c=e?.startsWith("codeField/")?dat:AQt,d=Math.max(l-c*2,1),u=Math.max(i.length-1,1);return c+d*a/u}function pat(n,e,t){let{width:r}=Ls(n);return e==="prev"?0:e==="next"?r:n.type==="code"&&e==="fieldOutput"?dat:den(n,e,t)??r/2}function iat(n,e,t){return n.position.x+pat(n,e,t)}function oat(n,e){let t=[...n].sort((r,i)=>r.desiredCenterX-i.desiredCenterX||r.order-i.order||(r.node.type??"").localeCompare(i.node.type??"")||r.node.id.localeCompare(i.node.id)).map(r=>{let{width:i}=Ls(r.node);return{...r,width:i,left:r.desiredCenterX-i/2}});for(let r=1;r<t.length;r+=1){let i=t[r-1],o=t[r];o.left=Math.max(o.left,i.left+i.width+e)}if(t.length>1){let r=Math.min(...t.map(l=>l.desiredCenterX-l.width/2)),i=Math.max(...t.map(l=>l.desiredCenterX+l.width/2)),o=Math.min(...t.map(l=>l.left)),s=Math.max(...t.map(l=>l.left+l.width)),a=(r+i)/2-(o+s)/2;t.forEach(l=>{l.left+=a})}return new Map(t.map(r=>[r.node.id,r.left]))}function uen(n,e){if(!e.has(n))return e.add(n),n;let t=2;for(;e.has(`${n}-${t}`);)t+=1;let r=`${n}-${t}`;return e.add(r),r}function hen(n,e){let t=n.reduce((l,c)=>(l[c.id]=c,l),{}),r=new Set(n.map(l=>l.id)),i=new WeakMap;e.forEach((l,c)=>{i.set(l,c)});let o=e.reduce((l,c)=>{let d=t[c.source],u=t[c.target],h=c.targetHandle?.startsWith("fieldInput/")||c.targetHandle?.startsWith("codeField/");return d?.type!=="state"||!u||u.type!=="app"&&u.type!=="code"||c.sourceHandle!=="fieldOutput"||!h||(l[c.source]=[...l[c.source]??[],c]),l},{}),s=[],a=new WeakMap;return Object.entries(o).forEach(([l,c])=>{let d=t[l];if(!d)return;let u=c.reduce((p,f)=>(p[f.target]=[...p[f.target]??[],f],p),{}),h=Object.entries(u).sort(([p,f],[m,g])=>(i.get(f[0])??0)-(i.get(g[0])??0)||p.localeCompare(m));h.length<=1||h.slice(1).forEach(([p,f])=>{let m=uen(`${l}__for__${p}`,r),{id:g,selected:b,dragging:v,positionAbsolute:y,..._}=d;s.push({..._,id:m,position:{...d.position},selected:!1,dragging:!1}),f.forEach(x=>{a.set(x,m)})})}),s.length===0?{nodes:n,edges:e}:{nodes:[...n,...s],edges:e.map(l=>{let c=a.get(l);return c?{...l,source:c}:l})}}function ise(n,e,t={}){let r=hen(n,e);return{nodes:pen(r.nodes,r.edges,t),edges:r.edges}}function pen(n,e,t={}){if(!n.length)return n;let r=t.fieldOrderByNodeId??{},i=n.map(aen),o=new Set;e.forEach(le=>{le.sourceHandle==="next"&&o.add(le.source),le.targetHandle==="prev"&&o.add(le.target)});let s=i.filter(le=>cen(le)||le.type==="app"&&!uw(le)&&o.has(le.id)),a=i.reduce((le,ce)=>(le[ce.id]=ce,le),{}),l=new Set(s.map(le=>le.id)),c=e.filter(le=>l.has(le.source)&&l.has(le.target)&&len(le)),d=e.reduce((le,ce)=>(!ce.source||!ce.target||(le[ce.source]=[...le[ce.source]??[],ce]),le),{}),u=e.reduce((le,ce)=>(!ce.source||!ce.target||(le[ce.target]=[...le[ce.target]??[],ce]),le),{}),h=new WeakMap;e.forEach((le,ce)=>{h.set(le,ce)});let p=new Map(s.map((le,ce)=>[le.id,ce])),f=[...c].sort((le,ce)=>(p.get(le.source)??0)-(p.get(ce.source)??0)||jf(le.source,le.sourceHandle,r)-jf(ce.source,ce.sourceHandle,r)||jf(le.target,le.targetHandle,r)-jf(ce.target,ce.targetHandle,r)||le.target.localeCompare(ce.target));if(!s.length)return n;let m=new Map(s.map(le=>[le.id,le.id])),g=le=>{let ce=m.get(le);if(!ce||ce===le)return le;let be=g(ce);return m.set(le,be),be},b=(le,ce)=>{let be=g(le),Ne=g(ce);be!==Ne&&m.set(Ne,be)};f.forEach(le=>{b(le.source,le.target)});let v=le=>l.has(le)?g(le):null,y=new wAe.default.graphlib.Graph({multigraph:!0});y.setGraph({rankdir:"LR",nodesep:qst,ranksep:EQt,edgesep:25}),y.setDefaultEdgeLabel(()=>({})),s.forEach(le=>{let{width:ce,height:be}=Ls(le);y.setNode(le.id,{width:ce,height:be,rank:le.type==="event"||le.type==="source"?"min":void 0})}),f.forEach(le=>{!le.source||!le.target||le.source===le.target||y.setEdge(le.source,le.target)}),wAe.default.layout(y);let _=new Map;s.forEach(le=>{let ce=y.node(le.id);if(!ce)return;let{width:be,height:Ne}=Ls(le);_.set(le.id,{x:ce.x-be/2,y:ce.y-Ne/2})});let x=(le,ce,be=new Set)=>{if(be.has(le))return;be.add(le);let Ne=_.get(le);Ne&&_.set(le,{x:Ne.x+ce.x,y:Ne.y+ce.y}),f.filter(Dt=>Dt.source===le).forEach(Dt=>{x(Dt.target,ce,be)})},S=f.reduce((le,ce)=>(!ce.sourceHandle?.startsWith("field/")||ce.targetHandle!=="prev"||(le[ce.source]=[...le[ce.source]??[],ce]),le),{}),k=new Set(Object.values(S).flatMap(le=>le.length>1?le.map(ce=>ce.target):[])),I=f.reduce((le,ce)=>(le[ce.target]=[...le[ce.target]??[],ce],le),{}),L=new Map,A=(le,ce=new Set)=>{if(L.has(le))return L.get(le)??null;if(!l.has(le))return L.set(le,null),null;if(k.has(le))return L.set(le,le),le;if(ce.has(le))return null;ce.add(le);for(let be of I[le]??[]){let Ne=A(be.source,new Set(ce));if(Ne)return L.set(le,Ne),Ne}return L.set(le,null),null},N=new Map,R=(le,ce=new Set)=>{let be=N.get(le);if(be)return new Set(be);let Ne=new Set;return ce.has(le)||(ce.add(le),l.has(le)&&Ne.add(le),f.filter(Dt=>Dt.source===le).forEach(Dt=>{R(Dt.target,new Set(ce)).forEach(lt=>Ne.add(lt))}),N.set(le,new Set(Ne))),Ne},F=new Map,D=(le,ce=new Set)=>{let be=F.get(le);if(be)return new Set(be);let Ne=new Set;return ce.has(le)||(ce.add(le),l.has(le)?Ne.add(le):(d[le]??[]).forEach(lt=>{D(lt.target,new Set(ce)).forEach(Kt=>Ne.add(Kt))}),F.set(le,new Set(Ne))),Ne},H=(le,ce)=>{if(!ce)return!0;let be=D(le);return be.size===0||[...be].every(Ne=>ce.has(Ne))},j=le=>D(le).size>1,K=(le,ce)=>Array.from((u[le]??[]).filter(be=>be.source&&be.target&&!l.has(be.source)&&H(be.source,ce)&&(be.targetHandle?.startsWith("fieldInput/")||be.targetHandle?.startsWith("codeField/"))).sort((be,Ne)=>jf(le,be.targetHandle,r)-jf(le,Ne.targetHandle,r)||(h.get(be)??0)-(h.get(Ne)??0)||be.source.localeCompare(Ne.source)).reduce((be,Ne)=>(be.has(Ne.source)||be.set(Ne.source,Ne),be),new Map).values()),de=(le,ce=new Set,be)=>{let Ne=a[le];if(!Ne)return{left:0,right:0,top:0,bottom:0};let Dt=Ls(Ne),lt={left:0,right:Dt.width,top:0,bottom:Dt.height};if(ce.has(le))return lt;ce.add(le);let Kt=0,cn=null;return K(le,be).forEach((Zn,zn)=>{let fr=a[Zn.source];if(!fr)return;let Oi=Ls(fr),jr=nse(fr,Ne),bs=rat(fr,Ne),Fa=Kt-(zn===0?jr:0)-Oi.height,Mi=Math.min(-bs-xAe*zn,cn?cn.left-Zst:Number.POSITIVE_INFINITY),Ns=nat(de(fr.id,new Set(ce),be),{x:Mi,y:Fa});lt=OR(lt,Ns),cn=cn?OR(cn,Ns):Ns,Kt=Ns.top-SAe}),lt},V=(le,ce,be=new Set)=>{let Ne=_.get(le);if(!Ne)return de(le,new Set,ce);let Dt=de(le,new Set,ce);return be.has(le)||(be.add(le),f.filter(lt=>lt.source===le).forEach(lt=>{let Kt=_.get(lt.target);Kt&&(Dt=OR(Dt,nat(V(lt.target,ce,new Set(be)),{x:Kt.x-Ne.x,y:Kt.y-Ne.y})))})),Dt};Object.entries(S).forEach(([le,ce])=>{if(ce.length<2)return;let be=s.find(ge=>ge.id===le),Ne=_.get(le);if(!be||!Ne)return;let Dt=new Set,lt=ce.map((ge,Nt)=>({edge:ge,index:Nt,pathIndexes:hat(ge.sourceHandle)})),Kt=lt.every(({pathIndexes:ge})=>ge.length>=2),cn=Kt?Array.from(new Set(lt.map(({pathIndexes:ge})=>ge[0]))).sort((ge,Nt)=>ge-Nt):[],Zn=Kt?Array.from(new Set(lt.map(({pathIndexes:ge})=>ge[1]))).sort((ge,Nt)=>ge-Nt):[],zn=Kt&<.length>3&&(cn.length===1||Zn.length===1),fr=Kt&&!zn,Oi=Math.max(1,Math.ceil(Math.sqrt(lt.length))),jr=lt.map(({edge:ge,index:Nt,pathIndexes:Jt})=>{let pi=a[ge.target],Ks=_.get(ge.target);if(!pi||!Ks)return null;let jc=fr?cn.indexOf(Jt[0]):Math.floor(Nt/Oi),ts=fr?Zn.indexOf(Jt[1]):Nt%Oi,Il=V(ge.target,R(ge.target));return{edge:ge,targetPosition:Ks,row:jc,column:ts,footprint:Il,footprintWidth:Il.right-Il.left,footprintHeight:Il.bottom-Il.top}}).filter(ge=>ge!==null&&ge.row>=0&&ge.column>=0);if(jr.length===0)return;let bs=Math.max(...jr.map(ge=>ge.column))+1,Fa=Math.max(...jr.map(ge=>ge.row))+1,Mi=Array.from({length:bs},()=>0),Ns=Array.from({length:Fa},()=>0);jr.forEach(ge=>{Mi[ge.column]=Math.max(Mi[ge.column],ge.footprintWidth),Ns[ge.row]=Math.max(Ns[ge.row],ge.footprintHeight)});let Gs=fr?IQt:TQt,Oa=fr?qst:LQt,Jb=Mi.reduce((ge,Nt,Jt)=>{let pi=Jt===0?0:ge[Jt-1]+Mi[Jt-1]+Gs;return ge.push(pi),ge},[]),Qb=Ns.reduce((ge,Nt,Jt)=>{let pi=Jt===0?0:ge[Jt-1]+Ns[Jt-1]+Oa;return ge.push(pi),ge},[]),Yp=Ns.reduce((ge,Nt)=>ge+Nt,0)+Math.max(0,Fa-1)*Oa,e0=Ls(be),WC=Ne.x+e0.width+Gs,tr=Ne.y+e0.height/2-Yp/2;jr.forEach(ge=>{let Nt=WC+Jb[ge.column]+(Mi[ge.column]-ge.footprintWidth)/2,Jt=tr+Qb[ge.row]+(Ns[ge.row]-ge.footprintHeight)/2,pi={x:Nt-ge.footprint.left,y:Jt-ge.footprint.top};x(ge.edge.target,{x:pi.x-ge.targetPosition.x,y:pi.y-ge.targetPosition.y},Dt)})});let z=new Map,te=(le,ce=new Set)=>{if(z.has(le))return z.get(le)??null;if(l.has(le))return z.set(le,le),le;if(ce.has(le))return null;ce.add(le);for(let be of d[le]??[]){let Ne=te(be.target,ce);if(Ne)return z.set(le,Ne),Ne}for(let be of u[le]??[]){let Ne=te(be.source,ce);if(Ne)return z.set(le,Ne),Ne}return z.set(le,null),null},oe=new Map,U=(le,ce,be=new Set)=>{let Ne=`${le}:${ce}`;if(oe.has(Ne))return oe.get(Ne)??0;if(le===ce)return oe.set(Ne,0),0;if(be.has(le))return 0;be.add(le);let Dt=0;for(let lt of d[le]??[]){let Kt=U(lt.target,ce,be);(Kt>0||lt.target===ce)&&(Dt=Math.max(Dt,Kt+1))}return oe.set(Ne,Dt),Dt},me=i.filter(le=>!l.has(le.id)).reduce((le,ce)=>{let be=te(ce.id);return be&&(le[be]=[...le[be]??[],ce]),le},{}),Be=i.map(le=>{let ce=_.get(le.id);return ce?{...le,position:{...ce}}:le}).reduce((le,ce)=>(le[ce.id]=ce,le),{}),ft=(()=>{let le=e.reduce((be,Ne)=>{if(!Ne.source||!Ne.target||!Ne.targetHandle?.startsWith("fieldInput/"))return be;let Dt=a[Ne.source],lt=a[Ne.target];return Dt?.type!=="state"||lt?.type!=="app"||(be[Ne.target]=[...be[Ne.target]??[],Ne]),be},{}),ce=new Map;return Object.entries(le).forEach(([be,Ne])=>{let Dt=a[be],lt=new Set(Ne.map(Kt=>Kt.source));!Dt||!tat(Dt,lt.size)||lt.forEach(Kt=>{ce.set(Kt,be)})}),ce})(),kt=new Map,Ue=(le,ce)=>{let be=kt.get(ce);return be?le===ce?0:be.get(le)??1:le===ce?0:1},Re=(le,ce,be)=>{let Ne=[],Dt=(lt,Kt,cn,Zn)=>{let zn=Be[Kt]??a[Kt];if(!zn)return;let fr=Ue(Kt,ce),Oi=fr===be-1?0:fr<be?1:2;if(Oi>1)return;let{width:jr}=Ls(le);Ne.push({centerX:iat(zn,cn,r)-pat(le,Zn,r)+jr/2,order:jf(Kt,cn,r),priority:Oi})};for(let lt of d[le.id]??[])Dt(lt,lt.target,lt.targetHandle,lt.sourceHandle);for(let lt of u[le.id]??[])Dt(lt,lt.source,lt.sourceHandle,lt.targetHandle);if(Ne.length===0){let lt=Be[ce]??a[ce];return{centerX:_Ae(lt||le),order:Number.MAX_SAFE_INTEGER}}return Ne.sort((lt,Kt)=>lt.priority-Kt.priority||lt.order-Kt.order||lt.centerX-Kt.centerX),{centerX:Ne[0].centerX,order:Ne[0].order}};Object.entries(me).forEach(([le,ce])=>{let be=Be[le]??a[le];if(!be)return;let Ne=new Map;ce.forEach(Kt=>{Ne.set(Kt.id,Math.max(1,U(Kt.id,le)))}),kt.set(le,Ne);let Dt=Math.max(...Ne.values(),1),lt=be.position.y-Gst;for(let Kt=1;Kt<=Dt;Kt+=1){let cn=ce.filter(jr=>Ne.get(jr.id)===Kt&&!ft.has(jr.id));if(cn.length===0)continue;let Zn=Math.max(...cn.map(jr=>Ls(jr).height)),zn=lt-Zn,fr=cn.map(jr=>{let bs=Re(jr,le,Kt);return{node:jr,desiredCenterX:bs.centerX,order:bs.order}}),Oi=oat(fr,sat);cn.forEach(jr=>{let bs=Ls(jr);Be[jr.id]={...jr,position:{x:Oi.get(jr.id)??_Ae(be)-bs.width/2,y:zn+Zn-bs.height}}}),lt=zn-Gst}});let rn=(le,ce,be,Ne)=>{let Dt=Ls(le),lt=Ls(ce);return le.position.x<ce.position.x+lt.width+be&&le.position.x+Dt.width+be>ce.position.x&&le.position.y<ce.position.y+lt.height+Ne&&le.position.y+Dt.height+Ne>ce.position.y},Ge=(le,ce)=>{Be[le.id]={...le,position:ce}},Lt=(le,ce)=>{le.forEach(be=>{let Ne=Be[be]??a[be];Ne&&Ge(Ne,{x:Ne.position.x+ce.x,y:Ne.position.y+ce.y})})},Pt=new Map,On=le=>!!(le.source&&le.target&&!l.has(le.source)&&(le.targetHandle?.startsWith("fieldInput/")||le.targetHandle?.startsWith("codeField/"))),Wt=e.reduce((le,ce)=>(On(ce)&&(le[ce.target]=[...le[ce.target]??[],ce]),le),{}),Et=(le,ce)=>Array.from((Wt[le]??[]).filter(be=>H(be.source,ce)).sort((be,Ne)=>jf(le,be.targetHandle,r)-jf(le,Ne.targetHandle,r)||(h.get(be)??0)-(h.get(Ne)??0)||be.source.localeCompare(Ne.source)).reduce((be,Ne)=>(be.has(Ne.source)||be.set(Ne.source,Ne),be),new Map).values()),Ae=(le,ce)=>{let be=le.position.y;return ce.forEach((Ne,Dt)=>{let lt=Be[Ne.source]??a[Ne.source];if(!lt)return;let Kt=Ls(lt),cn=Dt===0?nse(lt,le):0;be=be-cn-Kt.height-Xst}),be},ke=(le,ce=new Set,be)=>{let Ne=Be[le]??a[le];if(!Ne)return null;let Dt=FR(Ne);return ce.has(le)||(ce.add(le),Et(le,be).forEach(lt=>{let Kt=Be[lt.source]??a[lt.source];if(!Kt||l.has(Kt.id))return;let cn=ke(Kt.id,new Set(ce),be);cn&&(Dt=OR(Dt,cn))})),Dt},Te=(le,ce=new Set,be)=>{if(ce.has(le))return;ce.add(le);let Ne=Be[le]??a[le];if(!Ne)return;let Dt=Et(le,be),lt=Dt.filter(zn=>ft.get(zn.source)===le),Kt=Dt.filter(zn=>{let fr=Be[zn.source]??a[zn.source];return fr&&!l.has(fr.id)&&ft.get(fr.id)!==le});if(Ne.type==="code"&&Kt.length>sT)return;let cn=lt.length>0?Ae(Ne,lt):Ne.position.y,Zn=null;Kt.forEach((zn,fr)=>{let Oi=Be[zn.source]??a[zn.source];if(!Oi)return;let jr=Ls(Oi),bs=nse(Oi,Ne),Fa=rat(Oi,Ne),Mi=cn-(fr===0?bs:0)-jr.height,Ns=Math.min(Ne.position.x-Fa-xAe*fr,Zn?Zn.left-Zst:Number.POSITIVE_INFINITY);Ge(Oi,{x:Ns,y:Mi}),Te(Oi.id,new Set(ce),be);let Gs=ke(Oi.id,new Set(ce),be);Gs&&(Zn=Zn?OR(Zn,Gs):Gs),cn=(Gs?.top??Mi)-SAe})},Q=()=>{s.map(le=>Be[le.id]??le).sort((le,ce)=>le.position.x-ce.position.x||le.position.y-ce.position.y||(p.get(le.id)??0)-(p.get(ce.id)??0)||le.id.localeCompare(ce.id)).forEach(le=>{Te(le.id,new Set,R(le.id))})},se=()=>{let le=new Map;return s.forEach(ce=>{let be=A(ce.id)??ce.id,Ne=le.get(be)??new Set;Ne.add(ce.id),le.set(be,Ne)}),i.forEach(ce=>{if(l.has(ce.id)||j(ce.id))return;let be=te(ce.id);if(!be||!l.has(be))return;let Ne=A(be)??be,Dt=le.get(Ne)??new Set;Dt.add(ce.id),le.set(Ne,Dt)}),le},ve=(le,ce)=>le.top<ce.bottom+Kst&&le.bottom+Kst>ce.top,X=(le,ce)=>{let be=0;return le.forEach(Ne=>{let Dt=Be[Ne]??a[Ne];if(!Dt)return;let lt=FR(Dt);ce.forEach(Kt=>{let cn=Be[Kt]??a[Kt];if(!cn)return;let Zn=FR(cn);!(lt.left<Zn.right&<.right>Zn.left)||!ve(lt,Zn)||(be=Math.max(be,Zn.right+DQt-lt.left))})}),be},fe=le=>Array.from(le).map(ce=>Be[ce]??a[ce]).filter(ce=>!!ce).map(FR).reduce((ce,be)=>ce?OR(ce,be):be,null),ze=le=>Math.min(...Array.from(le).map(ce=>p.get(ce)??Number.MAX_SAFE_INTEGER)),dt=le=>{let ce=Array.from(le).find(be=>l.has(be));return ce?v(ce):null},Tt=()=>{let le=se(),ce=[];Array.from(le.values()).sort((be,Ne)=>{let Dt=fe(be),lt=fe(Ne);return(Dt?.left??0)-(lt?.left??0)||(Dt?.top??0)-(lt?.top??0)||ze(be)-ze(Ne)}).forEach(be=>{let Ne=dt(be);for(let Dt=0;Dt<bAe;Dt+=1){let lt=ce.filter(Kt=>Kt.componentId===Ne).reduce((Kt,cn)=>Math.max(Kt,X(be,cn.nodeIds)),0);if(lt<=0)break;Lt(be,{x:lt,y:0})}ce.push({nodeIds:be,componentId:Ne})})},qt=()=>{let le=new Map;return s.forEach(ce=>{let be=v(ce.id);if(!be)return;let Ne=le.get(be)??new Set;Ne.add(ce.id),le.set(be,Ne)}),i.forEach(ce=>{if(l.has(ce.id))return;let be=te(ce.id),Ne=be?v(be):null;if(!Ne)return;let Dt=le.get(Ne)??new Set;Dt.add(ce.id),le.set(Ne,Dt)}),le},nn=(le,ce)=>{let be=0;return le.forEach(Ne=>{let Dt=Be[Ne]??a[Ne];if(!Dt)return;let lt=FR(Dt);ce.forEach(Kt=>{let cn=Be[Kt]??a[Kt];if(!cn)return;let Zn=FR(cn),zn=lt.left<Zn.right+Yst&<.right+Yst>Zn.left,fr=lt.top<Zn.bottom+vAe&<.bottom+vAe>Zn.top;!zn||!fr||(be=Math.max(be,Zn.bottom+vAe-lt.top))})}),be},ir=()=>{let le=Array.from(qt().values()).sort((be,Ne)=>{let Dt=fe(be),lt=fe(Ne);return(Dt?.top??0)-(lt?.top??0)||(Dt?.left??0)-(lt?.left??0)||ze(be)-ze(Ne)}),ce=[];le.forEach(be=>{for(let Ne=0;Ne<bAe;Ne+=1){let Dt=ce.reduce((lt,Kt)=>Math.max(lt,nn(be,Kt.nodeIds)),0);if(Dt<=0)break;Lt(be,{x:0,y:Dt})}ce.push({nodeIds:be})})},sr=()=>{let le=e.reduce((ce,be)=>{if(!be.source||!be.target||!be.targetHandle?.startsWith("codeField/"))return ce;let Ne=Be[be.source]??a[be.source],Dt=Be[be.target]??a[be.target];return!Ne||Dt?.type!=="code"||l.has(Ne.id)||(ce[be.target]=[...ce[be.target]??[],be]),ce},{});Object.entries(le).forEach(([ce,be])=>{if(be.length<=sT)return;let Ne=Be[ce]??a[ce];if(!Ne)return;let Dt=Array.from(be.sort((zn,fr)=>jf(ce,zn.targetHandle,r)-jf(ce,fr.targetHandle,r)||(h.get(zn)??0)-(h.get(fr)??0)||zn.source.localeCompare(fr.source)).reduce((zn,fr)=>(zn.has(fr.source)||zn.set(fr.source,fr),zn),new Map).values()),lt=Dt.filter(zn=>(Be[zn.source]??a[zn.source])?.type==="state"),Kt=Dt.filter(zn=>(Be[zn.source]??a[zn.source])?.type!=="state"),cn=[];for(let zn=0;zn<lt.length;zn+=sT)cn.push(lt.slice(zn,zn+sT));for(let zn=0;zn<Kt.length;zn+=sT)cn.push(Kt.slice(zn,zn+sT));let Zn=Ne.position.y-ien;for(let[zn,fr]of cn.entries()){let Oi=fr.map((Mi,Ns)=>{let Gs=Be[Mi.source]??a[Mi.source];return Gs?{node:Gs,desiredCenterX:iat(Ne,Mi.targetHandle,r),order:zn*sT+Ns}:null}).filter(Mi=>Mi!==null);if(Oi.length===0)continue;let jr=Math.max(...Oi.map(Mi=>Ls(Mi.node).height)),bs=Zn-jr,Fa=oat(Oi,ren);Oi.forEach(Mi=>{let Ns=Ls(Mi.node);Ge(Mi.node,{x:Fa.get(Mi.node.id)??Mi.desiredCenterX-Ns.width/2,y:bs+jr-Ns.height})}),Zn=bs-oen}})},Zt=()=>{e.filter(ce=>{let be=Be[ce.source]??a[ce.source],Ne=Be[ce.target]??a[ce.target];return be&&Ne&&uw(be)&&Ne.type==="app"&&!uw(Ne)&&D(be.id).size===0&&!l.has(be.id)&&!l.has(Ne.id)&&ce.sourceHandle==="fieldOutput"&&!!ce.targetHandle?.startsWith("fieldInput/")}).sort((ce,be)=>{let Ne=te(ce.source),Dt=te(be.source),lt=Ne?Ue(ce.source,Ne):0,Kt=Dt?Ue(be.source,Dt):0;return lt-Kt||ce.source.localeCompare(be.source)}).forEach(ce=>{let be=Be[ce.source]??a[ce.source],Ne=Be[ce.target]??a[ce.target];if(!be||!Ne)return;let Dt=Ls(be),lt=Ls(Ne);Ge(be,{x:Ne.position.x-Dt.width-NQt,y:Ne.position.y+(lt.height-Dt.height)/2})})},er=()=>{Pt.clear();let le=e.reduce((ce,be)=>{if(!be.source||!be.target||!be.targetHandle?.startsWith("fieldInput/"))return ce;let Ne=Be[be.source]??a[be.source],Dt=Be[be.target]??a[be.target];return Ne?.type!=="state"||Dt?.type!=="app"||(ce[be.target]=[...ce[be.target]??[],be]),ce},{});Object.entries(le).forEach(([ce,be])=>{let Ne=Be[ce]??a[ce];if(!Ne)return;let lt=Array.from(be.sort((cn,Zn)=>jf(ce,cn.targetHandle,r)-jf(ce,Zn.targetHandle,r)||(h.get(cn)??0)-(h.get(Zn)??0)||cn.source.localeCompare(Zn.source)).reduce((cn,Zn)=>(cn.has(Zn.source)||cn.set(Zn.source,Zn),cn),new Map).values()).map(cn=>Be[cn.source]??a[cn.source]).filter(cn=>!!cn);if(lt.length===0||!tat(Ne,lt.length))return;let Kt=Ne.position.y;lt.forEach((cn,Zn)=>{let zn=Ls(cn),fr=Zn===0?nse(cn,Ne):0,Oi=Kt-fr-zn.height;Pt.set(cn.id,ce),Ge(cn,{x:Ne.position.x-aat-RQt*Zn,y:Oi}),Kt=Oi-Xst})})},Er=()=>{let le=i.map(be=>be.id).filter(be=>l.has(be)).sort((be,Ne)=>{let Dt=Be[be]??a[be],lt=Be[Ne]??a[Ne];return Dt.position.y-lt.position.y||Dt.position.x-lt.position.x||be.localeCompare(Ne)}),ce=i.map(be=>be.id).filter(be=>!l.has(be)).sort((be,Ne)=>{let Dt=Be[be]??a[be],lt=Be[Ne]??a[Ne];return Dt.position.y-lt.position.y||Dt.position.x-lt.position.x||be.localeCompare(Ne)});for(let be=0;be<bAe;be+=1){let Ne=!1;for(let Dt of ce){let lt=Be[Dt]??a[Dt],Kt=Ls(lt);for(let cn of le){let Zn=Be[cn]??a[cn],zn=Pt.has(lt.id),fr=Pt.get(lt.id)===cn;if(!rn(lt,Zn,zn&&!fr?0:t8,zn&&!fr?0:gAe))continue;let bs=Zn.position.y-Kt.height-gAe;bs<lt.position.y&&(Ge(lt,{x:lt.position.x,y:bs}),Ne=!0)}}for(let Dt=0;Dt<ce.length;Dt+=1)for(let lt=Dt+1;lt<ce.length;lt+=1){let Kt=Be[ce[Dt]]??a[ce[Dt]],cn=Be[ce[lt]]??a[ce[lt]],Zn=Pt.get(Kt.id),zn=Pt.get(cn.id),fr=Zn&&Zn===zn,Oi=Zn===cn.id||zn===Kt.id,jr=fr||Oi;if(!rn(Kt,cn,jr?0:t8,jr?0:gAe))continue;let Mi=Pt.has(Kt.id),Ns=Pt.has(cn.id),[Gs,Oa]=Mi!==Ns?Mi?[Kt,cn]:[cn,Kt]:Kt.position.x<=cn.position.x?[Kt,cn]:[cn,Kt],Jb=Ls(Gs),Qb=Ls(Oa),Yp=Oa.position.x<Gs.position.x?Gs.position.x-Qb.width-t8:Gs.position.x+Jb.width+t8;Ge(Oa,{x:Yp,y:Oa.position.y}),Ne=!0}if(!Ne)break}};return Zt(),sr(),er(),Er(),Zt(),sr(),er(),Er(),sr(),er(),Q(),Zt(),er(),sr(),Tt(),ir(),i.map(le=>Be[le.id]??le)}function ose(n){let e=new Uint8Array(n);if(window.crypto&&window.crypto.getRandomValues)window.crypto.getRandomValues(e);else for(let i=0;i<e.length;i++)e[i]=Math.floor(Math.random()*256);let t=Array.from(e);return btoa(String.fromCharCode.apply(null,t)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}var Bh=St(Lct(),1);function Act(n){return[{name:"commonName",value:n}]}function Jrn(n){let e=n.split(".");return e.length===4&&e.every(t=>/^\d+$/.test(t)&&Number(t)>=0&&Number(t)<=255)}function Qrn(n){return Jrn(n)||n.includes(":")&&/^[0-9a-fA-F:.]+$/.test(n)}function ein(n){let e=[{type:2,value:"localhost"},{type:7,ip:"127.0.0.1"}];return n&&e.push(Qrn(n)?{type:7,ip:n}:{type:2,value:n}),[{name:"subjectAltName",altNames:e}]}function Dct(){return`01${Bh.util.bytesToHex(Bh.random.getBytesSync(15))}`}function Nct(n,e){return new Date(n.getTime()+e*24*60*60*1e3)}function Rct(n){return n.toISOString().replace("Z","+00:00")}function Fct(n){let e=n.trim(),t=new Date,r=new Date(t.getTime()-300*1e3),i=Bh.pki.rsa.generateKeyPair({bits:2048,e:65537}),o=Bh.pki.createCertificate();o.publicKey=i.publicKey,o.serialNumber=Dct(),o.validity.notBefore=r,o.validity.notAfter=Nct(t,3650);let s=Act(`FrameOS Frame CA (${e||"frame"})`);o.setSubject(s),o.setIssuer(s),o.setExtensions([{name:"basicConstraints",cA:!0,critical:!0},{name:"keyUsage",digitalSignature:!0,keyCertSign:!0,cRLSign:!0,critical:!0}]),o.sign(i.privateKey,Bh.md.sha256.create());let a=Bh.pki.rsa.generateKeyPair({bits:2048,e:65537}),l=Bh.pki.createCertificate();return l.publicKey=a.publicKey,l.serialNumber=Dct(),l.validity.notBefore=r,l.validity.notAfter=Nct(t,825),l.setSubject(Act(e||"frame.local")),l.setIssuer(o.subject.attributes),l.setExtensions([...ein(e),{name:"basicConstraints",cA:!1,critical:!0},{name:"extKeyUsage",serverAuth:!0},{name:"keyUsage",digitalSignature:!0,keyEncipherment:!0,critical:!0}]),l.sign(i.privateKey,Bh.md.sha256.create()),{certs:{server:Bh.pki.certificateToPem(l),server_key:Bh.pki.privateKeyToPem(a.privateKey),client_ca:Bh.pki.certificateToPem(o)},server_cert_not_valid_after:Rct(l.validity.notAfter),client_ca_cert_not_valid_after:Rct(o.validity.notAfter)}}function tin(n,e){return(n.name||n.id).localeCompare(e.name||e.id,void 0,{numeric:!0,sensitivity:"base"})||String(n.id).localeCompare(String(e.id))}function Oct(n){return[...n].toSorted(tin)}var ZR={frameos:"2026.9.3+9a032fcb607dcc2ec67e22fab380217bd4557186",editor:"2026.9.3+4004e50d0c6a63b0b732f0f8d6e55c6b20b6ae3d",remote:"2026.9.3+a22d2f4dbdb936e9de7dd9f32559dba15fdbc1ad",docker:"2026.9.3+c12667acee0ef57360baef28f746d588b6bbabc1"};var Hdi=[{value:"",label:"Prefer binaries, build from source if needed"},{value:"precompiled",label:`Install precompiled binaries (version ${ZR.frameos.split("+")[0]})`},{value:"static",label:"Build from source - single binary (legacy: needs a build environment)"}];function zse(n){return n==="shared"||n==="shared-scenes"?"static":n==="static"||n==="precompiled"?n:"precompiled"}function v8(n){return n==="embedded"}function Ed(n,e){return v8(e)?"interpreted":n?.settings?.execution??"interpreted"}function y8(n,e){return Ed(n,e)!=="interpreted"}function Mct(n){let e=n?.settings?.execution;return e==="compiled"||e==="interpreted"?e:"interpreted"}var I2e="https://scenes.frameos.net/nim-converter",Pct="Preview runs the interpreter: this scene's Nim code nodes and Nim apps are not executed here. Convert the scene to JavaScript to see it whole.",rin=`This makes the scene compiled (legacy): it will need a full FrameOS source build on every deploy.
|
|
12539
|
+
`}};var Hoe={code:"Code",render:"Render",logic:"Logic",data:"Data"};function bit(n){return{...mit,...n,...Woe}}var $u=(0,AR.kea)([(0,AR.path)(["src","models","appsModel"]),(0,vit.loaders)(({values:n})=>({apps:[{},{loadApps:async()=>{try{let e=await tt("/api/apps");if(!e.ok)throw new Error("Failed to fetch apps");let t=await e.json();return bit(t.apps)}catch(e){return sw(e),bit(n.apps)}}}]})),(0,AR.afterMount)(({actions:n})=>{n.loadApps()})]);var DR=["app.ts","app.js","app.tsx","app.jsx"],$Le=Object.keys(Woe);function K6(n){return!!n&&n.startsWith("repo/")}function cw(n){return!!n&&$Le.includes(n)}function NR(n){return!!n&&DR.some(e=>!!n[e])}function Y6(n){return!!(n?.["app.nim"]||n?.["config.nim"])}function Xv(n){return Y6(n)&&!NR(n)}function Voe(n){return Object.values(n.apps??{}).some(e=>Xv(e.sources))?!0:(n.nodes??[]).some(e=>{if(e.type==="app"){let t=e.data;return Xv(t?.sources)||Xv(n.apps?.[t?.keyword??""]?.sources)}if(e.type==="code"){let t=e.data;return!!t?.code?.trim()&&!t?.codeJS?.trim()}return e.type==="source"})}function yit(n){if(!n?.["config.json"])return{};try{let e=JSON.parse(n["config.json"]);return typeof e=="object"&&e?e:{}}catch{return{}}}function _it(n){return Object.fromEntries(Object.entries(n).filter(([,e])=>e!==void 0))}function $1(n){return n?.origin??n?.source}function uXt(n){return!!n&&Object.keys(n).length>0}function wit(n){if(!n)return;if(G6[n])return n;if(!K6(n))return;let e=n.split("/").filter(Boolean),t=e[e.length-1],r=t?`repo/apps/code/${t}`:void 0;return r&&G6[r]?r:void 0}function hXt(n){let e=wit(n),t=e?G6[e]:void 0;return t?{...t}:void 0}function X6(n,e){let{source:t,...r}=n,i=$1(n)||e,o=wit(i),s=uXt(n.sources)?n.sources:hXt(i)||n.sources||{};return _it({...r,origin:o||i,sources:s})}function Rh(n){return Object.fromEntries(Object.entries(n??{}).map(([e,t])=>[e,X6(t,e)]))}function Uf(n){let e=yit(n.sources),t=$1(n);return{name:n.name||e.name||t||"Scene app",category:n.category||e.category,description:n.description||e.description,version:n.version||e.version,settings:n.settings||e.settings,apt:n.apt||e.apt,fields:n.fields||e.fields,output:n.output||e.output,cache:n.cache||e.cache,origin:t}}function qLe(n){return Object.fromEntries(Object.entries(Rh(n?.apps)).map(([e,t])=>[e,Uf(t)]))}function xit(n,e){return{...n,...qLe(e)}}function GLe(n){let e=$1(n);if(!e)return null;let t=e.split("/");return t[0]==="repo"&&t[1]==="apps"&&t[2]?t[2]:t[0]==="repo"&&t[1]?t[1]:t[0]==="scene"?"scene":t[0]||null}function Z6(n,e){let t=GLe(n);return`${e?`${e}: `:""}${n.name}${t?` [${t}]`:""}`}async function KLe(n){let e=G6[n]??git[n];if(e)return{...e};let t=await tt(`/api/apps/source?keyword=${encodeURIComponent(n)}`);return t.ok?await t.json():{}}function RR(n,e,t){let r=e.split("/").filter(Boolean),o=(r[r.length-1]||t?.name||"app").replace(/[^a-zA-Z0-9_-]+/g,"-").replace(/(^-|-$)/g,"")||"app";if(!n[o])return o;let s=2,a=`${o}-${s}`;for(;n[a];)s+=1,a=`${o}-${s}`;return a}function Uoe(n,e,t,r){let i=yit(t),o=$1(r)||$1(e)||(K6(n)?n:void 0),{source:s,...a}=r??{};return _it({...a,origin:o,name:i.name||r?.name||e?.name||n,category:i.category||r?.category||e?.category,description:i.description||r?.description||e?.description,version:i.version||r?.version||e?.version,settings:i.settings||r?.settings||e?.settings,apt:i.apt||r?.apt||e?.apt,fields:i.fields||r?.fields||e?.fields,output:i.output||r?.output||e?.output,cache:i.cache||r?.cache||e?.cache,sources:t})}async function joe(n,e,t){if(!K6(e))return{sceneApps:n,keyword:e,app:t??null};let r=await KLe(e),i=RR(n,e,t),o=Uoe(i,t,r,{origin:$1(t)||e});return{sceneApps:{...n,[i]:o},keyword:i,app:Uf(o)}}function $oe(n,e,t,r=!1,i){let o=Rh(t),s=r&&Object.values(o).some(a=>Y6(a.sources));return n?.map(a=>a.id===e?{...a,apps:o,...i?{nodes:i}:{},settings:s&&a.settings?.execution!=="compiled"?{...a.settings,execution:"compiled"}:a.settings}:a)}var qoe={openAI:{title:"OpenAI",tagLabel:"OpenAI API key missing",description:"The OpenAI API key is used within OpenAI apps on frames.",fields:[{label:"API key for frames",secret:!0,path:["openAI","apiKey"]}]},unsplash:{title:"Unsplash",tagLabel:"Unsplash access key missing",fields:[{label:"Access key",secret:!0,path:["unsplash","accessKey"]}]},homeAssistant:{title:"Home Assistant",tagLabel:"Home Assistant access token missing",fields:[{label:"Home assistant URL",path:["homeAssistant","url"]},{label:"Access token (Profile \u2192 Long-Lived Access Tokens)",secret:!0,path:["homeAssistant","accessToken"]}]},immich:{title:"Immich",tagLabel:"Immich API key missing",fields:[{label:"Server URL",path:["immich","url"]},{label:"API key (Account Settings \u2192 API Keys)",secret:!0,path:["immich","apiKey"]}]},github:{title:"GitHub",tagLabel:"GitHub personal access token missing",freeLimitedUsage:!0,fields:[{label:"API key",secret:!0,path:["github","api_key"]}]},frameOS:{title:"FrameOS Gallery",tagLabel:"FrameOS Gallery API key missing",fields:[{label:"API key",secret:!0,path:["frameOS","apiKey"]}]}};function pXt(n,e){if(e){if(n[e])return n[e];if(!e.includes("/")){let t=Object.keys(n).find(r=>r.endsWith(`/${e}`));if(t)return n[t]}}}function q1(n,e){let t=new Set;for(let r of n??[])for(let i of r.nodes??[])if(i.type==="app"){let o=i.data?.keyword,s=o?r.apps?.[o]:void 0,a=s?Uf(s):pXt(e,o);for(let l of a?.settings??[])qoe[l]&&t.add(l)}return Array.from(t)}function fXt(n){return"blob"in n?null:"templateId"in n?{template_id:n.templateId}:"url"in n?{url:n.url}:{source_scene_id:n.sourceSceneId,...n.sourceFrameId!==void 0?{source_frame_id:n.sourceFrameId}:{}}}var Goe=class extends Error{status;constructor(e,t){super(e),this.name="SceneImageError",this.status=t}};async function mXt(n){try{let e=await n.json();if(e?.detail)return String(e.detail)}catch{}return`unexpected status ${n.status}`}async function gXt(n,e,t){let r=fXt(t),i=r?await tt(`/api/frames/${n}/scene_images/${e}/copy`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)}):await tt(`/api/frames/${n}/scene_images/${e}`,{method:"POST",body:t.blob});if(!i.ok)throw new Goe(await mXt(i),i.status);tT.actions.updateEntityImage(`frames/${n}`,`scene_images/${e}`)}function YLe(n,e,t,r){let i=r instanceof Error?r.message:String(r);console.error(`Failed to copy the scene ${t}`,r),$n.actions.startTask({frameId:n,kind:"sceneImage",title:`Copying the scene ${t}`,detail:null,sceneId:e}),$n.actions.taskFailed({frameId:n,kind:"sceneImage",sceneId:e,detail:`${i}. The scene tile stays blank until the frame renders it.`})}async function Koe(n,e,t,r={}){let i=r.label??"preview image";if(!(!e.length||!t)&&!(Hn()&&!("blob"in t)))try{await Promise.all(e.map(o=>gXt(n,o,t)))}catch(o){if(r.ignoreMissingSource&&o instanceof Goe&&o.status===404)return;YLe(n,e[0],i,o)}}var wAe=St($st(),1),qst=90,EQt=90,IQt=120,TQt=64,LQt=56,Gst=50,sat=70,AQt=44,t8=40,gAe=40,bAe=24,DQt=16,Kst=0,Yst=180,vAe=120,NQt=t8,aat=32,RQt=24;var Xst=16,FQt=35,OQt=64,MQt=340,PQt=140,BQt=8,zQt=49,xAe=16,Zst=xAe+12,WQt=50,HQt=38,VQt=30,UQt=39,jQt=67,$Qt=48,qQt=32,Jst=200,SAe=18,GQt=260,KQt=180,Qst=200,lat=340,YQt=2200,XQt=6,ZQt=119,cat=260,yAe=100,JQt=72,QQt=8,een=120,ten=91,ese=7,nen=22,dat=40,sT=4,ren=sat,ien=60,oen=28,CAe=1e3;function Ls(n){return{width:n.width??GQt,height:n.height??KQt}}function tse(n){if(typeof n=="number"&&Number.isFinite(n))return n;if(typeof n=="string"){let e=Number.parseFloat(n);return Number.isFinite(e)?e:null}return null}function sen(n){let e=n.data??{},t=e.codeArgs??[],r=e.codeOutputs??[],i=(e.codeJS??e.code??"").trim(),o=i?i.split(/\r?\n/):[""],s=o.reduce((f,m)=>Math.max(f,m.length),0),a=[...t,...r].reduce((f,m)=>Math.max(f,m.name.length*ese+yAe),Qst),l=t.reduce((f,m)=>f+m.name.length*ese+JQt+QQt,een),c=t.length>XQt?YQt:lat,d=Math.min(c,Math.max(Qst,a,l,s*ese+yAe)),u=Math.max(1,Math.floor((d-yAe/2)/ese)),h=o.reduce((f,m)=>f+Math.max(1,Math.ceil(m.length/u)),0),p=Math.min(cat,Math.max(ZQt,ten+h*nen));return{width:Math.round(d),height:Math.round(p)}}function aen(n){if(n.type!=="code")return n;let e=sen(n),t=tse(n.width)??tse(n.style?.width),r=tse(n.height)??tse(n.style?.height),i=t!==null&&t>lat?Math.max(t,e.width):e.width,o=r!==null&&r>cat?Math.max(r,e.height):e.height,s={...n.style??{},width:i,height:o};return{...n,width:i,height:o,style:s}}function rse(n){return n?n.startsWith("fieldInput/")?n.slice(11):n.startsWith("codeField/")?n.slice(10):n.startsWith("field/")?n.slice(6):null:null}function uat(n){return rse(n)?.replace(/\[.*$/,"")??null}function eat(n){let e=hat(n);return e.length===0?null:e.reduce((t,r,i)=>t+r/CAe**i,0)}function hat(n){let e=rse(n);return e?Array.from(e.matchAll(/\[(\d+)\]/g)).map(t=>Number(t[1])):[]}function len(n){return n.sourceHandle==="next"||n.targetHandle==="prev"||n.type==="appNodeEdge"}function uw(n){if(n.type!=="app")return!1;let e=n.data?.keyword;return typeof e=="string"&&e.startsWith("data/")}function tat(n,e){if(n.type!=="app")return!1;if(e>1)return!0;let t=n.data?.keyword;return typeof t=="string"&&(t.startsWith("data/")||t.startsWith("logic/"))}function cen(n){return n.type==="event"||n.type==="dispatch"||n.type==="source"}function _Ae(n){return n.position.x+Ls(n).width/2}function FR(n){let e=Ls(n);return{left:n.position.x,right:n.position.x+e.width,top:n.position.y,bottom:n.position.y+e.height}}function OR(n,e){return{left:Math.min(n.left,e.left),right:Math.max(n.right,e.right),top:Math.min(n.top,e.top),bottom:Math.max(n.bottom,e.bottom)}}function nat(n,e){return{left:n.left+e.x,right:n.right+e.x,top:n.top+e.y,bottom:n.bottom+e.y}}function rat(n,e){if(n.type==="state")return uw(e)?aat:BQt;if(uw(n)&&uw(e))return zQt;let t=Ls(e);return n.type==="code"&&t.width<=MQt?OQt:FQt}function nse(n,e){let t=Ls(e);return n.type==="state"?uw(e)?SAe:t.height>=Jst?qQt:$Qt:uw(n)&&uw(e)?HQt:n.type==="code"?t.height<=PQt?jQt:t.height>=Jst?VQt:UQt:WQt}function jf(n,e,t){let r=rse(e);if(!r)return Number.MAX_SAFE_INTEGER;let i=t[n]??[],o=uat(e),s=eat(e)??0,a=i.indexOf(r);if(a>=0)return a*CAe+s;let l=o?i.indexOf(o):-1;if(l>=0)return l*CAe+s;let c=eat(e);return c!==null?c:Number.MAX_SAFE_INTEGER}function den(n,e,t){let r=rse(e);if(!r)return null;let i=t[n.id]??[],o=uat(e),s=i.indexOf(r),a=s>=0?s:o?i.indexOf(o):-1;if(a<0)return null;let{width:l}=Ls(n),c=e?.startsWith("codeField/")?dat:AQt,d=Math.max(l-c*2,1),u=Math.max(i.length-1,1);return c+d*a/u}function pat(n,e,t){let{width:r}=Ls(n);return e==="prev"?0:e==="next"?r:n.type==="code"&&e==="fieldOutput"?dat:den(n,e,t)??r/2}function iat(n,e,t){return n.position.x+pat(n,e,t)}function oat(n,e){let t=[...n].sort((r,i)=>r.desiredCenterX-i.desiredCenterX||r.order-i.order||(r.node.type??"").localeCompare(i.node.type??"")||r.node.id.localeCompare(i.node.id)).map(r=>{let{width:i}=Ls(r.node);return{...r,width:i,left:r.desiredCenterX-i/2}});for(let r=1;r<t.length;r+=1){let i=t[r-1],o=t[r];o.left=Math.max(o.left,i.left+i.width+e)}if(t.length>1){let r=Math.min(...t.map(l=>l.desiredCenterX-l.width/2)),i=Math.max(...t.map(l=>l.desiredCenterX+l.width/2)),o=Math.min(...t.map(l=>l.left)),s=Math.max(...t.map(l=>l.left+l.width)),a=(r+i)/2-(o+s)/2;t.forEach(l=>{l.left+=a})}return new Map(t.map(r=>[r.node.id,r.left]))}function uen(n,e){if(!e.has(n))return e.add(n),n;let t=2;for(;e.has(`${n}-${t}`);)t+=1;let r=`${n}-${t}`;return e.add(r),r}function hen(n,e){let t=n.reduce((l,c)=>(l[c.id]=c,l),{}),r=new Set(n.map(l=>l.id)),i=new WeakMap;e.forEach((l,c)=>{i.set(l,c)});let o=e.reduce((l,c)=>{let d=t[c.source],u=t[c.target],h=c.targetHandle?.startsWith("fieldInput/")||c.targetHandle?.startsWith("codeField/");return d?.type!=="state"||!u||u.type!=="app"&&u.type!=="code"||c.sourceHandle!=="fieldOutput"||!h||(l[c.source]=[...l[c.source]??[],c]),l},{}),s=[],a=new WeakMap;return Object.entries(o).forEach(([l,c])=>{let d=t[l];if(!d)return;let u=c.reduce((p,f)=>(p[f.target]=[...p[f.target]??[],f],p),{}),h=Object.entries(u).sort(([p,f],[m,g])=>(i.get(f[0])??0)-(i.get(g[0])??0)||p.localeCompare(m));h.length<=1||h.slice(1).forEach(([p,f])=>{let m=uen(`${l}__for__${p}`,r),{id:g,selected:b,dragging:v,positionAbsolute:y,..._}=d;s.push({..._,id:m,position:{...d.position},selected:!1,dragging:!1}),f.forEach(x=>{a.set(x,m)})})}),s.length===0?{nodes:n,edges:e}:{nodes:[...n,...s],edges:e.map(l=>{let c=a.get(l);return c?{...l,source:c}:l})}}function ise(n,e,t={}){let r=hen(n,e);return{nodes:pen(r.nodes,r.edges,t),edges:r.edges}}function pen(n,e,t={}){if(!n.length)return n;let r=t.fieldOrderByNodeId??{},i=n.map(aen),o=new Set;e.forEach(le=>{le.sourceHandle==="next"&&o.add(le.source),le.targetHandle==="prev"&&o.add(le.target)});let s=i.filter(le=>cen(le)||le.type==="app"&&!uw(le)&&o.has(le.id)),a=i.reduce((le,ce)=>(le[ce.id]=ce,le),{}),l=new Set(s.map(le=>le.id)),c=e.filter(le=>l.has(le.source)&&l.has(le.target)&&len(le)),d=e.reduce((le,ce)=>(!ce.source||!ce.target||(le[ce.source]=[...le[ce.source]??[],ce]),le),{}),u=e.reduce((le,ce)=>(!ce.source||!ce.target||(le[ce.target]=[...le[ce.target]??[],ce]),le),{}),h=new WeakMap;e.forEach((le,ce)=>{h.set(le,ce)});let p=new Map(s.map((le,ce)=>[le.id,ce])),f=[...c].sort((le,ce)=>(p.get(le.source)??0)-(p.get(ce.source)??0)||jf(le.source,le.sourceHandle,r)-jf(ce.source,ce.sourceHandle,r)||jf(le.target,le.targetHandle,r)-jf(ce.target,ce.targetHandle,r)||le.target.localeCompare(ce.target));if(!s.length)return n;let m=new Map(s.map(le=>[le.id,le.id])),g=le=>{let ce=m.get(le);if(!ce||ce===le)return le;let be=g(ce);return m.set(le,be),be},b=(le,ce)=>{let be=g(le),Ne=g(ce);be!==Ne&&m.set(Ne,be)};f.forEach(le=>{b(le.source,le.target)});let v=le=>l.has(le)?g(le):null,y=new wAe.default.graphlib.Graph({multigraph:!0});y.setGraph({rankdir:"LR",nodesep:qst,ranksep:EQt,edgesep:25}),y.setDefaultEdgeLabel(()=>({})),s.forEach(le=>{let{width:ce,height:be}=Ls(le);y.setNode(le.id,{width:ce,height:be,rank:le.type==="event"||le.type==="source"?"min":void 0})}),f.forEach(le=>{!le.source||!le.target||le.source===le.target||y.setEdge(le.source,le.target)}),wAe.default.layout(y);let _=new Map;s.forEach(le=>{let ce=y.node(le.id);if(!ce)return;let{width:be,height:Ne}=Ls(le);_.set(le.id,{x:ce.x-be/2,y:ce.y-Ne/2})});let x=(le,ce,be=new Set)=>{if(be.has(le))return;be.add(le);let Ne=_.get(le);Ne&&_.set(le,{x:Ne.x+ce.x,y:Ne.y+ce.y}),f.filter(Dt=>Dt.source===le).forEach(Dt=>{x(Dt.target,ce,be)})},S=f.reduce((le,ce)=>(!ce.sourceHandle?.startsWith("field/")||ce.targetHandle!=="prev"||(le[ce.source]=[...le[ce.source]??[],ce]),le),{}),k=new Set(Object.values(S).flatMap(le=>le.length>1?le.map(ce=>ce.target):[])),I=f.reduce((le,ce)=>(le[ce.target]=[...le[ce.target]??[],ce],le),{}),L=new Map,A=(le,ce=new Set)=>{if(L.has(le))return L.get(le)??null;if(!l.has(le))return L.set(le,null),null;if(k.has(le))return L.set(le,le),le;if(ce.has(le))return null;ce.add(le);for(let be of I[le]??[]){let Ne=A(be.source,new Set(ce));if(Ne)return L.set(le,Ne),Ne}return L.set(le,null),null},N=new Map,R=(le,ce=new Set)=>{let be=N.get(le);if(be)return new Set(be);let Ne=new Set;return ce.has(le)||(ce.add(le),l.has(le)&&Ne.add(le),f.filter(Dt=>Dt.source===le).forEach(Dt=>{R(Dt.target,new Set(ce)).forEach(lt=>Ne.add(lt))}),N.set(le,new Set(Ne))),Ne},F=new Map,D=(le,ce=new Set)=>{let be=F.get(le);if(be)return new Set(be);let Ne=new Set;return ce.has(le)||(ce.add(le),l.has(le)?Ne.add(le):(d[le]??[]).forEach(lt=>{D(lt.target,new Set(ce)).forEach(Kt=>Ne.add(Kt))}),F.set(le,new Set(Ne))),Ne},H=(le,ce)=>{if(!ce)return!0;let be=D(le);return be.size===0||[...be].every(Ne=>ce.has(Ne))},j=le=>D(le).size>1,K=(le,ce)=>Array.from((u[le]??[]).filter(be=>be.source&&be.target&&!l.has(be.source)&&H(be.source,ce)&&(be.targetHandle?.startsWith("fieldInput/")||be.targetHandle?.startsWith("codeField/"))).sort((be,Ne)=>jf(le,be.targetHandle,r)-jf(le,Ne.targetHandle,r)||(h.get(be)??0)-(h.get(Ne)??0)||be.source.localeCompare(Ne.source)).reduce((be,Ne)=>(be.has(Ne.source)||be.set(Ne.source,Ne),be),new Map).values()),de=(le,ce=new Set,be)=>{let Ne=a[le];if(!Ne)return{left:0,right:0,top:0,bottom:0};let Dt=Ls(Ne),lt={left:0,right:Dt.width,top:0,bottom:Dt.height};if(ce.has(le))return lt;ce.add(le);let Kt=0,cn=null;return K(le,be).forEach((Zn,zn)=>{let fr=a[Zn.source];if(!fr)return;let Oi=Ls(fr),jr=nse(fr,Ne),bs=rat(fr,Ne),Fa=Kt-(zn===0?jr:0)-Oi.height,Mi=Math.min(-bs-xAe*zn,cn?cn.left-Zst:Number.POSITIVE_INFINITY),Ns=nat(de(fr.id,new Set(ce),be),{x:Mi,y:Fa});lt=OR(lt,Ns),cn=cn?OR(cn,Ns):Ns,Kt=Ns.top-SAe}),lt},V=(le,ce,be=new Set)=>{let Ne=_.get(le);if(!Ne)return de(le,new Set,ce);let Dt=de(le,new Set,ce);return be.has(le)||(be.add(le),f.filter(lt=>lt.source===le).forEach(lt=>{let Kt=_.get(lt.target);Kt&&(Dt=OR(Dt,nat(V(lt.target,ce,new Set(be)),{x:Kt.x-Ne.x,y:Kt.y-Ne.y})))})),Dt};Object.entries(S).forEach(([le,ce])=>{if(ce.length<2)return;let be=s.find(ge=>ge.id===le),Ne=_.get(le);if(!be||!Ne)return;let Dt=new Set,lt=ce.map((ge,Nt)=>({edge:ge,index:Nt,pathIndexes:hat(ge.sourceHandle)})),Kt=lt.every(({pathIndexes:ge})=>ge.length>=2),cn=Kt?Array.from(new Set(lt.map(({pathIndexes:ge})=>ge[0]))).sort((ge,Nt)=>ge-Nt):[],Zn=Kt?Array.from(new Set(lt.map(({pathIndexes:ge})=>ge[1]))).sort((ge,Nt)=>ge-Nt):[],zn=Kt&<.length>3&&(cn.length===1||Zn.length===1),fr=Kt&&!zn,Oi=Math.max(1,Math.ceil(Math.sqrt(lt.length))),jr=lt.map(({edge:ge,index:Nt,pathIndexes:Jt})=>{let pi=a[ge.target],Ks=_.get(ge.target);if(!pi||!Ks)return null;let jc=fr?cn.indexOf(Jt[0]):Math.floor(Nt/Oi),ts=fr?Zn.indexOf(Jt[1]):Nt%Oi,Il=V(ge.target,R(ge.target));return{edge:ge,targetPosition:Ks,row:jc,column:ts,footprint:Il,footprintWidth:Il.right-Il.left,footprintHeight:Il.bottom-Il.top}}).filter(ge=>ge!==null&&ge.row>=0&&ge.column>=0);if(jr.length===0)return;let bs=Math.max(...jr.map(ge=>ge.column))+1,Fa=Math.max(...jr.map(ge=>ge.row))+1,Mi=Array.from({length:bs},()=>0),Ns=Array.from({length:Fa},()=>0);jr.forEach(ge=>{Mi[ge.column]=Math.max(Mi[ge.column],ge.footprintWidth),Ns[ge.row]=Math.max(Ns[ge.row],ge.footprintHeight)});let Gs=fr?IQt:TQt,Oa=fr?qst:LQt,Jb=Mi.reduce((ge,Nt,Jt)=>{let pi=Jt===0?0:ge[Jt-1]+Mi[Jt-1]+Gs;return ge.push(pi),ge},[]),Qb=Ns.reduce((ge,Nt,Jt)=>{let pi=Jt===0?0:ge[Jt-1]+Ns[Jt-1]+Oa;return ge.push(pi),ge},[]),Yp=Ns.reduce((ge,Nt)=>ge+Nt,0)+Math.max(0,Fa-1)*Oa,e0=Ls(be),WC=Ne.x+e0.width+Gs,tr=Ne.y+e0.height/2-Yp/2;jr.forEach(ge=>{let Nt=WC+Jb[ge.column]+(Mi[ge.column]-ge.footprintWidth)/2,Jt=tr+Qb[ge.row]+(Ns[ge.row]-ge.footprintHeight)/2,pi={x:Nt-ge.footprint.left,y:Jt-ge.footprint.top};x(ge.edge.target,{x:pi.x-ge.targetPosition.x,y:pi.y-ge.targetPosition.y},Dt)})});let z=new Map,te=(le,ce=new Set)=>{if(z.has(le))return z.get(le)??null;if(l.has(le))return z.set(le,le),le;if(ce.has(le))return null;ce.add(le);for(let be of d[le]??[]){let Ne=te(be.target,ce);if(Ne)return z.set(le,Ne),Ne}for(let be of u[le]??[]){let Ne=te(be.source,ce);if(Ne)return z.set(le,Ne),Ne}return z.set(le,null),null},oe=new Map,U=(le,ce,be=new Set)=>{let Ne=`${le}:${ce}`;if(oe.has(Ne))return oe.get(Ne)??0;if(le===ce)return oe.set(Ne,0),0;if(be.has(le))return 0;be.add(le);let Dt=0;for(let lt of d[le]??[]){let Kt=U(lt.target,ce,be);(Kt>0||lt.target===ce)&&(Dt=Math.max(Dt,Kt+1))}return oe.set(Ne,Dt),Dt},me=i.filter(le=>!l.has(le.id)).reduce((le,ce)=>{let be=te(ce.id);return be&&(le[be]=[...le[be]??[],ce]),le},{}),Be=i.map(le=>{let ce=_.get(le.id);return ce?{...le,position:{...ce}}:le}).reduce((le,ce)=>(le[ce.id]=ce,le),{}),ft=(()=>{let le=e.reduce((be,Ne)=>{if(!Ne.source||!Ne.target||!Ne.targetHandle?.startsWith("fieldInput/"))return be;let Dt=a[Ne.source],lt=a[Ne.target];return Dt?.type!=="state"||lt?.type!=="app"||(be[Ne.target]=[...be[Ne.target]??[],Ne]),be},{}),ce=new Map;return Object.entries(le).forEach(([be,Ne])=>{let Dt=a[be],lt=new Set(Ne.map(Kt=>Kt.source));!Dt||!tat(Dt,lt.size)||lt.forEach(Kt=>{ce.set(Kt,be)})}),ce})(),kt=new Map,Ue=(le,ce)=>{let be=kt.get(ce);return be?le===ce?0:be.get(le)??1:le===ce?0:1},Re=(le,ce,be)=>{let Ne=[],Dt=(lt,Kt,cn,Zn)=>{let zn=Be[Kt]??a[Kt];if(!zn)return;let fr=Ue(Kt,ce),Oi=fr===be-1?0:fr<be?1:2;if(Oi>1)return;let{width:jr}=Ls(le);Ne.push({centerX:iat(zn,cn,r)-pat(le,Zn,r)+jr/2,order:jf(Kt,cn,r),priority:Oi})};for(let lt of d[le.id]??[])Dt(lt,lt.target,lt.targetHandle,lt.sourceHandle);for(let lt of u[le.id]??[])Dt(lt,lt.source,lt.sourceHandle,lt.targetHandle);if(Ne.length===0){let lt=Be[ce]??a[ce];return{centerX:_Ae(lt||le),order:Number.MAX_SAFE_INTEGER}}return Ne.sort((lt,Kt)=>lt.priority-Kt.priority||lt.order-Kt.order||lt.centerX-Kt.centerX),{centerX:Ne[0].centerX,order:Ne[0].order}};Object.entries(me).forEach(([le,ce])=>{let be=Be[le]??a[le];if(!be)return;let Ne=new Map;ce.forEach(Kt=>{Ne.set(Kt.id,Math.max(1,U(Kt.id,le)))}),kt.set(le,Ne);let Dt=Math.max(...Ne.values(),1),lt=be.position.y-Gst;for(let Kt=1;Kt<=Dt;Kt+=1){let cn=ce.filter(jr=>Ne.get(jr.id)===Kt&&!ft.has(jr.id));if(cn.length===0)continue;let Zn=Math.max(...cn.map(jr=>Ls(jr).height)),zn=lt-Zn,fr=cn.map(jr=>{let bs=Re(jr,le,Kt);return{node:jr,desiredCenterX:bs.centerX,order:bs.order}}),Oi=oat(fr,sat);cn.forEach(jr=>{let bs=Ls(jr);Be[jr.id]={...jr,position:{x:Oi.get(jr.id)??_Ae(be)-bs.width/2,y:zn+Zn-bs.height}}}),lt=zn-Gst}});let rn=(le,ce,be,Ne)=>{let Dt=Ls(le),lt=Ls(ce);return le.position.x<ce.position.x+lt.width+be&&le.position.x+Dt.width+be>ce.position.x&&le.position.y<ce.position.y+lt.height+Ne&&le.position.y+Dt.height+Ne>ce.position.y},Ge=(le,ce)=>{Be[le.id]={...le,position:ce}},Lt=(le,ce)=>{le.forEach(be=>{let Ne=Be[be]??a[be];Ne&&Ge(Ne,{x:Ne.position.x+ce.x,y:Ne.position.y+ce.y})})},Pt=new Map,On=le=>!!(le.source&&le.target&&!l.has(le.source)&&(le.targetHandle?.startsWith("fieldInput/")||le.targetHandle?.startsWith("codeField/"))),Wt=e.reduce((le,ce)=>(On(ce)&&(le[ce.target]=[...le[ce.target]??[],ce]),le),{}),Et=(le,ce)=>Array.from((Wt[le]??[]).filter(be=>H(be.source,ce)).sort((be,Ne)=>jf(le,be.targetHandle,r)-jf(le,Ne.targetHandle,r)||(h.get(be)??0)-(h.get(Ne)??0)||be.source.localeCompare(Ne.source)).reduce((be,Ne)=>(be.has(Ne.source)||be.set(Ne.source,Ne),be),new Map).values()),Ae=(le,ce)=>{let be=le.position.y;return ce.forEach((Ne,Dt)=>{let lt=Be[Ne.source]??a[Ne.source];if(!lt)return;let Kt=Ls(lt),cn=Dt===0?nse(lt,le):0;be=be-cn-Kt.height-Xst}),be},ke=(le,ce=new Set,be)=>{let Ne=Be[le]??a[le];if(!Ne)return null;let Dt=FR(Ne);return ce.has(le)||(ce.add(le),Et(le,be).forEach(lt=>{let Kt=Be[lt.source]??a[lt.source];if(!Kt||l.has(Kt.id))return;let cn=ke(Kt.id,new Set(ce),be);cn&&(Dt=OR(Dt,cn))})),Dt},Te=(le,ce=new Set,be)=>{if(ce.has(le))return;ce.add(le);let Ne=Be[le]??a[le];if(!Ne)return;let Dt=Et(le,be),lt=Dt.filter(zn=>ft.get(zn.source)===le),Kt=Dt.filter(zn=>{let fr=Be[zn.source]??a[zn.source];return fr&&!l.has(fr.id)&&ft.get(fr.id)!==le});if(Ne.type==="code"&&Kt.length>sT)return;let cn=lt.length>0?Ae(Ne,lt):Ne.position.y,Zn=null;Kt.forEach((zn,fr)=>{let Oi=Be[zn.source]??a[zn.source];if(!Oi)return;let jr=Ls(Oi),bs=nse(Oi,Ne),Fa=rat(Oi,Ne),Mi=cn-(fr===0?bs:0)-jr.height,Ns=Math.min(Ne.position.x-Fa-xAe*fr,Zn?Zn.left-Zst:Number.POSITIVE_INFINITY);Ge(Oi,{x:Ns,y:Mi}),Te(Oi.id,new Set(ce),be);let Gs=ke(Oi.id,new Set(ce),be);Gs&&(Zn=Zn?OR(Zn,Gs):Gs),cn=(Gs?.top??Mi)-SAe})},Q=()=>{s.map(le=>Be[le.id]??le).sort((le,ce)=>le.position.x-ce.position.x||le.position.y-ce.position.y||(p.get(le.id)??0)-(p.get(ce.id)??0)||le.id.localeCompare(ce.id)).forEach(le=>{Te(le.id,new Set,R(le.id))})},se=()=>{let le=new Map;return s.forEach(ce=>{let be=A(ce.id)??ce.id,Ne=le.get(be)??new Set;Ne.add(ce.id),le.set(be,Ne)}),i.forEach(ce=>{if(l.has(ce.id)||j(ce.id))return;let be=te(ce.id);if(!be||!l.has(be))return;let Ne=A(be)??be,Dt=le.get(Ne)??new Set;Dt.add(ce.id),le.set(Ne,Dt)}),le},ve=(le,ce)=>le.top<ce.bottom+Kst&&le.bottom+Kst>ce.top,X=(le,ce)=>{let be=0;return le.forEach(Ne=>{let Dt=Be[Ne]??a[Ne];if(!Dt)return;let lt=FR(Dt);ce.forEach(Kt=>{let cn=Be[Kt]??a[Kt];if(!cn)return;let Zn=FR(cn);!(lt.left<Zn.right&<.right>Zn.left)||!ve(lt,Zn)||(be=Math.max(be,Zn.right+DQt-lt.left))})}),be},fe=le=>Array.from(le).map(ce=>Be[ce]??a[ce]).filter(ce=>!!ce).map(FR).reduce((ce,be)=>ce?OR(ce,be):be,null),ze=le=>Math.min(...Array.from(le).map(ce=>p.get(ce)??Number.MAX_SAFE_INTEGER)),dt=le=>{let ce=Array.from(le).find(be=>l.has(be));return ce?v(ce):null},Tt=()=>{let le=se(),ce=[];Array.from(le.values()).sort((be,Ne)=>{let Dt=fe(be),lt=fe(Ne);return(Dt?.left??0)-(lt?.left??0)||(Dt?.top??0)-(lt?.top??0)||ze(be)-ze(Ne)}).forEach(be=>{let Ne=dt(be);for(let Dt=0;Dt<bAe;Dt+=1){let lt=ce.filter(Kt=>Kt.componentId===Ne).reduce((Kt,cn)=>Math.max(Kt,X(be,cn.nodeIds)),0);if(lt<=0)break;Lt(be,{x:lt,y:0})}ce.push({nodeIds:be,componentId:Ne})})},qt=()=>{let le=new Map;return s.forEach(ce=>{let be=v(ce.id);if(!be)return;let Ne=le.get(be)??new Set;Ne.add(ce.id),le.set(be,Ne)}),i.forEach(ce=>{if(l.has(ce.id))return;let be=te(ce.id),Ne=be?v(be):null;if(!Ne)return;let Dt=le.get(Ne)??new Set;Dt.add(ce.id),le.set(Ne,Dt)}),le},nn=(le,ce)=>{let be=0;return le.forEach(Ne=>{let Dt=Be[Ne]??a[Ne];if(!Dt)return;let lt=FR(Dt);ce.forEach(Kt=>{let cn=Be[Kt]??a[Kt];if(!cn)return;let Zn=FR(cn),zn=lt.left<Zn.right+Yst&<.right+Yst>Zn.left,fr=lt.top<Zn.bottom+vAe&<.bottom+vAe>Zn.top;!zn||!fr||(be=Math.max(be,Zn.bottom+vAe-lt.top))})}),be},ir=()=>{let le=Array.from(qt().values()).sort((be,Ne)=>{let Dt=fe(be),lt=fe(Ne);return(Dt?.top??0)-(lt?.top??0)||(Dt?.left??0)-(lt?.left??0)||ze(be)-ze(Ne)}),ce=[];le.forEach(be=>{for(let Ne=0;Ne<bAe;Ne+=1){let Dt=ce.reduce((lt,Kt)=>Math.max(lt,nn(be,Kt.nodeIds)),0);if(Dt<=0)break;Lt(be,{x:0,y:Dt})}ce.push({nodeIds:be})})},sr=()=>{let le=e.reduce((ce,be)=>{if(!be.source||!be.target||!be.targetHandle?.startsWith("codeField/"))return ce;let Ne=Be[be.source]??a[be.source],Dt=Be[be.target]??a[be.target];return!Ne||Dt?.type!=="code"||l.has(Ne.id)||(ce[be.target]=[...ce[be.target]??[],be]),ce},{});Object.entries(le).forEach(([ce,be])=>{if(be.length<=sT)return;let Ne=Be[ce]??a[ce];if(!Ne)return;let Dt=Array.from(be.sort((zn,fr)=>jf(ce,zn.targetHandle,r)-jf(ce,fr.targetHandle,r)||(h.get(zn)??0)-(h.get(fr)??0)||zn.source.localeCompare(fr.source)).reduce((zn,fr)=>(zn.has(fr.source)||zn.set(fr.source,fr),zn),new Map).values()),lt=Dt.filter(zn=>(Be[zn.source]??a[zn.source])?.type==="state"),Kt=Dt.filter(zn=>(Be[zn.source]??a[zn.source])?.type!=="state"),cn=[];for(let zn=0;zn<lt.length;zn+=sT)cn.push(lt.slice(zn,zn+sT));for(let zn=0;zn<Kt.length;zn+=sT)cn.push(Kt.slice(zn,zn+sT));let Zn=Ne.position.y-ien;for(let[zn,fr]of cn.entries()){let Oi=fr.map((Mi,Ns)=>{let Gs=Be[Mi.source]??a[Mi.source];return Gs?{node:Gs,desiredCenterX:iat(Ne,Mi.targetHandle,r),order:zn*sT+Ns}:null}).filter(Mi=>Mi!==null);if(Oi.length===0)continue;let jr=Math.max(...Oi.map(Mi=>Ls(Mi.node).height)),bs=Zn-jr,Fa=oat(Oi,ren);Oi.forEach(Mi=>{let Ns=Ls(Mi.node);Ge(Mi.node,{x:Fa.get(Mi.node.id)??Mi.desiredCenterX-Ns.width/2,y:bs+jr-Ns.height})}),Zn=bs-oen}})},Zt=()=>{e.filter(ce=>{let be=Be[ce.source]??a[ce.source],Ne=Be[ce.target]??a[ce.target];return be&&Ne&&uw(be)&&Ne.type==="app"&&!uw(Ne)&&D(be.id).size===0&&!l.has(be.id)&&!l.has(Ne.id)&&ce.sourceHandle==="fieldOutput"&&!!ce.targetHandle?.startsWith("fieldInput/")}).sort((ce,be)=>{let Ne=te(ce.source),Dt=te(be.source),lt=Ne?Ue(ce.source,Ne):0,Kt=Dt?Ue(be.source,Dt):0;return lt-Kt||ce.source.localeCompare(be.source)}).forEach(ce=>{let be=Be[ce.source]??a[ce.source],Ne=Be[ce.target]??a[ce.target];if(!be||!Ne)return;let Dt=Ls(be),lt=Ls(Ne);Ge(be,{x:Ne.position.x-Dt.width-NQt,y:Ne.position.y+(lt.height-Dt.height)/2})})},er=()=>{Pt.clear();let le=e.reduce((ce,be)=>{if(!be.source||!be.target||!be.targetHandle?.startsWith("fieldInput/"))return ce;let Ne=Be[be.source]??a[be.source],Dt=Be[be.target]??a[be.target];return Ne?.type!=="state"||Dt?.type!=="app"||(ce[be.target]=[...ce[be.target]??[],be]),ce},{});Object.entries(le).forEach(([ce,be])=>{let Ne=Be[ce]??a[ce];if(!Ne)return;let lt=Array.from(be.sort((cn,Zn)=>jf(ce,cn.targetHandle,r)-jf(ce,Zn.targetHandle,r)||(h.get(cn)??0)-(h.get(Zn)??0)||cn.source.localeCompare(Zn.source)).reduce((cn,Zn)=>(cn.has(Zn.source)||cn.set(Zn.source,Zn),cn),new Map).values()).map(cn=>Be[cn.source]??a[cn.source]).filter(cn=>!!cn);if(lt.length===0||!tat(Ne,lt.length))return;let Kt=Ne.position.y;lt.forEach((cn,Zn)=>{let zn=Ls(cn),fr=Zn===0?nse(cn,Ne):0,Oi=Kt-fr-zn.height;Pt.set(cn.id,ce),Ge(cn,{x:Ne.position.x-aat-RQt*Zn,y:Oi}),Kt=Oi-Xst})})},Er=()=>{let le=i.map(be=>be.id).filter(be=>l.has(be)).sort((be,Ne)=>{let Dt=Be[be]??a[be],lt=Be[Ne]??a[Ne];return Dt.position.y-lt.position.y||Dt.position.x-lt.position.x||be.localeCompare(Ne)}),ce=i.map(be=>be.id).filter(be=>!l.has(be)).sort((be,Ne)=>{let Dt=Be[be]??a[be],lt=Be[Ne]??a[Ne];return Dt.position.y-lt.position.y||Dt.position.x-lt.position.x||be.localeCompare(Ne)});for(let be=0;be<bAe;be+=1){let Ne=!1;for(let Dt of ce){let lt=Be[Dt]??a[Dt],Kt=Ls(lt);for(let cn of le){let Zn=Be[cn]??a[cn],zn=Pt.has(lt.id),fr=Pt.get(lt.id)===cn;if(!rn(lt,Zn,zn&&!fr?0:t8,zn&&!fr?0:gAe))continue;let bs=Zn.position.y-Kt.height-gAe;bs<lt.position.y&&(Ge(lt,{x:lt.position.x,y:bs}),Ne=!0)}}for(let Dt=0;Dt<ce.length;Dt+=1)for(let lt=Dt+1;lt<ce.length;lt+=1){let Kt=Be[ce[Dt]]??a[ce[Dt]],cn=Be[ce[lt]]??a[ce[lt]],Zn=Pt.get(Kt.id),zn=Pt.get(cn.id),fr=Zn&&Zn===zn,Oi=Zn===cn.id||zn===Kt.id,jr=fr||Oi;if(!rn(Kt,cn,jr?0:t8,jr?0:gAe))continue;let Mi=Pt.has(Kt.id),Ns=Pt.has(cn.id),[Gs,Oa]=Mi!==Ns?Mi?[Kt,cn]:[cn,Kt]:Kt.position.x<=cn.position.x?[Kt,cn]:[cn,Kt],Jb=Ls(Gs),Qb=Ls(Oa),Yp=Oa.position.x<Gs.position.x?Gs.position.x-Qb.width-t8:Gs.position.x+Jb.width+t8;Ge(Oa,{x:Yp,y:Oa.position.y}),Ne=!0}if(!Ne)break}};return Zt(),sr(),er(),Er(),Zt(),sr(),er(),Er(),sr(),er(),Q(),Zt(),er(),sr(),Tt(),ir(),i.map(le=>Be[le.id]??le)}function ose(n){let e=new Uint8Array(n);if(window.crypto&&window.crypto.getRandomValues)window.crypto.getRandomValues(e);else for(let i=0;i<e.length;i++)e[i]=Math.floor(Math.random()*256);let t=Array.from(e);return btoa(String.fromCharCode.apply(null,t)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}var Bh=St(Lct(),1);function Act(n){return[{name:"commonName",value:n}]}function Jrn(n){let e=n.split(".");return e.length===4&&e.every(t=>/^\d+$/.test(t)&&Number(t)>=0&&Number(t)<=255)}function Qrn(n){return Jrn(n)||n.includes(":")&&/^[0-9a-fA-F:.]+$/.test(n)}function ein(n){let e=[{type:2,value:"localhost"},{type:7,ip:"127.0.0.1"}];return n&&e.push(Qrn(n)?{type:7,ip:n}:{type:2,value:n}),[{name:"subjectAltName",altNames:e}]}function Dct(){return`01${Bh.util.bytesToHex(Bh.random.getBytesSync(15))}`}function Nct(n,e){return new Date(n.getTime()+e*24*60*60*1e3)}function Rct(n){return n.toISOString().replace("Z","+00:00")}function Fct(n){let e=n.trim(),t=new Date,r=new Date(t.getTime()-300*1e3),i=Bh.pki.rsa.generateKeyPair({bits:2048,e:65537}),o=Bh.pki.createCertificate();o.publicKey=i.publicKey,o.serialNumber=Dct(),o.validity.notBefore=r,o.validity.notAfter=Nct(t,3650);let s=Act(`FrameOS Frame CA (${e||"frame"})`);o.setSubject(s),o.setIssuer(s),o.setExtensions([{name:"basicConstraints",cA:!0,critical:!0},{name:"keyUsage",digitalSignature:!0,keyCertSign:!0,cRLSign:!0,critical:!0}]),o.sign(i.privateKey,Bh.md.sha256.create());let a=Bh.pki.rsa.generateKeyPair({bits:2048,e:65537}),l=Bh.pki.createCertificate();return l.publicKey=a.publicKey,l.serialNumber=Dct(),l.validity.notBefore=r,l.validity.notAfter=Nct(t,825),l.setSubject(Act(e||"frame.local")),l.setIssuer(o.subject.attributes),l.setExtensions([...ein(e),{name:"basicConstraints",cA:!1,critical:!0},{name:"extKeyUsage",serverAuth:!0},{name:"keyUsage",digitalSignature:!0,keyEncipherment:!0,critical:!0}]),l.sign(i.privateKey,Bh.md.sha256.create()),{certs:{server:Bh.pki.certificateToPem(l),server_key:Bh.pki.privateKeyToPem(a.privateKey),client_ca:Bh.pki.certificateToPem(o)},server_cert_not_valid_after:Rct(l.validity.notAfter),client_ca_cert_not_valid_after:Rct(o.validity.notAfter)}}function tin(n,e){return(n.name||n.id).localeCompare(e.name||e.id,void 0,{numeric:!0,sensitivity:"base"})||String(n.id).localeCompare(String(e.id))}function Oct(n){return[...n].toSorted(tin)}var ZR={frameos:"2026.9.5+e0ee71ef10d953fd834de06c4483561da8cf9aed",editor:"2026.9.5+b78a3455fb7e56a2474ca1b54cc55de5cbc3ece7",remote:"2026.9.3+a22d2f4dbdb936e9de7dd9f32559dba15fdbc1ad",docker:"2026.9.5+087277afc6de3924b8912f8d7bebe11baa023698"};var Hdi=[{value:"",label:"Prefer binaries, build from source if needed"},{value:"precompiled",label:`Install precompiled binaries (version ${ZR.frameos.split("+")[0]})`},{value:"static",label:"Build from source - single binary (legacy: needs a build environment)"}];function zse(n){return n==="shared"||n==="shared-scenes"?"static":n==="static"||n==="precompiled"?n:"precompiled"}function v8(n){return n==="embedded"}function Ed(n,e){return v8(e)?"interpreted":n?.settings?.execution??"interpreted"}function y8(n,e){return Ed(n,e)!=="interpreted"}function Mct(n){let e=n?.settings?.execution;return e==="compiled"||e==="interpreted"?e:"interpreted"}var I2e="https://scenes.frameos.net/nim-converter",Pct="Preview runs the interpreter: this scene's Nim code nodes and Nim apps are not executed here. Convert the scene to JavaScript to see it whole.",rin=`This makes the scene compiled (legacy): it will need a full FrameOS source build on every deploy.
|
|
12540
12540
|
|
|
12541
12541
|
Keep it interpreted instead and convert it to an interpreted scene at ${I2e}?
|
|
12542
12542
|
|
|
@@ -12928,4 +12928,4 @@ use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.productio
|
|
|
12928
12928
|
* LICENSE file in the root directory of this source tree.
|
|
12929
12929
|
*)
|
|
12930
12930
|
*/
|
|
12931
|
-
//# sourceMappingURL=lib-
|
|
12931
|
+
//# sourceMappingURL=lib-KUGKN4SQ.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as P,b as O,c as F,d as M}from"./chunk-GC2ASTCL.js";import"./chunk-3BLCY6UO.js";import"./chunk-UQ47VFV7.js";import"./chunk-YVLZL2DF.js";import"./chunk-LJLSS6VP.js";import"./chunk-IO5HD6LR.js";import"./chunk-ISGRWLZB.js";import"./chunk-CMJLLXM5.js";import"./chunk-S7YZLIQ2.js";import"./chunk-QOR6RVYK.js";import"./chunk-IGSWCXWL.js";import"./chunk-XY25BMCC.js";import"./chunk-MYJDNFHV.js";import"./chunk-XX6D4PCV.js";import"./chunk-FFF5XN2E.js";import"./chunk-4E35PBBI.js";import"./chunk-I5YU2QOB.js";import"./chunk-NMLR6BBX.js";import"./chunk-OZMHIOOM.js";import"./chunk-VY54N476.js";import"./chunk-IAT3SH6V.js";import"./chunk-NKBKRXAI.js";import"./chunk-7WRUHYVT.js";import"./chunk-UQ2OIIDY.js";import"./chunk-SYSYBEFC.js";import"./chunk-P7EAYOW2.js";import"./chunk-UE65FKDK.js";import"./chunk-XRXYPYNZ.js";import"./chunk-2AMRXN7J.js";import"./chunk-MQ6GXGQP.js";import"./chunk-WXJNV4KM.js";import"./chunk-MMFEMX4D.js";import"./chunk-JMW7BC3H.js";import"./chunk-RIEQ6JT2.js";import"./chunk-76H6TNVU.js";import"./chunk-3PWLJ7VB.js";import"./chunk-RUT5KRF7.js";import"./chunk-PRLZJXP3.js";import"./chunk-UHBPDWMK.js";import"./chunk-PF2U73FX.js";import"./chunk-NLF7C362.js";import"./chunk-DNNQJI7D.js";import"./chunk-HYBSLNBW.js";import"./chunk-XA5PSH3Z.js";import"./chunk-BQIQDJSQ.js";import"./chunk-Q677WDQ5.js";import"./chunk-GQZ2XFQS.js";import"./chunk-6JGNP3CG.js";import"./chunk-KNM3LS47.js";import"./chunk-TQXNETKV.js";import"./chunk-K7SEZQEV.js";import"./chunk-35SNHSYE.js";import"./chunk-KI45N7NV.js";import"./chunk-YZMIVIZ5.js";import"./chunk-EXFFRG4T.js";import"./chunk-6ZBQJK6J.js";import"./chunk-2CR2MHW5.js";import"./chunk-YEUXEZFN.js";import"./chunk-GIOZPKCU.js";import"./chunk-RSVXJNBI.js";import"./chunk-6SG4JVGQ.js";import"./chunk-TOACPXU7.js";import"./chunk-OMEEZ2KP.js";import"./chunk-GQHVCGHB.js";import"./chunk-T24SSVPV.js";import"./chunk-T6RP4BD5.js";import"./chunk-4WRNN7GJ.js";import"./chunk-RUZ27PU2.js";import"./chunk-U5PEY4LZ.js";import"./chunk-ANIO6SZU.js";import"./chunk-7FDFD2RA.js";import"./chunk-2BO64G4N.js";import"./chunk-QFJGXGHG.js";import"./chunk-HCICVWA5.js";import"./chunk-SDHBPXRH.js";import"./chunk-7PUP564T.js";import"./chunk-FTRSNC63.js";import"./chunk-45FHXPEV.js";import"./chunk-LJCV6PN4.js";import"./chunk-YO6OY3Y3.js";import"./chunk-R7WVBZOR.js";import"./chunk-YA2PAOL6.js";import"./chunk-UMBBSV56.js";import"./chunk-KWJBJL5V.js";import"./chunk-YAIRCXNW.js";import"./chunk-5LOLNRAG.js";import"./chunk-OHNXNH3I.js";import"./chunk-YY6U53S3.js";import"./chunk-KDVTGBVQ.js";import"./chunk-NM5KCVND.js";import"./chunk-M52Y7THK.js";import"./chunk-UXYDP2GA.js";import"./chunk-5XO4Z6GR.js";import"./chunk-JQHJLBQS.js";import"./chunk-T3C76GSG.js";import"./chunk-ERWUOBST.js";import"./chunk-XMK64KOA.js";import"./chunk-XC57KLDG.js";import"./chunk-BQAFRR3J.js";import"./chunk-SJKWNSPY.js";import"./chunk-UZILS5FV.js";import"./chunk-BJQMVKVY.js";import"./chunk-3T3ARG3E.js";import"./chunk-5EHDUP6F.js";import"./chunk-R3CIFBZ5.js";import"./chunk-HV5HARVF.js";import"./chunk-TR4FEZFI.js";import"./chunk-2EHDYPYD.js";import"./chunk-DHGVBQ7P.js";import"./chunk-VSSLVNAR.js";import"./chunk-3PV5T5XU.js";import"./chunk-MTA7GLUS.js";import"./chunk-VTLK6Q27.js";import"./chunk-MBGDWTMS.js";import"./chunk-5QCMYUDE.js";import"./chunk-FMFLZD4C.js";import"./chunk-TRRBPBPW.js";import"./chunk-OJ3POHII.js";import"./chunk-MQZSDER5.js";import"./chunk-AO6PVYSP.js";import"./chunk-HUSYQ7O4.js";import"./chunk-WJVGIUKU.js";import"./chunk-2HSKHBQ3.js";import"./chunk-JF4IGMKP.js";import"./chunk-PEGTBE7W.js";import"./chunk-BROXBG6H.js";import"./chunk-7SX4UPLE.js";import"./chunk-ZFPGT7UB.js";import"./chunk-EKY6EZHW.js";import"./chunk-ZUBO4ZEH.js";import"./chunk-R53F7DXM.js";import"./chunk-K4DA7VO4.js";import"./chunk-QOEI2BB3.js";import"./chunk-ILLKJPPP.js";import"./chunk-LUKWWQ4Q.js";import"./chunk-UX2VV7NR.js";import"./chunk-NYPIF35V.js";import"./chunk-HDCXYMSE.js";import"./chunk-BJ5KKFRX.js";import"./chunk-35GGXXL4.js";import"./chunk-5HFCOS36.js";import"./chunk-BJ2H527R.js";import"./chunk-EXJ3TYPN.js";import"./chunk-22JI2C23.js";import"./chunk-FIBLU6JW.js";import"./chunk-PBWK4RSZ.js";import"./chunk-T4NNGQKH.js";import"./chunk-Y7GVIX2K.js";import"./chunk-UFBZ5RUP.js";import"./chunk-J43IOAV2.js";import"./chunk-G6BUUK3X.js";import"./chunk-RAQFCDSA.js";import"./chunk-GHOBFR25.js";import"./chunk-LEY7YUND.js";import"./chunk-VAW5CAKL.js";import"./chunk-W4T2JBHA.js";import"./chunk-6VNLT34U.js";import"./chunk-PKMWTI6A.js";import"./chunk-V3O2HLLM.js";import"./chunk-2CK4H4PK.js";import"./chunk-KN2A4UI3.js";import"./chunk-2DVAQSTR.js";import"./chunk-TMZXKUJ7.js";import"./chunk-4ZWCIZGW.js";import"./chunk-ZCHP3MYE.js";import"./chunk-ITXPPIKB.js";import"./chunk-JCKQGVLY.js";import"./chunk-SRASGVKV.js";import"./chunk-5TETHXKM.js";import"./chunk-GZPBQVE7.js";import"./chunk-B2GEUQZK.js";import"./chunk-C7WBA5UQ.js";import"./chunk-IZBV4PHK.js";import"./chunk-M2SCIUFO.js";import"./chunk-PGDMHBNI.js";import"./chunk-TIYOD65A.js";import"./chunk-PKANRYX6.js";import"./chunk-WLNBEVIM.js";import"./chunk-N45EUFA3.js";import"./chunk-DO57ZZNQ.js";import"./chunk-UTGGNDEF.js";import"./chunk-HE75YTAD.js";import"./chunk-TG4FTNP7.js";import"./chunk-VPAZW4IE.js";import"./chunk-QS2GJJXN.js";import"./chunk-MUJL7FQJ.js";import"./chunk-EKULWSLH.js";import"./chunk-KFMQ6GVV.js";import"./chunk-QPHGFD2Y.js";import"./chunk-HP4P4Z2R.js";import"./chunk-RSVFNNQ3.js";import"./chunk-XGBDEWZH.js";import"./chunk-NIZ3DLMN.js";import"./chunk-XPNMKQBN.js";import"./chunk-2VFZQK6H.js";import"./chunk-B4MC4X6R.js";import"./chunk-ZS3FCIDW.js";import"./chunk-JIPHTHEV.js";import"./chunk-EO6ZVYAU.js";import"./chunk-QHFNREED.js";import"./chunk-QTGI3NVE.js";import"./chunk-PUR6MQ67.js";import"./chunk-WLGZI23G.js";import"./chunk-BCZI2XYX.js";import"./chunk-OW25EIRT.js";import"./chunk-72VW33X6.js";import"./chunk-TTRVH5FY.js";import"./chunk-SVUYFOZB.js";import"./chunk-C4UW2SIM.js";import"./chunk-AG7KROZ7.js";import"./chunk-DNTASBVS.js";import"./chunk-FOT4BL2J.js";import"./chunk-ZTZIWYY7.js";import"./chunk-XIBMFQYW.js";import"./chunk-2JIMXGVJ.js";import"./chunk-W7UDHTT3.js";import"./chunk-Y6EQGSOI.js";import"./chunk-FF6M56TZ.js";import"./chunk-AITXKHH2.js";import"./chunk-2CMV52NX.js";import"./chunk-ZHSIL7EQ.js";import"./chunk-UCNHTX5Z.js";import"./chunk-OWNULEI4.js";import"./chunk-5HXEWEG7.js";import"./chunk-D7NTWXPI.js";import"./chunk-CW2G3GTX.js";import"./chunk-VPMBH7ED.js";import"./chunk-RBAETNMK.js";import"./chunk-6DJ3CL5E.js";import"./chunk-D4ZCQ4ZB.js";import"./chunk-SLMOCOVC.js";import"./chunk-WA3SGGGN.js";import"./chunk-ATTGRJIS.js";import"./chunk-I72JNYAW.js";import"./chunk-AMJO5MXW.js";import"./chunk-LERWLC26.js";import"./chunk-VBQRXBKN.js";import"./chunk-N7U6FF65.js";import"./chunk-UDQ657MP.js";import"./chunk-FNMPMXLQ.js";import"./chunk-SMV4XGKK.js";import"./chunk-2IXING64.js";import"./chunk-SFFASEUX.js";import"./chunk-TSAMHA74.js";import"./chunk-RNLPRU3L.js";import"./chunk-CCFDPXNH.js";import"./chunk-WTXODJNE.js";import"./chunk-HKVEG3TJ.js";import"./chunk-3Z2SL3LO.js";import"./chunk-A2J4PCL3.js";import"./chunk-ZAL7QAHA.js";import"./chunk-LSMPUXCK.js";import"./chunk-ZLXR3HBB.js";import"./chunk-MLFFVQ4H.js";import"./chunk-H7ZYEXEY.js";import"./chunk-6MVDPGZ3.js";import"./chunk-OUZK3JE3.js";import"./chunk-I4YHVXUS.js";import"./chunk-XAPIUMOF.js";import"./chunk-ILONVRIF.js";import"./chunk-VHQT6GPD.js";import"./chunk-JMTINDL5.js";import"./chunk-NKKHM6BH.js";import"./chunk-335U7CYZ.js";import"./chunk-L2TNAAQN.js";import"./chunk-WWRVMGI5.js";import"./chunk-ZJQQ5HGS.js";import"./chunk-YUQEO6UE.js";import"./chunk-KPGFYNDA.js";import"./chunk-CW3J33TN.js";import"./chunk-2HPZX3VT.js";import"./chunk-H2EJ2FXO.js";import"./chunk-27K5BE5C.js";import"./chunk-L6ZOAPPM.js";import"./chunk-2JMILQ6B.js";import"./chunk-FWGXBW4L.js";import"./chunk-GB2W6K7K.js";import"./chunk-MHSPATEG.js";import"./chunk-FODM75CC.js";import"./chunk-GZ3APDMX.js";import"./chunk-M4R7TXHA.js";import"./chunk-HPCIGI5Y.js";import"./chunk-F2I44VCA.js";import"./chunk-OJ7LTCWX.js";import"./chunk-XOIR265Z.js";import"./chunk-JDEUN4XM.js";import"./chunk-YKPUVWML.js";import"./chunk-KULXXWBI.js";import"./chunk-3U5632TD.js";import"./chunk-QQJTKUTN.js";import"./chunk-BJLZZSSQ.js";import"./chunk-B65HAB74.js";import"./chunk-FTY3DS4C.js";import"./chunk-5P6WZP6E.js";import"./chunk-2PXTM6RE.js";import"./chunk-AR6BFW4D.js";import"./chunk-U2LA4WCV.js";import"./chunk-L23DVICG.js";import"./chunk-77IJP7IA.js";import"./chunk-PEQWA434.js";import"./chunk-JQPBSXCG.js";import"./chunk-LYRW73XL.js";import"./chunk-ALC3I3V2.js";import{d as f}from"./chunk-A34ONGYR.js";var U=f(P(),1);var _=f(F(),1),R=!1,S=!1;function I(a,t){let o=document.getElementById(a);return o||(o=document.createElement("div"),o.id=a,o.style.position="absolute",o.style.zIndex=t,o.dataset.frameosEditorOwned="true",document.body.appendChild(o)),o}function x(a,t){if(S)throw new Error("mountFrameOSEditor: an editor is already mounted (the message bus is window-wide)");S=!0;let o=new URL("..",import.meta.url),s=window;s.FRAMEOS_EMBEDDED_NO_BACKEND=!0,s.ESBUILD_LOAD_CHUNKS=s.ESBUILD_LOAD_CHUNKS||function(){};let b=s.FRAMEOS_APP_CONFIG=s.FRAMEOS_APP_CONFIG||{};b.ingress_path=o.pathname.replace(/\/$/,"");let d=document.createElement("link");d.rel="stylesheet",d.href=new URL("./static/mount.css",o).href,document.head.appendChild(d);let w=I("modal","60"),g=I("popper","90"),n=document.documentElement,u=n.dataset.frameosTheme,C=n.style.colorScheme,m=t.theme??(window.matchMedia?.("(prefers-color-scheme: dark)").matches?"dark":"light");n.dataset.frameosTheme=m,n.style.colorScheme=m,R||(O({memoryRouter:!0}),R=!0);let i=t.scenes,p=!1,l=[],y=(r,e)=>({type:"frameos-editor:init",scenes:r,sceneId:e,mode:t.mode??"rpios",width:t.width??800,height:t.height??480,interval:t.interval??300,theme:m,previewProxyUrl:t.previewProxyUrl,description:t.description}),E=r=>{if(r.source!==window)return;let e=r.data;if(!(!e||typeof e!="object")){if(e.type==="frameos-editor:ready")p=!0,window.postMessage(y(i,t.sceneId),window.location.origin),t.onReady?.();else if(e.type==="frameos-editor:scenes"&&Array.isArray(e.scenes)){for(i=e.scenes;l.length>0;)l.shift()?.(e.scenes);t.onScenesChanged?.(e.scenes)}else if(e.type==="frameos-editor:save-screenshot"&&typeof e.dataUrl=="string"){if(!t.onSaveScreenshot)return;t.onSaveScreenshot(e.dataUrl,typeof e.sceneId=="string"?e.sceneId:null).catch(h=>({ok:!1,error:String(h)})).then(h=>{window.postMessage({type:"frameos-editor:screenshot-saved",...h},window.location.origin)})}}};window.addEventListener("message",E);let c=document.createElement("div");c.style.height="100%",a.appendChild(c);let v=U.default.createRoot(c);return v.render((0,_.jsx)(M,{})),{getScenesSync:()=>i,getScenes:()=>new Promise(r=>{if(!p){r(i);return}l.push(r),window.postMessage({type:"frameos-editor:get-scenes"},window.location.origin)}),setScenes:(r,e)=>{i=r,window.postMessage(y(r,e),window.location.origin)},selectScene:r=>{window.postMessage({type:"frameos-editor:select-scene",sceneId:r},window.location.origin)},destroy:()=>{window.removeEventListener("message",E),v.unmount(),c.remove(),d.remove(),w.dataset.frameosEditorOwned&&w.remove(),g.dataset.frameosEditorOwned&&g.remove(),u===void 0?delete n.dataset.frameosTheme:n.dataset.frameosTheme=u,n.style.colorScheme=C,S=!1}}}export{x as mountFrameOSEditor};
|
|
2
|
-
//# sourceMappingURL=mount-
|
|
1
|
+
import{a as P,b as O,c as F,d as M}from"./chunk-HFUAHA4L.js";import"./chunk-3BLCY6UO.js";import"./chunk-UQ47VFV7.js";import"./chunk-YVLZL2DF.js";import"./chunk-LJLSS6VP.js";import"./chunk-IO5HD6LR.js";import"./chunk-ISGRWLZB.js";import"./chunk-CMJLLXM5.js";import"./chunk-S7YZLIQ2.js";import"./chunk-QOR6RVYK.js";import"./chunk-IGSWCXWL.js";import"./chunk-XY25BMCC.js";import"./chunk-MYJDNFHV.js";import"./chunk-XX6D4PCV.js";import"./chunk-FFF5XN2E.js";import"./chunk-4E35PBBI.js";import"./chunk-I5YU2QOB.js";import"./chunk-NMLR6BBX.js";import"./chunk-OZMHIOOM.js";import"./chunk-VY54N476.js";import"./chunk-IAT3SH6V.js";import"./chunk-NKBKRXAI.js";import"./chunk-7WRUHYVT.js";import"./chunk-UQ2OIIDY.js";import"./chunk-SYSYBEFC.js";import"./chunk-P7EAYOW2.js";import"./chunk-UE65FKDK.js";import"./chunk-XRXYPYNZ.js";import"./chunk-2AMRXN7J.js";import"./chunk-MQ6GXGQP.js";import"./chunk-WXJNV4KM.js";import"./chunk-MMFEMX4D.js";import"./chunk-JMW7BC3H.js";import"./chunk-RIEQ6JT2.js";import"./chunk-76H6TNVU.js";import"./chunk-3PWLJ7VB.js";import"./chunk-RUT5KRF7.js";import"./chunk-PRLZJXP3.js";import"./chunk-UHBPDWMK.js";import"./chunk-PF2U73FX.js";import"./chunk-NLF7C362.js";import"./chunk-DNNQJI7D.js";import"./chunk-HYBSLNBW.js";import"./chunk-XA5PSH3Z.js";import"./chunk-BQIQDJSQ.js";import"./chunk-Q677WDQ5.js";import"./chunk-GQZ2XFQS.js";import"./chunk-6JGNP3CG.js";import"./chunk-KNM3LS47.js";import"./chunk-TQXNETKV.js";import"./chunk-K7SEZQEV.js";import"./chunk-35SNHSYE.js";import"./chunk-KI45N7NV.js";import"./chunk-YZMIVIZ5.js";import"./chunk-EXFFRG4T.js";import"./chunk-6ZBQJK6J.js";import"./chunk-2CR2MHW5.js";import"./chunk-YEUXEZFN.js";import"./chunk-GIOZPKCU.js";import"./chunk-RSVXJNBI.js";import"./chunk-6SG4JVGQ.js";import"./chunk-TOACPXU7.js";import"./chunk-OMEEZ2KP.js";import"./chunk-GQHVCGHB.js";import"./chunk-T24SSVPV.js";import"./chunk-T6RP4BD5.js";import"./chunk-4WRNN7GJ.js";import"./chunk-RUZ27PU2.js";import"./chunk-U5PEY4LZ.js";import"./chunk-ANIO6SZU.js";import"./chunk-7FDFD2RA.js";import"./chunk-2BO64G4N.js";import"./chunk-QFJGXGHG.js";import"./chunk-HCICVWA5.js";import"./chunk-SDHBPXRH.js";import"./chunk-7PUP564T.js";import"./chunk-FTRSNC63.js";import"./chunk-45FHXPEV.js";import"./chunk-LJCV6PN4.js";import"./chunk-YO6OY3Y3.js";import"./chunk-R7WVBZOR.js";import"./chunk-YA2PAOL6.js";import"./chunk-UMBBSV56.js";import"./chunk-KWJBJL5V.js";import"./chunk-YAIRCXNW.js";import"./chunk-5LOLNRAG.js";import"./chunk-OHNXNH3I.js";import"./chunk-YY6U53S3.js";import"./chunk-KDVTGBVQ.js";import"./chunk-NM5KCVND.js";import"./chunk-M52Y7THK.js";import"./chunk-UXYDP2GA.js";import"./chunk-5XO4Z6GR.js";import"./chunk-JQHJLBQS.js";import"./chunk-T3C76GSG.js";import"./chunk-ERWUOBST.js";import"./chunk-XMK64KOA.js";import"./chunk-XC57KLDG.js";import"./chunk-BQAFRR3J.js";import"./chunk-SJKWNSPY.js";import"./chunk-UZILS5FV.js";import"./chunk-BJQMVKVY.js";import"./chunk-3T3ARG3E.js";import"./chunk-5EHDUP6F.js";import"./chunk-R3CIFBZ5.js";import"./chunk-HV5HARVF.js";import"./chunk-TR4FEZFI.js";import"./chunk-2EHDYPYD.js";import"./chunk-DHGVBQ7P.js";import"./chunk-VSSLVNAR.js";import"./chunk-3PV5T5XU.js";import"./chunk-MTA7GLUS.js";import"./chunk-VTLK6Q27.js";import"./chunk-MBGDWTMS.js";import"./chunk-5QCMYUDE.js";import"./chunk-FMFLZD4C.js";import"./chunk-TRRBPBPW.js";import"./chunk-OJ3POHII.js";import"./chunk-MQZSDER5.js";import"./chunk-AO6PVYSP.js";import"./chunk-HUSYQ7O4.js";import"./chunk-WJVGIUKU.js";import"./chunk-2HSKHBQ3.js";import"./chunk-JF4IGMKP.js";import"./chunk-PEGTBE7W.js";import"./chunk-BROXBG6H.js";import"./chunk-7SX4UPLE.js";import"./chunk-ZFPGT7UB.js";import"./chunk-EKY6EZHW.js";import"./chunk-ZUBO4ZEH.js";import"./chunk-R53F7DXM.js";import"./chunk-K4DA7VO4.js";import"./chunk-QOEI2BB3.js";import"./chunk-ILLKJPPP.js";import"./chunk-LUKWWQ4Q.js";import"./chunk-UX2VV7NR.js";import"./chunk-NYPIF35V.js";import"./chunk-HDCXYMSE.js";import"./chunk-BJ5KKFRX.js";import"./chunk-35GGXXL4.js";import"./chunk-5HFCOS36.js";import"./chunk-BJ2H527R.js";import"./chunk-EXJ3TYPN.js";import"./chunk-22JI2C23.js";import"./chunk-FIBLU6JW.js";import"./chunk-PBWK4RSZ.js";import"./chunk-T4NNGQKH.js";import"./chunk-Y7GVIX2K.js";import"./chunk-UFBZ5RUP.js";import"./chunk-J43IOAV2.js";import"./chunk-G6BUUK3X.js";import"./chunk-RAQFCDSA.js";import"./chunk-GHOBFR25.js";import"./chunk-LEY7YUND.js";import"./chunk-VAW5CAKL.js";import"./chunk-W4T2JBHA.js";import"./chunk-6VNLT34U.js";import"./chunk-PKMWTI6A.js";import"./chunk-V3O2HLLM.js";import"./chunk-2CK4H4PK.js";import"./chunk-KN2A4UI3.js";import"./chunk-2DVAQSTR.js";import"./chunk-TMZXKUJ7.js";import"./chunk-4ZWCIZGW.js";import"./chunk-ZCHP3MYE.js";import"./chunk-ITXPPIKB.js";import"./chunk-JCKQGVLY.js";import"./chunk-SRASGVKV.js";import"./chunk-5TETHXKM.js";import"./chunk-GZPBQVE7.js";import"./chunk-B2GEUQZK.js";import"./chunk-C7WBA5UQ.js";import"./chunk-IZBV4PHK.js";import"./chunk-M2SCIUFO.js";import"./chunk-PGDMHBNI.js";import"./chunk-TIYOD65A.js";import"./chunk-PKANRYX6.js";import"./chunk-WLNBEVIM.js";import"./chunk-N45EUFA3.js";import"./chunk-DO57ZZNQ.js";import"./chunk-UTGGNDEF.js";import"./chunk-HE75YTAD.js";import"./chunk-TG4FTNP7.js";import"./chunk-VPAZW4IE.js";import"./chunk-QS2GJJXN.js";import"./chunk-MUJL7FQJ.js";import"./chunk-EKULWSLH.js";import"./chunk-KFMQ6GVV.js";import"./chunk-QPHGFD2Y.js";import"./chunk-HP4P4Z2R.js";import"./chunk-RSVFNNQ3.js";import"./chunk-XGBDEWZH.js";import"./chunk-NIZ3DLMN.js";import"./chunk-XPNMKQBN.js";import"./chunk-2VFZQK6H.js";import"./chunk-B4MC4X6R.js";import"./chunk-ZS3FCIDW.js";import"./chunk-JIPHTHEV.js";import"./chunk-EO6ZVYAU.js";import"./chunk-QHFNREED.js";import"./chunk-QTGI3NVE.js";import"./chunk-PUR6MQ67.js";import"./chunk-WLGZI23G.js";import"./chunk-BCZI2XYX.js";import"./chunk-OW25EIRT.js";import"./chunk-72VW33X6.js";import"./chunk-TTRVH5FY.js";import"./chunk-SVUYFOZB.js";import"./chunk-C4UW2SIM.js";import"./chunk-AG7KROZ7.js";import"./chunk-DNTASBVS.js";import"./chunk-FOT4BL2J.js";import"./chunk-ZTZIWYY7.js";import"./chunk-XIBMFQYW.js";import"./chunk-2JIMXGVJ.js";import"./chunk-W7UDHTT3.js";import"./chunk-Y6EQGSOI.js";import"./chunk-FF6M56TZ.js";import"./chunk-AITXKHH2.js";import"./chunk-2CMV52NX.js";import"./chunk-ZHSIL7EQ.js";import"./chunk-UCNHTX5Z.js";import"./chunk-OWNULEI4.js";import"./chunk-5HXEWEG7.js";import"./chunk-D7NTWXPI.js";import"./chunk-CW2G3GTX.js";import"./chunk-VPMBH7ED.js";import"./chunk-RBAETNMK.js";import"./chunk-6DJ3CL5E.js";import"./chunk-D4ZCQ4ZB.js";import"./chunk-SLMOCOVC.js";import"./chunk-WA3SGGGN.js";import"./chunk-ATTGRJIS.js";import"./chunk-I72JNYAW.js";import"./chunk-AMJO5MXW.js";import"./chunk-LERWLC26.js";import"./chunk-VBQRXBKN.js";import"./chunk-N7U6FF65.js";import"./chunk-UDQ657MP.js";import"./chunk-FNMPMXLQ.js";import"./chunk-SMV4XGKK.js";import"./chunk-2IXING64.js";import"./chunk-SFFASEUX.js";import"./chunk-TSAMHA74.js";import"./chunk-RNLPRU3L.js";import"./chunk-CCFDPXNH.js";import"./chunk-WTXODJNE.js";import"./chunk-HKVEG3TJ.js";import"./chunk-3Z2SL3LO.js";import"./chunk-A2J4PCL3.js";import"./chunk-ZAL7QAHA.js";import"./chunk-LSMPUXCK.js";import"./chunk-ZLXR3HBB.js";import"./chunk-MLFFVQ4H.js";import"./chunk-H7ZYEXEY.js";import"./chunk-6MVDPGZ3.js";import"./chunk-OUZK3JE3.js";import"./chunk-I4YHVXUS.js";import"./chunk-XAPIUMOF.js";import"./chunk-ILONVRIF.js";import"./chunk-VHQT6GPD.js";import"./chunk-JMTINDL5.js";import"./chunk-NKKHM6BH.js";import"./chunk-335U7CYZ.js";import"./chunk-L2TNAAQN.js";import"./chunk-WWRVMGI5.js";import"./chunk-ZJQQ5HGS.js";import"./chunk-YUQEO6UE.js";import"./chunk-KPGFYNDA.js";import"./chunk-CW3J33TN.js";import"./chunk-2HPZX3VT.js";import"./chunk-H2EJ2FXO.js";import"./chunk-27K5BE5C.js";import"./chunk-L6ZOAPPM.js";import"./chunk-2JMILQ6B.js";import"./chunk-FWGXBW4L.js";import"./chunk-GB2W6K7K.js";import"./chunk-MHSPATEG.js";import"./chunk-FODM75CC.js";import"./chunk-GZ3APDMX.js";import"./chunk-M4R7TXHA.js";import"./chunk-HPCIGI5Y.js";import"./chunk-F2I44VCA.js";import"./chunk-OJ7LTCWX.js";import"./chunk-XOIR265Z.js";import"./chunk-JDEUN4XM.js";import"./chunk-YKPUVWML.js";import"./chunk-KULXXWBI.js";import"./chunk-3U5632TD.js";import"./chunk-QQJTKUTN.js";import"./chunk-BJLZZSSQ.js";import"./chunk-B65HAB74.js";import"./chunk-FTY3DS4C.js";import"./chunk-5P6WZP6E.js";import"./chunk-2PXTM6RE.js";import"./chunk-AR6BFW4D.js";import"./chunk-U2LA4WCV.js";import"./chunk-L23DVICG.js";import"./chunk-77IJP7IA.js";import"./chunk-PEQWA434.js";import"./chunk-JQPBSXCG.js";import"./chunk-LYRW73XL.js";import"./chunk-ALC3I3V2.js";import{d as f}from"./chunk-A34ONGYR.js";var U=f(P(),1);var _=f(F(),1),R=!1,S=!1;function I(a,t){let o=document.getElementById(a);return o||(o=document.createElement("div"),o.id=a,o.style.position="absolute",o.style.zIndex=t,o.dataset.frameosEditorOwned="true",document.body.appendChild(o)),o}function x(a,t){if(S)throw new Error("mountFrameOSEditor: an editor is already mounted (the message bus is window-wide)");S=!0;let o=new URL("..",import.meta.url),s=window;s.FRAMEOS_EMBEDDED_NO_BACKEND=!0,s.ESBUILD_LOAD_CHUNKS=s.ESBUILD_LOAD_CHUNKS||function(){};let b=s.FRAMEOS_APP_CONFIG=s.FRAMEOS_APP_CONFIG||{};b.ingress_path=o.pathname.replace(/\/$/,"");let d=document.createElement("link");d.rel="stylesheet",d.href=new URL("./static/mount.css",o).href,document.head.appendChild(d);let w=I("modal","60"),g=I("popper","90"),n=document.documentElement,u=n.dataset.frameosTheme,C=n.style.colorScheme,m=t.theme??(window.matchMedia?.("(prefers-color-scheme: dark)").matches?"dark":"light");n.dataset.frameosTheme=m,n.style.colorScheme=m,R||(O({memoryRouter:!0}),R=!0);let i=t.scenes,p=!1,l=[],y=(r,e)=>({type:"frameos-editor:init",scenes:r,sceneId:e,mode:t.mode??"rpios",width:t.width??800,height:t.height??480,interval:t.interval??300,theme:m,previewProxyUrl:t.previewProxyUrl,description:t.description}),E=r=>{if(r.source!==window)return;let e=r.data;if(!(!e||typeof e!="object")){if(e.type==="frameos-editor:ready")p=!0,window.postMessage(y(i,t.sceneId),window.location.origin),t.onReady?.();else if(e.type==="frameos-editor:scenes"&&Array.isArray(e.scenes)){for(i=e.scenes;l.length>0;)l.shift()?.(e.scenes);t.onScenesChanged?.(e.scenes)}else if(e.type==="frameos-editor:save-screenshot"&&typeof e.dataUrl=="string"){if(!t.onSaveScreenshot)return;t.onSaveScreenshot(e.dataUrl,typeof e.sceneId=="string"?e.sceneId:null).catch(h=>({ok:!1,error:String(h)})).then(h=>{window.postMessage({type:"frameos-editor:screenshot-saved",...h},window.location.origin)})}}};window.addEventListener("message",E);let c=document.createElement("div");c.style.height="100%",a.appendChild(c);let v=U.default.createRoot(c);return v.render((0,_.jsx)(M,{})),{getScenesSync:()=>i,getScenes:()=>new Promise(r=>{if(!p){r(i);return}l.push(r),window.postMessage({type:"frameos-editor:get-scenes"},window.location.origin)}),setScenes:(r,e)=>{i=r,window.postMessage(y(r,e),window.location.origin)},selectScene:r=>{window.postMessage({type:"frameos-editor:select-scene",sceneId:r},window.location.origin)},destroy:()=>{window.removeEventListener("message",E),v.unmount(),c.remove(),d.remove(),w.dataset.frameosEditorOwned&&w.remove(),g.dataset.frameosEditorOwned&&g.remove(),u===void 0?delete n.dataset.frameosTheme:n.dataset.frameosTheme=u,n.style.colorScheme=C,S=!1}}}export{x as mountFrameOSEditor};
|
|
2
|
+
//# sourceMappingURL=mount-GJK3E4QX.js.map
|
package/dist/static/mount.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as P,b as O,c as F,d as M}from"./chunk-GC2ASTCL.js";import"./chunk-3BLCY6UO.js";import"./chunk-UQ47VFV7.js";import"./chunk-YVLZL2DF.js";import"./chunk-LJLSS6VP.js";import"./chunk-IO5HD6LR.js";import"./chunk-ISGRWLZB.js";import"./chunk-CMJLLXM5.js";import"./chunk-S7YZLIQ2.js";import"./chunk-QOR6RVYK.js";import"./chunk-IGSWCXWL.js";import"./chunk-XY25BMCC.js";import"./chunk-MYJDNFHV.js";import"./chunk-XX6D4PCV.js";import"./chunk-FFF5XN2E.js";import"./chunk-4E35PBBI.js";import"./chunk-I5YU2QOB.js";import"./chunk-NMLR6BBX.js";import"./chunk-OZMHIOOM.js";import"./chunk-VY54N476.js";import"./chunk-IAT3SH6V.js";import"./chunk-NKBKRXAI.js";import"./chunk-7WRUHYVT.js";import"./chunk-UQ2OIIDY.js";import"./chunk-SYSYBEFC.js";import"./chunk-P7EAYOW2.js";import"./chunk-UE65FKDK.js";import"./chunk-XRXYPYNZ.js";import"./chunk-2AMRXN7J.js";import"./chunk-MQ6GXGQP.js";import"./chunk-WXJNV4KM.js";import"./chunk-MMFEMX4D.js";import"./chunk-JMW7BC3H.js";import"./chunk-RIEQ6JT2.js";import"./chunk-76H6TNVU.js";import"./chunk-3PWLJ7VB.js";import"./chunk-RUT5KRF7.js";import"./chunk-PRLZJXP3.js";import"./chunk-UHBPDWMK.js";import"./chunk-PF2U73FX.js";import"./chunk-NLF7C362.js";import"./chunk-DNNQJI7D.js";import"./chunk-HYBSLNBW.js";import"./chunk-XA5PSH3Z.js";import"./chunk-BQIQDJSQ.js";import"./chunk-Q677WDQ5.js";import"./chunk-GQZ2XFQS.js";import"./chunk-6JGNP3CG.js";import"./chunk-KNM3LS47.js";import"./chunk-TQXNETKV.js";import"./chunk-K7SEZQEV.js";import"./chunk-35SNHSYE.js";import"./chunk-KI45N7NV.js";import"./chunk-YZMIVIZ5.js";import"./chunk-EXFFRG4T.js";import"./chunk-6ZBQJK6J.js";import"./chunk-2CR2MHW5.js";import"./chunk-YEUXEZFN.js";import"./chunk-GIOZPKCU.js";import"./chunk-RSVXJNBI.js";import"./chunk-6SG4JVGQ.js";import"./chunk-TOACPXU7.js";import"./chunk-OMEEZ2KP.js";import"./chunk-GQHVCGHB.js";import"./chunk-T24SSVPV.js";import"./chunk-T6RP4BD5.js";import"./chunk-4WRNN7GJ.js";import"./chunk-RUZ27PU2.js";import"./chunk-U5PEY4LZ.js";import"./chunk-ANIO6SZU.js";import"./chunk-7FDFD2RA.js";import"./chunk-2BO64G4N.js";import"./chunk-QFJGXGHG.js";import"./chunk-HCICVWA5.js";import"./chunk-SDHBPXRH.js";import"./chunk-7PUP564T.js";import"./chunk-FTRSNC63.js";import"./chunk-45FHXPEV.js";import"./chunk-LJCV6PN4.js";import"./chunk-YO6OY3Y3.js";import"./chunk-R7WVBZOR.js";import"./chunk-YA2PAOL6.js";import"./chunk-UMBBSV56.js";import"./chunk-KWJBJL5V.js";import"./chunk-YAIRCXNW.js";import"./chunk-5LOLNRAG.js";import"./chunk-OHNXNH3I.js";import"./chunk-YY6U53S3.js";import"./chunk-KDVTGBVQ.js";import"./chunk-NM5KCVND.js";import"./chunk-M52Y7THK.js";import"./chunk-UXYDP2GA.js";import"./chunk-5XO4Z6GR.js";import"./chunk-JQHJLBQS.js";import"./chunk-T3C76GSG.js";import"./chunk-ERWUOBST.js";import"./chunk-XMK64KOA.js";import"./chunk-XC57KLDG.js";import"./chunk-BQAFRR3J.js";import"./chunk-SJKWNSPY.js";import"./chunk-UZILS5FV.js";import"./chunk-BJQMVKVY.js";import"./chunk-3T3ARG3E.js";import"./chunk-5EHDUP6F.js";import"./chunk-R3CIFBZ5.js";import"./chunk-HV5HARVF.js";import"./chunk-TR4FEZFI.js";import"./chunk-2EHDYPYD.js";import"./chunk-DHGVBQ7P.js";import"./chunk-VSSLVNAR.js";import"./chunk-3PV5T5XU.js";import"./chunk-MTA7GLUS.js";import"./chunk-VTLK6Q27.js";import"./chunk-MBGDWTMS.js";import"./chunk-5QCMYUDE.js";import"./chunk-FMFLZD4C.js";import"./chunk-TRRBPBPW.js";import"./chunk-OJ3POHII.js";import"./chunk-MQZSDER5.js";import"./chunk-AO6PVYSP.js";import"./chunk-HUSYQ7O4.js";import"./chunk-WJVGIUKU.js";import"./chunk-2HSKHBQ3.js";import"./chunk-JF4IGMKP.js";import"./chunk-PEGTBE7W.js";import"./chunk-BROXBG6H.js";import"./chunk-7SX4UPLE.js";import"./chunk-ZFPGT7UB.js";import"./chunk-EKY6EZHW.js";import"./chunk-ZUBO4ZEH.js";import"./chunk-R53F7DXM.js";import"./chunk-K4DA7VO4.js";import"./chunk-QOEI2BB3.js";import"./chunk-ILLKJPPP.js";import"./chunk-LUKWWQ4Q.js";import"./chunk-UX2VV7NR.js";import"./chunk-NYPIF35V.js";import"./chunk-HDCXYMSE.js";import"./chunk-BJ5KKFRX.js";import"./chunk-35GGXXL4.js";import"./chunk-5HFCOS36.js";import"./chunk-BJ2H527R.js";import"./chunk-EXJ3TYPN.js";import"./chunk-22JI2C23.js";import"./chunk-FIBLU6JW.js";import"./chunk-PBWK4RSZ.js";import"./chunk-T4NNGQKH.js";import"./chunk-Y7GVIX2K.js";import"./chunk-UFBZ5RUP.js";import"./chunk-J43IOAV2.js";import"./chunk-G6BUUK3X.js";import"./chunk-RAQFCDSA.js";import"./chunk-GHOBFR25.js";import"./chunk-LEY7YUND.js";import"./chunk-VAW5CAKL.js";import"./chunk-W4T2JBHA.js";import"./chunk-6VNLT34U.js";import"./chunk-PKMWTI6A.js";import"./chunk-V3O2HLLM.js";import"./chunk-2CK4H4PK.js";import"./chunk-KN2A4UI3.js";import"./chunk-2DVAQSTR.js";import"./chunk-TMZXKUJ7.js";import"./chunk-4ZWCIZGW.js";import"./chunk-ZCHP3MYE.js";import"./chunk-ITXPPIKB.js";import"./chunk-JCKQGVLY.js";import"./chunk-SRASGVKV.js";import"./chunk-5TETHXKM.js";import"./chunk-GZPBQVE7.js";import"./chunk-B2GEUQZK.js";import"./chunk-C7WBA5UQ.js";import"./chunk-IZBV4PHK.js";import"./chunk-M2SCIUFO.js";import"./chunk-PGDMHBNI.js";import"./chunk-TIYOD65A.js";import"./chunk-PKANRYX6.js";import"./chunk-WLNBEVIM.js";import"./chunk-N45EUFA3.js";import"./chunk-DO57ZZNQ.js";import"./chunk-UTGGNDEF.js";import"./chunk-HE75YTAD.js";import"./chunk-TG4FTNP7.js";import"./chunk-VPAZW4IE.js";import"./chunk-QS2GJJXN.js";import"./chunk-MUJL7FQJ.js";import"./chunk-EKULWSLH.js";import"./chunk-KFMQ6GVV.js";import"./chunk-QPHGFD2Y.js";import"./chunk-HP4P4Z2R.js";import"./chunk-RSVFNNQ3.js";import"./chunk-XGBDEWZH.js";import"./chunk-NIZ3DLMN.js";import"./chunk-XPNMKQBN.js";import"./chunk-2VFZQK6H.js";import"./chunk-B4MC4X6R.js";import"./chunk-ZS3FCIDW.js";import"./chunk-JIPHTHEV.js";import"./chunk-EO6ZVYAU.js";import"./chunk-QHFNREED.js";import"./chunk-QTGI3NVE.js";import"./chunk-PUR6MQ67.js";import"./chunk-WLGZI23G.js";import"./chunk-BCZI2XYX.js";import"./chunk-OW25EIRT.js";import"./chunk-72VW33X6.js";import"./chunk-TTRVH5FY.js";import"./chunk-SVUYFOZB.js";import"./chunk-C4UW2SIM.js";import"./chunk-AG7KROZ7.js";import"./chunk-DNTASBVS.js";import"./chunk-FOT4BL2J.js";import"./chunk-ZTZIWYY7.js";import"./chunk-XIBMFQYW.js";import"./chunk-2JIMXGVJ.js";import"./chunk-W7UDHTT3.js";import"./chunk-Y6EQGSOI.js";import"./chunk-FF6M56TZ.js";import"./chunk-AITXKHH2.js";import"./chunk-2CMV52NX.js";import"./chunk-ZHSIL7EQ.js";import"./chunk-UCNHTX5Z.js";import"./chunk-OWNULEI4.js";import"./chunk-5HXEWEG7.js";import"./chunk-D7NTWXPI.js";import"./chunk-CW2G3GTX.js";import"./chunk-VPMBH7ED.js";import"./chunk-RBAETNMK.js";import"./chunk-6DJ3CL5E.js";import"./chunk-D4ZCQ4ZB.js";import"./chunk-SLMOCOVC.js";import"./chunk-WA3SGGGN.js";import"./chunk-ATTGRJIS.js";import"./chunk-I72JNYAW.js";import"./chunk-AMJO5MXW.js";import"./chunk-LERWLC26.js";import"./chunk-VBQRXBKN.js";import"./chunk-N7U6FF65.js";import"./chunk-UDQ657MP.js";import"./chunk-FNMPMXLQ.js";import"./chunk-SMV4XGKK.js";import"./chunk-2IXING64.js";import"./chunk-SFFASEUX.js";import"./chunk-TSAMHA74.js";import"./chunk-RNLPRU3L.js";import"./chunk-CCFDPXNH.js";import"./chunk-WTXODJNE.js";import"./chunk-HKVEG3TJ.js";import"./chunk-3Z2SL3LO.js";import"./chunk-A2J4PCL3.js";import"./chunk-ZAL7QAHA.js";import"./chunk-LSMPUXCK.js";import"./chunk-ZLXR3HBB.js";import"./chunk-MLFFVQ4H.js";import"./chunk-H7ZYEXEY.js";import"./chunk-6MVDPGZ3.js";import"./chunk-OUZK3JE3.js";import"./chunk-I4YHVXUS.js";import"./chunk-XAPIUMOF.js";import"./chunk-ILONVRIF.js";import"./chunk-VHQT6GPD.js";import"./chunk-JMTINDL5.js";import"./chunk-NKKHM6BH.js";import"./chunk-335U7CYZ.js";import"./chunk-L2TNAAQN.js";import"./chunk-WWRVMGI5.js";import"./chunk-ZJQQ5HGS.js";import"./chunk-YUQEO6UE.js";import"./chunk-KPGFYNDA.js";import"./chunk-CW3J33TN.js";import"./chunk-2HPZX3VT.js";import"./chunk-H2EJ2FXO.js";import"./chunk-27K5BE5C.js";import"./chunk-L6ZOAPPM.js";import"./chunk-2JMILQ6B.js";import"./chunk-FWGXBW4L.js";import"./chunk-GB2W6K7K.js";import"./chunk-MHSPATEG.js";import"./chunk-FODM75CC.js";import"./chunk-GZ3APDMX.js";import"./chunk-M4R7TXHA.js";import"./chunk-HPCIGI5Y.js";import"./chunk-F2I44VCA.js";import"./chunk-OJ7LTCWX.js";import"./chunk-XOIR265Z.js";import"./chunk-JDEUN4XM.js";import"./chunk-YKPUVWML.js";import"./chunk-KULXXWBI.js";import"./chunk-3U5632TD.js";import"./chunk-QQJTKUTN.js";import"./chunk-BJLZZSSQ.js";import"./chunk-B65HAB74.js";import"./chunk-FTY3DS4C.js";import"./chunk-5P6WZP6E.js";import"./chunk-2PXTM6RE.js";import"./chunk-AR6BFW4D.js";import"./chunk-U2LA4WCV.js";import"./chunk-L23DVICG.js";import"./chunk-77IJP7IA.js";import"./chunk-PEQWA434.js";import"./chunk-JQPBSXCG.js";import"./chunk-LYRW73XL.js";import"./chunk-ALC3I3V2.js";import{d as f}from"./chunk-A34ONGYR.js";var U=f(P(),1);var _=f(F(),1),R=!1,S=!1;function I(a,t){let o=document.getElementById(a);return o||(o=document.createElement("div"),o.id=a,o.style.position="absolute",o.style.zIndex=t,o.dataset.frameosEditorOwned="true",document.body.appendChild(o)),o}function x(a,t){if(S)throw new Error("mountFrameOSEditor: an editor is already mounted (the message bus is window-wide)");S=!0;let o=new URL("..",import.meta.url),s=window;s.FRAMEOS_EMBEDDED_NO_BACKEND=!0,s.ESBUILD_LOAD_CHUNKS=s.ESBUILD_LOAD_CHUNKS||function(){};let b=s.FRAMEOS_APP_CONFIG=s.FRAMEOS_APP_CONFIG||{};b.ingress_path=o.pathname.replace(/\/$/,"");let d=document.createElement("link");d.rel="stylesheet",d.href=new URL("./static/mount.css",o).href,document.head.appendChild(d);let w=I("modal","60"),g=I("popper","90"),n=document.documentElement,u=n.dataset.frameosTheme,C=n.style.colorScheme,m=t.theme??(window.matchMedia?.("(prefers-color-scheme: dark)").matches?"dark":"light");n.dataset.frameosTheme=m,n.style.colorScheme=m,R||(O({memoryRouter:!0}),R=!0);let i=t.scenes,p=!1,l=[],y=(r,e)=>({type:"frameos-editor:init",scenes:r,sceneId:e,mode:t.mode??"rpios",width:t.width??800,height:t.height??480,interval:t.interval??300,theme:m,previewProxyUrl:t.previewProxyUrl,description:t.description}),E=r=>{if(r.source!==window)return;let e=r.data;if(!(!e||typeof e!="object")){if(e.type==="frameos-editor:ready")p=!0,window.postMessage(y(i,t.sceneId),window.location.origin),t.onReady?.();else if(e.type==="frameos-editor:scenes"&&Array.isArray(e.scenes)){for(i=e.scenes;l.length>0;)l.shift()?.(e.scenes);t.onScenesChanged?.(e.scenes)}else if(e.type==="frameos-editor:save-screenshot"&&typeof e.dataUrl=="string"){if(!t.onSaveScreenshot)return;t.onSaveScreenshot(e.dataUrl,typeof e.sceneId=="string"?e.sceneId:null).catch(h=>({ok:!1,error:String(h)})).then(h=>{window.postMessage({type:"frameos-editor:screenshot-saved",...h},window.location.origin)})}}};window.addEventListener("message",E);let c=document.createElement("div");c.style.height="100%",a.appendChild(c);let v=U.default.createRoot(c);return v.render((0,_.jsx)(M,{})),{getScenesSync:()=>i,getScenes:()=>new Promise(r=>{if(!p){r(i);return}l.push(r),window.postMessage({type:"frameos-editor:get-scenes"},window.location.origin)}),setScenes:(r,e)=>{i=r,window.postMessage(y(r,e),window.location.origin)},selectScene:r=>{window.postMessage({type:"frameos-editor:select-scene",sceneId:r},window.location.origin)},destroy:()=>{window.removeEventListener("message",E),v.unmount(),c.remove(),d.remove(),w.dataset.frameosEditorOwned&&w.remove(),g.dataset.frameosEditorOwned&&g.remove(),u===void 0?delete n.dataset.frameosTheme:n.dataset.frameosTheme=u,n.style.colorScheme=C,S=!1}}}export{x as mountFrameOSEditor};
|
|
2
|
-
//# sourceMappingURL=mount-
|
|
1
|
+
import{a as P,b as O,c as F,d as M}from"./chunk-HFUAHA4L.js";import"./chunk-3BLCY6UO.js";import"./chunk-UQ47VFV7.js";import"./chunk-YVLZL2DF.js";import"./chunk-LJLSS6VP.js";import"./chunk-IO5HD6LR.js";import"./chunk-ISGRWLZB.js";import"./chunk-CMJLLXM5.js";import"./chunk-S7YZLIQ2.js";import"./chunk-QOR6RVYK.js";import"./chunk-IGSWCXWL.js";import"./chunk-XY25BMCC.js";import"./chunk-MYJDNFHV.js";import"./chunk-XX6D4PCV.js";import"./chunk-FFF5XN2E.js";import"./chunk-4E35PBBI.js";import"./chunk-I5YU2QOB.js";import"./chunk-NMLR6BBX.js";import"./chunk-OZMHIOOM.js";import"./chunk-VY54N476.js";import"./chunk-IAT3SH6V.js";import"./chunk-NKBKRXAI.js";import"./chunk-7WRUHYVT.js";import"./chunk-UQ2OIIDY.js";import"./chunk-SYSYBEFC.js";import"./chunk-P7EAYOW2.js";import"./chunk-UE65FKDK.js";import"./chunk-XRXYPYNZ.js";import"./chunk-2AMRXN7J.js";import"./chunk-MQ6GXGQP.js";import"./chunk-WXJNV4KM.js";import"./chunk-MMFEMX4D.js";import"./chunk-JMW7BC3H.js";import"./chunk-RIEQ6JT2.js";import"./chunk-76H6TNVU.js";import"./chunk-3PWLJ7VB.js";import"./chunk-RUT5KRF7.js";import"./chunk-PRLZJXP3.js";import"./chunk-UHBPDWMK.js";import"./chunk-PF2U73FX.js";import"./chunk-NLF7C362.js";import"./chunk-DNNQJI7D.js";import"./chunk-HYBSLNBW.js";import"./chunk-XA5PSH3Z.js";import"./chunk-BQIQDJSQ.js";import"./chunk-Q677WDQ5.js";import"./chunk-GQZ2XFQS.js";import"./chunk-6JGNP3CG.js";import"./chunk-KNM3LS47.js";import"./chunk-TQXNETKV.js";import"./chunk-K7SEZQEV.js";import"./chunk-35SNHSYE.js";import"./chunk-KI45N7NV.js";import"./chunk-YZMIVIZ5.js";import"./chunk-EXFFRG4T.js";import"./chunk-6ZBQJK6J.js";import"./chunk-2CR2MHW5.js";import"./chunk-YEUXEZFN.js";import"./chunk-GIOZPKCU.js";import"./chunk-RSVXJNBI.js";import"./chunk-6SG4JVGQ.js";import"./chunk-TOACPXU7.js";import"./chunk-OMEEZ2KP.js";import"./chunk-GQHVCGHB.js";import"./chunk-T24SSVPV.js";import"./chunk-T6RP4BD5.js";import"./chunk-4WRNN7GJ.js";import"./chunk-RUZ27PU2.js";import"./chunk-U5PEY4LZ.js";import"./chunk-ANIO6SZU.js";import"./chunk-7FDFD2RA.js";import"./chunk-2BO64G4N.js";import"./chunk-QFJGXGHG.js";import"./chunk-HCICVWA5.js";import"./chunk-SDHBPXRH.js";import"./chunk-7PUP564T.js";import"./chunk-FTRSNC63.js";import"./chunk-45FHXPEV.js";import"./chunk-LJCV6PN4.js";import"./chunk-YO6OY3Y3.js";import"./chunk-R7WVBZOR.js";import"./chunk-YA2PAOL6.js";import"./chunk-UMBBSV56.js";import"./chunk-KWJBJL5V.js";import"./chunk-YAIRCXNW.js";import"./chunk-5LOLNRAG.js";import"./chunk-OHNXNH3I.js";import"./chunk-YY6U53S3.js";import"./chunk-KDVTGBVQ.js";import"./chunk-NM5KCVND.js";import"./chunk-M52Y7THK.js";import"./chunk-UXYDP2GA.js";import"./chunk-5XO4Z6GR.js";import"./chunk-JQHJLBQS.js";import"./chunk-T3C76GSG.js";import"./chunk-ERWUOBST.js";import"./chunk-XMK64KOA.js";import"./chunk-XC57KLDG.js";import"./chunk-BQAFRR3J.js";import"./chunk-SJKWNSPY.js";import"./chunk-UZILS5FV.js";import"./chunk-BJQMVKVY.js";import"./chunk-3T3ARG3E.js";import"./chunk-5EHDUP6F.js";import"./chunk-R3CIFBZ5.js";import"./chunk-HV5HARVF.js";import"./chunk-TR4FEZFI.js";import"./chunk-2EHDYPYD.js";import"./chunk-DHGVBQ7P.js";import"./chunk-VSSLVNAR.js";import"./chunk-3PV5T5XU.js";import"./chunk-MTA7GLUS.js";import"./chunk-VTLK6Q27.js";import"./chunk-MBGDWTMS.js";import"./chunk-5QCMYUDE.js";import"./chunk-FMFLZD4C.js";import"./chunk-TRRBPBPW.js";import"./chunk-OJ3POHII.js";import"./chunk-MQZSDER5.js";import"./chunk-AO6PVYSP.js";import"./chunk-HUSYQ7O4.js";import"./chunk-WJVGIUKU.js";import"./chunk-2HSKHBQ3.js";import"./chunk-JF4IGMKP.js";import"./chunk-PEGTBE7W.js";import"./chunk-BROXBG6H.js";import"./chunk-7SX4UPLE.js";import"./chunk-ZFPGT7UB.js";import"./chunk-EKY6EZHW.js";import"./chunk-ZUBO4ZEH.js";import"./chunk-R53F7DXM.js";import"./chunk-K4DA7VO4.js";import"./chunk-QOEI2BB3.js";import"./chunk-ILLKJPPP.js";import"./chunk-LUKWWQ4Q.js";import"./chunk-UX2VV7NR.js";import"./chunk-NYPIF35V.js";import"./chunk-HDCXYMSE.js";import"./chunk-BJ5KKFRX.js";import"./chunk-35GGXXL4.js";import"./chunk-5HFCOS36.js";import"./chunk-BJ2H527R.js";import"./chunk-EXJ3TYPN.js";import"./chunk-22JI2C23.js";import"./chunk-FIBLU6JW.js";import"./chunk-PBWK4RSZ.js";import"./chunk-T4NNGQKH.js";import"./chunk-Y7GVIX2K.js";import"./chunk-UFBZ5RUP.js";import"./chunk-J43IOAV2.js";import"./chunk-G6BUUK3X.js";import"./chunk-RAQFCDSA.js";import"./chunk-GHOBFR25.js";import"./chunk-LEY7YUND.js";import"./chunk-VAW5CAKL.js";import"./chunk-W4T2JBHA.js";import"./chunk-6VNLT34U.js";import"./chunk-PKMWTI6A.js";import"./chunk-V3O2HLLM.js";import"./chunk-2CK4H4PK.js";import"./chunk-KN2A4UI3.js";import"./chunk-2DVAQSTR.js";import"./chunk-TMZXKUJ7.js";import"./chunk-4ZWCIZGW.js";import"./chunk-ZCHP3MYE.js";import"./chunk-ITXPPIKB.js";import"./chunk-JCKQGVLY.js";import"./chunk-SRASGVKV.js";import"./chunk-5TETHXKM.js";import"./chunk-GZPBQVE7.js";import"./chunk-B2GEUQZK.js";import"./chunk-C7WBA5UQ.js";import"./chunk-IZBV4PHK.js";import"./chunk-M2SCIUFO.js";import"./chunk-PGDMHBNI.js";import"./chunk-TIYOD65A.js";import"./chunk-PKANRYX6.js";import"./chunk-WLNBEVIM.js";import"./chunk-N45EUFA3.js";import"./chunk-DO57ZZNQ.js";import"./chunk-UTGGNDEF.js";import"./chunk-HE75YTAD.js";import"./chunk-TG4FTNP7.js";import"./chunk-VPAZW4IE.js";import"./chunk-QS2GJJXN.js";import"./chunk-MUJL7FQJ.js";import"./chunk-EKULWSLH.js";import"./chunk-KFMQ6GVV.js";import"./chunk-QPHGFD2Y.js";import"./chunk-HP4P4Z2R.js";import"./chunk-RSVFNNQ3.js";import"./chunk-XGBDEWZH.js";import"./chunk-NIZ3DLMN.js";import"./chunk-XPNMKQBN.js";import"./chunk-2VFZQK6H.js";import"./chunk-B4MC4X6R.js";import"./chunk-ZS3FCIDW.js";import"./chunk-JIPHTHEV.js";import"./chunk-EO6ZVYAU.js";import"./chunk-QHFNREED.js";import"./chunk-QTGI3NVE.js";import"./chunk-PUR6MQ67.js";import"./chunk-WLGZI23G.js";import"./chunk-BCZI2XYX.js";import"./chunk-OW25EIRT.js";import"./chunk-72VW33X6.js";import"./chunk-TTRVH5FY.js";import"./chunk-SVUYFOZB.js";import"./chunk-C4UW2SIM.js";import"./chunk-AG7KROZ7.js";import"./chunk-DNTASBVS.js";import"./chunk-FOT4BL2J.js";import"./chunk-ZTZIWYY7.js";import"./chunk-XIBMFQYW.js";import"./chunk-2JIMXGVJ.js";import"./chunk-W7UDHTT3.js";import"./chunk-Y6EQGSOI.js";import"./chunk-FF6M56TZ.js";import"./chunk-AITXKHH2.js";import"./chunk-2CMV52NX.js";import"./chunk-ZHSIL7EQ.js";import"./chunk-UCNHTX5Z.js";import"./chunk-OWNULEI4.js";import"./chunk-5HXEWEG7.js";import"./chunk-D7NTWXPI.js";import"./chunk-CW2G3GTX.js";import"./chunk-VPMBH7ED.js";import"./chunk-RBAETNMK.js";import"./chunk-6DJ3CL5E.js";import"./chunk-D4ZCQ4ZB.js";import"./chunk-SLMOCOVC.js";import"./chunk-WA3SGGGN.js";import"./chunk-ATTGRJIS.js";import"./chunk-I72JNYAW.js";import"./chunk-AMJO5MXW.js";import"./chunk-LERWLC26.js";import"./chunk-VBQRXBKN.js";import"./chunk-N7U6FF65.js";import"./chunk-UDQ657MP.js";import"./chunk-FNMPMXLQ.js";import"./chunk-SMV4XGKK.js";import"./chunk-2IXING64.js";import"./chunk-SFFASEUX.js";import"./chunk-TSAMHA74.js";import"./chunk-RNLPRU3L.js";import"./chunk-CCFDPXNH.js";import"./chunk-WTXODJNE.js";import"./chunk-HKVEG3TJ.js";import"./chunk-3Z2SL3LO.js";import"./chunk-A2J4PCL3.js";import"./chunk-ZAL7QAHA.js";import"./chunk-LSMPUXCK.js";import"./chunk-ZLXR3HBB.js";import"./chunk-MLFFVQ4H.js";import"./chunk-H7ZYEXEY.js";import"./chunk-6MVDPGZ3.js";import"./chunk-OUZK3JE3.js";import"./chunk-I4YHVXUS.js";import"./chunk-XAPIUMOF.js";import"./chunk-ILONVRIF.js";import"./chunk-VHQT6GPD.js";import"./chunk-JMTINDL5.js";import"./chunk-NKKHM6BH.js";import"./chunk-335U7CYZ.js";import"./chunk-L2TNAAQN.js";import"./chunk-WWRVMGI5.js";import"./chunk-ZJQQ5HGS.js";import"./chunk-YUQEO6UE.js";import"./chunk-KPGFYNDA.js";import"./chunk-CW3J33TN.js";import"./chunk-2HPZX3VT.js";import"./chunk-H2EJ2FXO.js";import"./chunk-27K5BE5C.js";import"./chunk-L6ZOAPPM.js";import"./chunk-2JMILQ6B.js";import"./chunk-FWGXBW4L.js";import"./chunk-GB2W6K7K.js";import"./chunk-MHSPATEG.js";import"./chunk-FODM75CC.js";import"./chunk-GZ3APDMX.js";import"./chunk-M4R7TXHA.js";import"./chunk-HPCIGI5Y.js";import"./chunk-F2I44VCA.js";import"./chunk-OJ7LTCWX.js";import"./chunk-XOIR265Z.js";import"./chunk-JDEUN4XM.js";import"./chunk-YKPUVWML.js";import"./chunk-KULXXWBI.js";import"./chunk-3U5632TD.js";import"./chunk-QQJTKUTN.js";import"./chunk-BJLZZSSQ.js";import"./chunk-B65HAB74.js";import"./chunk-FTY3DS4C.js";import"./chunk-5P6WZP6E.js";import"./chunk-2PXTM6RE.js";import"./chunk-AR6BFW4D.js";import"./chunk-U2LA4WCV.js";import"./chunk-L23DVICG.js";import"./chunk-77IJP7IA.js";import"./chunk-PEQWA434.js";import"./chunk-JQPBSXCG.js";import"./chunk-LYRW73XL.js";import"./chunk-ALC3I3V2.js";import{d as f}from"./chunk-A34ONGYR.js";var U=f(P(),1);var _=f(F(),1),R=!1,S=!1;function I(a,t){let o=document.getElementById(a);return o||(o=document.createElement("div"),o.id=a,o.style.position="absolute",o.style.zIndex=t,o.dataset.frameosEditorOwned="true",document.body.appendChild(o)),o}function x(a,t){if(S)throw new Error("mountFrameOSEditor: an editor is already mounted (the message bus is window-wide)");S=!0;let o=new URL("..",import.meta.url),s=window;s.FRAMEOS_EMBEDDED_NO_BACKEND=!0,s.ESBUILD_LOAD_CHUNKS=s.ESBUILD_LOAD_CHUNKS||function(){};let b=s.FRAMEOS_APP_CONFIG=s.FRAMEOS_APP_CONFIG||{};b.ingress_path=o.pathname.replace(/\/$/,"");let d=document.createElement("link");d.rel="stylesheet",d.href=new URL("./static/mount.css",o).href,document.head.appendChild(d);let w=I("modal","60"),g=I("popper","90"),n=document.documentElement,u=n.dataset.frameosTheme,C=n.style.colorScheme,m=t.theme??(window.matchMedia?.("(prefers-color-scheme: dark)").matches?"dark":"light");n.dataset.frameosTheme=m,n.style.colorScheme=m,R||(O({memoryRouter:!0}),R=!0);let i=t.scenes,p=!1,l=[],y=(r,e)=>({type:"frameos-editor:init",scenes:r,sceneId:e,mode:t.mode??"rpios",width:t.width??800,height:t.height??480,interval:t.interval??300,theme:m,previewProxyUrl:t.previewProxyUrl,description:t.description}),E=r=>{if(r.source!==window)return;let e=r.data;if(!(!e||typeof e!="object")){if(e.type==="frameos-editor:ready")p=!0,window.postMessage(y(i,t.sceneId),window.location.origin),t.onReady?.();else if(e.type==="frameos-editor:scenes"&&Array.isArray(e.scenes)){for(i=e.scenes;l.length>0;)l.shift()?.(e.scenes);t.onScenesChanged?.(e.scenes)}else if(e.type==="frameos-editor:save-screenshot"&&typeof e.dataUrl=="string"){if(!t.onSaveScreenshot)return;t.onSaveScreenshot(e.dataUrl,typeof e.sceneId=="string"?e.sceneId:null).catch(h=>({ok:!1,error:String(h)})).then(h=>{window.postMessage({type:"frameos-editor:screenshot-saved",...h},window.location.origin)})}}};window.addEventListener("message",E);let c=document.createElement("div");c.style.height="100%",a.appendChild(c);let v=U.default.createRoot(c);return v.render((0,_.jsx)(M,{})),{getScenesSync:()=>i,getScenes:()=>new Promise(r=>{if(!p){r(i);return}l.push(r),window.postMessage({type:"frameos-editor:get-scenes"},window.location.origin)}),setScenes:(r,e)=>{i=r,window.postMessage(y(r,e),window.location.origin)},selectScene:r=>{window.postMessage({type:"frameos-editor:select-scene",sceneId:r},window.location.origin)},destroy:()=>{window.removeEventListener("message",E),v.unmount(),c.remove(),d.remove(),w.dataset.frameosEditorOwned&&w.remove(),g.dataset.frameosEditorOwned&&g.remove(),u===void 0?delete n.dataset.frameosTheme:n.dataset.frameosTheme=u,n.style.colorScheme=C,S=!1}}}export{x as mountFrameOSEditor};
|
|
2
|
+
//# sourceMappingURL=mount-GJK3E4QX.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "frameos-editor",
|
|
3
|
-
"version": "2026.9.
|
|
3
|
+
"version": "2026.9.5",
|
|
4
4
|
"description": "The FrameOS visual scene editor as an embeddable static bundle: serve it from any host, embed it in an iframe, and exchange scenes JSON over postMessage.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"frameos",
|