unframer 2.11.2 → 2.12.0

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.
Files changed (47) hide show
  1. package/dist/exporter.d.ts +3 -0
  2. package/dist/exporter.d.ts.map +1 -1
  3. package/dist/exporter.js +54 -30
  4. package/dist/exporter.js.map +1 -1
  5. package/dist/exporter.test.js +3 -0
  6. package/dist/exporter.test.js.map +1 -1
  7. package/dist/framer.d.ts.map +1 -1
  8. package/dist/framer.js +840 -488
  9. package/dist/framer.js.map +1 -1
  10. package/dist/index.d.ts +3 -1
  11. package/dist/index.d.ts.map +1 -1
  12. package/dist/index.js +9 -5
  13. package/dist/index.js.map +1 -1
  14. package/dist/react.d.ts +15 -6
  15. package/dist/react.d.ts.map +1 -1
  16. package/dist/react.js +66 -3
  17. package/dist/react.js.map +1 -1
  18. package/dist/utils.d.ts +1 -1
  19. package/dist/utils.d.ts.map +1 -1
  20. package/dist/utils.js.map +1 -1
  21. package/esm/exporter.d.ts +3 -0
  22. package/esm/exporter.d.ts.map +1 -1
  23. package/esm/exporter.js +55 -32
  24. package/esm/exporter.js.map +1 -1
  25. package/esm/exporter.test.js +4 -1
  26. package/esm/exporter.test.js.map +1 -1
  27. package/esm/framer.d.ts.map +1 -1
  28. package/esm/framer.js +837 -488
  29. package/esm/framer.js.map +1 -1
  30. package/esm/index.d.ts +3 -1
  31. package/esm/index.d.ts.map +1 -1
  32. package/esm/index.js +3 -1
  33. package/esm/index.js.map +1 -1
  34. package/esm/react.d.ts +15 -6
  35. package/esm/react.d.ts.map +1 -1
  36. package/esm/react.js +65 -5
  37. package/esm/react.js.map +1 -1
  38. package/esm/utils.d.ts +1 -1
  39. package/esm/utils.d.ts.map +1 -1
  40. package/esm/utils.js.map +1 -1
  41. package/package.json +3 -3
  42. package/src/exporter.test.ts +6 -1
  43. package/src/exporter.ts +68 -33
  44. package/src/framer.js +891 -494
  45. package/src/index.ts +7 -1
  46. package/src/react.tsx +98 -16
  47. package/src/utils.ts +1 -1
package/dist/framer.js CHANGED
@@ -38,8 +38,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.LayoutGroupContext = exports.DeprecatedLayoutGroupContext = exports.DeprecatedFrameWithEvents = exports.DeprecatedComponentContainer = exports.defaultDeviceProps = exports.DataObserverContext = exports.DataObserver = exports.DataContext = exports.Data = exports.CycleVariantState = exports.CustomCursorHost = exports.createBox = exports.ConvertColor = exports.ControlType = exports.Container = exports.ConstraintValues = exports.ConstraintMask = exports.ComponentViewportProvider = exports.ComponentContainerContext = exports.complex = exports.combinedCSSRulesForPreview = exports.ColorMixModelType = exports.ColorFormat = exports.color = exports.Color = exports.clamp = exports.circOut = exports.circInOut = exports.circIn = exports.cancelSync = exports.cancelFrame = exports.callEach = exports.BoxShadow = exports.BezierAnimator = exports.backOut = exports.backInOut = exports.backIn = exports.BackgroundImage = exports.AnyInterpolation = exports.anticipate = exports.animations = exports.AnimateSharedLayout = exports.AnimatePresence = exports.animateMini = exports.animate = exports.Animatable = exports.AnchorLinkTarget = exports.addPointerInfo = exports.AcceleratedAnimation = exports.combinedCSSRules = void 0;
40
40
  exports.LazyValue = exports.LayoutIdContext = exports.LayoutGroup = exports.Layer = exports.isMotionValue = exports.isBrowser = exports.invariant = exports.InternalID = exports.Image = exports.GeneratedComponentContext = exports.GamepadContext = exports.FrameWithMotion = exports.frameSteps = exports.FramerEventSession = exports.FramerEventListener = exports.FramerEvent = exports.framerCSSMarker = exports.framerAppearTransformTemplateToken = exports.framerAppearIdKey = exports.framerAppearEffects = exports.framerAppearAnimationScriptKey = exports.FramerAnimation = exports.frameFromElements = exports.frameFromElement = exports.frameData = exports.frame = exports.Frame = exports.FormSelect = exports.FormPlainTextInput = exports.FormContainer = exports.FormBooleanInput = exports.fontStore = exports.FontSourceNames = exports.FlatTree = exports.Fetcher = exports.environment = exports.easeOut = exports.easeInOut = exports.easeIn = exports.Draggable = exports.DragControls = exports.domMin = exports.domMax = exports.domAnimation = exports.DOM = exports.distance = exports.dispatchKeyDownEvent = exports.DimensionType = exports.devicePresets = exports.DeviceCodeComponent = void 0;
41
- exports.SpringAnimator = exports.Size = exports.sharedSVGManager = exports.Shadow = exports.Scroll = exports.RichText = exports.reverseEasing = exports.ResolveLinks = exports.RenderTarget = exports.Rect = exports.RadialGradient = exports.QueryEngine = exports.px = exports.PropertyStore = exports.PropertyOverrides = exports.progress = exports.PresenceContext = exports.Polygon = exports.pipe = exports.PathVariablesContext = exports.PathSegment = exports.pathDefaults = exports.ParentSizeState = exports.Page = exports.optimizedAppearDataAttribute = exports.optimizeAppearTransformTemplate = exports.optimizeAppear = exports.ObservableObject = exports.NotFoundError = exports.nestedLinksCollector = exports.NavigationTransitionType = exports.NavigationConsumer = exports.NavigationCallbackProvider = exports.NavigateTo = exports.Reorder = exports.MotionValue = exports.MotionGlobalConfig = exports.MotionContext = exports.MotionConfigContext = exports.motion = exports.mirrorEasing = exports.makeUseVisualState = exports.MainLoop = exports.m = exports.localPackageFallbackIdentifier = exports.loadFont = exports.Link = exports.LinearGradient = exports.Line = exports.LibraryFeaturesProvider = void 0;
42
- exports.FormContext = exports.FetchClientProvider = exports.wrap = exports.withVariantFX = exports.withVariantAppearEffect = exports.withStyleAppearEffect = exports.withParallaxTransform = exports.withMeasuredSize = exports.withGeneratedLayoutId = exports.withFX = exports.withCSS = exports.WindowContext = exports.warning = exports.visualElementStore = exports.VisualElement = exports.version = exports.VectorGroup = exports.Vector = exports.VariantSelector = exports.ValueInterpolation = exports.useProvidedWindow = exports.useIsomorphicLayoutEffect = exports.useAnimation = exports.Text = exports.systemFontFamilyName = exports.sync = exports.SwitchLayoutGroupContext = exports.StyleSheetContext = exports.Stack = exports.SSRVariants = void 0;
41
+ exports.SmartComponentScopedContainer = exports.Size = exports.sharedSVGManager = exports.Shadow = exports.Scroll = exports.RichText = exports.reverseEasing = exports.ResolveLinks = exports.RenderTarget = exports.Rect = exports.RadialGradient = exports.QueryEngine = exports.px = exports.PropertyStore = exports.PropertyOverrides = exports.progress = exports.PresenceContext = exports.Polygon = exports.pipe = exports.PathVariablesContext = exports.PathSegment = exports.pathDefaults = exports.ParentSizeState = exports.Page = exports.optimizedAppearDataAttribute = exports.optimizeAppearTransformTemplate = exports.optimizeAppear = exports.ObservableObject = exports.NotFoundError = exports.nestedLinksCollector = exports.NavigationTransitionType = exports.NavigationConsumer = exports.NavigationCallbackProvider = exports.NavigateTo = exports.Reorder = exports.MotionValue = exports.MotionGlobalConfig = exports.MotionContext = exports.MotionConfigContext = exports.motion = exports.mirrorEasing = exports.makeUseVisualState = exports.MainLoop = exports.m = exports.localPackageFallbackIdentifier = exports.loadFont = exports.Link = exports.LinearGradient = exports.Line = exports.LibraryFeaturesProvider = void 0;
42
+ exports.LocaleInfoContext = exports.FormContext = exports.FetchClientProvider = exports.FramerLink = exports.wrap = exports.withVariantFX = exports.withVariantAppearEffect = exports.withStyleAppearEffect = exports.withParallaxTransform = exports.withMeasuredSize = exports.withGeneratedLayoutId = exports.withFX = exports.withCSS = exports.WindowContext = exports.warning = exports.visualElementStore = exports.VisualElement = exports.version = exports.VectorGroup = exports.Vector = exports.VariantSelector = exports.ValueInterpolation = exports.useProvidedWindow = exports.useIsomorphicLayoutEffect = exports.useAnimation = exports.Text = exports.systemFontFamilyName = exports.sync = exports.SwitchLayoutGroupContext = exports.StyleSheetContext = exports.Stack = exports.SSRVariants = exports.SpringAnimator = void 0;
43
43
  exports._injectRuntime = _injectRuntime;
44
44
  exports.addActionControls = addActionControls;
45
45
  exports.addFonts = addFonts;
@@ -247,6 +247,7 @@ exports.useVelocity = useVelocity;
247
247
  exports.useViewportScroll = useViewportScroll;
248
248
  exports.useWillChange = useWillChange;
249
249
  exports.valueToDimensionType = valueToDimensionType;
250
+ exports.withCodeBoundaryForOverrides = withCodeBoundaryForOverrides;
250
251
  exports.withInfiniteScroll = withInfiniteScroll;
251
252
  exports.withMappedReactProps = withMappedReactProps;
252
253
  exports.WithNavigator = WithNavigator;
@@ -14914,7 +14915,7 @@ function steps(numSteps, direction = 'end') {
14914
14915
  return clamp(0, 1, rounded / numSteps);
14915
14916
  };
14916
14917
  }
14917
- // https :https://app.framerstatic.com/framer.K3G2LCX5.mjs
14918
+ // https :https://app.framerstatic.com/framer.W2IMDDH5.mjs
14918
14919
  init_chunk_QLPHEVXG();
14919
14920
  const react_11 = __importDefault(require("react"));
14920
14921
  const react_12 = require("react");
