{
  "version": 3,
  "sources": ["../../src/renderer/CanvasRenderer.styles.ts", "../../src/renderer/CanvasRichText.tsx", "../../src/renderer/utils/isStackOrGridChildElement.ts", "../../src/utils/getMasonryLayoutChildrenForMeasurement.ts", "../../src/renderer/utils/addPlaceholders.tsx", "../../src/renderer/CanvasLayout.tsx", "../../src/document/models/CanvasTree/nodes/utils/useLayoutTemplateAnnotations.ts", "../../src/renderer/ComponentContainer.tsx", "../../src/renderer/withErrorBoundary.tsx", "../../src/renderer/withMeasuredLayout.tsx", "../../src/renderer/CanvasPortal.tsx", "../../src/renderer/utils/useVectorComponent.tsx", "../../src/renderer/utils/getVariableReferencesForProvider.ts", "../../src/renderer/CanvasVector.tsx", "../../src/renderer/TreeDatabaseCollection.ts", "../../src/renderer/collectionRenderUtils.ts", "../../src/renderer/getVectorForNode.tsx", "../../src/renderer/resetCacheForGraphics.tsx", "../../src/renderer/richTextRenderUtils.tsx"],
  "sourcesContent": ["import \"CanvasRenderer.styles_p19wry.wyw.css\"; export const groundNodeWrapperClassName = \"groundNodeWrapper\";\nexport const disableBackdropFiltersClass = \"disableBackdropFiltersClass_d197x122\";\nexport const disableShadowsClass = \"disableShadowsClass_dpj2ndz\";\nexport const disableFiltersClass = \"disableFiltersClass_d1tskyf\";\nexport const disableWillChangeClass = \"disableWillChangeClass_d74qriz\";\nexport const disableSmoothImageRenderingClass = \"disableSmoothImageRenderingClass_dyirmfz\";\nexport const globalCanvas = \"globalCanvas_gh7q592\";\nexport const canvasElementsDisabled = \"canvasElementsDisabled_c880hsu\";", "import type { AnyComponentLoader } from \"@framerjs/framer-runtime\"\nimport type { CanvasTree, RichTextNode } from \"document/models/CanvasTree/index.ts\"\nimport type { ComponentPresetNode } from \"document/models/CanvasTree/nodes/ComponentPresetNode.ts\"\nimport { filterComponentPresetControls } from \"document/models/controlProps/filterComponentPresetControls.ts\"\nimport { getControlProps } from \"document/models/controlProps/getControlProps.ts\"\nimport {\n\tgetControlPropValueResolvers,\n\tgetResolvedControlPropValues,\n} from \"document/models/controlProps/getResolvedControlPropValues.ts\"\nimport { ComponentPresetsProvider } from \"library/index.ts\"\nimport { RichText } from \"library/render/presentation/RichText.tsx\"\nimport { getAssetResolverWithHash } from \"./getAssetResolver.ts\"\n\ninterface Props {\n\ttree: CanvasTree\n\tcomponentLoader: AnyComponentLoader\n\tnode: RichTextNode\n\trichTextProps: React.ComponentProps<typeof RichText>\n\tchildren: React.ReactElement | undefined\n}\n\nexport function CanvasRichText({ tree, componentLoader, node, richTextProps, children }: Props) {\n\tconst componentPresets = node.getComponentPresets()\n\tconst presets: Record<string, Record<string, unknown>> = {}\n\n\tconst assetResolverWithHash = getAssetResolverWithHash()\n\n\tfor (const [componentIdentifier, presetId] of componentPresets) {\n\t\tconst presetNode = tree.get<ComponentPresetNode>(presetId)\n\t\tif (!presetNode) continue\n\n\t\t// We need to re-render the node when the preset changes.\n\t\tpresetNode.linkTo(node.id)\n\n\t\tconst component = componentLoader.reactComponentForIdentifier(presetNode.componentIdentifier)\n\t\tpresetNode.cache.isComponentLoaded = Boolean(component)\n\t\tif (!component) continue\n\n\t\tconst rawControlProps = presetNode.getRawControlProps()\n\t\tconst controls = filterComponentPresetControls(component, \"onlyPresets\")\n\t\tconst controlProps = getControlProps(controls, rawControlProps)\n\n\t\tpresets[componentIdentifier] = getResolvedControlPropValues(\n\t\t\tcontrols,\n\t\t\tcontrolProps,\n\t\t\tgetControlPropValueResolvers({\n\t\t\t\tassetResolverWithHash,\n\t\t\t\tvariableValueResolver: presetNode.cache,\n\t\t\t\tgetVariableControlByReference: ref => presetNode.cache.getVariableControlByReference(ref),\n\t\t\t\tgetResolvedFetchDataValue: undefined,\n\t\t\t\tgetCanvasTree: () => tree,\n\t\t\t\tcomponentLoader,\n\t\t\t}),\n\t\t)\n\t}\n\n\treturn (\n\t\t<ComponentPresetsProvider presets={presets}>\n\t\t\t<RichText {...richTextProps}>{children}</RichText>\n\t\t</ComponentPresetsProvider>\n\t)\n}\n", "/** Checks if the Stack or Grid child element is associated with a tree node that needs to be measured */\nexport function isStackOrGridChildElement(child: Element): boolean {\n\tif (child.hasAttribute(\"data-debug\")) return false\n\tif (child.hasAttribute(\"data-frame-border\")) return false\n\tif (child.hasAttribute(\"data-empty-state\")) return false\n\tif (child.hasAttribute(\"data-framer-background-image-wrapper\")) return false\n\treturn true\n}\n", "import { pickMasonryTrack } from \"library/render/presentation/withColumnMasonryLayout.tsx\"\nimport { isStackOrGridChildElement } from \"renderer/utils/isStackOrGridChildElement.ts\"\n\n/**\n * Helper function that flattens Masonry column wrapper HTML elements to help us measure\n * the actual items for layout measurements.\n */\nexport function getMasonryLayoutChildrenForMeasurement(element: Element | undefined | null): Element[] {\n\tif (!element) return []\n\n\tconst tracks = Array.from(element.children)\n\tconst trackCount = tracks.length\n\tif (trackCount === 0) return []\n\n\t// Build an array of measurable children per track, already filtered.\n\tconst trackChildren: Element[][] = tracks.map(track => Array.from(track.children).filter(isStackOrGridChildElement))\n\n\tconst totalItems = trackChildren.reduce((sum, arr) => sum + arr.length, 0)\n\tconst result: Element[] = []\n\n\t// Recreate the node order from the grid tracks to ensure that insertion indicator position calculation works as expected.\n\tfor (let childIndex = 0; result.length < totalItems; childIndex++) {\n\t\tconst trackIndex = pickMasonryTrack(trackCount, childIndex)\n\t\tconst queue = trackChildren[trackIndex]\n\t\tif (!queue) continue\n\t\tif (queue.length > 0) {\n\t\t\tconst child = queue.shift()\n\t\t\tif (!child) continue\n\t\t\tresult.push(child)\n\t\t}\n\t}\n\n\treturn result\n}\n", "import { colors } from \"@framerjs/fresco/tokens\"\nimport type { PlaceholderItem } from \"document/models/CanvasTree/nodes/CanvasNodeCache.ts\"\nimport { FrameWithMotion } from \"library/render/presentation/Frame/FrameWithMotion.tsx\"\nimport React from \"react\"\n\nexport function addPlaceholders(children: React.ReactNode, placeholders: PlaceholderItem[] | undefined) {\n\t// Placeholder indices are based on visible rects, so we need to filter the\n\t// children array to only the visible ones, so the placeholder is inserted\n\t// in the right position\n\tconst allChildren = React.Children.toArray(children)\n\tconst visibleChildrenWithPlaceholders = allChildren.filter(child => {\n\t\t// It is possible that child.props.visible could be undefined (it has a\n\t\t// missing visibility variable)\n\t\treturn React.isValidElement(child) && (child.props.visible ?? true)\n\t})\n\n\tif (placeholders) {\n\t\tlet key = 0\n\t\tfor (const {\n\t\t\tindex,\n\t\t\tattributes: { width, height, style },\n\t\t} of placeholders) {\n\t\t\tconst element = <DragPlaceholder key={key} width={width} height={height} style={style} />\n\t\t\tkey += 1\n\t\t\tvisibleChildrenWithPlaceholders.splice(index, 0, element)\n\t\t}\n\t}\n\n\treturn visibleChildrenWithPlaceholders\n}\n\nexport function DragPlaceholder({\n\twidth,\n\theight,\n\tstyle,\n}: {\n\twidth: number\n\theight: number\n\tstyle?: React.CSSProperties\n}) {\n\treturn (\n\t\t<FrameWithMotion\n\t\t\twidth={width}\n\t\t\theight={height}\n\t\t\tstyle={{ position: \"relative\", ...style }}\n\t\t\tbackground={colors.tint}\n\t\t\topacity={0.1}\n\t\t/>\n\t)\n}\n", "import { isFirefox } from \"@framerjs/shared/src/environment.ts\"\nimport type { CanvasNode } from \"document/models/CanvasTree/index.ts\"\nimport type { PlaceholderItem } from \"document/models/CanvasTree/nodes/CanvasNodeCache.ts\"\nimport { hasColumnMasonryLayout } from \"document/models/CanvasTree/traits/WithLayout.ts\"\nimport type { MotionStyle } from \"framer-motion\"\nimport { ComponentContainerContext } from \"library/render/presentation/ComponentContainerContext.tsx\"\nimport type { FrameProps } from \"library/render/presentation/Frame/FrameWithMotion.tsx\"\nimport { FrameWithMotion } from \"library/render/presentation/Frame/FrameWithMotion.tsx\"\nimport { withColumnMasonryLayout } from \"library/render/presentation/withColumnMasonryLayout.tsx\"\nimport { ParentSizeState, ProvideParentSize } from \"library/render/types/NewConstraints.tsx\"\nimport type { Size } from \"library/render/types/Size.ts\"\nimport { useMeasureLayout } from \"library/render/utils/useMeasureLayout.ts\"\nimport React from \"react\"\nimport { getMasonryLayoutChildrenForMeasurement } from \"utils/getMasonryLayoutChildrenForMeasurement.ts\"\nimport { addPlaceholders } from \"./utils/addPlaceholders.tsx\"\nimport { isStackOrGridChildElement } from \"./utils/isStackOrGridChildElement.ts\"\n\nexport type CanvasLayoutProps = Partial<FrameProps> & { parentSize: Size | null } & {\n\tnode?: CanvasNode\n\tleft: number | null\n\tright: number | null\n\tbottom: number | null\n\ttop: number | null\n\twidth: number | \"auto\"\n\theight: number | \"auto\"\n\tplaceholders?: PlaceholderItem[]\n\tisRepeater?: boolean\n\t_constraints: any\n\tgap?: number\n}\n\nconst ColumnMasonryFrameWithMotion = withColumnMasonryLayout(FrameWithMotion)\n\nexport const CanvasLayout = React.forwardRef(function CanvasLayout(\n\tprops: CanvasLayoutProps,\n\t// CanvasLayoutTemplate forwards a ref down to locate the breakpoint content.\n\tforwardedRef: React.RefObject<HTMLDivElement>,\n) {\n\tconst {\n\t\tvisible,\n\t\tplaceholders,\n\t\tchildren,\n\t\t// make sure _needsMeasure isn't forwarded through frameProps\n\t\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\t\t_needsMeasure,\n\t\tisRepeater = false, // eslint-disable-line @typescript-eslint/no-unused-vars\n\t\tstyle,\n\t\t...frameProps\n\t} = props\n\n\tconst inCodeComponent = React.useContext(ComponentContainerContext)\n\tconst fallbackRef = React.useRef<HTMLDivElement>(null)\n\tconst layoutRef = forwardedRef ?? fallbackRef\n\tconst measureChildrenFn =\n\t\tprops.node && hasColumnMasonryLayout(props.node)\n\t\t\t? getMasonryLayoutChildrenForMeasurement\n\t\t\t: getLayoutChildrenForMeasurement\n\tuseMeasureLayout(props, layoutRef, measureChildrenFn)\n\n\tlet visibleChildrenWithPlaceholders = addPlaceholders(children, placeholders)\n\tif (isFirefox()) {\n\t\tvisibleChildrenWithPlaceholders = elementsWithFirefoxPositionRoundingFix(visibleChildrenWithPlaceholders)\n\t\tapplyFirefoxPositionRoundingFix(style || {})\n\t}\n\n\tif (visible === false) return null\n\n\tconst Component = props.node && hasColumnMasonryLayout(props.node) ? ColumnMasonryFrameWithMotion : FrameWithMotion\n\n\tif (inCodeComponent) {\n\t\treturn (\n\t\t\t<ProvideParentSize parentSize={ParentSizeState.Disabled}>\n\t\t\t\t<Component {...frameProps} style={style} ref={layoutRef}>\n\t\t\t\t\t{visibleChildrenWithPlaceholders}\n\t\t\t\t</Component>\n\t\t\t</ProvideParentSize>\n\t\t)\n\t}\n\n\treturn (\n\t\t<ProvideParentSize\n\t\t\t// We force DOM layout for the entire subtree inside of a repeater.\n\t\t\t// Because the parent sizes (width and height) for the repeated\n\t\t\t// content aren't known. Thereby breaking absolute positions.\n\t\t\tparentSize={isRepeater ? ParentSizeState.Disabled : ParentSizeState.DisabledForCurrentLevel}\n\t\t>\n\t\t\t<Component {...frameProps} style={style} ref={layoutRef}>\n\t\t\t\t{visibleChildrenWithPlaceholders}\n\t\t\t</Component>\n\t\t</ProvideParentSize>\n\t)\n})\n\n// Returns the HTML elements for all grid children, excluding the empty state, or the frame border.\n// The reason we're not using the passed in children is that we also need the rects for any placeholders,\n// which don't correspond directly to tree nodes.\nexport function getLayoutChildrenForMeasurement(element: Element | undefined | null) {\n\tif (!element) return []\n\n\treturn Array.from(element.children).filter(isStackOrGridChildElement)\n}\n\n// Setting a 0-rotation transform to the grid will force Firefox into a position rounding\n// behavior similar to Chrome. Rotation will be set to the string \"0deg\" since Motion will not set a transform\n// if its value is actually 0.\nfunction applyFirefoxPositionRoundingFix(style: MotionStyle) {\n\tif (!(\"rotate\" in style) || style.rotate === 0) {\n\t\tstyle.rotate = \"0deg\"\n\t}\n}\n\nfunction elementsWithFirefoxPositionRoundingFix(elements: Exclude<React.ReactNode, boolean | null | undefined>[]) {\n\treturn elements.map(element => {\n\t\tif (!React.isValidElement<any>(element)) {\n\t\t\treturn element\n\t\t}\n\n\t\tconst style = element.props.style || {}\n\t\tapplyFirefoxPositionRoundingFix(style)\n\n\t\treturn React.cloneElement(element, { style })\n\t})\n}\n", "import { AnnotationKey } from \"@framerjs/framer-runtime/crossorigin\"\nimport type { SandboxComponentLoader } from \"@framerjs/framer-runtime/sandbox\"\nimport type { ModuleExportIdentifierString } from \"@framerjs/shared\"\nimport type { NodeID } from \"document/models/CanvasTree/nodes/NodeID.ts\"\nimport type { Breakpoints } from \"document/models/CanvasTree/traits/WithBreakpointVariants.ts\"\nimport { isBreakpoints } from \"document/models/CanvasTree/traits/WithBreakpointVariants.ts\"\nimport { DEFAULT_ROOT_FONT_SIZE } from \"document/models/CanvasTree/traits/WithRootFontSize.ts\"\nimport { useMemo } from \"react\"\nimport { findActiveBreakpointId } from \"utils/getActiveBreakpoint.ts\"\n\ninterface ParsedLayoutTemplateAnnotations {\n\tactiveVariant: NodeID\n\tselectors: string[]\n\tclassName?: string\n\tminHeight: number\n\trootFontSize: number\n}\n\ntype SelectorCache = Map<string, string[]>\ntype BreakpointCache = Map<string, Breakpoints>\ntype LayoutTemplateAnnotationCache = {\n\tselectorCache: SelectorCache\n\tbreakpointCache: BreakpointCache\n}\nexport function createLayoutTemplateAnnotationCache(): LayoutTemplateAnnotationCache {\n\treturn {\n\t\tselectorCache: new Map(),\n\t\tbreakpointCache: new Map(),\n\t}\n}\n\nfunction getLayoutTemplateRectSelectorsOnActiveBreakpoint(\n\tselectorAnnotation: string | undefined,\n\tactiveVariant: NodeID | undefined,\n\tselectorCache: SelectorCache,\n): string[] {\n\tif (!activeVariant) return []\n\n\tif (!selectorAnnotation) return []\n\n\tconst parsed = selectorCache.get(selectorAnnotation) ?? JSON.parse(selectorAnnotation)\n\tselectorCache.set(selectorAnnotation, parsed)\n\n\treturn parsed[activeVariant] as string[]\n}\n\nfunction parseBreakpoints(breakpointAnnotation: string | undefined, breakpointCache: BreakpointCache) {\n\tif (!breakpointAnnotation) return undefined\n\n\tconst breakpointsByVariant = breakpointCache.get(breakpointAnnotation) ?? JSON.parse(breakpointAnnotation)\n\tif (!isBreakpoints(breakpointsByVariant)) return undefined\n\n\tbreakpointCache.set(breakpointAnnotation, breakpointsByVariant)\n\treturn breakpointsByVariant\n}\n\nexport function useLayoutTemplateAnnotations(\n\tcomponentLoader: SandboxComponentLoader,\n\tcomponentIdentifier: ModuleExportIdentifierString,\n\tbreakpointWidth: number | undefined,\n\tcache: LayoutTemplateAnnotationCache,\n): ParsedLayoutTemplateAnnotations | undefined {\n\tconst annotations = componentLoader.componentForIdentifier(componentIdentifier)?.annotations\n\tconst breakpointAnnotation = annotations?.[AnnotationKey.FramerBreakpoints]\n\tconst defaultVariant = annotations?.[AnnotationKey.FramerDefaultVariant]\n\tconst selectorAnnotation = annotations?.[AnnotationKey.FramerHitTargets]\n\n\treturn useMemo(() => {\n\t\tif (breakpointWidth === undefined) return undefined\n\n\t\tconst breakpoints = parseBreakpoints(breakpointAnnotation, cache.breakpointCache)\n\t\tconst activeVariant = findActiveBreakpointId(breakpoints, breakpointWidth) ?? defaultVariant\n\t\tif (!activeVariant) return undefined\n\n\t\treturn {\n\t\t\tactiveVariant,\n\t\t\tselectors: getLayoutTemplateRectSelectorsOnActiveBreakpoint(\n\t\t\t\tselectorAnnotation,\n\t\t\t\tactiveVariant,\n\t\t\t\tcache.selectorCache,\n\t\t\t),\n\t\t\tclassName: breakpoints?.[activeVariant]?.canvasClassName,\n\t\t\tminHeight: breakpoints?.[activeVariant]?.minHeight ?? 1000,\n\t\t\trootFontSize: breakpoints?.[activeVariant]?.rootFontSize ?? DEFAULT_ROOT_FONT_SIZE,\n\t\t}\n\t}, [breakpointAnnotation, selectorAnnotation, defaultVariant, breakpointWidth, cache])\n}\n", "import { HardCodedCodeIdentifier } from \"document/models/CanvasTree/traits/utils/hardCodedCodeComponentIdentifiers.ts\"\nimport { LayoutGroup } from \"framer-motion\"\nimport { AutomaticLayoutIds } from \"library/components/AnimateLayout/LayoutIdContext.tsx\"\nimport { isEqual, isStaticRenderer } from \"library/index.ts\"\nimport { ComponentContainerContext } from \"library/render/presentation/ComponentContainerContext.tsx\"\nimport type { DeprecatedCoreFrameProps } from \"library/render/presentation/Frame/DeprecatedFrame.tsx\"\nimport { FrameWithMotion } from \"library/render/presentation/Frame/FrameWithMotion.tsx\"\nimport type { FrameProps } from \"library/render/presentation/Frame/index.tsx\"\nimport type { LayerProps } from \"library/render/presentation/Layer.tsx\"\nimport type { NewConstraintProperties } from \"library/render/types/NewConstraints.tsx\"\nimport { RenderTarget } from \"library/render/types/RenderEnvironment.ts\"\nimport { withGeneratedLayoutId } from \"library/render/utils/withGeneratedLayoutId.tsx\"\nimport React from \"react\"\nimport { withErrorBoundary } from \"./withErrorBoundary.tsx\"\nimport { withMeasuredLayout } from \"./withMeasuredLayout.tsx\"\n\nexport interface ComponentContainerProperties extends Partial<NewConstraintProperties>, LayerProps {\n\tstyle: React.CSSProperties\n\tvisible: boolean\n\tname?: string\n\tinnerRef?: React.RefObject<HTMLDivElement>\n\tlayoutId?: string\n\tforwardedRef?: React.Ref<unknown>\n\tcomponentIdentifier: string\n\t__withWidth?: boolean\n\t/** If this component container is rendered as a slot container. If true, we don't consider descendants inside of a\n\t * code component. */\n\tisSlotContainer?: boolean\n}\n\n/**\n * @deprecated Creating new Page and Scroll components in Framer is no longer supported as of July\n * 2025. Existing Page and Scroll components will continue to work, but please use alternative\n * solutions for new projects.\n */\nfunction isPageOrScroll(identifier?: string) {\n\tif (!identifier) return false\n\tif (identifier === HardCodedCodeIdentifier.page) return true\n\tif (identifier === HardCodedCodeIdentifier.scroll) return true\n\treturn false\n}\n\n/** When rendering on the canvas, not all things done to the code component need it to re-render.\n * For example, dragging it around will change the _domRect property, but this is never passed into\n * the user component. Or when the children slots are recalculated, they are often the same when\n * compared deeply, but not when compared shallow. In both cases this inner wrapper will prevent\n * potentially expensive user components from rendering too much. */\nclass CanvasComponentWrapper extends React.Component<Partial<ComponentContainerProperties>> {\n\toverride shouldComponentUpdate(nextProps: Partial<ComponentContainerProperties>) {\n\t\treturn !isEqual(this.props, nextProps, true)\n\t}\n\n\toverride render() {\n\t\tif (process.env.NODE_ENV !== \"production\") window[\"perf\"]?.nodeRender()\n\t\treturn this.props.children\n\t}\n}\n\n/*\n * Create a container for Code Components to ensure they can be absolutely\n * positioned, and manipulated on the canvas.\n *\n * If rendered outside of the canvas environment:\n * 1. Conditionally wrap the code component in AnimateSharedLayout to enable\n *    `layout` animations to run independently of a framer navigation\n *    transition.\n * 2. Separate react props so that props that could be overridden by overrides,\n *    and effect styling, are applied to the container's `<Frame>`. This allows\n *    any code component to have a familiar `<Frame>` api for animations, even\n *    if the underlying code component does not implement such an api.\n */\nclass Container extends React.Component<Partial<ComponentContainerProperties>> {\n\toverride shouldComponentUpdate(nextProps: Partial<ComponentContainerProperties>) {\n\t\t// When we are on the canvas, we have an extra wrapper that will compare properties deeply.\n\t\t// So that the DOM layout and other machinery continues to work, without needing the\n\t\t// component itself to re-render if its properties don't change.\n\t\tconst deepCompareProps = RenderTarget.current() !== RenderTarget.canvas\n\t\treturn nextProps._needsMeasure || !isEqual(this.props, nextProps, deepCompareProps)\n\t}\n\n\toverride render() {\n\t\tconst {\n\t\t\tchildren,\n\t\t\tinnerRef,\n\t\t\tforwardedRef,\n\t\t\tcomponentIdentifier,\n\t\t\t__withWidth: withWidth,\n\t\t\tisSlotContainer,\n\t\t\t...props\n\t\t} = this.props\n\t\t// Don't destructure layoutId out of props so that it's passed into the child code component.\n\t\tconst layoutId = this.props.layoutId\n\n\t\tconst isRenderingStaticContent = isStaticRenderer()\n\n\t\tconst needsAnimateSharedLayout = !isPageOrScroll(componentIdentifier)\n\n\t\tconst { frameProps, childProps = {} } = separateChildAndFrameProps(props, {\n\t\t\tlayoutId,\n\t\t\tforwardedRef,\n\t\t\tonCanvas: isRenderingStaticContent,\n\t\t})\n\n\t\t// For the breakpoint experiment, we calculate the active breakpoint on\n\t\t// the canvas by reading the width of the ground node. We likely will\n\t\t// take a different approach if we pursue this prototype.\n\t\tif (withWidth) {\n\t\t\t;(childProps as Record<string, unknown>).width = props.width\n\t\t}\n\n\t\t// This is provided by the time budget logic in runtime.\n\t\twindow[\"__checkComponentBudget__\"]?.()\n\n\t\t// Sometimes we need to add to the props of the code component.\n\t\tlet contents: React.ReactNode = children\n\t\tif (!isRenderingStaticContent || withWidth) {\n\t\t\tcontents = React.Children.map(children, (child: React.ReactElement<typeof childProps>) => {\n\t\t\t\treturn React.isValidElement(child) ? React.cloneElement(child, childProps) : child\n\t\t\t})\n\t\t}\n\n\t\t// On the canvas we want to wrap the code component so it renders less often. In preview we\n\t\t// might need to wrap it with a layout group.\n\t\tif (isRenderingStaticContent) {\n\t\t\tcontents = <CanvasComponentWrapper>{contents}</CanvasComponentWrapper>\n\t\t} else if (needsAnimateSharedLayout) {\n\t\t\tcontents = (\n\t\t\t\t<LayoutGroup inherit={false} id={layoutId}>\n\t\t\t\t\t<AutomaticLayoutIds enabled={false}>{contents}</AutomaticLayoutIds>\n\t\t\t\t</LayoutGroup>\n\t\t\t)\n\t\t}\n\n\t\treturn (\n\t\t\t// The background should come before the frameProps. It looks like there never should be\n\t\t\t// a background in frameProps, but published design components can contain an old\n\t\t\t// version of the presentation tree that expects the background that is passed to be\n\t\t\t// rendered here See the stackBackgroundTest.tsx integration test for an example of such\n\t\t\t// a case.\n\t\t\t<ComponentContainerContext.Provider value={!isSlotContainer}>\n\t\t\t\t<FrameWithMotion\n\t\t\t\t\tdata-framer-component-container\n\t\t\t\t\tbackground={null}\n\t\t\t\t\toverflow=\"visible\"\n\t\t\t\t\tref={innerRef}\n\t\t\t\t\t// biome-ignore lint/suspicious/noExplicitAny: Improves the TypeScript performance by not checking for expensive intersections\n\t\t\t\t\t{...(frameProps as any)}\n\t\t\t\t\tdata-framer-component-type=\"ComponentContainer\"\n\t\t\t\t\tstyle={{ ...frameProps.style, pointerEvents: undefined }}\n\t\t\t\t>\n\t\t\t\t\t{contents}\n\t\t\t\t</FrameWithMotion>\n\t\t\t</ComponentContainerContext.Provider>\n\t\t)\n\t}\n}\n\nconst ForwardedContainer = React.forwardRef<unknown, Partial<ComponentContainerProperties>>((props, ref) => (\n\t<Container {...props} forwardedRef={ref} />\n))\n\n/**\n * Augment the basic Container with specific features:\n * 1. Wrap the component in an error boundary, so that if any user code throws,\n *    the component does not crash the entire canvas. Errors can be logged with\n *    a `log` prop, and a specific logger can be specified by passing a Logger\n *    as `logger`.\n * 2. In the preview, provide a run-time generated layoutId to the component container. This\n *    ensures that components that are duplicated from each other animate their\n *    position during magic motion transitions in Framer's preview.\n * 3. On the canvas, run DOM layout measurements of the wrapped component to\n *    inform the size of outlines in the HUD.\n */\nexport const ComponentContainer = withErrorBoundary(withGeneratedLayoutId(withMeasuredLayout(ForwardedContainer)))\n\n// For Code Overrides, in the preview, we want the styling properties to\n// be applied to the Frame, and the rest to the actual component.\nfunction separateChildAndFrameProps(\n\tprops: Partial<ComponentContainerProperties>,\n\t{\n\t\tlayoutId,\n\t\tforwardedRef,\n\t\tonCanvas,\n\t}: { layoutId: string | undefined; onCanvas: boolean; forwardedRef?: React.Ref<unknown> },\n) {\n\tif (onCanvas) return { frameProps: props }\n\n\tconst {\n\t\topacity, // eslint-disable-line @typescript-eslint/no-unused-vars\n\t\tchildren, // eslint-disable-line @typescript-eslint/no-unused-vars\n\t\tleft,\n\t\tright,\n\t\ttop,\n\t\tbottom,\n\t\tcenter,\n\t\tcenterX,\n\t\tcenterY,\n\t\taspectRatio,\n\t\tparentSize,\n\t\twidth,\n\t\theight,\n\t\trotation,\n\t\tvisible,\n\t\t_constraints,\n\t\t_initialStyle,\n\t\tname,\n\t\tpositionSticky,\n\t\tpositionStickyTop,\n\t\tpositionStickyRight,\n\t\tpositionStickyBottom,\n\t\tpositionStickyLeft,\n\t\tstyle,\n\t\tduplicatedFrom,\n\t\twidthType,\n\t\theightType,\n\t\t...childProps\n\t} = props as Partial<FrameProps & DeprecatedCoreFrameProps & ComponentContainerProperties>\n\n\treturn {\n\t\tchildProps: Object.assign(childProps, { ref: forwardedRef }),\n\t\tframeProps: {\n\t\t\tid: props.id + \"-container\",\n\t\t\tlayoutId,\n\t\t\tstyle,\n\t\t\t_constraints,\n\t\t\t_initialStyle,\n\t\t\tleft,\n\t\t\tright,\n\t\t\ttop,\n\t\t\tbottom,\n\t\t\tcenter,\n\t\t\tcenterX,\n\t\t\tcenterY,\n\t\t\taspectRatio,\n\t\t\tparentSize,\n\t\t\twidth,\n\t\t\theight,\n\t\t\trotation,\n\t\t\tvisible,\n\t\t\tname,\n\t\t\tduplicatedFrom,\n\t\t\twidthType,\n\t\t\theightType,\n\t\t\tpositionSticky,\n\t\t\tpositionStickyTop,\n\t\t\tpositionStickyRight,\n\t\t\tpositionStickyBottom,\n\t\t\tpositionStickyLeft,\n\t\t},\n\t}\n}\n", "import { BudgetError } from \"@framerjs/framer-runtime\"\nimport { RenderPlaceholder } from \"@framerjs/framer-runtime/components/RenderPlaceholder\"\nimport type { SandboxComponentLoader } from \"@framerjs/framer-runtime/sandbox\"\nimport type { Logger } from \"@framerjs/shared\"\nimport {\n\tModuleType,\n\tgetLogger,\n\tisExternalModuleIdentifier,\n\tisLocalModuleIdentifier,\n\tparseModuleIdentifier,\n} from \"@framerjs/shared\"\nimport { isBuiltInFramerModule } from \"document/components/utils/defaultComponents.ts\"\nimport { FrameWithMotion } from \"library/render/presentation/Frame/FrameWithMotion.tsx\"\nimport { DimensionType } from \"library/render/types/Constraints.ts\"\nimport React from \"react\"\nimport { moduleErrorMessage } from \"utils/moduleErrorMessage.ts\"\nimport type { NodeRendering } from \"./RenderingStateTracker.ts\"\n\nconst defaultLogger = getLogger(\"SandboxComponentError\")\n\ninterface State {\n\tisOverBudget: boolean\n\tlastError?: {\n\t\terror: Error\n\t\tstack?: string[]\n\t}\n}\n\ntype UnknownProps = Record<string, unknown>\n\ninterface Props extends UnknownProps {\n\tchildren?: React.ReactNode\n\tcomponentLoader: SandboxComponentLoader\n\tcomponentIdentifier: string\n\twidthType?: DimensionType\n\theightType?: DimensionType\n\tforwardedRef: React.Ref<unknown>\n\t__logger?: Logger\n\t__externalModuleType?: ModuleType | string\n\t__rendering?: NodeRendering\n}\n\ninterface FixedSizeOverrides {\n\twidth?: 200\n\twidthType?: DimensionType.FixedNumber\n\theight?: 200\n\theightType?: DimensionType.FixedNumber\n}\n\n/**\n * Flag whether a component should log caught runtime errors to Sentry. Ideally\n * we will only log runtime errors originating from all generated\n * SmartComponents, as well as the default components.\n */\nfunction componentLogsErrorsToSentry(componentIdentifier: string, moduleType?: ModuleType | string): boolean {\n\tconst identifier = parseModuleIdentifier(componentIdentifier)\n\n\tif (isExternalModuleIdentifier(identifier)) {\n\t\tif (isBuiltInFramerModule(identifier)) return true\n\t\treturn moduleType === ModuleType.Canvas\n\t} else if (\n\t\tisLocalModuleIdentifier(identifier) &&\n\t\t(identifier.type === ModuleType.Canvas || identifier.type === ModuleType.Screen)\n\t) {\n\t\treturn true\n\t}\n\treturn false\n}\n\n// Extract component name from stack trace: https://regex101.com/r/bfYqDv/1\nconst stackLineRegExp = /\\s*(?:at|in) (\\S+)/\n\nfunction stackUntilFunction(rawStack: string, fn: Function): string[] {\n\tconst result: string[] = []\n\tfor (const line of rawStack.split(\"\\n\")) {\n\t\tif (!line) continue\n\t\tconst match = line.match(stackLineRegExp)\n\t\tif (match?.[1] === fn.name) break\n\t\tresult.push(line)\n\t}\n\treturn result\n}\n\nexport function withErrorBoundary(Component: React.ComponentType<UnknownProps>) {\n\tclass ErrorBoundary extends React.Component<Props, State> {\n\t\tprivate logsToSentry: boolean = false\n\t\tprivate lastComponentIdentifier?: string\n\n\t\toverride state: State = {\n\t\t\tisOverBudget: false,\n\t\t}\n\n\t\t/**\n\t\t * Determine if the component should log caught runtime errors to\n\t\t * Sentry, based on it's componentIdentifier, caching the result based\n\t\t * on the identifier to prevent unnecessary parsing of the identifier.\n\t\t */\n\t\tprivate shouldLogToSentry(componentIdentifier: string, externalModuleType?: ModuleType | string) {\n\t\t\tif (this.lastComponentIdentifier === componentIdentifier) return this.logsToSentry\n\t\t\tthis.lastComponentIdentifier = componentIdentifier\n\t\t\treturn (this.logsToSentry = componentLogsErrorsToSentry(componentIdentifier, externalModuleType))\n\t\t}\n\n\t\tprivate scheduledTimer?: number\n\t\tprivate scheduleRerenderDueToBudget() {\n\t\t\tif (this.scheduledTimer) return\n\t\t\tthis.scheduledTimer = window.setTimeout(() => {\n\t\t\t\tthis.scheduledTimer = undefined\n\t\t\t\tthis.setState({ isOverBudget: false })\n\t\t\t}, 0)\n\t\t}\n\n\t\tstatic getDerivedStateFromError(error: Error): Partial<State> {\n\t\t\t// As of React 18, we have to make sure the state is updated as soon\n\t\t\t// as possible, so this returns the error without the component\n\t\t\t// stack, then the setState call in componentDidCatch will add it.\n\t\t\treturn { lastError: { error } }\n\t\t}\n\n\t\toverride componentDidCatch(error: Error, info: React.ErrorInfo) {\n\t\t\tif (error instanceof BudgetError) {\n\t\t\t\tthis.setState({ isOverBudget: true })\n\t\t\t\tthis.scheduleRerenderDueToBudget()\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst stack = info.componentStack ? stackUntilFunction(info.componentStack, this.constructor) : undefined\n\t\t\tthis.setState({ lastError: { error, stack } })\n\t\t}\n\n\t\trenderErrorPlaceholder(error: { title?: string; message: string }): JSX.Element {\n\t\t\t// Prevent auto sized Component axes from collapsing to 0, making\n\t\t\t// the error message unreadable.\n\t\t\tconst fixedSizeOverrides: FixedSizeOverrides = {}\n\t\t\tif (this.props.widthType === DimensionType.Auto) {\n\t\t\t\tfixedSizeOverrides.width = 200\n\t\t\t\tfixedSizeOverrides.widthType = DimensionType.FixedNumber\n\t\t\t}\n\n\t\t\tif (this.props.heightType === DimensionType.Auto) {\n\t\t\t\tfixedSizeOverrides.height = 200\n\t\t\t\tfixedSizeOverrides.heightType = DimensionType.FixedNumber\n\t\t\t}\n\n\t\t\treturn (\n\t\t\t\t// Don't pass layoutId to the placeholder\n\t\t\t\t<FrameWithMotion\n\t\t\t\t\t{...this.props}\n\t\t\t\t\tlayoutId={undefined}\n\t\t\t\t\tlayoutIdKey={undefined}\n\t\t\t\t\t{...fixedSizeOverrides}\n\t\t\t\t\tbackground={null}\n\t\t\t\t>\n\t\t\t\t\t<RenderPlaceholder error={error} />\n\t\t\t\t</FrameWithMotion>\n\t\t\t)\n\t\t}\n\n\t\toverride componentDidUpdate(_: Props, prevState: State) {\n\t\t\tthis.props.__rendering?.setLastRenderingError(this.state.lastError?.error ?? null)\n\n\t\t\tif (this.state.lastError === undefined) return\n\t\t\t// If `state.lastError` didn't change since the last render it means\n\t\t\t// that the the component was rendered due to a parent render or\n\t\t\t// change of props. In both these cases we want to let the wrapped\n\t\t\t// component try to render itself again and possibly fix the error,\n\t\t\t// so we clear `state.lastError`.\n\t\t\tif (prevState.lastError === this.state.lastError) this.setState({ lastError: undefined })\n\t\t}\n\n\t\toverride render() {\n\t\t\tconst {\n\t\t\t\tcomponentLoader,\n\t\t\t\t__logger: logger = defaultLogger,\n\t\t\t\t__externalModuleType: externalModuleType,\n\t\t\t\t__rendering,\n\t\t\t\tforwardedRef,\n\t\t\t\t...componentProps\n\t\t\t} = this.props\n\t\t\tconst componentIdentifier = this.props.componentIdentifier\n\t\t\tconst { lastError } = this.state\n\n\t\t\t// If the file of the component is in has a compile or load error,\n\t\t\t// there will be no children and there will be an error in the\n\t\t\t// componentLoader. If so we render that error.\n\t\t\tif (isEmpty(this.props.children)) {\n\t\t\t\tconst errorComponent = componentLoader.errorForIdentifier(componentIdentifier)\n\t\t\t\tif (errorComponent) {\n\t\t\t\t\tconst error = moduleErrorMessage(errorComponent, undefined)\n\t\t\t\t\treturn this.renderErrorPlaceholder(error)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Don\u2019t try to render the component if the frame budget is\n\t\t\t// exceeded.\n\t\t\tif (this.state.isOverBudget) {\n\t\t\t\treturn this.renderErrorPlaceholder({ message: \"\", title: \"\" })\n\t\t\t}\n\n\t\t\t// If there is an error caught by componentDidCatch, render an error\n\t\t\t// placeholder to prevent the error from being rethrown and crashing\n\t\t\t// the entire sandbox. Errors will be dismissed by\n\t\t\t// componentDidUpdate when the component ceases crashing as the\n\t\t\t// result of the file or props being updated.\n\t\t\tif (lastError) {\n\t\t\t\tconst component = componentLoader.componentForIdentifier(componentIdentifier)\n\t\t\t\tconst error = moduleErrorMessage(component, lastError.error)\n\n\t\t\t\tif (this.shouldLogToSentry(componentIdentifier, externalModuleType)) {\n\t\t\t\t\tconst file = component ? component.file : \"???\"\n\t\t\t\t\tlogger.reportErrorOncePerMinute(lastError.error, { file, stack: lastError.stack })\n\t\t\t\t}\n\n\t\t\t\treturn this.renderErrorPlaceholder(error)\n\t\t\t}\n\n\t\t\treturn <Component {...componentProps} ref={forwardedRef} />\n\t\t}\n\t}\n\n\treturn React.forwardRef((props: Props, ref) => <ErrorBoundary {...props} forwardedRef={ref} />)\n}\n\nfunction isEmpty(children?: React.ReactNode) {\n\tif (!children) return true\n\n\tif (Array.isArray(children)) {\n\t\tconst childCount = React.Children.count(children)\n\t\tif (childCount === 0) return true\n\n\t\t// Note, cannot use React.Children.count when children = [null], so\n\t\t// specifically account for that case by checking for [null].\n\t\tconst [firstChild] = children\n\t\tif (firstChild === null && childCount === 1) return true\n\t}\n\n\treturn false\n}\n", "import { getMeasurableCodeComponentChildren } from \"library/render/utils/getMeasurableCodeComponentChildren.ts\"\nimport { useMeasureLayout } from \"library/render/utils/useMeasureLayout.ts\"\nimport React from \"react\"\n\nexport const withMeasuredLayout = <T extends { innerRef?: React.RefObject<HTMLDivElement> }>(\n\tComponent: React.ComponentType<T>,\n) =>\n\tReact.forwardRef((props: T, ref) => {\n\t\tconst { innerRef, ...rest } = props\n\t\tconst fallbackRef = React.useRef<HTMLDivElement>(null)\n\t\tconst layoutRef = innerRef ?? fallbackRef\n\n\t\tuseMeasureLayout(rest, layoutRef, getMeasurableCodeComponentChildren)\n\n\t\treturn <Component {...props} innerRef={layoutRef} ref={ref} />\n\t})\n", "import type { LayoutType } from \"document/models/CanvasTree/traits/WithLayout.ts\"\nimport { floatingZIndex } from \"document/models/CanvasTree/traits/WithZIndex.ts\"\n\ninterface CanvasPortalProps {\n\tid: string\n\tviewportHeight: number | undefined\n\ttype: LayoutType | undefined\n}\n\nconst VIEWPORT_PORTAL_ID_PREFIX = \"framer-viewport-portal-root\"\nexport function isPortalElement(element: Element): boolean {\n\treturn element.id.startsWith(VIEWPORT_PORTAL_ID_PREFIX)\n}\n\nexport function viewportPortalID(id: string, type: LayoutType | \"none\" = \"none\") {\n\treturn `${VIEWPORT_PORTAL_ID_PREFIX}-${id}-${type}`\n}\n\nexport const ViewportCanvasPortal = ({ id, viewportHeight, type }: CanvasPortalProps) => {\n\treturn (\n\t\t<div\n\t\t\tid={viewportPortalID(id, type)}\n\t\t\t// Here maxHeight is set to 100% to prevent the portal target from\n\t\t\t// ever being larger than the providing frame, which currently is\n\t\t\t// always a webpage ground node, even if the user-defined viewport\n\t\t\t// size is larger. This can happen when resizing a ground node, or\n\t\t\t// when a ground node is an auto height stack, and contents are\n\t\t\t// removed.\n\t\t\tstyle={{\n\t\t\t\ttop: 0,\n\t\t\t\tleft: 0,\n\t\t\t\tright: 0,\n\t\t\t\tposition: \"absolute\",\n\t\t\t\theight: viewportHeight,\n\t\t\t\tmaxHeight: \"100%\",\n\t\t\t}}\n\t\t/>\n\t)\n}\n\nconst PORTAL_ID_PREFIX = \"framer-portal-root\"\nexport function visibleOverflowPortalID(id: string, type: LayoutType | \"none\" = \"none\") {\n\treturn `${PORTAL_ID_PREFIX}-${id}-${type}`\n}\n\nexport const VisibleOverflowCanvasPortal = ({ id, type }: Omit<CanvasPortalProps, \"viewportHeight\">) => {\n\treturn (\n\t\t<div\n\t\t\tid={visibleOverflowPortalID(id, type)}\n\t\t\tstyle={{\n\t\t\t\tposition: \"fixed\",\n\t\t\t\twidth: \"100%\",\n\t\t\t\theight: \"100%\",\n\t\t\t\ttop: 0,\n\t\t\t\tleft: 0,\n\t\t\t\tzIndex: floatingZIndex,\n\t\t\t}}\n\t\t/>\n\t)\n}\n", "import { type ModuleExportIdentifierString, isModuleExportIdentifier } from \"@framerjs/shared\"\nimport { ANIMATED_PROP_NAME } from \"code-generation/jsx/svg/svgContext.ts\"\nimport type { CodeComponentNode } from \"document/models/CanvasTree/index.ts\"\nimport { stringFromNodeID } from \"document/models/CanvasTree/nodes/NodeID.ts\"\nimport { isDynamicValue } from \"document/models/CanvasTree/traits/DynamicValue.ts\"\nimport type { CombinedVariableProviderValueMap } from \"document/models/CanvasTree/traits/VariableProvider.ts\"\nimport { isVectorSetItemVariableInitialValue } from \"document/models/CanvasTree/traits/WithVariables.ts\"\nimport type { MotionStyle } from \"framer-motion\"\nimport { type FrameProps, useStyleAndRect } from \"library/render/presentation/Frame/FrameWithMotion.tsx\"\nimport { layoutHintDataPropsForCenter } from \"library/render/utils/layoutHintDataPropsForCenter.ts\"\nimport { transformTemplate } from \"library/render/utils/transformTemplate.ts\"\nimport { useMeasureLayout } from \"library/render/utils/useMeasureLayout.ts\"\nimport type { ReactNode } from \"react\"\nimport { useRef } from \"react\"\nimport { isValidElementType } from \"react-is\"\nimport { isString } from \"utils/typeChecks.ts\"\n\nfunction centerProps(center: boolean | \"x\" | \"y\" | undefined) {\n\treturn {\n\t\t...layoutHintDataPropsForCenter(center),\n\t\ttransformTemplate: transformTemplate(center),\n\t}\n}\n\nfunction valueForWidth(props: Partial<FrameProps>) {\n\t// Unlike normal code components which render inside a container, vectors render without any\n\t// wrappers. As a result, when we want to render them at their intrinsic size, we need to avoid\n\t// setting any width/height so that they can render with the intrinsic width and aspect ratio\n\t// code-generated into an applied class name.\n\tif (props.width === \"auto\" && props.height === \"auto\") return undefined\n\treturn props.width ?? \"auto\"\n}\n\nfunction defaultProps(props: Partial<FrameProps>) {\n\tprops.__fromCanvasComponent = true\n\n\t// Vector instances have a set width. The height is rendered via the aspect ratio. To ensure\n\t// that setting top/bottom pins can create an adaptive width, when the width is undefined, we\n\t// unset it with auto.\n\tprops.width = valueForWidth(props)\n\treturn props\n}\n\nconst baseProps = {\n\t// Always render vector instances with motion.\n\t[ANIMATED_PROP_NAME]: true,\n} as const\n\nObject.freeze(baseProps)\n\nexport interface GetPropsResult extends ReturnType<CodeComponentNode[\"getCodeComponentProps\"]> {\n\tid: string\n\tstyle: MotionStyle\n\tclassName?: string\n}\n\ninterface UseVectorParameters {\n\tnode: CodeComponentNode\n\tcombinedValueMap: CombinedVariableProviderValueMap | undefined\n\tframeProps: Partial<FrameProps>\n\tgetCodeComponentProps: () => ReturnType<CodeComponentNode[\"getCodeComponentProps\"]>\n\trenderVectorWithIdentifier: (\n\t\tidentifier: ModuleExportIdentifierString,\n\t\tgetProps: () => GetPropsResult,\n\t) => React.ReactNode\n}\n\nexport function useVectorComponent({\n\tnode,\n\tcombinedValueMap,\n\tframeProps,\n\tgetCodeComponentProps,\n\trenderVectorWithIdentifier,\n}: UseVectorParameters): ReactNode | null {\n\tconst vector = isDynamicValue(node.dynamicVectorSetIdentifier)\n\t\t? node.resolveValue(\"dynamicVectorSetIdentifier\", combinedValueMap)\n\t\t: node.codeComponentIdentifier\n\n\tconst identifier = isVectorSetItemVariableInitialValue(vector)\n\t\t? vector?.identifier\n\t\t: isString(vector) && isModuleExportIdentifier(vector)\n\t\t\t? vector\n\t\t\t: undefined\n\n\tconst isModuleExport = isModuleExportIdentifier(identifier)\n\n\t// Be sure to use the rendering id for measuring.\n\tconst id = frameProps.id ?? stringFromNodeID(node.id)\n\tconst visible = node.isVisible()\n\tconst ref = useRef(null)\n\n\tuseMeasureLayout(\n\t\t{\n\t\t\tid,\n\t\t\t_needsMeasure: frameProps._needsMeasure,\n\t\t\tvisible,\n\t\t},\n\t\tref,\n\t)\n\n\t// Convert Frame props to Motion props, avoiding the need for a wrapping FrameWithMotion.\n\tconst [style] = useStyleAndRect(defaultProps(frameProps))\n\n\tif (!identifier || !vector || !visible) {\n\t\treturn null\n\t}\n\n\tif (isModuleExport) {\n\t\treturn renderVectorWithIdentifier(identifier, () => ({\n\t\t\t...baseProps,\n\t\t\t...centerProps(frameProps.center),\n\t\t\t...getCodeComponentProps(),\n\t\t\tref,\n\t\t\tid,\n\t\t\tstyle,\n\t\t\t\"data-framer-component-type\": \"Frame\",\n\t\t}))\n\t}\n\n\tif (isValidElementType(vector)) {\n\t\tconst Component = vector\n\t\treturn <Component {...getCodeComponentProps()} ref={ref} id={id} style={style} data-framer-component-type=\"Frame\" />\n\t}\n\n\treturn null\n}\n", "import type { CanvasNode, CanvasTree } from \"document/models/CanvasTree/index.ts\"\nimport type { VariableID } from \"document/models/CanvasTree/traits/WithVariables.ts\"\nimport { getVariableReferencesFromNode } from \"./getVariableReferencesFromNode.ts\"\n\nconst cache = new WeakMap<CanvasNode, ReadonlySet<VariableID>>()\n\nexport function getVariableReferencesForProvider(tree: CanvasTree, node: CanvasNode): ReadonlySet<VariableID> {\n\tconst cached = cache.get(node)\n\tif (cached) return cached\n\n\tconst variableIds = new Set<string>()\n\n\t// Always include the id of the item.\n\tvariableIds.add(\"id\")\n\n\tconst nodeVariables = getVariableReferencesFromNode(tree, node)\n\tconst providerId = node.getPrimaryId()\n\n\tfor (const variable of nodeVariables) {\n\t\tif (variable.providerId === providerId) {\n\t\t\tvariableIds.add(variable.id)\n\t\t}\n\t}\n\n\tcache.set(node, variableIds)\n\treturn variableIds\n}\n", "import { RenderPlaceholder } from \"@framerjs/framer-runtime/components/RenderPlaceholder\"\nimport {\n\ttype ModuleExportIdentifierString,\n\tisExternalModuleIdentifier,\n\tisModuleExportIdentifier,\n} from \"@framerjs/shared\"\nimport type { CodeComponentNode } from \"document/models/CanvasTree/index.ts\"\nimport { isDynamicValue } from \"document/models/CanvasTree/traits/DynamicValue.ts\"\nimport type { CombinedVariableProviderValueMap } from \"document/models/CanvasTree/traits/VariableProvider.ts\"\nimport { isVectorSetItemVariableInitialValue } from \"document/models/CanvasTree/traits/WithVariables.ts\"\nimport { motion } from \"framer-motion\"\nimport type { FrameProps } from \"library/render/presentation/Frame/FrameWithMotion.tsx\"\nimport type { Locale } from \"library/router/types.ts\"\nimport React, { type CSSProperties } from \"react\"\nimport { useModulesRuntime } from \"utils/ModulesRuntimeContext.ts\"\nimport { useModuleState } from \"utils/useModuleState.tsx\"\nimport type { RenderingStateTracker } from \"./RenderingStateTracker.ts\"\nimport { getAssetResolverWithHash } from \"./getAssetResolver.ts\"\nimport { type GetPropsResult, useVectorComponent } from \"./utils/useVectorComponent.tsx\"\n\ninterface VectorSetItemProps extends Record<string, unknown> {\n\tclassName?: string\n\tstyle?: CSSProperties\n\t_needsMeasure?: boolean\n\tid?: string\n}\n\nexport function reactComponentForVectorSetIdentifier(identifier: ModuleExportIdentifierString) {\n\treturn React.forwardRef((props: VectorSetItemProps, ref) => {\n\t\tconst modulesRuntime = useModulesRuntime()\n\t\tconst [state, ModuleErrorBoundary] = useModuleState(modulesRuntime, identifier)\n\n\t\tswitch (state.status) {\n\t\t\tcase \"loading\":\n\t\t\t\treturn (\n\t\t\t\t\t<div className={props.className} style={props.style}>\n\t\t\t\t\t\t<RenderPlaceholder />\n\t\t\t\t\t</div>\n\t\t\t\t)\n\t\t\tcase \"error\":\n\t\t\t\treturn (\n\t\t\t\t\t<div className={props.className} style={props.style}>\n\t\t\t\t\t\t<RenderPlaceholder error={{ title: state.title, message: state.message }} />\n\t\t\t\t\t</div>\n\t\t\t\t)\n\t\t\tdefault: {\n\t\t\t\tconst Component = state.definition.class\n\t\t\t\treturn (\n\t\t\t\t\t<ModuleErrorBoundary>\n\t\t\t\t\t\t<Component {...props} ref={ref} />\n\t\t\t\t\t</ModuleErrorBoundary>\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\t})\n}\n\ninterface CanvasVectorForIdentifierProps {\n\ttracker: RenderingStateTracker\n\tidentifier: ModuleExportIdentifierString\n\tgetProps: () => GetPropsResult\n}\n\nconst CanvasVectorForIdentifier = React.forwardRef(function CanvasVectorForIdentifier(\n\t{ tracker, identifier, getProps }: CanvasVectorForIdentifierProps,\n\tref,\n) {\n\tconst [state, ModuleErrorBoundary] = useModuleState(tracker.modulesRuntime, identifier)\n\n\tconst { id, style, className, ...props } = getProps()\n\n\tswitch (state.status) {\n\t\tcase \"loading\":\n\t\t\tif (id) tracker.trackLoading(id)\n\n\t\t\treturn (\n\t\t\t\t<motion.div className={className} style={style}>\n\t\t\t\t\t<RenderPlaceholder />\n\t\t\t\t</motion.div>\n\t\t\t)\n\t\tcase \"error\":\n\t\t\tif (id) tracker.trackLoaded(id)\n\n\t\t\treturn (\n\t\t\t\t<motion.div className={className} style={style}>\n\t\t\t\t\t<RenderPlaceholder error={{ title: state.title, message: state.message }} />\n\t\t\t\t</motion.div>\n\t\t\t)\n\t\tdefault: {\n\t\t\tconst Component = state.definition.class\n\t\t\tif (id) tracker.trackLoaded(id)\n\n\t\t\treturn (\n\t\t\t\t<ModuleErrorBoundary>\n\t\t\t\t\t<Component ref={ref} {...props} id={id} style={style} data-framer-component-type=\"Frame\" />\n\t\t\t\t</ModuleErrorBoundary>\n\t\t\t)\n\t\t}\n\t}\n})\n\nfunction PreloadDefaultVector({ identifier }: { identifier: ModuleExportIdentifierString }) {\n\tconst modulesRuntime = useModulesRuntime()\n\tuseModuleState(modulesRuntime, identifier)\n\treturn null\n}\n\ninterface CanvasVectorProps {\n\ttracker: RenderingStateTracker\n\tnode: CodeComponentNode\n\tframeProps: Partial<FrameProps>\n\tactiveLocale: Locale | undefined\n\tcombinedValueMap: CombinedVariableProviderValueMap | undefined\n}\n\nexport function CanvasVector({ tracker, node, activeLocale, combinedValueMap, frameProps }: CanvasVectorProps) {\n\treturn useVectorComponent({\n\t\tnode,\n\t\tcombinedValueMap,\n\t\tframeProps,\n\t\tgetCodeComponentProps() {\n\t\t\treturn node.getCodeComponentProps(\n\t\t\t\ttracker.componentLoader,\n\t\t\t\tgetAssetResolverWithHash(),\n\t\t\t\tcombinedValueMap,\n\t\t\t\tactiveLocale,\n\t\t\t\ttracker.createFetchDataValueResolver(node),\n\t\t\t)\n\t\t},\n\t\trenderVectorWithIdentifier(identifier, getProps) {\n\t\t\tconst resolvedDynamicVectorIdentifier = isDynamicValue(node.dynamicVectorSetIdentifier)\n\t\t\t\t? node.resolveValue(\"dynamicVectorSetIdentifier\", combinedValueMap)\n\t\t\t\t: node.codeComponentIdentifier\n\n\t\t\tconst resolvedIdentifier = isVectorSetItemVariableInitialValue(resolvedDynamicVectorIdentifier)\n\t\t\t\t? resolvedDynamicVectorIdentifier.identifier\n\t\t\t\t: resolvedDynamicVectorIdentifier\n\n\t\t\treturn (\n\t\t\t\t// When the base component identifier is an external module, and it differs from the\n\t\t\t\t// resolved dynamic vector identifier, we need to preload the base component.\n\t\t\t\t<>\n\t\t\t\t\t{resolvedIdentifier !== node.codeComponentIdentifier &&\n\t\t\t\t\tisModuleExportIdentifier(node.codeComponentIdentifier) &&\n\t\t\t\t\tisExternalModuleIdentifier(node.codeComponentIdentifier) ? (\n\t\t\t\t\t\t<PreloadDefaultVector identifier={node.codeComponentIdentifier} />\n\t\t\t\t\t) : null}\n\t\t\t\t\t<CanvasVectorForIdentifier tracker={tracker} getProps={getProps} identifier={identifier} />\n\t\t\t\t</>\n\t\t\t)\n\t\t},\n\t})\n}\n", "import type { AnyComponentLoader, ReactComponentDefinition } from \"@framerjs/framer-runtime\"\nimport type { SandboxReactComponentDefinition } from \"@framerjs/framer-runtime/sandbox\"\nimport { assert, type ModuleExportIdentifierString } from \"@framerjs/shared\"\nimport { getCollectionControlProp, getVariableMap } from \"code-generation/components/cms/getCollectionControlProp.ts\"\nimport { type DatabaseValueResolvers, getDatabaseValue } from \"code-generation/components/cms/getDatabaseValue.ts\"\nimport { getDatabaseValueDefinition } from \"code-generation/components/cms/getDatabaseValueDefinition.ts\"\nimport type { CanvasTree, CollectionNode } from \"document/models/CanvasTree/index.ts\"\nimport type { CollectionItemNode } from \"document/models/CanvasTree/nodes/CollectionItemNode.ts\"\nimport type { CollectionChildrenVisibility } from \"document/models/CanvasTree/nodes/CollectionNodeCache.ts\"\nimport { compileRichTextForCanvasRendering } from \"document/models/CanvasTree/nodes/utils/compileRichText.tsx\"\nimport { defaultLocaleId } from \"document/models/CanvasTree/traits/WithLocales.ts\"\nimport { walkRichTextDocument } from \"document/models/richText/richTextDocumentTraversal.ts\"\nimport { isRichTextTreeValue, type RichTextTreeValue } from \"document/models/richText/richTextStorage.ts\"\nimport {\n\tcreatedAtVariableId,\n\tnextItemVariableId,\n\tpreviousItemVariableId,\n\tupdatedAtVariableId,\n} from \"document/utils/CollectionItemVariables.ts\"\nimport { ControlType, type Locale } from \"library/index.ts\"\nimport type { DatabaseValue } from \"library/modules/cms/DatabaseValue.ts\"\nimport type {\n\tDatabaseCollection,\n\tDatabaseIndex,\n\tDatabaseItem,\n\tDatabaseItemPointer,\n\tDatabaseRichTextPointer,\n\tDatabaseSchema,\n\tDatabaseVectorSetItemPointer,\n} from \"library/modules/cms/types.ts\"\nimport { iterateRichTextModuleIdentifiers } from \"prosemirror/schema/module.ts\"\nimport type { Mutable } from \"utils/Mutable.ts\"\nimport { resolveLinkToURL } from \"utils/resolveLink.ts\"\nimport { isString, isUndefined } from \"utils/typeChecks.ts\"\nimport { reactComponentForVectorSetIdentifier } from \"./CanvasVector.tsx\"\nimport { getAssetResolver } from \"./getAssetResolver.ts\"\n\nexport class TreeDatabaseCollection implements DatabaseCollection {\n\treadonly schema: DatabaseSchema\n\treadonly items: DatabaseItem[] = []\n\treadonly indexes: DatabaseIndex[] = []\n\n\treadonly assetResolver = getAssetResolver()\n\n\treadonly usedComponents = new Map<\n\t\tModuleExportIdentifierString,\n\t\tReactComponentDefinition | SandboxReactComponentDefinition\n\t>()\n\n\treadonly resolvers: DatabaseValueResolvers = {\n\t\tresolveColor: value => {\n\t\t\treturn value\n\t\t},\n\t\tresolveFile: identifier => {\n\t\t\treturn this.assetResolver(identifier)\n\t\t},\n\t\tresolveImage: (identifier, focalPoint) => {\n\t\t\tconst src = this.assetResolver(identifier)\n\t\t\tif (isUndefined(src)) return\n\n\t\t\treturn { src, ...focalPoint }\n\t\t},\n\t\tresolveLink: link => {\n\t\t\treturn resolveLinkToURL(this.tree, link)\n\t\t},\n\t\tresolveRichTextPointer: value => {\n\t\t\treturn value\n\t\t},\n\t\tresolveVectorSetItemPointer: pointer => {\n\t\t\treturn pointer\n\t\t},\n\t}\n\n\tconstructor(\n\t\treadonly tree: CanvasTree,\n\t\treadonly componentLoader: AnyComponentLoader,\n\t\treadonly collectionNode: CollectionNode,\n\t\treadonly locale: Locale | undefined,\n\t\treadonly visibility: CollectionChildrenVisibility,\n\t) {\n\t\tconst variableMap = getVariableMap(collectionNode.variables)\n\t\tconst propertyControls = collectionNode.getPropertyControls(tree, componentLoader)\n\t\tconst controlEntries = Object.entries(propertyControls)\n\n\t\tconst schema: Mutable<DatabaseSchema> = {\n\t\t\tid: {\n\t\t\t\ttype: ControlType.String,\n\t\t\t\tisNullable: false,\n\t\t\t},\n\t\t\t[createdAtVariableId]: {\n\t\t\t\ttype: ControlType.Date,\n\t\t\t\tisNullable: true,\n\t\t\t},\n\t\t\t[updatedAtVariableId]: {\n\t\t\t\ttype: ControlType.Date,\n\t\t\t\tisNullable: true,\n\t\t\t},\n\t\t\t[previousItemVariableId]: {\n\t\t\t\ttype: ControlType.String,\n\t\t\t\tisNullable: true,\n\t\t\t},\n\t\t\t[nextItemVariableId]: {\n\t\t\t\ttype: ControlType.String,\n\t\t\t\tisNullable: true,\n\t\t\t},\n\t\t}\n\n\t\tfor (const [key, control] of controlEntries) {\n\t\t\tconst definition = getDatabaseValueDefinition(control)\n\t\t\tif (definition) schema[key] = definition\n\t\t}\n\n\t\tthis.schema = schema\n\n\t\tconst allChildren = collectionNode.getSortedChildren(visibility, \"group-drafts\")\n\t\tconst children = locale ? allChildren.filter(child => isIncludedInLocale(child, locale)) : allChildren\n\n\t\tfor (let index = 0; index < children.length; index++) {\n\t\t\tconst collectionItemNode = children.at(index)\n\t\t\tif (!collectionItemNode) continue\n\n\t\t\tconst previousCollectionItemNode = children[index - 1]\n\t\t\tconst nextCollectionItemNode = children[index + 1]\n\n\t\t\tconst data: Record<string, DatabaseValue> = {\n\t\t\t\tid: {\n\t\t\t\t\ttype: ControlType.String,\n\t\t\t\t\tvalue: collectionItemNode.id,\n\t\t\t\t},\n\t\t\t\t[createdAtVariableId]: collectionItemNode.createdAt\n\t\t\t\t\t? {\n\t\t\t\t\t\t\ttype: ControlType.Date,\n\t\t\t\t\t\t\tvalue: new Date(collectionItemNode.createdAt).toISOString(),\n\t\t\t\t\t\t}\n\t\t\t\t\t: null,\n\t\t\t\t[updatedAtVariableId]: collectionItemNode.updatedAt\n\t\t\t\t\t? {\n\t\t\t\t\t\t\ttype: ControlType.Date,\n\t\t\t\t\t\t\tvalue: new Date(collectionItemNode.updatedAt).toISOString(),\n\t\t\t\t\t\t}\n\t\t\t\t\t: null,\n\t\t\t\t[previousItemVariableId]: previousCollectionItemNode\n\t\t\t\t\t? {\n\t\t\t\t\t\t\ttype: ControlType.String,\n\t\t\t\t\t\t\tvalue: previousCollectionItemNode.id,\n\t\t\t\t\t\t}\n\t\t\t\t\t: null,\n\t\t\t\t[nextItemVariableId]: nextCollectionItemNode\n\t\t\t\t\t? {\n\t\t\t\t\t\t\ttype: ControlType.String,\n\t\t\t\t\t\t\tvalue: nextCollectionItemNode.id,\n\t\t\t\t\t\t}\n\t\t\t\t\t: null,\n\t\t\t}\n\n\t\t\tfor (const [key, control] of controlEntries) {\n\t\t\t\tconst controlProp = getCollectionControlProp(key, control, variableMap, propertyControls, collectionItemNode)\n\n\t\t\t\tif (!controlProp) continue\n\n\t\t\t\tconst databaseValue = getDatabaseValue({\n\t\t\t\t\tcontrol,\n\t\t\t\t\tcontrolProp,\n\t\t\t\t\tresolvers: this.resolvers,\n\t\t\t\t\tlocale: this.locale,\n\t\t\t\t})\n\n\t\t\t\tdata[key] = databaseValue ?? null\n\t\t\t}\n\n\t\t\tconst item: DatabaseItem = {\n\t\t\t\tpointer: String(index),\n\t\t\t\tdata,\n\t\t\t}\n\n\t\t\tthis.items.push(item)\n\t\t}\n\t}\n\n\tresolveRichText(pointer: DatabaseRichTextPointer) {\n\t\tassert(isRichTextTreeValue(pointer), \"Pointer must be rich text\")\n\n\t\tfor (const componentIdentifier of iterateRichTextTreeValueModuleIdentifiers(pointer)) {\n\t\t\tconst definition = this.componentLoader.reactComponentForIdentifier(componentIdentifier)\n\t\t\tif (!definition) continue\n\n\t\t\tthis.usedComponents.set(componentIdentifier, definition)\n\t\t}\n\n\t\treturn compileRichTextForCanvasRendering(pointer, {\n\t\t\tcomponentLoader: this.componentLoader,\n\t\t\tresolveVectorSetItem: identifier => reactComponentForVectorSetIdentifier(identifier),\n\t\t\ttree: this.tree,\n\t\t})\n\t}\n\n\tresolveVectorSetItem(pointer: DatabaseVectorSetItemPointer) {\n\t\t// The pointer from the tree is a module export identifier. We return it directly as it is\n\t\t// expected to be handled by `CanvasVector` or `reactComponentForVectorSetIdentifier` (in\n\t\t// the case it is provided to a Smart Component property control). In both of these cases\n\t\t// the identifier will be preloaded properly if it is external, and rerender when the\n\t\t// evaluation result changes.\n\t\treturn pointer as ModuleExportIdentifierString\n\t}\n\n\tasync scanItems() {\n\t\treturn this.items\n\t}\n\n\tasync resolveItems(pointers: DatabaseItemPointer[]) {\n\t\treturn pointers.map(pointer => {\n\t\t\tconst index = Number(pointer)\n\t\t\tconst item = this.items[index]\n\t\t\tassert(item, \"Item must exist\")\n\t\t\treturn item\n\t\t})\n\t}\n\n\tcompareItems(left: DatabaseItem, right: DatabaseItem) {\n\t\treturn Number(left.pointer) - Number(right.pointer)\n\t}\n}\n\nfunction iterateRichTextTreeValueModuleIdentifiers(value: RichTextTreeValue): Iterable<ModuleExportIdentifierString> {\n\tif (isString(value)) {\n\t\treturn iterateRichTextModuleIdentifiers(value)\n\t}\n\n\tconst identifiers = new Set<ModuleExportIdentifierString>()\n\twalkRichTextDocument(value, {\n\t\tmodule(block) {\n\t\t\tidentifiers.add(block.identifier)\n\t\t},\n\t})\n\treturn identifiers\n}\n\nconst collectionCache = new WeakMap<CollectionNode, TreeDatabaseCollection[]>()\n\nexport function getCachedTreeDatabaseCollection(\n\ttree: CanvasTree,\n\tcomponentLoader: AnyComponentLoader,\n\tcollectionNode: CollectionNode,\n\tlocale: Locale | undefined,\n\tvisibility: CollectionChildrenVisibility,\n) {\n\tconst cachedCollections = collectionCache.get(collectionNode) ?? []\n\tcollectionCache.set(collectionNode, cachedCollections)\n\n\tconst cachedCollectionIndex = cachedCollections.findIndex(\n\t\tcached => cached.visibility === visibility && cached.locale === locale,\n\t)\n\n\tconst cachedCollection = cachedCollections[cachedCollectionIndex]\n\tif (cachedCollection && usesLatestComponents(cachedCollection, componentLoader)) {\n\t\treturn cachedCollection\n\t}\n\n\tconst newCollection = new TreeDatabaseCollection(tree, componentLoader, collectionNode, locale, visibility)\n\n\tif (cachedCollectionIndex >= 0) {\n\t\tcachedCollections[cachedCollectionIndex] = newCollection\n\t} else {\n\t\tcachedCollections.push(newCollection)\n\t}\n\n\treturn newCollection\n}\n\nfunction isIncludedInLocale(node: CollectionItemNode, locale: Locale): boolean {\n\tif (!node.includedLocales) return true\n\tif (locale.id === defaultLocaleId) return true\n\treturn node.includedLocales.includes(locale.id)\n}\n\nfunction usesLatestComponents(database: TreeDatabaseCollection, componentLoader: AnyComponentLoader) {\n\tfor (const [identifier, definition] of database.usedComponents) {\n\t\tconst latestDefinition = componentLoader.reactComponentForIdentifier(identifier)\n\t\tif (latestDefinition !== definition) return false\n\t}\n\n\treturn true\n}\n", "import type { SandboxComponentLoader } from \"@framerjs/framer-runtime/sandbox\"\nimport { assert, type ModuleExportIdentifierString } from \"@framerjs/shared\"\nimport { collectionIdKey } from \"code-generation/components/cms/dataIdKeys.ts\"\nimport {\n\tgetQueryDefaultCollectionAlias,\n\tgetQueryFrom,\n\tgetQuerySelect,\n} from \"code-generation/utils/valueTransformCollector/getQueryForDataRepeater.ts\"\nimport type {\n\tCanvasNode,\n\tCanvasTree,\n\tCollectionItemNode,\n\tCollectionNode,\n\tNodeID,\n\tWebPageNode,\n} from \"document/models/CanvasTree/index.ts\"\nimport type { CollectionChildrenVisibility } from \"document/models/CanvasTree/nodes/CollectionNodeCache.ts\"\nimport { DataSourceValueMap } from \"document/models/CanvasTree/nodes/DataSourceValueMap.ts\"\nimport type { CollectionRepeater } from \"document/models/CanvasTree/nodes/FrameNode.ts\"\nimport type { VariableProviderControlMap } from \"document/models/CanvasTree/traits/VariableProvider.ts\"\nimport type { HasCollectionDataSource } from \"document/models/CanvasTree/traits/WithCollectionDataSource.ts\"\nimport type { HasPaginationEnabled } from \"document/models/CanvasTree/traits/WithCollectionOptions.ts\"\nimport {\n\ttype RichTextVariableDefinition,\n\ttype VariableID,\n\tisRichTextVariableDefinition,\n} from \"document/models/CanvasTree/traits/WithVariables.ts\"\nimport { RepeaterValueMap } from \"document/utils/RepeaterVariables.ts\"\nimport { BinaryOperator, type Query } from \"library/modules/cms/types.ts\"\nimport { ControlType } from \"library/render/types/PropertyControls.ts\"\nimport type { Locale } from \"library/router/types.ts\"\nimport { iterateRichTextModuleIdentifiers } from \"prosemirror/schema/module.ts\"\nimport { getCollectionForIdentifier } from \"utils/getCollectionForIdentifier.ts\"\nimport { isString } from \"utils/typeChecks.ts\"\nimport { getCachedTreeDatabaseCollection } from \"./TreeDatabaseCollection.ts\"\nimport { getVariableReferencesForProvider } from \"./utils/getVariableReferencesForProvider.ts\"\n\nexport function addPaginationClauseToQuery(query: Query, node: CollectionRepeater & HasPaginationEnabled) {\n\tlet limitValue = node.collectionPaginationPageSize\n\n\tif (query.limit?.type === \"LiteralValue\" && typeof query.limit.value === \"number\") {\n\t\tlimitValue = Math.min(limitValue, query.limit.value)\n\t}\n\n\tquery.limit = { type: \"LiteralValue\", value: limitValue }\n}\n\nexport function createValueMapForRepeatedChild(\n\ttree: CanvasTree,\n\tcontrolMap: VariableProviderControlMap,\n\tdataItem: Record<string, unknown>,\n\titemIndex: number,\n\titemCount: number,\n) {\n\tconst valueMap = new DataSourceValueMap(tree, controlMap, dataItem)\n\treturn new RepeaterValueMap(valueMap, itemIndex, itemCount)\n}\n\nexport function resolveCollection(\n\ttree: CanvasTree,\n\tcomponentLoader: SandboxComponentLoader,\n\tnode: CanvasNode,\n\tdataIdentifier: ModuleExportIdentifierString,\n\tlocale: Locale | undefined,\n\tvisibility: CollectionChildrenVisibility = \"public-only\",\n) {\n\tconst collectionNode = getCollectionForIdentifier(tree, dataIdentifier)\n\tif (collectionNode) {\n\t\t// We need to re-render the node when the collection changes.\n\t\tcollectionNode.linkTo(node.id)\n\t\treturn getCachedTreeDatabaseCollection(tree, componentLoader, collectionNode, locale, visibility)\n\t}\n\n\tconst dataDefinition = componentLoader.dataForIdentifier(dataIdentifier)\n\tassert(dataDefinition, \"Data definition not found\")\n\treturn dataDefinition.class\n}\n\nexport function getQueryForWebPageNode(\n\ttree: CanvasTree,\n\tcomponentLoader: SandboxComponentLoader,\n\tcontrolMap: VariableProviderControlMap,\n\tscopeNode: WebPageNode & HasCollectionDataSource,\n\tgroundNode: CanvasNode,\n\tactiveLocale: Locale | undefined,\n\tselectedCollectionItemId: NodeID,\n\tvisibility: CollectionChildrenVisibility = \"public-only\",\n): Query {\n\tconst queriedVariableIds = new Set<VariableID>()\n\tconst defaultCollectionAlias = getQueryDefaultCollectionAlias(scopeNode)\n\n\tconst usedVariableIds = getVariableReferencesForProvider(tree, scopeNode)\n\tconst selectedVariableIds = new Set(usedVariableIds)\n\n\t// NOTE: We have to call `getQuerySelect` before `getQueryFrom`\n\t// because it might add variables to `queriedVariableIds`.\n\tconst querySelect = getQuerySelect(\n\t\tcontrolMap,\n\t\tselectedVariableIds,\n\t\tqueriedVariableIds,\n\t\tdefaultCollectionAlias,\n\t\tidentifier => resolveCollection(tree, componentLoader, groundNode, identifier, activeLocale, visibility),\n\t)\n\n\tconst queryFrom = getQueryFrom(\n\t\tscopeNode.dataIdentifier,\n\t\tcontrolMap,\n\t\tqueriedVariableIds,\n\t\tdefaultCollectionAlias,\n\t\tidentifier =>\n\t\t\tresolveCollection(\n\t\t\t\ttree,\n\t\t\t\tcomponentLoader,\n\t\t\t\tgroundNode,\n\t\t\t\tidentifier,\n\t\t\t\tactiveLocale,\n\t\t\t\t// TODO: this means that repeaters inside the detail page will also return private\n\t\t\t\t//       items when we're creating new items, because visibility is\n\t\t\t\t//       `public-and-private`. Ideally, getQueryFrom would pass `isJoin` to us so\n\t\t\t\t//       we could set `public-only` in that case.\n\t\t\t\t//       https://github.com/framer/FramerStudio/pull/23574#discussion_r2164552609\n\t\t\t\tvisibility,\n\t\t\t),\n\t)\n\n\treturn {\n\t\tfrom: queryFrom,\n\t\tselect: querySelect,\n\t\twhere: {\n\t\t\ttype: \"BinaryOperation\",\n\t\t\toperator: BinaryOperator.Equals,\n\t\t\tleft: {\n\t\t\t\ttype: \"Identifier\",\n\t\t\t\tname: collectionIdKey,\n\t\t\t\tcollection: defaultCollectionAlias,\n\t\t\t},\n\t\t\tright: {\n\t\t\t\ttype: \"LiteralValue\",\n\t\t\t\tvalue: selectedCollectionItemId,\n\t\t\t},\n\t\t},\n\t\tlimit: {\n\t\t\ttype: \"LiteralValue\",\n\t\t\tvalue: 1,\n\t\t},\n\t}\n}\n\nconst componentIdentifiersCache = new WeakMap<\n\tCollectionNode | CollectionItemNode,\n\tReadonlySet<ModuleExportIdentifierString>\n>()\n\nfunction getComponentIdentifiersForCollectionItemNode(\n\tcollectionItemNode: CollectionItemNode,\n\trichTextVariables: RichTextVariableDefinition[],\n): ReadonlySet<ModuleExportIdentifierString> {\n\tconst cached = componentIdentifiersCache.get(collectionItemNode)\n\tif (cached) return cached\n\n\tconst identifiers = new Set<ModuleExportIdentifierString>()\n\tfor (const variable of richTextVariables) {\n\t\tconst controlProp = collectionItemNode.getControlProp(variable.id)\n\t\tif (controlProp?.type !== ControlType.RichText) continue\n\n\t\tconst html = controlProp.value\n\t\tif (!isString(html)) continue\n\n\t\tfor (const componentIdentifier of iterateRichTextModuleIdentifiers(html)) {\n\t\t\tidentifiers.add(componentIdentifier)\n\t\t}\n\t}\n\n\tcomponentIdentifiersCache.set(collectionItemNode, identifiers)\n\treturn identifiers\n}\n\nfunction getComponentIdentifiersFromLocalizedValues(\n\tcollectionItemNode: CollectionItemNode,\n\trichTextVariables: RichTextVariableDefinition[],\n): ReadonlySet<ModuleExportIdentifierString> {\n\tconst identifiers = new Set<ModuleExportIdentifierString>()\n\n\tfor (const variable of richTextVariables) {\n\t\tconst controlProp = collectionItemNode.getControlProp(variable.id)\n\t\tif (controlProp?.type !== ControlType.RichText) continue\n\t\tif (!controlProp.valueLocalized) continue\n\n\t\tfor (const localeId of Object.keys(controlProp.valueLocalized)) {\n\t\t\tconst localizedValue = controlProp.valueLocalized[localeId]\n\t\t\tif (!localizedValue?.value) continue\n\t\t\tif (!isString(localizedValue.value)) continue\n\n\t\t\tfor (const componentIdentifier of iterateRichTextModuleIdentifiers(localizedValue.value)) {\n\t\t\t\tidentifiers.add(componentIdentifier)\n\t\t\t}\n\t\t}\n\t}\n\n\treturn identifiers\n}\n\nexport function getComponentIdentifiersForCollectionNode(\n\tcollectionNode: CollectionNode,\n\toptions: {\n\t\tincludeLocalizedValues?: boolean\n\t} = {\n\t\tincludeLocalizedValues: false,\n\t},\n): ReadonlySet<ModuleExportIdentifierString> {\n\tconst cached = componentIdentifiersCache.get(collectionNode)\n\tif (cached) return cached\n\n\tconst identifiers = new Set<ModuleExportIdentifierString>()\n\tconst richTextVariables = collectionNode.variables.filter(isRichTextVariableDefinition)\n\n\tfor (const child of collectionNode.getUnsortedChildren()) {\n\t\tconst childIdentifiers = getComponentIdentifiersForCollectionItemNode(child, richTextVariables)\n\t\tfor (const identifier of childIdentifiers) {\n\t\t\tidentifiers.add(identifier)\n\t\t}\n\n\t\tif (options.includeLocalizedValues) {\n\t\t\tconst localizedIdentifiers = getComponentIdentifiersFromLocalizedValues(child, richTextVariables)\n\t\t\tfor (const identifier of localizedIdentifiers) {\n\t\t\t\tidentifiers.add(identifier)\n\t\t\t}\n\t\t}\n\t}\n\n\tcomponentIdentifiersCache.set(collectionNode, identifiers)\n\treturn identifiers\n}\n", "import type { SandboxComponentLoader } from \"@framerjs/framer-runtime/sandbox\"\nimport type { SandboxVisibility } from \"document/SandboxVisibility.ts\"\nimport { type CanvasNode, isVectorNode } from \"document/models/CanvasTree/index.ts\"\nimport { isBooleanShapeNode, isShapeGroupNode } from \"document/models/CanvasTree/nodes/utils/nodeCheck.ts\"\nimport type { CombinedVariableProviderValueMap } from \"document/models/CanvasTree/traits/VariableProvider.ts\"\nimport { type RenderId, getChildRenderId } from \"document/utils/RenderId.ts\"\nimport { Vector } from \"library/render/presentation/Vector.tsx\"\nimport { VectorGroup } from \"library/render/presentation/VectorGroup.tsx\"\n\nexport function getVectorForNode(\n\tnode: CanvasNode,\n\tcomponentLoader: SandboxComponentLoader,\n\tcombinedValueMap: CombinedVariableProviderValueMap | undefined,\n\tsandboxVisibility: SandboxVisibility,\n\trenderId: RenderId,\n\tisRootVector: boolean,\n\tnodeProps: Record<string, unknown> | undefined,\n): React.ReactElement {\n\tconst props = nodeProps ?? node.getProps(componentLoader, combinedValueMap)\n\n\tconst isVisible = node.resolveValue(\"visible\", combinedValueMap) !== false\n\tsandboxVisibility.setVisible(renderId, isVisible)\n\n\tif (isShapeGroupNode(node)) {\n\t\treturn (\n\t\t\t<VectorGroup {...props} isRootVectorNode={isRootVector}>\n\t\t\t\t{node.children.map(child => {\n\t\t\t\t\tconst childRenderId = getChildRenderId(renderId, child.id)\n\t\t\t\t\treturn getVectorForNode(\n\t\t\t\t\t\tchild,\n\t\t\t\t\t\tcomponentLoader,\n\t\t\t\t\t\tcombinedValueMap,\n\t\t\t\t\t\tsandboxVisibility,\n\t\t\t\t\t\tchildRenderId,\n\t\t\t\t\t\tfalse,\n\t\t\t\t\t\tundefined,\n\t\t\t\t\t)\n\t\t\t\t})}\n\t\t\t</VectorGroup>\n\t\t)\n\t}\n\n\tif (isVectorNode(node)) {\n\t\t// Boolean shape descendants are never rendered, but they can still have visibility which\n\t\t// needs to be reported to the editor.\n\t\tif (isBooleanShapeNode(node)) {\n\t\t\tfor (const child of node.walk()) {\n\t\t\t\tif (child === node) continue\n\n\t\t\t\t// @TODO - Refactor to pass down the renderId of the parent.\n\t\t\t\tconst childRenderId = getChildRenderId(renderId, child.id)\n\t\t\t\tsandboxVisibility.setVisible(childRenderId, child.resolveValue(\"visible\", combinedValueMap) !== false)\n\t\t\t}\n\t\t}\n\t\treturn <Vector {...props} isRootVectorNode={isRootVector} />\n\t}\n\n\tthrow Error(`WARNING: Unknown vector node: ${node.__class}`)\n}\n", "import type { CanvasNode } from \"document/models/CanvasTree/index.ts\"\n\n// For graphics to render correctly, all edited children must have their calculated paths nulled.\nexport function resetCacheForGraphics(node: CanvasNode) {\n\tconst cache = node.cache\n\tif (cache.lastUpdate === node.update) return\n\n\tcache.lastUpdate = node.update\n\tcache.calculatedPaths = null\n\n\tif (node.children) {\n\t\tfor (const child of node.children) {\n\t\t\tresetCacheForGraphics(child)\n\t\t}\n\t}\n}\n", "import { getCompatibleNonNullLocalizedValue } from \"document/components/chrome/localization/getCompatibleLocalizedValue.ts\"\nimport { getLocalizationSourceTextType } from \"document/components/chrome/localization/getLocalizationSourceTextType.ts\"\nimport { getStyledLocalizedRichTextHTML } from \"document/components/chrome/localization/getStyledLocalizedRichTextHTML.ts\"\nimport { getLocalizedValueForActiveLocale } from \"document/components/chrome/localization/getValueForActiveLocale.ts\"\nimport type { RichTextNode } from \"document/models/CanvasTree/index.ts\"\nimport { compileRichTextForCanvasRenderingMemoized } from \"document/models/CanvasTree/nodes/utils/compileRichText.tsx\"\nimport { isRelativeDateComputedValue } from \"document/models/CanvasTree/traits/ComputedValue.ts\"\nimport type { FetchDataValueResolver } from \"document/models/CanvasTree/traits/FetchDataValue.ts\"\nimport type { CombinedVariableProviderValueMap } from \"document/models/CanvasTree/traits/VariableProvider.ts\"\nimport { svgViewBoxFromSize } from \"document/models/CanvasTree/traits/WithTextFit.ts\"\nimport { getResolvedComputedValueStartValue } from \"document/models/CanvasTree/traits/utils/computeValue.ts\"\nimport { type Locale, RelativeDate } from \"library/index.ts\"\nimport { isString } from \"utils/typeChecks.ts\"\n\nexport function getRichTextChildren(\n\tnode: RichTextNode,\n\tcombinedValueMap: CombinedVariableProviderValueMap | undefined,\n\tactiveLocale: Locale | undefined,\n): React.ReactElement | undefined {\n\tif (node.htmlContent) {\n\t\tconst html = node.resolveValue(\"htmlContent\", combinedValueMap)\n\t\t// Compile rich text if it was not compiled yet.\n\t\treturn isString(html) ? compileRichTextForCanvasRenderingMemoized(html) : html\n\t}\n\n\tlet html = node.html\n\n\tconst localizedValue = getLocalizedValueForActiveLocale(activeLocale, node.htmlLocalized)\n\tif (localizedValue) {\n\t\tconst textType = getLocalizationSourceTextType(html)\n\t\tconst compatibleLocalizedValue = getCompatibleNonNullLocalizedValue(textType, localizedValue, html)\n\n\t\tif (compatibleLocalizedValue) {\n\t\t\thtml = getStyledLocalizedRichTextHTML(node.html, compatibleLocalizedValue)\n\t\t}\n\t}\n\n\treturn compileRichTextForCanvasRenderingMemoized(html)\n}\n\nexport function getRichTextRelativeDate(\n\tnode: RichTextNode,\n\tcombinedValueMap: CombinedVariableProviderValueMap | undefined,\n\tfetchDataValueResolver: FetchDataValueResolver | undefined,\n) {\n\tconst textContent = node.textContent\n\tif (!isRelativeDateComputedValue(textContent)) return\n\n\tconst transform = textContent.transforms[0]\n\n\tconst dateString = getResolvedComputedValueStartValue(\n\t\ttextContent,\n\t\tcombinedValueMap,\n\t\tnode.cache,\n\t\tfetchDataValueResolver,\n\t)\n\tif (!isString(dateString)) return\n\n\treturn (\n\t\t<RelativeDate\n\t\t\tdate={dateString}\n\t\t\tdateFormat={transform.format}\n\t\t\tdateStyle={transform.dateStyle}\n\t\t\tdateCapitalize={transform.capitalize}\n\t\t\tlocale={transform.locale}\n\t\t/>\n\t)\n}\n\nexport function getRichTextViewBox(node: RichTextNode, activeLocale: Locale | undefined): string | undefined {\n\tif (!activeLocale?.id) return\n\tif (!node.textFitViewBoxSize) return\n\tif (!node.textFitViewBoxSizeLocalized) return\n\n\tconst textFitViewBoxSize = node.textFitViewBoxSizeLocalized[active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M,aAAa;AAAA,IAClB;AAAA,IACA;AAAA,IACA,KAAK;AAAA,IACL;AAAA,EACD;AACA,MAAI,CAAC,SAAS,UAAU,EAAG;AAE3B,SACC;AAAA,IAAC;AAAA;AAAA,MACA,MAAM;AAAA,MACN,YAAY,UAAU;AAAA,MACtB,WAAW,UAAU;AAAA,MACrB,gBAAgB,UAAU;AAAA,MAC1B,QAAQ,UAAU;AAAA;AAAA,EACnB;AAEF;AAEO,SAAS,mBAAmB,MAAoB,cAAsD;AAC5G,MAAI,CAAC,cAAc,GAAI;AACvB,MAAI,CAAC,KAAK,mBAAoB;AAC9B,MAAI,CAAC,KAAK,4BAA6B;AAEvC,QAAM,qBAAqB,KAAK,4BAA4B,aAAa,EAAE;AAC3E,MAAI,CAAC,mBAAoB;AAEzB,SAAO,mBAAmB,kBAAkB;AAC7C;",
  "names": ["import_jsx_runtime", "React", "import_react", "import_jsx_runtime", "React", "CanvasLayout", "import_react", "cache", "import_react", "import_react", "import_jsx_runtime", "React", "import_react", "import_jsx_runtime", "React", "import_jsx_runtime", "React", "import_jsx_runtime", "import_react", "import_jsx_runtime", "import_react", "import_jsx_runtime", "React", "CanvasVectorForIdentifier", "import_jsx_runtime", "cache", "import_jsx_runtime", "html"]
}
