framer-api 0.0.1-alpha.3 → 0.0.1-alpha.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -3230,7 +3230,7 @@ type NamespaceMembers<Class, Namespace extends string, Parent = undefined> = {
3230
3230
  [Member in Exclude<keyof Class, keyof Parent> as Member extends string ? `${Namespace}.${Member}` : never]: Class[Member];
3231
3231
  };
3232
3232
  type AllMembers = Omit<FramerPluginAPIAlpha, "isAllowedTo" | "subscribeToIsAllowedTo"> & NamespaceMembers<ImageAsset, "ImageAsset"> & NamespaceMembers<CodeFile, "CodeFile"> & NamespaceMembers<CodeFileVersion, "CodeFileVersion"> & NamespaceMembers<ComponentInstancePlaceholder, "ComponentInstancePlaceholder"> & NamespaceMembers<Field, "Field"> & NamespaceMembers<BooleanField, "BooleanField", Field> & NamespaceMembers<ColorField, "ColorField", Field> & NamespaceMembers<NumberField, "NumberField", Field> & NamespaceMembers<StringField, "StringField", Field> & NamespaceMembers<FormattedTextField, "FormattedTextField", Field> & NamespaceMembers<ImageField, "ImageField", Field> & NamespaceMembers<LinkField, "LinkField", Field> & NamespaceMembers<DateField, "DateField", Field> & NamespaceMembers<FieldDivider, "FieldDivider", Field> & NamespaceMembers<UnsupportedField, "UnsupportedField", Field> & NamespaceMembers<FileField, "FileField", Field> & NamespaceMembers<EnumField, "EnumField", Field> & NamespaceMembers<CollectionReferenceField, "CollectionReferenceField", Field> & NamespaceMembers<MultiCollectionReferenceField, "MultiCollectionReferenceField", Field> & NamespaceMembers<ManagedCollection, "ManagedCollection"> & NamespaceMembers<Collection, "Collection"> & NamespaceMembers<CollectionItem, "CollectionItem"> & NamespaceMembers<NodeMethods, "Node"> & NamespaceMembers<FrameNode, "FrameNode", NodeMethods> & NamespaceMembers<TextNode, "TextNode", NodeMethods> & NamespaceMembers<SVGNode, "SVGNode", NodeMethods> & NamespaceMembers<ComponentInstanceNode, "ComponentInstanceNode", NodeMethods> & NamespaceMembers<WebPageNode, "WebPageNode", NodeMethods> & NamespaceMembers<ComponentNode, "ComponentNode", NodeMethods> & NamespaceMembers<UnknownNode, "UnknownNode", NodeMethods> & NamespaceMembers<ColorStyle, "ColorStyle"> & NamespaceMembers<TextStyle, "TextStyle"> & NamespaceMembers<Variable, "Variable"> & NamespaceMembers<BooleanVariable, "BooleanVariable", Variable> & NamespaceMembers<NumberVariable, "NumberVariable", Variable> & NamespaceMembers<StringVariable, "StringVariable", Variable> & NamespaceMembers<FormattedTextVariable, "FormattedTextVariable", Variable> & NamespaceMembers<EnumCase, "EnumCase"> & NamespaceMembers<EnumVariable, "EnumVariable", Variable> & NamespaceMembers<ColorVariable, "ColorVariable", Variable> & NamespaceMembers<ImageVariable, "ImageVariable", Variable> & NamespaceMembers<FileVariable, "FileVariable", Variable> & NamespaceMembers<LinkVariable, "LinkVariable", Variable> & NamespaceMembers<DateVariable, "DateVariable", Variable> & NamespaceMembers<BorderVariable, "BorderVariable", Variable> & NamespaceMembers<UnsupportedVariable, "UnsupportedVariable", Variable> & NamespaceMembers<VectorSet, "VectorSet"> & NamespaceMembers<VectorSetItem, "VectorSetItem">;
3233
- declare const unprotectedMessageTypesSource: ["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", "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", "getChangedPagePaths", "getChangeAuthors", "INTERNAL_getAiServiceInfo", "INTERNAL_sendTrackingEvent", "INTERNAL_getHTMLForNode", "getAiServiceInfo", "sendTrackingEvent", "unstable_getCodeFile", "unstable_getCodeFiles", "unstable_getCodeFileVersionContent", "unstable_getCodeFileLint2", "unstable_getCodeFileTypecheck2", "unstable_getCodeFileVersions"];
3233
+ declare const unprotectedMessageTypesSource: ["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", "getChangedPagePaths", "getChangeAuthors", "INTERNAL_getAiServiceInfo", "INTERNAL_sendTrackingEvent", "INTERNAL_getHTMLForNode", "getAiServiceInfo", "sendTrackingEvent", "unstable_getCodeFile", "unstable_getCodeFiles", "unstable_getCodeFileVersionContent", "unstable_getCodeFileLint2", "unstable_getCodeFileTypecheck2", "unstable_getCodeFileVersions"];
3234
3234
  type UnprotectedMessageType = (typeof unprotectedMessageTypesSource)[number];
3235
3235
  type ProtectedMessageType = Exclude<keyof PluginMessageAPI, UnprotectedMessageType>;
