framer-api 0.0.1-beta.2 → 0.0.1-beta.3
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.js +7 -7
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { WebSocket } from 'unenv/node/http';
|
|
2
|
-
import
|
|
2
|
+
import Ho from 'unenv/node/process';
|
|
3
3
|
import * as nt from 'devalue';
|
|
4
4
|
|
|
5
|
-
/* Framer API SDK v0.0.1-beta.
|
|
6
|
-
var
|
|
5
|
+
/* Framer API SDK v0.0.1-beta.3 */
|
|
6
|
+
var Nr=Object.defineProperty;var r=(i,e)=>Nr(i,"name",{value:e,configurable:true});function at(i){return i!==undefined}r(at,"isDefined");function Ui(i){return i===undefined}r(Ui,"isUndefined");function x(i){return i===null}r(x,"isNull");function Oi(i){return i!==null}r(Oi,"isNotNull");function be(i){return i===true||i===false}r(be,"isBoolean");function g(i){return typeof i=="string"}r(g,"isString");function K(i){return typeof i=="number"&&Number.isFinite(i)}r(K,"isNumber");function kr(i){return typeof i=="function"}r(kr,"isFunction");function v(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}r(v,"isObject");function st(i){if(typeof i!="object"||i===null)return false;let e=Object.getPrototypeOf(i);return e===null||e===Object.prototype}r(st,"isPlainObject");function Bt(i){return Array.isArray(i)}r(Bt,"isArray");function lt(i,e){throw e||new Error(i?`Unexpected value: ${i}`:"Application entered invalid state")}r(lt,"assertNever");function m(i,...e){if(i)return;let t=Error("Assertion Error"+(e.length>0?": "+e.join(" "):""));if(t.stack)try{let n=t.stack.split(`
|
|
7
7
|
`);n[1]?.includes("assert")?(n.splice(1,1),t.stack=n.join(`
|
|
8
8
|
`)):n[0]?.includes("assert")&&(n.splice(0,1),t.stack=n.join(`
|
|
9
|
-
`));}catch{}throw t}r(m,"assert");function S(i){for(let e of Reflect.ownKeys(i)){let t=i[e];!t||typeof t!="object"&&!vr(t)||S(t);}return Object.freeze(i)}r(S,"deepFreeze");function Oi(i){return [i.slice(0,-1),i.at(-1)]}r(Oi,"splitRestAndLast");var c="__class";var Ut=Symbol(),Ot=Symbol(),Nr=Symbol(),kr=Symbol(),Mr=Symbol(),Er=Symbol(),zt=Symbol(),Gt=Symbol(),l={getAiServiceInfo:Ut,sendTrackingEvent:Ot,environmentInfo:Nr,showUncheckedPermissionToasts:kr,marshal:Mr,unmarshal:Er,getHTMLForNode:zt,setHTMLForNode:Gt},dt="INTERNAL_",ut=`${dt}getAiServiceInfo`,ct=`${dt}sendTrackingEvent`,se=`${dt}getHTMLForNode`,le=`${dt}setHTMLForNode`;var N=class{static{r(this,"VariableBase");}#e;#t;get nodeId(){return this.#t.nodeId}get nodeType(){return this.#t.nodeType}get id(){return this.#t.id}get name(){return this.#t.name}get description(){return this.#t.description??null}constructor(e,t){this.#e=e,this.#t=t;}async setAttributes(e){let t=await this.#e.invoke("updateVariable",this.nodeId,this.id,{...e,type:this.type});if(x(t))return null;let n=this.constructor;return new n(this.#e,t)}async remove(){await this.#e.invoke("removeVariables",this.nodeId,[this.id]);}},M="Variable";function E(i){let e=i.at(0);return m(!Bi(e)),`${e.toLowerCase()}${i.slice(1,-M.length)}`}r(E,"classToType");var Vr=`Boolean${M}`,Ar=E(Vr),xe=class i extends N{static{r(this,"BooleanVariable");}type=Ar;#e;constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new i(e,t)}[l.marshal](){return this.#e}},wr=`Number${M}`,Wr=E(wr),Ce=class i extends N{static{r(this,"NumberVariable");}type=Wr;#e;constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new i(e,t)}[l.marshal](){return this.#e}},Lr=`String${M}`,Rr=E(Lr),Ie=class i extends N{static{r(this,"StringVariable");}type=Rr;#e;constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new i(e,t)}[l.marshal](){return this.#e}},Br=`FormattedText${M}`,Ur=E(Br),Te=class i extends N{static{r(this,"FormattedTextVariable");}type=Ur;#e;constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new i(e,t)}[l.marshal](){return this.#e}},Or=`Enum${M}`,zr=E(Or),$=class i{static{r(this,"EnumCase");}#e;#t;#i;#n;get id(){return this.#n.id}get name(){return this.#n.name}get nameByLocale(){return this.#n.nameByLocale}constructor(e,t,n,o){this.#e=e,this.#t=t,this.#i=n,this.#n=o;}async setAttributes(e){let t=await this.#e.invoke("updateEnumCase",this.#t,this.#i,this.id,e);return t?new i(this.#e,this.#t,this.#i,t):null}async remove(){await this.#e.invoke("removeEnumCase",this.#t,this.#i,this.id);}},Pe=class i extends N{static{r(this,"EnumVariable");}type=zr;#e;#t;#i;get cases(){return this.#i||(this.#i=S(this.#t.cases.map(e=>new $(this.#e,this.nodeId,this.id,e)))),this.#i}constructor(e,t){super(e,t),this.#e=e,this.#t=t;}static[l.unmarshal](e,t){return new i(e,t)}[l.marshal](){return this.#t}async addCase(e){let t=await this.#e.invoke("addEnumCase",this.nodeId,this.id,e);return t?new $(this.#e,this.nodeId,this.id,t):null}async setCaseOrder(e){await this.#e.invoke("setEnumCaseOrder",this.nodeId,this.id,e);}},Gr=`Color${M}`,Kr=E(Gr),Se=class i extends N{static{r(this,"ColorVariable");}type=Kr;#e;constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new i(e,t)}[l.marshal](){return this.#e}},$r=`Image${M}`,Hr=E($r),Fe=class i extends N{static{r(this,"ImageVariable");}type=Hr;#e;constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new i(e,t)}[l.marshal](){return this.#e}},jr=`File${M}`,_r=E(jr),De=class i extends N{static{r(this,"FileVariable");}type=_r;#e;get allowedFileTypes(){return this.#e.allowedFileTypes}constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new i(e,t)}[l.marshal](){return this.#e}},qr=`Link${M}`,Yr=E(qr),ve=class i extends N{static{r(this,"LinkVariable");}type=Yr;#e;constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new i(e,t)}[l.marshal](){return this.#e}},Xr=`Date${M}`,Zr=E(Xr),Ne=class i extends N{static{r(this,"DateVariable");}type=Zr;#e;constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new i(e,t)}[l.marshal](){return this.#e}},Jr=`Border${M}`,Qr=E(Jr),ke=class i extends N{static{r(this,"BorderVariable");}type=Qr;#e;constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new i(e,t)}[l.marshal](){return this.#e}},eo=`Unsupported${M}`,to=E(eo),Me=class i extends N{static{r(this,"UnsupportedVariable");}type=to;#e;constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new i(e,t)}[l.marshal](){return this.#e}};function zi(i){return i instanceof N}r(zi,"isVariable");function io(i){return zi(i)&&i.nodeType==="component"}r(io,"isComponentVariable");var W=class{static{r(this,"FieldBase");}#e;#t;#i;get id(){return this.#i.id}get name(){return this.#i.name}constructor(e,t,n){this.#e=e,this.#t=t,this.#i=n;}async setAttributes(e){let t={...e,type:this.type,id:this.id},[n]=await this.#e.invoke("addCollectionFields2",this.#t,[t]);if(m(at(n)),x(n))return null;m(n.type===this.type);let o=this.constructor;return new o(this.#e,this.#t,n)}async remove(){await this.#e.invoke("removeCollectionFields",this.#t,[this.id]);}},A=class extends W{static{r(this,"FieldBaseWithRequired");}#e;get required(){return this.#e.required}constructor(e,t,n){super(e,t,n),this.#e=n;}},pt=class extends W{static{r(this,"BooleanField");}type=Ht},mt=class extends W{static{r(this,"ColorField");}type=jt},gt=class extends W{static{r(this,"NumberField");}type=_t},ft=class extends A{static{r(this,"StringField");}type=qt;#e;constructor(e,t,n){super(e,t,n),this.#e=n;}get basedOn(){return this.#e.basedOn}},yt=class extends A{static{r(this,"FormattedTextField");}type=Yt},Ee=class extends A{static{r(this,"ImageField");}type=Xt},ht=class extends A{static{r(this,"LinkField");}type=Jt},bt=class extends A{static{r(this,"DateField");}type=Qt},xt=class extends W{static{r(this,"FieldDivider");}type=ri},Ve=class extends W{static{r(this,"UnsupportedField");}type=oi},Ct=class extends A{static{r(this,"FileField");}type=ei;#e;get allowedFileTypes(){return this.#e.allowedFileTypes}constructor(e,t,n){super(e,t,n),this.#e=n;}},It=class extends W{static{r(this,"EnumField");}type=ti;#e;#t;#i;#n;get cases(){return this.#n||(this.#n=this.#i.cases.map(e=>new $(this.#e,this.#t,this.id,e)),S(this.#n)),this.#n}constructor(e,t,n){super(e,t,n),this.#e=e,this.#t=t,this.#i=n;}async addCase(e){let t=await this.#e.invoke("addEnumCase",this.#t,this.id,e);return t?new $(this.#e,this.#t,this.id,t):null}async setCaseOrder(e){await this.#e.invoke("setEnumCaseOrder",this.#t,this.id,e);}},Tt=class extends A{static{r(this,"CollectionReferenceField");}type=ii;#e;get collectionId(){return this.#e.collectionId}constructor(e,t,n){super(e,t,n),this.#e=n;}},Pt=class extends A{static{r(this,"MultiCollectionReferenceField");}type=ni;#e;get collectionId(){return this.#e.collectionId}constructor(e,t,n){super(e,t,n),this.#e=n;}},Kt=class extends A{static{r(this,"ArrayField");}type=Zt;fields;constructor(e,t,n){super(e,t,n);let o=n.fields[0];this.fields=[new Ee(e,t,o)];}};function $t(i,e,t){return i.map(n=>{switch(n.type){case Ht:return new pt(e,t,n);case jt:return new mt(e,t,n);case _t:return new gt(e,t,n);case qt:return new ft(e,t,n);case Yt:return new yt(e,t,n);case Xt:return new Ee(e,t,n);case Jt:return new ht(e,t,n);case Qt:return new bt(e,t,n);case ri:return new xt(e,t,n);case oi:return new Ve(e,t,n);case ei:return new Ct(e,t,n);case ti:return new It(e,t,n);case ii:return new Tt(e,t,n);case ni:return new Pt(e,t,n);case Zt:return new Kt(e,t,n);default:return new Ve(e,t,n)}})}r($t,"fieldDefinitionDataArrayToFieldClassInstances");function no(i){return i instanceof W}r(no,"isField");var Gi="action";function ro(i){return !!i&&Gi in i&&g(i[Gi])}r(ro,"isLocalizedValueUpdate");function Ki(i){return Object.keys(i).reduce((e,t)=>{let n=i[t];return ro(n)&&(e[t]=n),e},{})}r(Ki,"filterInlineLocalizationValues");var Ae=class i{static{r(this,"FileAsset");}id;url;extension;constructor(e){this.url=e.url,this.id=e.id,this.extension=e.extension;}static[l.unmarshal](e,t){return new i(t)}[l.marshal](){return {[c]:"FileAsset",id:this.id,url:this.url,extension:this.extension}}};function oo(i){return i instanceof Ae}r(oo,"isFileAsset");var ao="ImageAsset";function $i(i){return v(i)?i[c]===ao:false}r($i,"isImageAssetData");var H=class i{static{r(this,"ImageAsset");}id;url;thumbnailUrl;altText;resolution;#e;#t;constructor(e,t){this.#t=e,this.url=t.url,this.id=t.id,this.thumbnailUrl=t.thumbnailUrl,this.altText=t.altText,this.resolution=t.resolution;}static[l.unmarshal](e,t){return new i(e,t)}[l.marshal](){return {[c]:"ImageAsset",id:this.id,url:this.url,thumbnailUrl:this.thumbnailUrl,altText:this.altText,resolution:this.resolution}}cloneWithAttributes({altText:e,resolution:t}){return new i(this.#t,{[c]:"ImageAsset",id:this.id,url:this.url,thumbnailUrl:this.thumbnailUrl,altText:e??this.altText,resolution:t??this.resolution})}async measure(){return uo(this.url)}async getData(){if(this.#e&&this.#e.bytes.length>0)return this.#e;let e=await this.#t.invoke("getImageData",{id:this.id,resolution:this.resolution});if(!e)throw new Error("Failed to load image data");return this.#e=e,e}async loadBitmap(){let{mimeType:e,bytes:t}=await this.getData(),n=new Blob([t],{type:e});return createImageBitmap(n)}async loadImage(){let e=await this.getData(),t=URL.createObjectURL(new Blob([e.bytes]));return new Promise((n,o)=>{let a=new Image;a.onload=()=>n(a),a.onerror=()=>o(),a.src=t;})}};function so(i){return i instanceof H}r(so,"isImageAsset");function j(i){return i.type==="bytes"?[i.bytes.buffer]:[]}r(j,"getTransferable");function lo(i){if(!v(i))return false;let e="bytes",t="mimeType";return !(!(e in i)||!(t in i)||!(i[e]instanceof Uint8Array)||!g(i[t]))}r(lo,"isBytesData");async function we(i){if(i instanceof File)return li(i);let e=await Hi(i.image);return {name:i.name,altText:i.altText,resolution:i.resolution,preferredImageRendering:i.preferredImageRendering,...e}}r(we,"createImageTransferFromInput");async function ai(i){if(i instanceof File)return li(i);let e=await Hi(i.file);return {name:i.name,...e}}r(ai,"createFileTransferFromInput");async function Hi(i){return i instanceof File?li(i):lo(i)?{type:"bytes",mimeType:i.mimeType,bytes:i.bytes}:{type:"url",url:i}}r(Hi,"createAssetTransferFromAssetInput");function si(i){return Promise.all(i.map(we))}r(si,"createNamedAssetDataTransferFromInput");async function li(i){return new Promise((e,t)=>{let n=new FileReader;n.onload=o=>{let a=i.type,s=o.target?.result;if(!s||!(s instanceof ArrayBuffer)){t(new Error("Failed to read file, arrayBuffer is null"));return}let d=new Uint8Array(s);e({bytes:d,mimeType:a,type:"bytes",name:i.name});},n.onerror=o=>{t(o);},n.readAsArrayBuffer(i);})}r(li,"getAssetDataFromFile");async function uo(i){let e=i instanceof File,t=e?URL.createObjectURL(i):i,n=new Image;return n.crossOrigin="anonymous",new Promise((o,a)=>{n.onload=()=>{o({width:n.naturalWidth,height:n.naturalHeight});},n.onerror=s=>{a(s);},n.src=t;}).finally(()=>{e&&URL.revokeObjectURL(t);})}r(uo,"measureImage");var St=class{static{r(this,"ComputedValueBase");}};var co="unsupported",We=class i extends St{static{r(this,"UnsupportedComputedValue");}type=co;#e;constructor(e){super(),this.#e=e;}static[l.unmarshal](e,t){return new i(t)}[l.marshal](){return this.#e}};function po(i){return i instanceof St}r(po,"isComputedValue");var mo="Font";function _i(i){return v(i)&&i[c]===mo}r(_i,"isFontData");function go(i){if(!K(i))return false;switch(i){case 100:case 200:case 300:case 400:case 500:case 600:case 700:case 800:case 900:return true;default:return false}}r(go,"isFontWeight");function fo(i){if(!g(i))return false;switch(i){case "normal":case "italic":return true;default:return false}}r(fo,"isFontStyle");function qi(i){return v(i)?g(i.family)&&g(i.selector)&&go(i.weight)&&fo(i.style):false}r(qi,"isFont");var U=class i{static{r(this,"Font");}selector;family;weight;style;constructor(e){this.selector=e.selector,this.family=e.family,this.weight=e.weight,this.style=e.style;}static[l.unmarshal](e,t){let n=ji.get(t.selector);if(n)return n;let o=new i(t);return ji.set(t.selector,o),o}[l.marshal](){return {[c]:"Font",selector:this.selector,family:this.family,weight:this.weight,style:this.style}}},ji=new Map;var yo="LinearGradient",ho="RadialGradient",bo="ConicGradient",de=class{static{r(this,"GradientBase");}#e;get stops(){return this.#e.stops}constructor(e){this.#e=e;}cloneWithAttributes(e){let t=this.constructor;return new t({...this.#e,...e})}},Le=class i extends de{static{r(this,"LinearGradient");}[c]=yo;#e;get angle(){return this.#e.angle}constructor(e){super(e),this.#e=e;}static[l.unmarshal](e,t){return new i({...t,stops:h(e,t.stops)})}[l.marshal](){return L({...this.#e,[c]:this[c]})}toCSS(){let e=this.#e.stops.map(t=>(m(g(t.color),"ColorStyle not supported yet"),`${t.color} ${t.position*100}%`)).join(", ");return `linear-gradient(${this.angle}deg, ${e})`}},Re=class i extends de{static{r(this,"RadialGradient");}[c]=ho;#e;get width(){return this.#e.width}get height(){return this.#e.height}get x(){return this.#e.x}get y(){return this.#e.y}constructor(e){super(e),this.#e=e;}static[l.unmarshal](e,t){return new i({...t,stops:h(e,t.stops)})}[l.marshal](){return L({...this.#e,[c]:this[c]})}toCSS(){let e=this.stops.map((t,n)=>{m(g(t.color),"ColorStyle not supported yet");let o=this.stops[n+1],a=t.position===1&&o?.position===1?t.position-1e-4:t.position;return `${t.color} ${a*100}%`}).join(", ");return `radial-gradient(${this.width} ${this.height} at ${this.x} ${this.y}, ${e})`}},Be=class i extends de{static{r(this,"ConicGradient");}[c]=bo;#e;get angle(){return this.#e.angle}get x(){return this.#e.x}get y(){return this.#e.y}constructor(e){super(e),this.#e=e;}static[l.unmarshal](e,t){return new i({...t,stops:h(e,t.stops)})}[l.marshal](){return L({...this.#e,[c]:this[c]})}toCSS(){let e=this.stops.map(t=>(m(g(t.color),"ColorStyle not supported yet"),`${t.color} ${t.position*360}deg`)).join(", ");return `conic-gradient(from ${this.angle}deg at ${this.x} ${this.y}, ${e})`}};function Yi(i){return i instanceof de}r(Yi,"isGradient");var xo="ColorStyle";function Ft(i){return v(i)?i[c]===xo:false}r(Ft,"isColorStyleData");var Z=class i{static{r(this,"ColorStyle");}id;name;path;light;dark;#e;constructor(e,t){this.id=t.id,this.name=t.name,this.light=t.light,this.dark=t.dark,this.path=t.path,this.#e=e;}static[l.unmarshal](e,t){return new i(e,t)}[l.marshal](){return {[c]:"ColorStyle",id:this.id,name:this.name,light:this.light,dark:this.dark,path:this.path}}async setAttributes(e){let t=await this.#e.invoke("setColorStyleAttributes",this.id,e);return t?new i(this.#e,t):null}async getPluginData(e){return this.#e.invoke("getPluginDataForNode",this.id,e)}async setPluginData(e,t){return this.#e.invoke("setPluginDataForNode",this.id,e,t)}async getPluginDataKeys(){return this.#e.invoke("getPluginDataKeysForNode",this.id)}async remove(){return this.#e.invoke("removeColorStyle",this.id)}};function ue(i){return i instanceof Z}r(ue,"isColorStyle");var Co="TextStyle";function Xi(i){return v(i)?i[c]===Co:false}r(Xi,"isTextStyleData");var Ue=class i{static{r(this,"TextStyle");}id;name;path;tag;font;boldFont;italicFont;boldItalicFont;color;transform;alignment;decoration;decorationColor;decorationThickness;decorationStyle;decorationSkipInk;decorationOffset;balance;breakpoints;minWidth;fontSize;letterSpacing;lineHeight;paragraphSpacing;#e;constructor(e,t){this.id=t.id,this.name=t.name,this.path=t.path,this.tag=t.tag,this.font=U[l.unmarshal](e,t.font),this.boldFont=t.boldFont&&U[l.unmarshal](e,t.boldFont),this.italicFont=t.italicFont&&U[l.unmarshal](e,t.italicFont),this.boldItalicFont=t.boldItalicFont&&U[l.unmarshal](e,t.boldItalicFont),this.color=Ft(t.color)?Z[l.unmarshal](e,t.color):t.color,this.transform=t.transform,this.alignment=t.alignment,this.decoration=t.decoration,this.decorationColor=Ft(t.decorationColor)?Z[l.unmarshal](e,t.decorationColor):t.decorationColor,this.decorationThickness=t.decorationThickness,this.decorationStyle=t.decorationStyle,this.decorationSkipInk=t.decorationSkipInk,this.decorationOffset=t.decorationOffset,this.balance=t.balance,this.breakpoints=t.breakpoints,this.minWidth=t.minWidth,this.fontSize=t.fontSize,this.letterSpacing=t.letterSpacing,this.lineHeight=t.lineHeight,this.paragraphSpacing=t.paragraphSpacing,this.#e=e;}static[l.unmarshal](e,t){return new i(e,t)}[l.marshal](){return {[c]:"TextStyle",id:this.id,name:this.name,path:this.path,tag:this.tag,font:this.font[l.marshal](),boldFont:this.boldFont?.[l.marshal]()??null,italicFont:this.italicFont?.[l.marshal]()??null,boldItalicFont:this.boldItalicFont?.[l.marshal]()??null,color:ue(this.color)?this.color[l.marshal]():this.color,transform:this.transform,alignment:this.alignment,decoration:this.decoration,decorationColor:ue(this.decorationColor)?this.decorationColor[l.marshal]():this.decorationColor,decorationThickness:this.decorationThickness,decorationStyle:this.decorationStyle,decorationSkipInk:this.decorationSkipInk,decorationOffset:this.decorationOffset,balance:this.balance,breakpoints:this.breakpoints,minWidth:this.minWidth,fontSize:this.fontSize,letterSpacing:this.letterSpacing,lineHeight:this.lineHeight,paragraphSpacing:this.paragraphSpacing}}async setAttributes(e){let t=await this.#e.invoke("setTextStyleAttributes",this.id,e);return t?new i(this.#e,t):null}async getPluginData(e){return this.#e.invoke("getPluginDataForNode",this.id,e)}async setPluginData(e,t){return this.#e.invoke("setPluginDataForNode",this.id,e,t)}async getPluginDataKeys(){return this.#e.invoke("getPluginDataKeysForNode",this.id)}async remove(){return this.#e.invoke("removeTextStyle",this.id)}};function di(i){return i instanceof Ue}r(di,"isTextStyle");function Io(i){return v(i)&&l.marshal in i}r(Io,"isSelfMarshalable");function L(i){if(Io(i))return i[l.marshal]();if(Bt(i))return i.map(L);if(st(i)){let e={};for(let t of Object.keys(i))e[t]=L(i[t]);return e}return i}r(L,"marshal");var Zi={ColorStyle:Z,ConicGradient:Be,FileAsset:Ae,Font:U,ImageAsset:H,LinearGradient:Le,RadialGradient:Re,TextStyle:Ue,BooleanVariable:xe,BorderVariable:ke,ColorVariable:Se,DateVariable:Ne,EnumVariable:Pe,FileVariable:De,FormattedTextVariable:Te,ImageVariable:Fe,LinkVariable:ve,NumberVariable:Ce,StringVariable:Ie,UnsupportedVariable:Me,UnsupportedComputedValue:We};function To(i){return st(i)&&g(i[c])&&i[c]in Zi}r(To,"isSelfUnmarshalable");function h(i,e){if(To(e))return Zi[e[c]][l.unmarshal](i,e);if(Bt(e))return e.map(t=>h(i,t));if(st(e)){let t={};for(let n of Object.keys(e))t[n]=h(i,e[n]);return t}return e}r(h,"unmarshal");var Po={array:false,boolean:false,collectionReference:false,color:false,date:false,enum:false,file:false,formattedText:false,image:true,link:false,multiCollectionReference:false,number:false,string:false,unsupported:false};function So(i){return Po[i]}r(So,"isSupportedArrayItemFieldType");function Fo(i){return So(i.type)}r(Fo,"isSupportedArrayItemFieldDataEntry");var Ht="boolean",jt="color",_t="number",qt="string",Yt="formattedText",Xt="image",Zt="array",Jt="link",Qt="date",ei="file",ti="enum",ii="collectionReference",ni="multiCollectionReference",ri="divider",oi="unsupported";function Do(i){return i.map(e=>{if(e.type!=="enum")return e;let t=e.cases.map(n=>{let o=n.nameByLocale?Ki(n.nameByLocale):undefined;return {...n,nameByLocale:o}});return {...e,cases:t}})}r(Do,"sanitizeEnumFieldForMessage");function Ji(i,e){let t={};for(let n in i){let o=i[n];if(!o)continue;if(o.type!=="array"){t[n]=h(e,o);continue}let a=o.value.map(s=>{let d=Ji(s.fieldData,e),T={};for(let b in d){let D=d[b];m(D&&Fo(D),"Unsupported array item field data entry"),T[b]=D;}return {...s,fieldData:T}});t[n]={...o,value:a};}return t}r(Ji,"deserializeFieldData");var ce=class{static{r(this,"ManagedCollection");}id;name;readonly;managedBy;#e;constructor(e,t){this.id=e.id,this.name=e.name,this.readonly=e.readonly,m(e.managedBy!=="user","Managed Collection can only be managed by a plugin"),this.managedBy=e.managedBy,this.#e=t,S(this);}async getItemIds(){return this.#e.invoke("getManagedCollectionItemIds",this.id)}async setItemOrder(e){return this.#e.invoke("setManagedCollectionItemOrder",this.id,e)}async getFields(){return this.#e.invoke("getManagedCollectionFields2",this.id)}async setFields(e){let t=Do(e);return this.#e.invoke("setManagedCollectionFields",this.id,t)}async addItems(e){return this.#e.invoke("addManagedCollectionItems2",this.id,e)}async removeItems(e){return this.#e.invoke("removeManagedCollectionItems",this.id,e)}async setAsActive(){return this.#e.invoke("setActiveCollection",this.id)}async setPluginData(e,t){return this.#e.invoke("setPluginDataForNode",this.id,e,t)}async getPluginData(e){return this.#e.invoke("getPluginDataForNode",this.id,e)}async getPluginDataKeys(){return this.#e.invoke("getPluginDataKeysForNode",this.id)}async navigateTo(e){return this.#e.invoke("navigateTo",this.id,e)}},J=class{static{r(this,"Collection");}id;name;slugFieldName;slugFieldBasedOn;readonly;managedBy;#e;constructor(e,t){this.id=e.id,this.name=e.name,this.slugFieldName=e.slugFieldName,this.slugFieldBasedOn=e.slugFieldBasedOn,this.readonly=e.readonly,this.managedBy=e.managedBy,this.#e=t,S(this);}async setItemOrder(e){return this.#e.invoke("setCollectionItemOrder",this.id,e)}async getFields(){let e=await this.#e.invoke("getCollectionFields2",this.id,true);return $t(e,this.#e,this.id)}async addFields(e){let t=await this.#e.invoke("addCollectionFields2",this.id,e);return m(t.every(Ui)),$t(t,this.#e,this.id)}async removeFields(e){return this.#e.invoke("removeCollectionFields",this.id,e)}async setFieldOrder(e){return this.#e.invoke("setCollectionFieldOrder",this.id,e)}async getItems(){return (await this.#e.invoke("getCollectionItems2",this.id)).map(t=>new Oe(t,this.#e))}async addItems(e){await this.#e.invoke("addCollectionItems2",this.id,e);}async removeItems(e){return this.#e.invoke("removeCollectionItems",e)}async setAsActive(){return this.#e.invoke("setActiveCollection",this.id)}async setPluginData(e,t){return this.#e.invoke("setPluginDataForNode",this.id,e,t)}async getPluginData(e){return this.#e.invoke("getPluginDataForNode",this.id,e)}async getPluginDataKeys(){return this.#e.invoke("getPluginDataKeysForNode",this.id)}async navigateTo(e){return this.#e.invoke("navigateTo",this.id,e)}},Oe=class i{static{r(this,"CollectionItem");}id;nodeId;slug;slugByLocale;draft;fieldData;#e;constructor(e,t){let n=Ji(e.fieldData,t);this.id=e.externalId??e.nodeId,this.nodeId=e.nodeId,this.slug=e.slug,this.slugByLocale=e.slugByLocale,this.draft=e.draft??false,this.fieldData=n,this.#e=t,S(this);}async remove(){return this.#e.invoke("removeCollectionItems",[this.id])}async setAttributes(e){let t=await this.#e.invoke("setCollectionItemAttributes2",this.id,e);return t?new i(t,this.#e):null}async setPluginData(e,t){return this.#e.invoke("setPluginDataForNode",this.id,e,t)}async getPluginData(e){return this.#e.invoke("getPluginDataForNode",this.id,e)}async getPluginDataKeys(){return this.#e.invoke("getPluginDataKeysForNode",this.id)}async navigateTo(e){return this.#e.invoke("navigateTo",this.nodeId,e)}};var vo={fixed:true,sticky:true,absolute:true,relative:true},Qi="position";function ks(i){if(!(Qi in i))return false;let e=i[Qi];return g(e)&&vo[e]===true}r(ks,"supportsPosition");var en="top";function Ms(i){if(!(en in i))return false;let e=i[en];return g(e)||x(e)}r(Ms,"supportsPins");var tn="width";function Es(i){if(!(tn in i))return false;let e=i[tn];return g(e)||x(e)}r(Es,"supportsSize");var nn="maxWidth";function Vs(i){if(!(nn in i))return false;let e=i[nn];return g(e)||x(e)}r(Vs,"supportsSizeConstraints");var rn="aspectRatio";function As(i){if(!(rn in i))return false;let e=i[rn];return K(e)||x(e)}r(As,"supportsAspectRatio");var on="name";function ws(i){if(!(on in i))return false;let e=i[on];return g(e)||x(e)}r(ws,"supportsName");var an="visible";function Ws(i){if(!(an in i))return false;let e=i[an];return be(e)}r(Ws,"supportsVisible");var sn="locked";function Ls(i){if(!(sn in i))return false;let e=i[sn];return be(e)}r(Ls,"supportsLocked");var ln="backgroundColor";function Rs(i){if(!(ln in i))return false;let e=i[ln];return g(e)||ue(e)||x(e)}r(Rs,"supportsBackgroundColor");var dn="backgroundColor";function Bs(i){if(!(dn in i))return false;let e=i[dn];return g(e)||Ft(e)||x(e)}r(Bs,"supportsBackgroundColorData");var un="backgroundImage";function Us(i){if(!(un in i))return false;let e=i[un];return e instanceof H||x(e)}r(Us,"supportsBackgroundImage");var cn="backgroundImage";function Os(i){if(!(cn in i))return false;let e=i[cn];return e instanceof H?false:$i(e)||x(e)}r(Os,"supportsBackgroundImageData");var pn="backgroundGradient";function zs(i){if(!(pn in i))return false;let e=i[pn];return Yi(e)||x(e)}r(zs,"supportsBackgroundGradient");var mn="backgroundGradient";function Gs(i){if(!(mn in i))return false;let e=i[mn];return v(e)||x(e)}r(Gs,"supportsBackgroundGradientData");var gn="rotation";function Ks(i){if(!(gn in i))return false;let e=i[gn];return K(e)}r(Ks,"supportsRotation");var fn="opacity";function $s(i){if(!(fn in i))return false;let e=i[fn];return K(e)}r($s,"supportsOpacity");var yn="borderRadius";function Hs(i){if(!(yn in i))return false;let e=i[yn];return g(e)||x(e)}r(Hs,"supportsBorderRadius");var hn="border";function js(i){if(!(hn in i))return false;let e=i[hn];return x(e)||ue(e.color)}r(js,"supportsBorder");var bn="svg";function _s(i){if(!(bn in i))return false;let e=i[bn];return g(e)}r(_s,"supportsSVG");var xn="textTruncation";function qs(i){if(!(xn in i))return false;let e=i[xn];return K(e)||x(e)}r(qs,"supportsTextTruncation");var Cn="zIndex";function Ys(i){if(!(Cn in i))return false;let e=i[Cn];return K(e)||x(e)}r(Ys,"supportsZIndex");var In="overflow";function Xs(i){if(!(In in i))return false;let e=i[In];return g(e)||x(e)}r(Xs,"supportsOverflow");var Tn="componentIdentifier";function Zs(i){if(!(Tn in i))return false;let e=i[Tn];return g(e)}r(Zs,"supportsComponentInfo");var Pn="font";function Js(i){if(!(Pn in i))return false;let e=i[Pn];return qi(e)}r(Js,"supportsFont");var Sn="font";function Qs(i){if(!(Sn in i))return false;let e=i[Sn];return _i(e)||x(e)}r(Qs,"supportsFontData");var Fn="inlineTextStyle";function el(i){if(!(Fn in i))return false;let e=i[Fn];return di(e)||x(e)}r(el,"supportsInlineTextStyle");var Dn="inlineTextStyle";function tl(i){if(!(Dn in i))return false;let e=i[Dn];return Xi(e)||x(e)}r(tl,"supportsInlineTextStyleData");var vn="link";function il(i){if(!(vn in i))return false;let e=i[vn];return g(e)||x(e)}r(il,"supportsLink");var Nn="imageRendering";function nl(i){if(!(Nn in i))return false;let e=i[Nn];return g(e)||x(e)}r(nl,"supportsImageRendering");var kn="layout";function Vn(i){if(!(kn in i))return false;let e=i[kn];return g(e)||x(e)}r(Vn,"supportsLayout");function rl(i){return Vn(i)?i.layout==="stack":false}r(rl,"hasStackLayout");function ol(i){return Vn(i)?i.layout==="grid":false}r(ol,"hasGridLayout");var Mn="isVariant";function An(i){if(!(Mn in i))return false;let e=i[Mn];return be(e)}r(An,"supportsComponentVariant");function ui(i){return An(i)?i.isVariant:false}r(ui,"isComponentVariant");function wn(i){return !An(i)||!ui(i)?false:!x(i.gesture)}r(wn,"isComponentGestureVariant");var En="isBreakpoint";function No(i){if(!(En in i))return false;let e=i[En];return be(e)}r(No,"supportsBreakpoint");function Wn(i){return No(i)?i.isBreakpoint:false}r(Wn,"isBreakpoint");var V=class{static{r(this,"NodeMethods");}id;originalId;#e;constructor(e,t){this.id=e.id,this.originalId=e.originalId??null,this.#e=t;}get isReplica(){return this.originalId!==null}async remove(){return this.#e.invoke("removeNodes2",[this.id])}async select(){return this.#e.invoke("setSelection",[this.id])}async clone(){if(this[c]==="UnknownNode")throw Error("Can not clone unknown node");return this.#e.cloneNode(this.id)}async setAttributes(e){if(this[c]==="UnknownNode")throw Error("Can not set attributes on unknown node");return this.#e.setAttributes(this.id,e)}async getRect(){return this.#e.invoke("getRect",this.id)}async zoomIntoView(e){return this.#e.invoke("zoomIntoView",[this.id],e)}async navigateTo(e){return this.#e.invoke("navigateTo",this.id,e)}async getParent(){return this.#e.getParent(this.id)}async getChildren(){return Q(this)?Promise.resolve([]):this.#e.getChildren(this.id)}async getNodesWithType(e){return Q(this)?Promise.resolve([]):(await this.#e.invoke("getNodesWithType",this.id,e)).map(n=>C(n,this.#e))}async getNodesWithAttribute(e){return Q(this)?Promise.resolve([]):(await this.#e.invoke("getNodesWithAttribute",this.id,e)).map(n=>C(n,this.#e))}async getNodesWithAttributeSet(e){return Q(this)?Promise.resolve([]):(await this.#e.invoke("getNodesWithAttributeSet",this.id,e)).map(n=>C(n,this.#e))}async*walk(){if(yield this,!Q(this))for(let e of await this.getChildren())yield*e.walk();}async getPluginData(e){return this.#e.invoke("getPluginDataForNode",this.id,e)}async setPluginData(e,t){return this.#e.invoke("setPluginDataForNode",this.id,e,t)}async getPluginDataKeys(){return this.#e.invoke("getPluginDataKeysForNode",this.id)}},R=class extends V{static{r(this,"FrameNode");}[c]="FrameNode";name;visible;locked;backgroundColor;backgroundImage;backgroundGradient;rotation;opacity;borderRadius;border;imageRendering;position;top;right;bottom;left;centerX;centerY;width;height;maxWidth;minWidth;maxHeight;minHeight;aspectRatio;zIndex;link;linkOpenInNewTab;overflow;overflowX;overflowY;layout;gap;padding;stackDirection;stackDistribution;stackAlignment;stackWrapEnabled;gridColumnCount;gridRowCount;gridAlignment;gridColumnWidthType;gridColumnWidth;gridColumnMinWidth;gridRowHeightType;gridRowHeight;gridItemFillCellWidth;gridItemFillCellHeight;gridItemHorizontalAlignment;gridItemVerticalAlignment;gridItemColumnSpan;gridItemRowSpan;isVariant;isPrimaryVariant;isBreakpoint;isPrimaryBreakpoint;inheritsFromId;gesture;constructor(e,t){super(e,t),this.name=e.name??null,this.visible=e.visible??true,this.locked=e.locked??false,this.backgroundColor=h(t,e.backgroundColor)??null,this.backgroundImage=h(t,e.backgroundImage)??null,this.rotation=e.rotation??0,this.opacity=e.opacity??1,this.borderRadius=e.borderRadius??null,this.border=h(t,e.border)??null,this.backgroundGradient=h(t,e.backgroundGradient)??null,this.imageRendering=e.imageRendering??null,this.position=e.position,this.left=e.left??null,this.right=e.right??null,this.top=e.top??null,this.bottom=e.bottom??null,this.centerX=e.centerX??null,this.centerY=e.centerY??null,this.width=e.width??null,this.height=e.height??null,this.maxWidth=e.maxWidth??null,this.minWidth=e.minWidth??null,this.maxHeight=e.maxHeight??null,this.minHeight=e.minHeight??null,this.aspectRatio=e.aspectRatio??null,this.zIndex=e.zIndex??null,this.link=e.link??null,this.linkOpenInNewTab=e.linkOpenInNewTab??null,this.overflow=e.overflow??null,this.overflowX=e.overflowX??null,this.overflowY=e.overflowY??null,this.layout=e.layout??null,this.gap=e.gap??null,this.padding=e.padding??null,this.stackDirection=e.stackDirection??null,this.stackDistribution=e.stackDistribution??null,this.stackAlignment=e.stackAlignment??null,this.stackWrapEnabled=e.stackWrapEnabled??null,this.gridColumnCount=e.gridColumnCount??null,this.gridRowCount=e.gridRowCount??null,this.gridAlignment=e.gridAlignment??null,this.gridColumnWidthType=e.gridColumnWidthType??null,this.gridColumnWidth=e.gridColumnWidth??null,this.gridColumnMinWidth=e.gridColumnMinWidth??null,this.gridRowHeightType=e.gridRowHeightType??null,this.gridRowHeight=e.gridRowHeight??null,this.gridItemFillCellWidth=e.gridItemFillCellWidth??null,this.gridItemFillCellHeight=e.gridItemFillCellHeight??null,this.gridItemHorizontalAlignment=e.gridItemHorizontalAlignment??null,this.gridItemVerticalAlignment=e.gridItemVerticalAlignment??null,this.gridItemColumnSpan=e.gridItemColumnSpan??null,this.gridItemRowSpan=e.gridItemRowSpan??null,this.inheritsFromId=e.inheritsFromId??null,this.gesture=e.gesture??null,this.isVariant=e.isVariant??false,this.isPrimaryVariant=e.isPrimaryVariant??false,this.isBreakpoint=e.isBreakpoint??false,this.isPrimaryBreakpoint=e.isPrimaryBreakpoint??false,S(this);}},ee=class extends V{static{r(this,"TextNode");}[c]="TextNode";name;visible;locked;rotation;opacity;zIndex;font;inlineTextStyle;position;top;right;bottom;left;centerX;centerY;width;height;maxWidth;minWidth;maxHeight;minHeight;link;linkOpenInNewTab;gridItemFillCellWidth;gridItemFillCellHeight;gridItemHorizontalAlignment;gridItemVerticalAlignment;gridItemColumnSpan;gridItemRowSpan;overflow;overflowX;overflowY;textTruncation;#e;constructor(e,t){super(e,t),this.#e=t,this.name=e.name??null,this.visible=e.visible??true,this.locked=e.locked??false,this.rotation=e.rotation??0,this.opacity=e.opacity??1,this.zIndex=e.zIndex??null,this.font=h(t,e.font)??null,this.inlineTextStyle=h(t,e.inlineTextStyle)??null,this.position=e.position,this.left=e.left??null,this.right=e.right??null,this.top=e.top??null,this.bottom=e.bottom??null,this.centerX=e.centerX??null,this.centerY=e.centerY??null,this.width=e.width??null,this.height=e.height??null,this.maxWidth=e.maxWidth??null,this.minWidth=e.minWidth??null,this.maxHeight=e.maxHeight??null,this.minHeight=e.minHeight??null,this.link=e.link??null,this.linkOpenInNewTab=e.linkOpenInNewTab??null,this.overflow=e.overflow??null,this.overflowX=e.overflowX??null,this.overflowY=e.overflowY??null,this.textTruncation=e.textTruncation??null,this.gridItemFillCellWidth=e.gridItemFillCellWidth??null,this.gridItemFillCellHeight=e.gridItemFillCellHeight??null,this.gridItemHorizontalAlignment=e.gridItemHorizontalAlignment??null,this.gridItemVerticalAlignment=e.gridItemVerticalAlignment??null,this.gridItemColumnSpan=e.gridItemColumnSpan??null,this.gridItemRowSpan=e.gridItemRowSpan??null,S(this);}async setText(e){await this.#e.invoke("setTextForNode",this.id,e);}async getText(){return this.#e.invoke("getTextForNode",this.id)}async setHTML(e){await this.#e.invoke(le,this.id,e),await new Promise(t=>{setTimeout(t,30);});}async getHTML(){return this.#e.invoke(se,this.id)}},ze=class extends V{static{r(this,"SVGNode");}[c]="SVGNode";name;visible;locked;svg;rotation;opacity;position;top;right;bottom;left;centerX;centerY;width;height;constructor(e,t){super(e,t),this.name=e.name??null,this.visible=e.visible??true,this.locked=e.locked??false,this.svg=e.svg,this.rotation=e.rotation??0,this.opacity=e.opacity??1,this.position=e.position,this.left=e.left??null,this.right=e.right??null,this.top=e.top??null,this.bottom=e.bottom??null,this.centerX=e.centerX??null,this.centerY=e.centerY??null,this.width=e.width??null,this.height=e.height??null,S(this);}},Ge=class extends V{static{r(this,"VectorSetItemNode");}[c]="VectorSetItemNode";name;visible;locked;top;right;bottom;left;centerX;centerY;width;height;#e;constructor(e,t){super(e,t),this.#e=t,this.name=e.name??null,this.visible=e.visible??true,this.locked=e.locked??false,this.top=e.top??null,this.right=e.right??null,this.bottom=e.bottom??null,this.left=e.left??null,this.centerX=e.centerX??null,this.centerY=e.centerY??null,this.width=e.width??null,this.height=e.height??null,S(this);}async getSVG(){return this.#e.invoke("getSVGForNode",this.id)}},Ke=class extends V{static{r(this,"ComponentInstanceNode");}[c]="ComponentInstanceNode";name;visible;locked;componentIdentifier;insertURL;componentName;controls;rotation;opacity;position;top;right;bottom;left;centerX;centerY;width;height;maxWidth;minWidth;maxHeight;minHeight;aspectRatio;#e;#t;#i;get typedControls(){return this.#i||(this.#i=h(this.#e,this.#t.typedControls)??{}),this.#i}constructor(e,t){super(e,t),this.#e=t,this.#t=e,this.name=e.name??null,this.visible=e.visible??true,this.locked=e.locked??false,this.componentIdentifier=e.componentIdentifier,this.componentName=e.componentName??null,this.insertURL=e.insertURL??null,this.controls=h(t,e.controls)??{},this.rotation=e.rotation??0,this.opacity=e.opacity??1,this.position=e.position,this.left=e.left??null,this.right=e.right??null,this.top=e.top??null,this.bottom=e.bottom??null,this.centerX=e.centerX??null,this.centerY=e.centerY??null,this.width=e.width??null,this.height=e.height??null,this.maxWidth=e.maxWidth??null,this.minWidth=e.minWidth??null,this.maxHeight=e.maxHeight??null,this.minHeight=e.minHeight??null,this.aspectRatio=e.aspectRatio??null,S(this);}async getRuntimeError(){return this.#e.invoke("getRuntimeErrorForCodeComponentNode",this.id)}},te=class extends V{static{r(this,"WebPageNode");}[c]="WebPageNode";#e;path;collectionId;constructor(e,t){super(e,t),this.path=e.path??null,this.collectionId=e.collectionId??null,this.#e=t,S(this);}getBreakpointSuggestions(){return this.#e.invoke("getBreakpointSuggestionsForWebPage",this.id)}async addBreakpoint(e,t){let n=await this.#e.invoke("addBreakpointToWebPage",this.id,e,t),o=C(n,this.#e);return m(o instanceof R),m(Wn(o),"Expected node to be a FrameNode"),o}async getActiveCollectionItem(){let e=await this.#e.invoke("getActiveCollectionItemForWebPage",this.id);return e?new Oe(e,this.#e):null}},ie=class extends V{static{r(this,"ComponentNode");}[c]="ComponentNode";name;componentIdentifier;insertURL;componentName;#e;constructor(e,t){super(e,t),this.#e=t,this.componentIdentifier=e.componentIdentifier,this.insertURL=e.insertURL??null,this.componentName=e.componentName??null,this.name=e.name??null,S(this);}async addVariant(e,t){let n=await this.#e.invoke("addVariantToComponent",this.id,e,t);if(!n)throw new Error("Failed to add variant to component");let o=C(n,this.#e);return m(o instanceof R),m(ui(o),"Node is not a component variant"),o}async addGestureVariant(e,t,n){let o=await this.#e.invoke("addGestureVariantToComponent",this.id,e,t,n);if(!o)throw new Error("Failed to add state to component");let a=C(o,this.#e);return m(a instanceof R),m(wn(a),"Node is not a gesture variant"),a}async getVariables(){let e=await this.#e.invoke("getVariables",this.id);return h(this.#e,e)}async addVariables(e){let t=await this.#e.invoke("addVariables",this.id,L(e));return h(this.#e,t)}async removeVariables(e){await this.#e.invoke("removeVariables",this.id,e);}async setVariableOrder(e){await this.#e.invoke("setVariableOrder",this.id,e);}},$e=class extends V{static{r(this,"VectorSetNode");}[c]="VectorSetNode";name;constructor(e,t){super(e,t),this.name=e.name??null,S(this);}},ne=class extends V{static{r(this,"DesignPageNode");}[c]="DesignPageNode";name;constructor(e,t){super(e,t),this.name=e.name??null,S(this);}},He=class extends V{static{r(this,"UnknownNode");}[c]="UnknownNode";constructor(e,t){super(e,t),S(this);}};function C(i,e){switch(i[c]){case "DesignPageNode":return new ne(i,e);case "WebPageNode":return new te(i,e);case "ComponentNode":return new ie(i,e);case "VectorSetNode":return new $e(i,e);case "VectorSetItemNode":return new Ge(i,e);case "ComponentInstanceNode":return new Ke(i,e);case "FrameNode":return new R(i,e);case "SVGNode":return new ze(i,e);case "TextNode":return new ee(i,e);case "UnknownNode":return new He(i,e);default:return new He(i,e)}}r(C,"convertRawNodeDataToNode");function Dt(i){return i instanceof R}r(Dt,"isFrameNode");function Ln(i){return i instanceof ee}r(Ln,"isTextNode");function Rn(i){return i instanceof ze}r(Rn,"isSVGNode");function pe(i){return i instanceof Ke}r(pe,"isComponentInstanceNode");function Bn(i){return i instanceof te}r(Bn,"isWebPageNode");function Un(i){return i instanceof ie}r(Un,"isComponentNode");function On(i){return i instanceof ne}r(On,"isDesignPageNode");function zn(i){return i instanceof $e}r(zn,"isVectorSetNode");function Gn(i){return i instanceof Ge}r(Gn,"isVectorSetItemNode");function Q(i){return i instanceof He}r(Q,"isUnknownNode");function je(i){return !!(Dt(i)||Ln(i)||pe(i)||Rn(i)||Gn(i)||Q(i))}r(je,"isCanvasNode");function ci(i){return !!(Bn(i)||On(i)||Un(i)||zn(i)||Q(i))}r(ci,"isCanvasRootNode");var _e=class{static{r(this,"VectorSet");}id;name;owner;#e;constructor(e,t){this.id=e.id,this.name=e.name,this.owner=e.owner,this.#e=t;}async getItems(){return (await this.#e.invoke("getVectorSetItems",this.id)).map(t=>new vt(t,this.#e))}},vt=class{static{r(this,"VectorSetItem");}id;name;insertUrl;iconUrl;#e;#t;constructor(e,t){this.id=e.id,this.name=e.name,this.insertUrl=e.insertUrl,this.iconUrl=e.iconUrl,this.#e=e.moduleId,this.#t=t;}async getVariables(){return this.#t.invoke("getVectorSetItemVariables",this.id,this.#e)}};var qe=class extends Error{static{r(this,"FramerPluginError");}name=this.constructor.name},_=class extends Error{static{r(this,"FramerPluginClosedError");}name=this.constructor.name};function ko(i){return i.type==="separator"}r(ko,"isSeparatorMenuItem");function Nt(i,e){let t=[];for(let n of i){if(ko(n)){t.push(n);continue}let{onAction:o,...a}=n,s=a;if(n.onAction){let d=Math.random();e.set(d,n.onAction),s.actionId=d;}n.submenu&&(s.submenu=Nt(n.submenu,e)),t.push(s);}return t}r(Nt,"addMenuItemsToOnActionCallbackMap");var kt="type",Kn={[kt]:"pluginReadySignal"},Eo="pluginReadyResponse";var Vo={methodResponse:true,subscriptionMessage:true,permissionUpdate:true,menuAction:true};function $n(i){return v(i)&&g(i[kt])&&i[kt]in Vo}r($n,"isVekterToPluginNonHandshakeMessage");function Hn(i){return v(i)&&i[kt]===Eo}r(Hn,"isPluginReadyResponse");var pi=Symbol(),mi=Symbol(),gi=Symbol(),fi=Symbol(),yi=Symbol(),hi=Symbol(),B={publish:pi,getDeployments:mi,deploy:gi,getChangedPaths:fi,getChangeContributors:yi,createManagedCollection:hi};var Ao=["unstable_getCodeFile","unstable_getCodeFiles","unstable_getCodeFileVersionContent","unstable_getCodeFileLint2","unstable_getCodeFileTypecheck2","unstable_getCodeFileVersions"],wo=["closeNotification","closePlugin","getActiveCollection","getActiveLocale","getActiveManagedCollection","getCanvasRoot","getChildren","getCollection","getCollectionFields","getCollectionFields2","getCollectionItems","getCollectionItems2","getCollections","getColorStyle","getColorStyles","getCurrentUser","getCurrentUser2","getCustomCode","getDefaultLocale","getFont","getFonts","getImage","getImageData","getLocales","getLocalizationGroups","getManagedCollection","getManagedCollectionFields","getManagedCollectionFields2","getManagedCollectionItemIds","getManagedCollections","getNode","getNodesWithAttribute","getNodesWithAttributeSet","getNodesWithType","getParent","getPluginData","getPluginDataForNode","getPluginDataKeys","getPluginDataKeysForNode","getProjectInfo","getProjectInfo2","getPublishInfo","getRect","getSelection","getSVGForNode","getText","getTextForNode","getTextStyle","getTextStyles","hideUI","setBackgroundMessage","notify","onPointerDown","setActiveCollection","setSelection","showUI","getCodeFileVersionContent","lintCode","typecheckCode","getCodeFileVersions","getCodeFiles","getCodeFile","getRedirects","uploadFile","uploadFiles","uploadImage","uploadImages","zoomIntoView","navigateTo","getRuntimeErrorForModule","getRuntimeErrorForCodeComponentNode","showProgressOnInstances","removeProgressFromInstances","addComponentInstancePlaceholder","updateComponentInstancePlaceholder","removeComponentInstancePlaceholder","setMenu","showContextMenu","getBreakpointSuggestionsForWebPage","getActiveCollectionItemForWebPage","getVariables","getVectorSets","getVectorSetItems","getVectorSetItemVariables","getChangedPaths","getChangeContributors","getDeployments",ut,ct,se,"getAiServiceInfo","sendTrackingEvent",...Ao];new Set(wo);var bi={addComponentInstance:["addComponentInstance"],addComponentInstancePlaceholder:[],addDetachedComponentLayers:["addDetachedComponentLayers"],addImage:["addImage"],addImages:["addImages"],addSVG:["addSVG"],addText:["addText"],addRedirects:["addRedirects"],getRedirects:[],removeRedirects:["removeRedirects"],setRedirectOrder:["setRedirectOrder"],subscribeToRedirects:[],cloneNode:["cloneNode"],closePlugin:[],createColorStyle:["createColorStyle"],createFrameNode:["createNode"],createTextNode:["createNode"],createComponentNode:["createNode"],createTextStyle:["createTextStyle"],createDesignPage:["createDesignPage"],createWebPage:["createWebPage"],getActiveCollection:[],getActiveLocale:[],getActiveManagedCollection:[],getCanvasRoot:[],getChildren:[],getCollection:[],getCollections:[],getColorStyle:[],getColorStyles:[],getCurrentUser:[],getCustomCode:[],getDefaultLocale:[],getFont:[],getFonts:[],getImage:[],getLocales:[],getLocalizationGroups:[],getManagedCollection:[],getManagedCollections:[],getNode:[],getNodesWithAttribute:[],getNodesWithAttributeSet:[],getNodesWithType:[],getParent:[],getPluginData:[],getPluginDataKeys:[],getProjectInfo:[],getPublishInfo:[],getRect:[],getSelection:[],getText:[],getTextStyle:[],getTextStyles:[],hideUI:[],setBackgroundMessage:[],lintCode:[],makeDraggable:["onDragEnd","onDragStart","onDrag","setDragData","preloadDetachedComponentLayers","preloadImageUrlForInsertion","preloadDragPreviewImage"],notify:[],preloadDetachedComponentLayers:["preloadDetachedComponentLayers"],preloadDragPreviewImage:["preloadDragPreviewImage"],preloadImageUrlForInsertion:["preloadImageUrlForInsertion"],removeNode:["removeNodes2"],removeNodes:["removeNodes2"],setAttributes:["setAttributes"],setCustomCode:["setCustomCode"],setImage:["setImage"],setLocalizationData:["setLocalizationData"],setMenu:[],showContextMenu:[],setParent:["setParent"],setPluginData:["setPluginData"],setSelection:[],setText:["setText"],typecheckCode:[],showUI:[],subscribeToCanvasRoot:[],subscribeToColorStyles:[],subscribeToCustomCode:[],subscribeToImage:[],subscribeToPublishInfo:[],subscribeToSelection:[],subscribeToText:[],subscribeToTextStyles:[],createCodeFile:["createCodeFile"],unstable_ensureMinimumDependencyVersion:["unstable_ensureMinimumDependencyVersion"],getCodeFiles:[],getCodeFile:[],subscribeToCodeFiles:[],subscribeToOpenCodeFile:[],uploadFile:[],uploadFiles:[],uploadImage:[],uploadImages:[],zoomIntoView:[],navigateTo:[],getVectorSets:[],"VectorSet.getItems":[],"VectorSetItem.getVariables":[],"Node.navigateTo":[],"CodeFile.navigateTo":[],"Collection.navigateTo":[],"ManagedCollection.navigateTo":[],"CollectionItem.navigateTo":[],"ComponentInstanceNode.getRuntimeError":[],"ImageAsset.cloneWithAttributes":[],"ImageAsset.getData":[],"ImageAsset.loadBitmap":[],"ImageAsset.loadImage":[],"ImageAsset.measure":[],"CodeFile.remove":["removeCodeFile"],"CodeFile.rename":["renameCodeFile"],"CodeFile.setFileContent":["setCodeFileContent"],"CodeFile.getVersions":[],"CodeFile.showProgressOnInstances":[],"CodeFile.removeProgressFromInstances":[],"CodeFile.lint":[],"CodeFile.typecheck":[],"CodeFileVersion.getContent":[],"ComponentInstancePlaceholder.setAttributes":[],"ComponentInstancePlaceholder.remove":[],"ComponentInstancePlaceholder.replaceWithComponentInstance":["replaceComponentInstancePlaceholderWithComponentInstance"],"Field.remove":["removeCollectionFields"],"Field.setAttributes":["addCollectionFields"],"EnumField.addCase":["addEnumCase"],"EnumField.setCaseOrder":["setEnumCaseOrder"],"Collection.addFields":["addCollectionFields"],"Collection.addItems":["addCollectionItems2"],"Collection.getFields":[],"Collection.getItems":[],"Collection.getPluginData":[],"Collection.getPluginDataKeys":[],"Collection.removeFields":["removeCollectionFields"],"Collection.removeItems":["removeCollectionItems"],"Collection.setAsActive":[],"Collection.setFieldOrder":["setCollectionFieldOrder"],"Collection.setItemOrder":["setCollectionItemOrder"],"Collection.setPluginData":["setPluginDataForNode"],"CollectionItem.getPluginData":[],"CollectionItem.getPluginDataKeys":[],"CollectionItem.remove":["removeCollectionItems"],"CollectionItem.setAttributes":["setCollectionItemAttributes2"],"CollectionItem.setPluginData":["setPluginDataForNode"],"ManagedCollection.addItems":["addManagedCollectionItems2"],"ManagedCollection.getFields":[],"ManagedCollection.getItemIds":[],"ManagedCollection.getPluginData":[],"ManagedCollection.getPluginDataKeys":[],"ManagedCollection.removeItems":["removeManagedCollectionItems"],"ManagedCollection.setAsActive":[],"ManagedCollection.setFields":["setManagedCollectionFields"],"ManagedCollection.setItemOrder":["setManagedCollectionItemOrder"],"ManagedCollection.setPluginData":["setPluginDataForNode"],"Node.clone":["cloneNode"],"Node.getChildren":[],"Node.getNodesWithAttribute":[],"Node.getNodesWithAttributeSet":[],"Node.getNodesWithType":[],"Node.getParent":[],"Node.getPluginData":[],"Node.getPluginDataKeys":[],"Node.getRect":[],"Node.remove":["removeNodes2"],"Node.select":[],"Node.setAttributes":["setAttributes"],"Node.setPluginData":["setPluginDataForNode"],"Node.walk":[],"Node.zoomIntoView":[],"TextNode.getText":[],"TextNode.setText":["setTextForNode"],"TextNode.setHTML":[le],"TextNode.getHTML":[],"ComponentNode.addVariant":["addVariantToComponent"],"ComponentNode.addGestureVariant":["addGestureVariantToComponent"],"ComponentNode.getVariables":[],"ComponentNode.addVariables":["addVariables"],"ComponentNode.removeVariables":["removeVariables"],"WebPageNode.getBreakpointSuggestions":[],"WebPageNode.addBreakpoint":["addBreakpointToWebPage"],"WebPageNode.getActiveCollectionItem":[],"ColorStyle.getPluginData":[],"ColorStyle.getPluginDataKeys":[],"ColorStyle.remove":["removeColorStyle"],"ColorStyle.setAttributes":["setColorStyleAttributes"],"ColorStyle.setPluginData":["setPluginDataForNode"],"TextStyle.getPluginData":[],"TextStyle.getPluginDataKeys":[],"TextStyle.remove":["removeTextStyle"],"TextStyle.setAttributes":["setTextStyleAttributes"],"TextStyle.setPluginData":["setPluginDataForNode"],"Variable.setAttributes":["updateVariable"],"Variable.remove":["removeVariables"],"ComponentNode.setVariableOrder":["setVariableOrder"],"EnumCase.remove":["removeEnumCase"],"EnumCase.setAttributes":["updateEnumCase"],"EnumVariable.addCase":["addEnumCase"],"EnumVariable.setCaseOrder":["setEnumCaseOrder"],createCollection:["createCollection"],[Ut]:[],[Ot]:[],[zt]:[],[Gt]:[],[pi]:["publish"],[mi]:[],[gi]:["deploy"],[fi]:[],[yi]:[],[hi]:["createManagedCollection"]},Mt=[];for(let i of Object.keys(bi))bi[i].length!==0&&Mt.push(i);S(Mt);function xi(i){let e={};for(let t of Mt){let n=bi[t];e[t]=n.every(o=>i[o]);}return e}r(xi,"createPerMethodPermissionMap");function jn(){let i={};for(let e of Mt)i[e]=true;return i}r(jn,"createPerMethodPermissionMapForTesting");var me=null;function _n(i){if(typeof window>"u")return;if(!me){let t=document.createElement("style");document.head.appendChild(t),me=t.sheet;}if(!me){i();return}let e=me.insertRule("* { transition: none !important; animation: none !important; }");i(),requestAnimationFrame(()=>{requestAnimationFrame(()=>{me&&me.deleteRule(e);});});}r(_n,"withDisabledCssTransitions");var Ye=class{static{r(this,"PluginEngine");}methodInvocationId=0;notificationId=0;postMessage;methodResponseHandlers=new Map;mode;subscriptions=new Map;perMethodPermissionMap;permissionSubscriptions=new Set;messageTypesCheckedInIsAllowedTo=new Set;showUncheckedPermissionToasts=true;environmentInfo=null;menuItemOnActionCallbackMap=new Map;contextMenuItemOnActionCallbackMap=new Map;constructor(e){if(!e){this.postMessage=()=>{},this.mode="canvas",this.perMethodPermissionMap=jn();return}switch(e.transport.onMessage(this.onMessage),typeof window<"u"&&(window.addEventListener("error",t=>{t.error instanceof _&&(t.preventDefault(),t.stopImmediatePropagation());}),window.addEventListener("unhandledrejection",t=>{t.reason instanceof _&&(t.preventDefault(),t.stopImmediatePropagation());})),this.mode=e.mode,this.environmentInfo=e.environmentInfo,this.perMethodPermissionMap=xi(e.permissionMap),this.postMessage=(t,n)=>e.transport.send(t,n),this.mode){case "canvas":case "image":case "editImage":case "configureManagedCollection":case "syncManagedCollection":case "collection":case "localization":case "code":typeof window<"u"&&window.addEventListener("pointerdown",()=>{this.invoke("onPointerDown");}),e.theme&&this.applyPluginTheme(e.theme),this.subscribe("theme",this.applyPluginTheme);break;case "api":break;default:lt(this.mode);}}async invoke(e,...t){return this.invokeTransferable(e,undefined,...t)}async invokeTransferable(e,t,...n){return new Promise((a,s)=>{let d={type:"methodInvocation",methodName:e,id:this.methodInvocationId,args:n.map(L)};this.methodInvocationId+=1,this.methodResponseHandlers.set(d.id,{resolve:a,reject:s}),this.postMessage(d,t);})}subscribe(e,t){this.postMessage({type:"subscribe",topic:e});let n=this.subscriptions.get(e)??new Set;return n.add(t),this.subscriptions.set(e,n),()=>{let o=this.subscriptions.get(e)??new Set;o.delete(t),o.size===0&&this.postMessage({type:"unsubscribe",topic:e}),this.subscriptions.set(e,o);}}onMessage=e=>{let t=e?.data??e;if($n(t))switch(t.type){case "permissionUpdate":{this.perMethodPermissionMap=xi(t.permissionMap);for(let n of this.permissionSubscriptions)n();break}case "methodResponse":{let n=this.methodResponseHandlers.get(t.id);if(!n)throw new Error(`No handler for response with id ${t.id}`);this.methodResponseHandlers.delete(t.id),g(t.error)?n.reject(new qe(t.error)):n.resolve(t.result);break}case "subscriptionMessage":{let{topic:n,payload:o}=t,a=this.subscriptions.get(n);if(!a)throw new Error("Received a subscription message but no handler present");for(let s of a)s(o);break}case "menuAction":{let n=this.getOnActionFromCallbackMap(t.actionId,t.actionType);if(!n)throw new Error("Menu action received for an unknown menu item");n();break}default:lt(t);}};getOnActionFromCallbackMap(e,t){switch(t){case "pluginMenu":return this.menuItemOnActionCallbackMap.get(e);case "contextMenu":return this.contextMenuItemOnActionCallbackMap.get(e);default:lt(t);}}applyPluginTheme=e=>{_n(()=>{document.body.setAttribute("data-framer-theme",e.mode);for(let t in e.tokens)document.body.style.setProperty(t,e.tokens[t]);});};async cloneNode(e){let t=await this.invoke("cloneNode",e);return t?C(t,this):null}async setAttributes(e,t){let n=await this.invoke("setAttributes",e,t);return n?C(n,this):null}async getParent(e){let t=await this.invoke("getParent",e);return t?C(t,this):null}async getChildren(e){return (await this.invoke("getChildren",e)).map(n=>{let o=C(n,this);return m(je(o)),o})}notify=(e,t)=>{let n=`notification-${this.notificationId}`;return this.notificationId+=1,this.invoke("notify",e,{notificationId:n,variant:t?.variant??"info",buttonText:t?.button?.text,durationMs:t?.durationMs}).then(o=>{o==="actionButtonClicked"&&t?.button?.onClick&&t.button.onClick(),t?.onDisappear&&t.onDisappear();}),{close:()=>this.invoke("closeNotification",n)}};async setMenu(e){this.menuItemOnActionCallbackMap=new Map;let t=Nt(e,this.menuItemOnActionCallbackMap);await this.invoke("setMenu",t);}async showContextMenu(e,t){this.contextMenuItemOnActionCallbackMap=new Map;let n=Nt(e,this.contextMenuItemOnActionCallbackMap);await this.invoke("showContextMenu",n,t);}};function Wo(i){return i.type==="component"}r(Wo,"isCodeFileComponentExport");function Lo(i){return i.type==="override"}r(Lo,"isCodeFileOverrideExport");var Ci=class{static{r(this,"CodeFileVersion");}#e;#t;get id(){return this.#e.id}get name(){return this.#e.name}get createdAt(){return this.#e.createdAt}get createdBy(){return this.#e.createdBy}constructor(e,t){this.#t=t,this.#e=e;}async getContent(){return await this.#t.invoke("getCodeFileVersionContent",this.#e.fileId,this.#e.id)}},q=class i{static{r(this,"CodeFile");}#e;#t;get id(){return this.#e.id}get name(){return this.#e.name}get path(){return this.#e.path}get content(){return this.#e.content}get exports(){return this.#e.exports}get versionId(){return this.#e.versionId}constructor(e,t){this.#t=t,this.#e=e;}async setFileContent(e){let t=await this.#t.invoke("setCodeFileContent",this.id,e);return new i(t,this.#t)}async rename(e){let t=await this.#t.invoke("renameCodeFile",this.id,e);return new i(t,this.#t)}async remove(){return this.#t.invoke("removeCodeFile",this.id)}async getVersions(){return (await this.#t.invoke("getCodeFileVersions",this.id)).map(t=>new Ci(t,this.#t))}async showProgressOnInstances(e){return this.#t.invoke("showProgressOnInstances",this.id,e)}async removeProgressFromInstances(){return this.#t.invoke("removeProgressFromInstances",this.id)}async lint(e){return await this.#t.invoke("lintCode",this.name,this.content,e)}async typecheck(e){return await this.#t.invoke("typecheckCode",this.name,this.content,e)}async navigateTo(){return this.#t.invoke("navigateTo",this.id)}};var Et=class i{static{r(this,"ComponentInstancePlaceholder");}#e;#t;constructor(e,t){this.#e=e,this.#t=t;}get id(){return this.#e.id}get width(){return this.#e.width}get height(){return this.#e.height}get title(){return this.#e.title}get codePreview(){return this.#e.codePreview}async setAttributes(e){let t=await this.#t.invoke("updateComponentInstancePlaceholder",this.id,e);return t?new i(t,this.#t):null}async remove(){await this.#t.invoke("removeComponentInstancePlaceholder",this.id);}async replaceWithComponentInstance(e,t){let n=await this.#t.invoke("replaceComponentInstancePlaceholderWithComponentInstance",this.id,e,t);if(!n)return null;let o=C(n,this.#t);return m(pe(o)),o}};var Ro=(()=>{let i=null;return {disableUntilMouseUp:()=>{if(i)return;i=document.createElement("style"),i.textContent="* { pointer-events: none !important; user-select: none !important; -webkit-user-select: none !important; }",document.head.appendChild(i);let e=r(()=>{i&&(document.head.removeChild(i),i=null,o());},"enablePointerEvents"),t=r(a=>{a.buttons>0&&a.buttons&1||e();},"handlePointerChange"),n=r(()=>{e();},"handleBlur");window.addEventListener("pointerup",t,true),window.addEventListener("pointermove",t,true),window.addEventListener("blur",n);function o(){window.removeEventListener("pointerup",t,true),window.removeEventListener("pointermove",t,true),window.removeEventListener("blur",n);}r(o,"cleanup");}}})(),qn=5,Bo=(()=>{let i=1;return {next:()=>`drag-${i++}`}})();function Uo(){}r(Uo,"noop");function Yn(i,e,t,n){if(i.mode!=="canvas")return Uo;let o=Bo.next(),a=document.body.style.cursor,s={type:"idle"},d=document.body,T=re.subscribeToIsAllowedTo("makeDraggable",p=>{p||I();}),b=r(p=>{re.isAllowedTo("makeDraggable")&&s.type!=="idle"&&(s.type==="dragging"&&i.invoke("onDragEnd",{...p,dragSessionId:o}).then(y=>{try{n?.(y);}catch{}}).catch(y=>{if(y instanceof Error){n?.({status:"error",reason:y.message});return}if(typeof y=="string"){n?.({status:"error",reason:y});return}n?.({status:"error"});}),I());},"endDrag"),D=r(p=>{if(!re.isAllowedTo("makeDraggable")||s.type==="idle")return;if(!(p.buttons>0&&!!(p.buttons&1))){b({cancelled:false});return}let{clientX:F,clientY:X}=p;if(s.type==="pointerDown"){let he=F-s.dragStart.mouse.x,Ri=X-s.dragStart.mouse.y;if(Math.abs(he)<qn&&Math.abs(Ri)<qn)return;s={type:"dragging",dragStart:s.dragStart},i.invoke("onDragStart",s.dragStart),document.getSelection()?.empty(),Ro.disableUntilMouseUp();}d.setPointerCapture(p.pointerId);let P={x:F,y:X};i.invoke("onDrag",{dragSessionId:o,mouse:P}).then(he=>{s.type==="dragging"&&(document.body.style.cursor=he??"");});},"handlePointerChange"),z=r(p=>{p.key==="Escape"&&b({cancelled:true});},"handleKeyDown"),G=r(()=>{b({cancelled:true});},"handleBlur"),f=r(p=>{if(!re.isAllowedTo("makeDraggable"))return;b({cancelled:true});let y=e.getBoundingClientRect(),F={x:y.x,y:y.y,width:y.width,height:y.height},X,P=e.querySelectorAll("svg");if(P.length===1){let ot=P.item(0).getBoundingClientRect();X={x:ot.x,y:ot.y,width:ot.width,height:ot.height};}let he={x:p.clientX,y:p.clientY};s={type:"pointerDown",dragStart:{dragSessionId:o,elementRect:F,svgRect:X,mouse:he}},i.invoke("setDragData",o,t()),d.addEventListener("pointermove",D,true),d.addEventListener("pointerup",D,true),window.addEventListener("keydown",z,true),window.addEventListener("blur",G);},"handlePointerDown"),u=r(()=>{if(!re.isAllowedTo("makeDraggable"))return;let p=t();p.type==="detachedComponentLayers"&&i.invoke("preloadDetachedComponentLayers",p.url),p.type==="image"&&i.invoke("preloadImageUrlForInsertion",p.image),p.previewImage&&i.invoke("preloadDragPreviewImage",p.previewImage);},"preload");e.addEventListener("pointerdown",f),e.addEventListener("mouseenter",u);function I(){s={type:"idle"},document.body.style.cursor=a,d.removeEventListener("pointermove",D,true),d.removeEventListener("pointerup",D,true),window.removeEventListener("keydown",z,true),window.removeEventListener("blur",G);}return r(I,"dragCleanup"),()=>{e.removeEventListener("pointerdown",f),e.removeEventListener("mouseenter",u),b({cancelled:true}),T();}}r(Yn,"makeDraggable");var ge=class i{static{r(this,"Redirect");}#e;#t;get id(){return this.#e.id}get from(){return this.#e.from}get to(){return this.#e.to}get expandToAllLocales(){return this.#e.expandToAllLocales}constructor(e,t){this.#t=t,this.#e=e;}remove(){return this.#t.invoke("removeRedirects",[this.id])}async setAttributes(e){let t={...e,id:this.id},[n]=await this.#t.invoke("addRedirects",[t]);return m(at(n)),x(n)?null:new i(n,this.#t)}};var Ii=class{static{r(this,"FramerPluginAPI");}#e;constructor(e){this.#e=e;}get mode(){return this.#e.mode}isAllowedTo(...e){return e.every(t=>this.#e.perMethodPermissionMap[t])}subscribeToIsAllowedTo(...e){let[t,n]=Oi(e),o=this.isAllowedTo(...t),a=r(()=>{let s=this.isAllowedTo(...t);s!==o&&(o=s,n(o));},"update");return this.#e.permissionSubscriptions.add(a),()=>{this.#e.permissionSubscriptions.delete(a);}}async showUI(e){return this.#e.invoke("showUI",e)}async hideUI(){return this.#e.invoke("hideUI")}async setBackgroundMessage(e){return this.#e.invoke("setBackgroundMessage",e)}closePlugin(e,t){throw this.#e.invoke("closePlugin",e,t),new _}async getCurrentUser(){return this.#e.invoke("getCurrentUser2")}async getProjectInfo(){return this.#e.invoke("getProjectInfo2")}async getSelection(){return (await this.#e.invoke("getSelection")).map(t=>{let n=C(t,this.#e);return m(je(n)),n})}async setSelection(e){let t=g(e)?[e]:Array.from(e);return this.#e.invoke("setSelection",t)}subscribeToSelection(e){return this.#e.subscribe("selection",t=>{let n=t.map(o=>{let a=C(o,this.#e);return m(je(a)),a});e(n);})}async getCanvasRoot(){let e=await this.#e.invoke("getCanvasRoot"),t=C(e,this.#e);return m(ci(t)),t}subscribeToCanvasRoot(e){return this.#e.subscribe("canvasRoot",t=>{let n=C(t,this.#e);m(ci(n)),e(n);})}async getPublishInfo(){return this.#e.invoke("getPublishInfo")}subscribeToPublishInfo(e){return this.#e.subscribe("publishInfo",e)}async createFrameNode(e,t){let n=await this.#e.invoke("createNode","FrameNode",t??null,e);if(!n)return null;let o=C(n,this.#e);return m(o instanceof R),o}async removeNodes(e){return this.#e.invoke("removeNodes2",e)}async removeNode(e){return this.removeNodes([e])}async cloneNode(e){return this.#e.cloneNode(e)}async getNode(e){let t=await this.#e.invoke("getNode",e);return t?C(t,this.#e):null}async getParent(e){return this.#e.getParent(e)}async getChildren(e){return this.#e.getChildren(e)}async getRect(e){return this.#e.invoke("getRect",e)}async zoomIntoView(e,t){let n=g(e)?[e]:Array.from(e);return this.#e.invoke("zoomIntoView",n,t)}async setAttributes(e,t){return this.#e.setAttributes(e,t)}async setParent(e,t,n){return this.#e.invoke("setParent",e,t,n)}async getNodesWithType(e){return (await this.#e.invoke("getNodesWithType",null,e)).map(n=>C(n,this.#e))}async getNodesWithAttribute(e){return (await this.#e.invoke("getNodesWithAttribute",null,e)).map(n=>C(n,this.#e))}async getNodesWithAttributeSet(e){return (await this.#e.invoke("getNodesWithAttributeSet",null,e)).map(n=>C(n,this.#e))}async getImage(){let e=await this.#e.invoke("getImage");return e?h(this.#e,e):null}subscribeToImage(e){return this.#e.subscribe("image",t=>{if(!t){e(null);return}e(h(this.#e,t));})}async addImage(e){let t=await we(e),n=j(t);return this.#e.invokeTransferable("addImage",n,t)}async setImage(e){let t=await we(e),n=j(t);return this.#e.invokeTransferable("setImage",n,t)}async uploadImage(e){let t=await we(e),n=j(t),o=await this.#e.invokeTransferable("uploadImage",n,t);return h(this.#e,o)}async addImages(e){let t=await si(e),n=t.flatMap(j);await this.#e.invokeTransferable("addImages",n,t);}async uploadImages(e){let t=await si(e),n=t.flatMap(j),o=await this.#e.invokeTransferable("uploadImages",n,t);return h(this.#e,o)}async uploadFile(e){let t=await ai(e),n=await this.#e.invokeTransferable("uploadFile",j(t),t);return h(this.#e,n)}async uploadFiles(e){let t=await Promise.all(e.map(ai)),n=t.flatMap(j),o=await this.#e.invokeTransferable("uploadFiles",n,t);return h(this.#e,o)}async addSVG(e){return this.#e.invoke("addSVG",e)}async addComponentInstance({url:e,attributes:t,parentId:n}){let o=await this.#e.invoke("addComponentInstance",{url:e,attributes:t,parentId:n}),a=C(o,this.#e);return m(pe(a)),a}async addDetachedComponentLayers({url:e,layout:t,attributes:n}){let o=await this.#e.invoke("addDetachedComponentLayers",{url:e,layout:t,attributes:n}),a=C(o,this.#e);return m(Dt(a)),a}async preloadDetachedComponentLayers(e){await this.#e.invoke("preloadDetachedComponentLayers",e);}async preloadImageUrlForInsertion(e){await this.#e.invoke("preloadImageUrlForInsertion",e);}async preloadDragPreviewImage(e){await this.#e.invoke("preloadDragPreviewImage",e);}async getText(){return this.#e.invoke("getText")}async setText(e){return this.#e.invoke("setText",e)}async addText(e,t){return this.#e.invoke("addText",e,t)}async setCustomCode(e){return this.#e.invoke("setCustomCode",e)}async getCustomCode(){return this.#e.invoke("getCustomCode")}subscribeToCustomCode(e){return this.#e.subscribe("customCode",e)}subscribeToText(e){return this.#e.subscribe("text",e)}makeDraggable(e,t,n){return Yn(this.#e,e,t,n)}async getActiveManagedCollection(){let e=await this.#e.invoke("getActiveManagedCollection");return m(e,"Collection data must be defined"),new ce(e,this.#e)}async getManagedCollection(){return this.getActiveManagedCollection()}async getManagedCollections(){let e=await this.#e.invoke("getManagedCollections");return m(e,"Collections data must be defined"),e.map(t=>new ce(t,this.#e))}async getCollection(e){let t=await this.#e.invoke("getCollection",e);return t?new J(t,this.#e):null}async getActiveCollection(){let e=await this.#e.invoke("getActiveCollection");return e?new J(e,this.#e):null}async getCollections(){return (await this.#e.invoke("getCollections")).map(t=>new J(t,this.#e))}notify=(e,t)=>this.#e.notify(e,t);async getPluginData(e){return this.#e.invoke("getPluginData",e)}async setPluginData(e,t){return this.#e.invoke("setPluginData",e,t)}async getPluginDataKeys(){return this.#e.invoke("getPluginDataKeys")}async getColorStyles(){let e=await this.#e.invoke("getColorStyles");return h(this.#e,e)}async getColorStyle(e){let t=await this.#e.invoke("getColorStyle",e);return t?h(this.#e,t):null}async createColorStyle(e){let t=await this.#e.invoke("createColorStyle",e);return h(this.#e,t)}subscribeToColorStyles(e){return this.#e.subscribe("colorStyles",t=>{let n=h(this.#e,t);return e(n)})}async getTextStyles(){let e=await this.#e.invoke("getTextStyles");return h(this.#e,e)}async getTextStyle(e){let t=await this.#e.invoke("getTextStyle",e);return t?h(this.#e,t):null}async createTextStyle(e){let t=await this.#e.invoke("createTextStyle",e);return h(this.#e,t)}subscribeToTextStyles(e){return this.#e.subscribe("textStyles",t=>{let n=h(this.#e,t);return e(n)})}async getFont(e,t){let n=await this.#e.invoke("getFont",e,t);return n?h(this.#e,n):null}async getFonts(){let e=await this.#e.invoke("getFonts");return h(this.#e,e)}getLocales(){return this.#e.invoke("getLocales")}getDefaultLocale(){return this.#e.invoke("getDefaultLocale")}getActiveLocale(){return this.#e.invoke("getActiveLocale")}async getLocalizationGroups(){return this.#e.invoke("getLocalizationGroups")}setLocalizationData(e){return this.#e.invoke("setLocalizationData",e)}async getRedirects(){return (await this.#e.invoke("getRedirects")).map(t=>new ge(t,this.#e))}subscribeToRedirects(e){return this.#e.subscribe("redirects",t=>{let n=t.map(o=>new ge(o,this.#e));return e(n)})}async addRedirects(e){return (await this.#e.invoke("addRedirects",e)).map(n=>new ge(n,this.#e))}async removeRedirects(e){return this.#e.invoke("removeRedirects",e)}async setRedirectOrder(e){return this.#e.invoke("setRedirectOrder",e)}async createCodeFile(e,t,n){let o=await this.#e.invoke("createCodeFile",e,t,n);return new q(o,this.#e)}async getCodeFiles(){let e=await this.#e.invoke("getCodeFiles"),t=[];for(let n of e)t.push(new q(n,this.#e));return t}async getCodeFile(e){let t=await this.#e.invoke("getCodeFile",e);return t?new q(t,this.#e):null}lintCode(e,t,n){return this.#e.invoke("lintCode",e,t,n)}typecheckCode(e,t,n){return this.#e.invoke("typecheckCode",e,t,n)}subscribeToCodeFiles(e){return this.#e.subscribe("codeFiles",t=>{let n=t?.map(o=>new q(o,this.#e));return e(n)})}setMenu(e){return this.#e.setMenu(e)}showContextMenu(e,t){return this.#e.showContextMenu(e,t)}async unstable_ensureMinimumDependencyVersion(e,t){return this.#e.invoke("unstable_ensureMinimumDependencyVersion",e,t)}async navigateTo(e,t){return this.#e.invoke("navigateTo",e,t)}subscribeToOpenCodeFile(e){return this.#e.subscribe("openCodeFile",t=>{let n=t?new q(t,this.#e):null;return e(n)})}async createDesignPage(e){let t=await this.#e.invoke("createDesignPage",e),n=C(t,this.#e);return m(n instanceof ne,"Expected node to be a DesignPageNode"),n}async createWebPage(e){let t=await this.#e.invoke("createWebPage",e),n=C(t,this.#e);return m(n instanceof te,"Expected node to be a WebPageNode"),n}async createCollection(e){let t=await this.#e.invoke("createCollection",e);return new J(t,this.#e)}},Ti=class extends Ii{static{r(this,"FramerPluginAPIBeta");}#e;constructor(e){super(e),this.#e=e,this.#e;}},Xe=class extends Ti{static{r(this,"FramerPluginAPIAlpha");}#e;constructor(e){super(e),this.#e=e,this.#e;}async addComponentInstancePlaceholder(e){let t=await this.#e.invoke("addComponentInstancePlaceholder",e);return new Et(t,this.#e)}async[l.getAiServiceInfo](){return this.#e.invoke(ut)}async[l.sendTrackingEvent](e,t,n){return this.#e.invoke(ct,e,t,n)}async[l.getHTMLForNode](e){return this.#e.invoke(se,e)}async[l.setHTMLForNode](e,t){return this.#e.invoke(le,e,t)}get[l.environmentInfo](){return this.#e.environmentInfo}get[l.showUncheckedPermissionToasts](){return this.#e.showUncheckedPermissionToasts}set[l.showUncheckedPermissionToasts](e){this.#e.showUncheckedPermissionToasts=e;}async createTextNode(e,t){let n=await this.#e.invoke("createNode","TextNode",t??null,e);if(!n)return null;let o=C(n,this.#e);return m(o instanceof ee),o}async createComponentNode(e){let t=await this.#e.invoke("createNode","ComponentNode",null,{name:e});if(!t)return null;let n=C(t,this.#e);return m(n instanceof ie),n}async getVectorSets(){return (await this.#e.invoke("getVectorSets")).map(t=>new _e(t,this.#e))}async[B.publish](){return this.#e.invoke("publish")}async[B.getDeployments](){return this.#e.invoke("getDeployments")}async[B.deploy](e,t){return this.#e.invoke("deploy",e,t)}async[B.getChangedPaths](){return this.#e.invoke("getChangedPaths")}async[B.getChangeContributors](e,t){return this.#e.invoke("getChangeContributors",e,t)}async[B.createManagedCollection](e){let t=await this.#e.invoke("createManagedCollection",e);return new ce(t,this.#e)}};var Pi=class{constructor(e){this.origin=e;}static{r(this,"IframeTransport");}send(e,t){window.parent.postMessage(e,this.origin,t);}onMessage(e){window.addEventListener("message",e);}};async function Oo(){return new Promise(i=>{function e({data:t,origin:n}){if(!Hn(t))return;window.removeEventListener("message",e);let a={transport:new Pi(n),mode:t.mode,permissionMap:t.permissionMap,environmentInfo:t.environmentInfo,origin:n,theme:t.theme??null};i(a);}r(e,"handshakeListener"),window.addEventListener("message",e),window.parent.postMessage(Kn,"*");})}r(Oo,"createBrowserContext");async function zo(){return typeof window<"u"?Oo():null}r(zo,"bootstrap");var Xn=await zo(),re=Xn?new Xe(new Ye(Xn)):new Proxy({},{get(i,e){throw new Error(`Cannot access framer.${String(e)} in server runtime. Use createFramerInstance() with a custom transport.`)}});function Zn(i){return new Xe(new Ye(i))}r(Zn,"createFramerInstance");var $o=Ko,Jn=$o.env;function Ho(i){Object.assign(Jn,i);}r(Ho,"configure");function fe(i,e){return Jn[i]??e}r(fe,"getEnv");var Qn=typeof globalThis.WebSocket<"u"?globalThis.WebSocket:WebSocket,er,tr;try{er=await import('node:fs'),tr=await import('node:path');}catch{}var Si=er,Fi=tr;function w(i,...e){if(i)return;let t=Error("Assertion Error"+(e.length>0?": "+e.join(" "):""));if(t.stack)try{let n=t.stack.split(`
|
|
9
|
+
`));}catch{}throw t}r(m,"assert");function S(i){for(let e of Reflect.ownKeys(i)){let t=i[e];!t||typeof t!="object"&&!kr(t)||S(t);}return Object.freeze(i)}r(S,"deepFreeze");function zi(i){return [i.slice(0,-1),i.at(-1)]}r(zi,"splitRestAndLast");var c="__class";var Ut=Symbol(),Ot=Symbol(),Mr=Symbol(),Er=Symbol(),Ar=Symbol(),Vr=Symbol(),zt=Symbol(),Gt=Symbol(),l={getAiServiceInfo:Ut,sendTrackingEvent:Ot,environmentInfo:Mr,showUncheckedPermissionToasts:Er,marshal:Ar,unmarshal:Vr,getHTMLForNode:zt,setHTMLForNode:Gt},dt="INTERNAL_",ut=`${dt}getAiServiceInfo`,ct=`${dt}sendTrackingEvent`,se=`${dt}getHTMLForNode`,le=`${dt}setHTMLForNode`;var k=class{static{r(this,"VariableBase");}#e;#t;get nodeId(){return this.#t.nodeId}get nodeType(){return this.#t.nodeType}get id(){return this.#t.id}get name(){return this.#t.name}get description(){return this.#t.description??null}constructor(e,t){this.#e=e,this.#t=t;}async setAttributes(e){let t=await this.#e.invoke("updateVariable",this.nodeId,this.id,{...e,type:this.type});if(x(t))return null;let n=this.constructor;return new n(this.#e,t)}async remove(){await this.#e.invoke("removeVariables",this.nodeId,[this.id]);}},M="Variable";function E(i){let e=i.at(0);return m(!Ui(e)),`${e.toLowerCase()}${i.slice(1,-M.length)}`}r(E,"classToType");var wr=`Boolean${M}`,Wr=E(wr),xe=class i extends k{static{r(this,"BooleanVariable");}type=Wr;#e;constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new i(e,t)}[l.marshal](){return this.#e}},Lr=`Number${M}`,Rr=E(Lr),Ce=class i extends k{static{r(this,"NumberVariable");}type=Rr;#e;constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new i(e,t)}[l.marshal](){return this.#e}},Br=`String${M}`,Ur=E(Br),Ie=class i extends k{static{r(this,"StringVariable");}type=Ur;#e;constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new i(e,t)}[l.marshal](){return this.#e}},Or=`FormattedText${M}`,zr=E(Or),Te=class i extends k{static{r(this,"FormattedTextVariable");}type=zr;#e;constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new i(e,t)}[l.marshal](){return this.#e}},Gr=`Enum${M}`,Kr=E(Gr),$=class i{static{r(this,"EnumCase");}#e;#t;#i;#n;get id(){return this.#n.id}get name(){return this.#n.name}get nameByLocale(){return this.#n.nameByLocale}constructor(e,t,n,o){this.#e=e,this.#t=t,this.#i=n,this.#n=o;}async setAttributes(e){let t=await this.#e.invoke("updateEnumCase",this.#t,this.#i,this.id,e);return t?new i(this.#e,this.#t,this.#i,t):null}async remove(){await this.#e.invoke("removeEnumCase",this.#t,this.#i,this.id);}},Pe=class i extends k{static{r(this,"EnumVariable");}type=Kr;#e;#t;#i;get cases(){return this.#i||(this.#i=S(this.#t.cases.map(e=>new $(this.#e,this.nodeId,this.id,e)))),this.#i}constructor(e,t){super(e,t),this.#e=e,this.#t=t;}static[l.unmarshal](e,t){return new i(e,t)}[l.marshal](){return this.#t}async addCase(e){let t=await this.#e.invoke("addEnumCase",this.nodeId,this.id,e);return t?new $(this.#e,this.nodeId,this.id,t):null}async setCaseOrder(e){await this.#e.invoke("setEnumCaseOrder",this.nodeId,this.id,e);}},$r=`Color${M}`,Hr=E($r),Se=class i extends k{static{r(this,"ColorVariable");}type=Hr;#e;constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new i(e,t)}[l.marshal](){return this.#e}},jr=`Image${M}`,_r=E(jr),Fe=class i extends k{static{r(this,"ImageVariable");}type=_r;#e;constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new i(e,t)}[l.marshal](){return this.#e}},qr=`File${M}`,Yr=E(qr),De=class i extends k{static{r(this,"FileVariable");}type=Yr;#e;get allowedFileTypes(){return this.#e.allowedFileTypes}constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new i(e,t)}[l.marshal](){return this.#e}},Xr=`Link${M}`,Zr=E(Xr),ve=class i extends k{static{r(this,"LinkVariable");}type=Zr;#e;constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new i(e,t)}[l.marshal](){return this.#e}},Jr=`Date${M}`,Qr=E(Jr),Ne=class i extends k{static{r(this,"DateVariable");}type=Qr;#e;constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new i(e,t)}[l.marshal](){return this.#e}},eo=`Border${M}`,to=E(eo),ke=class i extends k{static{r(this,"BorderVariable");}type=to;#e;constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new i(e,t)}[l.marshal](){return this.#e}},io=`Unsupported${M}`,no=E(io),Me=class i extends k{static{r(this,"UnsupportedVariable");}type=no;#e;constructor(e,t){super(e,t),this.#e=t;}static[l.unmarshal](e,t){return new i(e,t)}[l.marshal](){return this.#e}};function Gi(i){return i instanceof k}r(Gi,"isVariable");function ro(i){return Gi(i)&&i.nodeType==="component"}r(ro,"isComponentVariable");var W=class{static{r(this,"FieldBase");}#e;#t;#i;get id(){return this.#i.id}get name(){return this.#i.name}constructor(e,t,n){this.#e=e,this.#t=t,this.#i=n;}async setAttributes(e){let t={...e,type:this.type,id:this.id},[n]=await this.#e.invoke("addCollectionFields2",this.#t,[t]);if(m(at(n)),x(n))return null;m(n.type===this.type);let o=this.constructor;return new o(this.#e,this.#t,n)}async remove(){await this.#e.invoke("removeCollectionFields",this.#t,[this.id]);}},V=class extends W{static{r(this,"FieldBaseWithRequired");}#e;get required(){return this.#e.required}constructor(e,t,n){super(e,t,n),this.#e=n;}},pt=class extends W{static{r(this,"BooleanField");}type=Ht},mt=class extends W{static{r(this,"ColorField");}type=jt},gt=class extends W{static{r(this,"NumberField");}type=_t},ft=class extends V{static{r(this,"StringField");}type=qt;#e;constructor(e,t,n){super(e,t,n),this.#e=n;}get basedOn(){return this.#e.basedOn}},yt=class extends V{static{r(this,"FormattedTextField");}type=Yt},Ee=class extends V{static{r(this,"ImageField");}type=Xt},ht=class extends V{static{r(this,"LinkField");}type=Jt},bt=class extends V{static{r(this,"DateField");}type=Qt},xt=class extends W{static{r(this,"FieldDivider");}type=ri},Ae=class extends W{static{r(this,"UnsupportedField");}type=oi},Ct=class extends V{static{r(this,"FileField");}type=ei;#e;get allowedFileTypes(){return this.#e.allowedFileTypes}constructor(e,t,n){super(e,t,n),this.#e=n;}},It=class extends W{static{r(this,"EnumField");}type=ti;#e;#t;#i;#n;get cases(){return this.#n||(this.#n=this.#i.cases.map(e=>new $(this.#e,this.#t,this.id,e)),S(this.#n)),this.#n}constructor(e,t,n){super(e,t,n),this.#e=e,this.#t=t,this.#i=n;}async addCase(e){let t=await this.#e.invoke("addEnumCase",this.#t,this.id,e);return t?new $(this.#e,this.#t,this.id,t):null}async setCaseOrder(e){await this.#e.invoke("setEnumCaseOrder",this.#t,this.id,e);}},Tt=class extends V{static{r(this,"CollectionReferenceField");}type=ii;#e;get collectionId(){return this.#e.collectionId}constructor(e,t,n){super(e,t,n),this.#e=n;}},Pt=class extends V{static{r(this,"MultiCollectionReferenceField");}type=ni;#e;get collectionId(){return this.#e.collectionId}constructor(e,t,n){super(e,t,n),this.#e=n;}},Kt=class extends V{static{r(this,"ArrayField");}type=Zt;fields;constructor(e,t,n){super(e,t,n);let o=n.fields[0];this.fields=[new Ee(e,t,o)];}};function $t(i,e,t){return i.map(n=>{switch(n.type){case Ht:return new pt(e,t,n);case jt:return new mt(e,t,n);case _t:return new gt(e,t,n);case qt:return new ft(e,t,n);case Yt:return new yt(e,t,n);case Xt:return new Ee(e,t,n);case Jt:return new ht(e,t,n);case Qt:return new bt(e,t,n);case ri:return new xt(e,t,n);case oi:return new Ae(e,t,n);case ei:return new Ct(e,t,n);case ti:return new It(e,t,n);case ii:return new Tt(e,t,n);case ni:return new Pt(e,t,n);case Zt:return new Kt(e,t,n);default:return new Ae(e,t,n)}})}r($t,"fieldDefinitionDataArrayToFieldClassInstances");function oo(i){return i instanceof W}r(oo,"isField");var Ki="action";function ao(i){return !!i&&Ki in i&&g(i[Ki])}r(ao,"isLocalizedValueUpdate");function $i(i){return Object.keys(i).reduce((e,t)=>{let n=i[t];return ao(n)&&(e[t]=n),e},{})}r($i,"filterInlineLocalizationValues");var Ve=class i{static{r(this,"FileAsset");}id;url;extension;constructor(e){this.url=e.url,this.id=e.id,this.extension=e.extension;}static[l.unmarshal](e,t){return new i(t)}[l.marshal](){return {[c]:"FileAsset",id:this.id,url:this.url,extension:this.extension}}};function so(i){return i instanceof Ve}r(so,"isFileAsset");var lo="ImageAsset";function Hi(i){return v(i)?i[c]===lo:false}r(Hi,"isImageAssetData");var H=class i{static{r(this,"ImageAsset");}id;url;thumbnailUrl;altText;resolution;#e;#t;constructor(e,t){this.#t=e,this.url=t.url,this.id=t.id,this.thumbnailUrl=t.thumbnailUrl,this.altText=t.altText,this.resolution=t.resolution;}static[l.unmarshal](e,t){return new i(e,t)}[l.marshal](){return {[c]:"ImageAsset",id:this.id,url:this.url,thumbnailUrl:this.thumbnailUrl,altText:this.altText,resolution:this.resolution}}cloneWithAttributes({altText:e,resolution:t}){return new i(this.#t,{[c]:"ImageAsset",id:this.id,url:this.url,thumbnailUrl:this.thumbnailUrl,altText:e??this.altText,resolution:t??this.resolution})}async measure(){return po(this.url)}async getData(){if(this.#e&&this.#e.bytes.length>0)return this.#e;let e=await this.#t.invoke("getImageData",{id:this.id,resolution:this.resolution});if(!e)throw new Error("Failed to load image data");return this.#e=e,e}async loadBitmap(){let{mimeType:e,bytes:t}=await this.getData(),n=new Blob([t],{type:e});return createImageBitmap(n)}async loadImage(){let e=await this.getData(),t=URL.createObjectURL(new Blob([e.bytes]));return new Promise((n,o)=>{let a=new Image;a.onload=()=>n(a),a.onerror=()=>o(),a.src=t;})}};function uo(i){return i instanceof H}r(uo,"isImageAsset");function j(i){return i.type==="bytes"?[i.bytes.buffer]:[]}r(j,"getTransferable");function co(i){if(!v(i))return false;let e="bytes",t="mimeType";return !(!(e in i)||!(t in i)||!(i[e]instanceof Uint8Array)||!g(i[t]))}r(co,"isBytesData");async function we(i){if(i instanceof File)return li(i);let e=await ji(i.image);return {name:i.name,altText:i.altText,resolution:i.resolution,preferredImageRendering:i.preferredImageRendering,...e}}r(we,"createImageTransferFromInput");async function ai(i){if(i instanceof File)return li(i);let e=await ji(i.file);return {name:i.name,...e}}r(ai,"createFileTransferFromInput");async function ji(i){return i instanceof File?li(i):co(i)?{type:"bytes",mimeType:i.mimeType,bytes:i.bytes}:{type:"url",url:i}}r(ji,"createAssetTransferFromAssetInput");function si(i){return Promise.all(i.map(we))}r(si,"createNamedAssetDataTransferFromInput");async function li(i){return new Promise((e,t)=>{let n=new FileReader;n.onload=o=>{let a=i.type,s=o.target?.result;if(!s||!(s instanceof ArrayBuffer)){t(new Error("Failed to read file, arrayBuffer is null"));return}let d=new Uint8Array(s);e({bytes:d,mimeType:a,type:"bytes",name:i.name});},n.onerror=o=>{t(o);},n.readAsArrayBuffer(i);})}r(li,"getAssetDataFromFile");async function po(i){let e=i instanceof File,t=e?URL.createObjectURL(i):i,n=new Image;return n.crossOrigin="anonymous",new Promise((o,a)=>{n.onload=()=>{o({width:n.naturalWidth,height:n.naturalHeight});},n.onerror=s=>{a(s);},n.src=t;}).finally(()=>{e&&URL.revokeObjectURL(t);})}r(po,"measureImage");var St=class{static{r(this,"ComputedValueBase");}};var mo="unsupported",We=class i extends St{static{r(this,"UnsupportedComputedValue");}type=mo;#e;constructor(e){super(),this.#e=e;}static[l.unmarshal](e,t){return new i(t)}[l.marshal](){return this.#e}};function go(i){return i instanceof St}r(go,"isComputedValue");var fo="Font";function qi(i){return v(i)&&i[c]===fo}r(qi,"isFontData");function yo(i){if(!K(i))return false;switch(i){case 100:case 200:case 300:case 400:case 500:case 600:case 700:case 800:case 900:return true;default:return false}}r(yo,"isFontWeight");function ho(i){if(!g(i))return false;switch(i){case "normal":case "italic":return true;default:return false}}r(ho,"isFontStyle");function Yi(i){return v(i)?g(i.family)&&g(i.selector)&&yo(i.weight)&&ho(i.style):false}r(Yi,"isFont");var U=class i{static{r(this,"Font");}selector;family;weight;style;constructor(e){this.selector=e.selector,this.family=e.family,this.weight=e.weight,this.style=e.style;}static[l.unmarshal](e,t){let n=_i.get(t.selector);if(n)return n;let o=new i(t);return _i.set(t.selector,o),o}[l.marshal](){return {[c]:"Font",selector:this.selector,family:this.family,weight:this.weight,style:this.style}}},_i=new Map;var bo="LinearGradient",xo="RadialGradient",Co="ConicGradient",de=class{static{r(this,"GradientBase");}#e;get stops(){return this.#e.stops}constructor(e){this.#e=e;}cloneWithAttributes(e){let t=this.constructor;return new t({...this.#e,...e})}},Le=class i extends de{static{r(this,"LinearGradient");}[c]=bo;#e;get angle(){return this.#e.angle}constructor(e){super(e),this.#e=e;}static[l.unmarshal](e,t){return new i({...t,stops:h(e,t.stops)})}[l.marshal](){return L({...this.#e,[c]:this[c]})}toCSS(){let e=this.#e.stops.map(t=>(m(g(t.color),"ColorStyle not supported yet"),`${t.color} ${t.position*100}%`)).join(", ");return `linear-gradient(${this.angle}deg, ${e})`}},Re=class i extends de{static{r(this,"RadialGradient");}[c]=xo;#e;get width(){return this.#e.width}get height(){return this.#e.height}get x(){return this.#e.x}get y(){return this.#e.y}constructor(e){super(e),this.#e=e;}static[l.unmarshal](e,t){return new i({...t,stops:h(e,t.stops)})}[l.marshal](){return L({...this.#e,[c]:this[c]})}toCSS(){let e=this.stops.map((t,n)=>{m(g(t.color),"ColorStyle not supported yet");let o=this.stops[n+1],a=t.position===1&&o?.position===1?t.position-1e-4:t.position;return `${t.color} ${a*100}%`}).join(", ");return `radial-gradient(${this.width} ${this.height} at ${this.x} ${this.y}, ${e})`}},Be=class i extends de{static{r(this,"ConicGradient");}[c]=Co;#e;get angle(){return this.#e.angle}get x(){return this.#e.x}get y(){return this.#e.y}constructor(e){super(e),this.#e=e;}static[l.unmarshal](e,t){return new i({...t,stops:h(e,t.stops)})}[l.marshal](){return L({...this.#e,[c]:this[c]})}toCSS(){let e=this.stops.map(t=>(m(g(t.color),"ColorStyle not supported yet"),`${t.color} ${t.position*360}deg`)).join(", ");return `conic-gradient(from ${this.angle}deg at ${this.x} ${this.y}, ${e})`}};function Xi(i){return i instanceof de}r(Xi,"isGradient");var Io="ColorStyle";function Ft(i){return v(i)?i[c]===Io:false}r(Ft,"isColorStyleData");var Z=class i{static{r(this,"ColorStyle");}id;name;path;light;dark;#e;constructor(e,t){this.id=t.id,this.name=t.name,this.light=t.light,this.dark=t.dark,this.path=t.path,this.#e=e;}static[l.unmarshal](e,t){return new i(e,t)}[l.marshal](){return {[c]:"ColorStyle",id:this.id,name:this.name,light:this.light,dark:this.dark,path:this.path}}async setAttributes(e){let t=await this.#e.invoke("setColorStyleAttributes",this.id,e);return t?new i(this.#e,t):null}async getPluginData(e){return this.#e.invoke("getPluginDataForNode",this.id,e)}async setPluginData(e,t){return this.#e.invoke("setPluginDataForNode",this.id,e,t)}async getPluginDataKeys(){return this.#e.invoke("getPluginDataKeysForNode",this.id)}async remove(){return this.#e.invoke("removeColorStyle",this.id)}};function ue(i){return i instanceof Z}r(ue,"isColorStyle");var To="TextStyle";function Zi(i){return v(i)?i[c]===To:false}r(Zi,"isTextStyleData");var Ue=class i{static{r(this,"TextStyle");}id;name;path;tag;font;boldFont;italicFont;boldItalicFont;color;transform;alignment;decoration;decorationColor;decorationThickness;decorationStyle;decorationSkipInk;decorationOffset;balance;breakpoints;minWidth;fontSize;letterSpacing;lineHeight;paragraphSpacing;#e;constructor(e,t){this.id=t.id,this.name=t.name,this.path=t.path,this.tag=t.tag,this.font=U[l.unmarshal](e,t.font),this.boldFont=t.boldFont&&U[l.unmarshal](e,t.boldFont),this.italicFont=t.italicFont&&U[l.unmarshal](e,t.italicFont),this.boldItalicFont=t.boldItalicFont&&U[l.unmarshal](e,t.boldItalicFont),this.color=Ft(t.color)?Z[l.unmarshal](e,t.color):t.color,this.transform=t.transform,this.alignment=t.alignment,this.decoration=t.decoration,this.decorationColor=Ft(t.decorationColor)?Z[l.unmarshal](e,t.decorationColor):t.decorationColor,this.decorationThickness=t.decorationThickness,this.decorationStyle=t.decorationStyle,this.decorationSkipInk=t.decorationSkipInk,this.decorationOffset=t.decorationOffset,this.balance=t.balance,this.breakpoints=t.breakpoints,this.minWidth=t.minWidth,this.fontSize=t.fontSize,this.letterSpacing=t.letterSpacing,this.lineHeight=t.lineHeight,this.paragraphSpacing=t.paragraphSpacing,this.#e=e;}static[l.unmarshal](e,t){return new i(e,t)}[l.marshal](){return {[c]:"TextStyle",id:this.id,name:this.name,path:this.path,tag:this.tag,font:this.font[l.marshal](),boldFont:this.boldFont?.[l.marshal]()??null,italicFont:this.italicFont?.[l.marshal]()??null,boldItalicFont:this.boldItalicFont?.[l.marshal]()??null,color:ue(this.color)?this.color[l.marshal]():this.color,transform:this.transform,alignment:this.alignment,decoration:this.decoration,decorationColor:ue(this.decorationColor)?this.decorationColor[l.marshal]():this.decorationColor,decorationThickness:this.decorationThickness,decorationStyle:this.decorationStyle,decorationSkipInk:this.decorationSkipInk,decorationOffset:this.decorationOffset,balance:this.balance,breakpoints:this.breakpoints,minWidth:this.minWidth,fontSize:this.fontSize,letterSpacing:this.letterSpacing,lineHeight:this.lineHeight,paragraphSpacing:this.paragraphSpacing}}async setAttributes(e){let t=await this.#e.invoke("setTextStyleAttributes",this.id,e);return t?new i(this.#e,t):null}async getPluginData(e){return this.#e.invoke("getPluginDataForNode",this.id,e)}async setPluginData(e,t){return this.#e.invoke("setPluginDataForNode",this.id,e,t)}async getPluginDataKeys(){return this.#e.invoke("getPluginDataKeysForNode",this.id)}async remove(){return this.#e.invoke("removeTextStyle",this.id)}};function di(i){return i instanceof Ue}r(di,"isTextStyle");function Po(i){return v(i)&&l.marshal in i}r(Po,"isSelfMarshalable");function L(i){if(Po(i))return i[l.marshal]();if(Bt(i))return i.map(L);if(st(i)){let e={};for(let t of Object.keys(i))e[t]=L(i[t]);return e}return i}r(L,"marshal");var Ji={ColorStyle:Z,ConicGradient:Be,FileAsset:Ve,Font:U,ImageAsset:H,LinearGradient:Le,RadialGradient:Re,TextStyle:Ue,BooleanVariable:xe,BorderVariable:ke,ColorVariable:Se,DateVariable:Ne,EnumVariable:Pe,FileVariable:De,FormattedTextVariable:Te,ImageVariable:Fe,LinkVariable:ve,NumberVariable:Ce,StringVariable:Ie,UnsupportedVariable:Me,UnsupportedComputedValue:We};function So(i){return st(i)&&g(i[c])&&i[c]in Ji}r(So,"isSelfUnmarshalable");function h(i,e){if(So(e))return Ji[e[c]][l.unmarshal](i,e);if(Bt(e))return e.map(t=>h(i,t));if(st(e)){let t={};for(let n of Object.keys(e))t[n]=h(i,e[n]);return t}return e}r(h,"unmarshal");var Fo={array:false,boolean:false,collectionReference:false,color:false,date:false,enum:false,file:false,formattedText:false,image:true,link:false,multiCollectionReference:false,number:false,string:false,unsupported:false};function Do(i){return Fo[i]}r(Do,"isSupportedArrayItemFieldType");function vo(i){return Do(i.type)}r(vo,"isSupportedArrayItemFieldDataEntry");var Ht="boolean",jt="color",_t="number",qt="string",Yt="formattedText",Xt="image",Zt="array",Jt="link",Qt="date",ei="file",ti="enum",ii="collectionReference",ni="multiCollectionReference",ri="divider",oi="unsupported";function No(i){return i.map(e=>{if(e.type!=="enum")return e;let t=e.cases.map(n=>{let o=n.nameByLocale?$i(n.nameByLocale):undefined;return {...n,nameByLocale:o}});return {...e,cases:t}})}r(No,"sanitizeEnumFieldForMessage");function Qi(i,e){let t={};for(let n in i){let o=i[n];if(!o)continue;if(o.type!=="array"){t[n]=h(e,o);continue}let a=o.value.map(s=>{let d=Qi(s.fieldData,e),T={};for(let b in d){let D=d[b];m(D&&vo(D),"Unsupported array item field data entry"),T[b]=D;}return {...s,fieldData:T}});t[n]={...o,value:a};}return t}r(Qi,"deserializeFieldData");var ce=class{static{r(this,"ManagedCollection");}id;name;readonly;managedBy;#e;constructor(e,t){this.id=e.id,this.name=e.name,this.readonly=e.readonly,m(e.managedBy!=="user","Managed Collection can only be managed by a plugin"),this.managedBy=e.managedBy,this.#e=t,S(this);}async getItemIds(){return this.#e.invoke("getManagedCollectionItemIds",this.id)}async setItemOrder(e){return this.#e.invoke("setManagedCollectionItemOrder",this.id,e)}async getFields(){return this.#e.invoke("getManagedCollectionFields2",this.id)}async setFields(e){let t=No(e);return this.#e.invoke("setManagedCollectionFields",this.id,t)}async addItems(e){return this.#e.invoke("addManagedCollectionItems2",this.id,e)}async removeItems(e){return this.#e.invoke("removeManagedCollectionItems",this.id,e)}async setAsActive(){return this.#e.invoke("setActiveCollection",this.id)}async setPluginData(e,t){return this.#e.invoke("setPluginDataForNode",this.id,e,t)}async getPluginData(e){return this.#e.invoke("getPluginDataForNode",this.id,e)}async getPluginDataKeys(){return this.#e.invoke("getPluginDataKeysForNode",this.id)}async navigateTo(e){return this.#e.invoke("navigateTo",this.id,e)}},J=class{static{r(this,"Collection");}id;name;slugFieldName;slugFieldBasedOn;readonly;managedBy;#e;constructor(e,t){this.id=e.id,this.name=e.name,this.slugFieldName=e.slugFieldName,this.slugFieldBasedOn=e.slugFieldBasedOn,this.readonly=e.readonly,this.managedBy=e.managedBy,this.#e=t,S(this);}async setItemOrder(e){return this.#e.invoke("setCollectionItemOrder",this.id,e)}async getFields(){let e=await this.#e.invoke("getCollectionFields2",this.id,true);return $t(e,this.#e,this.id)}async addFields(e){let t=await this.#e.invoke("addCollectionFields2",this.id,e);return m(t.every(Oi)),$t(t,this.#e,this.id)}async removeFields(e){return this.#e.invoke("removeCollectionFields",this.id,e)}async setFieldOrder(e){return this.#e.invoke("setCollectionFieldOrder",this.id,e)}async getItems(){return (await this.#e.invoke("getCollectionItems2",this.id)).map(t=>new Oe(t,this.#e))}async addItems(e){await this.#e.invoke("addCollectionItems2",this.id,e);}async removeItems(e){return this.#e.invoke("removeCollectionItems",e)}async setAsActive(){return this.#e.invoke("setActiveCollection",this.id)}async setPluginData(e,t){return this.#e.invoke("setPluginDataForNode",this.id,e,t)}async getPluginData(e){return this.#e.invoke("getPluginDataForNode",this.id,e)}async getPluginDataKeys(){return this.#e.invoke("getPluginDataKeysForNode",this.id)}async navigateTo(e){return this.#e.invoke("navigateTo",this.id,e)}},Oe=class i{static{r(this,"CollectionItem");}id;nodeId;slug;slugByLocale;draft;fieldData;#e;constructor(e,t){let n=Qi(e.fieldData,t);this.id=e.externalId??e.nodeId,this.nodeId=e.nodeId,this.slug=e.slug,this.slugByLocale=e.slugByLocale,this.draft=e.draft??false,this.fieldData=n,this.#e=t,S(this);}async remove(){return this.#e.invoke("removeCollectionItems",[this.id])}async setAttributes(e){let t=await this.#e.invoke("setCollectionItemAttributes2",this.id,e);return t?new i(t,this.#e):null}async setPluginData(e,t){return this.#e.invoke("setPluginDataForNode",this.id,e,t)}async getPluginData(e){return this.#e.invoke("getPluginDataForNode",this.id,e)}async getPluginDataKeys(){return this.#e.invoke("getPluginDataKeysForNode",this.id)}async navigateTo(e){return this.#e.invoke("navigateTo",this.nodeId,e)}};var ko={fixed:true,sticky:true,absolute:true,relative:true},en="position";function As(i){if(!(en in i))return false;let e=i[en];return g(e)&&ko[e]===true}r(As,"supportsPosition");var tn="top";function Vs(i){if(!(tn in i))return false;let e=i[tn];return g(e)||x(e)}r(Vs,"supportsPins");var nn="width";function ws(i){if(!(nn in i))return false;let e=i[nn];return g(e)||x(e)}r(ws,"supportsSize");var rn="maxWidth";function Ws(i){if(!(rn in i))return false;let e=i[rn];return g(e)||x(e)}r(Ws,"supportsSizeConstraints");var on="aspectRatio";function Ls(i){if(!(on in i))return false;let e=i[on];return K(e)||x(e)}r(Ls,"supportsAspectRatio");var an="name";function Rs(i){if(!(an in i))return false;let e=i[an];return g(e)||x(e)}r(Rs,"supportsName");var sn="visible";function Bs(i){if(!(sn in i))return false;let e=i[sn];return be(e)}r(Bs,"supportsVisible");var ln="locked";function Us(i){if(!(ln in i))return false;let e=i[ln];return be(e)}r(Us,"supportsLocked");var dn="backgroundColor";function Os(i){if(!(dn in i))return false;let e=i[dn];return g(e)||ue(e)||x(e)}r(Os,"supportsBackgroundColor");var un="backgroundColor";function zs(i){if(!(un in i))return false;let e=i[un];return g(e)||Ft(e)||x(e)}r(zs,"supportsBackgroundColorData");var cn="backgroundImage";function Gs(i){if(!(cn in i))return false;let e=i[cn];return e instanceof H||x(e)}r(Gs,"supportsBackgroundImage");var pn="backgroundImage";function Ks(i){if(!(pn in i))return false;let e=i[pn];return e instanceof H?false:Hi(e)||x(e)}r(Ks,"supportsBackgroundImageData");var mn="backgroundGradient";function $s(i){if(!(mn in i))return false;let e=i[mn];return Xi(e)||x(e)}r($s,"supportsBackgroundGradient");var gn="backgroundGradient";function Hs(i){if(!(gn in i))return false;let e=i[gn];return v(e)||x(e)}r(Hs,"supportsBackgroundGradientData");var fn="rotation";function js(i){if(!(fn in i))return false;let e=i[fn];return K(e)}r(js,"supportsRotation");var yn="opacity";function _s(i){if(!(yn in i))return false;let e=i[yn];return K(e)}r(_s,"supportsOpacity");var hn="borderRadius";function qs(i){if(!(hn in i))return false;let e=i[hn];return g(e)||x(e)}r(qs,"supportsBorderRadius");var bn="border";function Ys(i){if(!(bn in i))return false;let e=i[bn];return x(e)||ue(e.color)}r(Ys,"supportsBorder");var xn="svg";function Xs(i){if(!(xn in i))return false;let e=i[xn];return g(e)}r(Xs,"supportsSVG");var Cn="textTruncation";function Zs(i){if(!(Cn in i))return false;let e=i[Cn];return K(e)||x(e)}r(Zs,"supportsTextTruncation");var In="zIndex";function Js(i){if(!(In in i))return false;let e=i[In];return K(e)||x(e)}r(Js,"supportsZIndex");var Tn="overflow";function Qs(i){if(!(Tn in i))return false;let e=i[Tn];return g(e)||x(e)}r(Qs,"supportsOverflow");var Pn="componentIdentifier";function el(i){if(!(Pn in i))return false;let e=i[Pn];return g(e)}r(el,"supportsComponentInfo");var Sn="font";function tl(i){if(!(Sn in i))return false;let e=i[Sn];return Yi(e)}r(tl,"supportsFont");var Fn="font";function il(i){if(!(Fn in i))return false;let e=i[Fn];return qi(e)||x(e)}r(il,"supportsFontData");var Dn="inlineTextStyle";function nl(i){if(!(Dn in i))return false;let e=i[Dn];return di(e)||x(e)}r(nl,"supportsInlineTextStyle");var vn="inlineTextStyle";function rl(i){if(!(vn in i))return false;let e=i[vn];return Zi(e)||x(e)}r(rl,"supportsInlineTextStyleData");var Nn="link";function ol(i){if(!(Nn in i))return false;let e=i[Nn];return g(e)||x(e)}r(ol,"supportsLink");var kn="imageRendering";function al(i){if(!(kn in i))return false;let e=i[kn];return g(e)||x(e)}r(al,"supportsImageRendering");var Mn="layout";function Vn(i){if(!(Mn in i))return false;let e=i[Mn];return g(e)||x(e)}r(Vn,"supportsLayout");function sl(i){return Vn(i)?i.layout==="stack":false}r(sl,"hasStackLayout");function ll(i){return Vn(i)?i.layout==="grid":false}r(ll,"hasGridLayout");var En="isVariant";function wn(i){if(!(En in i))return false;let e=i[En];return be(e)}r(wn,"supportsComponentVariant");function ui(i){return wn(i)?i.isVariant:false}r(ui,"isComponentVariant");function Wn(i){return !wn(i)||!ui(i)?false:!x(i.gesture)}r(Wn,"isComponentGestureVariant");var An="isBreakpoint";function Mo(i){if(!(An in i))return false;let e=i[An];return be(e)}r(Mo,"supportsBreakpoint");function Ln(i){return Mo(i)?i.isBreakpoint:false}r(Ln,"isBreakpoint");var A=class{static{r(this,"NodeMethods");}id;originalId;#e;constructor(e,t){this.id=e.id,this.originalId=e.originalId??null,this.#e=t;}get isReplica(){return this.originalId!==null}async remove(){return this.#e.invoke("removeNodes2",[this.id])}async select(){return this.#e.invoke("setSelection",[this.id])}async clone(){if(this[c]==="UnknownNode")throw Error("Can not clone unknown node");return this.#e.cloneNode(this.id)}async setAttributes(e){if(this[c]==="UnknownNode")throw Error("Can not set attributes on unknown node");return this.#e.setAttributes(this.id,e)}async getRect(){return this.#e.invoke("getRect",this.id)}async zoomIntoView(e){return this.#e.invoke("zoomIntoView",[this.id],e)}async navigateTo(e){return this.#e.invoke("navigateTo",this.id,e)}async getParent(){return this.#e.getParent(this.id)}async getChildren(){return Q(this)?Promise.resolve([]):this.#e.getChildren(this.id)}async getNodesWithType(e){return Q(this)?Promise.resolve([]):(await this.#e.invoke("getNodesWithType",this.id,e)).map(n=>C(n,this.#e))}async getNodesWithAttribute(e){return Q(this)?Promise.resolve([]):(await this.#e.invoke("getNodesWithAttribute",this.id,e)).map(n=>C(n,this.#e))}async getNodesWithAttributeSet(e){return Q(this)?Promise.resolve([]):(await this.#e.invoke("getNodesWithAttributeSet",this.id,e)).map(n=>C(n,this.#e))}async*walk(){if(yield this,!Q(this))for(let e of await this.getChildren())yield*e.walk();}async getPluginData(e){return this.#e.invoke("getPluginDataForNode",this.id,e)}async setPluginData(e,t){return this.#e.invoke("setPluginDataForNode",this.id,e,t)}async getPluginDataKeys(){return this.#e.invoke("getPluginDataKeysForNode",this.id)}},R=class extends A{static{r(this,"FrameNode");}[c]="FrameNode";name;visible;locked;backgroundColor;backgroundImage;backgroundGradient;rotation;opacity;borderRadius;border;imageRendering;position;top;right;bottom;left;centerX;centerY;width;height;maxWidth;minWidth;maxHeight;minHeight;aspectRatio;zIndex;link;linkOpenInNewTab;overflow;overflowX;overflowY;layout;gap;padding;stackDirection;stackDistribution;stackAlignment;stackWrapEnabled;gridColumnCount;gridRowCount;gridAlignment;gridColumnWidthType;gridColumnWidth;gridColumnMinWidth;gridRowHeightType;gridRowHeight;gridItemFillCellWidth;gridItemFillCellHeight;gridItemHorizontalAlignment;gridItemVerticalAlignment;gridItemColumnSpan;gridItemRowSpan;isVariant;isPrimaryVariant;isBreakpoint;isPrimaryBreakpoint;inheritsFromId;gesture;constructor(e,t){super(e,t),this.name=e.name??null,this.visible=e.visible??true,this.locked=e.locked??false,this.backgroundColor=h(t,e.backgroundColor)??null,this.backgroundImage=h(t,e.backgroundImage)??null,this.rotation=e.rotation??0,this.opacity=e.opacity??1,this.borderRadius=e.borderRadius??null,this.border=h(t,e.border)??null,this.backgroundGradient=h(t,e.backgroundGradient)??null,this.imageRendering=e.imageRendering??null,this.position=e.position,this.left=e.left??null,this.right=e.right??null,this.top=e.top??null,this.bottom=e.bottom??null,this.centerX=e.centerX??null,this.centerY=e.centerY??null,this.width=e.width??null,this.height=e.height??null,this.maxWidth=e.maxWidth??null,this.minWidth=e.minWidth??null,this.maxHeight=e.maxHeight??null,this.minHeight=e.minHeight??null,this.aspectRatio=e.aspectRatio??null,this.zIndex=e.zIndex??null,this.link=e.link??null,this.linkOpenInNewTab=e.linkOpenInNewTab??null,this.overflow=e.overflow??null,this.overflowX=e.overflowX??null,this.overflowY=e.overflowY??null,this.layout=e.layout??null,this.gap=e.gap??null,this.padding=e.padding??null,this.stackDirection=e.stackDirection??null,this.stackDistribution=e.stackDistribution??null,this.stackAlignment=e.stackAlignment??null,this.stackWrapEnabled=e.stackWrapEnabled??null,this.gridColumnCount=e.gridColumnCount??null,this.gridRowCount=e.gridRowCount??null,this.gridAlignment=e.gridAlignment??null,this.gridColumnWidthType=e.gridColumnWidthType??null,this.gridColumnWidth=e.gridColumnWidth??null,this.gridColumnMinWidth=e.gridColumnMinWidth??null,this.gridRowHeightType=e.gridRowHeightType??null,this.gridRowHeight=e.gridRowHeight??null,this.gridItemFillCellWidth=e.gridItemFillCellWidth??null,this.gridItemFillCellHeight=e.gridItemFillCellHeight??null,this.gridItemHorizontalAlignment=e.gridItemHorizontalAlignment??null,this.gridItemVerticalAlignment=e.gridItemVerticalAlignment??null,this.gridItemColumnSpan=e.gridItemColumnSpan??null,this.gridItemRowSpan=e.gridItemRowSpan??null,this.inheritsFromId=e.inheritsFromId??null,this.gesture=e.gesture??null,this.isVariant=e.isVariant??false,this.isPrimaryVariant=e.isPrimaryVariant??false,this.isBreakpoint=e.isBreakpoint??false,this.isPrimaryBreakpoint=e.isPrimaryBreakpoint??false,S(this);}},ee=class extends A{static{r(this,"TextNode");}[c]="TextNode";name;visible;locked;rotation;opacity;zIndex;font;inlineTextStyle;position;top;right;bottom;left;centerX;centerY;width;height;maxWidth;minWidth;maxHeight;minHeight;link;linkOpenInNewTab;gridItemFillCellWidth;gridItemFillCellHeight;gridItemHorizontalAlignment;gridItemVerticalAlignment;gridItemColumnSpan;gridItemRowSpan;overflow;overflowX;overflowY;textTruncation;#e;constructor(e,t){super(e,t),this.#e=t,this.name=e.name??null,this.visible=e.visible??true,this.locked=e.locked??false,this.rotation=e.rotation??0,this.opacity=e.opacity??1,this.zIndex=e.zIndex??null,this.font=h(t,e.font)??null,this.inlineTextStyle=h(t,e.inlineTextStyle)??null,this.position=e.position,this.left=e.left??null,this.right=e.right??null,this.top=e.top??null,this.bottom=e.bottom??null,this.centerX=e.centerX??null,this.centerY=e.centerY??null,this.width=e.width??null,this.height=e.height??null,this.maxWidth=e.maxWidth??null,this.minWidth=e.minWidth??null,this.maxHeight=e.maxHeight??null,this.minHeight=e.minHeight??null,this.link=e.link??null,this.linkOpenInNewTab=e.linkOpenInNewTab??null,this.overflow=e.overflow??null,this.overflowX=e.overflowX??null,this.overflowY=e.overflowY??null,this.textTruncation=e.textTruncation??null,this.gridItemFillCellWidth=e.gridItemFillCellWidth??null,this.gridItemFillCellHeight=e.gridItemFillCellHeight??null,this.gridItemHorizontalAlignment=e.gridItemHorizontalAlignment??null,this.gridItemVerticalAlignment=e.gridItemVerticalAlignment??null,this.gridItemColumnSpan=e.gridItemColumnSpan??null,this.gridItemRowSpan=e.gridItemRowSpan??null,S(this);}async setText(e){await this.#e.invoke("setTextForNode",this.id,e);}async getText(){return this.#e.invoke("getTextForNode",this.id)}async setHTML(e){await this.#e.invoke(le,this.id,e),await new Promise(t=>{setTimeout(t,30);});}async getHTML(){return this.#e.invoke(se,this.id)}},ze=class extends A{static{r(this,"SVGNode");}[c]="SVGNode";name;visible;locked;svg;rotation;opacity;position;top;right;bottom;left;centerX;centerY;width;height;constructor(e,t){super(e,t),this.name=e.name??null,this.visible=e.visible??true,this.locked=e.locked??false,this.svg=e.svg,this.rotation=e.rotation??0,this.opacity=e.opacity??1,this.position=e.position,this.left=e.left??null,this.right=e.right??null,this.top=e.top??null,this.bottom=e.bottom??null,this.centerX=e.centerX??null,this.centerY=e.centerY??null,this.width=e.width??null,this.height=e.height??null,S(this);}},Ge=class extends A{static{r(this,"VectorSetItemNode");}[c]="VectorSetItemNode";name;visible;locked;top;right;bottom;left;centerX;centerY;width;height;#e;constructor(e,t){super(e,t),this.#e=t,this.name=e.name??null,this.visible=e.visible??true,this.locked=e.locked??false,this.top=e.top??null,this.right=e.right??null,this.bottom=e.bottom??null,this.left=e.left??null,this.centerX=e.centerX??null,this.centerY=e.centerY??null,this.width=e.width??null,this.height=e.height??null,S(this);}async getSVG(){return this.#e.invoke("getSVGForNode",this.id)}},Ke=class extends A{static{r(this,"ComponentInstanceNode");}[c]="ComponentInstanceNode";name;visible;locked;componentIdentifier;insertURL;componentName;controls;rotation;opacity;position;top;right;bottom;left;centerX;centerY;width;height;maxWidth;minWidth;maxHeight;minHeight;aspectRatio;#e;#t;#i;get typedControls(){return this.#i||(this.#i=h(this.#e,this.#t.typedControls)??{}),this.#i}constructor(e,t){super(e,t),this.#e=t,this.#t=e,this.name=e.name??null,this.visible=e.visible??true,this.locked=e.locked??false,this.componentIdentifier=e.componentIdentifier,this.componentName=e.componentName??null,this.insertURL=e.insertURL??null,this.controls=h(t,e.controls)??{},this.rotation=e.rotation??0,this.opacity=e.opacity??1,this.position=e.position,this.left=e.left??null,this.right=e.right??null,this.top=e.top??null,this.bottom=e.bottom??null,this.centerX=e.centerX??null,this.centerY=e.centerY??null,this.width=e.width??null,this.height=e.height??null,this.maxWidth=e.maxWidth??null,this.minWidth=e.minWidth??null,this.maxHeight=e.maxHeight??null,this.minHeight=e.minHeight??null,this.aspectRatio=e.aspectRatio??null,S(this);}async getRuntimeError(){return this.#e.invoke("getRuntimeErrorForCodeComponentNode",this.id)}},te=class extends A{static{r(this,"WebPageNode");}[c]="WebPageNode";#e;path;collectionId;constructor(e,t){super(e,t),this.path=e.path??null,this.collectionId=e.collectionId??null,this.#e=t,S(this);}getBreakpointSuggestions(){return this.#e.invoke("getBreakpointSuggestionsForWebPage",this.id)}async addBreakpoint(e,t){let n=await this.#e.invoke("addBreakpointToWebPage",this.id,e,t),o=C(n,this.#e);return m(o instanceof R),m(Ln(o),"Expected node to be a FrameNode"),o}async getActiveCollectionItem(){let e=await this.#e.invoke("getActiveCollectionItemForWebPage",this.id);return e?new Oe(e,this.#e):null}},ie=class extends A{static{r(this,"ComponentNode");}[c]="ComponentNode";name;componentIdentifier;insertURL;componentName;#e;constructor(e,t){super(e,t),this.#e=t,this.componentIdentifier=e.componentIdentifier,this.insertURL=e.insertURL??null,this.componentName=e.componentName??null,this.name=e.name??null,S(this);}async addVariant(e,t){let n=await this.#e.invoke("addVariantToComponent",this.id,e,t);if(!n)throw new Error("Failed to add variant to component");let o=C(n,this.#e);return m(o instanceof R),m(ui(o),"Node is not a component variant"),o}async addGestureVariant(e,t,n){let o=await this.#e.invoke("addGestureVariantToComponent",this.id,e,t,n);if(!o)throw new Error("Failed to add state to component");let a=C(o,this.#e);return m(a instanceof R),m(Wn(a),"Node is not a gesture variant"),a}async getVariables(){let e=await this.#e.invoke("getVariables",this.id);return h(this.#e,e)}async addVariables(e){let t=await this.#e.invoke("addVariables",this.id,L(e));return h(this.#e,t)}async removeVariables(e){await this.#e.invoke("removeVariables",this.id,e);}async setVariableOrder(e){await this.#e.invoke("setVariableOrder",this.id,e);}},$e=class extends A{static{r(this,"VectorSetNode");}[c]="VectorSetNode";name;constructor(e,t){super(e,t),this.name=e.name??null,S(this);}},ne=class extends A{static{r(this,"DesignPageNode");}[c]="DesignPageNode";name;constructor(e,t){super(e,t),this.name=e.name??null,S(this);}},He=class extends A{static{r(this,"UnknownNode");}[c]="UnknownNode";constructor(e,t){super(e,t),S(this);}};function C(i,e){switch(i[c]){case "DesignPageNode":return new ne(i,e);case "WebPageNode":return new te(i,e);case "ComponentNode":return new ie(i,e);case "VectorSetNode":return new $e(i,e);case "VectorSetItemNode":return new Ge(i,e);case "ComponentInstanceNode":return new Ke(i,e);case "FrameNode":return new R(i,e);case "SVGNode":return new ze(i,e);case "TextNode":return new ee(i,e);case "UnknownNode":return new He(i,e);default:return new He(i,e)}}r(C,"convertRawNodeDataToNode");function Dt(i){return i instanceof R}r(Dt,"isFrameNode");function Rn(i){return i instanceof ee}r(Rn,"isTextNode");function Bn(i){return i instanceof ze}r(Bn,"isSVGNode");function pe(i){return i instanceof Ke}r(pe,"isComponentInstanceNode");function Un(i){return i instanceof te}r(Un,"isWebPageNode");function On(i){return i instanceof ie}r(On,"isComponentNode");function zn(i){return i instanceof ne}r(zn,"isDesignPageNode");function Gn(i){return i instanceof $e}r(Gn,"isVectorSetNode");function Kn(i){return i instanceof Ge}r(Kn,"isVectorSetItemNode");function Q(i){return i instanceof He}r(Q,"isUnknownNode");function je(i){return !!(Dt(i)||Rn(i)||pe(i)||Bn(i)||Kn(i)||Q(i))}r(je,"isCanvasNode");function ci(i){return !!(Un(i)||zn(i)||On(i)||Gn(i)||Q(i))}r(ci,"isCanvasRootNode");var _e=class{static{r(this,"VectorSet");}id;name;owner;#e;constructor(e,t){this.id=e.id,this.name=e.name,this.owner=e.owner,this.#e=t;}async getItems(){return (await this.#e.invoke("getVectorSetItems",this.id)).map(t=>new vt(t,this.#e))}},vt=class{static{r(this,"VectorSetItem");}id;name;insertUrl;iconUrl;#e;#t;constructor(e,t){this.id=e.id,this.name=e.name,this.insertUrl=e.insertUrl,this.iconUrl=e.iconUrl,this.#e=e.moduleId,this.#t=t;}async getVariables(){return this.#t.invoke("getVectorSetItemVariables",this.id,this.#e)}};var qe=class extends Error{static{r(this,"FramerPluginError");}name=this.constructor.name},_=class extends Error{static{r(this,"FramerPluginClosedError");}name=this.constructor.name};function Eo(i){return i.type==="separator"}r(Eo,"isSeparatorMenuItem");function Nt(i,e){let t=[];for(let n of i){if(Eo(n)){t.push(n);continue}let{onAction:o,...a}=n,s=a;if(n.onAction){let d=Math.random();e.set(d,n.onAction),s.actionId=d;}n.submenu&&(s.submenu=Nt(n.submenu,e)),t.push(s);}return t}r(Nt,"addMenuItemsToOnActionCallbackMap");var kt="type",$n={[kt]:"pluginReadySignal"},Vo="pluginReadyResponse";var wo={methodResponse:true,subscriptionMessage:true,permissionUpdate:true,menuAction:true};function Hn(i){return v(i)&&g(i[kt])&&i[kt]in wo}r(Hn,"isVekterToPluginNonHandshakeMessage");function jn(i){return v(i)&&i[kt]===Vo}r(jn,"isPluginReadyResponse");var pi=Symbol(),mi=Symbol(),gi=Symbol(),fi=Symbol(),yi=Symbol(),hi=Symbol(),B={publish:pi,getDeployments:mi,deploy:gi,getChangedPaths:fi,getChangeContributors:yi,createManagedCollection:hi};function bi(i){return typeof i=="string"&&i in B}r(bi,"isFramerApiOnlyMethod");var Wo=["unstable_getCodeFile","unstable_getCodeFiles","unstable_getCodeFileVersionContent","unstable_getCodeFileLint2","unstable_getCodeFileTypecheck2","unstable_getCodeFileVersions"],Lo=["closeNotification","closePlugin","getActiveCollection","getActiveLocale","getActiveManagedCollection","getCanvasRoot","getChildren","getCollection","getCollectionFields","getCollectionFields2","getCollectionItems","getCollectionItems2","getCollections","getColorStyle","getColorStyles","getCurrentUser","getCurrentUser2","getCustomCode","getDefaultLocale","getFont","getFonts","getImage","getImageData","getLocales","getLocalizationGroups","getManagedCollection","getManagedCollectionFields","getManagedCollectionFields2","getManagedCollectionItemIds","getManagedCollections","getNode","getNodesWithAttribute","getNodesWithAttributeSet","getNodesWithType","getParent","getPluginData","getPluginDataForNode","getPluginDataKeys","getPluginDataKeysForNode","getProjectInfo","getProjectInfo2","getPublishInfo","getRect","getSelection","getSVGForNode","getText","getTextForNode","getTextStyle","getTextStyles","hideUI","setBackgroundMessage","notify","onPointerDown","setActiveCollection","setSelection","showUI","getCodeFileVersionContent","lintCode","typecheckCode","getCodeFileVersions","getCodeFiles","getCodeFile","getRedirects","uploadFile","uploadFiles","uploadImage","uploadImages","zoomIntoView","navigateTo","getRuntimeErrorForModule","getRuntimeErrorForCodeComponentNode","showProgressOnInstances","removeProgressFromInstances","addComponentInstancePlaceholder","updateComponentInstancePlaceholder","removeComponentInstancePlaceholder","setMenu","showContextMenu","getBreakpointSuggestionsForWebPage","getActiveCollectionItemForWebPage","getVariables","getVectorSets","getVectorSetItems","getVectorSetItemVariables","getChangedPaths","getChangeContributors","getDeployments",ut,ct,se,"getAiServiceInfo","sendTrackingEvent",...Wo];new Set(Lo);var xi={addComponentInstance:["addComponentInstance"],addComponentInstancePlaceholder:[],addDetachedComponentLayers:["addDetachedComponentLayers"],addImage:["addImage"],addImages:["addImages"],addSVG:["addSVG"],addText:["addText"],addRedirects:["addRedirects"],getRedirects:[],removeRedirects:["removeRedirects"],setRedirectOrder:["setRedirectOrder"],subscribeToRedirects:[],cloneNode:["cloneNode"],closePlugin:[],createColorStyle:["createColorStyle"],createFrameNode:["createNode"],createTextNode:["createNode"],createComponentNode:["createNode"],createTextStyle:["createTextStyle"],createDesignPage:["createDesignPage"],createWebPage:["createWebPage"],getActiveCollection:[],getActiveLocale:[],getActiveManagedCollection:[],getCanvasRoot:[],getChildren:[],getCollection:[],getCollections:[],getColorStyle:[],getColorStyles:[],getCurrentUser:[],getCustomCode:[],getDefaultLocale:[],getFont:[],getFonts:[],getImage:[],getLocales:[],getLocalizationGroups:[],getManagedCollection:[],getManagedCollections:[],getNode:[],getNodesWithAttribute:[],getNodesWithAttributeSet:[],getNodesWithType:[],getParent:[],getPluginData:[],getPluginDataKeys:[],getProjectInfo:[],getPublishInfo:[],getRect:[],getSelection:[],getText:[],getTextStyle:[],getTextStyles:[],hideUI:[],setBackgroundMessage:[],lintCode:[],makeDraggable:["onDragEnd","onDragStart","onDrag","setDragData","preloadDetachedComponentLayers","preloadImageUrlForInsertion","preloadDragPreviewImage"],notify:[],preloadDetachedComponentLayers:["preloadDetachedComponentLayers"],preloadDragPreviewImage:["preloadDragPreviewImage"],preloadImageUrlForInsertion:["preloadImageUrlForInsertion"],removeNode:["removeNodes2"],removeNodes:["removeNodes2"],setAttributes:["setAttributes"],setCustomCode:["setCustomCode"],setImage:["setImage"],setLocalizationData:["setLocalizationData"],setMenu:[],showContextMenu:[],setParent:["setParent"],setPluginData:["setPluginData"],setSelection:[],setText:["setText"],typecheckCode:[],showUI:[],subscribeToCanvasRoot:[],subscribeToColorStyles:[],subscribeToCustomCode:[],subscribeToImage:[],subscribeToPublishInfo:[],subscribeToSelection:[],subscribeToText:[],subscribeToTextStyles:[],createCodeFile:["createCodeFile"],unstable_ensureMinimumDependencyVersion:["unstable_ensureMinimumDependencyVersion"],getCodeFiles:[],getCodeFile:[],subscribeToCodeFiles:[],subscribeToOpenCodeFile:[],uploadFile:[],uploadFiles:[],uploadImage:[],uploadImages:[],zoomIntoView:[],navigateTo:[],getVectorSets:[],"VectorSet.getItems":[],"VectorSetItem.getVariables":[],"Node.navigateTo":[],"CodeFile.navigateTo":[],"Collection.navigateTo":[],"ManagedCollection.navigateTo":[],"CollectionItem.navigateTo":[],"ComponentInstanceNode.getRuntimeError":[],"ImageAsset.cloneWithAttributes":[],"ImageAsset.getData":[],"ImageAsset.loadBitmap":[],"ImageAsset.loadImage":[],"ImageAsset.measure":[],"CodeFile.remove":["removeCodeFile"],"CodeFile.rename":["renameCodeFile"],"CodeFile.setFileContent":["setCodeFileContent"],"CodeFile.getVersions":[],"CodeFile.showProgressOnInstances":[],"CodeFile.removeProgressFromInstances":[],"CodeFile.lint":[],"CodeFile.typecheck":[],"CodeFileVersion.getContent":[],"ComponentInstancePlaceholder.setAttributes":[],"ComponentInstancePlaceholder.remove":[],"ComponentInstancePlaceholder.replaceWithComponentInstance":["replaceComponentInstancePlaceholderWithComponentInstance"],"Field.remove":["removeCollectionFields"],"Field.setAttributes":["addCollectionFields"],"EnumField.addCase":["addEnumCase"],"EnumField.setCaseOrder":["setEnumCaseOrder"],"Collection.addFields":["addCollectionFields"],"Collection.addItems":["addCollectionItems2"],"Collection.getFields":[],"Collection.getItems":[],"Collection.getPluginData":[],"Collection.getPluginDataKeys":[],"Collection.removeFields":["removeCollectionFields"],"Collection.removeItems":["removeCollectionItems"],"Collection.setAsActive":[],"Collection.setFieldOrder":["setCollectionFieldOrder"],"Collection.setItemOrder":["setCollectionItemOrder"],"Collection.setPluginData":["setPluginDataForNode"],"CollectionItem.getPluginData":[],"CollectionItem.getPluginDataKeys":[],"CollectionItem.remove":["removeCollectionItems"],"CollectionItem.setAttributes":["setCollectionItemAttributes2"],"CollectionItem.setPluginData":["setPluginDataForNode"],"ManagedCollection.addItems":["addManagedCollectionItems2"],"ManagedCollection.getFields":[],"ManagedCollection.getItemIds":[],"ManagedCollection.getPluginData":[],"ManagedCollection.getPluginDataKeys":[],"ManagedCollection.removeItems":["removeManagedCollectionItems"],"ManagedCollection.setAsActive":[],"ManagedCollection.setFields":["setManagedCollectionFields"],"ManagedCollection.setItemOrder":["setManagedCollectionItemOrder"],"ManagedCollection.setPluginData":["setPluginDataForNode"],"Node.clone":["cloneNode"],"Node.getChildren":[],"Node.getNodesWithAttribute":[],"Node.getNodesWithAttributeSet":[],"Node.getNodesWithType":[],"Node.getParent":[],"Node.getPluginData":[],"Node.getPluginDataKeys":[],"Node.getRect":[],"Node.remove":["removeNodes2"],"Node.select":[],"Node.setAttributes":["setAttributes"],"Node.setPluginData":["setPluginDataForNode"],"Node.walk":[],"Node.zoomIntoView":[],"TextNode.getText":[],"TextNode.setText":["setTextForNode"],"TextNode.setHTML":[le],"TextNode.getHTML":[],"ComponentNode.addVariant":["addVariantToComponent"],"ComponentNode.addGestureVariant":["addGestureVariantToComponent"],"ComponentNode.getVariables":[],"ComponentNode.addVariables":["addVariables"],"ComponentNode.removeVariables":["removeVariables"],"WebPageNode.getBreakpointSuggestions":[],"WebPageNode.addBreakpoint":["addBreakpointToWebPage"],"WebPageNode.getActiveCollectionItem":[],"ColorStyle.getPluginData":[],"ColorStyle.getPluginDataKeys":[],"ColorStyle.remove":["removeColorStyle"],"ColorStyle.setAttributes":["setColorStyleAttributes"],"ColorStyle.setPluginData":["setPluginDataForNode"],"TextStyle.getPluginData":[],"TextStyle.getPluginDataKeys":[],"TextStyle.remove":["removeTextStyle"],"TextStyle.setAttributes":["setTextStyleAttributes"],"TextStyle.setPluginData":["setPluginDataForNode"],"Variable.setAttributes":["updateVariable"],"Variable.remove":["removeVariables"],"ComponentNode.setVariableOrder":["setVariableOrder"],"EnumCase.remove":["removeEnumCase"],"EnumCase.setAttributes":["updateEnumCase"],"EnumVariable.addCase":["addEnumCase"],"EnumVariable.setCaseOrder":["setEnumCaseOrder"],createCollection:["createCollection"],[Ut]:[],[Ot]:[],[zt]:[],[Gt]:[],[pi]:["publish"],[mi]:[],[gi]:["deploy"],[fi]:[],[yi]:[],[hi]:["createManagedCollection"]},Mt=[];for(let i of Object.keys(xi))xi[i].length!==0&&Mt.push(i);S(Mt);function Ci(i){let e={};for(let t of Mt){let n=xi[t];e[t]=n.every(o=>i[o]);}return e}r(Ci,"createPerMethodPermissionMap");function _n(){let i={};for(let e of Mt)i[e]=true;return i}r(_n,"createPerMethodPermissionMapForTesting");var me=null;function qn(i){if(typeof window>"u")return;if(!me){let t=document.createElement("style");document.head.appendChild(t),me=t.sheet;}if(!me){i();return}let e=me.insertRule("* { transition: none !important; animation: none !important; }");i(),requestAnimationFrame(()=>{requestAnimationFrame(()=>{me&&me.deleteRule(e);});});}r(qn,"withDisabledCssTransitions");var Ye=class{static{r(this,"PluginEngine");}methodInvocationId=0;notificationId=0;postMessage;methodResponseHandlers=new Map;mode;subscriptions=new Map;perMethodPermissionMap;permissionSubscriptions=new Set;messageTypesCheckedInIsAllowedTo=new Set;showUncheckedPermissionToasts=true;environmentInfo=null;menuItemOnActionCallbackMap=new Map;contextMenuItemOnActionCallbackMap=new Map;constructor(e){if(!e){this.postMessage=()=>{},this.mode="canvas",this.perMethodPermissionMap=_n();return}switch(e.transport.onMessage(this.onMessage),typeof window<"u"&&(window.addEventListener("error",t=>{t.error instanceof _&&(t.preventDefault(),t.stopImmediatePropagation());}),window.addEventListener("unhandledrejection",t=>{t.reason instanceof _&&(t.preventDefault(),t.stopImmediatePropagation());})),this.mode=e.mode,this.environmentInfo=e.environmentInfo,this.perMethodPermissionMap=Ci(e.permissionMap),this.postMessage=(t,n)=>e.transport.send(t,n),this.mode){case "canvas":case "image":case "editImage":case "configureManagedCollection":case "syncManagedCollection":case "collection":case "localization":case "code":typeof window<"u"&&window.addEventListener("pointerdown",()=>{this.invoke("onPointerDown");}),e.theme&&this.applyPluginTheme(e.theme),this.subscribe("theme",this.applyPluginTheme);break;case "api":break;default:lt(this.mode);}}async invoke(e,...t){return this.invokeTransferable(e,undefined,...t)}async invokeTransferable(e,t,...n){return new Promise((a,s)=>{let d={type:"methodInvocation",methodName:e,id:this.methodInvocationId,args:n.map(L)};this.methodInvocationId+=1,this.methodResponseHandlers.set(d.id,{resolve:a,reject:s}),this.postMessage(d,t);})}subscribe(e,t){this.postMessage({type:"subscribe",topic:e});let n=this.subscriptions.get(e)??new Set;return n.add(t),this.subscriptions.set(e,n),()=>{let o=this.subscriptions.get(e)??new Set;o.delete(t),o.size===0&&this.postMessage({type:"unsubscribe",topic:e}),this.subscriptions.set(e,o);}}onMessage=e=>{let t=e?.data??e;if(Hn(t))switch(t.type){case "permissionUpdate":{this.perMethodPermissionMap=Ci(t.permissionMap);for(let n of this.permissionSubscriptions)n();break}case "methodResponse":{let n=this.methodResponseHandlers.get(t.id);if(!n)throw new Error(`No handler for response with id ${t.id}`);this.methodResponseHandlers.delete(t.id),g(t.error)?n.reject(new qe(t.error)):n.resolve(t.result);break}case "subscriptionMessage":{let{topic:n,payload:o}=t,a=this.subscriptions.get(n);if(!a)throw new Error("Received a subscription message but no handler present");for(let s of a)s(o);break}case "menuAction":{let n=this.getOnActionFromCallbackMap(t.actionId,t.actionType);if(!n)throw new Error("Menu action received for an unknown menu item");n();break}default:lt(t);}};getOnActionFromCallbackMap(e,t){switch(t){case "pluginMenu":return this.menuItemOnActionCallbackMap.get(e);case "contextMenu":return this.contextMenuItemOnActionCallbackMap.get(e);default:lt(t);}}applyPluginTheme=e=>{qn(()=>{document.body.setAttribute("data-framer-theme",e.mode);for(let t in e.tokens)document.body.style.setProperty(t,e.tokens[t]);});};async cloneNode(e){let t=await this.invoke("cloneNode",e);return t?C(t,this):null}async setAttributes(e,t){let n=await this.invoke("setAttributes",e,t);return n?C(n,this):null}async getParent(e){let t=await this.invoke("getParent",e);return t?C(t,this):null}async getChildren(e){return (await this.invoke("getChildren",e)).map(n=>{let o=C(n,this);return m(je(o)),o})}notify=(e,t)=>{let n=`notification-${this.notificationId}`;return this.notificationId+=1,this.invoke("notify",e,{notificationId:n,variant:t?.variant??"info",buttonText:t?.button?.text,durationMs:t?.durationMs}).then(o=>{o==="actionButtonClicked"&&t?.button?.onClick&&t.button.onClick(),t?.onDisappear&&t.onDisappear();}),{close:()=>this.invoke("closeNotification",n)}};async setMenu(e){this.menuItemOnActionCallbackMap=new Map;let t=Nt(e,this.menuItemOnActionCallbackMap);await this.invoke("setMenu",t);}async showContextMenu(e,t){this.contextMenuItemOnActionCallbackMap=new Map;let n=Nt(e,this.contextMenuItemOnActionCallbackMap);await this.invoke("showContextMenu",n,t);}};function Ro(i){return i.type==="component"}r(Ro,"isCodeFileComponentExport");function Bo(i){return i.type==="override"}r(Bo,"isCodeFileOverrideExport");var Ii=class{static{r(this,"CodeFileVersion");}#e;#t;get id(){return this.#e.id}get name(){return this.#e.name}get createdAt(){return this.#e.createdAt}get createdBy(){return this.#e.createdBy}constructor(e,t){this.#t=t,this.#e=e;}async getContent(){return await this.#t.invoke("getCodeFileVersionContent",this.#e.fileId,this.#e.id)}},q=class i{static{r(this,"CodeFile");}#e;#t;get id(){return this.#e.id}get name(){return this.#e.name}get path(){return this.#e.path}get content(){return this.#e.content}get exports(){return this.#e.exports}get versionId(){return this.#e.versionId}constructor(e,t){this.#t=t,this.#e=e;}async setFileContent(e){let t=await this.#t.invoke("setCodeFileContent",this.id,e);return new i(t,this.#t)}async rename(e){let t=await this.#t.invoke("renameCodeFile",this.id,e);return new i(t,this.#t)}async remove(){return this.#t.invoke("removeCodeFile",this.id)}async getVersions(){return (await this.#t.invoke("getCodeFileVersions",this.id)).map(t=>new Ii(t,this.#t))}async showProgressOnInstances(e){return this.#t.invoke("showProgressOnInstances",this.id,e)}async removeProgressFromInstances(){return this.#t.invoke("removeProgressFromInstances",this.id)}async lint(e){return await this.#t.invoke("lintCode",this.name,this.content,e)}async typecheck(e){return await this.#t.invoke("typecheckCode",this.name,this.content,e)}async navigateTo(){return this.#t.invoke("navigateTo",this.id)}};var Et=class i{static{r(this,"ComponentInstancePlaceholder");}#e;#t;constructor(e,t){this.#e=e,this.#t=t;}get id(){return this.#e.id}get width(){return this.#e.width}get height(){return this.#e.height}get title(){return this.#e.title}get codePreview(){return this.#e.codePreview}async setAttributes(e){let t=await this.#t.invoke("updateComponentInstancePlaceholder",this.id,e);return t?new i(t,this.#t):null}async remove(){await this.#t.invoke("removeComponentInstancePlaceholder",this.id);}async replaceWithComponentInstance(e,t){let n=await this.#t.invoke("replaceComponentInstancePlaceholderWithComponentInstance",this.id,e,t);if(!n)return null;let o=C(n,this.#t);return m(pe(o)),o}};var Uo=(()=>{let i=null;return {disableUntilMouseUp:()=>{if(i)return;i=document.createElement("style"),i.textContent="* { pointer-events: none !important; user-select: none !important; -webkit-user-select: none !important; }",document.head.appendChild(i);let e=r(()=>{i&&(document.head.removeChild(i),i=null,o());},"enablePointerEvents"),t=r(a=>{a.buttons>0&&a.buttons&1||e();},"handlePointerChange"),n=r(()=>{e();},"handleBlur");window.addEventListener("pointerup",t,true),window.addEventListener("pointermove",t,true),window.addEventListener("blur",n);function o(){window.removeEventListener("pointerup",t,true),window.removeEventListener("pointermove",t,true),window.removeEventListener("blur",n);}r(o,"cleanup");}}})(),Yn=5,Oo=(()=>{let i=1;return {next:()=>`drag-${i++}`}})();function zo(){}r(zo,"noop");function Xn(i,e,t,n){if(i.mode!=="canvas")return zo;let o=Oo.next(),a=document.body.style.cursor,s={type:"idle"},d=document.body,T=re.subscribeToIsAllowedTo("makeDraggable",p=>{p||I();}),b=r(p=>{re.isAllowedTo("makeDraggable")&&s.type!=="idle"&&(s.type==="dragging"&&i.invoke("onDragEnd",{...p,dragSessionId:o}).then(y=>{try{n?.(y);}catch{}}).catch(y=>{if(y instanceof Error){n?.({status:"error",reason:y.message});return}if(typeof y=="string"){n?.({status:"error",reason:y});return}n?.({status:"error"});}),I());},"endDrag"),D=r(p=>{if(!re.isAllowedTo("makeDraggable")||s.type==="idle")return;if(!(p.buttons>0&&!!(p.buttons&1))){b({cancelled:false});return}let{clientX:F,clientY:X}=p;if(s.type==="pointerDown"){let he=F-s.dragStart.mouse.x,Bi=X-s.dragStart.mouse.y;if(Math.abs(he)<Yn&&Math.abs(Bi)<Yn)return;s={type:"dragging",dragStart:s.dragStart},i.invoke("onDragStart",s.dragStart),document.getSelection()?.empty(),Uo.disableUntilMouseUp();}d.setPointerCapture(p.pointerId);let P={x:F,y:X};i.invoke("onDrag",{dragSessionId:o,mouse:P}).then(he=>{s.type==="dragging"&&(document.body.style.cursor=he??"");});},"handlePointerChange"),z=r(p=>{p.key==="Escape"&&b({cancelled:true});},"handleKeyDown"),G=r(()=>{b({cancelled:true});},"handleBlur"),f=r(p=>{if(!re.isAllowedTo("makeDraggable"))return;b({cancelled:true});let y=e.getBoundingClientRect(),F={x:y.x,y:y.y,width:y.width,height:y.height},X,P=e.querySelectorAll("svg");if(P.length===1){let ot=P.item(0).getBoundingClientRect();X={x:ot.x,y:ot.y,width:ot.width,height:ot.height};}let he={x:p.clientX,y:p.clientY};s={type:"pointerDown",dragStart:{dragSessionId:o,elementRect:F,svgRect:X,mouse:he}},i.invoke("setDragData",o,t()),d.addEventListener("pointermove",D,true),d.addEventListener("pointerup",D,true),window.addEventListener("keydown",z,true),window.addEventListener("blur",G);},"handlePointerDown"),u=r(()=>{if(!re.isAllowedTo("makeDraggable"))return;let p=t();p.type==="detachedComponentLayers"&&i.invoke("preloadDetachedComponentLayers",p.url),p.type==="image"&&i.invoke("preloadImageUrlForInsertion",p.image),p.previewImage&&i.invoke("preloadDragPreviewImage",p.previewImage);},"preload");e.addEventListener("pointerdown",f),e.addEventListener("mouseenter",u);function I(){s={type:"idle"},document.body.style.cursor=a,d.removeEventListener("pointermove",D,true),d.removeEventListener("pointerup",D,true),window.removeEventListener("keydown",z,true),window.removeEventListener("blur",G);}return r(I,"dragCleanup"),()=>{e.removeEventListener("pointerdown",f),e.removeEventListener("mouseenter",u),b({cancelled:true}),T();}}r(Xn,"makeDraggable");var ge=class i{static{r(this,"Redirect");}#e;#t;get id(){return this.#e.id}get from(){return this.#e.from}get to(){return this.#e.to}get expandToAllLocales(){return this.#e.expandToAllLocales}constructor(e,t){this.#t=t,this.#e=e;}remove(){return this.#t.invoke("removeRedirects",[this.id])}async setAttributes(e){let t={...e,id:this.id},[n]=await this.#t.invoke("addRedirects",[t]);return m(at(n)),x(n)?null:new i(n,this.#t)}};var Ti=class{static{r(this,"FramerPluginAPI");}#e;constructor(e){this.#e=e;}get mode(){return this.#e.mode}isAllowedTo(...e){return e.every(t=>this.#e.perMethodPermissionMap[t])}subscribeToIsAllowedTo(...e){let[t,n]=zi(e),o=this.isAllowedTo(...t),a=r(()=>{let s=this.isAllowedTo(...t);s!==o&&(o=s,n(o));},"update");return this.#e.permissionSubscriptions.add(a),()=>{this.#e.permissionSubscriptions.delete(a);}}async showUI(e){return this.#e.invoke("showUI",e)}async hideUI(){return this.#e.invoke("hideUI")}async setBackgroundMessage(e){return this.#e.invoke("setBackgroundMessage",e)}closePlugin(e,t){throw this.#e.invoke("closePlugin",e,t),new _}async getCurrentUser(){return this.#e.invoke("getCurrentUser2")}async getProjectInfo(){return this.#e.invoke("getProjectInfo2")}async getSelection(){return (await this.#e.invoke("getSelection")).map(t=>{let n=C(t,this.#e);return m(je(n)),n})}async setSelection(e){let t=g(e)?[e]:Array.from(e);return this.#e.invoke("setSelection",t)}subscribeToSelection(e){return this.#e.subscribe("selection",t=>{let n=t.map(o=>{let a=C(o,this.#e);return m(je(a)),a});e(n);})}async getCanvasRoot(){let e=await this.#e.invoke("getCanvasRoot"),t=C(e,this.#e);return m(ci(t)),t}subscribeToCanvasRoot(e){return this.#e.subscribe("canvasRoot",t=>{let n=C(t,this.#e);m(ci(n)),e(n);})}async getPublishInfo(){return this.#e.invoke("getPublishInfo")}subscribeToPublishInfo(e){return this.#e.subscribe("publishInfo",e)}async createFrameNode(e,t){let n=await this.#e.invoke("createNode","FrameNode",t??null,e);if(!n)return null;let o=C(n,this.#e);return m(o instanceof R),o}async removeNodes(e){return this.#e.invoke("removeNodes2",e)}async removeNode(e){return this.removeNodes([e])}async cloneNode(e){return this.#e.cloneNode(e)}async getNode(e){let t=await this.#e.invoke("getNode",e);return t?C(t,this.#e):null}async getParent(e){return this.#e.getParent(e)}async getChildren(e){return this.#e.getChildren(e)}async getRect(e){return this.#e.invoke("getRect",e)}async zoomIntoView(e,t){let n=g(e)?[e]:Array.from(e);return this.#e.invoke("zoomIntoView",n,t)}async setAttributes(e,t){return this.#e.setAttributes(e,t)}async setParent(e,t,n){return this.#e.invoke("setParent",e,t,n)}async getNodesWithType(e){return (await this.#e.invoke("getNodesWithType",null,e)).map(n=>C(n,this.#e))}async getNodesWithAttribute(e){return (await this.#e.invoke("getNodesWithAttribute",null,e)).map(n=>C(n,this.#e))}async getNodesWithAttributeSet(e){return (await this.#e.invoke("getNodesWithAttributeSet",null,e)).map(n=>C(n,this.#e))}async getImage(){let e=await this.#e.invoke("getImage");return e?h(this.#e,e):null}subscribeToImage(e){return this.#e.subscribe("image",t=>{if(!t){e(null);return}e(h(this.#e,t));})}async addImage(e){let t=await we(e),n=j(t);return this.#e.invokeTransferable("addImage",n,t)}async setImage(e){let t=await we(e),n=j(t);return this.#e.invokeTransferable("setImage",n,t)}async uploadImage(e){let t=await we(e),n=j(t),o=await this.#e.invokeTransferable("uploadImage",n,t);return h(this.#e,o)}async addImages(e){let t=await si(e),n=t.flatMap(j);await this.#e.invokeTransferable("addImages",n,t);}async uploadImages(e){let t=await si(e),n=t.flatMap(j),o=await this.#e.invokeTransferable("uploadImages",n,t);return h(this.#e,o)}async uploadFile(e){let t=await ai(e),n=await this.#e.invokeTransferable("uploadFile",j(t),t);return h(this.#e,n)}async uploadFiles(e){let t=await Promise.all(e.map(ai)),n=t.flatMap(j),o=await this.#e.invokeTransferable("uploadFiles",n,t);return h(this.#e,o)}async addSVG(e){return this.#e.invoke("addSVG",e)}async addComponentInstance({url:e,attributes:t,parentId:n}){let o=await this.#e.invoke("addComponentInstance",{url:e,attributes:t,parentId:n}),a=C(o,this.#e);return m(pe(a)),a}async addDetachedComponentLayers({url:e,layout:t,attributes:n}){let o=await this.#e.invoke("addDetachedComponentLayers",{url:e,layout:t,attributes:n}),a=C(o,this.#e);return m(Dt(a)),a}async preloadDetachedComponentLayers(e){await this.#e.invoke("preloadDetachedComponentLayers",e);}async preloadImageUrlForInsertion(e){await this.#e.invoke("preloadImageUrlForInsertion",e);}async preloadDragPreviewImage(e){await this.#e.invoke("preloadDragPreviewImage",e);}async getText(){return this.#e.invoke("getText")}async setText(e){return this.#e.invoke("setText",e)}async addText(e,t){return this.#e.invoke("addText",e,t)}async setCustomCode(e){return this.#e.invoke("setCustomCode",e)}async getCustomCode(){return this.#e.invoke("getCustomCode")}subscribeToCustomCode(e){return this.#e.subscribe("customCode",e)}subscribeToText(e){return this.#e.subscribe("text",e)}makeDraggable(e,t,n){return Xn(this.#e,e,t,n)}async getActiveManagedCollection(){let e=await this.#e.invoke("getActiveManagedCollection");return m(e,"Collection data must be defined"),new ce(e,this.#e)}async getManagedCollection(){return this.getActiveManagedCollection()}async getManagedCollections(){let e=await this.#e.invoke("getManagedCollections");return m(e,"Collections data must be defined"),e.map(t=>new ce(t,this.#e))}async getCollection(e){let t=await this.#e.invoke("getCollection",e);return t?new J(t,this.#e):null}async getActiveCollection(){let e=await this.#e.invoke("getActiveCollection");return e?new J(e,this.#e):null}async getCollections(){return (await this.#e.invoke("getCollections")).map(t=>new J(t,this.#e))}notify=(e,t)=>this.#e.notify(e,t);async getPluginData(e){return this.#e.invoke("getPluginData",e)}async setPluginData(e,t){return this.#e.invoke("setPluginData",e,t)}async getPluginDataKeys(){return this.#e.invoke("getPluginDataKeys")}async getColorStyles(){let e=await this.#e.invoke("getColorStyles");return h(this.#e,e)}async getColorStyle(e){let t=await this.#e.invoke("getColorStyle",e);return t?h(this.#e,t):null}async createColorStyle(e){let t=await this.#e.invoke("createColorStyle",e);return h(this.#e,t)}subscribeToColorStyles(e){return this.#e.subscribe("colorStyles",t=>{let n=h(this.#e,t);return e(n)})}async getTextStyles(){let e=await this.#e.invoke("getTextStyles");return h(this.#e,e)}async getTextStyle(e){let t=await this.#e.invoke("getTextStyle",e);return t?h(this.#e,t):null}async createTextStyle(e){let t=await this.#e.invoke("createTextStyle",e);return h(this.#e,t)}subscribeToTextStyles(e){return this.#e.subscribe("textStyles",t=>{let n=h(this.#e,t);return e(n)})}async getFont(e,t){let n=await this.#e.invoke("getFont",e,t);return n?h(this.#e,n):null}async getFonts(){let e=await this.#e.invoke("getFonts");return h(this.#e,e)}getLocales(){return this.#e.invoke("getLocales")}getDefaultLocale(){return this.#e.invoke("getDefaultLocale")}getActiveLocale(){return this.#e.invoke("getActiveLocale")}async getLocalizationGroups(){return this.#e.invoke("getLocalizationGroups")}setLocalizationData(e){return this.#e.invoke("setLocalizationData",e)}async getRedirects(){return (await this.#e.invoke("getRedirects")).map(t=>new ge(t,this.#e))}subscribeToRedirects(e){return this.#e.subscribe("redirects",t=>{let n=t.map(o=>new ge(o,this.#e));return e(n)})}async addRedirects(e){return (await this.#e.invoke("addRedirects",e)).map(n=>new ge(n,this.#e))}async removeRedirects(e){return this.#e.invoke("removeRedirects",e)}async setRedirectOrder(e){return this.#e.invoke("setRedirectOrder",e)}async createCodeFile(e,t,n){let o=await this.#e.invoke("createCodeFile",e,t,n);return new q(o,this.#e)}async getCodeFiles(){let e=await this.#e.invoke("getCodeFiles"),t=[];for(let n of e)t.push(new q(n,this.#e));return t}async getCodeFile(e){let t=await this.#e.invoke("getCodeFile",e);return t?new q(t,this.#e):null}lintCode(e,t,n){return this.#e.invoke("lintCode",e,t,n)}typecheckCode(e,t,n){return this.#e.invoke("typecheckCode",e,t,n)}subscribeToCodeFiles(e){return this.#e.subscribe("codeFiles",t=>{let n=t?.map(o=>new q(o,this.#e));return e(n)})}setMenu(e){return this.#e.setMenu(e)}showContextMenu(e,t){return this.#e.showContextMenu(e,t)}async unstable_ensureMinimumDependencyVersion(e,t){return this.#e.invoke("unstable_ensureMinimumDependencyVersion",e,t)}async navigateTo(e,t){return this.#e.invoke("navigateTo",e,t)}subscribeToOpenCodeFile(e){return this.#e.subscribe("openCodeFile",t=>{let n=t?new q(t,this.#e):null;return e(n)})}async createDesignPage(e){let t=await this.#e.invoke("createDesignPage",e),n=C(t,this.#e);return m(n instanceof ne,"Expected node to be a DesignPageNode"),n}async createWebPage(e){let t=await this.#e.invoke("createWebPage",e),n=C(t,this.#e);return m(n instanceof te,"Expected node to be a WebPageNode"),n}async createCollection(e){let t=await this.#e.invoke("createCollection",e);return new J(t,this.#e)}},Pi=class extends Ti{static{r(this,"FramerPluginAPIBeta");}#e;constructor(e){super(e),this.#e=e,this.#e;}},Xe=class extends Pi{static{r(this,"FramerPluginAPIAlpha");}#e;constructor(e){super(e),this.#e=e,this.#e;}async addComponentInstancePlaceholder(e){let t=await this.#e.invoke("addComponentInstancePlaceholder",e);return new Et(t,this.#e)}async[l.getAiServiceInfo](){return this.#e.invoke(ut)}async[l.sendTrackingEvent](e,t,n){return this.#e.invoke(ct,e,t,n)}async[l.getHTMLForNode](e){return this.#e.invoke(se,e)}async[l.setHTMLForNode](e,t){return this.#e.invoke(le,e,t)}get[l.environmentInfo](){return this.#e.environmentInfo}get[l.showUncheckedPermissionToasts](){return this.#e.showUncheckedPermissionToasts}set[l.showUncheckedPermissionToasts](e){this.#e.showUncheckedPermissionToasts=e;}async createTextNode(e,t){let n=await this.#e.invoke("createNode","TextNode",t??null,e);if(!n)return null;let o=C(n,this.#e);return m(o instanceof ee),o}async createComponentNode(e){let t=await this.#e.invoke("createNode","ComponentNode",null,{name:e});if(!t)return null;let n=C(t,this.#e);return m(n instanceof ie),n}async getVectorSets(){return (await this.#e.invoke("getVectorSets")).map(t=>new _e(t,this.#e))}async[B.publish](){return this.#e.invoke("publish")}async[B.getDeployments](){return this.#e.invoke("getDeployments")}async[B.deploy](e,t){return this.#e.invoke("deploy",e,t)}async[B.getChangedPaths](){return this.#e.invoke("getChangedPaths")}async[B.getChangeContributors](e,t){return this.#e.invoke("getChangeContributors",e,t)}async[B.createManagedCollection](e){let t=await this.#e.invoke("createManagedCollection",e);return new ce(t,this.#e)}};var Si=class{constructor(e){this.origin=e;}static{r(this,"IframeTransport");}send(e,t){window.parent.postMessage(e,this.origin,t);}onMessage(e){window.addEventListener("message",e);}};async function Go(){return new Promise(i=>{function e({data:t,origin:n}){if(!jn(t))return;window.removeEventListener("message",e);let a={transport:new Si(n),mode:t.mode,permissionMap:t.permissionMap,environmentInfo:t.environmentInfo,origin:n,theme:t.theme??null};i(a);}r(e,"handshakeListener"),window.addEventListener("message",e),window.parent.postMessage($n,"*");})}r(Go,"createBrowserContext");async function Ko(){return typeof window<"u"?Go():null}r(Ko,"bootstrap");var Zn=await Ko(),re=Zn?new Xe(new Ye(Zn)):new Proxy({},{get(i,e){throw new Error(`Cannot access framer.${String(e)} in server runtime. Use createFramerInstance() with a custom transport.`)}});function Jn(i){return new Xe(new Ye(i))}r(Jn,"createFramerInstance");var jo=Ho,Qn=jo.env;function _o(i){Object.assign(Qn,i);}r(_o,"configure");function fe(i,e){return Qn[i]??e}r(fe,"getEnv");var er=typeof navigator<"u"&&navigator.userAgent==="Cloudflare-Workers"||typeof globalThis.WebSocketPair<"u",tr=typeof globalThis.WebSocket<"u"?globalThis.WebSocket:WebSocket;async function ir(i,e){let t=new URL(i.href);t.protocol=t.protocol==="wss:"?"https:":t.protocol==="ws:"?"http:":t.protocol;let o=(await fetch(t.href,{headers:{Upgrade:"websocket",...e}})).webSocket;if(!o)throw new Error("WebSocket upgrade failed - server did not accept");return o.accept(),o}r(ir,"connectWebSocketCF");var nr,rr;try{nr=await import('node:fs'),rr=await import('node:path');}catch{}var Fi=nr,Di=rr;function w(i,...e){if(i)return;let t=Error("Assertion Error"+(e.length>0?": "+e.join(" "):""));if(t.stack)try{let n=t.stack.split(`
|
|
10
10
|
`);n[1]?.includes("assert")?(n.splice(1,1),t.stack=n.join(`
|
|
11
11
|
`)):n[0]?.includes("assert")&&(n.splice(0,1),t.stack=n.join(`
|
|
12
|
-
`));}catch{}throw t}r(w,"assert");var ir={showUI:false,hideUI:false,closePlugin:false,notify:false,setMenu:false,showContextMenu:false,preloadDetachedComponentLayers:false,preloadDragPreviewImage:false,preloadImageUrlForInsertion:false,setBackgroundMessage:false,getSelection:false,getActiveCollection:false,getActiveManagedCollection:false,getActiveLocale:false,zoomIntoView:false,navigateTo:false,getPluginData:false,setPluginData:false,getPluginDataKeys:false,makeDraggable:false,subscribeToSelection:false,subscribeToImage:false,subscribeToText:false,subscribeToCustomCode:false,subscribeToColorStyles:false,subscribeToTextStyles:false,subscribeToRedirects:false,subscribeToCodeFiles:false,subscribeToOpenCodeFile:false,subscribeToIsAllowedTo:false,subscribeToCanvasRoot:false,subscribeToPublishInfo:false,unstable_ensureMinimumDependencyVersion:false,removeNode:true,removeNodes:true,addSVG:true,getRect:true,setText:true,getText:true,addText:true,setCustomCode:true,getCustomCode:true,getLocales:true,getDefaultLocale:true,getLocalizationGroups:true,setLocalizationData:true,getCurrentUser:true,getProjectInfo:true,setSelection:true,getCanvasRoot:true,getPublishInfo:true,cloneNode:true,getNode:true,getParent:true,getChildren:true,setAttributes:true,getNodesWithType:true,getNodesWithAttribute:true,getNodesWithAttributeSet:true,addImages:true,getImage:true,addImage:true,setImage:true,uploadImage:true,uploadImages:true,uploadFile:true,uploadFiles:true,setParent:true,addComponentInstance:true,addDetachedComponentLayers:true,getManagedCollection:true,getManagedCollections:true,getCollection:true,getCollections:true,getColorStyle:true,getColorStyles:true,createColorStyle:true,getTextStyle:true,getTextStyles:true,createTextStyle:true,getFont:true,getFonts:true,createCodeFile:true,getCodeFiles:true,getCodeFile:true,lintCode:true,typecheckCode:true,addRedirects:true,getRedirects:true,setRedirectOrder:true,removeRedirects:true,addComponentInstancePlaceholder:true,createCollection:true,getVectorSets:true,createDesignPage:true,createWebPage:true,createTextNode:true,createComponentNode:true,mode:true,isAllowedTo:false,createFrameNode:true};function Di(i){return i in ir?ir[i]===true:false}r(Di,"isAllowedMethod");function nr(i){return typeof i=="string"&&i in B}r(nr,"isFramerApiOnlyMethod");var Vt=class i{static{r(this,"FramerAPI");}requestId;#e;#t;constructor(e,t,n){this.#t=e,this.#e=t,this.requestId=n;}static create(e,t,n){let o=new i(e,t,n);return new Proxy(o,{get(a,s){if(s in a)return Reflect.get(a,s);if(nr(s)){let T=B[s],b=Reflect.get(a.#t,T);return typeof b=="function"?b.bind(a.#t):b}if(!Di(s))return;let d=Reflect.get(a.#t,s);return typeof d=="function"?d.bind(a.#t):d},has(a,s){return s in a||nr(s)?true:Di(s)?s in a.#t:false}})}disconnect=async()=>{await this.#e();};[Symbol.dispose]=()=>{this.#e();};[Symbol.asyncDispose]=()=>this.#e()};var jo=/^.+--([A-Za-z0-9]+)/u,rr=/^[A-Za-z0-9]{20}$/u;function or(i){if(rr.test(i))return i;try{let t=new URL(i,"https://framer.com").pathname.split("/").filter(Boolean),n=t.findIndex(o=>o.toLowerCase()==="projects");if(n>=0){let o=t[n+1];if(o!==void 0){let a=decodeURIComponent(o),d=a.match(jo)?.[1]??a;if(rr.test(d))return d}}return null}catch{return null}}r(or,"parseProjectId");var oe=class extends Error{static{r(this,"FramerAPIError");}constructor(e){super(e),this.name="FramerAPIError",this.stack=undefined;}};var vi={silent:0,error:1,warn:2,info:3,debug:4};function _o(){let i=fe("FRAMER_API_LOG_LEVEL")?.toLowerCase();return i&&i in vi?i:"warn"}r(_o,"getLogLevel");var Ni=_o();function Ze(i){return vi[i]<=vi[Ni]}r(Ze,"shouldLog");var Je=globalThis.console,qo="\x1B[90m",Yo="\x1B[0m";function Xo(i){return i?`[FramerAPI:${i}]`:"[FramerAPI]"}r(Xo,"formatPrefix");function Zo(i,...e){return [qo+i,...e,Yo]}r(Zo,"formatDebug");function ar(i){let e=Xo(i);return {warn:(...t)=>{Ze("warn")&&Je.warn(e,...t);},error:(...t)=>{Ze("error")&&Je.error(e,...t);},log:(...t)=>{Ze("info")&&Je.log(e,...t);},info:(...t)=>{Ze("info")&&Je.info(e,...t);},debug:(...t)=>{Ze("debug")&&Je.debug(...Zo(e,...t));},setLevel:t=>{Ni=t;},getLevel:()=>Ni,withRequestId:t=>ar(t)}}r(ar,"createLogger");var k=ar();k.warn;k.error;k.log;k.info;k.debug;k.setLevel;k.getLevel;var sr;function lr({error:i,tags:e,extras:t,critical:n,caller:o}){w(sr,"Set up an error callback with setErrorReporter, or configure Sentry with initializeEnvironment");let a=Mi(i,o);return sr({error:a,tags:{...a.tags,...e},extras:{...a.extras,...t},critical:!!n}),a}r(lr,"reportError");function Mi(i,e=Mi){return i instanceof Error?i:new ki(i,e)}r(Mi,"reportableError");var ki=class extends Error{static{r(this,"UnhandledError");}constructor(e,t){let n=e?JSON.stringify(e):"No error message provided";if(super(n),this.message=n,t&&Error.captureStackTrace)Error.captureStackTrace(this,t);else try{throw new Error}catch(o){this.stack=o.stack;}}};var Qe=typeof window<"u"?window.location.hostname:undefined,dr=!!(Qe&&["web.framerlocal.com","localhost","127.0.0.1","[::1]"].includes(Qe)),Ei=(()=>{if(!Qe)return;if(dr)return {main:Qe,previewLink:undefined};let i=/^(([^.]+\.)?beta\.)?((?:development\.)?framer\.com)$/u,e=Qe.match(i);if(!(!e||!e[3]))return {previewLink:e[2]&&e[0],main:e[3]}})();({hosts:Ei,isDevelopment:Ei?.main==="development.framer.com",isProduction:Ei?.main==="framer.com",isLocal:dr});var At;function wt(){return typeof window>"u"?{}:At||(At=ea(),At)}r(wt,"getServiceMap");function ea(){let i=window.location,e=window?.bootstrap?.services;if(e)return e;let t;try{if(t=window.top.location.origin,e=window.top?.bootstrap?.services,e)return e}catch{}if(t&&t!==i.origin)throw Error(`Unexpectedly embedded by ${t} (expected ${i.origin})`);if(i.origin.endsWith("framer.com")||i.origin.endsWith("framer.dev"))throw Error("ServiceMap data was not provided in document");try{let n=new URLSearchParams(i.search).get("services")||new URLSearchParams(i.hash.substring(1)).get("services");n&&(e=JSON.parse(n));}catch{}if(e&&typeof e=="object"&&e.api)return e;throw Error("ServiceMap requested but not available")}r(ea,"extractServiceMap");function et(i,e=0,t=new Set){if(i===null)return i;if(typeof i=="function")return `[Function: ${i.name??"unknown"}]`;if(typeof i!="object")return i;if(i instanceof Error)return `[${i.toString()}]`;if(t.has(i))return "[Circular]";if(e>2)return "...";t.add(i);try{if("toJSON"in i&&typeof i.toJSON=="function")return et(i.toJSON(),e+1,t);if(Array.isArray(i))return i.map(n=>et(n,e+1,t));if(Object.getPrototypeOf(i)!==Object.prototype)return `[Object: ${"__class"in i&&i.__class||i.constructor?.name}]`;{let n={};for(let[o,a]of Object.entries(i))n[o]=et(a,e+1,t);return n}}catch(n){return `[Throws: ${n instanceof Error?n.message:n}]`}finally{t.delete(i);}}r(et,"jsonSafeCopy");var ta=["trace","debug","info","warn","error"],ia=[":trace",":debug",":info",":warn",":error"];function pr(i,e){let t=[];for(let n of i.split(/[ ,]/u)){let o=n.trim();if(o.length===0)continue;let a=1,s=false;o.startsWith("-")&&(o=o.slice(1),a=3,s=true);for(let b=0;b<=4;b++){let D=ia[b];if(D&&o.endsWith(D)){a=b,s&&(a+=1),o=o.slice(0,o.length-D.length),o.length===0&&(o="*");break}}let d=new RegExp("^"+la(o).replace(/\\\*/gu,".*")+"$"),T=0;for(let b of e)b.id.match(d)&&(b.level=a,++T);T===0&&t.push(n);}return t}r(pr,"applyLogLevelSpec");var tt=class i{constructor(e,t,n){this.logger=e;this.level=t;this.parts=n;this.id=i.nextId++,this.time=Date.now();}static{r(this,"LogEntry");}static nextId=0;id;time;stringPrefix;toMessage(){if(this.stringPrefix)return this.parts;let e=[new Date(this.time).toISOString().substr(-14,14),ta[this.level]+": ["+this.logger.id+"]"],t=0;for(;t<this.parts.length;t++){let n=this.parts[t];if(typeof n=="string"){e.push(n);continue}break}return this.stringPrefix=e.join(" "),this.parts.splice(0,t,this.stringPrefix),this.parts}toString(){return this.toMessage().map(e=>{let t=typeof e;if(t==="string")return e;if(t==="function")return `[Function: ${e.name??"unknown"}]`;if(e instanceof Error)return e.stack??e.toString();let n=JSON.stringify(et(e));return n?.length>253?n.slice(0,250)+"...":n}).join(" ")}},O="*:app:info,app:info",mr=typeof process<"u"&&!!process.kill,na=mr&&!!process.env.CI;na?O="-:warn":mr&&(O="");try{typeof window<"u"&&window.localStorage&&(O=window.localStorage.logLevel||O);}catch{}try{typeof process<"u"&&(O=process.env.DEBUG||O);}catch{}try{typeof window<"u"&&Object.assign(window,{setLogLevel:yr});}catch{}try{typeof window<"u"&&window.postMessage&&window.top===window&&window.addEventListener("message",i=>{if(!i.data||typeof i.data!="object")return;let{loggerId:e,level:t,parts:n,printed:o}=i.data;if(typeof e!="string"||!Array.isArray(n)||n.length<1||typeof t!="number")return;let a=it(e);if(t<0||t>5)return;n[0]=n[0].replace("[","*[");let s=new tt(a,t,n);s.stringPrefix=n[0],Y.push(s),!o&&(a.level>t||console?.log(...s.toMessage()));});}catch{}var Ai;try{typeof window<"u"&&window.postMessage&&window.parent!==window&&!window.location.pathname.startsWith("/edit")&&(Ai=r(i=>{try{let e=i.toMessage().map(s=>et(s)),t=i.logger,n=i.level,o=t.level<=i.level,a={loggerId:t.id,level:n,parts:e,printed:o};window.parent?.postMessage(a,wt().app);}catch{}},"postLogEntry"));}catch{}var Vi={},Y=[],gr=1e3;function ae(i,e,t){let n=new tt(i,e,t);for(Y.push(n),Ai?.(n);Y.length>gr;)Y.shift();return n}r(ae,"createLogEntry");function fr(i){return typeof i=="number"&&(gr=i),Y}r(fr,"getLogReplayBuffer");var ra=/\/(?<filename>[^/.]+)(?=\.(?:debug\.)?html$)/u,cr;function oa(){if(!(typeof window>"u"||!window.location))return cr??=ra.exec(window.location.pathname)?.groups?.filename,cr}r(oa,"getFilenameFromWindowPathname");function it(i){let e=oa();i=(e?e+":":"")+i;let t=Vi[i];if(t)return t;let n=new Wt(i);return Vi[i]=n,pr(O,[n]),Ai?.(new tt(n,-1,[])),n}r(it,"getLogger");function yr(i,e=true){try{typeof window<"u"&&window.localStorage&&(window.localStorage.logLevel=i);}catch{}let t=O;O=i;let n=Object.values(Vi);for(let a of n)a.level=3;let o=pr(i,n);if(o.length>0&&console?.warn("Some log level specs matched no loggers:",o),e&&Y.length>0){console?.log("--- LOG REPLAY ---");for(let a of Y)a.logger.level>a.level||(a.level>=3?console?.warn(...a.toMessage()):console?.log(...a.toMessage()));console?.log("--- END OF LOG REPLAY ---");}return t}r(yr,"setLogLevel");var aa=r(i=>{let e={...i,logs:fr().slice(-50).map(t=>t.toString().slice(0,600)).join(`
|
|
13
|
-
`)};return i.logs&&console?.warn("extras.logs is reserved for log replay buffer, use another key"),e},"enrichWithLogs"),Wt=class{constructor(e,t){this.id=e;this.errorIsCritical=t??(e==="fatal"||e.endsWith(":fatal"));}static{r(this,"Logger");}level=3;didLog={};errorIsCritical;extend(e){let t=this.id+":"+e;return it(t)}getBufferedMessages(){return Y.filter(e=>e.logger===this)}setLevel(e){let t=this.level;return this.level=e,t}isLoggingTraceMessages(){return this.level>=0}trace=(...e)=>{if(this.level>0)return;let t=ae(this,0,e);console?.log(...t.toMessage());};debug=(...e)=>{let t=ae(this,1,e);this.level>1||console?.log(...t.toMessage());};info=(...e)=>{let t=ae(this,2,e);this.level>2||console?.info(...t.toMessage());};warn=(...e)=>{let t=ae(this,3,e);this.level>3||console?.warn(...t.toMessage());};warnOncePerMinute=(e,...t)=>{let n=this.didLog[e];if(n&&n>Date.now())return;this.didLog[e]=Date.now()+1e3*60,t.unshift(e);let o=ae(this,3,t);this.level>3||console?.warn(...o.toMessage());};error=(...e)=>{let t=ae(this,4,e);this.level>4||console?.error(...t.toMessage());};errorOncePerMinute=(e,...t)=>{let n=this.didLog[e];if(n&&n>Date.now())return;this.didLog[e]=Date.now()+1e3*60,t.unshift(e);let o=ae(this,4,t);this.level>4||console?.error(...o.toMessage());};reportWithoutLogging=(e,t,n,o)=>{let a=
|
|
12
|
+
`));}catch{}throw t}r(w,"assert");var or={showUI:false,hideUI:false,closePlugin:false,notify:false,setMenu:false,showContextMenu:false,preloadDetachedComponentLayers:false,preloadDragPreviewImage:false,preloadImageUrlForInsertion:false,setBackgroundMessage:false,getSelection:false,getActiveCollection:false,getActiveManagedCollection:false,getActiveLocale:false,zoomIntoView:false,navigateTo:false,getPluginData:false,setPluginData:false,getPluginDataKeys:false,makeDraggable:false,subscribeToSelection:false,subscribeToImage:false,subscribeToText:false,subscribeToCustomCode:false,subscribeToColorStyles:false,subscribeToTextStyles:false,subscribeToRedirects:false,subscribeToCodeFiles:false,subscribeToOpenCodeFile:false,subscribeToIsAllowedTo:false,subscribeToCanvasRoot:false,subscribeToPublishInfo:false,unstable_ensureMinimumDependencyVersion:false,removeNode:true,removeNodes:true,addSVG:true,getRect:true,setText:true,getText:true,addText:true,setCustomCode:true,getCustomCode:true,getLocales:true,getDefaultLocale:true,getLocalizationGroups:true,setLocalizationData:true,getCurrentUser:true,getProjectInfo:true,setSelection:true,getCanvasRoot:true,getPublishInfo:true,cloneNode:true,getNode:true,getParent:true,getChildren:true,setAttributes:true,getNodesWithType:true,getNodesWithAttribute:true,getNodesWithAttributeSet:true,addImages:true,getImage:true,addImage:true,setImage:true,uploadImage:true,uploadImages:true,uploadFile:true,uploadFiles:true,setParent:true,addComponentInstance:true,addDetachedComponentLayers:true,getManagedCollection:true,getManagedCollections:true,getCollection:true,getCollections:true,getColorStyle:true,getColorStyles:true,createColorStyle:true,getTextStyle:true,getTextStyles:true,createTextStyle:true,getFont:true,getFonts:true,createCodeFile:true,getCodeFiles:true,getCodeFile:true,lintCode:true,typecheckCode:true,addRedirects:true,getRedirects:true,setRedirectOrder:true,removeRedirects:true,addComponentInstancePlaceholder:true,createCollection:true,getVectorSets:true,createDesignPage:true,createWebPage:true,createTextNode:true,createComponentNode:true,mode:true,isAllowedTo:false,createFrameNode:true};function vi(i){return i in or?or[i]===true:false}r(vi,"isAllowedMethod");var At=class i{static{r(this,"FramerAPI");}requestId;#e;#t;constructor(e,t,n){this.#t=e,this.#e=t,this.requestId=n;}static create(e,t,n){let o=new i(e,t,n);return new Proxy(o,{get(a,s){if(s in a)return Reflect.get(a,s);if(bi(s)){let T=B[s],b=Reflect.get(a.#t,T);return typeof b=="function"?b.bind(a.#t):b}if(!vi(s))return;let d=Reflect.get(a.#t,s);return typeof d=="function"?d.bind(a.#t):d},has(a,s){return s in a||bi(s)?true:vi(s)?s in a.#t:false}})}disconnect=async()=>{await this.#e();};[Symbol.dispose]=()=>{this.#e();};[Symbol.asyncDispose]=()=>this.#e()};var qo=/^.+--([A-Za-z0-9]+)/u,ar=/^[A-Za-z0-9]{20}$/u;function sr(i){if(ar.test(i))return i;try{let t=new URL(i,"https://framer.com").pathname.split("/").filter(Boolean),n=t.findIndex(o=>o.toLowerCase()==="projects");if(n>=0){let o=t[n+1];if(o!==void 0){let a=decodeURIComponent(o),d=a.match(qo)?.[1]??a;if(ar.test(d))return d}}return null}catch{return null}}r(sr,"parseProjectId");var oe=class extends Error{static{r(this,"FramerAPIError");}constructor(e){super(e),this.name="FramerAPIError",this.stack=undefined;}};var Ni={silent:0,error:1,warn:2,info:3,debug:4};function Yo(){let i=fe("FRAMER_API_LOG_LEVEL")?.toLowerCase();return i&&i in Ni?i:"warn"}r(Yo,"getLogLevel");var ki=Yo();function Ze(i){return Ni[i]<=Ni[ki]}r(Ze,"shouldLog");var Je=globalThis.console,Xo="\x1B[90m",Zo="\x1B[0m";function Jo(i){return i?`[FramerAPI:${i}]`:"[FramerAPI]"}r(Jo,"formatPrefix");function Qo(i,...e){return [Xo+i,...e,Zo]}r(Qo,"formatDebug");function lr(i){let e=Jo(i);return {warn:(...t)=>{Ze("warn")&&Je.warn(e,...t);},error:(...t)=>{Ze("error")&&Je.error(e,...t);},log:(...t)=>{Ze("info")&&Je.log(e,...t);},info:(...t)=>{Ze("info")&&Je.info(e,...t);},debug:(...t)=>{Ze("debug")&&Je.debug(...Qo(e,...t));},setLevel:t=>{ki=t;},getLevel:()=>ki,withRequestId:t=>lr(t)}}r(lr,"createLogger");var N=lr();N.warn;N.error;N.log;N.info;N.debug;N.setLevel;N.getLevel;var dr;function ur({error:i,tags:e,extras:t,critical:n,caller:o}){w(dr,"Set up an error callback with setErrorReporter, or configure Sentry with initializeEnvironment");let a=Ei(i,o);return dr({error:a,tags:{...a.tags,...e},extras:{...a.extras,...t},critical:!!n}),a}r(ur,"reportError");function Ei(i,e=Ei){return i instanceof Error?i:new Mi(i,e)}r(Ei,"reportableError");var Mi=class extends Error{static{r(this,"UnhandledError");}constructor(e,t){let n=e?JSON.stringify(e):"No error message provided";if(super(n),this.message=n,t&&Error.captureStackTrace)Error.captureStackTrace(this,t);else try{throw new Error}catch(o){this.stack=o.stack;}}};var Qe=typeof window<"u"?window.location.hostname:undefined,cr=!!(Qe&&["web.framerlocal.com","localhost","127.0.0.1","[::1]"].includes(Qe)),Ai=(()=>{if(!Qe)return;if(cr)return {main:Qe,previewLink:undefined};let i=/^(([^.]+\.)?beta\.)?((?:development\.)?framer\.com)$/u,e=Qe.match(i);if(!(!e||!e[3]))return {previewLink:e[2]&&e[0],main:e[3]}})();({hosts:Ai,isDevelopment:Ai?.main==="development.framer.com",isProduction:Ai?.main==="framer.com",isLocal:cr});var Vt;function wt(){return typeof window>"u"?{}:Vt||(Vt=ia(),Vt)}r(wt,"getServiceMap");function ia(){let i=window.location,e=window?.bootstrap?.services;if(e)return e;let t;try{if(t=window.top.location.origin,e=window.top?.bootstrap?.services,e)return e}catch{}if(t&&t!==i.origin)throw Error(`Unexpectedly embedded by ${t} (expected ${i.origin})`);if(i.origin.endsWith("framer.com")||i.origin.endsWith("framer.dev"))throw Error("ServiceMap data was not provided in document");try{let n=new URLSearchParams(i.search).get("services")||new URLSearchParams(i.hash.substring(1)).get("services");n&&(e=JSON.parse(n));}catch{}if(e&&typeof e=="object"&&e.api)return e;throw Error("ServiceMap requested but not available")}r(ia,"extractServiceMap");function et(i,e=0,t=new Set){if(i===null)return i;if(typeof i=="function")return `[Function: ${i.name??"unknown"}]`;if(typeof i!="object")return i;if(i instanceof Error)return `[${i.toString()}]`;if(t.has(i))return "[Circular]";if(e>2)return "...";t.add(i);try{if("toJSON"in i&&typeof i.toJSON=="function")return et(i.toJSON(),e+1,t);if(Array.isArray(i))return i.map(n=>et(n,e+1,t));if(Object.getPrototypeOf(i)!==Object.prototype)return `[Object: ${"__class"in i&&i.__class||i.constructor?.name}]`;{let n={};for(let[o,a]of Object.entries(i))n[o]=et(a,e+1,t);return n}}catch(n){return `[Throws: ${n instanceof Error?n.message:n}]`}finally{t.delete(i);}}r(et,"jsonSafeCopy");var na=["trace","debug","info","warn","error"],ra=[":trace",":debug",":info",":warn",":error"];function gr(i,e){let t=[];for(let n of i.split(/[ ,]/u)){let o=n.trim();if(o.length===0)continue;let a=1,s=false;o.startsWith("-")&&(o=o.slice(1),a=3,s=true);for(let b=0;b<=4;b++){let D=ra[b];if(D&&o.endsWith(D)){a=b,s&&(a+=1),o=o.slice(0,o.length-D.length),o.length===0&&(o="*");break}}let d=new RegExp("^"+ua(o).replace(/\\\*/gu,".*")+"$"),T=0;for(let b of e)b.id.match(d)&&(b.level=a,++T);T===0&&t.push(n);}return t}r(gr,"applyLogLevelSpec");var tt=class i{constructor(e,t,n){this.logger=e;this.level=t;this.parts=n;this.id=i.nextId++,this.time=Date.now();}static{r(this,"LogEntry");}static nextId=0;id;time;stringPrefix;toMessage(){if(this.stringPrefix)return this.parts;let e=[new Date(this.time).toISOString().substr(-14,14),na[this.level]+": ["+this.logger.id+"]"],t=0;for(;t<this.parts.length;t++){let n=this.parts[t];if(typeof n=="string"){e.push(n);continue}break}return this.stringPrefix=e.join(" "),this.parts.splice(0,t,this.stringPrefix),this.parts}toString(){return this.toMessage().map(e=>{let t=typeof e;if(t==="string")return e;if(t==="function")return `[Function: ${e.name??"unknown"}]`;if(e instanceof Error)return e.stack??e.toString();let n=JSON.stringify(et(e));return n?.length>253?n.slice(0,250)+"...":n}).join(" ")}},O="*:app:info,app:info",fr=typeof process<"u"&&!!process.kill,oa=fr&&!!process.env.CI;oa?O="-:warn":fr&&(O="");try{typeof window<"u"&&window.localStorage&&(O=window.localStorage.logLevel||O);}catch{}try{typeof process<"u"&&(O=process.env.DEBUG||O);}catch{}try{typeof window<"u"&&Object.assign(window,{setLogLevel:br});}catch{}try{typeof window<"u"&&window.postMessage&&window.top===window&&window.addEventListener("message",i=>{if(!i.data||typeof i.data!="object")return;let{loggerId:e,level:t,parts:n,printed:o}=i.data;if(typeof e!="string"||!Array.isArray(n)||n.length<1||typeof t!="number")return;let a=it(e);if(t<0||t>5)return;n[0]=n[0].replace("[","*[");let s=new tt(a,t,n);s.stringPrefix=n[0],Y.push(s),!o&&(a.level>t||console?.log(...s.toMessage()));});}catch{}var wi;try{typeof window<"u"&&window.postMessage&&window.parent!==window&&!window.location.pathname.startsWith("/edit")&&(wi=r(i=>{try{let e=i.toMessage().map(s=>et(s)),t=i.logger,n=i.level,o=t.level<=i.level,a={loggerId:t.id,level:n,parts:e,printed:o};window.parent?.postMessage(a,wt().app);}catch{}},"postLogEntry"));}catch{}var Vi={},Y=[],yr=1e3;function ae(i,e,t){let n=new tt(i,e,t);for(Y.push(n),wi?.(n);Y.length>yr;)Y.shift();return n}r(ae,"createLogEntry");function hr(i){return typeof i=="number"&&(yr=i),Y}r(hr,"getLogReplayBuffer");var aa=/\/(?<filename>[^/.]+)(?=\.(?:debug\.)?html$)/u,mr;function sa(){if(!(typeof window>"u"||!window.location))return mr??=aa.exec(window.location.pathname)?.groups?.filename,mr}r(sa,"getFilenameFromWindowPathname");function it(i){let e=sa();i=(e?e+":":"")+i;let t=Vi[i];if(t)return t;let n=new Wt(i);return Vi[i]=n,gr(O,[n]),wi?.(new tt(n,-1,[])),n}r(it,"getLogger");function br(i,e=true){try{typeof window<"u"&&window.localStorage&&(window.localStorage.logLevel=i);}catch{}let t=O;O=i;let n=Object.values(Vi);for(let a of n)a.level=3;let o=gr(i,n);if(o.length>0&&console?.warn("Some log level specs matched no loggers:",o),e&&Y.length>0){console?.log("--- LOG REPLAY ---");for(let a of Y)a.logger.level>a.level||(a.level>=3?console?.warn(...a.toMessage()):console?.log(...a.toMessage()));console?.log("--- END OF LOG REPLAY ---");}return t}r(br,"setLogLevel");var la=r(i=>{let e={...i,logs:hr().slice(-50).map(t=>t.toString().slice(0,600)).join(`
|
|
13
|
+
`)};return i.logs&&console?.warn("extras.logs is reserved for log replay buffer, use another key"),e},"enrichWithLogs"),Wt=class{constructor(e,t){this.id=e;this.errorIsCritical=t??(e==="fatal"||e.endsWith(":fatal"));}static{r(this,"Logger");}level=3;didLog={};errorIsCritical;extend(e){let t=this.id+":"+e;return it(t)}getBufferedMessages(){return Y.filter(e=>e.logger===this)}setLevel(e){let t=this.level;return this.level=e,t}isLoggingTraceMessages(){return this.level>=0}trace=(...e)=>{if(this.level>0)return;let t=ae(this,0,e);console?.log(...t.toMessage());};debug=(...e)=>{let t=ae(this,1,e);this.level>1||console?.log(...t.toMessage());};info=(...e)=>{let t=ae(this,2,e);this.level>2||console?.info(...t.toMessage());};warn=(...e)=>{let t=ae(this,3,e);this.level>3||console?.warn(...t.toMessage());};warnOncePerMinute=(e,...t)=>{let n=this.didLog[e];if(n&&n>Date.now())return;this.didLog[e]=Date.now()+1e3*60,t.unshift(e);let o=ae(this,3,t);this.level>3||console?.warn(...o.toMessage());};error=(...e)=>{let t=ae(this,4,e);this.level>4||console?.error(...t.toMessage());};errorOncePerMinute=(e,...t)=>{let n=this.didLog[e];if(n&&n>Date.now())return;this.didLog[e]=Date.now()+1e3*60,t.unshift(e);let o=ae(this,4,t);this.level>4||console?.error(...o.toMessage());};reportWithoutLogging=(e,t,n,o)=>{let a=la(t??{}),s=ur({caller:this.reportWithoutLogging,error:e,tags:{...n,handler:"logger",where:this.id},extras:t,critical:o??this.errorIsCritical});return [a,s]};reportError=(e,t,n,o)=>{let[a,s]=this.reportWithoutLogging(e,t,n,o);a?this.error(s,a):this.error(s);};reportErrorOncePerMinute=(e,t)=>{if(!da(e))return;let n=this.didLog[e.message];n&&n>Date.now()||(this.didLog[e.message]=Date.now()+1e3*60,this.reportError(e,t));};reportCriticalError=(e,t,n)=>this.reportError(e,t,n,true)};function da(i){return Object.prototype.hasOwnProperty.call(i,"message")}r(da,"isErrorWithMessage");function ua(i){return i.replace(/[/\-\\^$*+?.()|[\]{}]/gu,"\\$&")}r(ua,"escapeRegExp");var Ir;(G=>{function i(f,...u){return f.concat(u)}G.push=i,r(i,"push");function e(f){return f.slice(0,-1)}G.pop=e,r(e,"pop");function t(f,...u){return u.concat(f)}G.unshift=t,r(t,"unshift");function n(f,u,...I){let p=f.length;if(u<0||u>p)throw Error("index out of range: "+u);let y=f.slice();return y.splice(u,0,...I),y}G.insert=n,r(n,"insert");function o(f,u,I){let p=f.length;if(u<0||u>=p)throw Error("index out of range: "+u);let y=Array.isArray(I)?I:[I],F=f.slice();return F.splice(u,1,...y),F}G.replace=o,r(o,"replace");function a(f,u){let I=f.length;if(u<0||u>=I)throw Error("index out of range: "+u);let p=f.slice();return p.splice(u,1),p}G.remove=a,r(a,"remove");function s(f,u,I){let p=f.length;if(u<0||u>=p)throw Error("from index out of range: "+u);if(I<0||I>=p)throw Error("to index out of range: "+I);let y=f.slice();if(I===u)return y;let F=y[u];return u<I?(y.splice(I+1,0,F),y.splice(u,1)):(y.splice(u,1),y.splice(I,0,F)),y}G.move=s,r(s,"move");function d(f,u){let I=[],p=Math.min(f.length,u.length);for(let y=0;y<p;y++)I.push([f[y],u[y]]);return I}G.zip=d,r(d,"zip");function T(f,u,I){let p=f.slice(),y=p[u];return y===undefined||(p[u]=I(y)),p}G.update=T,r(T,"update");function b(f){return Array.from(new Set(f))}G.unique=b,r(b,"unique");function D(f,...u){return Array.from(new Set([...f,...u.flat()]))}G.union=D,r(D,"union");function z(f,u){return f.filter(u)}G.filter=z,r(z,"filter");})(Ir||={});var ha=Object.prototype.hasOwnProperty;function ba(i,e){return ha.call(i,e)}r(ba,"hasOwnProperty");var Tr;(n=>{function i(o,a){for(let s of Object.keys(o))ba(a,s)||delete o[s];for(let s of Object.keys(a))o[s]===undefined&&(o[s]=a[s]);return Object.setPrototypeOf(o,Object.getPrototypeOf(a)),o}n.morphUsingTemplate=i,r(i,"morphUsingTemplate");function e(o,a){a&&Object.assign(o,a);}n.writeOnce=e,r(e,"writeOnce");function t(o,a){return Object.assign(Object.create(Object.getPrototypeOf(o)),o,a)}n.update=t,r(t,"update");})(Tr||={});var Pr;(o=>{function i(a,...s){return new Set([...a,...s])}o.add=i,r(i,"add");function e(a,...s){let d=new Set(a);for(let T of s)d.delete(T);return d}o.remove=e,r(e,"remove");function t(...a){let s=new Set;for(let d of a)for(let T of d)s.add(T);return s}o.union=t,r(t,"union");function n(a,s){return a.has(s)?o.remove(a,s):o.add(a,s)}o.toggle=n,r(n,"toggle");})(Pr||={});var Sr;(n=>{function i(o,...a){let s=new Map;o.forEach((T,b)=>s.set(b,T));let d=false;for(let T of a)T&&(T.forEach((b,D)=>s.set(D,b)),d=true);return d?s:o}n.merge=i,r(i,"merge");function e(o,a,s){let d=new Map(o);return d.set(a,s),d}n.set=e,r(e,"set");function t(o,a){let s=new Map(o);return s.delete(a),s}n.remove=t,r(t,"remove");})(Sr||={});var Lt=class extends Promise{static{r(this,"ResolvablePromise");}_state="initial";resolve;reject;get state(){return this._state}pending(){return this._state="pending",this}isResolved(){return this._state==="fulfilled"||this._state==="rejected"}constructor(){let e,t;super((n,o)=>{e=n,t=o;}),this.resolve=n=>{this._state="fulfilled",e(n);},this.reject=n=>{this._state="rejected",t(n);};}};Lt.prototype.constructor=Promise;it("task-queue");function Li(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}r(Li,"isObject");var ye=class{constructor(e){this.ws=e;}static{r(this,"WebSocketTransport");}send(e){this.ws.send(nt.stringify(e));}waitForDisconnectAck(e){return new Promise(t=>{let n=setTimeout(()=>{this.ws.removeEventListener("message",o),t();},e),o=r(a=>{if(!(typeof a.data!="string"&&!(a.data instanceof String)))try{let s=nt.parse(a.data);Li(s)&&s.type==="disconnect-ack"&&(clearTimeout(n),this.ws.removeEventListener("message",o),t());}catch{}},"handler");this.ws.addEventListener("message",o);})}onMessage(e){this.ws.addEventListener("message",t=>{let n=typeof t.data=="string"?t.data:t.data.toString(),o=nt.parse(n);if(Li(o)&&o.type==="error"){N.error(`Server error: ${o.message||JSON.stringify(o)}`);return}if(Li(o)&&o.type==="debug-archive"){Ri(o.data);return}e(o);});}};function Ri(i){w(Fi,"File system module is not available."),w(Di,"Path module is not available.");let t=`debug-archive-${new Date().toISOString().replace(/[:.]/gu,"-")}.zip`,n=process.cwd(),o=Di.resolve(n,t);Fi.writeFileSync(o,Buffer.from(i)),N.info(`Debug archive saved to ${o}`);}r(Ri,"handleDebugArchive");function Rt(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}r(Rt,"isObject");var Ta={type:"pluginReadySignal"};function Pa(i){return Rt(i)&&i.type==="pluginReadyResponse"}r(Pa,"isPluginReadyResponse");var Fr=45e3,Sa=2e4;async function Fa(i,e){let t={Authorization:`Token ${e}`};return er?(N.debug("Using Cloudflare Workers WebSocket connection"),ir(i,t)):(N.debug("Using standard WebSocket connection"),new tr(i.href,{headers:t}))}r(Fa,"createWebSocket");async function Dr(i,e){let t=new URL(fe("FRAMER_HEADLESS_SERVER_URL","wss://api.framer.com/channel/headless-plugin"));t.protocol==="https:"?t.protocol="wss:":t.protocol==="http:"&&(t.protocol="ws:"),t.searchParams.set("projectId",i),N.debug(`Connecting to ${t.href}`);let n=await Fa(t,e);N.debug(`WebSocket created, readyState: ${n.readyState}`);let o,a=N,s=false,d=setInterval(()=>{n.readyState===n.OPEN&&(n.send(nt.stringify({type:"ping"})),a.debug("Sent ping"));},Sa),T=r(()=>{clearInterval(d),n.readyState!==n.CLOSED&&n.readyState!==n.CLOSING&&n.close(1e3,"Client disconnect");},"forceClose"),b=r(async()=>{if(clearInterval(d),!(n.readyState===n.CLOSED||n.readyState===n.CLOSING)){if(s){a.debug("Initiating graceful disconnect");let z=new ye(n);z.send({type:"client-disconnect"}),await z.waitForDisconnectAck(5e3);}n.readyState!==n.CLOSED&&n.readyState!==n.CLOSING&&n.close(1e3,"Client disconnect");}},"cleanup"),D=await new Promise((z,G)=>{let f=setTimeout(()=>{T(),G(new oe(`Connection timeout after ${Fr}ms`));},Fr),u=r(()=>{a.debug("WebSocket opened, waiting for ready");},"onOpen"),I=r(F=>{a.debug("WebSocket error:",F),clearTimeout(f),T(),G(new oe("No connection to the server"));},"onError"),p=r(F=>{a.debug(`WebSocket closed: code=${F.code}, reason=${F.reason||"(no reason)"}, wasClean=${F.wasClean}`),clearTimeout(f),clearInterval(d),G(new oe(`Connection to the server was closed (code: ${F.code})`));},"onClose");function y(F){a.debug("Received message");let X=typeof F.data=="string"?F.data:F.data.toString(),P=nt.parse(X);a.debug(`Message type: ${P.type}`),P.type==="error"?(clearTimeout(f),T(),G(new oe(`Server error: ${P.message||JSON.stringify(P)}`))):P.type==="ready"?(Rt(P)&&"requestId"in P&&(o=String(P.requestId),a=N.withRequestId(o),a.debug(`Server request ID: ${o}`)),Rt(P)&&"version"in P&&a.debug(`Server version: ${P.version}`),Rt(P)&&P.gracefulDisconnect===true&&(s=true),a.debug("Sending pluginReadySignal"),n.send(nt.stringify(Ta))):P.type==="debug-archive"?Ri(P.data):Pa(P)&&(clearTimeout(f),n.removeEventListener("message",y),n.removeEventListener("error",I),n.removeEventListener("close",p),z(P));}r(y,"handshakeMessageHandler"),n.addEventListener("open",u),n.addEventListener("message",y),n.addEventListener("error",I),n.addEventListener("close",p);});return n.addEventListener("close",()=>{b();}),{ws:n,pluginReadyData:D,requestId:o,logger:a,gracefulDisconnect:s,cleanup:b}}r(Dr,"connectAndHandshake");async function vr(i,e){let t=performance.now(),n=sr(i);w(n,`Invalid project URL or ID: ${i}`);let o=e??fe("FRAMER_API_KEY");w(o,"FRAMER_API_KEY environment variable is required");let a=await Dr(n,o),d={transport:new ye(a.ws),mode:a.pluginReadyData.mode,permissionMap:a.pluginReadyData.permissionMap,environmentInfo:a.pluginReadyData.environmentInfo,origin:null,theme:null},T=Jn(d),b=r(async()=>{let D=((performance.now()-t)/1e3).toFixed(2);a.logger.debug(`Connection ended after ${D}s`),await a.cleanup();},"cleanup");return At.create(T,b,a.requestId)}r(vr,"connect");async function Da(i,e,t){let n=await vr(i,t);try{return await e(n)}finally{await n.disconnect();}}r(Da,"withConnection");
|
|
14
14
|
|
|
15
|
-
export { pt as BooleanField, xe as BooleanVariable, ke as BorderVariable, Tt as CollectionReferenceField, mt as ColorField, Se as ColorVariable, Ke as ComponentInstanceNode, ie as ComponentNode, Be as ConicGradient, bt as DateField, Ne as DateVariable, ne as DesignPageNode, $ as EnumCase, It as EnumField, Pe as EnumVariable, xt as FieldDivider, Ct as FileField, De as FileVariable, yt as FormattedTextField, Te as FormattedTextVariable, R as FrameNode, _ as FramerPluginClosedError, qe as FramerPluginError, Ee as ImageField, Fe as ImageVariable, Le as LinearGradient, ht as LinkField, ve as LinkVariable, Pt as MultiCollectionReferenceField, gt as NumberField, Ce as NumberVariable, Re as RadialGradient, ze as SVGNode, ft as StringField, Ie as StringVariable, ee as TextNode, We as UnsupportedComputedValue,
|
|
15
|
+
export { pt as BooleanField, xe as BooleanVariable, ke as BorderVariable, Tt as CollectionReferenceField, mt as ColorField, Se as ColorVariable, Ke as ComponentInstanceNode, ie as ComponentNode, Be as ConicGradient, bt as DateField, Ne as DateVariable, ne as DesignPageNode, $ as EnumCase, It as EnumField, Pe as EnumVariable, xt as FieldDivider, Ct as FileField, De as FileVariable, yt as FormattedTextField, Te as FormattedTextVariable, R as FrameNode, _ as FramerPluginClosedError, qe as FramerPluginError, Ee as ImageField, Fe as ImageVariable, Le as LinearGradient, ht as LinkField, ve as LinkVariable, Pt as MultiCollectionReferenceField, gt as NumberField, Ce as NumberVariable, Re as RadialGradient, ze as SVGNode, ft as StringField, Ie as StringVariable, ee as TextNode, We as UnsupportedComputedValue, Ae as UnsupportedField, Me as UnsupportedVariable, _e as VectorSet, vt as VectorSetItem, Ge as VectorSetItemNode, $e as VectorSetNode, te as WebPageNode, _o as configure, vr as connect, re as framer, ll as hasGridLayout, sl as hasStackLayout, Ln as isBreakpoint, Ro as isCodeFileComponentExport, Bo as isCodeFileOverrideExport, ue as isColorStyle, Wn as isComponentGestureVariant, pe as isComponentInstanceNode, On as isComponentNode, ro as isComponentVariable, ui as isComponentVariant, go as isComputedValue, zn as isDesignPageNode, oo as isField, so as isFileAsset, Dt as isFrameNode, uo as isImageAsset, Bn as isSVGNode, Rn as isTextNode, di as isTextStyle, Gi as isVariable, Kn as isVectorSetItemNode, Gn as isVectorSetNode, Un as isWebPageNode, Ls as supportsAspectRatio, Os as supportsBackgroundColor, zs as supportsBackgroundColorData, $s as supportsBackgroundGradient, Hs as supportsBackgroundGradientData, Gs as supportsBackgroundImage, Ks as supportsBackgroundImageData, Ys as supportsBorder, qs as supportsBorderRadius, Mo as supportsBreakpoint, el as supportsComponentInfo, wn as supportsComponentVariant, tl as supportsFont, il as supportsFontData, al as supportsImageRendering, nl as supportsInlineTextStyle, rl as supportsInlineTextStyleData, Vn as supportsLayout, ol as supportsLink, Us as supportsLocked, Rs as supportsName, _s as supportsOpacity, Qs as supportsOverflow, Vs as supportsPins, As as supportsPosition, js as supportsRotation, Xs as supportsSVG, ws as supportsSize, Ws as supportsSizeConstraints, Zs as supportsTextTruncation, Bs as supportsVisible, Js as supportsZIndex, Da as withConnection };
|