@@ -16582,9 +16583,9 @@ function renderPage(Page4, defaultPageStyle) {
16582
16583
  var NotFoundError = class extends Error {
16583
16584
  };
16584
16585
  exports.NotFoundError = NotFoundError;
16585
- var ErrorBoundaryCaughtError = class extends Error {
16586
+ var NotFoundErrorBoundaryCaughtError = class extends Error {
16586
16587
  };
16587
- var ErrorBoundary = class extends react_7.Component {
16588
+ var NotFoundErrorBoundary = class extends react_7.Component {
16588
16589
  constructor(props) {
16589
16590
  super(props);
16590
16591
  this.state = {
@@ -16615,7 +16616,7 @@ var ErrorBoundary = class extends react_7.Component {
16615
16616
  return this.props.children;
16616
16617
  }
16617
16618
  if (!(this.state.error instanceof NotFoundError)) {
16618
- const error = new ErrorBoundaryCaughtError();
16619
+ const error = new NotFoundErrorBoundaryCaughtError();
16619
16620
  error.cause = this.state.error;
16620
16621
  throw error;
16621
16622
  }
@@ -16626,6 +16627,159 @@ var ErrorBoundary = class extends react_7.Component {
16626
16627
  return renderPage(notFoundPage, defaultPageStyle);
16627
16628
  }
16628
16629
  };
16630
+ function isObject(value) {
16631
+ return typeof value === 'object' && value !== null && !Array.isArray(value);
16632
+ }
16633
+ function isString(value) {
16634
+ return typeof value === 'string';
16635
+ }
16636
+ var preloadKey = 'preload';
16637
+ function isLazyComponentType(componentType) {
16638
+ return typeof componentType === 'object' && componentType !== null && !react_11.default.isValidElement(componentType) &&
16639
+ preloadKey in componentType;
16640
+ }
16641
+ function lazy(factory) {
16642
+ const LazyComponent = react_11.default.lazy(factory);
16643
+ let factoryPromise;
16644
+ let LoadedComponent;
16645
+ const Component18 = react_11.default.forwardRef(function LazyWithPreload(props, ref) {
16646
+ return react_11.default.createElement(LoadedComponent !== null && LoadedComponent !== void 0 ? LoadedComponent : LazyComponent, ref
16647
+ ? {
16648
+ ref,
16649
+ ...props,
16650
+ }
16651
+ : props);
16652
+ });
16653
+ Component18.preload = () => {
16654
+ if (!factoryPromise) {
16655
+ factoryPromise = factory().then((module) => {
16656
+ LoadedComponent = module.default;
16657
+ return LoadedComponent;
16658
+ });
16659
+ }
16660
+ return factoryPromise;
16661
+ };
16662
+ return Component18;
16663
+ }
16664
+ function getRouteElementId(route, hash2) {
16665
+ if (hash2 && route) {
16666
+ if (route.elements && hash2 in route.elements) {
16667
+ return route.elements[hash2];
16668
+ }
16669
+ else {
16670
+ return hash2;
16671
+ }
16672
+ }
16673
+ return void 0;
16674
+ }
16675
+ function isBot(userAgent) {
16676
+ return /bot|-google|google-|yandex|ia_archiver/iu.test(userAgent);
16677
+ }
16678
+ function yieldToMain(options) {
16679
+ if ('scheduler' in window) {
16680
+ if ('yield' in scheduler)
16681
+ return scheduler.yield(options);
16682
+ if ('postTask' in scheduler)
16683
+ return scheduler.postTask(() => { }, options);
16684
+ }
16685
+ if ((options === null || options === void 0 ? void 0 : options.priority) === 'user-blocking') {
16686
+ return Promise.resolve();
16687
+ }
16688
+ return new Promise((resolve) => {
16689
+ setTimeout(resolve);
16690
+ });
16691
+ }
16692
+ async function yieldBefore(fn, options) {
16693
+ await yieldToMain(options);
16694
+ return fn();
16695
+ }
16696
+ function interactionResponse(options) {
16697
+ return new Promise((resolve) => {
16698
+ setTimeout(resolve, 100);
16699
+ requestAnimationFrame(() => {
16700
+ void yieldBefore(resolve, options);
16701
+ });
16702
+ });
16703
+ }
16704
+ function useAfterPaintEffect(effectFn, deps, opts, useEffectFn = react_3.useLayoutEffect) {
16705
+ useEffectFn(() => {
16706
+ const runAfterPaint = async (fn) => {
16707
+ await interactionResponse(opts);
16708
+ return fn();
16709
+ };
16710
+ const runPromise = runAfterPaint(effectFn);
16711
+ return () => {
16712
+ void (async () => {
16713
+ const cleanup = await runPromise;
16714
+ if (!cleanup)
16715
+ return;
16716
+ void runAfterPaint(cleanup);
16717
+ })();
16718
+ };
16719
+ }, deps);
16720
+ }
16721
+ var noop2 = () => { };
16722
+ var EMPTY_ARRAY = [];
16723
+ var ErrorBoundaryCaughtError = class extends NotFoundErrorBoundaryCaughtError {
16724
+ constructor() {
16725
+ super(...arguments);
16726
+ this.caught = true;
16727
+ }
16728
+ };
16729
+ var GracefullyDegradingErrorBoundary = class extends react_7.Component {
16730
+ constructor() {
16731
+ super(...arguments);
16732
+ this.state = {
16733
+ error: void 0,
16734
+ };
16735
+ this.message = 'Made UI non-interactive due to the error above. We\'ve logged it, but also please report this to the Framer team.';
16736
+ }
16737
+ static getDerivedStateFromError(error) {
16738
+ return {
16739
+ error,
16740
+ };
16741
+ }
16742
+ componentDidCatch(error) {
16743
+ var _a;
16744
+ if ('cause' in error) {
16745
+ error = error.cause;
16746
+ }
16747
+ console.error(this.message);
16748
+ if (Math.random() > 0.01)
16749
+ return;
16750
+ const stack = error instanceof Error && typeof error.stack === 'string' ? error.stack : null;
16751
+ (_a = window.__framer_events) === null || _a === void 0 ? void 0 : _a.push(['published_site_load_error', {
16752
+ message: String(error),
16753
+ stack,
16754
+ },]);
16755
+ }
16756
+ render() {
16757
+ var _a;
16758
+ const error = this.state.error;
16759
+ if (!error)
16760
+ return this.props.children;
16761
+ if (!isBot(navigator.userAgent)) {
16762
+ const fatalError = new ErrorBoundaryCaughtError();
16763
+ fatalError.cause = 'cause' in error ? error.cause : error;
16764
+ console.error(this.message, fatalError.cause);
16765
+ throw fatalError;
16766
+ }
16767
+ return (
16768
+ // This has the caveat that we will slightly modify the DOM, but it appears to be fine in this case.
16769
+ // The alternative would be to queue a new task that runs after and then set the innerHTML (= avoids the dummy-div), but that means we'll have DOM -> no DOM -> DOM transitions. With the div, we have DOM -> DOM and remove possible race-conditions.
16770
+ (0, jsx_runtime_1.jsx)('div', {
16771
+ style: {
16772
+ display: 'contents',
16773
+ },
16774
+ suppressHydrationWarning: true,
16775
+ // biome-ignore lint/security/noDangerouslySetInnerHtml: React would unmount the root on errors, but we must ensure that bots can still read the SSR'd content.
16776
+ dangerouslySetInnerHTML: {
16777
+ __html: '<!-- DOM replaced by GracefullyDegradingErrorBoundary -->' +
16778
+ (((_a = document.getElementById('main')) === null || _a === void 0 ? void 0 : _a.innerHTML) || ''),
16779
+ },
16780
+ }));
16781
+ }
16782
+ };
16629
16783
  var pathVariablesRegExpRaw = ':([a-z]\\w*)';
16630
16784
  var pathVariablesRegExp = /* @__PURE__ */ new RegExp(pathVariablesRegExpRaw, 'gi');
16631
16785
  function fillPathVariables(path, variables) {
@@ -16799,99 +16953,6 @@ function forwardQueryParams(queryParamsString, href) {
16799
16953
  }
16800
16954
  return hrefWithoutHash.substring(0, startOfSearch + 1) + newSearchParams.toString() + hash2;
16801
16955
  }
16802
- function isObject(value) {
16803
- return typeof value === 'object' && value !== null && !Array.isArray(value);
16804
- }
16805
- function isString(value) {
16806
- return typeof value === 'string';
16807
- }
16808
- var preloadKey = 'preload';
16809
- function isLazyComponentType(componentType) {
16810
- return typeof componentType === 'object' && componentType !== null && !react_11.default.isValidElement(componentType) &&
16811
- preloadKey in componentType;
16812
- }
16813
- function lazy(factory) {
16814
- const LazyComponent = react_11.default.lazy(factory);
16815
- let factoryPromise;
16816
- let LoadedComponent;
16817
- const Component16 = react_11.default.forwardRef(function LazyWithPreload(props, ref) {
16818
- return react_11.default.createElement(LoadedComponent !== null && LoadedComponent !== void 0 ? LoadedComponent : LazyComponent, ref
16819
- ? {
16820
- ref,
16821
- ...props,
16822
- }
16823
- : props);
16824
- });
16825
- Component16.preload = () => {
16826
- if (!factoryPromise) {
16827
- factoryPromise = factory().then((module) => {
16828
- LoadedComponent = module.default;
16829
- return LoadedComponent;
16830
- });
16831
- }
16832
- return factoryPromise;
16833
- };
16834
- return Component16;
16835
- }
16836
- function getRouteElementId(route, hash2) {
16837
- if (hash2 && route) {
16838
- if (route.elements && hash2 in route.elements) {
16839
- return route.elements[hash2];
16840
- }
16841
- else {
16842
- return hash2;
16843
- }
16844
- }
16845
- return void 0;
16846
- }
16847
- function isBot(userAgent) {
16848
- return /bot|-google|google-|yandex|ia_archiver/iu.test(userAgent);
16849
- }
16850
- function yieldToMain(options) {
16851
- if ('scheduler' in window) {
16852
- if ('yield' in scheduler)
16853
- return scheduler.yield(options);
16854
- if ('postTask' in scheduler)
16855
- return scheduler.postTask(() => { }, options);
16856
- }
16857
- if ((options === null || options === void 0 ? void 0 : options.priority) === 'user-blocking') {
16858
- return Promise.resolve();
16859
- }
16860
- return new Promise((resolve) => {
16861
- setTimeout(resolve);
16862
- });
16863
- }
16864
- async function yieldBefore(fn, options) {
16865
- await yieldToMain(options);
16866
- return fn();
16867
- }
16868
- function interactionResponse(options) {
16869
- return new Promise((resolve) => {
16870
- setTimeout(resolve, 100);
16871
- requestAnimationFrame(() => {
16872
- void yieldBefore(resolve, options);
16873
- });
16874
- });
16875
- }
16876
- function useAfterPaintEffect(effectFn, deps, opts, useEffectFn = react_3.useLayoutEffect) {
16877
- useEffectFn(() => {
16878
- const runAfterPaint = async (fn) => {
16879
- await interactionResponse(opts);
16880
- return fn();
16881
- };
16882
- const runPromise = runAfterPaint(effectFn);
16883
- return () => {
16884
- void (async () => {
16885
- const cleanup = await runPromise;
16886
- if (!cleanup)
16887
- return;
16888
- void runAfterPaint(cleanup);
16889
- })();
16890
- };
16891
- }, deps);
16892
- }
16893
- var noop2 = () => { };
16894
- var EMPTY_ARRAY = [];
16895
16956
  async function replacePathVariables(path, currentLocale, nextLocale, defaultLocale, collectionId, pathVariables, collectionUtils) {
16896
16957
  var _a, _b, _c;
16897
16958
  let resultPath = path;
@@ -17951,8 +18012,8 @@ var SuspenseErrorBoundary = class extends react_7.Component {
17951
18012
  };
17952
18013
  }
17953
18014
  static getDerivedStateFromError(error) {
17954
- if (!(error instanceof ErrorBoundaryCaughtError)) {
17955
- console.error('Derived error in SuspenseErrorBoundary', error);
18015
+ if (!(error instanceof NotFoundErrorBoundaryCaughtError)) {
18016
+ console.error('Derived error in SuspenseErrorBoundary:\n', error);
17956
18017
  }
17957
18018
  return {
17958
18019
  error,
@@ -17960,26 +18021,25 @@ var SuspenseErrorBoundary = class extends react_7.Component {
17960
18021
  }
17961
18022
  componentDidCatch(error, errorInfo) {
17962
18023
  var _a;
17963
- if (error instanceof ErrorBoundaryCaughtError) {
18024
+ if (error instanceof NotFoundErrorBoundaryCaughtError) {
17964
18025
  return;
17965
18026
  }
17966
18027
  const componentStack = errorInfo === null || errorInfo === void 0 ? void 0 : errorInfo.componentStack;
17967
- console.error('Caught error in SuspenseErrorBoundary', error, componentStack);
17968
- if (typeof window !== 'undefined') {
17969
- const stack = error instanceof Error && typeof error.stack === 'string' ? error.stack : null;
17970
- (_a = window.__framer_events) === null || _a === void 0 ? void 0 : _a.push(['published_site_load_recoverable_error', {
17971
- message: String(error),
17972
- stack,
17973
- // only log componentStack if we don't have a stack
17974
- componentStack: stack ? void 0 : componentStack,
17975
- },]);
17976
- }
18028
+ console.error('Caught error in SuspenseErrorBoundary:\n', error, componentStack);
18029
+ const stack = error instanceof Error && typeof error.stack === 'string' ? error.stack : null;
18030
+ (_a = window.__framer_events) === null || _a === void 0 ? void 0 : _a.push(['published_site_load_recoverable_error', {
18031
+ message: String(error),
18032
+ stack,
18033
+ // only log componentStack if we don't have a stack
18034
+ componentStack: stack ? void 0 : componentStack,
18035
+ },]);
17977
18036
  }
17978
18037
  render() {
17979
- if (this.state.error === void 0)
18038
+ const error = this.state.error;
18039
+ if (error === void 0)
17980
18040
  return this.props.children;
17981
- if (this.state.error instanceof ErrorBoundaryCaughtError) {
17982
- throw this.state.error.cause;
18041
+ if (error instanceof NotFoundErrorBoundaryCaughtError) {
18042
+ throw error.cause;
17983
18043
  }
17984
18044
  window.__framer_STPD_OPT_OUT__ = true;
17985
18045
  return (0, jsx_runtime_1.jsx)(react_13.Suspense, {
@@ -18014,6 +18074,7 @@ var defaultLocaleInfo = {
18014
18074
  setLocale: noopAsync,
18015
18075
  };
18016
18076
  var LocaleInfoContext = /* @__PURE__ */ react_11.default.createContext(defaultLocaleInfo);
18077
+ exports.LocaleInfoContext = LocaleInfoContext;
18017
18078
  function useLocaleInfo() {
18018
18079
  return react_11.default.useContext(LocaleInfoContext);
18019
18080
  }
@@ -18287,39 +18348,41 @@ function Router({ defaultPageStyle, disableHistory, initialPathVariables, initia
18287
18348
  ? fillPathVariables(current.path, currentPathVariables)
18288
18349
  : current.path;
18289
18350
  const remountKey = String(currentLocaleId) + pathWithFilledVariables;
18290
- return (0, jsx_runtime_1.jsx)(RouterAPIProvider, {
18291
- api,
18292
- children: (0, jsx_runtime_1.jsx)(LocaleInfoContext.Provider, {
18293
- value: localeInfo,
18294
- children: (0, jsx_runtime_1.jsxs)(SuspenseThatPreservesDom, {
18295
- children: [
18296
- (0, jsx_runtime_1.jsx)(ErrorBoundary, {
18297
- notFoundPage,
18298
- defaultPageStyle,
18299
- forceUpdateKey: dep,
18300
- children: (0, jsx_runtime_1.jsx)(WithLayoutTemplate, {
18301
- LayoutTemplate,
18302
- routeId: currentRouteId,
18303
- children: (0, jsx_runtime_1.jsxs)(react_8.Fragment, {
18304
- children: [
18305
- (0, jsx_runtime_1.jsx)(MarkSuspenseEffects.Start, {}),
18306
- pageExistsInCurrentLocale
18307
- ? renderPage(current.page, LayoutTemplate
18308
- ? {
18309
- ...defaultPageStyle,
18310
- display: 'content',
18311
- }
18312
- : defaultPageStyle)
18313
- : // LAYOUT_TEMPLATE @TODO: display: content for not found page?
18314
- notFoundPage && renderPage(notFoundPage, defaultPageStyle),
18315
- ],
18316
- }, remountKey),
18351
+ return (0, jsx_runtime_1.jsx)(GracefullyDegradingErrorBoundary, {
18352
+ children: (0, jsx_runtime_1.jsx)(RouterAPIProvider, {
18353
+ api,
18354
+ children: (0, jsx_runtime_1.jsx)(LocaleInfoContext.Provider, {
18355
+ value: localeInfo,
18356
+ children: (0, jsx_runtime_1.jsxs)(SuspenseThatPreservesDom, {
18357
+ children: [
18358
+ (0, jsx_runtime_1.jsx)(NotFoundErrorBoundary, {
18359
+ notFoundPage,
18360
+ defaultPageStyle,
18361
+ forceUpdateKey: dep,
18362
+ children: (0, jsx_runtime_1.jsx)(WithLayoutTemplate, {
18363
+ LayoutTemplate,
18364
+ routeId: currentRouteId,
18365
+ children: (0, jsx_runtime_1.jsxs)(react_8.Fragment, {
18366
+ children: [
18367
+ (0, jsx_runtime_1.jsx)(MarkSuspenseEffects.Start, {}),
18368
+ pageExistsInCurrentLocale
18369
+ ? renderPage(current.page, LayoutTemplate
18370
+ ? {
18371
+ ...defaultPageStyle,
18372
+ display: 'content',
18373
+ }
18374
+ : defaultPageStyle)
18375
+ : // LAYOUT_TEMPLATE @TODO: display: content for not found page?
18376
+ notFoundPage && renderPage(notFoundPage, defaultPageStyle),
18377
+ ],
18378
+ }, remountKey),
18379
+ }),
18317
18380
  }),
18318
- }),
18319
- (0, jsx_runtime_1.jsx)(TurnOnReactEventHandling, {}),
18320
- (0, jsx_runtime_1.jsx)(MarkSuspenseEffects.End, {}),
18321
- editorBar,
18322
- ],
18381
+ (0, jsx_runtime_1.jsx)(TurnOnReactEventHandling, {}),
18382
+ (0, jsx_runtime_1.jsx)(MarkSuspenseEffects.End, {}),
18383
+ editorBar,
18384
+ ],
18385
+ }),
18323
18386
  }),
18324
18387
  }),
18325
18388
  });
@@ -20762,6 +20825,7 @@ var mockWindow = {
20762
20825
  scrollY: 0,
20763
20826
  location: {
20764
20827
  href: '',
20828
+ pathname: '',
20765
20829
  },
20766
20830
  document: {
20767
20831
  cookie: '',
@@ -20790,6 +20854,7 @@ var mockWindow = {
20790
20854
  innerWidth: 0,
20791
20855
  SVGSVGElement: {},
20792
20856
  open: function (_url, _target, _features) { },
20857
+ __framer_events: [],
20793
20858
  };
20794
20859
  var safeWindow = typeof window === 'undefined' ? mockWindow : window;
20795
20860
  var _raf = (f) => {
@@ -21746,7 +21811,7 @@ function getColorsFromTheme(theme, type) {
21746
21811
  screenColor: isDarkTheme ? '#333' : '#eee',
21747
21812
  };
21748
21813
  }
21749
- var ErrorBoundary2 = class extends react_7.Component {
21814
+ var ErrorBoundary = class extends react_7.Component {
21750
21815
  constructor() {
21751
21816
  super(...arguments);
21752
21817
  __publicField(this, 'state', {});
@@ -21892,7 +21957,7 @@ function Device({ canResize = false, children, ResizeObserver: ResizeObserver2 =
21892
21957
  ref: screenRef,
21893
21958
  children: /* @__PURE__ */ (0, jsx_runtime_1.jsx)(MotionConfig, {
21894
21959
  transformPagePoint: invertScale2,
21895
- children: /* @__PURE__ */ (0, jsx_runtime_1.jsx)(ErrorBoundary2, {
21960
+ children: /* @__PURE__ */ (0, jsx_runtime_1.jsx)(ErrorBoundary, {
21896
21961
  children,
21897
21962
  }),
21898
21963
  }),
@@ -26596,7 +26661,7 @@ function useMeasuredSize(ref) {
26596
26661
  return size.current;
26597
26662
  }
26598
26663
  var SIZE_COMPATIBILITY_WRAPPER_ATTRIBUTE = 'data-framer-size-compatibility-wrapper';
26599
- var withMeasuredSize = (Component16) => (props) => {
26664
+ var withMeasuredSize = (Component18) => (props) => {
26600
26665
  const ref = react_11.default.useRef(null);
26601
26666
  const size = useMeasuredSize(ref);
26602
26667
  const dataProps = {
@@ -26613,7 +26678,7 @@ var withMeasuredSize = (Component16) => (props) => {
26613
26678
  },
26614
26679
  ref,
26615
26680
  ...dataProps,
26616
- children: shouldRender && /* @__PURE__ */ (0, jsx_runtime_1.jsx)(Component16, {
26681
+ children: shouldRender && /* @__PURE__ */ (0, jsx_runtime_1.jsx)(Component18, {
26617
26682
  ...props,
26618
26683
  width: (size == null ? void 0 : size.width) ?? fallbackWidth,
26619
26684
  height: (size == null ? void 0 : size.height) ?? fallbackHeight,
@@ -28124,7 +28189,7 @@ var clamp2 = (value, a, b) => {
28124
28189
  var DraggingContext = /* @__PURE__ */ react_11.default.createContext({
28125
28190
  dragging: false,
28126
28191
  });
28127
- function WithDragging(Component16) {
28192
+ function WithDragging(Component18) {
28128
28193
  const _WithDraggingHOC = class extends react_11.default.Component {
28129
28194
  constructor(props, defaultProps) {
28130
28195
  super(props, defaultProps);
@@ -28693,7 +28758,7 @@ function WithDragging(Component16) {
28693
28758
  value: {
28694
28759
  dragging: this.state.isDragging,
28695
28760
  },
28696
- children: /* @__PURE__ */ (0, jsx_runtime_1.jsx)(Component16, {
28761
+ children: /* @__PURE__ */ (0, jsx_runtime_1.jsx)(Component18, {
28697
28762
  ...originalProps,
28698
28763
  }),
28699
28764
  });
@@ -28731,9 +28796,9 @@ function WithDragging(Component16) {
28731
28796
  constraints: {},
28732
28797
  mouseWheel: false,
28733
28798
  });
28734
- __publicField(WithDraggingHOC, 'defaultProps', Object.assign({}, Component16.defaultProps, _WithDraggingHOC.draggingDefaultProps));
28799
+ __publicField(WithDraggingHOC, 'defaultProps', Object.assign({}, Component18.defaultProps, _WithDraggingHOC.draggingDefaultProps));
28735
28800
  const withDragging = WithDraggingHOC;
28736
- (0, import_hoist_non_react_statics.default)(withDragging, Component16);
28801
+ (0, import_hoist_non_react_statics.default)(withDragging, Component18);
28737
28802
  return withDragging;
28738
28803
  }
28739
28804
  var hoverProps = {
@@ -31520,7 +31585,7 @@ function useInfiniteScroll({ ref: elementRef, loadMore, rootMargin = '0px', thre
31520
31585
  };
31521
31586
  }, [elementRef, callback, rootMargin, threshold, paginationInfo.currentPage,]);
31522
31587
  }
31523
- function withInfiniteScroll(Component16) {
31588
+ function withInfiniteScroll(Component18) {
31524
31589
  return react_11.default.forwardRef(({ __paginationInfo, __loadMore, ...props }, ref) => {
31525
31590
  const backupRef = react_11.default.useRef(null);
31526
31591
  const infiniteScrollRef = ref ?? backupRef;
@@ -31530,7 +31595,7 @@ function withInfiniteScroll(Component16) {
31530
31595
  ref: infiniteScrollRef,
31531
31596
  paginationInfo: __paginationInfo,
31532
31597
  });
31533
- return /* @__PURE__ */ (0, jsx_runtime_1.jsx)(Component16, {
31598
+ return /* @__PURE__ */ (0, jsx_runtime_1.jsx)(Component18, {
31534
31599
  ...props,
31535
31600
  ref: infiniteScrollRef,
31536
31601
  });
@@ -34317,20 +34382,20 @@ function convertColorProps(props) {
34317
34382
  }
34318
34383
  return props;
34319
34384
  }
34320
- function WithOverride(Component16, override) {
34385
+ function WithOverride(Component18, override) {
34321
34386
  const useOverride = typeof override === 'function' ? (props) => override(convertColorProps(props)) : () => convertColorProps(override);
34322
34387
  const ComponentWithOverride = function (props) {
34323
34388
  (0, react_2.useContext)(DataObserverContext);
34324
34389
  const overrideProps = useOverride(props);
34325
34390
  const { style, ...rest } = props;
34326
- return /* @__PURE__ */ (0, jsx_runtime_1.jsx)(Component16, {
34391
+ return /* @__PURE__ */ (0, jsx_runtime_1.jsx)(Component18, {
34327
34392
  ...rest,
34328
34393
  ...overrideProps,
34329
34394
  _initialStyle: style,
34330
34395
  });
34331
34396
  };
34332
- (0, import_hoist_non_react_statics4.default)(ComponentWithOverride, Component16);
34333
- ComponentWithOverride['displayName'] = `WithOverride(${Component16.displayName || Component16.name})`;
34397
+ (0, import_hoist_non_react_statics4.default)(ComponentWithOverride, Component18);
34398
+ ComponentWithOverride['displayName'] = `WithOverride(${Component18.displayName || Component18.name})`;
34334
34399
  return ComponentWithOverride;
34335
34400
  }
34336
34401
  var prefix = '__framer__';
@@ -35134,10 +35199,10 @@ function addMotionValueStyle(style, values) {
35134
35199
  function isVariantOrVariantList(value) {
35135
35200
  return isString2(value) || Array.isArray(value);
35136
35201
  }
35137
- var withFX = (Component16) => react_11.default.forwardRef((props, forwardedRef) => {
35202
+ var withFX = (Component18) => react_11.default.forwardRef((props, forwardedRef) => {
35138
35203
  var _a;
35139
35204
  if (props.__withFX) {
35140
- return /* @__PURE__ */ (0, jsx_runtime_1.jsx)(Component16, {
35205
+ return /* @__PURE__ */ (0, jsx_runtime_1.jsx)(Component18, {
35141
35206
  ...props,
35142
35207
  animate: void 0,
35143
35208
  initial: void 0,
@@ -35148,7 +35213,7 @@ var withFX = (Component16) => react_11.default.forwardRef((props, forwardedRef)
35148
35213
  if (RenderTarget.current() === RenderTarget.canvas) {
35149
35214
  const animate4 = isVariantOrVariantList(props.animate) ? props.animate : void 0;
35150
35215
  const initial2 = isVariantOrVariantList(props.initial) ? props.initial : void 0;
35151
- return /* @__PURE__ */ (0, jsx_runtime_1.jsx)(Component16, {
35216
+ return /* @__PURE__ */ (0, jsx_runtime_1.jsx)(Component18, {
35152
35217
  ...props,
35153
35218
  animate: animate4,
35154
35219
  initial: initial2,
@@ -35226,7 +35291,7 @@ var withFX = (Component16) => react_11.default.forwardRef((props, forwardedRef)
35226
35291
  exit,
35227
35292
  }
35228
35293
  : {};
35229
- return /* @__PURE__ */ (0, jsx_runtime_1.jsx)(Component16, {
35294
+ return /* @__PURE__ */ (0, jsx_runtime_1.jsx)(Component18, {
35230
35295
  ...forwardedProps,
35231
35296
  ...motionGestures,
35232
35297
  __withFX: true,
@@ -35352,7 +35417,7 @@ var ComponentViewportContext = /* @__PURE__ */ react_11.default.createContext({}
35352
35417
  function useComponentViewport() {
35353
35418
  return react_11.default.useContext(ComponentViewportContext);
35354
35419
  }
35355
- var ComponentViewportProvider = /* @__PURE__ */ react_11.default.forwardRef(({ width, height, y, children, ...rest }, ref) => {
35420
+ var ComponentViewportProvider = /* @__PURE__ */ react_11.default.forwardRef(function ComponentViewportProvider2({ width, height, y, children, ...rest }, ref) {
35356
35421
  const componentViewport = react_11.default.useMemo(() => {
35357
35422
  return {
35358
35423
  width,
@@ -35367,9 +35432,9 @@ var ComponentViewportProvider = /* @__PURE__ */ react_11.default.forwardRef(({ w
35367
35432
  });
35368
35433
  });
35369
35434
  exports.ComponentViewportProvider = ComponentViewportProvider;
35370
- var withGeneratedLayoutId = (Component16) => react_11.default.forwardRef((props, ref) => {
35435
+ var withGeneratedLayoutId = (Component18) => react_11.default.forwardRef((props, ref) => {
35371
35436
  const layoutId = useLayoutId2(props);
35372
- return /* @__PURE__ */ (0, jsx_runtime_1.jsx)(Component16, {
35437
+ return /* @__PURE__ */ (0, jsx_runtime_1.jsx)(Component18, {
35373
35438
  layoutId,
35374
35439
  ...props,
35375
35440
  layoutIdKey: void 0,
@@ -35378,7 +35443,84 @@ var withGeneratedLayoutId = (Component16) => react_11.default.forwardRef((props,
35378
35443
  });
35379
35444
  });
35380
35445
  exports.withGeneratedLayoutId = withGeneratedLayoutId;
35381
- var ContainerErrorBoundary = class extends react_7.Component {
35446
+ function collectErrorToAnalytics(error, errorInfo) {
35447
+ var _a;
35448
+ if (typeof window === 'undefined')
35449
+ return;
35450
+ if (Math.random() > 0.01)
35451
+ return;
35452
+ const stack = error instanceof Error && typeof error.stack === 'string' ? error.stack : null;
35453
+ const componentStack = errorInfo == null ? void 0 : errorInfo.componentStack;
35454
+ (_a = safeWindow.__framer_events) == null ? void 0 : _a.push(['published_site_load_recoverable_error', {
35455
+ message: String(error),
35456
+ stack,
35457
+ // only log componentStack if we don't have a stack
35458
+ componentStack: stack ? void 0 : componentStack,
35459
+ },]);
35460
+ }
35461
+ function logError(...args) {
35462
+ if (false)
35463
+ return;
35464
+ console.error(...args);
35465
+ }
35466
+ function shouldEnableCodeBoundaries() {
35467
+ return RenderTarget.current() !== RenderTarget.canvas;
35468
+ }
35469
+ function CodeComponentBoundary({ errorMessage, fallback, children, }) {
35470
+ if (!shouldEnableCodeBoundaries()) {
35471
+ return children;
35472
+ }
35473
+ return /* @__PURE__ */ (0, jsx_runtime_1.jsx)(ClientSideErrorBoundary, {
35474
+ fallback,
35475
+ errorMessage,
35476
+ children: /* @__PURE__ */ (0, jsx_runtime_1.jsx)(ServerSideErrorBoundary, {
35477
+ fallback,
35478
+ children,
35479
+ }),
35480
+ });
35481
+ }
35482
+ var ClientSideErrorBoundary = class extends react_7.Component {
35483
+ constructor() {
35484
+ super(...arguments);
35485
+ __publicField(this, 'state', {
35486
+ hasError: false,
35487
+ });
35488
+ }
35489
+ static getDerivedStateFromError() {
35490
+ return {
35491
+ hasError: true,
35492
+ };
35493
+ }
35494
+ componentDidCatch(error, errorInfo) {
35495
+ logError(this.props.errorMessage, errorInfo == null ? void 0 : errorInfo.componentStack);
35496
+ collectErrorToAnalytics(error, errorInfo);
35497
+ }
35498
+ render() {
35499
+ const { children, fallback = null, } = this.props;
35500
+ const { hasError, } = this.state;
35501
+ return hasError ? fallback : children;
35502
+ }
35503
+ };
35504
+ function ServerSideErrorBoundary({ children, fallback = null, }) {
35505
+ return typeof window === 'undefined'
35506
+ ? // On the server, Suspense fallback is activated by errors. So we use the actual Suspense,
35507
+ // and render the actual error fallback if Suspense activates.
35508
+ /* @__PURE__ */
35509
+ (0, jsx_runtime_1.jsx)(react_13.Suspense, {
35510
+ fallback,
35511
+ children,
35512
+ })
35513
+ : // On the client, Suspense fallback is activated by data fetching. So we use SuspenseThatPreservesDom,
35514
+ // because we don’t want to render a fallback if the boundary gets inadvertently activated.
35515
+ //
35516
+ // “Why won’t you just render plain children without Suspense?” Because that would cause a hydration mismatch
35517
+ // (the server has Suspense, the client doesn’t).
35518
+ /* @__PURE__ */
35519
+ (0, jsx_runtime_1.jsx)(SuspenseThatPreservesDom, {
35520
+ children,
35521
+ });
35522
+ }
35523
+ var DeprecatedContainerErrorBoundary = class extends react_7.Component {
35382
35524
  constructor() {
35383
35525
  super(...arguments);
35384
35526
  __publicField(this, 'state', {
@@ -35388,21 +35530,12 @@ var ContainerErrorBoundary = class extends react_7.Component {
35388
35530
  // We use `componentDidCatch` instead of `static getDerivedStateFromError()` because the latter could also catch hydration errors.
35389
35531
  // Hydration errors are recoverable by React, so we don't want to hide the coponent in that case (since the tree will not unmount).
35390
35532
  componentDidCatch(error, errorInfo) {
35391
- var _a;
35392
35533
  const componentStack = errorInfo == null ? void 0 : errorInfo.componentStack;
35393
35534
  console.error('Error in component (see previous log). This component has been hidden. Please check any custom code or code overrides to fix.', componentStack);
35394
35535
  this.setState({
35395
35536
  hasError: true,
35396
35537
  });
35397
- if (typeof window !== 'undefined' && Math.random() <= 0.01) {
35398
- const stack = error instanceof Error && typeof error.stack === 'string' ? error.stack : null;
35399
- (_a = window.__framer_events) == null ? void 0 : _a.push(['published_site_load_recoverable_error', {
35400
- message: String(error),
35401
- stack,
35402
- // only log componentStack if we don't have a stack
35403
- componentStack: stack ? void 0 : componentStack,
35404
- },]);
35405
- }
35538
+ collectErrorToAnalytics(error, errorInfo);
35406
35539
  }
35407
35540
  render() {
35408
35541
  const { children, } = this.props;
@@ -35410,9 +35543,63 @@ var ContainerErrorBoundary = class extends react_7.Component {
35410
35543
  return hasError ? null : children;
35411
35544
  }
35412
35545
  };
35413
- var Providers = /* @__PURE__ */ react_11.default.forwardRef(({ children, layoutId, as, ...props }, ref) => {
35546
+ var CRASH_ERROR_MESSAGE_PREFIX = 'code-crash:';
35547
+ function formatCodeCrashLocationFromSourceNode(scopeId, nodeId) {
35548
+ return `${CRASH_ERROR_MESSAGE_PREFIX}${scopeId}:${nodeId}`;
35549
+ }
35550
+ function getErrorMessageForComponent(scopeId, nodeId) {
35551
+ return getErrorMessageFor('component', scopeId, nodeId);
35552
+ }
35553
+ function getErrorMessageForOverride(scopeId, nodeId) {
35554
+ return getErrorMessageFor('override', scopeId, nodeId);
35555
+ }
35556
+ function getErrorMessageFor(element, scopeId, nodeId) {
35557
+ return `A code ${element} crashed while rendering due to the error above. To find and fix it, open the project in the editor \u2192 open Quick Actions (press Cmd+K or Ctrl+K) \u2192 paste this: ${formatCodeCrashLocationFromSourceNode(scopeId, nodeId)} \u2192 click \u201CShow Layer\u201D.`;
35558
+ }
35559
+ var IsInExternalComponentContext = /* @__PURE__ */ (() => react_11.default.createContext(0))();
35560
+ function useExternalComponentNestingLevel() {
35561
+ return react_11.default.useContext(IsInExternalComponentContext);
35562
+ }
35563
+ function IsExternalComponent({ children, }) {
35564
+ const count = react_11.default.useContext(IsInExternalComponentContext);
35565
+ return /* @__PURE__ */ (0, jsx_runtime_1.jsx)(IsInExternalComponentContext.Provider, {
35566
+ value: count + 1,
35567
+ children,
35568
+ });
35569
+ }
35570
+ function shouldWrapComponentWithBoundary(externalModuleNestingLevel, isAuthoredByUser, isExternalComponent, inComponentSlot) {
35571
+ const isLocalComponentInstance =
35572
+ // We know a component instance is local when it’s not nested inside any external component...
35573
+ externalModuleNestingLevel === 0 ||
35574
+ // ...or – “Ticker edge case” – when it’s nested inside an external component during React rendering,
35575
+ // but is actually defined in a slot that’s passed into the component. (This is the “Ticker edge case”:
35576
+ // if a site has a Ticker (or any other component with slots), and something in a Ticker’s slot crashes,
35577
+ // we want to disable that something, not the whole ticker.)
35578
+ externalModuleNestingLevel === 1 && inComponentSlot;
35579
+ return (isAuthoredByUser || isExternalComponent) && isLocalComponentInstance;
35580
+ }
35581
+ function shouldWrapOverrideWithBoundary(externalModuleNestingLevel, inComponentSlot) {
35582
+ const isWrappingFrameLocalToProject =
35583
+ // We know a frame is local when it’s not nested inside any external component...
35584
+ externalModuleNestingLevel === 0 ||
35585
+ // ...or – “Ticker edge case” – when it’s nested inside an external component during React rendering,
35586
+ // but is actually defined in a slot that’s passed into the component. (This is the “Ticker edge case”:
35587
+ // if a site has a Ticker (or any other component with slots), and an override in a Ticker’s slot crashes,
35588
+ // we want to disable that override, not the whole ticker.)
35589
+ externalModuleNestingLevel === 1 && inComponentSlot;
35590
+ return isWrappingFrameLocalToProject;
35591
+ }
35592
+ var ContainerInner = /* @__PURE__ */ react_11.default.forwardRef(({ children, layoutId, as, scopeId, nodeId, isAuthoredByUser, isModuleExternal, inComponentSlot, ...props }, ref) => {
35414
35593
  const outerLayoutId = useConstant2(() => layoutId ? `${layoutId}-container` : void 0);
35415
35594
  const MotionComponent = htmlElementAsMotionComponent(as);
35595
+ const clonedChildren = react_11.default.Children.map(children, (child) => {
35596
+ return react_11.default.isValidElement(child)
35597
+ ? react_11.default.cloneElement(child, {
35598
+ layoutId,
35599
+ })
35600
+ : child;
35601
+ });
35602
+ const childrenWithCodeBoundary = useWrapWithCodeBoundary(clonedChildren, scopeId, nodeId, isAuthoredByUser, isModuleExternal, inComponentSlot);
35416
35603
  return /* @__PURE__ */ (0, jsx_runtime_1.jsx)(MotionComponent, {
35417
35604
  layoutId: outerLayoutId,
35418
35605
  ...props,
@@ -35424,22 +35611,64 @@ var Providers = /* @__PURE__ */ react_11.default.forwardRef(({ children, layoutI
35424
35611
  children: /* @__PURE__ */ (0, jsx_runtime_1.jsx)(LayoutGroup, {
35425
35612
  id: layoutId ?? '',
35426
35613
  inherit: 'id',
35427
- children: /* @__PURE__ */ (0, jsx_runtime_1.jsx)(ContainerErrorBoundary, {
35428
- children: react_11.default.Children.map(children, (child) => {
35429
- return react_11.default.isValidElement(child)
35430
- ? react_11.default.cloneElement(child, {
35431
- layoutId,
35432
- })
35433
- : child;
35434
- }),
35435
- }),
35614
+ children: childrenWithCodeBoundary,
35436
35615
  }),
35437
35616
  }),
35438
35617
  }),
35439
35618
  });
35440
35619
  });
35441
- var Container = /* @__PURE__ */ withGeneratedLayoutId(Providers);
35620
+ var Container = /* @__PURE__ */ withGeneratedLayoutId(ContainerInner);
35442
35621
  exports.Container = Container;
35622
+ var SmartComponentScopedContainer = /* @__PURE__ */ react_11.default.forwardRef((props, ref) => {
35623
+ const { as, layoutId, scopeId, nodeId, isAuthoredByUser, rendersWithMotion, isModuleExternal, inComponentSlot, style, children, ...renderableProps } = props;
35624
+ const childrenWithCodeBoundary = useWrapWithCodeBoundary(children, scopeId, nodeId, isAuthoredByUser, isModuleExternal, inComponentSlot);
35625
+ const tagName = props.as ?? 'div';
35626
+ if (props.rendersWithMotion) {
35627
+ const Component18 = htmlElementAsMotionComponent(tagName);
35628
+ return /* @__PURE__ */ (0, jsx_runtime_1.jsx)(Component18, {
35629
+ ref,
35630
+ style: props.style,
35631
+ ...renderableProps,
35632
+ children: childrenWithCodeBoundary,
35633
+ });
35634
+ }
35635
+ else {
35636
+ const Component18 = tagName;
35637
+ return /* @__PURE__ */ (0, jsx_runtime_1.jsx)(Component18, {
35638
+ ref,
35639
+ style: props.style,
35640
+ ...renderableProps,
35641
+ children: childrenWithCodeBoundary,
35642
+ });
35643
+ }
35644
+ });
35645
+ exports.SmartComponentScopedContainer = SmartComponentScopedContainer;
35646
+ function useWrapWithCodeBoundary(children, scopeId, nodeId, isAuthoredByUser, isExternalComponent, inComponentSlot) {
35647
+ const externalModuleNestingLevel = useExternalComponentNestingLevel();
35648
+ if (
35649
+ // Those props will either be all undefined, which means the Container wasn’t codegenned yet,
35650
+ // and we should use the old ContainerErrorBoundary –
35651
+ // or all defined, which means we have enough information to use the new boundary.
35652
+ isUndefined(scopeId) || isUndefined(nodeId)) {
35653
+ return /* @__PURE__ */ (0, jsx_runtime_1.jsx)(DeprecatedContainerErrorBoundary, {
35654
+ children,
35655
+ });
35656
+ }
35657
+ const shouldWrapWithBoundary = shouldWrapComponentWithBoundary(externalModuleNestingLevel, isAuthoredByUser ?? false, isExternalComponent ?? false, inComponentSlot ?? false);
35658
+ if (shouldWrapWithBoundary) {
35659
+ children = /* @__PURE__ */ (0, jsx_runtime_1.jsx)(CodeComponentBoundary, {
35660
+ errorMessage: getErrorMessageForComponent(scopeId, nodeId),
35661
+ fallback: null,
35662
+ children,
35663
+ });
35664
+ }
35665
+ if (isExternalComponent) {
35666
+ children = /* @__PURE__ */ (0, jsx_runtime_1.jsx)(IsExternalComponent, {
35667
+ children,
35668
+ });
35669
+ }
35670
+ return children;
35671
+ }
35443
35672
  var StyleSheetContext = /* @__PURE__ */ react_11.default.createContext(void 0);
35444
35673
  exports.StyleSheetContext = StyleSheetContext;
35445
35674
  var framerPostSSRCSSSelector = 'style[data-framer-css-ssr-minified]';
@@ -35456,7 +35685,7 @@ var componentsWithServerRenderedStyles = /* @__PURE__ */ (() => {
35456
35685
  })();
35457
35686
  var framerCSSMarker = 'data-framer-css-ssr';
35458
35687
  exports.framerCSSMarker = framerCSSMarker;
35459
- var withCSS = (Component16, escapedCSS, componentSerializationId) => react_11.default.forwardRef((props, ref) => {
35688
+ var withCSS = (Component18, escapedCSS, componentSerializationId) => react_11.default.forwardRef((props, ref) => {
35460
35689
  const { sheet, cache: cache2, } = react_11.default.useContext(StyleSheetContext) ?? {};
35461
35690
  if (!isBrowser2()) {
35462
35691
  if (isFunction(escapedCSS))
@@ -35473,7 +35702,7 @@ var withCSS = (Component16, escapedCSS, componentSerializationId) => react_11.de
35473
35702
  __html: concatenatedCSS,
35474
35703
  },
35475
35704
  }),
35476
- /* @__PURE__ */ (0, jsx_runtime_1.jsx)(Component16, {
35705
+ /* @__PURE__ */ (0, jsx_runtime_1.jsx)(Component18, {
35477
35706
  ...props,
35478
35707
  ref,
35479
35708
  }),
@@ -35490,7 +35719,7 @@ var withCSS = (Component16, escapedCSS, componentSerializationId) => react_11.de
35490
35719
  : escapedCSS.split('\n');
35491
35720
  css2.forEach((rule) => rule && injectCSSRule(rule, sheet, cache2));
35492
35721
  }, []);
35493
- return /* @__PURE__ */ (0, jsx_runtime_1.jsx)(Component16, {
35722
+ return /* @__PURE__ */ (0, jsx_runtime_1.jsx)(Component18, {
35494
35723
  ...props,
35495
35724
  ref,
35496
35725
  });
@@ -36468,10 +36697,10 @@ function ChildrenCanSuspend({ children, }) {
36468
36697
  children,
36469
36698
  });
36470
36699
  }
36471
- function withChildrenCanSuspend(Component16) {
36700
+ function withChildrenCanSuspend(Component18) {
36472
36701
  return (0, react_4.forwardRef)(function withChildrenCanSuspendInner(props, ref) {
36473
36702
  return /* @__PURE__ */ (0, jsx_runtime_1.jsx)(ChildrenCanSuspend, {
36474
- children: /* @__PURE__ */ (0, jsx_runtime_1.jsx)(Component16, {
36703
+ children: /* @__PURE__ */ (0, jsx_runtime_1.jsx)(Component18, {
36475
36704
  ...props,
36476
36705
  ref,
36477
36706
  }),
@@ -37025,7 +37254,7 @@ function getRouteFromPageLink(pageLink, router, currentRoute) {
37025
37254
  const { webPageId, } = pageLink;
37026
37255
  return (_a = router.getRoute) == null ? void 0 : _a.call(router, webPageId);
37027
37256
  }
37028
- var Link = /* @__PURE__ */ withChildrenCanSuspend(/* @__PURE__ */ (0, react_4.forwardRef)(({ children, href, openInNewTab, smoothScroll, nodeId, ...restProps }, forwardedRef) => {
37257
+ var Link = /* @__PURE__ */ withChildrenCanSuspend(/* @__PURE__ */ (0, react_4.forwardRef)(function Link2({ children, href, openInNewTab, smoothScroll, nodeId, ...restProps }, forwardedRef) {
37029
37258
  const router = useRouter();
37030
37259
  const currentRoute = useCurrentRoute();
37031
37260
  const implicitPathVariables = useImplicitPathVariables();
@@ -37082,6 +37311,7 @@ var Link = /* @__PURE__ */ withChildrenCanSuspend(/* @__PURE__ */ (0, react_4.fo
37082
37311
  return getChildren(el);
37083
37312
  }));
37084
37313
  exports.Link = Link;
37314
+ exports.FramerLink = Link;
37085
37315
  var ParentLinkContext = /* @__PURE__ */ (0, react_1.createContext)(void 0);
37086
37316
  function useReplaceNestedLinks(nodeId, href, propsAddedByLink) {
37087
37317
  const parentLink = (0, react_2.useContext)(ParentLinkContext);
@@ -38048,12 +38278,8 @@ function PageRoot({ RootComponent, isWebsite, routeId, framerSiteId, pathVariabl
38048
38278
  },
38049
38279
  preserveQueryParams,
38050
38280
  enableAsyncURLUpdates,
38051
- editorBar: EditorBar && framerSiteId && /* @__PURE__ */ (0, jsx_runtime_1.jsx)(IgnoreErrors, {
38052
- children: /* @__PURE__ */ (0, jsx_runtime_1.jsx)(react_13.Suspense, {
38053
- children: /* @__PURE__ */ (0, jsx_runtime_1.jsx)(EditorBar, {
38054
- framerSiteId,
38055
- }),
38056
- }),
38281
+ editorBar: /* @__PURE__ */ (0, jsx_runtime_1.jsx)(EditorBarLauncher, {
38282
+ EditorBar,
38057
38283
  }),
38058
38284
  }),
38059
38285
  }),
@@ -38078,6 +38304,24 @@ function PageRoot({ RootComponent, isWebsite, routeId, framerSiteId, pathVariabl
38078
38304
  });
38079
38305
  }
38080
38306
  }
38307
+ function EditorBarLauncher({ EditorBar, }) {
38308
+ const [mounted, setMounted,] = (0, react_9.useState)(false);
38309
+ const framerSiteId = (0, react_2.useContext)(FormContext);
38310
+ (0, react_2.useEffect)(() => {
38311
+ (0, react_12.startTransition)(() => {
38312
+ setMounted(true);
38313
+ });
38314
+ }, []);
38315
+ if (!EditorBar || !framerSiteId || !mounted)
38316
+ return null;
38317
+ return /* @__PURE__ */ (0, jsx_runtime_1.jsx)(IgnoreErrors, {
38318
+ children: /* @__PURE__ */ (0, jsx_runtime_1.jsx)(react_13.Suspense, {
38319
+ children: /* @__PURE__ */ (0, jsx_runtime_1.jsx)(EditorBar, {
38320
+ framerSiteId,
38321
+ }),
38322
+ }),
38323
+ });
38324
+ }
38081
38325
  function cloneChildrenWithProps(children, props, asNode) {
38082
38326
  const cloned = React2.Children.map(children, (child) => {
38083
38327
  if (React2.isValidElement(child)) {
@@ -38676,61 +38920,61 @@ var DatabaseValue = {
38676
38920
  * Checks if the left value is equal to the right value. Returns false if
38677
38921
  * the values are not of the same type.
38678
38922
  */
38679
- equal(left, right, collation10) {
38923
+ equal(left, right, collation11) {
38680
38924
  if ((left == null ? void 0 : left.type) !== (right == null ? void 0 : right.type)) {
38681
38925
  return false;
38682
38926
  }
38683
- return compare(left, right, collation10) === 0;
38927
+ return compare(left, right, collation11) === 0;
38684
38928
  },
38685
38929
  /**
38686
38930
  * Checks if the left value is less than the right value. Returns false if
38687
38931
  * the values are not of the same type.
38688
38932
  */
38689
- lessThan(left, right, collation10) {
38933
+ lessThan(left, right, collation11) {
38690
38934
  if ((left == null ? void 0 : left.type) !== (right == null ? void 0 : right.type)) {
38691
38935
  return false;
38692
38936
  }
38693
- return compare(left, right, collation10) < 0;
38937
+ return compare(left, right, collation11) < 0;
38694
38938
  },
38695
38939
  /**
38696
38940
  * Checks if the left value is less than or equal to the right value.
38697
38941
  * Returns false if the values are not of the same type.
38698
38942
  */
38699
- lessThanOrEqual(left, right, collation10) {
38943
+ lessThanOrEqual(left, right, collation11) {
38700
38944
  if ((left == null ? void 0 : left.type) !== (right == null ? void 0 : right.type)) {
38701
38945
  return false;
38702
38946
  }
38703
- return compare(left, right, collation10) <= 0;
38947
+ return compare(left, right, collation11) <= 0;
38704
38948
  },
38705
38949
  /**
38706
38950
  * Checks if the left value is greater than the right value. Returns false
38707
38951
  * if the values are not of the same type.
38708
38952
  */
38709
- greaterThan(left, right, collation10) {
38953
+ greaterThan(left, right, collation11) {
38710
38954
  if ((left == null ? void 0 : left.type) !== (right == null ? void 0 : right.type)) {
38711
38955
  return false;
38712
38956
  }
38713
- return compare(left, right, collation10) > 0;
38957
+ return compare(left, right, collation11) > 0;
38714
38958
  },
38715
38959
  /**
38716
38960
  * Checks if the left value is greater than or equal to the right value.
38717
38961
  * Returns false if the values are not of the same type.
38718
38962
  */
38719
- greaterThanOrEqual(left, right, collation10) {
38963
+ greaterThanOrEqual(left, right, collation11) {
38720
38964
  if ((left == null ? void 0 : left.type) !== (right == null ? void 0 : right.type)) {
38721
38965
  return false;
38722
38966
  }
38723
- return compare(left, right, collation10) >= 0;
38967
+ return compare(left, right, collation11) >= 0;
38724
38968
  },
38725
38969
  /**
38726
38970
  * Checks if the left value is in the right value. Returns false if the
38727
38971
  * right value is not an array.
38728
38972
  */
38729
- in(left, right, collation10) {
38973
+ in(left, right, collation11) {
38730
38974
  if ((right == null ? void 0 : right.type) !== 'array')
38731
38975
  return false;
38732
38976
  return right.value.some((item) => {
38733
- return DatabaseValue.equal(item, left, collation10);
38977
+ return DatabaseValue.equal(item, left, collation11);
38734
38978
  });
38735
38979
  },
38736
38980
  /**
@@ -38738,47 +38982,47 @@ var DatabaseValue = {
38738
38982
  *
38739
38983
  * If source has duplicates, the index of the first occurrence is always returned.
38740
38984
  */
38741
- indexOf(source, target, collation10) {
38985
+ indexOf(source, target, collation11) {
38742
38986
  if ((source == null ? void 0 : source.type) !== 'array')
38743
38987
  return -1;
38744
38988
  return source.value.findIndex((item) => {
38745
- return DatabaseValue.equal(item, target, collation10);
38989
+ return DatabaseValue.equal(item, target, collation11);
38746
38990
  });
38747
38991
  },
38748
- contains(source, target, collation10) {
38992
+ contains(source, target, collation11) {
38749
38993
  let sourceValue = toString(source);
38750
38994
  let targetValue = toString(target);
38751
38995
  if (isNull(sourceValue))
38752
38996
  return false;
38753
38997
  if (isNull(targetValue))
38754
38998
  return false;
38755
- if (collation10.type === 0) {
38999
+ if (collation11.type === 0) {
38756
39000
  sourceValue = sourceValue.toLowerCase();
38757
39001
  targetValue = targetValue.toLowerCase();
38758
39002
  }
38759
39003
  return sourceValue.includes(targetValue);
38760
39004
  },
38761
- startsWith(source, target, collation10) {
39005
+ startsWith(source, target, collation11) {
38762
39006
  let sourceValue = toString(source);
38763
39007
  let targetValue = toString(target);
38764
39008
  if (isNull(sourceValue))
38765
39009
  return false;
38766
39010
  if (isNull(targetValue))
38767
39011
  return false;
38768
- if (collation10.type === 0) {
39012
+ if (collation11.type === 0) {
38769
39013
  sourceValue = sourceValue.toLowerCase();
38770
39014
  targetValue = targetValue.toLowerCase();
38771
39015
  }
38772
39016
  return sourceValue.startsWith(targetValue);
38773
39017
  },
38774
- endsWith(source, target, collation10) {
39018
+ endsWith(source, target, collation11) {
38775
39019
  let sourceValue = toString(source);
38776
39020
  let targetValue = toString(target);
38777
39021
  if (isNull(sourceValue))
38778
39022
  return false;
38779
39023
  if (isNull(targetValue))
38780
39024
  return false;
38781
- if (collation10.type === 0) {
39025
+ if (collation11.type === 0) {
38782
39026
  sourceValue = sourceValue.toLowerCase();
38783
39027
  targetValue = targetValue.toLowerCase();
38784
39028
  }
@@ -38824,7 +39068,7 @@ var DatabaseValue = {
38824
39068
  }
38825
39069
  },
38826
39070
  };
38827
- function compare(left, right, collation10) {
39071
+ function compare(left, right, collation11) {
38828
39072
  if (isNull(left) || isNull(right)) {
38829
39073
  assert(left === right);
38830
39074
  return 0;
@@ -38843,7 +39087,7 @@ function compare(left, right, collation10) {
38843
39087
  const rightItem = right.value[i];
38844
39088
  assert(!isUndefined(leftItem), 'Left item must exist');
38845
39089
  assert(!isUndefined(rightItem), 'Right item must exist');
38846
- const result = compare(leftItem, rightItem, collation10);
39090
+ const result = compare(leftItem, rightItem, collation11);
38847
39091
  if (result !== 0)
38848
39092
  return result;
38849
39093
  }
@@ -38930,7 +39174,7 @@ function compare(left, right, collation10) {
38930
39174
  const rightValue = right.value[rightKey];
38931
39175
  assert(!isUndefined(leftValue), 'Left value must exist');
38932
39176
  assert(!isUndefined(rightValue), 'Right value must exist');
38933
- const result = compare(leftValue, rightValue, collation10);
39177
+ const result = compare(leftValue, rightValue, collation11);
38934
39178
  if (result !== 0)
38935
39179
  return result;
38936
39180
  }
@@ -38960,7 +39204,7 @@ function compare(left, right, collation10) {
38960
39204
  assert(left.type === right.type);
38961
39205
  let leftValue = left.value;
38962
39206
  let rightValue = right.value;
38963
- if (collation10.type === 0) {
39207
+ if (collation11.type === 0) {
38964
39208
  leftValue = left.value.toLowerCase();
38965
39209
  rightValue = right.value.toLowerCase();
38966
39210
  }
@@ -38979,6 +39223,208 @@ var unknownDefinition = {
38979
39223
  type: 'unknown',
38980
39224
  isNullable: true,
38981
39225
  };
39226
+ function getNetworkLatency() {
39227
+ return 25;
39228
+ }
39229
+ function getNetworkSpeed() {
39230
+ return 100 * 125;
39231
+ }
39232
+ var KB = 1e3;
39233
+ var Cost = class {
39234
+ constructor(network) {
39235
+ this.network = network;
39236
+ }
39237
+ static estimate(totalRequests, transferredBytes) {
39238
+ const latency = getNetworkLatency();
39239
+ const speed = getNetworkSpeed();
39240
+ const network = totalRequests * latency + transferredBytes / speed;
39241
+ return new Cost(network);
39242
+ }
39243
+ static max(left, right) {
39244
+ const network = Math.max(left.network, right.network);
39245
+ return new Cost(network);
39246
+ }
39247
+ static compare(left, right) {
39248
+ if (left.network < right.network)
39249
+ return -1;
39250
+ if (left.network > right.network)
39251
+ return 1;
39252
+ return 0;
39253
+ }
39254
+ add(cost) {
39255
+ this.network += cost.network;
39256
+ return this;
39257
+ }
39258
+ toString() {
39259
+ return `${this.network}ms`;
39260
+ }
39261
+ };
39262
+ function GroupId(id3) {
39263
+ return id3;
39264
+ }
39265
+ var Group = class {
39266
+ constructor(id3, relational) {
39267
+ this.id = id3;
39268
+ this.relational = relational;
39269
+ __publicField(this, 'nodes', []);
39270
+ __publicField(this, 'winners', /* @__PURE__ */ new Map());
39271
+ }
39272
+ /**
39273
+ * Adds a node to the group. Throws an error if the node is already in a
39274
+ * group.
39275
+ */
39276
+ addNode(node) {
39277
+ this.nodes.push(node);
39278
+ node.setGroup(this);
39279
+ }
39280
+ /**
39281
+ * Returns the winner for the given required physical props. The winner
39282
+ * stores the best node and its cost. This is used to find the best node in
39283
+ * the group.
39284
+ */
39285
+ getWinner(required) {
39286
+ const hash2 = required.getHash();
39287
+ const existing = this.winners.get(hash2);
39288
+ if (existing)
39289
+ return existing;
39290
+ const winner = new Winner();
39291
+ this.winners.set(hash2, winner);
39292
+ return winner;
39293
+ }
39294
+ /**
39295
+ * Returns the optimized version of the node. The optimized version is the
39296
+ * node with the lowest cost with all children replaced with their optimized
39297
+ * versions. This is used to create the final optimized query plan.
39298
+ */
39299
+ getOptimized(required) {
39300
+ const winner = this.getWinner(required);
39301
+ assert(winner.node, 'Group not optimized');
39302
+ const optimizer = winner.node.getOptimized(required);
39303
+ optimizer.setGroup(this);
39304
+ return optimizer;
39305
+ }
39306
+ };
39307
+ var Winner = class {
39308
+ constructor() {
39309
+ __publicField(this, 'node');
39310
+ __publicField(this, 'cost', new Cost(Infinity));
39311
+ __publicField(this, 'nodes', []);
39312
+ }
39313
+ update(node, cost) {
39314
+ this.nodes.push(node);
39315
+ if (Cost.compare(cost, this.cost) < 0) {
39316
+ this.node = node;
39317
+ this.cost = cost;
39318
+ }
39319
+ }
39320
+ };
39321
+ function evaluateSync(generator) {
39322
+ const state2 = generator.next();
39323
+ assert(state2.done, 'Generator must not yield');
39324
+ return state2.value;
39325
+ }
39326
+ async function evaluateAsync(generator, state2 = generator.next()) {
39327
+ while (!state2.done) {
39328
+ const value = await state2.value;
39329
+ state2 = generator.next(value);
39330
+ }
39331
+ return state2.value;
39332
+ }
39333
+ function* evaluateObject(values) {
39334
+ const result = {};
39335
+ const keys3 = Object.keys(values);
39336
+ const promises = [];
39337
+ for (const key7 of keys3) {
39338
+ const generator = values[key7];
39339
+ if (isGenerator2(generator)) {
39340
+ const state2 = generator.next();
39341
+ if (state2.done) {
39342
+ result[key7] = state2.value;
39343
+ }
39344
+ else {
39345
+ promises.push(evaluateAsync(generator, state2).then((value) => {
39346
+ result[key7] = value;
39347
+ }));
39348
+ }
39349
+ }
39350
+ else {
39351
+ result[key7] = generator;
39352
+ }
39353
+ }
39354
+ if (promises.length > 0) {
39355
+ yield Promise.all(promises);
39356
+ }
39357
+ return result;
39358
+ }
39359
+ function* evaluateArray(values) {
39360
+ const result = [];
39361
+ const keys3 = values.keys();
39362
+ const promises = [];
39363
+ for (const key7 of keys3) {
39364
+ const generator = values[key7];
39365
+ if (isGenerator2(generator)) {
39366
+ const state2 = generator.next();
39367
+ if (state2.done) {
39368
+ result[key7] = state2.value;
39369
+ }
39370
+ else {
39371
+ promises.push(evaluateAsync(generator, state2).then((value) => {
39372
+ result[key7] = value;
39373
+ }));
39374
+ }
39375
+ }
39376
+ else {
39377
+ result[key7] = generator;
39378
+ }
39379
+ }
39380
+ if (promises.length > 0) {
39381
+ yield Promise.all(promises);
39382
+ }
39383
+ return result;
39384
+ }
39385
+ var AbstractNode = class {
39386
+ constructor(isSynchronous) {
39387
+ this.isSynchronous = isSynchronous;
39388
+ }
39389
+ };
39390
+ var RelationalNode = class extends AbstractNode {
39391
+ constructor() {
39392
+ super(...arguments);
39393
+ __publicField(this, 'group');
39394
+ }
39395
+ /**
39396
+ * Returns the group that the node belongs to. Throws an error if the node
39397
+ * is not in a group. This should only happen in the constructor because
39398
+ * every node is added to a group right after creation.
39399
+ */
39400
+ getGroup() {
39401
+ assert(this.group, 'Node must be in a group');
39402
+ return this.group;
39403
+ }
39404
+ /**
39405
+ * Adds the node to the given group. Throws an error if the node is already
39406
+ * in a group.
39407
+ */
39408
+ setGroup(group) {
39409
+ assert(!this.group, 'Node is already in a group');
39410
+ this.group = group;
39411
+ }
39412
+ /**
39413
+ * Evaluates the node and all children synchronously. Throws an error if the
39414
+ * node is not synchronous.
39415
+ */
39416
+ evaluateSync() {
39417
+ const generator = this.evaluate(void 0);
39418
+ return evaluateSync(generator);
39419
+ }
39420
+ /**
39421
+ * Evaluates the node and all children asynchronously.
39422
+ */
39423
+ evaluateAsync() {
39424
+ const generator = this.evaluate(void 0);
39425
+ return evaluateAsync(generator);
39426
+ }
39427
+ };
38982
39428
  function Hash(value) {
38983
39429
  return value;
38984
39430
  }
@@ -38987,6 +39433,16 @@ function isHashable(value) {
38987
39433
  }
38988
39434
  function calculateHash(name, ...values) {
38989
39435
  const hashes = values.map((value) => {
39436
+ const isCollectionMetadata = value instanceof CollectionMetadata;
39437
+ assert(!isCollectionMetadata, 'Pass CollectionMetadata.id instead');
39438
+ const isFieldMetadata = value instanceof FieldMetadata;
39439
+ assert(!isFieldMetadata, 'Pass FieldMetadata.id instead');
39440
+ const isIndexMetadata = value instanceof IndexMetadata;
39441
+ assert(!isIndexMetadata, 'Pass IndexMetadata.id instead');
39442
+ const isRelationalNode = value instanceof RelationalNode;
39443
+ assert(!isRelationalNode, 'Pass RelationalNode.group.id instead');
39444
+ const isGroup = value instanceof Group;
39445
+ assert(!isGroup, 'Pass Group.id instead');
38990
39446
  if (isHashable(value)) {
38991
39447
  return value.getHash();
38992
39448
  }
@@ -39111,106 +39567,6 @@ var Fields = class extends Metadata {
39111
39567
  __publicField(this, 'name', 'Fields');
39112
39568
  }
39113
39569
  };
39114
- function getNetworkLatency() {
39115
- return 25;
39116
- }
39117
- function getNetworkSpeed() {
39118
- return 100 * 125;
39119
- }
39120
- var KB = 1e3;
39121
- var Cost = class {
39122
- constructor(network) {
39123
- this.network = network;
39124
- }
39125
- static estimate(totalRequests, transferredBytes) {
39126
- const latency = getNetworkLatency();
39127
- const speed = getNetworkSpeed();
39128
- const network = totalRequests * latency + transferredBytes / speed;
39129
- return new Cost(network);
39130
- }
39131
- static max(left, right) {
39132
- const network = Math.max(left.network, right.network);
39133
- return new Cost(network);
39134
- }
39135
- static compare(left, right) {
39136
- if (left.network < right.network)
39137
- return -1;
39138
- if (left.network > right.network)
39139
- return 1;
39140
- return 0;
39141
- }
39142
- add(cost) {
39143
- this.network += cost.network;
39144
- return this;
39145
- }
39146
- toString() {
39147
- return `${this.network}ms`;
39148
- }
39149
- };
39150
- function evaluateSync(generator) {
39151
- const state2 = generator.next();
39152
- assert(state2.done, 'Generator must not yield');
39153
- return state2.value;
39154
- }
39155
- async function evaluateAsync(generator, state2 = generator.next()) {
39156
- while (!state2.done) {
39157
- const value = await state2.value;
39158
- state2 = generator.next(value);
39159
- }
39160
- return state2.value;
39161
- }
39162
- function* evaluateObject(values) {
39163
- const result = {};
39164
- const keys3 = Object.keys(values);
39165
- const promises = [];
39166
- for (const key7 of keys3) {
39167
- const generator = values[key7];
39168
- if (isGenerator2(generator)) {
39169
- const state2 = generator.next();
39170
- if (state2.done) {
39171
- result[key7] = state2.value;
39172
- }
39173
- else {
39174
- promises.push(evaluateAsync(generator, state2).then((value) => {
39175
- result[key7] = value;
39176
- }));
39177
- }
39178
- }
39179
- else {
39180
- result[key7] = generator;
39181
- }
39182
- }
39183
- if (promises.length > 0) {
39184
- yield Promise.all(promises);
39185
- }
39186
- return result;
39187
- }
39188
- function* evaluateArray(values) {
39189
- const result = [];
39190
- const keys3 = values.keys();
39191
- const promises = [];
39192
- for (const key7 of keys3) {
39193
- const generator = values[key7];
39194
- if (isGenerator2(generator)) {
39195
- const state2 = generator.next();
39196
- if (state2.done) {
39197
- result[key7] = state2.value;
39198
- }
39199
- else {
39200
- promises.push(evaluateAsync(generator, state2).then((value) => {
39201
- result[key7] = value;
39202
- }));
39203
- }
39204
- }
39205
- else {
39206
- result[key7] = generator;
39207
- }
39208
- }
39209
- if (promises.length > 0) {
39210
- yield Promise.all(promises);
39211
- }
39212
- return result;
39213
- }
39214
39570
  var RequiredProps = class {
39215
39571
  constructor(ordering, resolvedFields) {
39216
39572
  this.ordering = ordering;
@@ -39263,8 +39619,11 @@ var Tuple = class {
39263
39619
  __publicField(this, 'values', /* @__PURE__ */ new Map());
39264
39620
  }
39265
39621
  getKey() {
39266
- const pointers = this.pointers.values();
39267
- return Array.from(pointers).join('-');
39622
+ const result = [];
39623
+ for (const [collection, pointer,] of this.pointers) {
39624
+ result.push(`${collection.id}-${pointer}`);
39625
+ }
39626
+ return result.sort().join('-');
39268
39627
  }
39269
39628
  addValue(field, value) {
39270
39629
  this.values.set(field, value);
@@ -39361,49 +39720,6 @@ var Relation = class {
39361
39720
  return result;
39362
39721
  }
39363
39722
  };
39364
- var AbstractNode = class {
39365
- constructor(isSynchronous) {
39366
- this.isSynchronous = isSynchronous;
39367
- }
39368
- };
39369
- var RelationalNode = class extends AbstractNode {
39370
- constructor() {
39371
- super(...arguments);
39372
- __publicField(this, 'group');
39373
- }
39374
- /**
39375
- * Returns the group that the node belongs to. Throws an error if the node
39376
- * is not in a group. This should only happen in the constructor because
39377
- * every node is added to a group right after creation.
39378
- */
39379
- getGroup() {
39380
- assert(this.group, 'Node must be in a group');
39381
- return this.group;
39382
- }
39383
- /**
39384
- * Adds the node to the given group. Throws an error if the node is already
39385
- * in a group.
39386
- */
39387
- setGroup(group) {
39388
- assert(!this.group, 'Node is already in a group');
39389
- this.group = group;
39390
- }
39391
- /**
39392
- * Evaluates the node and all children synchronously. Throws an error if the
39393
- * node is not synchronous.
39394
- */
39395
- evaluateSync() {
39396
- const generator = this.evaluate(void 0);
39397
- return evaluateSync(generator);
39398
- }
39399
- /**
39400
- * Evaluates the node and all children asynchronously.
39401
- */
39402
- evaluateAsync() {
39403
- const generator = this.evaluate(void 0);
39404
- return evaluateAsync(generator);
39405
- }
39406
- };
39407
39723
  var ProjectionField = class {
39408
39724
  constructor(input, field) {
39409
39725
  this.input = input;
@@ -39436,7 +39752,16 @@ var RelationalProject = class extends RelationalNode {
39436
39752
  }
39437
39753
  return fields;
39438
39754
  }
39439
- canProvideOrdering() {
39755
+ canProvideOrdering(ordering) {
39756
+ const projectionFields = new Fields();
39757
+ for (const projection of this.projections) {
39758
+ projectionFields.add(projection.field);
39759
+ }
39760
+ for (const { field, } of ordering.fields) {
39761
+ if (projectionFields.has(field)) {
39762
+ return false;
39763
+ }
39764
+ }
39440
39765
  return true;
39441
39766
  }
39442
39767
  canProvideResolvedFields() {
@@ -40489,21 +40814,19 @@ var RelationalLeftJoin = class extends RelationalNode {
40489
40814
  return new RelationalLeftJoin(left, right, constraint);
40490
40815
  }
40491
40816
  /** Optimized path for equality constraints that runs in O(n + m) time. */
40492
- *evaluateScalarEquals(result, constraint, context) {
40493
- const { left, right, } = yield* evaluateObject({
40494
- left: this.left.evaluate(context),
40495
- right: this.right.evaluate(context),
40496
- });
40817
+ *evaluateScalarEquals(left, right, leftConstraint, rightConstraint, context) {
40497
40818
  const joinKeyMap = /* @__PURE__ */ new Map();
40498
40819
  for (const rightTuple of right.tuples) {
40499
- const rightValue = yield* constraint.right.evaluate(context, rightTuple);
40820
+ const rightValue = yield* rightConstraint.evaluate(context, rightTuple);
40500
40821
  const key7 = JSON.stringify((rightValue == null ? void 0 : rightValue.value) ?? null);
40501
40822
  const tuplesForKey = joinKeyMap.get(key7) ?? [];
40502
40823
  tuplesForKey.push(rightTuple);
40503
40824
  joinKeyMap.set(key7, tuplesForKey);
40504
40825
  }
40826
+ const outputFields = this.getOutputFields();
40827
+ const result = new Relation(outputFields);
40505
40828
  for (const leftTuple of left.tuples) {
40506
- const leftValue = yield* constraint.left.evaluate(context, leftTuple);
40829
+ const leftValue = yield* leftConstraint.evaluate(context, leftTuple);
40507
40830
  const key7 = JSON.stringify((leftValue == null ? void 0 : leftValue.value) ?? null);
40508
40831
  const matches = joinKeyMap.get(key7) ?? [];
40509
40832
  if (matches.length === 0) {
@@ -40521,16 +40844,22 @@ var RelationalLeftJoin = class extends RelationalNode {
40521
40844
  return result;
40522
40845
  }
40523
40846
  *evaluate(context) {
40524
- const outputFields = this.getOutputFields();
40525
- const result = new Relation(outputFields);
40526
- if (this.constraint instanceof ScalarEquals) {
40527
- yield* this.evaluateScalarEquals(result.tuples, this.constraint, context);
40528
- return result;
40529
- }
40530
40847
  const { left, right, } = yield* evaluateObject({
40531
40848
  left: this.left.evaluate(context),
40532
40849
  right: this.right.evaluate(context),
40533
40850
  });
40851
+ if (this.constraint instanceof ScalarEquals) {
40852
+ if (this.constraint.left.referencedFields.subsetOf(this.leftGroup.relational.outputFields) &&
40853
+ this.constraint.right.referencedFields.subsetOf(this.rightGroup.relational.outputFields)) {
40854
+ return yield* this.evaluateScalarEquals(left, right, this.constraint.left, this.constraint.right, context);
40855
+ }
40856
+ if (this.constraint.right.referencedFields.subsetOf(this.leftGroup.relational.outputFields) &&
40857
+ this.constraint.left.referencedFields.subsetOf(this.rightGroup.relational.outputFields)) {
40858
+ return yield* this.evaluateScalarEquals(left, right, this.constraint.right, this.constraint.left, context);
40859
+ }
40860
+ }
40861
+ const outputFields = this.getOutputFields();
40862
+ const result = new Relation(outputFields);
40534
40863
  for (const leftTuple of left.tuples) {
40535
40864
  let hasMatch = false;
40536
40865
  for (const rightTuple of right.tuples) {
@@ -40607,21 +40936,19 @@ var RelationalRightJoin = class extends RelationalNode {
40607
40936
  return new RelationalRightJoin(left, right, constraint);
40608
40937
  }
40609
40938
  /** Optimized path for equality constraints that runs in O(n + m) time. */
40610
- *evaluateScalarEquals(result, constraint, context) {
40611
- const { left, right, } = yield* evaluateObject({
40612
- left: this.left.evaluate(context),
40613
- right: this.right.evaluate(context),
40614
- });
40939
+ *evaluateScalarEquals(left, right, leftConstraint, rightConstraint, context) {
40615
40940
  const joinKeyMap = /* @__PURE__ */ new Map();
40616
40941
  for (const leftTuple of left.tuples) {
40617
- const leftValue = yield* constraint.left.evaluate(context, leftTuple);
40942
+ const leftValue = yield* leftConstraint.evaluate(context, leftTuple);
40618
40943
  const key7 = JSON.stringify((leftValue == null ? void 0 : leftValue.value) ?? null);
40619
40944
  const tuplesForKey = joinKeyMap.get(key7) ?? [];
40620
40945
  tuplesForKey.push(leftTuple);
40621
40946
  joinKeyMap.set(key7, tuplesForKey);
40622
40947
  }
40948
+ const outputFields = this.getOutputFields();
40949
+ const result = new Relation(outputFields);
40623
40950
  for (const rightTuple of right.tuples) {
40624
- const rightValue = yield* constraint.right.evaluate(context, rightTuple);
40951
+ const rightValue = yield* rightConstraint.evaluate(context, rightTuple);
40625
40952
  const key7 = JSON.stringify((rightValue == null ? void 0 : rightValue.value) ?? null);
40626
40953
  const matches = joinKeyMap.get(key7) ?? [];
40627
40954
  if (matches.length === 0) {
@@ -40639,16 +40966,22 @@ var RelationalRightJoin = class extends RelationalNode {
40639
40966
  return result;
40640
40967
  }
40641
40968
  *evaluate(context) {
40642
- const outputFields = this.getOutputFields();
40643
- const result = new Relation(outputFields);
40644
- if (this.constraint instanceof ScalarEquals) {
40645
- yield* this.evaluateScalarEquals(result.tuples, this.constraint, context);
40646
- return result;
40647
- }
40648
40969
  const { left, right, } = yield* evaluateObject({
40649
40970
  left: this.left.evaluate(context),
40650
40971
  right: this.right.evaluate(context),
40651
40972
  });
40973
+ if (this.constraint instanceof ScalarEquals) {
40974
+ if (this.constraint.left.referencedFields.subsetOf(this.leftGroup.relational.outputFields) &&
40975
+ this.constraint.right.referencedFields.subsetOf(this.rightGroup.relational.outputFields)) {
40976
+ return yield* this.evaluateScalarEquals(left, right, this.constraint.left, this.constraint.right, context);
40977
+ }
40978
+ if (this.constraint.right.referencedFields.subsetOf(this.leftGroup.relational.outputFields) &&
40979
+ this.constraint.left.referencedFields.subsetOf(this.rightGroup.relational.outputFields)) {
40980
+ return yield* this.evaluateScalarEquals(left, right, this.constraint.right, this.constraint.left, context);
40981
+ }
40982
+ }
40983
+ const outputFields = this.getOutputFields();
40984
+ const result = new Relation(outputFields);
40652
40985
  for (const rightTuple of right.tuples) {
40653
40986
  let hasMatch = false;
40654
40987
  for (const leftTuple of left.tuples) {
@@ -41246,7 +41579,7 @@ var Explorer = class {
41246
41579
  explore(before) {
41247
41580
  const group = before.getGroup();
41248
41581
  if (before instanceof RelationalLeftJoin) {
41249
- const after = new RelationalRightJoin(before.left, before.right, before.constraint);
41582
+ const after = new RelationalRightJoin(before.right, before.left, before.constraint);
41250
41583
  this.memo.addRelational(after, group);
41251
41584
  }
41252
41585
  if (before instanceof RelationalFilter) {
@@ -41383,63 +41716,6 @@ function createIndexQueryAll(length) {
41383
41716
  };
41384
41717
  return new Array(length).fill(lookup);
41385
41718
  }
41386
- function GroupId(id3) {
41387
- return id3;
41388
- }
41389
- var Group = class {
41390
- constructor(id3, relational) {
41391
- this.id = id3;
41392
- this.relational = relational;
41393
- __publicField(this, 'nodes', []);
41394
- __publicField(this, 'winners', /* @__PURE__ */ new Map());
41395
- }
41396
- /**
41397
- * Adds a node to the group. Throws an error if the node is already in a
41398
- * group.
41399
- */
41400
- addNode(node) {
41401
- this.nodes.push(node);
41402
- node.setGroup(this);
41403
- }
41404
- /**
41405
- * Returns the winner for the given required physical props. The winner
41406
- * stores the best node and its cost. This is used to find the best node in
41407
- * the group.
41408
- */
41409
- getWinner(required) {
41410
- const hash2 = required.getHash();
41411
- const existing = this.winners.get(hash2);
41412
- if (existing)
41413
- return existing;
41414
- const winner = new Winner();
41415
- this.winners.set(hash2, winner);
41416
- return winner;
41417
- }
41418
- /**
41419
- * Returns the optimized version of the node. The optimized version is the
41420
- * node with the lowest cost with all children replaced with their optimized
41421
- * versions. This is used to create the final optimized query plan.
41422
- */
41423
- getOptimized(required) {
41424
- const winner = this.getWinner(required);
41425
- assert(winner.node, 'Group not optimized');
41426
- const optimizer = winner.node.getOptimized(required);
41427
- optimizer.setGroup(this);
41428
- return optimizer;
41429
- }
41430
- };
41431
- var Winner = class {
41432
- constructor() {
41433
- __publicField(this, 'node');
41434
- __publicField(this, 'cost', new Cost(Infinity));
41435
- }
41436
- update(node, cost) {
41437
- if (Cost.compare(cost, this.cost) < 0) {
41438
- this.node = node;
41439
- this.cost = cost;
41440
- }
41441
- }
41442
- };
41443
41719
  var RelationalProps = class {
41444
41720
  constructor(outputFields) {
41445
41721
  this.outputFields = outputFields;
@@ -41606,9 +41882,11 @@ var EnforcerSort = class extends EnforcerNode {
41606
41882
  getInputRequiredProps(required) {
41607
41883
  const resolvedFields = new Fields(required.resolvedFields);
41608
41884
  for (const { field, } of this.ordering.fields) {
41609
- if (field.name !== VIRTUAL_INDEX_FIELD) {
41610
- resolvedFields.add(field);
41611
- }
41885
+ if (field.name === VIRTUAL_INDEX_FIELD)
41886
+ continue;
41887
+ if (isUndefined(field.collection))
41888
+ continue;
41889
+ resolvedFields.add(field);
41612
41890
  }
41613
41891
  const ordering = new Ordering();
41614
41892
  return new RequiredProps(ordering, resolvedFields);
@@ -41799,6 +42077,8 @@ var ScalarArray = class extends ScalarNode {
41799
42077
  const resolvedFields = new Fields();
41800
42078
  const fields = Object.values(this.namedFields);
41801
42079
  for (const field of fields) {
42080
+ if (isUndefined(field.collection))
42081
+ continue;
41802
42082
  resolvedFields.add(field);
41803
42083
  }
41804
42084
  return new RequiredProps(this.ordering, resolvedFields);
@@ -41885,7 +42165,9 @@ var ScalarFlatArray = class extends ScalarNode {
41885
42165
  }
41886
42166
  getInputRequiredProps() {
41887
42167
  const resolvedFields = new Fields();
41888
- resolvedFields.add(this.field);
42168
+ if (!isUndefined(this.field.collection)) {
42169
+ resolvedFields.add(this.field);
42170
+ }
41889
42171
  return new RequiredProps(this.ordering, resolvedFields);
41890
42172
  }
41891
42173
  optimize(optimizer) {
@@ -41913,7 +42195,7 @@ var ScalarFlatArray = class extends ScalarNode {
41913
42195
  };
41914
42196
  }
41915
42197
  };
41916
- var collation7 = {
42198
+ var collation8 = {
41917
42199
  type: 0,
41918
42200
  /* CaseInsensitive */
41919
42201
  };
@@ -41957,11 +42239,11 @@ var ScalarIn = class extends ScalarNode {
41957
42239
  });
41958
42240
  return {
41959
42241
  type: 'boolean',
41960
- value: DatabaseValue.in(left, right, collation7),
42242
+ value: DatabaseValue.in(left, right, collation8),
41961
42243
  };
41962
42244
  }
41963
42245
  };
41964
- var collation8 = {
42246
+ var collation9 = {
41965
42247
  type: 1,
41966
42248
  /* CaseSensitive */
41967
42249
  };
@@ -42005,7 +42287,7 @@ var ScalarIndexOf = class extends ScalarNode {
42005
42287
  });
42006
42288
  return {
42007
42289
  type: 'number',
42008
- value: DatabaseValue.indexOf(source, target, collation8),
42290
+ value: DatabaseValue.indexOf(source, target, collation9),
42009
42291
  };
42010
42292
  }
42011
42293
  };
@@ -42069,7 +42351,7 @@ var ScalarNot = class extends ScalarNode {
42069
42351
  };
42070
42352
  }
42071
42353
  };
42072
- var collation9 = {
42354
+ var collation10 = {
42073
42355
  type: 0,
42074
42356
  /* CaseInsensitive */
42075
42357
  };
@@ -42113,7 +42395,7 @@ var ScalarNotIn = class extends ScalarNode {
42113
42395
  });
42114
42396
  return {
42115
42397
  type: 'boolean',
42116
- value: !DatabaseValue.in(left, right, collation9),
42398
+ value: !DatabaseValue.in(left, right, collation10),
42117
42399
  };
42118
42400
  }
42119
42401
  };
@@ -42491,6 +42773,11 @@ var Optimizer = class {
42491
42773
  this.explorer.explore(node);
42492
42774
  }
42493
42775
  }
42776
+ if (false) {
42777
+ assert(winner.node, 'Group not optimized');
42778
+ const cache2 = /* @__PURE__ */ new Map();
42779
+ winner.node = new RelationalAssert(winner.node, required, cache2);
42780
+ }
42494
42781
  return winner.cost;
42495
42782
  }
42496
42783
  createEnforcer(winner, node, required) {
@@ -42768,7 +43055,7 @@ var AnimationCollector = class {
42768
43055
  _variantHashes = /* @__PURE__ */ new WeakMap();
42769
43056
  var framerAppearEffects = /* @__PURE__ */ new AnimationCollector();
42770
43057
  exports.framerAppearEffects = framerAppearEffects;
42771
- function withOptimizedAppearEffect(Component16) {
43058
+ function withOptimizedAppearEffect(Component18) {
42772
43059
  return react_11.default.forwardRef(({ optimized, ...props }, ref) => {
42773
43060
  const generatedComponentContext = react_11.default.useContext(GeneratedComponentContext);
42774
43061
  const variants = react_11.default.useContext(SSRParentVariantsContext);
@@ -42782,7 +43069,7 @@ function withOptimizedAppearEffect(Component16) {
42782
43069
  // should not be optimized.
42783
43070
  optimized ? props : null, generatedComponentContext);
42784
43071
  }
42785
- return /* @__PURE__ */ (0, jsx_runtime_1.jsx)(Component16, {
43072
+ return /* @__PURE__ */ (0, jsx_runtime_1.jsx)(Component18, {
42786
43073
  ref,
42787
43074
  ...props,
42788
43075
  });
@@ -43349,49 +43636,49 @@ function usePrototypeNavigate({ preload, } = {}) {
43349
43636
  navigation.goBack();
43350
43637
  return false;
43351
43638
  }
43352
- const Component16 = typeof target === 'string'
43639
+ const Component18 = typeof target === 'string'
43353
43640
  ? await componentForRoute(getRoute == null ? void 0 : getRoute(target)).catch(() => { })
43354
43641
  : react_11.default.isValidElement(target)
43355
43642
  ? target
43356
43643
  : null;
43357
- if (!Component16)
43644
+ if (!Component18)
43358
43645
  return;
43359
43646
  const { appearsFrom, backdropColor, animation, } = options;
43360
43647
  const transitionType = options.transition || 'instant';
43361
43648
  switch (transitionType) {
43362
43649
  case 'instant':
43363
- navigation.instant(Component16);
43650
+ navigation.instant(Component18);
43364
43651
  break;
43365
43652
  case 'fade':
43366
- navigation.fade(Component16, {
43653
+ navigation.fade(Component18, {
43367
43654
  animation,
43368
43655
  });
43369
43656
  break;
43370
43657
  case 'push':
43371
- navigation.push(Component16, {
43658
+ navigation.push(Component18, {
43372
43659
  appearsFrom,
43373
43660
  animation,
43374
43661
  });
43375
43662
  break;
43376
43663
  case 'flip':
43377
- navigation.flip(Component16, {
43664
+ navigation.flip(Component18, {
43378
43665
  appearsFrom,
43379
43666
  animation,
43380
43667
  });
43381
43668
  break;
43382
43669
  case 'magicMotion':
43383
- navigation.magicMotion(Component16, {
43670
+ navigation.magicMotion(Component18, {
43384
43671
  animation,
43385
43672
  });
43386
43673
  break;
43387
43674
  case 'modal':
43388
- navigation.modal(Component16, {
43675
+ navigation.modal(Component18, {
43389
43676
  backdropColor,
43390
43677
  animation,
43391
43678
  });
43392
43679
  break;
43393
43680
  case 'overlay':
43394
- navigation.overlay(Component16, {
43681
+ navigation.overlay(Component18, {
43395
43682
  appearsFrom,
43396
43683
  backdropColor,
43397
43684
  animation,
@@ -43765,6 +44052,71 @@ function useVariantState({ variant, defaultVariant: externalDefaultVariant, tran
43765
44052
  variantClassNames,
43766
44053
  ]);
43767
44054
  }
44055
+ function withCodeBoundaryForOverrides(Component18, { scopeId, nodeId, override, inComponentSlot, }) {
44056
+ if (!shouldEnableCodeBoundaries()) {
44057
+ return override(Component18);
44058
+ }
44059
+ const appliedOverride = tryToApplyOverride(Component18, override);
44060
+ let hasErrorBeenLogged = false;
44061
+ function CodeBoundaryForOverrides(props, ref) {
44062
+ const externalComponentNestingLevel = useExternalComponentNestingLevel();
44063
+ const shouldWrapWithBoundary = shouldWrapOverrideWithBoundary(externalComponentNestingLevel, inComponentSlot ?? false);
44064
+ if (shouldWrapWithBoundary) {
44065
+ if (appliedOverride.status === 'success') {
44066
+ return /* @__PURE__ */ (0, jsx_runtime_1.jsx)(CodeComponentBoundary, {
44067
+ errorMessage: getErrorMessageForOverride(scopeId, nodeId),
44068
+ fallback: /* @__PURE__ */ (0, jsx_runtime_1.jsx)(Component18, {
44069
+ ...props,
44070
+ ref,
44071
+ }),
44072
+ children: /* @__PURE__ */ (0, jsx_runtime_1.jsx)(appliedOverride.Component, {
44073
+ ...props,
44074
+ ref,
44075
+ }),
44076
+ });
44077
+ }
44078
+ else {
44079
+ if (!hasErrorBeenLogged) {
44080
+ logError(appliedOverride.error);
44081
+ logError(getErrorMessageForOverride(scopeId, nodeId));
44082
+ collectErrorToAnalytics(appliedOverride.error);
44083
+ hasErrorBeenLogged = true;
44084
+ }
44085
+ return /* @__PURE__ */ (0, jsx_runtime_1.jsx)(Component18, {
44086
+ ...props,
44087
+ ref,
44088
+ });
44089
+ }
44090
+ }
44091
+ else {
44092
+ if (appliedOverride.status === 'success') {
44093
+ return /* @__PURE__ */ (0, jsx_runtime_1.jsx)(appliedOverride.Component, {
44094
+ ...props,
44095
+ ref,
44096
+ });
44097
+ }
44098
+ else {
44099
+ throw appliedOverride.error;
44100
+ }
44101
+ }
44102
+ }
44103
+ return react_11.default.forwardRef(CodeBoundaryForOverrides);
44104
+ }
44105
+ function tryToApplyOverride(Component18, override) {
44106
+ try {
44107
+ const ComponentWithOverrides = override(Component18);
44108
+ return {
44109
+ status: 'success',
44110
+ Component: ComponentWithOverrides,
44111
+ };
44112
+ }
44113
+ catch (error) {
44114
+ return {
44115
+ status: 'error',
44116
+ error,
44117
+ };
44118
+ }
44119
+ }
43768
44120
  function extractMappingFromInfo(info) {
43769
44121
  var _a;
43770
44122
  const json = (_a = info.__FramerMetadata__.exports.default.annotations) == null ? void 0 : _a.framerVariables;
@@ -43777,14 +44129,14 @@ function extractMappingFromInfo(info) {
43777
44129
  return void 0;
43778
44130
  }
43779
44131
  }
43780
- function withMappedReactProps(Component16, info) {
44132
+ function withMappedReactProps(Component18, info) {
43781
44133
  return (rawProps) => {
43782
44134
  const props = {};
43783
44135
  const mapping = extractMappingFromInfo(info);
43784
44136
  for (const key7 in rawProps) {
43785
44137
  asRecord(props)[(mapping == null ? void 0 : mapping[key7]) ?? key7] = rawProps[key7];
43786
44138
  }
43787
- return /* @__PURE__ */ (0, jsx_runtime_1.jsx)(Component16, {
44139
+ return /* @__PURE__ */ (0, jsx_runtime_1.jsx)(Component18, {
43788
44140
  ...props,
43789
44141
  });
43790
44142
  };
@@ -43827,9 +44179,9 @@ function createInputOutputRanges2(transformTargets, threshold, exitTarget) {
43827
44179
  outputRange: [-1, -1, ...outputRange,],
43828
44180
  };
43829
44181
  }
43830
- var withVariantAppearEffect = (Component16) => react_11.default.forwardRef((props, forwardedRef) => {
44182
+ var withVariantAppearEffect = (Component18) => react_11.default.forwardRef((props, forwardedRef) => {
43831
44183
  if (RenderTarget.current() === RenderTarget.canvas) {
43832
- return /* @__PURE__ */ (0, jsx_runtime_1.jsx)(Component16, {
44184
+ return /* @__PURE__ */ (0, jsx_runtime_1.jsx)(Component18, {
43833
44185
  ...props,
43834
44186
  ref: forwardedRef,
43835
44187
  });
@@ -43914,27 +44266,27 @@ var withVariantAppearEffect = (Component16) => react_11.default.forwardRef((prop
43914
44266
  repeat: !animateOnce,
43915
44267
  });
43916
44268
  if (!('variantAppearEffectEnabled' in options) || variantAppearEffectEnabled === true) {
43917
- return /* @__PURE__ */ (0, jsx_runtime_1.jsx)(Component16, {
44269
+ return /* @__PURE__ */ (0, jsx_runtime_1.jsx)(Component18, {
43918
44270
  ...rest,
43919
44271
  variant: activeVariant ?? props.variant,
43920
44272
  ref: observerRef,
43921
44273
  });
43922
44274
  }
43923
44275
  else {
43924
- return /* @__PURE__ */ (0, jsx_runtime_1.jsx)(Component16, {
44276
+ return /* @__PURE__ */ (0, jsx_runtime_1.jsx)(Component18, {
43925
44277
  ...rest,
43926
44278
  });
43927
44279
  }
43928
44280
  });
43929
44281
  exports.withVariantAppearEffect = withVariantAppearEffect;
43930
- var withVariantFX = (Component16) => react_11.default.forwardRef(({ initial, animate: animate3, exit, ...props }, forwardedRef) => {
44282
+ var withVariantFX = (Component18) => react_11.default.forwardRef(({ initial, animate: animate3, exit, ...props }, forwardedRef) => {
43931
44283
  const observerRef = useObserverRef(forwardedRef);
43932
44284
  const effect = usePresenceAnimation({
43933
44285
  initial,
43934
44286
  animate: animate3,
43935
44287
  exit,
43936
44288
  }, observerRef, true);
43937
- return /* @__PURE__ */ (0, jsx_runtime_1.jsx)(Component16, {
44289
+ return /* @__PURE__ */ (0, jsx_runtime_1.jsx)(Component18, {
43938
44290
  ...props,
43939
44291
  style: {
43940
44292
  ...(props == null ? void 0 : props.style),
@@ -47404,10 +47756,10 @@ var RichTextContainer = /* @__PURE__ */ (0, react_4.forwardRef)((props, ref) =>
47404
47756
  if (layoutId) {
47405
47757
  rest.layout = 'preserve-aspect';
47406
47758
  }
47407
- const Component16 = htmlElementAsMotionComponent(props.as);
47759
+ const Component18 = htmlElementAsMotionComponent(props.as);
47408
47760
  if (isString2(props.viewBox)) {
47409
47761
  if (props.as !== void 0) {
47410
- return /* @__PURE__ */ (0, jsx_runtime_1.jsx)(Component16, {
47762
+ return /* @__PURE__ */ (0, jsx_runtime_1.jsx)(Component18, {
47411
47763
  ...rest,
47412
47764
  ref: containerRef,
47413
47765
  style: containerStyle,
@@ -47441,7 +47793,7 @@ var RichTextContainer = /* @__PURE__ */ (0, react_4.forwardRef)((props, ref) =>
47441
47793
  });
47442
47794
  }
47443
47795
  }
47444
- return /* @__PURE__ */ (0, jsx_runtime_1.jsx)(Component16, {
47796
+ return /* @__PURE__ */ (0, jsx_runtime_1.jsx)(Component18, {
47445
47797
  ...rest,
47446
47798
  ref: containerRef,
47447
47799
  style: containerStyle,