3236
3236
  type Method = keyof {
@@ -3294,6 +3294,8 @@ declare const methodToMessageTypes: {
3294
3294
  readonly getTextStyles: [];
3295
3295
  readonly hideUI: [];
3296
3296
  /** @beta */
3297
+ readonly setBackgroundMessage: [];
3298
+ /** @beta */
3297
3299
  readonly lintCode: [];
3298
3300
  readonly makeDraggable: ["onDragEnd", "onDragStart", "onDrag", "setDragData", "preloadDetachedComponentLayers", "preloadImageUrlForInsertion", "preloadDragPreviewImage"];
3299
3301
  readonly notify: [];
@@ -3767,6 +3769,8 @@ declare class FramerPluginAPI {
3767
3769
  showUI(options?: UIOptions): Promise<void>;
3768
3770
  /** Hide the plugin window, without stopping the plugin. */
3769
3771
  hideUI(): Promise<void>;
3772
+ /** Update the background status text shown while the plugin UI is hidden. */
3773
+ setBackgroundMessage(status: string | null): Promise<void>;
3770
3774
  /**
3771
3775
  * Stop the plugin. Throws `FramerPluginClosedError`, which should be ignored.
3772
3776
  * @param message - Optional message to show in the notification (ignored if options.silent is true)
@@ -4175,6 +4179,7 @@ type OtherDragData = Exclude<DragData, {
4175
4179
  type MessageApiDragData = ComponentDragData | OtherDragData;
4176
4180
  interface PluginMessageAPI {
4177
4181
  hideUI: FramerPluginAPI["hideUI"];
4182
+ setBackgroundMessage: FramerPluginAPI["setBackgroundMessage"];
4178
4183
  closePlugin: (...parameters: Parameters<FramerPluginAPI["closePlugin"]>) => Promise<void>;
4179
4184
  removeNode: FramerPluginAPI["removeNode"];
4180
4185
  removeNodes: FramerPluginAPI["removeNodes"];
@@ -4579,9 +4584,6 @@ declare const framer: FramerPluginAPIAlpha;
4579
4584
 
4580
4585
  declare function configure(environment: Record<string, string | undefined>): void;
4581
4586
 
4582
- declare const API_MODE_BLOCKED_MESSAGE_TYPES: readonly ["showUI", "hideUI", "closePlugin", "notify", "setMenu", "showContextMenu", "preloadDetachedComponentLayers", "preloadDragPreviewImage", "preloadImageUrlForInsertion", "getSelection", "getActiveCollection", "getActiveManagedCollection", "getActiveLocale", "zoomIntoView", "navigateTo", "getPluginData", "setPluginData", "getPluginDataKeys", "setDragData", "onDragStart", "onDrag", "onDragEnd"];
4583
- /** Used by ActivePlugin.ts for vekter-side validation */
4584
- type ApiModeBlockedMethods = (typeof API_MODE_BLOCKED_MESSAGE_TYPES)[number];
4585
4587
  /** Used to block methods at runtime */
4586
4588
  declare const PUBLIC_API_BLOCKED_METHODS: readonly ["showUI", "hideUI", "closePlugin", "notify", "setMenu", "showContextMenu", "preloadDetachedComponentLayers", "preloadDragPreviewImage", "preloadImageUrlForInsertion", "getSelection", "getActiveCollection", "getActiveManagedCollection", "getActiveLocale", "zoomIntoView", "navigateTo", "getPluginData", "setPluginData", "getPluginDataKeys", "makeDraggable", "subscribeToSelection", "subscribeToImage", "subscribeToText"];
4587
4589
  /**
@@ -4601,4 +4603,4 @@ type Framer = FramerHeadlessAPI & FramerConnectionMethods;
4601
4603
  declare function connect(projectUrlOrId: string, token?: string): Promise<Framer>;
4602
4604
  declare function withConnection<T>(projectUrlOrId: string, callback: (framer: Framer) => Promise<T>, token?: string): Promise<T>;
4603
4605
 
4604
- export { type AllTraits, type AnyNode, type ApiModeBlockedMethods, type ApiVersion1ProjectInfo, type ApiVersion1User, type ArrayControl, type ArrayFieldDataEntry, type ArrayFieldDataEntryInput, type ArrayItem, type ArrayItemData, type ArrayItemInput, type AxisOverflow, type BooleanControl, BooleanField, BooleanVariable, type Border, type BorderControl, type BorderRadius, type BorderRadiusControl, type BorderStyle, BorderVariable, type BorderWidth, type Breakpoint, type CanvasNode, type CanvasRootNode, CodeFile, type CodeFileComponentExport, type CodeFileExport, type CodeFileOverrideExport, CodeFileVersion, Collection, CollectionItem, type CollectionItemData, type CollectionItemInput, type CollectionReferenceControl, CollectionReferenceField, type ColorControl, ColorField, type ColorStop, ColorStyle, ColorVariable, ComponentInstanceNode, ComponentInstancePlaceholder, type ComponentInstancePlaceholderAttributes, type ComponentInstancePlaceholderData, ComponentNode, type ComponentVariable, type ComputedValue, ConicGradient, type Control, type ControlAttributes, type CreateField, type CreateVariable, type CursorControl, type CustomCode, type CustomCodeLocation, type CustomCursorControl, type DateControl, DateField, DateVariable, DesignPageNode, type DiagnosticSpan, type EditableManagedCollectionField, EnumCase, type EnumCaseData, type EnumControl, EnumField, EnumVariable, type Field, type FieldData, type FieldDataEntry, type FieldDataEntryInput, type FieldDataInput, FieldDivider, type FileControl, FileField, FileVariable, type FitContent, type FitImage, Font, type FontControl, type FormattedTextControl, FormattedTextField, FormattedTextVariable, FrameNode, type Framer, type FramerConnectionMethods, FramerPluginClosedError, FramerPluginError, type FusedNumberControl, type GapControl, type Gesture, type Gradient, type GridContentAlignment, type GridItemAlignment, type GridItemColumnSpan, type GridLayout, type HeightConstraint, type HeightLength, ImageAsset, type ImageControl, ImageField, type ImageRendering, ImageVariable, type InlineLocalizationValueByLocale, type IsBreakpoint, type IsComponentGestureVariant, type IsComponentVariant, type LayoutType, type Length, LinearGradient, type LinkControl, LinkField, type LinkRelControl, LinkVariable, type LintConfig, type LintDiagnostic, type LintLink, type Locale, type LocaleId, type LocalizationData, type LocalizationGroup, type LocalizationGroupStatus, type LocalizationGroupStatusByLocale, type LocalizationSource, type LocalizationSourceId, type LocalizationSourceUpdate, type LocalizationValueByLocale, type LocalizedValueStatus, type LocalizedValueUpdate, ManagedCollection, type ManagedCollectionField, type ManagedCollectionFieldInput, type ManagedCollectionItemInput, type Mode, type MultiCollectionReferenceControl, MultiCollectionReferenceField, type NodeAttributeKey, type NodeId, type NodeRuntimeErrorResult, type NumberControl, NumberField, NumberVariable, type ObjectControl, type Overflow, type Ownership, PUBLIC_API_BLOCKED_METHODS, type PaddingControl, type PageScopeControl, type Position, type ProjectInfo, type ProtectedMethod, type Publish, type PublishInfo, RadialGradient, type Rect$1 as Rect, Redirect, type RedirectInput, SVGNode, type ScrollSectionControl, type SetLocalizationDataResult, type ShadowControl, type ShowProgressOnInstancesAttributes, type StackAlignment, type StackDirection, type StackDistribution, type StackLayout, type StringControl, StringField, StringVariable, type TextAlignment, type TextDecoration, TextNode, TextStyle, type TextStyleBreakpoint, type TextStyleTag, type TextTransform, type TrackingIdControl, type TraitVariant, type TraitVariantData, type TraitVariantNode, type TransitionControl, type TypecheckDiagnostic, UnsupportedComputedValue, UnsupportedField, UnsupportedVariable, type UpdateFieldAttributes, type User, type Variable, VectorSet, type VectorSetData, VectorSetItem, type VectorSetItemControl, type VectorSetItemData, VectorSetItemNode, type VectorSetItemVariable, VectorSetNode, WebPageNode, type WidthConstraint, type WidthLength, type WithAspectRatioTrait, type WithBackgroundColorTrait, type WithBackgroundGradientTrait, type WithBackgroundImageTrait, type WithBorderRadiusTrait, type WithBorderTrait, type WithBreakpointTrait, type WithComponentInfoTrait, type WithComponentVariantTrait, type WithControlAttributesTrait, type WithFontTrait, type WithGridItemTrait, type WithIdTrait, type WithImageRenderingTrait, type WithInlineTextStyleTrait, type WithLayoutTrait, type WithLinkTrait, type WithLockedTrait, type WithNameTrait, type WithNullableComponentInfoTrait, type WithOpacityTrait, type WithOverflowTrait, type WithPinsTrait, type WithPositionTrait, type WithReplicaInfoTrait, type WithRequiredComponentInfoTrait, type WithRotationTrait, type WithSVGTrait, type WithSizeConstraintsTrait, type WithSizeTrait, type WithTextTruncationTrait, type WithVisibleTrait, type WithWebPageInfoTrait, type WithZIndexTrait, configure, connect, framer, hasGridLayout, hasStackLayout, isBreakpoint, isCodeFileComponentExport, isCodeFileOverrideExport, isColorStyle, isComponentGestureVariant, isComponentInstanceNode, isComponentNode, isComponentVariable, isComponentVariant, isComputedValue, isDesignPageNode, isField, isFileAsset, isFrameNode, isImageAsset, isSVGNode, isTextNode, isTextStyle, isVariable, isVectorSetItemNode, isVectorSetNode, isWebPageNode, supportsAspectRatio, supportsBackgroundColor, supportsBackgroundColorData, supportsBackgroundGradient, supportsBackgroundGradientData, supportsBackgroundImage, supportsBackgroundImageData, supportsBorder, supportsBorderRadius, supportsBreakpoint, supportsComponentInfo, supportsComponentVariant, supportsFont, supportsFontData, supportsImageRendering, supportsInlineTextStyle, supportsInlineTextStyleData, supportsLayout, supportsLink, supportsLocked, supportsName, supportsOpacity, supportsOverflow, supportsPins, supportsPosition, supportsRotation, supportsSVG, supportsSize, supportsSizeConstraints, supportsTextTruncation, supportsVisible, supportsZIndex, withConnection };
4606
+ export { type AllTraits, type AnyNode, type ApiVersion1ProjectInfo, type ApiVersion1User, type ArrayControl, type ArrayFieldDataEntry, type ArrayFieldDataEntryInput, type ArrayItem, type ArrayItemData, type ArrayItemInput, type AxisOverflow, type BooleanControl, BooleanField, BooleanVariable, type Border, type BorderControl, type BorderRadius, type BorderRadiusControl, type BorderStyle, BorderVariable, type BorderWidth, type Breakpoint, type CanvasNode, type CanvasRootNode, CodeFile, type CodeFileComponentExport, type CodeFileExport, type CodeFileOverrideExport, CodeFileVersion, Collection, CollectionItem, type CollectionItemData, type CollectionItemInput, type CollectionReferenceControl, CollectionReferenceField, type ColorControl, ColorField, type ColorStop, ColorStyle, ColorVariable, ComponentInstanceNode, ComponentInstancePlaceholder, type ComponentInstancePlaceholderAttributes, type ComponentInstancePlaceholderData, ComponentNode, type ComponentVariable, type ComputedValue, ConicGradient, type Control, type ControlAttributes, type CreateField, type CreateVariable, type CursorControl, type CustomCode, type CustomCodeLocation, type CustomCursorControl, type DateControl, DateField, DateVariable, DesignPageNode, type DiagnosticSpan, type EditableManagedCollectionField, EnumCase, type EnumCaseData, type EnumControl, EnumField, EnumVariable, type Field, type FieldData, type FieldDataEntry, type FieldDataEntryInput, type FieldDataInput, FieldDivider, type FileControl, FileField, FileVariable, type FitContent, type FitImage, Font, type FontControl, type FormattedTextControl, FormattedTextField, FormattedTextVariable, FrameNode, type Framer, FramerPluginClosedError, FramerPluginError, type FusedNumberControl, type GapControl, type Gesture, type Gradient, type GridContentAlignment, type GridItemAlignment, type GridItemColumnSpan, type GridLayout, type HeightConstraint, type HeightLength, ImageAsset, type ImageControl, ImageField, type ImageRendering, ImageVariable, type InlineLocalizationValueByLocale, type IsBreakpoint, type IsComponentGestureVariant, type IsComponentVariant, type LayoutType, type Length, LinearGradient, type LinkControl, LinkField, type LinkRelControl, LinkVariable, type LintConfig, type LintDiagnostic, type LintLink, type Locale, type LocaleId, type LocalizationData, type LocalizationGroup, type LocalizationGroupStatus, type LocalizationGroupStatusByLocale, type LocalizationSource, type LocalizationSourceId, type LocalizationSourceUpdate, type LocalizationValueByLocale, type LocalizedValueStatus, type LocalizedValueUpdate, ManagedCollection, type ManagedCollectionField, type ManagedCollectionFieldInput, type ManagedCollectionItemInput, type Mode, type MultiCollectionReferenceControl, MultiCollectionReferenceField, type NodeAttributeKey, type NodeId, type NodeRuntimeErrorResult, type NumberControl, NumberField, NumberVariable, type ObjectControl, type Overflow, type Ownership, type PaddingControl, type PageScopeControl, type Position, type ProjectInfo, type ProtectedMethod, type Publish, type PublishInfo, RadialGradient, type Rect$1 as Rect, Redirect, type RedirectInput, SVGNode, type ScrollSectionControl, type SetLocalizationDataResult, type ShadowControl, type ShowProgressOnInstancesAttributes, type StackAlignment, type StackDirection, type StackDistribution, type StackLayout, type StringControl, StringField, StringVariable, type TextAlignment, type TextDecoration, TextNode, TextStyle, type TextStyleBreakpoint, type TextStyleTag, type TextTransform, type TrackingIdControl, type TraitVariant, type TraitVariantData, type TraitVariantNode, type TransitionControl, type TypecheckDiagnostic, UnsupportedComputedValue, UnsupportedField, UnsupportedVariable, type UpdateFieldAttributes, type User, type Variable, VectorSet, type VectorSetData, VectorSetItem, type VectorSetItemControl, type VectorSetItemData, VectorSetItemNode, type VectorSetItemVariable, VectorSetNode, WebPageNode, type WidthConstraint, type WidthLength, type WithAspectRatioTrait, type WithBackgroundColorTrait, type WithBackgroundGradientTrait, type WithBackgroundImageTrait, type WithBorderRadiusTrait, type WithBorderTrait, type WithBreakpointTrait, type WithComponentInfoTrait, type WithComponentVariantTrait, type WithControlAttributesTrait, type WithFontTrait, type WithGridItemTrait, type WithIdTrait, type WithImageRenderingTrait, type WithInlineTextStyleTrait, type WithLayoutTrait, type WithLinkTrait, type WithLockedTrait, type WithNameTrait, type WithNullableComponentInfoTrait, type WithOpacityTrait, type WithOverflowTrait, type WithPinsTrait, type WithPositionTrait, type WithReplicaInfoTrait, type WithRequiredComponentInfoTrait, type WithRotationTrait, type WithSVGTrait, type WithSizeConstraintsTrait, type WithSizeTrait, type WithTextTruncationTrait, type WithVisibleTrait, type WithWebPageInfoTrait, type WithZIndexTrait, configure, connect, framer, hasGridLayout, hasStackLayout, isBreakpoint, isCodeFileComponentExport, isCodeFileOverrideExport, isColorStyle, isComponentGestureVariant, isComponentInstanceNode, isComponentNode, isComponentVariable, isComponentVariant, isComputedValue, isDesignPageNode, isField, isFileAsset, isFrameNode, isImageAsset, isSVGNode, isTextNode, isTextStyle, isVariable, isVectorSetItemNode, isVectorSetNode, isWebPageNode, supportsAspectRatio, supportsBackgroundColor, supportsBackgroundColorData, supportsBackgroundGradient, supportsBackgroundGradientData, supportsBackgroundImage, supportsBackgroundImageData, supportsBorder, supportsBorderRadius, supportsBreakpoint, supportsComponentInfo, supportsComponentVariant, supportsFont, supportsFontData, supportsImageRendering, supportsInlineTextStyle, supportsInlineTextStyleData, supportsLayout, supportsLink, supportsLocked, supportsName, supportsOpacity, supportsOverflow, supportsPins, supportsPosition, supportsRotation, supportsSVG, supportsSize, supportsSizeConstraints, supportsTextTruncation, supportsVisible, supportsZIndex, withConnection };
package/dist/index.js CHANGED
@@ -1,14 +1,15 @@
1
1
  import { WebSocket } from 'unenv/node/http';
2
- import Ja from 'unenv/node/process';
3
- import * as ee from 'devalue';
2
+ import wo from 'unenv/node/process';
3
+ import * as it from 'devalue';
4
4
 
5
- /* Framer API SDK v0.0.1-alpha.3 */
6
- var Ln=Object.defineProperty;var a=(i,e)=>Ln(i,"name",{value:e,configurable:true});function Ze(i){return i!==undefined}a(Ze,"isDefined");function pi(i){return i===undefined}a(pi,"isUndefined");function m(i){return i===null}a(m,"isNull");function mi(i){return i!==null}a(mi,"isNotNull");function ge(i){return i===true||i===false}a(ge,"isBoolean");function c(i){return typeof i=="string"}a(c,"isString");function U(i){return typeof i=="number"&&Number.isFinite(i)}a(U,"isNumber");function Rn(i){return typeof i=="function"}a(Rn,"isFunction");function C(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}a(C,"isObject");function Je(i){if(typeof i!="object"||i===null)return false;let e=Object.getPrototypeOf(i);return e===null||e===Object.prototype}a(Je,"isPlainObject");function Ft(i){return Array.isArray(i)}a(Ft,"isArray");function Qe(i,e){throw e||new Error(i?`Unexpected value: ${i}`:"Application entered invalid state")}a(Qe,"assertNever");function u(i,...e){if(i)return;let t=Error("Assertion Error"+(e.length>0?": "+e.join(" "):""));if(t.stack)try{let n=t.stack.split(`
5
+ /* Framer API SDK v0.0.1-alpha.5 */
6
+ var hr=Object.defineProperty;var r=(i,e)=>hr(i,"name",{value:e,configurable:true});function ot(i){return i!==undefined}r(ot,"isDefined");function Ni(i){return i===undefined}r(Ni,"isUndefined");function b(i){return i===null}r(b,"isNull");function ki(i){return i!==null}r(ki,"isNotNull");function he(i){return i===true||i===false}r(he,"isBoolean");function g(i){return typeof i=="string"}r(g,"isString");function G(i){return typeof i=="number"&&Number.isFinite(i)}r(G,"isNumber");function br(i){return typeof i=="function"}r(br,"isFunction");function v(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}r(v,"isObject");function at(i){if(typeof i!="object"||i===null)return false;let e=Object.getPrototypeOf(i);return e===null||e===Object.prototype}r(at,"isPlainObject");function Lt(i){return Array.isArray(i)}r(Lt,"isArray");function st(i,e){throw e||new Error(i?`Unexpected value: ${i}`:"Application entered invalid state")}r(st,"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}a(u,"assert");function h(i){for(let e of Reflect.ownKeys(i)){let t=i[e];!t||typeof t!="object"&&!Rn(t)||h(t);}return Object.freeze(i)}a(h,"deepFreeze");function gi(i){return [i.slice(0,-1),i.at(-1)]}a(gi,"splitRestAndLast");var d="__class";var St=Symbol(),Dt=Symbol(),Bn=Symbol(),Un=Symbol(),On=Symbol(),zn=Symbol(),Nt=Symbol(),vt=Symbol(),r={getAiServiceInfo:St,sendTrackingEvent:Dt,environmentInfo:Bn,showUncheckedPermissionToasts:Un,marshal:On,unmarshal:zn,getHTMLForNode:Nt,setHTMLForNode:vt},et="INTERNAL_",tt=`${et}getAiServiceInfo`,it=`${et}sendTrackingEvent`,ae=`${et}getHTMLForNode`,oe=`${et}setHTMLForNode`;var T=class{static{a(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(m(t))return null;let n=this.constructor;return new n(this.#e,t)}async remove(){await this.#e.invoke("removeVariables",this.nodeId,[this.id]);}},F="Variable";function N(i){let e=i.at(0);return u(!pi(e)),`${e.toLowerCase()}${i.slice(1,-F.length)}`}a(N,"classToType");var Gn=`Boolean${F}`,Kn=N(Gn),ye=class i extends T{static{a(this,"BooleanVariable");}type=Kn;#e;constructor(e,t){super(e,t),this.#e=t;}static[r.unmarshal](e,t){return new i(e,t)}[r.marshal](){return this.#e}},Hn=`Number${F}`,$n=N(Hn),he=class i extends T{static{a(this,"NumberVariable");}type=$n;#e;constructor(e,t){super(e,t),this.#e=t;}static[r.unmarshal](e,t){return new i(e,t)}[r.marshal](){return this.#e}},jn=`String${F}`,qn=N(jn),fe=class i extends T{static{a(this,"StringVariable");}type=qn;#e;constructor(e,t){super(e,t),this.#e=t;}static[r.unmarshal](e,t){return new i(e,t)}[r.marshal](){return this.#e}},_n=`FormattedText${F}`,Yn=N(_n),Ce=class i extends T{static{a(this,"FormattedTextVariable");}type=Yn;#e;constructor(e,t){super(e,t),this.#e=t;}static[r.unmarshal](e,t){return new i(e,t)}[r.marshal](){return this.#e}},Xn=`Enum${F}`,Zn=N(Xn),O=class i{static{a(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);}},be=class i extends T{static{a(this,"EnumVariable");}type=Zn;#e;#t;#i;get cases(){return this.#i||(this.#i=h(this.#t.cases.map(e=>new O(this.#e,this.nodeId,this.id,e)))),this.#i}constructor(e,t){super(e,t),this.#e=e,this.#t=t;}static[r.unmarshal](e,t){return new i(e,t)}[r.marshal](){return this.#t}async addCase(e){let t=await this.#e.invoke("addEnumCase",this.nodeId,this.id,e);return t?new O(this.#e,this.nodeId,this.id,t):null}async setCaseOrder(e){await this.#e.invoke("setEnumCaseOrder",this.nodeId,this.id,e);}},Jn=`Color${F}`,Qn=N(Jn),Ie=class i extends T{static{a(this,"ColorVariable");}type=Qn;#e;constructor(e,t){super(e,t),this.#e=t;}static[r.unmarshal](e,t){return new i(e,t)}[r.marshal](){return this.#e}},ea=`Image${F}`,ta=N(ea),Te=class i extends T{static{a(this,"ImageVariable");}type=ta;#e;constructor(e,t){super(e,t),this.#e=t;}static[r.unmarshal](e,t){return new i(e,t)}[r.marshal](){return this.#e}},ia=`File${F}`,na=N(ia),Pe=class i extends T{static{a(this,"FileVariable");}type=na;#e;get allowedFileTypes(){return this.#e.allowedFileTypes}constructor(e,t){super(e,t),this.#e=t;}static[r.unmarshal](e,t){return new i(e,t)}[r.marshal](){return this.#e}},aa=`Link${F}`,oa=N(aa),xe=class i extends T{static{a(this,"LinkVariable");}type=oa;#e;constructor(e,t){super(e,t),this.#e=t;}static[r.unmarshal](e,t){return new i(e,t)}[r.marshal](){return this.#e}},ra=`Date${F}`,sa=N(ra),Fe=class i extends T{static{a(this,"DateVariable");}type=sa;#e;constructor(e,t){super(e,t),this.#e=t;}static[r.unmarshal](e,t){return new i(e,t)}[r.marshal](){return this.#e}},la=`Border${F}`,da=N(la),Se=class i extends T{static{a(this,"BorderVariable");}type=da;#e;constructor(e,t){super(e,t),this.#e=t;}static[r.unmarshal](e,t){return new i(e,t)}[r.marshal](){return this.#e}},ua=`Unsupported${F}`,ca=N(ua),De=class i extends T{static{a(this,"UnsupportedVariable");}type=ca;#e;constructor(e,t){super(e,t),this.#e=t;}static[r.unmarshal](e,t){return new i(e,t)}[r.marshal](){return this.#e}};function yi(i){return i instanceof T}a(yi,"isVariable");function pa(i){return yi(i)&&i.nodeType==="component"}a(pa,"isComponentVariable");var W=class{static{a(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(u(Ze(n)),m(n))return null;u(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{a(this,"FieldBaseWithRequired");}#e;get required(){return this.#e.required}constructor(e,t,n){super(e,t,n),this.#e=n;}},nt=class extends W{static{a(this,"BooleanField");}type=At},at=class extends W{static{a(this,"ColorField");}type=Wt},ot=class extends W{static{a(this,"NumberField");}type=Et},rt=class extends V{static{a(this,"StringField");}type=Mt;#e;constructor(e,t,n){super(e,t,n),this.#e=n;}get basedOn(){return this.#e.basedOn}},st=class extends V{static{a(this,"FormattedTextField");}type=wt},Ne=class extends V{static{a(this,"ImageField");}type=Lt},lt=class extends V{static{a(this,"LinkField");}type=Bt},dt=class extends V{static{a(this,"DateField");}type=Ut},ut=class extends W{static{a(this,"FieldDivider");}type=Ht},ve=class extends W{static{a(this,"UnsupportedField");}type=$t},ct=class extends V{static{a(this,"FileField");}type=Ot;#e;get allowedFileTypes(){return this.#e.allowedFileTypes}constructor(e,t,n){super(e,t,n),this.#e=n;}},pt=class extends W{static{a(this,"EnumField");}type=zt;#e;#t;#i;#n;get cases(){return this.#n||(this.#n=this.#i.cases.map(e=>new O(this.#e,this.#t,this.id,e)),h(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 O(this.#e,this.#t,this.id,t):null}async setCaseOrder(e){await this.#e.invoke("setEnumCaseOrder",this.#t,this.id,e);}},mt=class extends V{static{a(this,"CollectionReferenceField");}type=Gt;#e;get collectionId(){return this.#e.collectionId}constructor(e,t,n){super(e,t,n),this.#e=n;}},gt=class extends V{static{a(this,"MultiCollectionReferenceField");}type=Kt;#e;get collectionId(){return this.#e.collectionId}constructor(e,t,n){super(e,t,n),this.#e=n;}},Vt=class extends V{static{a(this,"ArrayField");}type=Rt;fields;constructor(e,t,n){super(e,t,n);let o=n.fields[0];this.fields=[new Ne(e,t,o)];}};function kt(i,e,t){return i.map(n=>{switch(n.type){case At:return new nt(e,t,n);case Wt:return new at(e,t,n);case Et:return new ot(e,t,n);case Mt:return new rt(e,t,n);case wt:return new st(e,t,n);case Lt:return new Ne(e,t,n);case Bt:return new lt(e,t,n);case Ut:return new dt(e,t,n);case Ht:return new ut(e,t,n);case $t:return new ve(e,t,n);case Ot:return new ct(e,t,n);case zt:return new pt(e,t,n);case Gt:return new mt(e,t,n);case Kt:return new gt(e,t,n);case Rt:return new Vt(e,t,n);default:return new ve(e,t,n)}})}a(kt,"fieldDefinitionDataArrayToFieldClassInstances");function ma(i){return i instanceof W}a(ma,"isField");var hi="action";function ga(i){return !!i&&hi in i&&c(i[hi])}a(ga,"isLocalizedValueUpdate");function fi(i){return Object.keys(i).reduce((e,t)=>{let n=i[t];return ga(n)&&(e[t]=n),e},{})}a(fi,"filterInlineLocalizationValues");var Ve=class i{static{a(this,"FileAsset");}id;url;extension;constructor(e){this.url=e.url,this.id=e.id,this.extension=e.extension;}static[r.unmarshal](e,t){return new i(t)}[r.marshal](){return {[d]:"FileAsset",id:this.id,url:this.url,extension:this.extension}}};function ya(i){return i instanceof Ve}a(ya,"isFileAsset");var ha="ImageAsset";function Ci(i){return C(i)?i[d]===ha:false}a(Ci,"isImageAssetData");var z=class i{static{a(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[r.unmarshal](e,t){return new i(e,t)}[r.marshal](){return {[d]:"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,{[d]:"ImageAsset",id:this.id,url:this.url,thumbnailUrl:this.thumbnailUrl,altText:e??this.altText,resolution:t??this.resolution})}async measure(){return ba(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 l=new Image;l.onload=()=>n(l),l.onerror=()=>o(),l.src=t;})}};function fa(i){return i instanceof z}a(fa,"isImageAsset");function G(i){return i.type==="bytes"?[i.bytes.buffer]:[]}a(G,"getTransferable");function Ca(i){if(!C(i))return false;let e="bytes",t="mimeType";return !(!(e in i)||!(t in i)||!(i[e]instanceof Uint8Array)||!c(i[t]))}a(Ca,"isBytesData");async function ke(i){if(i instanceof File)return _t(i);let e=await bi(i.image);return {name:i.name,altText:i.altText,resolution:i.resolution,preferredImageRendering:i.preferredImageRendering,...e}}a(ke,"createImageTransferFromInput");async function jt(i){if(i instanceof File)return _t(i);let e=await bi(i.file);return {name:i.name,...e}}a(jt,"createFileTransferFromInput");async function bi(i){return i instanceof File?_t(i):Ca(i)?{type:"bytes",mimeType:i.mimeType,bytes:i.bytes}:{type:"url",url:i}}a(bi,"createAssetTransferFromAssetInput");function qt(i){return Promise.all(i.map(ke))}a(qt,"createNamedAssetDataTransferFromInput");async function _t(i){return new Promise((e,t)=>{let n=new FileReader;n.onload=o=>{let l=i.type,s=o.target?.result;if(!s||!(s instanceof ArrayBuffer)){t(new Error("Failed to read file, arrayBuffer is null"));return}let f=new Uint8Array(s);e({bytes:f,mimeType:l,type:"bytes",name:i.name});},n.onerror=o=>{t(o);},n.readAsArrayBuffer(i);})}a(_t,"getAssetDataFromFile");async function ba(i){let e=i instanceof File,t=e?URL.createObjectURL(i):i,n=new Image;return n.crossOrigin="anonymous",new Promise((o,l)=>{n.onload=()=>{o({width:n.naturalWidth,height:n.naturalHeight});},n.onerror=s=>{l(s);},n.src=t;}).finally(()=>{e&&URL.revokeObjectURL(t);})}a(ba,"measureImage");var yt=class{static{a(this,"ComputedValueBase");}};var Ia="unsupported",Ae=class i extends yt{static{a(this,"UnsupportedComputedValue");}type=Ia;#e;constructor(e){super(),this.#e=e;}static[r.unmarshal](e,t){return new i(t)}[r.marshal](){return this.#e}};function Ta(i){return i instanceof yt}a(Ta,"isComputedValue");var Pa="Font";function Ti(i){return C(i)&&i[d]===Pa}a(Ti,"isFontData");function xa(i){if(!U(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}}a(xa,"isFontWeight");function Fa(i){if(!c(i))return false;switch(i){case "normal":case "italic":return true;default:return false}}a(Fa,"isFontStyle");function Pi(i){return C(i)?c(i.family)&&c(i.selector)&&xa(i.weight)&&Fa(i.style):false}a(Pi,"isFont");var R=class i{static{a(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[r.unmarshal](e,t){let n=Ii.get(t.selector);if(n)return n;let o=new i(t);return Ii.set(t.selector,o),o}[r.marshal](){return {[d]:"Font",selector:this.selector,family:this.family,weight:this.weight,style:this.style}}},Ii=new Map;var Sa="LinearGradient",Da="RadialGradient",Na="ConicGradient",re=class{static{a(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})}},We=class i extends re{static{a(this,"LinearGradient");}[d]=Sa;#e;get angle(){return this.#e.angle}constructor(e){super(e),this.#e=e;}static[r.unmarshal](e,t){return new i({...t,stops:p(e,t.stops)})}[r.marshal](){return E({...this.#e,[d]:this[d]})}toCSS(){let e=this.#e.stops.map(t=>(u(c(t.color),"ColorStyle not supported yet"),`${t.color} ${t.position*100}%`)).join(", ");return `linear-gradient(${this.angle}deg, ${e})`}},Ee=class i extends re{static{a(this,"RadialGradient");}[d]=Da;#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[r.unmarshal](e,t){return new i({...t,stops:p(e,t.stops)})}[r.marshal](){return E({...this.#e,[d]:this[d]})}toCSS(){let e=this.stops.map((t,n)=>{u(c(t.color),"ColorStyle not supported yet");let o=this.stops[n+1],l=t.position===1&&o?.position===1?t.position-1e-4:t.position;return `${t.color} ${l*100}%`}).join(", ");return `radial-gradient(${this.width} ${this.height} at ${this.x} ${this.y}, ${e})`}},Me=class i extends re{static{a(this,"ConicGradient");}[d]=Na;#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[r.unmarshal](e,t){return new i({...t,stops:p(e,t.stops)})}[r.marshal](){return E({...this.#e,[d]:this[d]})}toCSS(){let e=this.stops.map(t=>(u(c(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 re}a(xi,"isGradient");var va="ColorStyle";function ht(i){return C(i)?i[d]===va:false}a(ht,"isColorStyleData");var q=class i{static{a(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[r.unmarshal](e,t){return new i(e,t)}[r.marshal](){return {[d]:"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 se(i){return i instanceof q}a(se,"isColorStyle");var Va="TextStyle";function Fi(i){return C(i)?i[d]===Va:false}a(Fi,"isTextStyleData");var we=class i{static{a(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=R[r.unmarshal](e,t.font),this.boldFont=t.boldFont&&R[r.unmarshal](e,t.boldFont),this.italicFont=t.italicFont&&R[r.unmarshal](e,t.italicFont),this.boldItalicFont=t.boldItalicFont&&R[r.unmarshal](e,t.boldItalicFont),this.color=ht(t.color)?q[r.unmarshal](e,t.color):t.color,this.transform=t.transform,this.alignment=t.alignment,this.decoration=t.decoration,this.decorationColor=ht(t.decorationColor)?q[r.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[r.unmarshal](e,t){return new i(e,t)}[r.marshal](){return {[d]:"TextStyle",id:this.id,name:this.name,path:this.path,tag:this.tag,font:this.font[r.marshal](),boldFont:this.boldFont?.[r.marshal]()??null,italicFont:this.italicFont?.[r.marshal]()??null,boldItalicFont:this.boldItalicFont?.[r.marshal]()??null,color:se(this.color)?this.color[r.marshal]():this.color,transform:this.transform,alignment:this.alignment,decoration:this.decoration,decorationColor:se(this.decorationColor)?this.decorationColor[r.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 Yt(i){return i instanceof we}a(Yt,"isTextStyle");function ka(i){return C(i)&&r.marshal in i}a(ka,"isSelfMarshalable");function E(i){if(ka(i))return i[r.marshal]();if(Ft(i))return i.map(E);if(Je(i)){let e={};for(let t of Object.keys(i))e[t]=E(i[t]);return e}return i}a(E,"marshal");var Si={ColorStyle:q,ConicGradient:Me,FileAsset:Ve,Font:R,ImageAsset:z,LinearGradient:We,RadialGradient:Ee,TextStyle:we,BooleanVariable:ye,BorderVariable:Se,ColorVariable:Ie,DateVariable:Fe,EnumVariable:be,FileVariable:Pe,FormattedTextVariable:Ce,ImageVariable:Te,LinkVariable:xe,NumberVariable:he,StringVariable:fe,UnsupportedVariable:De,UnsupportedComputedValue:Ae};function Aa(i){return Je(i)&&c(i[d])&&i[d]in Si}a(Aa,"isSelfUnmarshalable");function p(i,e){if(Aa(e))return Si[e[d]][r.unmarshal](i,e);if(Ft(e))return e.map(t=>p(i,t));if(Je(e)){let t={};for(let n of Object.keys(e))t[n]=p(i,e[n]);return t}return e}a(p,"unmarshal");var Wa={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 Ea(i){return Wa[i]}a(Ea,"isSupportedArrayItemFieldType");function Ma(i){return Ea(i.type)}a(Ma,"isSupportedArrayItemFieldDataEntry");var At="boolean",Wt="color",Et="number",Mt="string",wt="formattedText",Lt="image",Rt="array",Bt="link",Ut="date",Ot="file",zt="enum",Gt="collectionReference",Kt="multiCollectionReference",Ht="divider",$t="unsupported";function wa(i){return i.map(e=>{if(e.type!=="enum")return e;let t=e.cases.map(n=>{let o=n.nameByLocale?fi(n.nameByLocale):undefined;return {...n,nameByLocale:o}});return {...e,cases:t}})}a(wa,"sanitizeEnumFieldForMessage");function Di(i,e){let t={};for(let n in i){let o=i[n];if(!o)continue;if(o.type!=="array"){t[n]=p(e,o);continue}let l=o.value.map(s=>{let f=Di(s.fieldData,e),b={};for(let P in f){let D=f[P];u(D&&Ma(D),"Unsupported array item field data entry"),b[P]=D;}return {...s,fieldData:b}});t[n]={...o,value:l};}return t}a(Di,"deserializeFieldData");var le=class{static{a(this,"ManagedCollection");}id;name;readonly;managedBy;#e;constructor(e,t){this.id=e.id,this.name=e.name,this.readonly=e.readonly,u(e.managedBy!=="user","Managed Collection can only be managed by a plugin"),this.managedBy=e.managedBy,this.#e=t,h(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=wa(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)}},de=class{static{a(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,h(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 kt(e,this.#e,this.id)}async addFields(e){let t=await this.#e.invoke("addCollectionFields2",this.id,e);return u(t.every(mi)),kt(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 Le(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)}},Le=class i{static{a(this,"CollectionItem");}id;nodeId;slug;slugByLocale;draft;fieldData;#e;constructor(e,t){let n=Di(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,h(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 La={fixed:true,sticky:true,absolute:true,relative:true},Ni="position";function Cr(i){if(!(Ni in i))return false;let e=i[Ni];return c(e)&&La[e]===true}a(Cr,"supportsPosition");var vi="top";function br(i){if(!(vi in i))return false;let e=i[vi];return c(e)||m(e)}a(br,"supportsPins");var Vi="width";function Ir(i){if(!(Vi in i))return false;let e=i[Vi];return c(e)||m(e)}a(Ir,"supportsSize");var ki="maxWidth";function Tr(i){if(!(ki in i))return false;let e=i[ki];return c(e)||m(e)}a(Tr,"supportsSizeConstraints");var Ai="aspectRatio";function Pr(i){if(!(Ai in i))return false;let e=i[Ai];return U(e)||m(e)}a(Pr,"supportsAspectRatio");var Wi="name";function xr(i){if(!(Wi in i))return false;let e=i[Wi];return c(e)||m(e)}a(xr,"supportsName");var Ei="visible";function Fr(i){if(!(Ei in i))return false;let e=i[Ei];return ge(e)}a(Fr,"supportsVisible");var Mi="locked";function Sr(i){if(!(Mi in i))return false;let e=i[Mi];return ge(e)}a(Sr,"supportsLocked");var wi="backgroundColor";function Dr(i){if(!(wi in i))return false;let e=i[wi];return c(e)||se(e)||m(e)}a(Dr,"supportsBackgroundColor");var Li="backgroundColor";function Nr(i){if(!(Li in i))return false;let e=i[Li];return c(e)||ht(e)||m(e)}a(Nr,"supportsBackgroundColorData");var Ri="backgroundImage";function vr(i){if(!(Ri in i))return false;let e=i[Ri];return e instanceof z||m(e)}a(vr,"supportsBackgroundImage");var Bi="backgroundImage";function Vr(i){if(!(Bi in i))return false;let e=i[Bi];return e instanceof z?false:Ci(e)||m(e)}a(Vr,"supportsBackgroundImageData");var Ui="backgroundGradient";function kr(i){if(!(Ui in i))return false;let e=i[Ui];return xi(e)||m(e)}a(kr,"supportsBackgroundGradient");var Oi="backgroundGradient";function Ar(i){if(!(Oi in i))return false;let e=i[Oi];return C(e)||m(e)}a(Ar,"supportsBackgroundGradientData");var zi="rotation";function Wr(i){if(!(zi in i))return false;let e=i[zi];return U(e)}a(Wr,"supportsRotation");var Gi="opacity";function Er(i){if(!(Gi in i))return false;let e=i[Gi];return U(e)}a(Er,"supportsOpacity");var Ki="borderRadius";function Mr(i){if(!(Ki in i))return false;let e=i[Ki];return c(e)||m(e)}a(Mr,"supportsBorderRadius");var Hi="border";function wr(i){if(!(Hi in i))return false;let e=i[Hi];return m(e)||se(e.color)}a(wr,"supportsBorder");var $i="svg";function Lr(i){if(!($i in i))return false;let e=i[$i];return c(e)}a(Lr,"supportsSVG");var ji="textTruncation";function Rr(i){if(!(ji in i))return false;let e=i[ji];return U(e)||m(e)}a(Rr,"supportsTextTruncation");var qi="zIndex";function Br(i){if(!(qi in i))return false;let e=i[qi];return U(e)||m(e)}a(Br,"supportsZIndex");var _i="overflow";function Ur(i){if(!(_i in i))return false;let e=i[_i];return c(e)||m(e)}a(Ur,"supportsOverflow");var Yi="componentIdentifier";function Or(i){if(!(Yi in i))return false;let e=i[Yi];return c(e)}a(Or,"supportsComponentInfo");var Xi="font";function zr(i){if(!(Xi in i))return false;let e=i[Xi];return Pi(e)}a(zr,"supportsFont");var Zi="font";function Gr(i){if(!(Zi in i))return false;let e=i[Zi];return Ti(e)||m(e)}a(Gr,"supportsFontData");var Ji="inlineTextStyle";function Kr(i){if(!(Ji in i))return false;let e=i[Ji];return Yt(e)||m(e)}a(Kr,"supportsInlineTextStyle");var Qi="inlineTextStyle";function Hr(i){if(!(Qi in i))return false;let e=i[Qi];return Fi(e)||m(e)}a(Hr,"supportsInlineTextStyleData");var en="link";function $r(i){if(!(en in i))return false;let e=i[en];return c(e)||m(e)}a($r,"supportsLink");var tn="imageRendering";function jr(i){if(!(tn in i))return false;let e=i[tn];return c(e)||m(e)}a(jr,"supportsImageRendering");var nn="layout";function rn(i){if(!(nn in i))return false;let e=i[nn];return c(e)||m(e)}a(rn,"supportsLayout");function qr(i){return rn(i)?i.layout==="stack":false}a(qr,"hasStackLayout");function _r(i){return rn(i)?i.layout==="grid":false}a(_r,"hasGridLayout");var an="isVariant";function sn(i){if(!(an in i))return false;let e=i[an];return ge(e)}a(sn,"supportsComponentVariant");function Xt(i){return sn(i)?i.isVariant:false}a(Xt,"isComponentVariant");function ln(i){return !sn(i)||!Xt(i)?false:!m(i.gesture)}a(ln,"isComponentGestureVariant");var on="isBreakpoint";function Ra(i){if(!(on in i))return false;let e=i[on];return ge(e)}a(Ra,"supportsBreakpoint");function dn(i){return Ra(i)?i.isBreakpoint:false}a(dn,"isBreakpoint");var v=class{static{a(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[d]==="UnknownNode")throw Error("Can not clone unknown node");return this.#e.cloneNode(this.id)}async setAttributes(e){if(this[d]==="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 _(this)?Promise.resolve([]):this.#e.getChildren(this.id)}async getNodesWithType(e){return _(this)?Promise.resolve([]):(await this.#e.invoke("getNodesWithType",this.id,e)).map(n=>g(n,this.#e))}async getNodesWithAttribute(e){return _(this)?Promise.resolve([]):(await this.#e.invoke("getNodesWithAttribute",this.id,e)).map(n=>g(n,this.#e))}async getNodesWithAttributeSet(e){return _(this)?Promise.resolve([]):(await this.#e.invoke("getNodesWithAttributeSet",this.id,e)).map(n=>g(n,this.#e))}async*walk(){if(yield this,!_(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)}},M=class extends v{static{a(this,"FrameNode");}[d]="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=p(t,e.backgroundColor)??null,this.backgroundImage=p(t,e.backgroundImage)??null,this.rotation=e.rotation??0,this.opacity=e.opacity??1,this.borderRadius=e.borderRadius??null,this.border=p(t,e.border)??null,this.backgroundGradient=p(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,h(this);}},Y=class extends v{static{a(this,"TextNode");}[d]="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=p(t,e.font)??null,this.inlineTextStyle=p(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,h(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(oe,this.id,e),await new Promise(t=>{setTimeout(t,30);});}async getHTML(){return this.#e.invoke(ae,this.id)}},Re=class extends v{static{a(this,"SVGNode");}[d]="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,h(this);}},Be=class extends v{static{a(this,"VectorSetItemNode");}[d]="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,h(this);}async getSVG(){return this.#e.invoke("getSVGForNode",this.id)}},Ue=class extends v{static{a(this,"ComponentInstanceNode");}[d]="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=p(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=p(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,h(this);}async getRuntimeError(){return this.#e.invoke("getRuntimeErrorForCodeComponentNode",this.id)}},X=class extends v{static{a(this,"WebPageNode");}[d]="WebPageNode";#e;path;collectionId;constructor(e,t){super(e,t),this.path=e.path??null,this.collectionId=e.collectionId??null,this.#e=t,h(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=g(n,this.#e);return u(o instanceof M),u(dn(o),"Expected node to be a FrameNode"),o}async getActiveCollectionItem(){let e=await this.#e.invoke("getActiveCollectionItemForWebPage",this.id);return e?new Le(e,this.#e):null}},Z=class extends v{static{a(this,"ComponentNode");}[d]="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,h(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=g(n,this.#e);return u(o instanceof M),u(Xt(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 l=g(o,this.#e);return u(l instanceof M),u(ln(l),"Node is not a gesture variant"),l}async getVariables(){let e=await this.#e.invoke("getVariables",this.id);return p(this.#e,e)}async addVariables(e){let t=await this.#e.invoke("addVariables",this.id,E(e));return p(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);}},Oe=class extends v{static{a(this,"VectorSetNode");}[d]="VectorSetNode";name;constructor(e,t){super(e,t),this.name=e.name??null,h(this);}},J=class extends v{static{a(this,"DesignPageNode");}[d]="DesignPageNode";name;constructor(e,t){super(e,t),this.name=e.name??null,h(this);}},ze=class extends v{static{a(this,"UnknownNode");}[d]="UnknownNode";constructor(e,t){super(e,t),h(this);}};function g(i,e){switch(i[d]){case "DesignPageNode":return new J(i,e);case "WebPageNode":return new X(i,e);case "ComponentNode":return new Z(i,e);case "VectorSetNode":return new Oe(i,e);case "VectorSetItemNode":return new Be(i,e);case "ComponentInstanceNode":return new Ue(i,e);case "FrameNode":return new M(i,e);case "SVGNode":return new Re(i,e);case "TextNode":return new Y(i,e);case "UnknownNode":return new ze(i,e);default:return new ze(i,e)}}a(g,"convertRawNodeDataToNode");function ft(i){return i instanceof M}a(ft,"isFrameNode");function un(i){return i instanceof Y}a(un,"isTextNode");function cn(i){return i instanceof Re}a(cn,"isSVGNode");function ue(i){return i instanceof Ue}a(ue,"isComponentInstanceNode");function pn(i){return i instanceof X}a(pn,"isWebPageNode");function mn(i){return i instanceof Z}a(mn,"isComponentNode");function gn(i){return i instanceof J}a(gn,"isDesignPageNode");function yn(i){return i instanceof Oe}a(yn,"isVectorSetNode");function hn(i){return i instanceof Be}a(hn,"isVectorSetItemNode");function _(i){return i instanceof ze}a(_,"isUnknownNode");function Ge(i){return !!(ft(i)||un(i)||ue(i)||cn(i)||hn(i)||_(i))}a(Ge,"isCanvasNode");function Zt(i){return !!(pn(i)||gn(i)||mn(i)||yn(i)||_(i))}a(Zt,"isCanvasRootNode");var Ke=class{static{a(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 Ct(t,this.#e))}},Ct=class{static{a(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 He=class extends Error{static{a(this,"FramerPluginError");}name=this.constructor.name},K=class extends Error{static{a(this,"FramerPluginClosedError");}name=this.constructor.name};function Ba(i){return i.type==="separator"}a(Ba,"isSeparatorMenuItem");function bt(i,e){let t=[];for(let n of i){if(Ba(n)){t.push(n);continue}let{onAction:o,...l}=n,s=l;if(n.onAction){let f=Math.random();e.set(f,n.onAction),s.actionId=f;}n.submenu&&(s.submenu=bt(n.submenu,e)),t.push(s);}return t}a(bt,"addMenuItemsToOnActionCallbackMap");var It="type",fn={[It]:"pluginReadySignal"},Oa="pluginReadyResponse";var za={methodResponse:true,subscriptionMessage:true,permissionUpdate:true,menuAction:true};function Cn(i){return C(i)&&c(i[It])&&i[It]in za}a(Cn,"isVekterToPluginNonHandshakeMessage");function bn(i){return C(i)&&i[It]===Oa}a(bn,"isPluginReadyResponse");var Ga=["unstable_getCodeFile","unstable_getCodeFiles","unstable_getCodeFileVersionContent","unstable_getCodeFileLint2","unstable_getCodeFileTypecheck2","unstable_getCodeFileVersions"],Ka=["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","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","getChangedPagePaths","getChangeAuthors",tt,it,ae,"getAiServiceInfo","sendTrackingEvent",...Ga];new Set(Ka);var Jt={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:[],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":[oe],"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"],publish:["publish"],getChangedPagePaths:[],getChangeAuthors:[],createManagedCollection:["createManagedCollection"],[St]:[],[Dt]:[],[Nt]:[],[vt]:[]},Tt=[];for(let i of Object.keys(Jt))Jt[i].length!==0&&Tt.push(i);h(Tt);function Qt(i){let e={};for(let t of Tt){let n=Jt[t];e[t]=n.every(o=>i[o]);}return e}a(Qt,"createPerMethodPermissionMap");function In(){let i={};for(let e of Tt)i[e]=true;return i}a(In,"createPerMethodPermissionMapForTesting");var ce=null;function Tn(i){if(typeof window>"u")return;if(!ce){let t=document.createElement("style");document.head.appendChild(t),ce=t.sheet;}if(!ce){i();return}let e=ce.insertRule("* { transition: none !important; animation: none !important; }");i(),requestAnimationFrame(()=>{requestAnimationFrame(()=>{ce&&ce.deleteRule(e);});});}a(Tn,"withDisabledCssTransitions");var $e=class{static{a(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=In();return}switch(e.transport.onMessage(this.onMessage),typeof window<"u"&&(window.addEventListener("error",t=>{t.error instanceof K&&(t.preventDefault(),t.stopImmediatePropagation());}),window.addEventListener("unhandledrejection",t=>{t.reason instanceof K&&(t.preventDefault(),t.stopImmediatePropagation());})),this.mode=e.mode,this.environmentInfo=e.environmentInfo,this.perMethodPermissionMap=Qt(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:Qe(this.mode);}}async invoke(e,...t){return this.invokeTransferable(e,undefined,...t)}async invokeTransferable(e,t,...n){return new Promise((o,l)=>{let s={type:"methodInvocation",methodName:e,id:this.methodInvocationId,args:n.map(E)};this.methodInvocationId+=1,this.methodResponseHandlers.set(s.id,{resolve:o,reject:l}),this.postMessage(s,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(Cn(t))switch(t.type){case "permissionUpdate":{this.perMethodPermissionMap=Qt(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),c(t.error)?n.reject(new He(t.error)):n.resolve(t.result);break}case "subscriptionMessage":{let{topic:n,payload:o}=t,l=this.subscriptions.get(n);if(!l)throw new Error("Received a subscription message but no handler present");for(let s of l)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:Qe(t);}};getOnActionFromCallbackMap(e,t){switch(t){case "pluginMenu":return this.menuItemOnActionCallbackMap.get(e);case "contextMenu":return this.contextMenuItemOnActionCallbackMap.get(e);default:Qe(t);}}applyPluginTheme=e=>{Tn(()=>{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?g(t,this):null}async setAttributes(e,t){let n=await this.invoke("setAttributes",e,t);return n?g(n,this):null}async getParent(e){let t=await this.invoke("getParent",e);return t?g(t,this):null}async getChildren(e){return (await this.invoke("getChildren",e)).map(n=>{let o=g(n,this);return u(Ge(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=bt(e,this.menuItemOnActionCallbackMap);await this.invoke("setMenu",t);}async showContextMenu(e,t){this.contextMenuItemOnActionCallbackMap=new Map;let n=bt(e,this.contextMenuItemOnActionCallbackMap);await this.invoke("showContextMenu",n,t);}};function Ha(i){return i.type==="component"}a(Ha,"isCodeFileComponentExport");function $a(i){return i.type==="override"}a($a,"isCodeFileOverrideExport");var ei=class{static{a(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)}},H=class i{static{a(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 ei(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 Pt=class i{static{a(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=g(n,this.#t);return u(ue(o)),o}};var ja=(()=>{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=a(()=>{i&&(document.head.removeChild(i),i=null,o());},"enablePointerEvents"),t=a(l=>{l.buttons>0&&l.buttons&1||e();},"handlePointerChange"),n=a(()=>{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);}a(o,"cleanup");}}})(),Pn=5,qa=(()=>{let i=1;return {next:()=>`drag-${i++}`}})();function _a(){}a(_a,"noop");function xn(i,e,t,n){if(i.mode!=="canvas")return _a;let o=qa.next(),l=document.body.style.cursor,s={type:"idle"},f=document.body,b=Q.subscribeToIsAllowedTo("makeDraggable",y=>{y||te();}),P=a(y=>{Q.isAllowedTo("makeDraggable")&&s.type!=="idle"&&(s.type==="dragging"&&i.invoke("onDragEnd",{...y,dragSessionId:o}).then(I=>{try{n?.(I);}catch{}}).catch(I=>{if(I instanceof Error){n?.({status:"error",reason:I.message});return}if(typeof I=="string"){n?.({status:"error",reason:I});return}n?.({status:"error"});}),te());},"endDrag"),D=a(y=>{if(!Q.isAllowedTo("makeDraggable")||s.type==="idle")return;if(!(y.buttons>0&&!!(y.buttons&1))){P({cancelled:false});return}let{clientX:B,clientY:$}=y;if(s.type==="pointerDown"){let ne=B-s.dragStart.mouse.x,j=$-s.dragStart.mouse.y;if(Math.abs(ne)<Pn&&Math.abs(j)<Pn)return;s={type:"dragging",dragStart:s.dragStart},i.invoke("onDragStart",s.dragStart),document.getSelection()?.empty(),ja.disableUntilMouseUp();}f.setPointerCapture(y.pointerId);let ie={x:B,y:$};i.invoke("onDrag",{dragSessionId:o,mouse:ie}).then(ne=>{s.type==="dragging"&&(document.body.style.cursor=ne??"");});},"handlePointerChange"),xt=a(y=>{y.key==="Escape"&&P({cancelled:true});},"handleKeyDown"),Xe=a(()=>{P({cancelled:true});},"handleBlur"),w=a(y=>{if(!Q.isAllowedTo("makeDraggable"))return;P({cancelled:true});let I=e.getBoundingClientRect(),B={x:I.x,y:I.y,width:I.width,height:I.height},$,ie=e.querySelectorAll("svg");if(ie.length===1){let x=ie.item(0).getBoundingClientRect();$={x:x.x,y:x.y,width:x.width,height:x.height};}let ne={x:y.clientX,y:y.clientY};s={type:"pointerDown",dragStart:{dragSessionId:o,elementRect:B,svgRect:$,mouse:ne}},i.invoke("setDragData",o,t()),f.addEventListener("pointermove",D,true),f.addEventListener("pointerup",D,true),window.addEventListener("keydown",xt,true),window.addEventListener("blur",Xe);},"handlePointerDown"),L=a(()=>{if(!Q.isAllowedTo("makeDraggable"))return;let y=t();y.type==="detachedComponentLayers"&&i.invoke("preloadDetachedComponentLayers",y.url),y.type==="image"&&i.invoke("preloadImageUrlForInsertion",y.image),y.previewImage&&i.invoke("preloadDragPreviewImage",y.previewImage);},"preload");e.addEventListener("pointerdown",w),e.addEventListener("mouseenter",L);function te(){s={type:"idle"},document.body.style.cursor=l,f.removeEventListener("pointermove",D,true),f.removeEventListener("pointerup",D,true),window.removeEventListener("keydown",xt,true),window.removeEventListener("blur",Xe);}return a(te,"dragCleanup"),()=>{e.removeEventListener("pointerdown",w),e.removeEventListener("mouseenter",L),P({cancelled:true}),b();}}a(xn,"makeDraggable");var pe=class i{static{a(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 u(Ze(n)),m(n)?null:new i(n,this.#t)}};var ti=class{static{a(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]=gi(e),o=this.isAllowedTo(...t),l=a(()=>{let s=this.isAllowedTo(...t);s!==o&&(o=s,n(o));},"update");return this.#e.permissionSubscriptions.add(l),()=>{this.#e.permissionSubscriptions.delete(l);}}async showUI(e){return this.#e.invoke("showUI",e)}async hideUI(){return this.#e.invoke("hideUI")}closePlugin(e,t){throw this.#e.invoke("closePlugin",e,t),new K}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=g(t,this.#e);return u(Ge(n)),n})}async setSelection(e){let t=c(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 l=g(o,this.#e);return u(Ge(l)),l});e(n);})}async getCanvasRoot(){let e=await this.#e.invoke("getCanvasRoot"),t=g(e,this.#e);return u(Zt(t)),t}subscribeToCanvasRoot(e){return this.#e.subscribe("canvasRoot",t=>{let n=g(t,this.#e);u(Zt(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=g(n,this.#e);return u(o instanceof M),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?g(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=c(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=>g(n,this.#e))}async getNodesWithAttribute(e){return (await this.#e.invoke("getNodesWithAttribute",null,e)).map(n=>g(n,this.#e))}async getNodesWithAttributeSet(e){return (await this.#e.invoke("getNodesWithAttributeSet",null,e)).map(n=>g(n,this.#e))}async getImage(){let e=await this.#e.invoke("getImage");return e?p(this.#e,e):null}subscribeToImage(e){return this.#e.subscribe("image",t=>{if(!t){e(null);return}e(p(this.#e,t));})}async addImage(e){let t=await ke(e),n=G(t);return this.#e.invokeTransferable("addImage",n,t)}async setImage(e){let t=await ke(e),n=G(t);return this.#e.invokeTransferable("setImage",n,t)}async uploadImage(e){let t=await ke(e),n=G(t),o=await this.#e.invokeTransferable("uploadImage",n,t);return p(this.#e,o)}async addImages(e){let t=await qt(e),n=t.flatMap(G);await this.#e.invokeTransferable("addImages",n,t);}async uploadImages(e){let t=await qt(e),n=t.flatMap(G),o=await this.#e.invokeTransferable("uploadImages",n,t);return p(this.#e,o)}async uploadFile(e){let t=await jt(e),n=await this.#e.invokeTransferable("uploadFile",G(t),t);return p(this.#e,n)}async uploadFiles(e){let t=await Promise.all(e.map(jt)),n=t.flatMap(G),o=await this.#e.invokeTransferable("uploadFiles",n,t);return p(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}),l=g(o,this.#e);return u(ue(l)),l}async addDetachedComponentLayers({url:e,layout:t,attributes:n}){let o=await this.#e.invoke("addDetachedComponentLayers",{url:e,layout:t,attributes:n}),l=g(o,this.#e);return u(ft(l)),l}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 u(e,"Collection data must be defined"),new le(e,this.#e)}async getManagedCollection(){return this.getActiveManagedCollection()}async getManagedCollections(){let e=await this.#e.invoke("getManagedCollections");return u(e,"Collections data must be defined"),e.map(t=>new le(t,this.#e))}async getCollection(e){let t=await this.#e.invoke("getCollection",e);return t?new de(t,this.#e):null}async getActiveCollection(){let e=await this.#e.invoke("getActiveCollection");return e?new de(e,this.#e):null}async getCollections(){return (await this.#e.invoke("getCollections")).map(t=>new de(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 p(this.#e,e)}async getColorStyle(e){let t=await this.#e.invoke("getColorStyle",e);return t?p(this.#e,t):null}async createColorStyle(e){let t=await this.#e.invoke("createColorStyle",e);return p(this.#e,t)}subscribeToColorStyles(e){return this.#e.subscribe("colorStyles",t=>{let n=p(this.#e,t);return e(n)})}async getTextStyles(){let e=await this.#e.invoke("getTextStyles");return p(this.#e,e)}async getTextStyle(e){let t=await this.#e.invoke("getTextStyle",e);return t?p(this.#e,t):null}async createTextStyle(e){let t=await this.#e.invoke("createTextStyle",e);return p(this.#e,t)}subscribeToTextStyles(e){return this.#e.subscribe("textStyles",t=>{let n=p(this.#e,t);return e(n)})}async getFont(e,t){let n=await this.#e.invoke("getFont",e,t);return n?p(this.#e,n):null}async getFonts(){let e=await this.#e.invoke("getFonts");return p(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 pe(t,this.#e))}subscribeToRedirects(e){return this.#e.subscribe("redirects",t=>{let n=t.map(o=>new pe(o,this.#e));return e(n)})}async addRedirects(e){return (await this.#e.invoke("addRedirects",e)).map(n=>new pe(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){let n=await this.#e.invoke("createCodeFile",e,t);return new H(n,this.#e)}async getCodeFiles(){let e=await this.#e.invoke("getCodeFiles"),t=[];for(let n of e)t.push(new H(n,this.#e));return t}async getCodeFile(e){let t=await this.#e.invoke("getCodeFile",e);return t?new H(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 H(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 H(t,this.#e):null;return e(n)})}async createDesignPage(e){let t=await this.#e.invoke("createDesignPage",e),n=g(t,this.#e);return u(n instanceof J,"Expected node to be a DesignPageNode"),n}async createWebPage(e){let t=await this.#e.invoke("createWebPage",e),n=g(t,this.#e);return u(n instanceof X,"Expected node to be a WebPageNode"),n}},ii=class extends ti{static{a(this,"FramerPluginAPIBeta");}},je=class extends ii{static{a(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 Pt(t,this.#e)}async[r.getAiServiceInfo](){return this.#e.invoke(tt)}async[r.sendTrackingEvent](e,t,n){return this.#e.invoke(it,e,t,n)}async[r.getHTMLForNode](e){return this.#e.invoke(ae,e)}async[r.setHTMLForNode](e,t){return this.#e.invoke(oe,e,t)}get[r.environmentInfo](){return this.#e.environmentInfo}get[r.showUncheckedPermissionToasts](){return this.#e.showUncheckedPermissionToasts}set[r.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=g(n,this.#e);return u(o instanceof Y),o}async createComponentNode(e){let t=await this.#e.invoke("createNode","ComponentNode",null,{name:e});if(!t)return null;let n=g(t,this.#e);return u(n instanceof Z),n}async getVectorSets(){return (await this.#e.invoke("getVectorSets")).map(t=>new Ke(t,this.#e))}async publish(){return this.#e.invoke("publish")}async getChangedPagePaths(e,t){return this.#e.invoke("getChangedPagePaths",e,t)}async getChangeAuthors(e,t){return this.#e.invoke("getChangeAuthors",e,t)}async createManagedCollection(e){let t=await this.#e.invoke("createManagedCollection",e);return new le(t,this.#e)}};var ni=class{constructor(e){this.origin=e;}static{a(this,"IframeTransport");}send(e,t){window.parent.postMessage(e,this.origin,t);}onMessage(e){window.addEventListener("message",e);}};async function Ya(){return new Promise(i=>{function e({data:t,origin:n}){if(!bn(t))return;window.removeEventListener("message",e);let l={transport:new ni(n),mode:t.mode,permissionMap:t.permissionMap,environmentInfo:t.environmentInfo,origin:n,theme:t.theme??null};i(l);}a(e,"handshakeListener"),window.addEventListener("message",e),window.parent.postMessage(fn,"*");})}a(Ya,"createBrowserContext");async function Xa(){return typeof window<"u"?Ya():null}a(Xa,"bootstrap");var Fn=await Xa(),Q=Fn?new je(new $e(Fn)):new Proxy({},{get(i,e){throw new Error(`Cannot access framer.${String(e)} in server runtime. Use createFramerInstance() with a custom transport.`)}});function Sn(i){return new je(new $e(i))}a(Sn,"createFramerInstance");var Qa=Ja,Dn=Qa.env;function eo(i){Object.assign(Dn,i);}a(eo,"configure");function qe(i,e){return Dn[i]??e}a(qe,"getEnv");var Nn=typeof globalThis.WebSocket<"u"?globalThis.WebSocket:WebSocket;function ai(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 P(i){for(let e of Reflect.ownKeys(i)){let t=i[e];!t||typeof t!="object"&&!br(t)||P(t);}return Object.freeze(i)}r(P,"deepFreeze");function Mi(i){return [i.slice(0,-1),i.at(-1)]}r(Mi,"splitRestAndLast");var c="__class";var Rt=Symbol(),Bt=Symbol(),xr=Symbol(),Ir=Symbol(),Cr=Symbol(),Tr=Symbol(),Ut=Symbol(),Ot=Symbol(),l={getAiServiceInfo:Rt,sendTrackingEvent:Bt,environmentInfo:xr,showUncheckedPermissionToasts:Ir,marshal:Cr,unmarshal:Tr,getHTMLForNode:Ut,setHTMLForNode:Ot},lt="INTERNAL_",dt=`${lt}getAiServiceInfo`,ut=`${lt}sendTrackingEvent`,oe=`${lt}getHTMLForNode`,ae=`${lt}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(b(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(!Ni(e)),`${e.toLowerCase()}${i.slice(1,-M.length)}`}r(E,"classToType");var Pr=`Boolean${M}`,Sr=E(Pr),be=class i extends N{static{r(this,"BooleanVariable");}type=Sr;#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}},Fr=`Number${M}`,Dr=E(Fr),xe=class i extends N{static{r(this,"NumberVariable");}type=Dr;#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}},vr=`String${M}`,Nr=E(vr),Ie=class i extends N{static{r(this,"StringVariable");}type=Nr;#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}},kr=`FormattedText${M}`,Mr=E(kr),Ce=class i extends N{static{r(this,"FormattedTextVariable");}type=Mr;#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}},Er=`Enum${M}`,Vr=E(Er),K=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);}},Te=class i extends N{static{r(this,"EnumVariable");}type=Vr;#e;#t;#i;get cases(){return this.#i||(this.#i=P(this.#t.cases.map(e=>new K(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 K(this.#e,this.nodeId,this.id,t):null}async setCaseOrder(e){await this.#e.invoke("setEnumCaseOrder",this.nodeId,this.id,e);}},Ar=`Color${M}`,wr=E(Ar),Pe=class i extends N{static{r(this,"ColorVariable");}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}},Wr=`Image${M}`,Lr=E(Wr),Se=class i extends N{static{r(this,"ImageVariable");}type=Lr;#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}},Rr=`File${M}`,Br=E(Rr),Fe=class i extends N{static{r(this,"FileVariable");}type=Br;#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}},Ur=`Link${M}`,Or=E(Ur),De=class i extends N{static{r(this,"LinkVariable");}type=Or;#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}},zr=`Date${M}`,Gr=E(zr),ve=class i extends N{static{r(this,"DateVariable");}type=Gr;#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}},Kr=`Border${M}`,$r=E(Kr),Ne=class i extends N{static{r(this,"BorderVariable");}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}},Hr=`Unsupported${M}`,jr=E(Hr),ke=class i extends N{static{r(this,"UnsupportedVariable");}type=jr;#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 Ei(i){return i instanceof N}r(Ei,"isVariable");function _r(i){return Ei(i)&&i.nodeType==="component"}r(_r,"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(ot(n)),b(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;}},ct=class extends W{static{r(this,"BooleanField");}type=Kt},pt=class extends W{static{r(this,"ColorField");}type=$t},mt=class extends W{static{r(this,"NumberField");}type=Ht},gt=class extends A{static{r(this,"StringField");}type=jt;#e;constructor(e,t,n){super(e,t,n),this.#e=n;}get basedOn(){return this.#e.basedOn}},ft=class extends A{static{r(this,"FormattedTextField");}type=_t},Me=class extends A{static{r(this,"ImageField");}type=qt},yt=class extends A{static{r(this,"LinkField");}type=Xt},ht=class extends A{static{r(this,"DateField");}type=Zt},bt=class extends W{static{r(this,"FieldDivider");}type=ii},Ee=class extends W{static{r(this,"UnsupportedField");}type=ni},xt=class extends A{static{r(this,"FileField");}type=Jt;#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=Qt;#e;#t;#i;#n;get cases(){return this.#n||(this.#n=this.#i.cases.map(e=>new K(this.#e,this.#t,this.id,e)),P(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 K(this.#e,this.#t,this.id,t):null}async setCaseOrder(e){await this.#e.invoke("setEnumCaseOrder",this.#t,this.id,e);}},Ct=class extends A{static{r(this,"CollectionReferenceField");}type=ei;#e;get collectionId(){return this.#e.collectionId}constructor(e,t,n){super(e,t,n),this.#e=n;}},Tt=class extends A{static{r(this,"MultiCollectionReferenceField");}type=ti;#e;get collectionId(){return this.#e.collectionId}constructor(e,t,n){super(e,t,n),this.#e=n;}},zt=class extends A{static{r(this,"ArrayField");}type=Yt;fields;constructor(e,t,n){super(e,t,n);let o=n.fields[0];this.fields=[new Me(e,t,o)];}};function Gt(i,e,t){return i.map(n=>{switch(n.type){case Kt:return new ct(e,t,n);case $t:return new pt(e,t,n);case Ht:return new mt(e,t,n);case jt:return new gt(e,t,n);case _t:return new ft(e,t,n);case qt:return new Me(e,t,n);case Xt:return new yt(e,t,n);case Zt:return new ht(e,t,n);case ii:return new bt(e,t,n);case ni:return new Ee(e,t,n);case Jt:return new xt(e,t,n);case Qt:return new It(e,t,n);case ei:return new Ct(e,t,n);case ti:return new Tt(e,t,n);case Yt:return new zt(e,t,n);default:return new Ee(e,t,n)}})}r(Gt,"fieldDefinitionDataArrayToFieldClassInstances");function qr(i){return i instanceof W}r(qr,"isField");var Vi="action";function Yr(i){return !!i&&Vi in i&&g(i[Vi])}r(Yr,"isLocalizedValueUpdate");function Ai(i){return Object.keys(i).reduce((e,t)=>{let n=i[t];return Yr(n)&&(e[t]=n),e},{})}r(Ai,"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 Xr(i){return i instanceof Ve}r(Xr,"isFileAsset");var Zr="ImageAsset";function wi(i){return v(i)?i[c]===Zr:false}r(wi,"isImageAssetData");var $=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 eo(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 Jr(i){return i instanceof $}r(Jr,"isImageAsset");function H(i){return i.type==="bytes"?[i.bytes.buffer]:[]}r(H,"getTransferable");function Qr(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(Qr,"isBytesData");async function Ae(i){if(i instanceof File)return ai(i);let e=await Wi(i.image);return {name:i.name,altText:i.altText,resolution:i.resolution,preferredImageRendering:i.preferredImageRendering,...e}}r(Ae,"createImageTransferFromInput");async function ri(i){if(i instanceof File)return ai(i);let e=await Wi(i.file);return {name:i.name,...e}}r(ri,"createFileTransferFromInput");async function Wi(i){return i instanceof File?ai(i):Qr(i)?{type:"bytes",mimeType:i.mimeType,bytes:i.bytes}:{type:"url",url:i}}r(Wi,"createAssetTransferFromAssetInput");function oi(i){return Promise.all(i.map(Ae))}r(oi,"createNamedAssetDataTransferFromInput");async function ai(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 u=new Uint8Array(s);e({bytes:u,mimeType:a,type:"bytes",name:i.name});},n.onerror=o=>{t(o);},n.readAsArrayBuffer(i);})}r(ai,"getAssetDataFromFile");async function eo(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(eo,"measureImage");var Pt=class{static{r(this,"ComputedValueBase");}};var to="unsupported",we=class i extends Pt{static{r(this,"UnsupportedComputedValue");}type=to;#e;constructor(e){super(),this.#e=e;}static[l.unmarshal](e,t){return new i(t)}[l.marshal](){return this.#e}};function io(i){return i instanceof Pt}r(io,"isComputedValue");var no="Font";function Ri(i){return v(i)&&i[c]===no}r(Ri,"isFontData");function ro(i){if(!G(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(ro,"isFontWeight");function oo(i){if(!g(i))return false;switch(i){case "normal":case "italic":return true;default:return false}}r(oo,"isFontStyle");function Bi(i){return v(i)?g(i.family)&&g(i.selector)&&ro(i.weight)&&oo(i.style):false}r(Bi,"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=Li.get(t.selector);if(n)return n;let o=new i(t);return Li.set(t.selector,o),o}[l.marshal](){return {[c]:"Font",selector:this.selector,family:this.family,weight:this.weight,style:this.style}}},Li=new Map;var ao="LinearGradient",so="RadialGradient",lo="ConicGradient",se=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})}},We=class i extends se{static{r(this,"LinearGradient");}[c]=ao;#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})`}},Le=class i extends se{static{r(this,"RadialGradient");}[c]=so;#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})`}},Re=class i extends se{static{r(this,"ConicGradient");}[c]=lo;#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 Ui(i){return i instanceof se}r(Ui,"isGradient");var uo="ColorStyle";function St(i){return v(i)?i[c]===uo:false}r(St,"isColorStyleData");var X=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 le(i){return i instanceof X}r(le,"isColorStyle");var co="TextStyle";function Oi(i){return v(i)?i[c]===co:false}r(Oi,"isTextStyleData");var Be=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=St(t.color)?X[l.unmarshal](e,t.color):t.color,this.transform=t.transform,this.alignment=t.alignment,this.decoration=t.decoration,this.decorationColor=St(t.decorationColor)?X[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:le(this.color)?this.color[l.marshal]():this.color,transform:this.transform,alignment:this.alignment,decoration:this.decoration,decorationColor:le(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 si(i){return i instanceof Be}r(si,"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(Lt(i))return i.map(L);if(at(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:X,ConicGradient:Re,FileAsset:Ve,Font:U,ImageAsset:$,LinearGradient:We,RadialGradient:Le,TextStyle:Be,BooleanVariable:be,BorderVariable:Ne,ColorVariable:Pe,DateVariable:ve,EnumVariable:Te,FileVariable:Fe,FormattedTextVariable:Ce,ImageVariable:Se,LinkVariable:De,NumberVariable:xe,StringVariable:Ie,UnsupportedVariable:ke,UnsupportedComputedValue:we};function mo(i){return at(i)&&g(i[c])&&i[c]in zi}r(mo,"isSelfUnmarshalable");function h(i,e){if(mo(e))return zi[e[c]][l.unmarshal](i,e);if(Lt(e))return e.map(t=>h(i,t));if(at(e)){let t={};for(let n of Object.keys(e))t[n]=h(i,e[n]);return t}return e}r(h,"unmarshal");var go={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 fo(i){return go[i]}r(fo,"isSupportedArrayItemFieldType");function yo(i){return fo(i.type)}r(yo,"isSupportedArrayItemFieldDataEntry");var Kt="boolean",$t="color",Ht="number",jt="string",_t="formattedText",qt="image",Yt="array",Xt="link",Zt="date",Jt="file",Qt="enum",ei="collectionReference",ti="multiCollectionReference",ii="divider",ni="unsupported";function ho(i){return i.map(e=>{if(e.type!=="enum")return e;let t=e.cases.map(n=>{let o=n.nameByLocale?Ai(n.nameByLocale):undefined;return {...n,nameByLocale:o}});return {...e,cases:t}})}r(ho,"sanitizeEnumFieldForMessage");function Gi(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 u=Gi(s.fieldData,e),C={};for(let I in u){let D=u[I];m(D&&yo(D),"Unsupported array item field data entry"),C[I]=D;}return {...s,fieldData:C}});t[n]={...o,value:a};}return t}r(Gi,"deserializeFieldData");var de=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,P(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=ho(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)}},ue=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,P(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 Gt(e,this.#e,this.id)}async addFields(e){let t=await this.#e.invoke("addCollectionFields2",this.id,e);return m(t.every(ki)),Gt(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 Ue(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)}},Ue=class i{static{r(this,"CollectionItem");}id;nodeId;slug;slugByLocale;draft;fieldData;#e;constructor(e,t){let n=Gi(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,P(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 bo={fixed:true,sticky:true,absolute:true,relative:true},Ki="position";function Ps(i){if(!(Ki in i))return false;let e=i[Ki];return g(e)&&bo[e]===true}r(Ps,"supportsPosition");var $i="top";function Ss(i){if(!($i in i))return false;let e=i[$i];return g(e)||b(e)}r(Ss,"supportsPins");var Hi="width";function Fs(i){if(!(Hi in i))return false;let e=i[Hi];return g(e)||b(e)}r(Fs,"supportsSize");var ji="maxWidth";function Ds(i){if(!(ji in i))return false;let e=i[ji];return g(e)||b(e)}r(Ds,"supportsSizeConstraints");var _i="aspectRatio";function vs(i){if(!(_i in i))return false;let e=i[_i];return G(e)||b(e)}r(vs,"supportsAspectRatio");var qi="name";function Ns(i){if(!(qi in i))return false;let e=i[qi];return g(e)||b(e)}r(Ns,"supportsName");var Yi="visible";function ks(i){if(!(Yi in i))return false;let e=i[Yi];return he(e)}r(ks,"supportsVisible");var Xi="locked";function Ms(i){if(!(Xi in i))return false;let e=i[Xi];return he(e)}r(Ms,"supportsLocked");var Zi="backgroundColor";function Es(i){if(!(Zi in i))return false;let e=i[Zi];return g(e)||le(e)||b(e)}r(Es,"supportsBackgroundColor");var Ji="backgroundColor";function Vs(i){if(!(Ji in i))return false;let e=i[Ji];return g(e)||St(e)||b(e)}r(Vs,"supportsBackgroundColorData");var Qi="backgroundImage";function As(i){if(!(Qi in i))return false;let e=i[Qi];return e instanceof $||b(e)}r(As,"supportsBackgroundImage");var en="backgroundImage";function ws(i){if(!(en in i))return false;let e=i[en];return e instanceof $?false:wi(e)||b(e)}r(ws,"supportsBackgroundImageData");var tn="backgroundGradient";function Ws(i){if(!(tn in i))return false;let e=i[tn];return Ui(e)||b(e)}r(Ws,"supportsBackgroundGradient");var nn="backgroundGradient";function Ls(i){if(!(nn in i))return false;let e=i[nn];return v(e)||b(e)}r(Ls,"supportsBackgroundGradientData");var rn="rotation";function Rs(i){if(!(rn in i))return false;let e=i[rn];return G(e)}r(Rs,"supportsRotation");var on="opacity";function Bs(i){if(!(on in i))return false;let e=i[on];return G(e)}r(Bs,"supportsOpacity");var an="borderRadius";function Us(i){if(!(an in i))return false;let e=i[an];return g(e)||b(e)}r(Us,"supportsBorderRadius");var sn="border";function Os(i){if(!(sn in i))return false;let e=i[sn];return b(e)||le(e.color)}r(Os,"supportsBorder");var ln="svg";function zs(i){if(!(ln in i))return false;let e=i[ln];return g(e)}r(zs,"supportsSVG");var dn="textTruncation";function Gs(i){if(!(dn in i))return false;let e=i[dn];return G(e)||b(e)}r(Gs,"supportsTextTruncation");var un="zIndex";function Ks(i){if(!(un in i))return false;let e=i[un];return G(e)||b(e)}r(Ks,"supportsZIndex");var cn="overflow";function $s(i){if(!(cn in i))return false;let e=i[cn];return g(e)||b(e)}r($s,"supportsOverflow");var pn="componentIdentifier";function Hs(i){if(!(pn in i))return false;let e=i[pn];return g(e)}r(Hs,"supportsComponentInfo");var mn="font";function js(i){if(!(mn in i))return false;let e=i[mn];return Bi(e)}r(js,"supportsFont");var gn="font";function _s(i){if(!(gn in i))return false;let e=i[gn];return Ri(e)||b(e)}r(_s,"supportsFontData");var fn="inlineTextStyle";function qs(i){if(!(fn in i))return false;let e=i[fn];return si(e)||b(e)}r(qs,"supportsInlineTextStyle");var yn="inlineTextStyle";function Ys(i){if(!(yn in i))return false;let e=i[yn];return Oi(e)||b(e)}r(Ys,"supportsInlineTextStyleData");var hn="link";function Xs(i){if(!(hn in i))return false;let e=i[hn];return g(e)||b(e)}r(Xs,"supportsLink");var bn="imageRendering";function Zs(i){if(!(bn in i))return false;let e=i[bn];return g(e)||b(e)}r(Zs,"supportsImageRendering");var xn="layout";function Tn(i){if(!(xn in i))return false;let e=i[xn];return g(e)||b(e)}r(Tn,"supportsLayout");function Js(i){return Tn(i)?i.layout==="stack":false}r(Js,"hasStackLayout");function Qs(i){return Tn(i)?i.layout==="grid":false}r(Qs,"hasGridLayout");var In="isVariant";function Pn(i){if(!(In in i))return false;let e=i[In];return he(e)}r(Pn,"supportsComponentVariant");function li(i){return Pn(i)?i.isVariant:false}r(li,"isComponentVariant");function Sn(i){return !Pn(i)||!li(i)?false:!b(i.gesture)}r(Sn,"isComponentGestureVariant");var Cn="isBreakpoint";function xo(i){if(!(Cn in i))return false;let e=i[Cn];return he(e)}r(xo,"supportsBreakpoint");function Fn(i){return xo(i)?i.isBreakpoint:false}r(Fn,"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 Z(this)?Promise.resolve([]):this.#e.getChildren(this.id)}async getNodesWithType(e){return Z(this)?Promise.resolve([]):(await this.#e.invoke("getNodesWithType",this.id,e)).map(n=>x(n,this.#e))}async getNodesWithAttribute(e){return Z(this)?Promise.resolve([]):(await this.#e.invoke("getNodesWithAttribute",this.id,e)).map(n=>x(n,this.#e))}async getNodesWithAttributeSet(e){return Z(this)?Promise.resolve([]):(await this.#e.invoke("getNodesWithAttributeSet",this.id,e)).map(n=>x(n,this.#e))}async*walk(){if(yield this,!Z(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,P(this);}},J=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,P(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(ae,this.id,e),await new Promise(t=>{setTimeout(t,30);});}async getHTML(){return this.#e.invoke(oe,this.id)}},Oe=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,P(this);}},ze=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,P(this);}async getSVG(){return this.#e.invoke("getSVGForNode",this.id)}},Ge=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,P(this);}async getRuntimeError(){return this.#e.invoke("getRuntimeErrorForCodeComponentNode",this.id)}},Q=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,P(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=x(n,this.#e);return m(o instanceof R),m(Fn(o),"Expected node to be a FrameNode"),o}async getActiveCollectionItem(){let e=await this.#e.invoke("getActiveCollectionItemForWebPage",this.id);return e?new Ue(e,this.#e):null}},ee=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,P(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=x(n,this.#e);return m(o instanceof R),m(li(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=x(o,this.#e);return m(a instanceof R),m(Sn(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);}},Ke=class extends V{static{r(this,"VectorSetNode");}[c]="VectorSetNode";name;constructor(e,t){super(e,t),this.name=e.name??null,P(this);}},te=class extends V{static{r(this,"DesignPageNode");}[c]="DesignPageNode";name;constructor(e,t){super(e,t),this.name=e.name??null,P(this);}},$e=class extends V{static{r(this,"UnknownNode");}[c]="UnknownNode";constructor(e,t){super(e,t),P(this);}};function x(i,e){switch(i[c]){case "DesignPageNode":return new te(i,e);case "WebPageNode":return new Q(i,e);case "ComponentNode":return new ee(i,e);case "VectorSetNode":return new Ke(i,e);case "VectorSetItemNode":return new ze(i,e);case "ComponentInstanceNode":return new Ge(i,e);case "FrameNode":return new R(i,e);case "SVGNode":return new Oe(i,e);case "TextNode":return new J(i,e);case "UnknownNode":return new $e(i,e);default:return new $e(i,e)}}r(x,"convertRawNodeDataToNode");function Ft(i){return i instanceof R}r(Ft,"isFrameNode");function Dn(i){return i instanceof J}r(Dn,"isTextNode");function vn(i){return i instanceof Oe}r(vn,"isSVGNode");function ce(i){return i instanceof Ge}r(ce,"isComponentInstanceNode");function Nn(i){return i instanceof Q}r(Nn,"isWebPageNode");function kn(i){return i instanceof ee}r(kn,"isComponentNode");function Mn(i){return i instanceof te}r(Mn,"isDesignPageNode");function En(i){return i instanceof Ke}r(En,"isVectorSetNode");function Vn(i){return i instanceof ze}r(Vn,"isVectorSetItemNode");function Z(i){return i instanceof $e}r(Z,"isUnknownNode");function He(i){return !!(Ft(i)||Dn(i)||ce(i)||vn(i)||Vn(i)||Z(i))}r(He,"isCanvasNode");function di(i){return !!(Nn(i)||Mn(i)||kn(i)||En(i)||Z(i))}r(di,"isCanvasRootNode");var je=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 Dt(t,this.#e))}},Dt=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 _e=class extends Error{static{r(this,"FramerPluginError");}name=this.constructor.name},j=class extends Error{static{r(this,"FramerPluginClosedError");}name=this.constructor.name};function Io(i){return i.type==="separator"}r(Io,"isSeparatorMenuItem");function vt(i,e){let t=[];for(let n of i){if(Io(n)){t.push(n);continue}let{onAction:o,...a}=n,s=a;if(n.onAction){let u=Math.random();e.set(u,n.onAction),s.actionId=u;}n.submenu&&(s.submenu=vt(n.submenu,e)),t.push(s);}return t}r(vt,"addMenuItemsToOnActionCallbackMap");var Nt="type",An={[Nt]:"pluginReadySignal"},To="pluginReadyResponse";var Po={methodResponse:true,subscriptionMessage:true,permissionUpdate:true,menuAction:true};function wn(i){return v(i)&&g(i[Nt])&&i[Nt]in Po}r(wn,"isVekterToPluginNonHandshakeMessage");function Wn(i){return v(i)&&i[Nt]===To}r(Wn,"isPluginReadyResponse");var So=["unstable_getCodeFile","unstable_getCodeFiles","unstable_getCodeFileVersionContent","unstable_getCodeFileLint2","unstable_getCodeFileTypecheck2","unstable_getCodeFileVersions"],Fo=["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","getChangedPagePaths","getChangeAuthors",dt,ut,oe,"getAiServiceInfo","sendTrackingEvent",...So];new Set(Fo);var ui={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":[ae],"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"],publish:["publish"],getChangedPagePaths:[],getChangeAuthors:[],createManagedCollection:["createManagedCollection"],[Rt]:[],[Bt]:[],[Ut]:[],[Ot]:[]},kt=[];for(let i of Object.keys(ui))ui[i].length!==0&&kt.push(i);P(kt);function ci(i){let e={};for(let t of kt){let n=ui[t];e[t]=n.every(o=>i[o]);}return e}r(ci,"createPerMethodPermissionMap");function Ln(){let i={};for(let e of kt)i[e]=true;return i}r(Ln,"createPerMethodPermissionMapForTesting");var pe=null;function Rn(i){if(typeof window>"u")return;if(!pe){let t=document.createElement("style");document.head.appendChild(t),pe=t.sheet;}if(!pe){i();return}let e=pe.insertRule("* { transition: none !important; animation: none !important; }");i(),requestAnimationFrame(()=>{requestAnimationFrame(()=>{pe&&pe.deleteRule(e);});});}r(Rn,"withDisabledCssTransitions");var qe=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=Ln();return}switch(e.transport.onMessage(this.onMessage),typeof window<"u"&&(window.addEventListener("error",t=>{t.error instanceof j&&(t.preventDefault(),t.stopImmediatePropagation());}),window.addEventListener("unhandledrejection",t=>{t.reason instanceof j&&(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:st(this.mode);}}async invoke(e,...t){return this.invokeTransferable(e,undefined,...t)}async invokeTransferable(e,t,...n){return new Promise((o,a)=>{let s={type:"methodInvocation",methodName:e,id:this.methodInvocationId,args:n.map(L)};this.methodInvocationId+=1,this.methodResponseHandlers.set(s.id,{resolve:o,reject:a}),this.postMessage(s,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(wn(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 _e(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:st(t);}};getOnActionFromCallbackMap(e,t){switch(t){case "pluginMenu":return this.menuItemOnActionCallbackMap.get(e);case "contextMenu":return this.contextMenuItemOnActionCallbackMap.get(e);default:st(t);}}applyPluginTheme=e=>{Rn(()=>{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?x(t,this):null}async setAttributes(e,t){let n=await this.invoke("setAttributes",e,t);return n?x(n,this):null}async getParent(e){let t=await this.invoke("getParent",e);return t?x(t,this):null}async getChildren(e){return (await this.invoke("getChildren",e)).map(n=>{let o=x(n,this);return m(He(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=vt(e,this.menuItemOnActionCallbackMap);await this.invoke("setMenu",t);}async showContextMenu(e,t){this.contextMenuItemOnActionCallbackMap=new Map;let n=vt(e,this.contextMenuItemOnActionCallbackMap);await this.invoke("showContextMenu",n,t);}};function Do(i){return i.type==="component"}r(Do,"isCodeFileComponentExport");function vo(i){return i.type==="override"}r(vo,"isCodeFileOverrideExport");var pi=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)}},_=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 pi(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 Mt=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=x(n,this.#t);return m(ce(o)),o}};var No=(()=>{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");}}})(),Bn=5,ko=(()=>{let i=1;return {next:()=>`drag-${i++}`}})();function Mo(){}r(Mo,"noop");function Un(i,e,t,n){if(i.mode!=="canvas")return Mo;let o=ko.next(),a=document.body.style.cursor,s={type:"idle"},u=document.body,C=ie.subscribeToIsAllowedTo("makeDraggable",p=>{p||T();}),I=r(p=>{ie.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"});}),T());},"endDrag"),D=r(p=>{if(!ie.isAllowedTo("makeDraggable")||s.type==="idle")return;if(!(p.buttons>0&&!!(p.buttons&1))){I({cancelled:false});return}let{clientX:S,clientY:Y}=p;if(s.type==="pointerDown"){let ye=S-s.dragStart.mouse.x,vi=Y-s.dragStart.mouse.y;if(Math.abs(ye)<Bn&&Math.abs(vi)<Bn)return;s={type:"dragging",dragStart:s.dragStart},i.invoke("onDragStart",s.dragStart),document.getSelection()?.empty(),No.disableUntilMouseUp();}u.setPointerCapture(p.pointerId);let F={x:S,y:Y};i.invoke("onDrag",{dragSessionId:o,mouse:F}).then(ye=>{s.type==="dragging"&&(document.body.style.cursor=ye??"");});},"handlePointerChange"),B=r(p=>{p.key==="Escape"&&I({cancelled:true});},"handleKeyDown"),z=r(()=>{I({cancelled:true});},"handleBlur"),f=r(p=>{if(!ie.isAllowedTo("makeDraggable"))return;I({cancelled:true});let y=e.getBoundingClientRect(),S={x:y.x,y:y.y,width:y.width,height:y.height},Y,F=e.querySelectorAll("svg");if(F.length===1){let rt=F.item(0).getBoundingClientRect();Y={x:rt.x,y:rt.y,width:rt.width,height:rt.height};}let ye={x:p.clientX,y:p.clientY};s={type:"pointerDown",dragStart:{dragSessionId:o,elementRect:S,svgRect:Y,mouse:ye}},i.invoke("setDragData",o,t()),u.addEventListener("pointermove",D,true),u.addEventListener("pointerup",D,true),window.addEventListener("keydown",B,true),window.addEventListener("blur",z);},"handlePointerDown"),d=r(()=>{if(!ie.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",d);function T(){s={type:"idle"},document.body.style.cursor=a,u.removeEventListener("pointermove",D,true),u.removeEventListener("pointerup",D,true),window.removeEventListener("keydown",B,true),window.removeEventListener("blur",z);}return r(T,"dragCleanup"),()=>{e.removeEventListener("pointerdown",f),e.removeEventListener("mouseenter",d),I({cancelled:true}),C();}}r(Un,"makeDraggable");var me=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(ot(n)),b(n)?null:new i(n,this.#t)}};var mi=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]=Mi(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 j}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=x(t,this.#e);return m(He(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=x(o,this.#e);return m(He(a)),a});e(n);})}async getCanvasRoot(){let e=await this.#e.invoke("getCanvasRoot"),t=x(e,this.#e);return m(di(t)),t}subscribeToCanvasRoot(e){return this.#e.subscribe("canvasRoot",t=>{let n=x(t,this.#e);m(di(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=x(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?x(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=>x(n,this.#e))}async getNodesWithAttribute(e){return (await this.#e.invoke("getNodesWithAttribute",null,e)).map(n=>x(n,this.#e))}async getNodesWithAttributeSet(e){return (await this.#e.invoke("getNodesWithAttributeSet",null,e)).map(n=>x(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 Ae(e),n=H(t);return this.#e.invokeTransferable("addImage",n,t)}async setImage(e){let t=await Ae(e),n=H(t);return this.#e.invokeTransferable("setImage",n,t)}async uploadImage(e){let t=await Ae(e),n=H(t),o=await this.#e.invokeTransferable("uploadImage",n,t);return h(this.#e,o)}async addImages(e){let t=await oi(e),n=t.flatMap(H);await this.#e.invokeTransferable("addImages",n,t);}async uploadImages(e){let t=await oi(e),n=t.flatMap(H),o=await this.#e.invokeTransferable("uploadImages",n,t);return h(this.#e,o)}async uploadFile(e){let t=await ri(e),n=await this.#e.invokeTransferable("uploadFile",H(t),t);return h(this.#e,n)}async uploadFiles(e){let t=await Promise.all(e.map(ri)),n=t.flatMap(H),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=x(o,this.#e);return m(ce(a)),a}async addDetachedComponentLayers({url:e,layout:t,attributes:n}){let o=await this.#e.invoke("addDetachedComponentLayers",{url:e,layout:t,attributes:n}),a=x(o,this.#e);return m(Ft(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 Un(this.#e,e,t,n)}async getActiveManagedCollection(){let e=await this.#e.invoke("getActiveManagedCollection");return m(e,"Collection data must be defined"),new de(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 de(t,this.#e))}async getCollection(e){let t=await this.#e.invoke("getCollection",e);return t?new ue(t,this.#e):null}async getActiveCollection(){let e=await this.#e.invoke("getActiveCollection");return e?new ue(e,this.#e):null}async getCollections(){return (await this.#e.invoke("getCollections")).map(t=>new ue(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 me(t,this.#e))}subscribeToRedirects(e){return this.#e.subscribe("redirects",t=>{let n=t.map(o=>new me(o,this.#e));return e(n)})}async addRedirects(e){return (await this.#e.invoke("addRedirects",e)).map(n=>new me(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){let n=await this.#e.invoke("createCodeFile",e,t);return new _(n,this.#e)}async getCodeFiles(){let e=await this.#e.invoke("getCodeFiles"),t=[];for(let n of e)t.push(new _(n,this.#e));return t}async getCodeFile(e){let t=await this.#e.invoke("getCodeFile",e);return t?new _(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 _(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 _(t,this.#e):null;return e(n)})}async createDesignPage(e){let t=await this.#e.invoke("createDesignPage",e),n=x(t,this.#e);return m(n instanceof te,"Expected node to be a DesignPageNode"),n}async createWebPage(e){let t=await this.#e.invoke("createWebPage",e),n=x(t,this.#e);return m(n instanceof Q,"Expected node to be a WebPageNode"),n}},gi=class extends mi{static{r(this,"FramerPluginAPIBeta");}},Ye=class extends gi{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 Mt(t,this.#e)}async[l.getAiServiceInfo](){return this.#e.invoke(dt)}async[l.sendTrackingEvent](e,t,n){return this.#e.invoke(ut,e,t,n)}async[l.getHTMLForNode](e){return this.#e.invoke(oe,e)}async[l.setHTMLForNode](e,t){return this.#e.invoke(ae,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=x(n,this.#e);return m(o instanceof J),o}async createComponentNode(e){let t=await this.#e.invoke("createNode","ComponentNode",null,{name:e});if(!t)return null;let n=x(t,this.#e);return m(n instanceof ee),n}async getVectorSets(){return (await this.#e.invoke("getVectorSets")).map(t=>new je(t,this.#e))}async publish(){return this.#e.invoke("publish")}async getChangedPagePaths(e,t){return this.#e.invoke("getChangedPagePaths",e,t)}async getChangeAuthors(e,t){return this.#e.invoke("getChangeAuthors",e,t)}async createManagedCollection(e){let t=await this.#e.invoke("createManagedCollection",e);return new de(t,this.#e)}};var fi=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 Eo(){return new Promise(i=>{function e({data:t,origin:n}){if(!Wn(t))return;window.removeEventListener("message",e);let a={transport:new fi(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(An,"*");})}r(Eo,"createBrowserContext");async function Vo(){return typeof window<"u"?Eo():null}r(Vo,"bootstrap");var On=await Vo(),ie=On?new Ye(new qe(On)):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 Ye(new qe(i))}r(zn,"createFramerInstance");var Wo=wo,Gn=Wo.env;function Lo(i){Object.assign(Gn,i);}r(Lo,"configure");function ge(i,e){return Gn[i]??e}r(ge,"getEnv");var Kn=typeof globalThis.WebSocket<"u"?globalThis.WebSocket:WebSocket,$n,Hn;try{$n=await import('node:fs'),Hn=await import('node:path');}catch{}var yi=$n,hi=Hn;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}a(ai,"assert");var oi={silent:0,error:1,warn:2,info:3,debug:4};function to(){let i=qe("FRAMER_API_LOG_LEVEL")?.toLowerCase();return i&&i in oi?i:"warn"}a(to,"getLogLevel");var ri=to();function _e(i){return oi[i]<=oi[ri]}a(_e,"shouldLog");var Ye=globalThis.console,io="\x1B[90m",no="\x1B[0m";function ao(i){return i?`[FramerAPI:${i}]`:"[FramerAPI]"}a(ao,"formatPrefix");function oo(i,...e){return [io+i,...e,no]}a(oo,"formatDebug");function vn(i){let e=ao(i);return {warn:(...t)=>{_e("warn")&&Ye.warn(e,...t);},error:(...t)=>{_e("error")&&Ye.error(e,...t);},log:(...t)=>{_e("info")&&Ye.log(e,...t);},info:(...t)=>{_e("info")&&Ye.info(e,...t);},debug:(...t)=>{_e("debug")&&Ye.debug(...oo(e,...t));},setLevel:t=>{ri=t;},getLevel:()=>ri,withRequestId:t=>vn(t)}}a(vn,"createLogger");var S=vn();S.warn;S.error;S.log;S.info;S.debug;S.setLevel;S.getLevel;var ro=/^[^-]+--([^-]+)/u;function Vn(i){try{let t=new URL(i).pathname.split("/").filter(Boolean),n=t.findIndex(o=>o.toLowerCase()==="projects");if(n>=0){let o=t[n+1];if(o!==void 0){let l=decodeURIComponent(o);return l.match(ro)?.[1]??l}}return null}catch{return null}}a(Vn,"parseProjectId");var kn=["showUI","hideUI","closePlugin","notify","setMenu","showContextMenu","preloadDetachedComponentLayers","preloadDragPreviewImage","preloadImageUrlForInsertion","getSelection","getActiveCollection","getActiveManagedCollection","getActiveLocale","zoomIntoView","navigateTo","getPluginData","setPluginData","getPluginDataKeys"],lo=["makeDraggable","subscribeToSelection","subscribeToImage","subscribeToText"],An=[...kn,...lo];function li(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}a(li,"isObject");var uo={type:"pluginReadySignal"};function co(i){return li(i)&&i.type==="pluginReadyResponse"}a(co,"isPluginReadyResponse");var si=class{constructor(e){this.ws=e;}static{a(this,"WebSocketTransport");}send(e){this.ws.send(ee.stringify(e));}onMessage(e){this.ws.addEventListener("message",t=>{let n=typeof t.data=="string"?t.data:t.data.toString(),o=ee.parse(n);if(li(o)&&o.type==="error"){S.error(`Server error: ${o.message||JSON.stringify(o)}`);return}e(o);});}},Wn=45e3,po=2e4;async function Zl(i,e){return En(i,e)}a(Zl,"connect");function mo(i){for(let e of An)e in i&&(i[e]=()=>{throw new Error(`"${e}" is not available in API mode`)});}a(mo,"restrictBlockedMethods");async function En(i,e){let t=Vn(i);ai(t,`Invalid project URL or ID: ${i}`);let n=e??qe("FRAMER_API_KEY");ai(n,"FRAMER_API_KEY environment variable is required");let o=new URL(qe("FRAMER_HEADLESS_SERVER_URL","wss://api.framer.com/channel/headless-plugin"));o.protocol=o.protocol==="https:"?"wss:":o.protocol==="http"?"ws:":o.protocol,o.searchParams.set("projectId",t),S.debug(`Connecting to ${o.href}`);let l={headers:{Authorization:`Token ${n}`}},s=new Nn(o.href,l);S.debug(`WebSocket created, readyState: ${s.readyState}`);let f,b=S,P=setInterval(()=>{s.readyState===s.OPEN&&(s.send(ee.stringify({type:"ping"})),b.debug("Sent ping"));},po),D=await new Promise((j,me)=>{let x=setTimeout(()=>{s.close(),me(new Error(`Connection timeout after ${Wn}ms`));},Wn),Mn=a(()=>{b.debug("WebSocket opened, waiting for ready");},"onOpen"),di=a(k=>{b.debug("WebSocket error:",k),x&&clearTimeout(x),clearInterval(P),s.close(),me(new Error("WebSocket connection failed"));},"onError"),ui=a(k=>{b.debug(`WebSocket closed: code=${k.code}, reason=${k.reason||"(no reason)"}, wasClean=${k.wasClean}`),x&&clearTimeout(x),P&&clearInterval(P),me(new Error(`WebSocket connection closed before handshake completed (code: ${k.code})`));},"onClose");function ci(k){b.debug("Received message");let wn=typeof k.data=="string"?k.data:k.data.toString(),A=ee.parse(wn);b.debug(`Message type: ${A.type}`),A.type==="error"?(x&&clearTimeout(x),s.close(),me(new Error(`Server error: ${A.message||JSON.stringify(A)}`))):A.type==="ready"?(li(A)&&"requestId"in A&&(f=String(A.requestId),b=S.withRequestId(f),b.debug(`Server request ID: ${f}`)),b.debug("Sending pluginReadySignal"),s.send(ee.stringify(uo))):co(A)&&(x&&clearTimeout(x),s.removeEventListener("message",ci),s.removeEventListener("error",di),s.removeEventListener("close",ui),j(A));}a(ci,"handshakeMessageHandler"),s.addEventListener("open",Mn),s.addEventListener("message",ci),s.addEventListener("error",di),s.addEventListener("close",ui);}),Xe={transport:new si(s),mode:D.mode,permissionMap:D.permissionMap,environmentInfo:D.environmentInfo,origin:null,theme:null},w=Sn(Xe);s.addEventListener("close",j=>{j.code!==1e3&&(b.debug(`Connection closed unexpectedly: ${j.code}`),typeof process<"u"&&process.exit&&process.exit(1));}),mo(w);let L=w,te=typeof L.disconnect=="function"?L.disconnect.bind(w):undefined,y=typeof L[Symbol.asyncDispose]=="function"?L[Symbol.asyncDispose].bind(w):undefined,I=typeof L[Symbol.dispose]=="function"?L[Symbol.dispose].bind(w):undefined,B=a(async()=>{clearInterval(P),s.readyState!==s.CLOSED&&s.readyState!==s.CLOSING&&s.close(1e3,"Client disconnect"),te&&await te();},"disconnect"),$=a(async()=>{await B(),y&&y!==te&&await y();},"asyncDispose"),ie=a(()=>{B(),I&&I();},"syncDispose");return Object.assign(w,{disconnect:B,requestId:f,[Symbol.asyncDispose]:$,[Symbol.dispose]:ie})}a(En,"createConnection");async function Jl(i,e,t){let n=await En(i,t);try{return await e(n)}finally{await n.disconnect();}}a(Jl,"withConnection");
12
+ `));}catch{}throw t}r(w,"assert");function jn(i,e){let{cleanup:t,requestId:n}=e,o=i,a=typeof o.disconnect=="function"?o.disconnect.bind(i):undefined,s=typeof o[Symbol.asyncDispose]=="function"?o[Symbol.asyncDispose].bind(i):undefined,u=typeof o[Symbol.dispose]=="function"?o[Symbol.dispose].bind(i):undefined,C=r(async()=>{await t(),a&&await a();},"disconnect"),I=r(async()=>{await C(),s&&s!==a&&await s();},"asyncDispose"),D=r(()=>{C(),u&&u();},"syncDispose");Object.assign(i,{disconnect:C,requestId:n,[Symbol.asyncDispose]:I,[Symbol.dispose]:D});}r(jn,"makeDisposable");var _n=["showUI","hideUI","closePlugin","notify","setMenu","showContextMenu","preloadDetachedComponentLayers","preloadDragPreviewImage","preloadImageUrlForInsertion","getSelection","getActiveCollection","getActiveManagedCollection","getActiveLocale","zoomIntoView","navigateTo","getPluginData","setPluginData","getPluginDataKeys"],Bo=["makeDraggable","subscribeToSelection","subscribeToImage","subscribeToText"],Uo=[..._n,...Bo];function qn(i){for(let e of Uo)e in i&&(i[e]=()=>{throw new Error(`"${e}" is not available in API mode`)});}r(qn,"restrictBlockedMethods");var Oo=/^.+--([A-Za-z0-9]+)/u,Yn=/^[A-Za-z0-9]{20}$/u;function Xn(i){if(Yn.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),u=a.match(Oo)?.[1]??a;if(Yn.test(u))return u}}return null}catch{return null}}r(Xn,"parseProjectId");var ne=class extends Error{static{r(this,"FramerAPIError");}constructor(e){super(e),this.name="FramerAPIError",this.stack=undefined;}};var bi={silent:0,error:1,warn:2,info:3,debug:4};function zo(){let i=ge("FRAMER_API_LOG_LEVEL")?.toLowerCase();return i&&i in bi?i:"warn"}r(zo,"getLogLevel");var xi=zo();function Xe(i){return bi[i]<=bi[xi]}r(Xe,"shouldLog");var Ze=globalThis.console,Go="\x1B[90m",Ko="\x1B[0m";function $o(i){return i?`[FramerAPI:${i}]`:"[FramerAPI]"}r($o,"formatPrefix");function Ho(i,...e){return [Go+i,...e,Ko]}r(Ho,"formatDebug");function Zn(i){let e=$o(i);return {warn:(...t)=>{Xe("warn")&&Ze.warn(e,...t);},error:(...t)=>{Xe("error")&&Ze.error(e,...t);},log:(...t)=>{Xe("info")&&Ze.log(e,...t);},info:(...t)=>{Xe("info")&&Ze.info(e,...t);},debug:(...t)=>{Xe("debug")&&Ze.debug(...Ho(e,...t));},setLevel:t=>{xi=t;},getLevel:()=>xi,withRequestId:t=>Zn(t)}}r(Zn,"createLogger");var k=Zn();k.warn;k.error;k.log;k.info;k.debug;k.setLevel;k.getLevel;var Jn;function Qn({error:i,tags:e,extras:t,critical:n,caller:o}){w(Jn,"Set up an error callback with setErrorReporter, or configure Sentry with initializeEnvironment");let a=Ci(i,o);return Jn({error:a,tags:{...a.tags,...e},extras:{...a.extras,...t},critical:!!n}),a}r(Qn,"reportError");function Ci(i,e=Ci){return i instanceof Error?i:new Ii(i,e)}r(Ci,"reportableError");var Ii=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 Je=typeof window<"u"?window.location.hostname:undefined,er=!!(Je&&["web.framerlocal.com","localhost","127.0.0.1","[::1]"].includes(Je)),Ti=(()=>{if(!Je)return;if(er)return {main:Je,previewLink:undefined};let i=/^(([^.]+\.)?beta\.)?((?:development\.)?framer\.com)$/u,e=Je.match(i);if(!(!e||!e[3]))return {previewLink:e[2]&&e[0],main:e[3]}})();({hosts:Ti,isDevelopment:Ti?.main==="development.framer.com",isProduction:Ti?.main==="framer.com",isLocal:er});var Et;function Vt(){return typeof window>"u"?{}:Et||(Et=qo(),Et)}r(Vt,"getServiceMap");function qo(){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(qo,"extractServiceMap");function Qe(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 Qe(i.toJSON(),e+1,t);if(Array.isArray(i))return i.map(n=>Qe(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]=Qe(a,e+1,t);return n}}catch(n){return `[Throws: ${n instanceof Error?n.message:n}]`}finally{t.delete(i);}}r(Qe,"jsonSafeCopy");var Yo=["trace","debug","info","warn","error"],Xo=[":trace",":debug",":info",":warn",":error"];function nr(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 I=0;I<=4;I++){let D=Xo[I];if(D&&o.endsWith(D)){a=I,s&&(a+=1),o=o.slice(0,o.length-D.length),o.length===0&&(o="*");break}}let u=new RegExp("^"+ia(o).replace(/\\\*/gu,".*")+"$"),C=0;for(let I of e)I.id.match(u)&&(I.level=a,++C);C===0&&t.push(n);}return t}r(nr,"applyLogLevelSpec");var et=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),Yo[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(Qe(e));return n?.length>253?n.slice(0,250)+"...":n}).join(" ")}},O="*:app:info,app:info",rr=typeof process<"u"&&!!process.kill,Zo=rr&&!!process.env.CI;Zo?O="-:warn":rr&&(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:sr});}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=tt(e);if(t<0||t>5)return;n[0]=n[0].replace("[","*[");let s=new et(a,t,n);s.stringPrefix=n[0],q.push(s),!o&&(a.level>t||console?.log(...s.toMessage()));});}catch{}var Si;try{typeof window<"u"&&window.postMessage&&window.parent!==window&&!window.location.pathname.startsWith("/edit")&&(Si=r(i=>{try{let e=i.toMessage().map(s=>Qe(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,Vt().app);}catch{}},"postLogEntry"));}catch{}var Pi={},q=[],or=1e3;function re(i,e,t){let n=new et(i,e,t);for(q.push(n),Si?.(n);q.length>or;)q.shift();return n}r(re,"createLogEntry");function ar(i){return typeof i=="number"&&(or=i),q}r(ar,"getLogReplayBuffer");var Jo=/\/(?<filename>[^/.]+)(?=\.(?:debug\.)?html$)/u,ir;function Qo(){if(!(typeof window>"u"||!window.location))return ir??=Jo.exec(window.location.pathname)?.groups?.filename,ir}r(Qo,"getFilenameFromWindowPathname");function tt(i){let e=Qo();i=(e?e+":":"")+i;let t=Pi[i];if(t)return t;let n=new At(i);return Pi[i]=n,nr(O,[n]),Si?.(new et(n,-1,[])),n}r(tt,"getLogger");function sr(i,e=true){try{typeof window<"u"&&window.localStorage&&(window.localStorage.logLevel=i);}catch{}let t=O;O=i;let n=Object.values(Pi);for(let a of n)a.level=3;let o=nr(i,n);if(o.length>0&&console?.warn("Some log level specs matched no loggers:",o),e&&q.length>0){console?.log("--- LOG REPLAY ---");for(let a of q)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(sr,"setLogLevel");var ea=r(i=>{let e={...i,logs:ar().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"),At=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 tt(t)}getBufferedMessages(){return q.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=re(this,0,e);console?.log(...t.toMessage());};debug=(...e)=>{let t=re(this,1,e);this.level>1||console?.log(...t.toMessage());};info=(...e)=>{let t=re(this,2,e);this.level>2||console?.info(...t.toMessage());};warn=(...e)=>{let t=re(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=re(this,3,t);this.level>3||console?.warn(...o.toMessage());};error=(...e)=>{let t=re(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=re(this,4,t);this.level>4||console?.error(...o.toMessage());};reportWithoutLogging=(e,t,n,o)=>{let a=ea(t??{}),s=Qn({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(!ta(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 ta(i){return Object.prototype.hasOwnProperty.call(i,"message")}r(ta,"isErrorWithMessage");function ia(i){return i.replace(/[/\-\\^$*+?.()|[\]{}]/gu,"\\$&")}r(ia,"escapeRegExp");var ur;(z=>{function i(f,...d){return f.concat(d)}z.push=i,r(i,"push");function e(f){return f.slice(0,-1)}z.pop=e,r(e,"pop");function t(f,...d){return d.concat(f)}z.unshift=t,r(t,"unshift");function n(f,d,...T){let p=f.length;if(d<0||d>p)throw Error("index out of range: "+d);let y=f.slice();return y.splice(d,0,...T),y}z.insert=n,r(n,"insert");function o(f,d,T){let p=f.length;if(d<0||d>=p)throw Error("index out of range: "+d);let y=Array.isArray(T)?T:[T],S=f.slice();return S.splice(d,1,...y),S}z.replace=o,r(o,"replace");function a(f,d){let T=f.length;if(d<0||d>=T)throw Error("index out of range: "+d);let p=f.slice();return p.splice(d,1),p}z.remove=a,r(a,"remove");function s(f,d,T){let p=f.length;if(d<0||d>=p)throw Error("from index out of range: "+d);if(T<0||T>=p)throw Error("to index out of range: "+T);let y=f.slice();if(T===d)return y;let S=y[d];return d<T?(y.splice(T+1,0,S),y.splice(d,1)):(y.splice(d,1),y.splice(T,0,S)),y}z.move=s,r(s,"move");function u(f,d){let T=[],p=Math.min(f.length,d.length);for(let y=0;y<p;y++)T.push([f[y],d[y]]);return T}z.zip=u,r(u,"zip");function C(f,d,T){let p=f.slice(),y=p[d];return y===undefined||(p[d]=T(y)),p}z.update=C,r(C,"update");function I(f){return Array.from(new Set(f))}z.unique=I,r(I,"unique");function D(f,...d){return Array.from(new Set([...f,...d.flat()]))}z.union=D,r(D,"union");function B(f,d){return f.filter(d)}z.filter=B,r(B,"filter");})(ur||={});var da=Object.prototype.hasOwnProperty;function ua(i,e){return da.call(i,e)}r(ua,"hasOwnProperty");var cr;(n=>{function i(o,a){for(let s of Object.keys(o))ua(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");})(cr||={});var pr;(o=>{function i(a,...s){return new Set([...a,...s])}o.add=i,r(i,"add");function e(a,...s){let u=new Set(a);for(let C of s)u.delete(C);return u}o.remove=e,r(e,"remove");function t(...a){let s=new Set;for(let u of a)for(let C of u)s.add(C);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 mr;(n=>{function i(o,...a){let s=new Map;o.forEach((C,I)=>s.set(I,C));let u=false;for(let C of a)C&&(C.forEach((I,D)=>s.set(D,I)),u=true);return u?s:o}n.merge=i,r(i,"merge");function e(o,a,s){let u=new Map(o);return u.set(a,s),u}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");})(mr||={});(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);};}});tt("task-queue");function Di(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}r(Di,"isObject");var fe=class{constructor(e){this.ws=e;}static{r(this,"WebSocketTransport");}send(e){this.ws.send(it.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=it.parse(a.data);Di(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=it.parse(n);if(Di(o)&&o.type==="error"){k.error(`Server error: ${o.message||JSON.stringify(o)}`);return}if(Di(o)&&o.type==="debug-archive"){this.handleDebugArchive(o.data);return}e(o);});}handleDebugArchive(e){w(yi,"File system module is not available."),w(hi,"Path module is not available.");let n=`debug-archive-${new Date().toISOString().replace(/[:.]/gu,"-")}.zip`,o=process.cwd(),a=hi.resolve(o,n);yi.writeFileSync(a,Buffer.from(e)),k.info(`Debug archive saved to ${a}`);}};function Wt(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}r(Wt,"isObject");var ga={type:"pluginReadySignal"};function fa(i){return Wt(i)&&i.type==="pluginReadyResponse"}r(fa,"isPluginReadyResponse");var gr=45e3,ya=2e4;async function fr(i,e){let t=new URL(ge("FRAMER_HEADLESS_SERVER_URL","wss://api.framer.com/channel/headless-plugin"));t.protocol=t.protocol==="https:"?"wss:":t.protocol==="http"?"ws:":t.protocol,t.searchParams.set("projectId",i),k.debug(`Connecting to ${t.href}`);let n=new Kn(t.href,{headers:{Authorization:`Token ${e}`}});k.debug(`WebSocket created, readyState: ${n.readyState}`);let o,a=k,s=false,u=setInterval(()=>{n.readyState===n.OPEN&&(n.send(it.stringify({type:"ping"})),a.debug("Sent ping"));},ya),C=r(()=>{clearInterval(u),n.readyState!==n.CLOSED&&n.readyState!==n.CLOSING&&n.close(1e3,"Client disconnect");},"forceClose"),I=r(async()=>{if(clearInterval(u),!(n.readyState===n.CLOSED||n.readyState===n.CLOSING)){if(s){a.debug("Initiating graceful disconnect");let B=new fe(n);B.sendRaw({type:"client-disconnect"}),await B.waitForDisconnectAck(5e3);}n.readyState!==n.CLOSED&&n.readyState!==n.CLOSING&&n.close(1e3,"Client disconnect");}},"cleanup"),D=await new Promise((B,z)=>{let f=setTimeout(()=>{C(),z(new ne(`Connection timeout after ${gr}ms`));},gr),d=r(()=>{a.debug("WebSocket opened, waiting for ready");},"onOpen"),T=r(S=>{a.debug("WebSocket error:",S),clearTimeout(f),C(),z(new ne("WebSocket connection failed"));},"onError"),p=r(S=>{a.debug(`WebSocket closed: code=${S.code}, reason=${S.reason||"(no reason)"}, wasClean=${S.wasClean}`),clearTimeout(f),clearInterval(u),z(new ne(`WebSocket closed before handshake completed (code: ${S.code})`));},"onClose");function y(S){a.debug("Received message");let Y=typeof S.data=="string"?S.data:S.data.toString(),F=it.parse(Y);a.debug(`Message type: ${F.type}`),F.type==="error"?(clearTimeout(f),C(),z(new ne(`Server error: ${F.message||JSON.stringify(F)}`))):F.type==="ready"?(Wt(F)&&"requestId"in F&&(o=String(F.requestId),a=k.withRequestId(o),a.debug(`Server request ID: ${o}`)),Wt(F)&&"version"in F&&a.debug(`Server version: ${F.version}`),Wt(F)&&F.gracefulDisconnect===true&&(s=true),a.debug("Sending pluginReadySignal"),n.send(it.stringify(ga))):fa(F)&&(clearTimeout(f),n.removeEventListener("message",y),n.removeEventListener("error",T),n.removeEventListener("close",p),B(F));}r(y,"handshakeMessageHandler"),n.addEventListener("open",d),n.addEventListener("message",y),n.addEventListener("error",T),n.addEventListener("close",p);});return {ws:n,pluginReadyData:D,requestId:o,logger:a,gracefulDisconnect:s,cleanup:I}}r(fr,"connectAndHandshake");async function yr(i,e){let t=Xn(i);w(t,`Invalid project URL or ID: ${i}`);let n=e??ge("FRAMER_API_KEY");w(n,"FRAMER_API_KEY environment variable is required");let o=await fr(t,n),a=new fe(o.ws),s={transport:a,mode:o.pluginReadyData.mode,permissionMap:o.pluginReadyData.permissionMap,environmentInfo:o.pluginReadyData.environmentInfo,origin:null,theme:null},u=zn(s);return o.ws.addEventListener("close",I=>{I.code!==1e3&&(o.logger.debug(`Connection closed unexpectedly: ${I.code}`),typeof process<"u"&&process.exit&&process.exit(1));}),qn(u),jn(u,{cleanup:r(async()=>{o.gracefulDisconnect&&(o.logger.debug("Initiating graceful disconnect"),a.send({type:"client-disconnect"}),await a.waitForDisconnectAck(5e3)),await o.cleanup();},"cleanup"),requestId:o.requestId}),u}r(yr,"connect");async function ha(i,e,t){let n=await yr(i,t);try{return await e(n)}finally{await n.disconnect();}}r(ha,"withConnection");
13
14
 
14
- export { nt as BooleanField, ye as BooleanVariable, Se as BorderVariable, mt as CollectionReferenceField, at as ColorField, Ie as ColorVariable, Ue as ComponentInstanceNode, Z as ComponentNode, Me as ConicGradient, dt as DateField, Fe as DateVariable, J as DesignPageNode, O as EnumCase, pt as EnumField, be as EnumVariable, ut as FieldDivider, ct as FileField, Pe as FileVariable, st as FormattedTextField, Ce as FormattedTextVariable, M as FrameNode, K as FramerPluginClosedError, He as FramerPluginError, Ne as ImageField, Te as ImageVariable, We as LinearGradient, lt as LinkField, xe as LinkVariable, gt as MultiCollectionReferenceField, ot as NumberField, he as NumberVariable, An as PUBLIC_API_BLOCKED_METHODS, Ee as RadialGradient, Re as SVGNode, rt as StringField, fe as StringVariable, Y as TextNode, Ae as UnsupportedComputedValue, ve as UnsupportedField, De as UnsupportedVariable, Ke as VectorSet, Ct as VectorSetItem, Be as VectorSetItemNode, Oe as VectorSetNode, X as WebPageNode, eo as configure, Zl as connect, Q as framer, _r as hasGridLayout, qr as hasStackLayout, dn as isBreakpoint, Ha as isCodeFileComponentExport, $a as isCodeFileOverrideExport, se as isColorStyle, ln as isComponentGestureVariant, ue as isComponentInstanceNode, mn as isComponentNode, pa as isComponentVariable, Xt as isComponentVariant, Ta as isComputedValue, gn as isDesignPageNode, ma as isField, ya as isFileAsset, ft as isFrameNode, fa as isImageAsset, cn as isSVGNode, un as isTextNode, Yt as isTextStyle, yi as isVariable, hn as isVectorSetItemNode, yn as isVectorSetNode, pn as isWebPageNode, Pr as supportsAspectRatio, Dr as supportsBackgroundColor, Nr as supportsBackgroundColorData, kr as supportsBackgroundGradient, Ar as supportsBackgroundGradientData, vr as supportsBackgroundImage, Vr as supportsBackgroundImageData, wr as supportsBorder, Mr as supportsBorderRadius, Ra as supportsBreakpoint, Or as supportsComponentInfo, sn as supportsComponentVariant, zr as supportsFont, Gr as supportsFontData, jr as supportsImageRendering, Kr as supportsInlineTextStyle, Hr as supportsInlineTextStyleData, rn as supportsLayout, $r as supportsLink, Sr as supportsLocked, xr as supportsName, Er as supportsOpacity, Ur as supportsOverflow, br as supportsPins, Cr as supportsPosition, Wr as supportsRotation, Lr as supportsSVG, Ir as supportsSize, Tr as supportsSizeConstraints, Rr as supportsTextTruncation, Fr as supportsVisible, Br as supportsZIndex, Jl as withConnection };
15
+ export { ct as BooleanField, be as BooleanVariable, Ne as BorderVariable, Ct as CollectionReferenceField, pt as ColorField, Pe as ColorVariable, Ge as ComponentInstanceNode, ee as ComponentNode, Re as ConicGradient, ht as DateField, ve as DateVariable, te as DesignPageNode, K as EnumCase, It as EnumField, Te as EnumVariable, bt as FieldDivider, xt as FileField, Fe as FileVariable, ft as FormattedTextField, Ce as FormattedTextVariable, R as FrameNode, j as FramerPluginClosedError, _e as FramerPluginError, Me as ImageField, Se as ImageVariable, We as LinearGradient, yt as LinkField, De as LinkVariable, Tt as MultiCollectionReferenceField, mt as NumberField, xe as NumberVariable, Le as RadialGradient, Oe as SVGNode, gt as StringField, Ie as StringVariable, J as TextNode, we as UnsupportedComputedValue, Ee as UnsupportedField, ke as UnsupportedVariable, je as VectorSet, Dt as VectorSetItem, ze as VectorSetItemNode, Ke as VectorSetNode, Q as WebPageNode, Lo as configure, yr as connect, ie as framer, Qs as hasGridLayout, Js as hasStackLayout, Fn as isBreakpoint, Do as isCodeFileComponentExport, vo as isCodeFileOverrideExport, le as isColorStyle, Sn as isComponentGestureVariant, ce as isComponentInstanceNode, kn as isComponentNode, _r as isComponentVariable, li as isComponentVariant, io as isComputedValue, Mn as isDesignPageNode, qr as isField, Xr as isFileAsset, Ft as isFrameNode, Jr as isImageAsset, vn as isSVGNode, Dn as isTextNode, si as isTextStyle, Ei as isVariable, Vn as isVectorSetItemNode, En as isVectorSetNode, Nn as isWebPageNode, vs as supportsAspectRatio, Es as supportsBackgroundColor, Vs as supportsBackgroundColorData, Ws as supportsBackgroundGradient, Ls as supportsBackgroundGradientData, As as supportsBackgroundImage, ws as supportsBackgroundImageData, Os as supportsBorder, Us as supportsBorderRadius, xo as supportsBreakpoint, Hs as supportsComponentInfo, Pn as supportsComponentVariant, js as supportsFont, _s as supportsFontData, Zs as supportsImageRendering, qs as supportsInlineTextStyle, Ys as supportsInlineTextStyleData, Tn as supportsLayout, Xs as supportsLink, Ms as supportsLocked, Ns as supportsName, Bs as supportsOpacity, $s as supportsOverflow, Ss as supportsPins, Ps as supportsPosition, Rs as supportsRotation, zs as supportsSVG, Fs as supportsSize, Ds as supportsSizeConstraints, Gs as supportsTextTruncation, ks as supportsVisible, Ks as supportsZIndex, ha as withConnection };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "framer-api",
3
- "version": "0.0.1-alpha.3",
3
+ "version": "0.0.1-alpha.5",
4
4
  "type": "module",
5
5
  "types": "dist/index.d.ts",
6
6
  "exports": {