unframer 3.2.1 → 3.2.4

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 (131) hide show
  1. package/README.md +4 -4
  2. package/dist/cli.d.ts.map +1 -1
  3. package/dist/cli.js +106 -7
  4. package/dist/cli.js.map +1 -1
  5. package/dist/css.d.ts +5 -0
  6. package/dist/css.d.ts.map +1 -1
  7. package/dist/css.js +25 -0
  8. package/dist/css.js.map +1 -1
  9. package/dist/exporter.js +1 -1
  10. package/dist/exporter.js.map +1 -1
  11. package/dist/framer-chunks/chunk-VUHWYTYT.d.ts +15 -0
  12. package/dist/framer-chunks/chunk-VUHWYTYT.d.ts.map +1 -0
  13. package/dist/framer-chunks/chunk-VUHWYTYT.js +111 -0
  14. package/dist/framer-chunks/chunk-VUHWYTYT.js.map +1 -0
  15. package/dist/framer-chunks/fontshare-SWUWNY3H-GSSY33IO.d.ts +634 -0
  16. package/dist/framer-chunks/fontshare-SWUWNY3H-GSSY33IO.d.ts.map +1 -0
  17. package/dist/framer-chunks/fontshare-SWUWNY3H-GSSY33IO.js +8 -0
  18. package/dist/framer-chunks/fontshare-SWUWNY3H-GSSY33IO.js.map +1 -0
  19. package/dist/framer-chunks/fontshare-V2SGEFJT-AVIABYEX.d.ts +115 -0
  20. package/dist/framer-chunks/fontshare-V2SGEFJT-AVIABYEX.d.ts.map +1 -0
  21. package/dist/framer-chunks/fontshare-V2SGEFJT-AVIABYEX.js +8 -0
  22. package/dist/framer-chunks/fontshare-V2SGEFJT-AVIABYEX.js.map +1 -0
  23. package/dist/framer-chunks/fontshare-YCG7BCG4-T3OENDSJ.d.ts +781 -0
  24. package/dist/framer-chunks/fontshare-YCG7BCG4-T3OENDSJ.d.ts.map +1 -0
  25. package/dist/framer-chunks/fontshare-YCG7BCG4-T3OENDSJ.js +8 -0
  26. package/dist/framer-chunks/fontshare-YCG7BCG4-T3OENDSJ.js.map +1 -0
  27. package/dist/framer-chunks/framer-font-T5XNAHJ3-SBU5UWOY.d.ts +18 -0
  28. package/dist/framer-chunks/framer-font-T5XNAHJ3-SBU5UWOY.d.ts.map +1 -0
  29. package/dist/framer-chunks/framer-font-T5XNAHJ3-SBU5UWOY.js +8 -0
  30. package/dist/framer-chunks/framer-font-T5XNAHJ3-SBU5UWOY.js.map +1 -0
  31. package/dist/framer-chunks/google-63PUBKA6-AMAUIPXM.d.ts +1566 -0
  32. package/dist/framer-chunks/google-63PUBKA6-AMAUIPXM.d.ts.map +1 -0
  33. package/dist/framer-chunks/google-63PUBKA6-AMAUIPXM.js +8 -0
  34. package/dist/framer-chunks/google-63PUBKA6-AMAUIPXM.js.map +1 -0
  35. package/dist/framer-chunks/google-7QNFQWAU-FKX5MRKV.d.ts +3588 -0
  36. package/dist/framer-chunks/google-7QNFQWAU-FKX5MRKV.d.ts.map +1 -0
  37. package/dist/framer-chunks/google-7QNFQWAU-FKX5MRKV.js +8 -0
  38. package/dist/framer-chunks/google-7QNFQWAU-FKX5MRKV.js.map +1 -0
  39. package/dist/framer-chunks/google-KTMKGB4J-RA7CAZTC.d.ts +10293 -0
  40. package/dist/framer-chunks/google-KTMKGB4J-RA7CAZTC.d.ts.map +1 -0
  41. package/dist/framer-chunks/google-KTMKGB4J-RA7CAZTC.js +8 -0
  42. package/dist/framer-chunks/google-KTMKGB4J-RA7CAZTC.js.map +1 -0
  43. package/dist/framer.js +1477 -910
  44. package/dist/generated/api-client.d.ts +1 -1
  45. package/dist/generated/api-client.d.ts.map +1 -1
  46. package/dist/index.d.ts +3 -0
  47. package/dist/index.d.ts.map +1 -1
  48. package/dist/index.js +6 -1
  49. package/dist/index.js.map +1 -1
  50. package/dist/package-manager.d.ts +1 -1
  51. package/dist/package-manager.d.ts.map +1 -1
  52. package/dist/package-manager.js.map +1 -1
  53. package/dist/stackblitz.d.ts +9 -0
  54. package/dist/stackblitz.d.ts.map +1 -0
  55. package/dist/stackblitz.js +182 -0
  56. package/dist/stackblitz.js.map +1 -0
  57. package/dist/version.d.ts +1 -1
  58. package/dist/version.js +1 -1
  59. package/esm/cli.d.ts.map +1 -1
  60. package/esm/cli.js +108 -9
  61. package/esm/cli.js.map +1 -1
  62. package/esm/css.d.ts +5 -0
  63. package/esm/css.d.ts.map +1 -1
  64. package/esm/css.js +24 -0
  65. package/esm/css.js.map +1 -1
  66. package/esm/exporter.js +1 -1
  67. package/esm/exporter.js.map +1 -1
  68. package/esm/framer-chunks/chunk-VUHWYTYT.d.ts +15 -0
  69. package/esm/framer-chunks/chunk-VUHWYTYT.d.ts.map +1 -0
  70. package/esm/framer-chunks/chunk-VUHWYTYT.js +96 -0
  71. package/esm/framer-chunks/chunk-VUHWYTYT.js.map +1 -0
  72. package/esm/framer-chunks/fontshare-SWUWNY3H-GSSY33IO.d.ts +634 -0
  73. package/esm/framer-chunks/fontshare-SWUWNY3H-GSSY33IO.d.ts.map +1 -0
  74. package/esm/framer-chunks/fontshare-SWUWNY3H-GSSY33IO.js +5 -0
  75. package/esm/framer-chunks/fontshare-SWUWNY3H-GSSY33IO.js.map +1 -0
  76. package/esm/framer-chunks/fontshare-V2SGEFJT-AVIABYEX.d.ts +115 -0
  77. package/esm/framer-chunks/fontshare-V2SGEFJT-AVIABYEX.d.ts.map +1 -0
  78. package/esm/framer-chunks/fontshare-V2SGEFJT-AVIABYEX.js +5 -0
  79. package/esm/framer-chunks/fontshare-V2SGEFJT-AVIABYEX.js.map +1 -0
  80. package/esm/framer-chunks/fontshare-YCG7BCG4-T3OENDSJ.d.ts +781 -0
  81. package/esm/framer-chunks/fontshare-YCG7BCG4-T3OENDSJ.d.ts.map +1 -0
  82. package/esm/framer-chunks/fontshare-YCG7BCG4-T3OENDSJ.js +5 -0
  83. package/esm/framer-chunks/fontshare-YCG7BCG4-T3OENDSJ.js.map +1 -0
  84. package/esm/framer-chunks/framer-font-T5XNAHJ3-SBU5UWOY.d.ts +18 -0
  85. package/esm/framer-chunks/framer-font-T5XNAHJ3-SBU5UWOY.d.ts.map +1 -0
  86. package/esm/framer-chunks/framer-font-T5XNAHJ3-SBU5UWOY.js +5 -0
  87. package/esm/framer-chunks/framer-font-T5XNAHJ3-SBU5UWOY.js.map +1 -0
  88. package/esm/framer-chunks/google-63PUBKA6-AMAUIPXM.d.ts +1566 -0
  89. package/esm/framer-chunks/google-63PUBKA6-AMAUIPXM.d.ts.map +1 -0
  90. package/esm/framer-chunks/google-63PUBKA6-AMAUIPXM.js +5 -0
  91. package/esm/framer-chunks/google-63PUBKA6-AMAUIPXM.js.map +1 -0
  92. package/esm/framer-chunks/google-7QNFQWAU-FKX5MRKV.d.ts +3588 -0
  93. package/esm/framer-chunks/google-7QNFQWAU-FKX5MRKV.d.ts.map +1 -0
  94. package/esm/framer-chunks/google-7QNFQWAU-FKX5MRKV.js +5 -0
  95. package/esm/framer-chunks/google-7QNFQWAU-FKX5MRKV.js.map +1 -0
  96. package/esm/framer-chunks/google-KTMKGB4J-RA7CAZTC.d.ts +10293 -0
  97. package/esm/framer-chunks/google-KTMKGB4J-RA7CAZTC.d.ts.map +1 -0
  98. package/esm/framer-chunks/google-KTMKGB4J-RA7CAZTC.js +5 -0
  99. package/esm/framer-chunks/google-KTMKGB4J-RA7CAZTC.js.map +1 -0
  100. package/esm/framer.js +1214 -650
  101. package/esm/index.d.ts +3 -0
  102. package/esm/index.d.ts.map +1 -1
  103. package/esm/index.js +4 -0
  104. package/esm/index.js.map +1 -1
  105. package/esm/package-manager.d.ts +1 -1
  106. package/esm/package-manager.d.ts.map +1 -1
  107. package/esm/package-manager.js.map +1 -1
  108. package/esm/stackblitz.d.ts +9 -0
  109. package/esm/stackblitz.d.ts.map +1 -0
  110. package/esm/stackblitz.js +179 -0
  111. package/esm/stackblitz.js.map +1 -0
  112. package/esm/version.d.ts +1 -1
  113. package/esm/version.js +1 -1
  114. package/package.json +3 -3
  115. package/src/cli.ts +122 -11
  116. package/src/{css.ts → css.tsx} +38 -0
  117. package/src/exporter.ts +8 -8
  118. package/src/framer-chunks/chunk-VUHWYTYT.js +105 -0
  119. package/src/framer-chunks/fontshare-SWUWNY3H-GSSY33IO.js +7 -0
  120. package/src/framer-chunks/fontshare-V2SGEFJT-AVIABYEX.js +7 -0
  121. package/src/framer-chunks/fontshare-YCG7BCG4-T3OENDSJ.js +7 -0
  122. package/src/framer-chunks/framer-font-T5XNAHJ3-SBU5UWOY.js +7 -0
  123. package/src/framer-chunks/google-63PUBKA6-AMAUIPXM.js +7 -0
  124. package/src/framer-chunks/google-7QNFQWAU-FKX5MRKV.js +7 -0
  125. package/src/framer-chunks/google-KTMKGB4J-RA7CAZTC.js +7 -0
  126. package/src/framer.js +1207 -634
  127. package/src/index.ts +6 -0
  128. package/src/package-manager.ts +2 -4
  129. package/src/stackblitz.ts +193 -0
  130. package/src/styles/framer.css +24 -0
  131. package/src/version.ts +1 -1
package/src/framer.js CHANGED
@@ -13,7 +13,7 @@ import {
13
13
  __toESM,
14
14
  } from './framer-chunks/chunk-A2PMVMFI.js';
15
15
 
16
- // /:https://app.framerstatic.com/chunk-BLFSVU7M.mjs
16
+ // /:https://app.framerstatic.com/chunk-VDW2YK33.mjs
17
17
  import { createContext, } from 'react';
18
18
  import { useEffect, useLayoutEffect, } from 'react';
19
19
  import { useCallback, useContext, useId, } from 'react';
@@ -343,7 +343,7 @@ function createRenderBatcher(scheduleNextBatch, allowKeepAlive,) {
343
343
  isProcessing: false,
344
344
  };
345
345
  const flagRunNextFrame = () => runNextFrame = true;
346
- const steps2 = stepsOrder.reduce((acc, key7,) => {
346
+ const steps22 = stepsOrder.reduce((acc, key7,) => {
347
347
  acc[key7] = createRenderStep(flagRunNextFrame, allowKeepAlive ? key7 : void 0,);
348
348
  return acc;
349
349
  }, {},);
@@ -356,7 +356,7 @@ function createRenderBatcher(scheduleNextBatch, allowKeepAlive,) {
356
356
  preRender,
357
357
  render,
358
358
  postRender,
359
- } = steps2;
359
+ } = steps22;
360
360
  const processBatch = () => {
361
361
  const timestamp = MotionGlobalConfig.useManualTiming ? state.timestamp : performance.now();
362
362
  runNextFrame = false;
@@ -387,7 +387,7 @@ function createRenderBatcher(scheduleNextBatch, allowKeepAlive,) {
387
387
  }
388
388
  };
389
389
  const schedule = stepsOrder.reduce((acc, key7,) => {
390
- const step2 = steps2[key7];
390
+ const step2 = steps22[key7];
391
391
  acc[key7] = (process2, keepAlive = false, immediate = false,) => {
392
392
  if (!runNextFrame) wake();
393
393
  return step2.schedule(process2, keepAlive, immediate,);
@@ -396,14 +396,14 @@ function createRenderBatcher(scheduleNextBatch, allowKeepAlive,) {
396
396
  }, {},);
397
397
  const cancel = (process2) => {
398
398
  for (let i = 0; i < stepsOrder.length; i++) {
399
- steps2[stepsOrder[i]].cancel(process2,);
399
+ steps22[stepsOrder[i]].cancel(process2,);
400
400
  }
401
401
  };
402
402
  return {
403
403
  schedule,
404
404
  cancel,
405
405
  state,
406
- steps: steps2,
406
+ steps: steps22,
407
407
  };
408
408
  }
409
409
  var {
@@ -569,6 +569,11 @@ var color = {
569
569
  transform: (v) => {
570
570
  return typeof v === 'string' ? v : v.hasOwnProperty('red',) ? rgba.transform(v,) : hsla.transform(v,);
571
571
  },
572
+ getAnimatableNone: (v) => {
573
+ const parsed = color.parse(v,);
574
+ parsed.alpha = 0;
575
+ return color.transform(parsed,);
576
+ },
572
577
  };
573
578
  var colorRegex = /(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;
574
579
  function test(v,) {
@@ -646,7 +651,7 @@ function createTransformer(source,) {
646
651
  return output;
647
652
  };
648
653
  }
649
- var convertNumbersToZero = (v) => typeof v === 'number' ? 0 : v;
654
+ var convertNumbersToZero = (v) => typeof v === 'number' ? 0 : color.test(v,) ? color.getAnimatableNone(v,) : v;
650
655
  function getAnimatableNone(v,) {
651
656
  const parsed = parseComplexValue(v,);
652
657
  const transformer = createTransformer(v,);
@@ -833,7 +838,7 @@ var generateLinearEasing = (easing, duration, resolution = 10,) => {
833
838
  let points = '';
834
839
  const numPoints = Math.max(Math.round(duration / resolution,), 2,);
835
840
  for (let i = 0; i < numPoints; i++) {
836
- points += easing(i / (numPoints - 1),) + ', ';
841
+ points += Math.round(easing(i / (numPoints - 1),) * 1e4,) / 1e4 + ', ';
837
842
  }
838
843
  return `linear(${points.substring(0, points.length - 2,)})`;
839
844
  };
@@ -4064,7 +4069,7 @@ function addToQueue(builder,) {
4064
4069
  }
4065
4070
  var ViewTransitionBuilder = class {
4066
4071
  constructor(update, options = {},) {
4067
- this.currentTarget = 'root';
4072
+ this.currentSubject = 'root';
4068
4073
  this.targets = /* @__PURE__ */ new Map();
4069
4074
  this.notifyReady = noop;
4070
4075
  this.readyPromise = new Promise((resolve) => {
@@ -4077,8 +4082,8 @@ var ViewTransitionBuilder = class {
4077
4082
  };
4078
4083
  addToQueue(this,);
4079
4084
  }
4080
- get(selector,) {
4081
- this.currentTarget = selector;
4085
+ get(subject,) {
4086
+ this.currentSubject = subject;
4082
4087
  return this;
4083
4088
  }
4084
4089
  layout(keyframes2, options,) {
@@ -4112,13 +4117,13 @@ var ViewTransitionBuilder = class {
4112
4117
  }
4113
4118
  updateTarget(target, keyframes2, options = {},) {
4114
4119
  const {
4115
- currentTarget,
4120
+ currentSubject,
4116
4121
  targets,
4117
4122
  } = this;
4118
- if (!targets.has(currentTarget,)) {
4119
- targets.set(currentTarget, {},);
4123
+ if (!targets.has(currentSubject,)) {
4124
+ targets.set(currentSubject, {},);
4120
4125
  }
4121
- const targetData = targets.get(currentTarget,);
4126
+ const targetData = targets.get(currentSubject,);
4122
4127
  targetData[target] = {
4123
4128
  keyframes: keyframes2,
4124
4129
  options,
@@ -4198,6 +4203,7 @@ function PopChild({
4198
4203
  children,
4199
4204
  isPresent: isPresent2,
4200
4205
  anchorX,
4206
+ root,
4201
4207
  },) {
4202
4208
  const id4 = useId();
4203
4209
  const ref = useRef3(null,);
@@ -4224,7 +4230,8 @@ function PopChild({
4224
4230
  ref.current.dataset.motionPopId = id4;
4225
4231
  const style2 = document.createElement('style',);
4226
4232
  if (nonce) style2.nonce = nonce;
4227
- document.head.appendChild(style2,);
4233
+ const parent = root ?? document.head;
4234
+ parent.appendChild(style2,);
4228
4235
  if (style2.sheet) {
4229
4236
  style2.sheet.insertRule(`
4230
4237
  [data-motion-pop-id="${id4}"] {
@@ -4237,8 +4244,9 @@ function PopChild({
4237
4244
  `,);
4238
4245
  }
4239
4246
  return () => {
4240
- if (document.head.contains(style2,)) {
4241
- document.head.removeChild(style2,);
4247
+ parent.removeChild(style2,);
4248
+ if (parent.contains(style2,)) {
4249
+ parent.removeChild(style2,);
4242
4250
  }
4243
4251
  };
4244
4252
  }, [isPresent2,],);
@@ -4260,6 +4268,7 @@ var PresenceChild = ({
4260
4268
  presenceAffectsLayout,
4261
4269
  mode,
4262
4270
  anchorX,
4271
+ root,
4263
4272
  },) => {
4264
4273
  const presenceChildren = useConstant(newChildrenMap,);
4265
4274
  const id4 = useId();
@@ -4299,6 +4308,7 @@ var PresenceChild = ({
4299
4308
  children = jsx3(PopChild, {
4300
4309
  isPresent: isPresent2,
4301
4310
  anchorX,
4311
+ root,
4302
4312
  children,
4303
4313
  },);
4304
4314
  }
@@ -4327,6 +4337,7 @@ var AnimatePresence = ({
4327
4337
  mode = 'sync',
4328
4338
  propagate = false,
4329
4339
  anchorX = 'left',
4340
+ root,
4330
4341
  },) => {
4331
4342
  const [isParentPresent, safeToRemove,] = usePresence(propagate,);
4332
4343
  const presentChildren = useMemo2(() => onlyElements(children,), [children,],);
@@ -4403,6 +4414,7 @@ var AnimatePresence = ({
4403
4414
  custom,
4404
4415
  presenceAffectsLayout,
4405
4416
  mode,
4417
+ root,
4406
4418
  onExitComplete: isPresent2 ? void 0 : onExit,
4407
4419
  anchorX,
4408
4420
  children: child,
@@ -4586,7 +4598,7 @@ function isValidMotionProp(key7,) {
4586
4598
  }
4587
4599
  var shouldForward = (key7) => !isValidMotionProp(key7,);
4588
4600
  function loadExternalIsValidProp(isValidProp,) {
4589
- if (!isValidProp) return;
4601
+ if (typeof isValidProp !== 'function') return;
4590
4602
  shouldForward = (key7) => key7.startsWith('on',) ? !isValidMotionProp(key7,) : isValidProp(key7,);
4591
4603
  }
4592
4604
  try {
@@ -7979,6 +7991,7 @@ function createProjectionNode2({
7979
7991
  constructor(latestValues = {}, parent = defaultParent == null ? void 0 : defaultParent(),) {
7980
7992
  this.id = id2++;
7981
7993
  this.animationId = 0;
7994
+ this.animationCommitId = 0;
7982
7995
  this.children = /* @__PURE__ */ new Set();
7983
7996
  this.options = {};
7984
7997
  this.isTreeAnimating = false;
@@ -8211,9 +8224,14 @@ function createProjectionNode2({
8211
8224
  this.nodes.forEach(clearMeasurements,);
8212
8225
  return;
8213
8226
  }
8227
+ if (this.animationId <= this.animationCommitId) {
8228
+ this.nodes.forEach(clearIsLayoutDirty,);
8229
+ return;
8230
+ }
8214
8231
  if (!this.isUpdating) {
8215
8232
  this.nodes.forEach(clearIsLayoutDirty,);
8216
8233
  }
8234
+ this.animationCommitId = this.animationId;
8217
8235
  this.isUpdating = false;
8218
8236
  this.nodes.forEach(resetTransformStyle,);
8219
8237
  this.nodes.forEach(updateLayout,);
@@ -10190,6 +10208,8 @@ function calcNextTime(current2, next2, prev, labels,) {
10190
10208
  return Math.max(0, current2 + parseFloat(next2,),);
10191
10209
  } else if (next2 === '<') {
10192
10210
  return prev;
10211
+ } else if (next2.startsWith('<',)) {
10212
+ return Math.max(0, prev + parseFloat(next2.slice(1,),),);
10193
10213
  } else {
10194
10214
  return labels.get(next2,) ?? current2;
10195
10215
  }
@@ -10277,7 +10297,7 @@ function createAnimationsFromSequence(
10277
10297
  } = valueTransition;
10278
10298
  const calculatedDelay = typeof delay2 === 'function' ? delay2(elementIndex, numSubjects,) : delay2;
10279
10299
  const numKeyframes = valueKeyframesAsList.length;
10280
- const createGenerator = isGenerator(type,) ? type : generators == null ? void 0 : generators[type];
10300
+ const createGenerator = isGenerator(type,) ? type : generators == null ? void 0 : generators[type || 'keyframes'];
10281
10301
  if (numKeyframes <= 2 && createGenerator) {
10282
10302
  let absoluteDelta = 100;
10283
10303
  if (numKeyframes === 2 && isNumberKeyframesArray(valueKeyframesAsList,)) {
@@ -10553,6 +10573,9 @@ function createScopedAnimate(scope,) {
10553
10573
  const animation = new GroupAnimationWithThen(animations2,);
10554
10574
  if (scope) {
10555
10575
  scope.animations.push(animation,);
10576
+ animation.finished.then(() => {
10577
+ removeItem(scope.animations, animation,);
10578
+ },);
10556
10579
  }
10557
10580
  return animation;
10558
10581
  }
@@ -10568,6 +10591,7 @@ function useAnimate() {
10568
10591
  const animate22 = useConstant(() => createScopedAnimate(scope,));
10569
10592
  useUnmountEffect(() => {
10570
10593
  scope.animations.forEach((animation) => animation.stop());
10594
+ scope.animations.length = 0;
10571
10595
  },);
10572
10596
  return [scope, animate22,];
10573
10597
  }
@@ -10841,6 +10865,20 @@ function useInstantTransition() {
10841
10865
  function disableInstantTransitions() {
10842
10866
  MotionGlobalConfig.instantAnimations = false;
10843
10867
  }
10868
+ function usePageInView() {
10869
+ const [isInView, setIsInView,] = useState(true,);
10870
+ useEffect(() => {
10871
+ const handleVisibilityChange = () => setIsInView(!document.hidden,);
10872
+ if (document.hidden) {
10873
+ handleVisibilityChange();
10874
+ }
10875
+ document.addEventListener('visibilitychange', handleVisibilityChange,);
10876
+ return () => {
10877
+ document.removeEventListener('visibilitychange', handleVisibilityChange,);
10878
+ };
10879
+ }, [],);
10880
+ return isInView;
10881
+ }
10844
10882
  var appearAnimationStore = /* @__PURE__ */ new Map();
10845
10883
  var appearComplete = /* @__PURE__ */ new Map();
10846
10884
  var appearStoreId = (elementId, valueName,) => {
@@ -11214,15 +11252,17 @@ function stagger(duration = 0.1, {
11214
11252
  };
11215
11253
  }
11216
11254
 
11217
- // /:https://app.framerstatic.com/framer.ZNMFLOLI.mjs
11218
- import { lazy as ReactLazy, } from 'react';
11255
+ // /:https://app.framerstatic.com/framer.L7DRXRFF.mjs
11256
+
11219
11257
  import React4 from 'react';
11220
11258
  import { startTransition as startTransition2, } from 'react';
11221
11259
  import { Suspense as Suspense2, } from 'react';
11222
11260
  import { memo as memo2, } from 'react';
11223
11261
  import ReactDOM from 'react-dom';
11262
+ import { useSyncExternalStore, } from 'react';
11224
11263
  import { createRef, } from 'react';
11225
11264
  import { useTransition, } from 'react';
11265
+ import { createPortal, } from 'react-dom';
11226
11266
  import { cloneElement as cloneElement32, } from 'react';
11227
11267
  var __unframerNavigator2 = typeof window !== 'undefined' ? navigator : void 0;
11228
11268
  var require_hsluv = __commonJS({
@@ -12150,37 +12190,46 @@ var preloadKey = 'preload';
12150
12190
  function isLazyComponentType(componentType,) {
12151
12191
  return typeof componentType === 'object' && componentType !== null && !isValidElement(componentType,) && preloadKey in componentType;
12152
12192
  }
12153
- function lazy(factory,) {
12154
- const LazyComponent = ReactLazy(factory,);
12193
+ function lazy(factory, moduleName = 'default',) {
12155
12194
  let factoryPromise;
12156
12195
  let LoadedComponent;
12157
12196
  let hasRendered = false;
12158
- const Component17 = forwardRef(function LazyWithPreload(props, ref,) {
12159
- useEffect(() => {
12160
- hasRendered = true;
12161
- }, [],);
12162
- const Comp = LoadedComponent ?? LazyComponent;
12163
- return /* @__PURE__ */ jsx3(Comp, {
12164
- ref,
12165
- ...props,
12166
- },);
12167
- },);
12168
- Component17.preload = () => {
12197
+ let error;
12198
+ const load = () => {
12169
12199
  if (!factoryPromise) {
12170
12200
  factoryPromise = factory().then((module) => {
12171
- LoadedComponent = module.default;
12201
+ if (!(moduleName in module)) throw new Error(`Module does not contain export '${moduleName}'`,);
12202
+ LoadedComponent = module[moduleName];
12172
12203
  return LoadedComponent;
12204
+ },).catch((err) => {
12205
+ error = err;
12173
12206
  },);
12174
12207
  }
12175
12208
  return factoryPromise;
12176
12209
  };
12177
- Component17.getStatus = () => {
12210
+ const Component18 = forwardRef(function LazyWithPreload(props, ref,) {
12211
+ useEffect(() => {
12212
+ hasRendered = true;
12213
+ }, [],);
12214
+ if (error) {
12215
+ throw error;
12216
+ }
12217
+ if (!LoadedComponent) {
12218
+ throw load();
12219
+ }
12220
+ return /* @__PURE__ */ jsx3(LoadedComponent, {
12221
+ ref,
12222
+ ...props,
12223
+ },);
12224
+ },);
12225
+ Component18.preload = load;
12226
+ Component18.getStatus = () => {
12178
12227
  return {
12179
12228
  hasLoaded: LoadedComponent !== void 0,
12180
12229
  hasRendered,
12181
12230
  };
12182
12231
  };
12183
- return Component17;
12232
+ return Component18;
12184
12233
  }
12185
12234
  var objectKeys = Object.keys;
12186
12235
  function hasProp(o, prop,) {
@@ -12842,23 +12891,26 @@ function forwardCurrentQueryParams(href,) {
12842
12891
  }
12843
12892
  return forwardQueryParams(queryParamsString, href,);
12844
12893
  }
12894
+ var FRAMER_VARIANT_KEY = 'framer_variant';
12845
12895
  function forwardQueryParams(queryParamsString, href,) {
12846
12896
  const startOfHash = href.indexOf('#',);
12847
12897
  const hrefWithoutHash = startOfHash === -1 ? href : href.substring(0, startOfHash,);
12848
12898
  const hash2 = startOfHash === -1 ? '' : href.substring(startOfHash,);
12849
12899
  const startOfSearch = hrefWithoutHash.indexOf('?',);
12850
- if (startOfSearch === -1) {
12851
- return hrefWithoutHash + queryParamsString + hash2;
12852
- }
12900
+ const baseUrl = startOfSearch === -1 ? hrefWithoutHash : hrefWithoutHash.substring(0, startOfSearch,);
12901
+ const searchString = startOfSearch === -1 ? '' : hrefWithoutHash.substring(startOfSearch,);
12902
+ const newSearchParams = new URLSearchParams(searchString,);
12853
12903
  const currentSearchParams = new URLSearchParams(queryParamsString,);
12854
- const newSearchString = hrefWithoutHash.substring(startOfSearch + 1,);
12855
- const newSearchParams = new URLSearchParams(newSearchString,);
12856
12904
  for (const [key7, value,] of currentSearchParams) {
12857
- if (!newSearchParams.has(key7,)) {
12858
- newSearchParams.append(key7, value,);
12859
- }
12905
+ if (newSearchParams.has(key7,)) continue;
12906
+ if (key7 === FRAMER_VARIANT_KEY) continue;
12907
+ newSearchParams.append(key7, value,);
12860
12908
  }
12861
- return hrefWithoutHash.substring(0, startOfSearch + 1,) + newSearchParams.toString() + hash2;
12909
+ const newSearchString = newSearchParams.toString();
12910
+ if (newSearchString === '') {
12911
+ return hrefWithoutHash + hash2;
12912
+ }
12913
+ return baseUrl + '?' + newSearchString + hash2;
12862
12914
  }
12863
12915
  async function replacePathVariables(path, currentLocale, nextLocale, defaultLocale, collectionId, pathVariables, collectionUtils,) {
12864
12916
  var _a;
@@ -20331,8 +20383,38 @@ var inputIconCSSDeclaration = {
20331
20383
  function createRGBVariableFallbacks(variables, fallback,) {
20332
20384
  return css2.variable(...variables.flatMap((variable) => [`${variable}-rgb`, variable,]), fallback,);
20333
20385
  }
20386
+ var defaultRichTextContainerStyle = {
20387
+ display: 'flex',
20388
+ flexDirection: 'column',
20389
+ justifyContent: 'flex-start',
20390
+ };
20391
+ var defaultTextFillStyle = {
20392
+ display: 'inline-block',
20393
+ };
20394
+ var defaultImageStyle = {
20395
+ display: 'block',
20396
+ };
20334
20397
  var richTextCSSRules = /* @__PURE__ */ (() => [
20398
+ /**
20399
+ * RichTextContainer styles can get overridden by other static or inline styles collected in
20400
+ * style collectors, as well as styles defined directly in the @link{RichText.tsx} component.
20401
+ *
20402
+ * NOTE: `display: flex` can get overridden with `display: -webkit-box` in
20403
+ * @link{collectTextTruncation.ts} if the text is truncated. In this case, the flex-specific
20404
+ * properties are not supported, e.g. `justify-content`. This is ok because truncated text has
20405
+ * auto height and doesn't support vertical alignment. In any case, keep this in mind when
20406
+ * using other flex-specific properties.
20407
+ */
20335
20408
  /* css */
20409
+ `
20410
+ [data-framer-component-type="RichTextContainer"] {
20411
+ display: ${defaultRichTextContainerStyle.display};
20412
+ flex-direction: ${defaultRichTextContainerStyle.flexDirection};
20413
+ justify-content: ${defaultRichTextContainerStyle.justifyContent};
20414
+ outline: none;
20415
+ flex-shrink: 0;
20416
+ }
20417
+ `, /* css */
20336
20418
  `
20337
20419
  p.framer-text,
20338
20420
  div.framer-text,
@@ -20499,7 +20581,7 @@ var richTextCSSRules = /* @__PURE__ */ (() => [
20499
20581
  /* css */
20500
20582
  `
20501
20583
  .framer-text[data-text-fill] {
20502
- display: inline-block;
20584
+ display: ${defaultTextFillStyle.display};
20503
20585
  background-clip: text;
20504
20586
  -webkit-background-clip: text;
20505
20587
  /* make this a transparent color if you want to visualise the clipping */
@@ -20869,7 +20951,7 @@ var richTextCSSRules = /* @__PURE__ */ (() => [
20869
20951
  `, /* css */
20870
20952
  `
20871
20953
  .framer-image.framer-text {
20872
- display: block;
20954
+ display: ${defaultImageStyle.display};
20873
20955
  max-width: 100%;
20874
20956
  height: auto;
20875
20957
  }
@@ -21027,6 +21109,42 @@ var richTextCSSRules = /* @__PURE__ */ (() => [
21027
21109
  }
21028
21110
  `,
21029
21111
  ])();
21112
+ var textTruncationDisplayInlineVariableForSafari16 = '--text-truncation-display-inline-for-safari-16';
21113
+ var textTruncationDisplayNoneVariableForSafari16 = '--text-truncation-display-none-for-safari-16';
21114
+ var textTruncationLineBreakVariableForSafari16 = '--text-truncation-line-break-for-safari-16';
21115
+ var blockLikeElementSelectors = [
21116
+ 'div.framer-text',
21117
+ 'p.framer-text',
21118
+ 'h1.framer-text',
21119
+ 'h2.framer-text',
21120
+ 'h3.framer-text',
21121
+ 'h4.framer-text',
21122
+ 'h5.framer-text',
21123
+ 'h6.framer-text',
21124
+ 'ol.framer-text',
21125
+ 'ul.framer-text',
21126
+ 'li.framer-text',
21127
+ 'blockquote.framer-text',
21128
+ '.framer-text.framer-image',
21129
+ ];
21130
+ var anySafariVersion = '(background: -webkit-named-image(i))';
21131
+ var safari17OrGreater = '(contain-intrinsic-size: inherit)';
21132
+ var safari16TextTruncationFix = /* @__PURE__ */ (() => [`@supports ${anySafariVersion} and (not ${safari17OrGreater}) {
21133
+ /* Render block-like elements inline when text is truncated, otherwise default to user agent (revert) */
21134
+ ${blockLikeElementSelectors.join(', ',)} { display: var(${textTruncationDisplayInlineVariableForSafari16}, revert) }
21135
+
21136
+ /* Add a line break after each block-like element that we render inline, to resemble the block-like behavior */
21137
+ ${
21138
+ blockLikeElementSelectors.map((selector) => `${selector}::after`).join(', ',)
21139
+ } { content: var(${textTruncationLineBreakVariableForSafari16}); white-space: pre; }
21140
+
21141
+ /* Don't render modules (e.g. videos, code-blocks), or tables when text is truncated, because often these can't be truncated and their children might be block elements */
21142
+ .framer-text.framer-text-module,
21143
+ .framer-text.framer-table-wrapper { display: var(${textTruncationDisplayNoneVariableForSafari16}, revert) }
21144
+
21145
+ /* Render text-fill elements inline when text is truncated, otherwise default to their default value (e.g. inline-block) */
21146
+ p.framer-text[data-text-fill] { display: var(${textTruncationDisplayInlineVariableForSafari16}, ${defaultTextFillStyle.display}) }
21147
+ }`,])();
21030
21148
  var defaultCache = /* @__PURE__ */ new Set();
21031
21149
  var defaultSheet;
21032
21150
  function injectCSSRule(cssRule, sheet, cache2 = defaultCache,) {
@@ -21301,6 +21419,7 @@ var pageContentWrapperWrapperCSSRules = [
21301
21419
  `[data-framer-component-type="PageContentWrapper"] > *, [data-framer-component-type="PageContentWrapper"] > [data-framer-component-type] { position: relative; }`,
21302
21420
  ];
21303
21421
  var presenceCSS = [`[data-is-present="false"], [data-is-present="false"] * { pointer-events: none !important; }`,];
21422
+ var lightboxCSS = [`.framer-lightbox-container { opacity: 1 !important; pointer-events: auto !important; }`,];
21304
21423
  var cursorCSS = [
21305
21424
  `[data-framer-cursor="pointer"] { cursor: pointer; }`,
21306
21425
  `[data-framer-cursor="grab"] { cursor: grab; }`,
@@ -21333,13 +21452,13 @@ var hideScrollbars = [
21333
21452
  ];
21334
21453
  var willChangeOverrideCSSVariable = '--framer-will-change-override';
21335
21454
  var willChangeEffectOverrideCSSVariable = '--framer-will-change-effect-override';
21336
- var anySafariVersion = '(background: -webkit-named-image(i))';
21455
+ var anySafariVersion2 = '(background: -webkit-named-image(i))';
21337
21456
  var safari16OrGreater = '(grid-template-rows: subgrid)';
21338
21457
  var willChangeTransformRules = (isPreview) =>
21339
21458
  isPreview
21340
21459
  ? [
21341
21460
  `body { ${willChangeOverrideCSSVariable}: none; }`,
21342
- `@supports ${anySafariVersion} and (not ${safari16OrGreater}) { body { ${willChangeOverrideCSSVariable}: transform; } }`,
21461
+ `@supports ${anySafariVersion2} and (not ${safari16OrGreater}) { body { ${willChangeOverrideCSSVariable}: transform; } }`,
21343
21462
  ]
21344
21463
  : [`body { ${willChangeOverrideCSSVariable}: none; ${willChangeEffectOverrideCSSVariable}: none; }`,];
21345
21464
  var frameCSSRules = (isPreview) => {
@@ -21370,6 +21489,8 @@ var combineCSSRules =
21370
21489
  ...resetCSS,
21371
21490
  ...hideScrollbars,
21372
21491
  ...overflowClipFallbackCSSRules,
21492
+ ...lightboxCSS,
21493
+ ...safari16TextTruncationFix,
21373
21494
  ];
21374
21495
  export var combinedCSSRules = /* @__PURE__ */ combineCSSRules(false,);
21375
21496
  var combinedCSSRulesForPreview = /* @__PURE__ */ combineCSSRules(true,);
@@ -23199,23 +23320,45 @@ function getImageStyle(image,) {
23199
23320
  objectFit: cssObjectFit(image.fit,),
23200
23321
  };
23201
23322
  }
23323
+ function useDecodingAttribute(avoidAsyncDecoding,) {
23324
+ const currentDecoding = React4.useRef(avoidAsyncDecoding ? 'auto' : 'async',);
23325
+ const switchDecodingToAuto = useCallback((node) => {
23326
+ currentDecoding.current = 'auto';
23327
+ node.decoding = 'auto';
23328
+ }, [],);
23329
+ const onImageLoad = useCallback((event) => {
23330
+ switchDecodingToAuto(event.currentTarget,);
23331
+ }, [switchDecodingToAuto,],);
23332
+ const onImageMount = useCallback((node) => {
23333
+ if (node == null ? void 0 : node.complete) switchDecodingToAuto(node,);
23334
+ }, [switchDecodingToAuto,],);
23335
+ return {
23336
+ decoding: currentDecoding.current,
23337
+ onImageLoad,
23338
+ onImageMount,
23339
+ };
23340
+ }
23202
23341
  function StaticImage({
23203
23342
  image,
23204
23343
  containerSize,
23205
23344
  nodeId,
23206
23345
  alt,
23207
23346
  draggable,
23208
- syncDecoding,
23347
+ avoidAsyncDecoding,
23209
23348
  },) {
23210
23349
  const source = runtime.useImageSource(image, containerSize, nodeId,);
23211
23350
  const imageStyle = getImageStyle(image,);
23212
- const imageRef = React4.useRef(null,);
23351
+ const {
23352
+ decoding,
23353
+ onImageLoad,
23354
+ onImageMount,
23355
+ } = useDecodingAttribute(avoidAsyncDecoding,);
23213
23356
  return (
23214
23357
  // eslint-disable-next-line framer-studio/require-async-decoding -- we conditionally apply it
23215
23358
  /* @__PURE__ */
23216
23359
  jsx3('img', {
23217
- ref: imageRef,
23218
- decoding: syncDecoding ? 'sync' : 'async',
23360
+ ref: onImageMount,
23361
+ decoding,
23219
23362
  fetchPriority: image.fetchPriority,
23220
23363
  loading: image.loading,
23221
23364
  width: image.pixelWidth,
@@ -23223,6 +23366,7 @@ function StaticImage({
23223
23366
  sizes: image.sizes,
23224
23367
  srcSet: image.srcSet,
23225
23368
  src: source,
23369
+ onLoad: onImageLoad,
23226
23370
  alt: alt ?? image.alt ?? '',
23227
23371
  style: imageStyle,
23228
23372
  draggable,
@@ -23312,7 +23456,7 @@ function BackgroundImageComponent({
23312
23456
  } else if (RenderTarget.current() !== RenderTarget.canvas) {
23313
23457
  imageNode = /* @__PURE__ */ jsx3(StaticImage, {
23314
23458
  image,
23315
- syncDecoding: RenderTarget.current() === RenderTarget.export,
23459
+ avoidAsyncDecoding: RenderTarget.current() === RenderTarget.export,
23316
23460
  ...props,
23317
23461
  },);
23318
23462
  } else if (
@@ -23466,22 +23610,10 @@ function getIntrinsicSizeForBackgroundImage(background,) {
23466
23610
  height: background.pixelHeight,
23467
23611
  };
23468
23612
  }
23469
- return parseImageSizeFromSrc(background.src,);
23470
- }
23471
- function parseImageSizeFromSrc(src,) {
23472
- if (!src) return void 0;
23473
- let url;
23474
- try {
23475
- url = new URL(src,);
23476
- } catch {
23477
- return void 0;
23478
- }
23479
- const width = url.searchParams.get('width',);
23480
- const height = url.searchParams.get('height',);
23481
- if (width && height) {
23613
+ if (background.src === void 0) {
23482
23614
  return {
23483
- width: parseInt(width,),
23484
- height: parseInt(height,),
23615
+ width: 1,
23616
+ height: 1,
23485
23617
  };
23486
23618
  }
23487
23619
  return void 0;
@@ -23779,7 +23911,7 @@ function useMeasuredSize(ref,) {
23779
23911
  return size.current;
23780
23912
  }
23781
23913
  var SIZE_COMPATIBILITY_WRAPPER_ATTRIBUTE = 'data-framer-size-compatibility-wrapper';
23782
- var withMeasuredSize = (Component17) => (props) => {
23914
+ var withMeasuredSize = (Component18) => (props) => {
23783
23915
  const ref = React4.useRef(null,);
23784
23916
  const size = useMeasuredSize(ref,);
23785
23917
  const dataProps = {
@@ -23796,7 +23928,7 @@ var withMeasuredSize = (Component17) => (props) => {
23796
23928
  },
23797
23929
  ref,
23798
23930
  ...dataProps,
23799
- children: shouldRender && /* @__PURE__ */ jsx3(Component17, {
23931
+ children: shouldRender && /* @__PURE__ */ jsx3(Component18, {
23800
23932
  ...props,
23801
23933
  width: (size == null ? void 0 : size.width) ?? fallbackWidth,
23802
23934
  height: (size == null ? void 0 : size.height) ?? fallbackHeight,
@@ -26776,7 +26908,7 @@ var clamp2 = (value, a, b,) => {
26776
26908
  var DraggingContext = /* @__PURE__ */ React4.createContext({
26777
26909
  dragging: false,
26778
26910
  },);
26779
- function WithDragging(Component17,) {
26911
+ function WithDragging(Component18,) {
26780
26912
  const _WithDraggingHOC = class _WithDraggingHOC2 extends React4.Component {
26781
26913
  constructor(props, defaultProps,) {
26782
26914
  super(props, defaultProps,);
@@ -27397,7 +27529,7 @@ function WithDragging(Component17,) {
27397
27529
  value: {
27398
27530
  dragging: this.state.isDragging,
27399
27531
  },
27400
- children: /* @__PURE__ */ jsx3(Component17, {
27532
+ children: /* @__PURE__ */ jsx3(Component18, {
27401
27533
  ...originalProps,
27402
27534
  },),
27403
27535
  },);
@@ -27434,10 +27566,10 @@ function WithDragging(Component17,) {
27434
27566
  constraints: {},
27435
27567
  mouseWheel: false,
27436
27568
  },);
27437
- __publicField(_WithDraggingHOC, 'defaultProps', Object.assign({}, Component17.defaultProps, _WithDraggingHOC.draggingDefaultProps,),);
27569
+ __publicField(_WithDraggingHOC, 'defaultProps', Object.assign({}, Component18.defaultProps, _WithDraggingHOC.draggingDefaultProps,),);
27438
27570
  let WithDraggingHOC = _WithDraggingHOC;
27439
27571
  const withDragging = WithDraggingHOC;
27440
- (0, import_hoist_non_react_statics2.default)(withDragging, Component17,);
27572
+ (0, import_hoist_non_react_statics2.default)(withDragging, Component18,);
27441
27573
  return withDragging;
27442
27574
  }
27443
27575
  var hoverProps = {
@@ -28688,7 +28820,7 @@ function useInfiniteScroll({
28688
28820
  enabled: paginationInfo.currentPage < paginationInfo.totalPages,
28689
28821
  },);
28690
28822
  }
28691
- function withInfiniteScroll(Component17,) {
28823
+ function withInfiniteScroll(Component18,) {
28692
28824
  return React4.forwardRef(({
28693
28825
  __paginationInfo,
28694
28826
  __loadMore,
@@ -28701,7 +28833,7 @@ function withInfiniteScroll(Component17,) {
28701
28833
  ref: infiniteScrollRef,
28702
28834
  paginationInfo: __paginationInfo,
28703
28835
  },);
28704
- return /* @__PURE__ */ jsx3(Component17, {
28836
+ return /* @__PURE__ */ jsx3(Component18, {
28705
28837
  ...props,
28706
28838
  ref: infiniteScrollRef,
28707
28839
  },);
@@ -31608,7 +31740,7 @@ function convertColorProps(props,) {
31608
31740
  }
31609
31741
  return props;
31610
31742
  }
31611
- function WithOverride(Component17, override,) {
31743
+ function WithOverride(Component18, override,) {
31612
31744
  const useOverride = typeof override === 'function' ? (props) => override(convertColorProps(props,),) : () => convertColorProps(override,);
31613
31745
  const ComponentWithOverride = function (props,) {
31614
31746
  useContext(DataObserverContext,);
@@ -31617,14 +31749,14 @@ function WithOverride(Component17, override,) {
31617
31749
  style: style2,
31618
31750
  ...rest
31619
31751
  } = props;
31620
- return /* @__PURE__ */ jsx3(Component17, {
31752
+ return /* @__PURE__ */ jsx3(Component18, {
31621
31753
  ...rest,
31622
31754
  ...overrideProps,
31623
31755
  _initialStyle: style2,
31624
31756
  },);
31625
31757
  };
31626
- (0, import_hoist_non_react_statics4.default)(ComponentWithOverride, Component17,);
31627
- ComponentWithOverride['displayName'] = `WithOverride(${Component17.displayName || Component17.name})`;
31758
+ (0, import_hoist_non_react_statics4.default)(ComponentWithOverride, Component18,);
31759
+ ComponentWithOverride['displayName'] = `WithOverride(${Component18.displayName || Component18.name})`;
31628
31760
  return ComponentWithOverride;
31629
31761
  }
31630
31762
  var prefix = '__framer__';
@@ -31763,7 +31895,7 @@ var componentsWithServerRenderedStyles = /* @__PURE__ */ (() => {
31763
31895
  return new Set(componentsWithSSRStylesAttr.split(' ',),);
31764
31896
  })();
31765
31897
  var framerCSSMarker = 'data-framer-css-ssr';
31766
- var withCSS = (Component17, escapedCSS, componentSerializationId,) =>
31898
+ var withCSS = (Component18, escapedCSS, componentSerializationId,) =>
31767
31899
  React4.forwardRef((props, ref,) => {
31768
31900
  const {
31769
31901
  sheet,
@@ -31773,23 +31905,7 @@ var withCSS = (Component17, escapedCSS, componentSerializationId,) =>
31773
31905
  if (!isBrowser2()) {
31774
31906
  if (isFunction(escapedCSS,)) escapedCSS = escapedCSS(RenderTarget.current(),);
31775
31907
  const concatenatedCSS = Array.isArray(escapedCSS,) ? escapedCSS.join('\n',) : escapedCSS;
31776
- return /* @__PURE__ */ jsxs(Fragment, {
31777
- children: [
31778
- /* @__PURE__ */ jsx3('style', {
31779
- ...{
31780
- [framerCSSMarker]: true,
31781
- },
31782
- 'data-framer-component': id3,
31783
- dangerouslySetInnerHTML: {
31784
- __html: concatenatedCSS,
31785
- },
31786
- },),
31787
- /* @__PURE__ */ jsx3(Component17, {
31788
- ...props,
31789
- ref,
31790
- },),
31791
- ],
31792
- },);
31908
+ cssCollector.add(concatenatedCSS, id3,);
31793
31909
  }
31794
31910
  useInsertionEffect(() => {
31795
31911
  if (id3 && componentsWithServerRenderedStyles.has(id3,)) return;
@@ -31800,11 +31916,32 @@ var withCSS = (Component17, escapedCSS, componentSerializationId,) =>
31800
31916
  : escapedCSS.split('\n',);
31801
31917
  css22.forEach((rule) => rule && injectCSSRule(rule, sheet, cache2,));
31802
31918
  }, [],);
31803
- return /* @__PURE__ */ jsx3(Component17, {
31919
+ return /* @__PURE__ */ jsx3(Component18, {
31804
31920
  ...props,
31805
31921
  ref,
31806
31922
  },);
31807
31923
  },);
31924
+ var CSSCollector = class {
31925
+ constructor() {
31926
+ __publicField(this, 'styles', /* @__PURE__ */ new Set(),);
31927
+ __publicField(this, 'componentIds', /* @__PURE__ */ new Set(),);
31928
+ }
31929
+ add(css22, componentId,) {
31930
+ this.styles.add(css22,);
31931
+ if (componentId) this.componentIds.add(componentId,);
31932
+ }
31933
+ getStyles() {
31934
+ return this.styles;
31935
+ }
31936
+ getComponentIds() {
31937
+ return this.componentIds;
31938
+ }
31939
+ clear() {
31940
+ this.styles.clear();
31941
+ this.componentIds.clear();
31942
+ }
31943
+ };
31944
+ var cssCollector = /* @__PURE__ */ new CSSCollector();
31808
31945
  var SSRParentVariantsContext = /* @__PURE__ */ React4.createContext(void 0,);
31809
31946
  var SSRVariantClassName = 'ssr-variant';
31810
31947
  function renderBranchedChildrenFromPropertyOverrides(
@@ -32088,7 +32225,7 @@ var AnimationCollector = class {
32088
32225
  };
32089
32226
  _variantHashes = /* @__PURE__ */ new WeakMap();
32090
32227
  var framerAppearEffects = /* @__PURE__ */ new AnimationCollector();
32091
- function withOptimizedAppearEffect(Component17,) {
32228
+ function withOptimizedAppearEffect(Component18,) {
32092
32229
  return React4.forwardRef(({
32093
32230
  optimized,
32094
32231
  ...props
@@ -32111,7 +32248,7 @@ function withOptimizedAppearEffect(Component17,) {
32111
32248
  );
32112
32249
  }
32113
32250
  const disabledProps = getDisabledFXPropsInStaticRenderer(props,);
32114
- return /* @__PURE__ */ jsx3(Component17, {
32251
+ return /* @__PURE__ */ jsx3(Component18, {
32115
32252
  ref,
32116
32253
  ...props,
32117
32254
  ...disabledProps,
@@ -32407,8 +32544,11 @@ function useParallax(options, ref, visibilityStyle,) {
32407
32544
  : effectDisabledStyle,
32408
32545
  };
32409
32546
  }
32547
+ function isTargetAndTransition(value,) {
32548
+ return typeof value === 'object' && value !== null;
32549
+ }
32410
32550
  function getTransition(value,) {
32411
- if (isString(value,) || !isObject2(value,)) return void 0;
32551
+ if (!isTargetAndTransition(value,)) return void 0;
32412
32552
  return value == null ? void 0 : value.transition;
32413
32553
  }
32414
32554
  function runEffectAnimation(target, effect, shouldReduceMotion, ref, appearId, instant,) {
@@ -32418,7 +32558,9 @@ function runEffectAnimation(target, effect, shouldReduceMotion, ref, appearId, i
32418
32558
  if (shouldReduceMotion && key7 !== 'opacity') return resolve();
32419
32559
  const motionValue2 = effect.values[key7];
32420
32560
  motionValue2.stop();
32421
- let value = !isObject2(target,) ? defaultFXValues[key7] : (target == null ? void 0 : target[key7]) ?? defaultFXValues[key7];
32561
+ let value = !isTargetAndTransition(target,)
32562
+ ? defaultFXValues[key7]
32563
+ : (target == null ? void 0 : target[key7]) ?? defaultFXValues[key7];
32422
32564
  if (isMotionValue(value,)) value = value.get();
32423
32565
  if (!isNumber2(value,)) return resolve();
32424
32566
  const visualElement = visualElementStore.get(ref.current,);
@@ -33065,11 +33207,11 @@ function addMotionValueStyle(style2, values,) {
33065
33207
  function isVariantOrVariantList2(value,) {
33066
33208
  return isString(value,) || Array.isArray(value,);
33067
33209
  }
33068
- var withFX = (Component17) =>
33210
+ var withFX = (Component18) =>
33069
33211
  React4.forwardRef((props, forwardedRef,) => {
33070
33212
  var _a;
33071
33213
  if (props.__withFX) {
33072
- return /* @__PURE__ */ jsx3(Component17, {
33214
+ return /* @__PURE__ */ jsx3(Component18, {
33073
33215
  ...props,
33074
33216
  animate: void 0,
33075
33217
  initial: void 0,
@@ -33079,7 +33221,7 @@ var withFX = (Component17) =>
33079
33221
  }
33080
33222
  const disabledProps = getDisabledFXPropsInStaticRenderer(props,);
33081
33223
  if (disabledProps) {
33082
- return /* @__PURE__ */ jsx3(Component17, {
33224
+ return /* @__PURE__ */ jsx3(Component18, {
33083
33225
  ...props,
33084
33226
  ...disabledProps,
33085
33227
  ref: forwardedRef,
@@ -33174,7 +33316,7 @@ var withFX = (Component17) =>
33174
33316
  exit,
33175
33317
  }
33176
33318
  : {};
33177
- return /* @__PURE__ */ jsx3(Component17, {
33319
+ return /* @__PURE__ */ jsx3(Component18, {
33178
33320
  ...forwardedProps,
33179
33321
  ...motionGestures,
33180
33322
  __withFX: true,
@@ -33239,10 +33381,10 @@ var ComponentViewportProvider = /* @__PURE__ */ React4.forwardRef(function Compo
33239
33381
  children: cloneWithPropsAndRef(children, rest,),
33240
33382
  },);
33241
33383
  },);
33242
- var withGeneratedLayoutId = (Component17) =>
33384
+ var withGeneratedLayoutId = (Component18) =>
33243
33385
  React4.forwardRef((props, ref,) => {
33244
33386
  const layoutId = useLayoutId2(props,);
33245
- return /* @__PURE__ */ jsx3(Component17, {
33387
+ return /* @__PURE__ */ jsx3(Component18, {
33246
33388
  layoutId,
33247
33389
  ...props,
33248
33390
  layoutIdKey: void 0,
@@ -33276,7 +33418,7 @@ var SynchronousSuspenseErrorBoundary = class extends Component2 {
33276
33418
  error,
33277
33419
  '\n\nComponent stack:\n',
33278
33420
  componentStack,
33279
- '\n\nThis error indicates a state update wasn\u2019t wrapped with startTransition. Some of the UI might flash as a result. If you are the author of this website, check recently added custom code, and if the issue persists, report it to the Framer team via https://www.framer.com/contact/.',
33421
+ '\n\nThis error indicates a state update wasn\u2019t wrapped with `startTransition`. Some of the UI might flash as a result. If you are the author of this website, update external components and check recently added custom code or code overrides. In case the issue persists, report it to the Framer team via https://www.framer.com/contact/.',
33280
33422
  );
33281
33423
  const stack = error instanceof Error && typeof error.stack === 'string' ? error.stack : void 0;
33282
33424
  sendTrackingEvent('published_site_load_recoverable_error', {
@@ -33655,10 +33797,10 @@ var SmartComponentScopedContainer = /* @__PURE__ */ React4.forwardRef((props, re
33655
33797
  );
33656
33798
  const tagName = props.as ?? 'div';
33657
33799
  if (props.rendersWithMotion) {
33658
- const Component17 = htmlElementAsMotionComponent(tagName,);
33800
+ const Component18 = htmlElementAsMotionComponent(tagName,);
33659
33801
  return /* @__PURE__ */ jsx3(NodeIdContext.Provider, {
33660
33802
  value: nodeId ?? null,
33661
- children: /* @__PURE__ */ jsx3(Component17, {
33803
+ children: /* @__PURE__ */ jsx3(Component18, {
33662
33804
  ...otherProps,
33663
33805
  ref,
33664
33806
  style: props.style,
@@ -33666,7 +33808,7 @@ var SmartComponentScopedContainer = /* @__PURE__ */ React4.forwardRef((props, re
33666
33808
  },),
33667
33809
  },);
33668
33810
  } else {
33669
- const Component17 = tagName;
33811
+ const Component18 = tagName;
33670
33812
  const {
33671
33813
  layoutId,
33672
33814
  layoutDependency,
@@ -33674,7 +33816,7 @@ var SmartComponentScopedContainer = /* @__PURE__ */ React4.forwardRef((props, re
33674
33816
  } = otherProps;
33675
33817
  return /* @__PURE__ */ jsx3(NodeIdContext.Provider, {
33676
33818
  value: nodeId ?? null,
33677
- children: /* @__PURE__ */ jsx3(Component17, {
33819
+ children: /* @__PURE__ */ jsx3(Component18, {
33678
33820
  ...plainHTMLRenderableProps,
33679
33821
  ref,
33680
33822
  style: props.style,
@@ -33967,6 +34109,336 @@ function useCustomCursors(webPageCursors,) {
33967
34109
  return registerCursors(cursors, id3,);
33968
34110
  }, [registerCursors, id3,],);
33969
34111
  }
34112
+ var linkKey = 'webPageId';
34113
+ function isLinkToWebPage(link,) {
34114
+ return Boolean(link && typeof link === 'object' && linkKey in link,);
34115
+ }
34116
+ function linkInfoKey(link,) {
34117
+ var _a, _b;
34118
+ return `${link.scopeId}:${link.nodeId}:${(_a = link.furthestExternalComponent) == null ? void 0 : _a.scopeId}:${
34119
+ (_b = link.furthestExternalComponent) == null ? void 0 : _b.nodeId
34120
+ }`;
34121
+ }
34122
+ var NestedLinksCollector = class {
34123
+ constructor() {
34124
+ __publicField(this, 'collectedLinks', /* @__PURE__ */ new Map(),);
34125
+ __publicField(this, 'nestingInfo', /* @__PURE__ */ new Map(),);
34126
+ }
34127
+ clear() {
34128
+ this.collectedLinks.clear();
34129
+ this.nestingInfo.clear();
34130
+ }
34131
+ /**
34132
+ * Returns a Map of outer links to their inner links.
34133
+ *
34134
+ * NOTE: This function is called in the SSG renderer sandbox (<root>/src/ssg/src/ssg-sandbox-renderer/sandbox/worker/renderer.ts)
34135
+ */
34136
+ getLinks() {
34137
+ const result = /* @__PURE__ */ new Map();
34138
+ for (const [outerLinkKey, innerLinkKeys,] of this.nestingInfo) {
34139
+ const outerLinkInfo = this.collectedLinks.get(outerLinkKey,);
34140
+ assert(outerLinkInfo, `Outer link not found: ${outerLinkKey}`,);
34141
+ const links = Array.from(innerLinkKeys,).map((innerLinkKey) => {
34142
+ const innerLinkInfo = this.collectedLinks.get(innerLinkKey,);
34143
+ assert(innerLinkInfo, `Inner link not found: ${innerLinkKey}`,);
34144
+ return innerLinkInfo;
34145
+ },);
34146
+ result.set(outerLinkInfo, links,);
34147
+ }
34148
+ return result;
34149
+ }
34150
+ collectNestedLink(outerLink, innerLink,) {
34151
+ if (isWindow && !isTest() || !outerLink.nodeId || !innerLink.nodeId) {
34152
+ return;
34153
+ }
34154
+ this.collectedLinks.set(linkInfoKey(outerLink,), outerLink,);
34155
+ this.collectedLinks.set(linkInfoKey(innerLink,), innerLink,);
34156
+ const outerLinkNestingInfo = this.nestingInfo.get(linkInfoKey(outerLink,),) ?? /* @__PURE__ */ new Set();
34157
+ outerLinkNestingInfo.add(linkInfoKey(innerLink,),);
34158
+ this.nestingInfo.set(linkInfoKey(outerLink,), outerLinkNestingInfo,);
34159
+ }
34160
+ };
34161
+ var nestedLinksCollector = /* @__PURE__ */ new NestedLinksCollector();
34162
+ function useIsOnFramerCanvas() {
34163
+ return RenderTarget.current() === RenderTarget.canvas;
34164
+ }
34165
+ function isInternalURL(href,) {
34166
+ if (href === void 0) return false;
34167
+ if (href.startsWith('#',) || href.startsWith('/',) || href.startsWith('.',)) return true;
34168
+ return false;
34169
+ }
34170
+ function isValidURL(href, isInternal,) {
34171
+ try {
34172
+ const url = new URL(href,);
34173
+ return Boolean(url.protocol,);
34174
+ } catch {}
34175
+ return isInternal;
34176
+ }
34177
+ function getRouteFromPageLink(pageLink, router, currentRoute,) {
34178
+ var _a;
34179
+ if (isString(pageLink,)) {
34180
+ const isInternal = isInternalURL(pageLink,);
34181
+ if (!router.routes || !router.getRoute || !currentRoute || !isInternal) {
34182
+ return;
34183
+ }
34184
+ const [pathnameWithQueryParams,] = pageLink.split('#', 2,);
34185
+ if (pathnameWithQueryParams === void 0) return;
34186
+ const [pathname,] = pathnameWithQueryParams.split('?', 2,);
34187
+ if (pathname === void 0) return;
34188
+ const {
34189
+ routeId,
34190
+ } = inferInitialRouteFromPath(router.routes, pathname,);
34191
+ return router.getRoute(routeId,);
34192
+ }
34193
+ const {
34194
+ webPageId,
34195
+ } = pageLink;
34196
+ return (_a = router.getRoute) == null ? void 0 : _a.call(router, webPageId,);
34197
+ }
34198
+ var elementKey = 'element';
34199
+ var collectionKey = 'collection';
34200
+ var collectionItemIdKey = 'collectionItemId';
34201
+ var pathVariablesKey = 'pathVariables';
34202
+ var mediaType = 'framer/page-link,';
34203
+ function isFramerPageLink(value,) {
34204
+ return isString(value,) && value.startsWith(`data:${mediaType}`,);
34205
+ }
34206
+ function createFramerPageLink(targetId = null, options = {},) {
34207
+ const target = targetId ? targetId : 'none';
34208
+ const link = new URL(`data:${mediaType}${target}`,);
34209
+ if (options.element) {
34210
+ link.searchParams.append(elementKey, options.element,);
34211
+ }
34212
+ if (options.collectionItem) {
34213
+ link.searchParams.append(collectionKey, options.collectionItem.collection,);
34214
+ link.searchParams.append(collectionItemIdKey, options.collectionItem.collectionItemId,);
34215
+ link.searchParams.append(pathVariablesKey, new URLSearchParams(options.collectionItem.pathVariables,).toString(),);
34216
+ }
34217
+ return link.href;
34218
+ }
34219
+ function parseFramerPageLink(link,) {
34220
+ if (!isFramerPageLink(link,)) return;
34221
+ try {
34222
+ const url = new URL(link,);
34223
+ const target = url.pathname.substring(mediaType.length,);
34224
+ const searchParams = url.searchParams;
34225
+ const element = searchParams.has(elementKey,) ? searchParams.get(elementKey,) : void 0;
34226
+ let collectionItem;
34227
+ const collection = searchParams.get(collectionKey,);
34228
+ const collectionItemId = searchParams.get(collectionItemIdKey,);
34229
+ const pathVariablesValue = searchParams.get(pathVariablesKey,);
34230
+ if (collection && collectionItemId && pathVariablesValue) {
34231
+ const pathVariables = Object.fromEntries(new URLSearchParams(pathVariablesValue,).entries(),);
34232
+ collectionItem = {
34233
+ collection,
34234
+ collectionItemId,
34235
+ pathVariables,
34236
+ };
34237
+ }
34238
+ return {
34239
+ target: target === 'none' ? null : target,
34240
+ /**
34241
+ * For historical reason we used to set "element=none" into the
34242
+ * datalink, we no longer do that today, but we still keep this code
34243
+ * so we could parse legacy links correctly.
34244
+ */
34245
+ element: element === 'none' ? void 0 : element,
34246
+ collectionItem,
34247
+ };
34248
+ } catch {
34249
+ return;
34250
+ }
34251
+ }
34252
+ function shouldOpenLinkInNewTab(link,) {
34253
+ return !isFramerPageLink(link,);
34254
+ }
34255
+ function navigateFromAttributes(navigate, element, implicitPathVariables,) {
34256
+ var _a;
34257
+ let routeId = element.getAttribute('data-framer-page-link-target',/* Page */
34258
+ );
34259
+ let elementId;
34260
+ let pathVariables;
34261
+ if (routeId) {
34262
+ elementId = element.getAttribute('data-framer-page-link-element',/* Element */
34263
+ ) ?? void 0;
34264
+ const pathVariablesRaw = element.getAttribute('data-framer-page-link-path-variables',/* PathVariables */
34265
+ );
34266
+ if (pathVariablesRaw) {
34267
+ pathVariables = Object.fromEntries(new URLSearchParams(pathVariablesRaw,).entries(),);
34268
+ }
34269
+ } else {
34270
+ const href = element.getAttribute('href',);
34271
+ if (!href) return false;
34272
+ const link = parseFramerPageLink(href,);
34273
+ if (!link || !link.target) return false;
34274
+ routeId = link.target;
34275
+ elementId = link.element ?? void 0;
34276
+ pathVariables = (_a = link.collectionItem) == null ? void 0 : _a.pathVariables;
34277
+ }
34278
+ const smoothScroll = elementId ? element.dataset.framerSmoothScroll !== void 0 : void 0;
34279
+ navigate(routeId, elementId, Object.assign({}, implicitPathVariables, pathVariables,), smoothScroll,);
34280
+ return true;
34281
+ }
34282
+ function linkFromFramerPageLink(link,) {
34283
+ if (!isFramerPageLink(link,)) return link;
34284
+ const parsed = parseFramerPageLink(link,);
34285
+ if (!parsed) return void 0;
34286
+ const {
34287
+ target,
34288
+ element,
34289
+ collectionItem,
34290
+ } = parsed;
34291
+ if (!target) return void 0;
34292
+ return {
34293
+ webPageId: target,
34294
+ hash: element ?? void 0,
34295
+ pathVariables: createVariablesFromPageLinkCollectionItem(collectionItem,),
34296
+ };
34297
+ }
34298
+ function createVariablesFromPageLinkCollectionItem(collectionItem,) {
34299
+ if (!collectionItem) return void 0;
34300
+ const variables = {};
34301
+ for (const pathVariablesKey2 in collectionItem.pathVariables) {
34302
+ const value = collectionItem.pathVariables[pathVariablesKey2];
34303
+ if (value) variables[pathVariablesKey2] = value;
34304
+ }
34305
+ return variables;
34306
+ }
34307
+ var OuterLinkContext = /* @__PURE__ */ createContext(void 0,);
34308
+ function ResetOuterLinkContext({
34309
+ children,
34310
+ },) {
34311
+ return /* @__PURE__ */ jsx3(OuterLinkContext.Provider, {
34312
+ value: void 0,
34313
+ children,
34314
+ },);
34315
+ }
34316
+ function useReplaceNestedLinks(children, scopeId, nodeId, href, propsAddedByLink, observerRef,) {
34317
+ const outerLink = useContext(OuterLinkContext,);
34318
+ const furthestExternalComponent = useFurthestExternalComponent();
34319
+ const innerLink = useMemo2(() => ({
34320
+ scopeId,
34321
+ nodeId,
34322
+ furthestExternalComponent,
34323
+ }), [scopeId, nodeId, furthestExternalComponent,],);
34324
+ const router = useRouter();
34325
+ const currentRoute = useCurrentRoute();
34326
+ const route = useMemo2(() => {
34327
+ const pageLink = isLinkToWebPage(href,) ? href : linkFromFramerPageLink(href,);
34328
+ if (!pageLink) return;
34329
+ return getRouteFromPageLink(pageLink, router, currentRoute,);
34330
+ }, [currentRoute, href, router,],);
34331
+ const isOnFramerCanvas = useIsOnFramerCanvas();
34332
+ const shouldReplaceLink = Boolean(!isOnFramerCanvas && (outerLink == null ? void 0 : outerLink.nodeId) && innerLink.nodeId,);
34333
+ const onClick = useCallback((event) => {
34334
+ var _a;
34335
+ if (!propsAddedByLink.href) return;
34336
+ event.preventDefault();
34337
+ event.stopPropagation();
34338
+ const isAppleDevice = /Mac|iPod|iPhone|iPad/u.test(__unframerNavigator2.userAgent,);
34339
+ if (isAppleDevice ? event.metaKey : event.ctrlKey) {
34340
+ openExternalLink(propsAddedByLink.href, '', '_blank',);
34341
+ return;
34342
+ }
34343
+ if (route) {
34344
+ (_a = propsAddedByLink.navigate) == null ? void 0 : _a.call(propsAddedByLink,);
34345
+ } else {
34346
+ openExternalLink(propsAddedByLink.href, propsAddedByLink.rel, propsAddedByLink.target,);
34347
+ }
34348
+ }, [propsAddedByLink, route,],);
34349
+ const onAuxClick = useCallback((event) => {
34350
+ if (!propsAddedByLink.href) return;
34351
+ event.preventDefault();
34352
+ event.stopPropagation();
34353
+ openExternalLink(propsAddedByLink.href, '', '_blank',);
34354
+ }, [propsAddedByLink,],);
34355
+ const onKeyDown = useCallback((event) => {
34356
+ var _a;
34357
+ if (!propsAddedByLink.href) return;
34358
+ if (event.key !== 'Enter') return;
34359
+ event.preventDefault();
34360
+ event.stopPropagation();
34361
+ if (route) {
34362
+ (_a = propsAddedByLink.navigate) == null ? void 0 : _a.call(propsAddedByLink,);
34363
+ } else {
34364
+ openExternalLink(propsAddedByLink.href, propsAddedByLink.rel, propsAddedByLink.target,);
34365
+ }
34366
+ }, [propsAddedByLink, route,],);
34367
+ useRefEffect(observerRef, (node) => {
34368
+ if (node === null) return;
34369
+ if (!shouldReplaceLink) return;
34370
+ node.dataset.hydrated = 'true';
34371
+ }, [shouldReplaceLink,],);
34372
+ let replacedChildren = children;
34373
+ if (shouldReplaceLink) {
34374
+ Children.forEach(children, (child) => {
34375
+ if (!isChildReplaceable(child,)) return;
34376
+ assert(
34377
+ linkInfoIsCollectable(outerLink,),
34378
+ 'outerLink must have nodeId defined at this point; this was verified with `shouldReplaceLink` above',
34379
+ );
34380
+ assert(
34381
+ linkInfoIsCollectable(innerLink,),
34382
+ 'innerLink must have nodeId defined at this point; this was verified with `shouldReplaceLink` above',
34383
+ );
34384
+ nestedLinksCollector.collectNestedLink(outerLink, innerLink,);
34385
+ },);
34386
+ replacedChildren = Children.map(children, (child) => {
34387
+ if (!isChildReplaceable(child,)) return child;
34388
+ const tag = maybeReplaceAnchorWithSpan(child.type,);
34389
+ const {
34390
+ children: childChildren,
34391
+ ...childProps
34392
+ } = child.props;
34393
+ const props = {
34394
+ ...childProps,
34395
+ // This attribute is used in `ssg/src/ssg-sandbox-renderer/worker/nestedLinks.ts` to handle the nested links clicks
34396
+ 'data-nested-link': true,
34397
+ role: 'link',
34398
+ tabIndex: 0,
34399
+ onClick,
34400
+ onAuxClick,
34401
+ onKeyDown,
34402
+ as: childProps.as && maybeReplaceAnchorWithSpan(childProps.as,),
34403
+ };
34404
+ const ref = 'ref' in child ? child.ref : void 0;
34405
+ return createElement(tag, // We need to pass the ref here again, otherwise it will be lost
34406
+ {
34407
+ ...props,
34408
+ ref,
34409
+ }, childChildren,);
34410
+ },);
34411
+ }
34412
+ return /* @__PURE__ */ jsx3(OuterLinkContext.Provider, {
34413
+ value: innerLink,
34414
+ children: replacedChildren,
34415
+ },);
34416
+ }
34417
+ function linkInfoIsCollectable(linkInfo,) {
34418
+ return !isUndefined(linkInfo == null ? void 0 : linkInfo.nodeId,);
34419
+ }
34420
+ function isChildReplaceable(child,) {
34421
+ return isValidElement(child,) &&
34422
+ (maybeReplaceAnchorWithSpan(child.type,) !== child.type || maybeReplaceAnchorWithSpan(child.props.as,) !== child.props.as);
34423
+ }
34424
+ function openExternalLink(href, rel, target,) {
34425
+ const link = document.createElement('a',);
34426
+ link.href = href;
34427
+ if (rel) {
34428
+ link.rel = rel;
34429
+ }
34430
+ if (target) {
34431
+ link.target = target;
34432
+ }
34433
+ document.body.appendChild(link,);
34434
+ link.click();
34435
+ link.remove();
34436
+ }
34437
+ function maybeReplaceAnchorWithSpan(component,) {
34438
+ if (component === 'a') return 'span';
34439
+ if (isMotionComponent(component,) && unwrapMotionComponent(component,) === 'a') return motion.span;
34440
+ return component;
34441
+ }
33970
34442
  var Polygon = {
33971
34443
  /**
33972
34444
  * Determine if the vertices are ordered clockwise or counter-clockwise. This works for simple
@@ -34492,19 +34964,31 @@ function Floating({
34492
34964
  x: offsetX ?? 0,
34493
34965
  y: offsetY ?? 0,
34494
34966
  };
34495
- let getSafePlacementRect;
34496
- let position;
34497
34967
  let cleanup;
34498
34968
  let cleanupHasRun = false;
34499
34969
  let initialUpdateHasRun = false;
34500
34970
  let anchorRect;
34501
- let elementRect;
34502
34971
  let safePlacement;
34503
34972
  let calculatedRect;
34504
34973
  let latestEvent;
34505
34974
  let updateSafeArea;
34506
34975
  let scrollX = 0;
34507
34976
  let scrollY = 0;
34977
+ const ancestorInfo = domReadGetAncestorInfo(anchorRef,);
34978
+ const position = ancestorInfo.position;
34979
+ const elementRect = contentRef.current.getBoundingClientRect();
34980
+ const getSafePlacementRect = makeGetSafePlacementFloatingPositionRect({
34981
+ placement,
34982
+ alignment,
34983
+ offset,
34984
+ collisionDetectionSize: collisionDetection
34985
+ ? {
34986
+ width: safeWindow.innerWidth,
34987
+ height: safeWindow.innerHeight,
34988
+ }
34989
+ : void 0,
34990
+ collisionDetectionPadding,
34991
+ },);
34508
34992
  const onRender = () => {
34509
34993
  if (cleanupHasRun) return;
34510
34994
  domWriteUpdatePosition(floatingPositionRef, position, calculatedRect, scrollX, scrollY,);
@@ -34538,29 +35022,12 @@ function Floating({
34538
35022
  safePlacement = safePlacementAndRect[0];
34539
35023
  calculatedRect = safePlacementAndRect[1];
34540
35024
  };
34541
- frame.read(() => {
34542
- if (cleanupHasRun || !contentRef.current) return;
34543
- const ancestorInfo = domReadGetAncestorInfo(anchorRef,);
34544
- position = ancestorInfo.position;
34545
- elementRect = contentRef.current.getBoundingClientRect();
34546
- getSafePlacementRect = makeGetSafePlacementFloatingPositionRect({
34547
- placement,
34548
- alignment,
34549
- offset,
34550
- collisionDetectionSize: collisionDetection
34551
- ? {
34552
- width: safeWindow.innerWidth,
34553
- height: safeWindow.innerHeight,
34554
- }
34555
- : void 0,
34556
- collisionDetectionPadding,
34557
- },);
34558
- domReadUpdateSafePlacementAndRect();
34559
- frame.update(onUpdate,);
34560
- frame.render(initialRender,);
34561
- if (!ancestorInfo.scrolls) return;
35025
+ domReadUpdateSafePlacementAndRect();
35026
+ onUpdate();
35027
+ initialRender();
35028
+ if (ancestorInfo.scrolls) {
34562
35029
  cleanup = domReadStartAnimationFrameLoop(domReadUpdateSafePlacementAndRect,);
34563
- },);
35030
+ }
34564
35031
  if (!safeArea) {
34565
35032
  return () => {
34566
35033
  cleanup == null ? void 0 : cleanup();
@@ -34625,9 +35092,11 @@ function Floating({
34625
35092
  },),
34626
35093
  /* @__PURE__ */ jsx3(FloatingStackingContext.Provider, {
34627
35094
  value: descendantContext,
34628
- children: /* @__PURE__ */ jsx3('div', {
34629
- ref: contentRef,
34630
- children: childrenWithOrigin(children, origin,),
35095
+ children: /* @__PURE__ */ jsx3(ResetOuterLinkContext, {
35096
+ children: /* @__PURE__ */ jsx3('div', {
35097
+ ref: contentRef,
35098
+ children: childrenWithOrigin(children, origin,),
35099
+ },),
34631
35100
  },),
34632
35101
  },),
34633
35102
  ],
@@ -34636,11 +35105,11 @@ function Floating({
34636
35105
  );
34637
35106
  }
34638
35107
  var Instance = /* @__PURE__ */ React4.forwardRef(function Instance2({
34639
- Component: Component17,
35108
+ Component: Component18,
34640
35109
  ...props
34641
35110
  }, ref,) {
34642
- return Component17
34643
- ? /* @__PURE__ */ jsx3(Component17, {
35111
+ return Component18
35112
+ ? /* @__PURE__ */ jsx3(Component18, {
34644
35113
  ...props,
34645
35114
  ref,
34646
35115
  },)
@@ -34801,20 +35270,16 @@ function ChildrenCanSuspend({
34801
35270
  children,
34802
35271
  },);
34803
35272
  }
34804
- function withChildrenCanSuspend(Component17,) {
35273
+ function withChildrenCanSuspend(Component18,) {
34805
35274
  return forwardRef(function withChildrenCanSuspendInner(props, ref,) {
34806
35275
  return /* @__PURE__ */ jsx3(ChildrenCanSuspend, {
34807
- children: /* @__PURE__ */ jsx3(Component17, {
35276
+ children: /* @__PURE__ */ jsx3(Component18, {
34808
35277
  ...props,
34809
35278
  ref,
34810
35279
  },),
34811
35280
  },);
34812
35281
  },);
34813
35282
  }
34814
- var linkKey = 'webPageId';
34815
- function isLinkToWebPage(link,) {
34816
- return Boolean(link && typeof link === 'object' && linkKey in link,);
34817
- }
34818
35283
  var PRELOAD_AFTER_MS = 500;
34819
35284
  var OBSERVER_THRESHOLD = 0.9;
34820
35285
  var LOW_MEMORY_THRESHOLD = 1.7;
@@ -34988,18 +35453,6 @@ function resolveSlugsWithSuspense(unresolvedPathSlugs, unresolvedHashSlugs, coll
34988
35453
  }
34989
35454
  return result;
34990
35455
  }
34991
- function isInternalURL(href,) {
34992
- if (href === void 0) return false;
34993
- if (href.startsWith('#',) || href.startsWith('/',) || href.startsWith('.',)) return true;
34994
- return false;
34995
- }
34996
- function isValidURL(href, isInternal,) {
34997
- try {
34998
- const url = new URL(href,);
34999
- return Boolean(url.protocol,);
35000
- } catch {}
35001
- return isInternal;
35002
- }
35003
35456
  async function findMatchingRouteAttributesForWebPageLink(router, currentRoute, pageLink, activeLocale, implicitPathVariables,) {
35004
35457
  const {
35005
35458
  webPageId,
@@ -35087,136 +35540,6 @@ function getRouteAttributes(router, currentRoute, routeId, hash2, implicitPathVa
35087
35540
  pathVariables: combinedPathVariables,
35088
35541
  };
35089
35542
  }
35090
- function getRouteFromPageLink(pageLink, router, currentRoute,) {
35091
- var _a;
35092
- if (isString(pageLink,)) {
35093
- const isInternal = isInternalURL(pageLink,);
35094
- if (!router.routes || !router.getRoute || !currentRoute || !isInternal) {
35095
- return;
35096
- }
35097
- const [pathnameWithQueryParams,] = pageLink.split('#', 2,);
35098
- if (pathnameWithQueryParams === void 0) return;
35099
- const [pathname,] = pathnameWithQueryParams.split('?', 2,);
35100
- if (pathname === void 0) return;
35101
- const {
35102
- routeId,
35103
- } = inferInitialRouteFromPath(router.routes, pathname,);
35104
- return router.getRoute(routeId,);
35105
- }
35106
- const {
35107
- webPageId,
35108
- } = pageLink;
35109
- return (_a = router.getRoute) == null ? void 0 : _a.call(router, webPageId,);
35110
- }
35111
- var elementKey = 'element';
35112
- var collectionKey = 'collection';
35113
- var collectionItemIdKey = 'collectionItemId';
35114
- var pathVariablesKey = 'pathVariables';
35115
- var mediaType = 'framer/page-link,';
35116
- function isFramerPageLink(value,) {
35117
- return isString(value,) && value.startsWith(`data:${mediaType}`,);
35118
- }
35119
- function createFramerPageLink(targetId = null, options = {},) {
35120
- const target = targetId ? targetId : 'none';
35121
- const link = new URL(`data:${mediaType}${target}`,);
35122
- if (options.element) {
35123
- link.searchParams.append(elementKey, options.element,);
35124
- }
35125
- if (options.collectionItem) {
35126
- link.searchParams.append(collectionKey, options.collectionItem.collection,);
35127
- link.searchParams.append(collectionItemIdKey, options.collectionItem.collectionItemId,);
35128
- link.searchParams.append(pathVariablesKey, new URLSearchParams(options.collectionItem.pathVariables,).toString(),);
35129
- }
35130
- return link.href;
35131
- }
35132
- function parseFramerPageLink(link,) {
35133
- if (!isFramerPageLink(link,)) return;
35134
- try {
35135
- const url = new URL(link,);
35136
- const target = url.pathname.substring(mediaType.length,);
35137
- const searchParams = url.searchParams;
35138
- const element = searchParams.has(elementKey,) ? searchParams.get(elementKey,) : void 0;
35139
- let collectionItem;
35140
- const collection = searchParams.get(collectionKey,);
35141
- const collectionItemId = searchParams.get(collectionItemIdKey,);
35142
- const pathVariablesValue = searchParams.get(pathVariablesKey,);
35143
- if (collection && collectionItemId && pathVariablesValue) {
35144
- const pathVariables = Object.fromEntries(new URLSearchParams(pathVariablesValue,).entries(),);
35145
- collectionItem = {
35146
- collection,
35147
- collectionItemId,
35148
- pathVariables,
35149
- };
35150
- }
35151
- return {
35152
- target: target === 'none' ? null : target,
35153
- /**
35154
- * For historical reason we used to set "element=none" into the
35155
- * datalink, we no longer do that today, but we still keep this code
35156
- * so we could parse legacy links correctly.
35157
- */
35158
- element: element === 'none' ? void 0 : element,
35159
- collectionItem,
35160
- };
35161
- } catch {
35162
- return;
35163
- }
35164
- }
35165
- function shouldOpenLinkInNewTab(link,) {
35166
- return !isFramerPageLink(link,);
35167
- }
35168
- function navigateFromAttributes(navigate, element, implicitPathVariables,) {
35169
- var _a;
35170
- let routeId = element.getAttribute('data-framer-page-link-target',/* Page */
35171
- );
35172
- let elementId;
35173
- let pathVariables;
35174
- if (routeId) {
35175
- elementId = element.getAttribute('data-framer-page-link-element',/* Element */
35176
- ) ?? void 0;
35177
- const pathVariablesRaw = element.getAttribute('data-framer-page-link-path-variables',/* PathVariables */
35178
- );
35179
- if (pathVariablesRaw) {
35180
- pathVariables = Object.fromEntries(new URLSearchParams(pathVariablesRaw,).entries(),);
35181
- }
35182
- } else {
35183
- const href = element.getAttribute('href',);
35184
- if (!href) return false;
35185
- const link = parseFramerPageLink(href,);
35186
- if (!link || !link.target) return false;
35187
- routeId = link.target;
35188
- elementId = link.element ?? void 0;
35189
- pathVariables = (_a = link.collectionItem) == null ? void 0 : _a.pathVariables;
35190
- }
35191
- const smoothScroll = elementId ? element.dataset.framerSmoothScroll !== void 0 : void 0;
35192
- navigate(routeId, elementId, Object.assign({}, implicitPathVariables, pathVariables,), smoothScroll,);
35193
- return true;
35194
- }
35195
- function linkFromFramerPageLink(link,) {
35196
- if (!isFramerPageLink(link,)) return link;
35197
- const parsed = parseFramerPageLink(link,);
35198
- if (!parsed) return void 0;
35199
- const {
35200
- target,
35201
- element,
35202
- collectionItem,
35203
- } = parsed;
35204
- if (!target) return void 0;
35205
- return {
35206
- webPageId: target,
35207
- hash: element ?? void 0,
35208
- pathVariables: createVariablesFromPageLinkCollectionItem(collectionItem,),
35209
- };
35210
- }
35211
- function createVariablesFromPageLinkCollectionItem(collectionItem,) {
35212
- if (!collectionItem) return void 0;
35213
- const variables = {};
35214
- for (const pathVariablesKey2 in collectionItem.pathVariables) {
35215
- const value = collectionItem.pathVariables[pathVariablesKey2];
35216
- if (value) variables[pathVariablesKey2] = value;
35217
- }
35218
- return variables;
35219
- }
35220
35543
  var pathVariablesRegExp2 = /:([a-z]\w*)/gi;
35221
35544
  var PathVariablesContext = /* @__PURE__ */ createContext(void 0,);
35222
35545
  function useImplicitPathVariables() {
@@ -35286,187 +35609,6 @@ function combineRels(rel, otherRel,) {
35286
35609
  if (rel && otherRel) return `${rel} ${otherRel}`;
35287
35610
  return void 0;
35288
35611
  }
35289
- function linkInfoKey(link,) {
35290
- var _a, _b;
35291
- return `${link.scopeId}:${link.nodeId}:${(_a = link.furthestExternalComponent) == null ? void 0 : _a.scopeId}:${
35292
- (_b = link.furthestExternalComponent) == null ? void 0 : _b.nodeId
35293
- }`;
35294
- }
35295
- var NestedLinksCollector = class {
35296
- constructor() {
35297
- __publicField(this, 'collectedLinks', /* @__PURE__ */ new Map(),);
35298
- __publicField(this, 'nestingInfo', /* @__PURE__ */ new Map(),);
35299
- }
35300
- clear() {
35301
- this.collectedLinks.clear();
35302
- this.nestingInfo.clear();
35303
- }
35304
- /**
35305
- * Returns a Map of outer links to their inner links.
35306
- *
35307
- * NOTE: This function is called in the SSG renderer sandbox (<root>/src/ssg/src/ssg-sandbox-renderer/sandbox/worker/renderer.ts)
35308
- */
35309
- getLinks() {
35310
- const result = /* @__PURE__ */ new Map();
35311
- for (const [outerLinkKey, innerLinkKeys,] of this.nestingInfo) {
35312
- const outerLinkInfo = this.collectedLinks.get(outerLinkKey,);
35313
- assert(outerLinkInfo, `Outer link not found: ${outerLinkKey}`,);
35314
- const links = Array.from(innerLinkKeys,).map((innerLinkKey) => {
35315
- const innerLinkInfo = this.collectedLinks.get(innerLinkKey,);
35316
- assert(innerLinkInfo, `Inner link not found: ${innerLinkKey}`,);
35317
- return innerLinkInfo;
35318
- },);
35319
- result.set(outerLinkInfo, links,);
35320
- }
35321
- return result;
35322
- }
35323
- collectNestedLink(outerLink, innerLink,) {
35324
- if (isWindow && !isTest() || !outerLink.nodeId || !innerLink.nodeId) {
35325
- return;
35326
- }
35327
- this.collectedLinks.set(linkInfoKey(outerLink,), outerLink,);
35328
- this.collectedLinks.set(linkInfoKey(innerLink,), innerLink,);
35329
- const outerLinkNestingInfo = this.nestingInfo.get(linkInfoKey(outerLink,),) ?? /* @__PURE__ */ new Set();
35330
- outerLinkNestingInfo.add(linkInfoKey(innerLink,),);
35331
- this.nestingInfo.set(linkInfoKey(outerLink,), outerLinkNestingInfo,);
35332
- }
35333
- };
35334
- var nestedLinksCollector = /* @__PURE__ */ new NestedLinksCollector();
35335
- function useIsOnFramerCanvas() {
35336
- return RenderTarget.current() === RenderTarget.canvas;
35337
- }
35338
- var OuterLinkContext = /* @__PURE__ */ createContext(void 0,);
35339
- function useReplaceNestedLinks(children, scopeId, nodeId, href, propsAddedByLink, observerRef,) {
35340
- const outerLink = useContext(OuterLinkContext,);
35341
- const furthestExternalComponent = useFurthestExternalComponent();
35342
- const innerLink = useMemo2(() => ({
35343
- scopeId,
35344
- nodeId,
35345
- furthestExternalComponent,
35346
- }), [scopeId, nodeId, furthestExternalComponent,],);
35347
- const router = useRouter();
35348
- const currentRoute = useCurrentRoute();
35349
- const route = useMemo2(() => {
35350
- const pageLink = isLinkToWebPage(href,) ? href : linkFromFramerPageLink(href,);
35351
- if (!pageLink) return;
35352
- return getRouteFromPageLink(pageLink, router, currentRoute,);
35353
- }, [currentRoute, href, router,],);
35354
- const {
35355
- replaceNestedLinks,
35356
- } = useLibraryFeatures();
35357
- const isOnFramerCanvas = useIsOnFramerCanvas();
35358
- const shouldReplaceLink = Boolean(
35359
- replaceNestedLinks && !isOnFramerCanvas && (outerLink == null ? void 0 : outerLink.nodeId) && innerLink.nodeId,
35360
- );
35361
- const onClick = useCallback((event) => {
35362
- var _a;
35363
- if (!propsAddedByLink.href) return;
35364
- event.preventDefault();
35365
- event.stopPropagation();
35366
- const isAppleDevice = /Mac|iPod|iPhone|iPad/u.test(__unframerNavigator2.userAgent,);
35367
- if (isAppleDevice ? event.metaKey : event.ctrlKey) {
35368
- openExternalLink(propsAddedByLink.href, '', '_blank',);
35369
- return;
35370
- }
35371
- if (route) {
35372
- (_a = propsAddedByLink.navigate) == null ? void 0 : _a.call(propsAddedByLink,);
35373
- } else {
35374
- openExternalLink(propsAddedByLink.href, propsAddedByLink.rel, propsAddedByLink.target,);
35375
- }
35376
- }, [propsAddedByLink, route,],);
35377
- const onAuxClick = useCallback((event) => {
35378
- if (!propsAddedByLink.href) return;
35379
- event.preventDefault();
35380
- event.stopPropagation();
35381
- openExternalLink(propsAddedByLink.href, '', '_blank',);
35382
- }, [propsAddedByLink,],);
35383
- const onKeyDown = useCallback((event) => {
35384
- var _a;
35385
- if (!propsAddedByLink.href) return;
35386
- if (event.key !== 'Enter') return;
35387
- event.preventDefault();
35388
- event.stopPropagation();
35389
- if (route) {
35390
- (_a = propsAddedByLink.navigate) == null ? void 0 : _a.call(propsAddedByLink,);
35391
- } else {
35392
- openExternalLink(propsAddedByLink.href, propsAddedByLink.rel, propsAddedByLink.target,);
35393
- }
35394
- }, [propsAddedByLink, route,],);
35395
- useRefEffect(observerRef, (node) => {
35396
- if (node === null) return;
35397
- if (!shouldReplaceLink) return;
35398
- node.dataset.hydrated = 'true';
35399
- }, [shouldReplaceLink,],);
35400
- let replacedChildren = children;
35401
- if (shouldReplaceLink) {
35402
- Children.forEach(children, (child) => {
35403
- if (!isChildReplaceable(child,)) return;
35404
- assert(
35405
- linkInfoIsCollectable(outerLink,),
35406
- 'outerLink must have nodeId defined at this point; this was verified with `shouldReplaceLink` above',
35407
- );
35408
- assert(
35409
- linkInfoIsCollectable(innerLink,),
35410
- 'innerLink must have nodeId defined at this point; this was verified with `shouldReplaceLink` above',
35411
- );
35412
- nestedLinksCollector.collectNestedLink(outerLink, innerLink,);
35413
- },);
35414
- replacedChildren = Children.map(children, (child) => {
35415
- if (!isChildReplaceable(child,)) return child;
35416
- const tag = maybeReplaceAnchorWithSpan(child.type,);
35417
- const {
35418
- children: childChildren,
35419
- ...childProps
35420
- } = child.props;
35421
- const props = {
35422
- ...childProps,
35423
- // This attribute is used in `ssg/src/ssg-sandbox-renderer/worker/nestedLinks.ts` to handle the nested links clicks
35424
- 'data-nested-link': true,
35425
- role: 'link',
35426
- tabIndex: 0,
35427
- onClick,
35428
- onAuxClick,
35429
- onKeyDown,
35430
- as: childProps.as && maybeReplaceAnchorWithSpan(childProps.as,),
35431
- };
35432
- const ref = 'ref' in child ? child.ref : void 0;
35433
- return createElement(tag, // We need to pass the ref here again, otherwise it will be lost
35434
- {
35435
- ...props,
35436
- ref,
35437
- }, childChildren,);
35438
- },);
35439
- }
35440
- return /* @__PURE__ */ jsx3(OuterLinkContext.Provider, {
35441
- value: innerLink,
35442
- children: replacedChildren,
35443
- },);
35444
- }
35445
- function linkInfoIsCollectable(linkInfo,) {
35446
- return !isUndefined(linkInfo == null ? void 0 : linkInfo.nodeId,);
35447
- }
35448
- function isChildReplaceable(child,) {
35449
- return isValidElement(child,) &&
35450
- (maybeReplaceAnchorWithSpan(child.type,) !== child.type || maybeReplaceAnchorWithSpan(child.props.as,) !== child.props.as);
35451
- }
35452
- function openExternalLink(href, rel, target,) {
35453
- const link = document.createElement('a',);
35454
- link.href = href;
35455
- if (rel) {
35456
- link.rel = rel;
35457
- }
35458
- if (target) {
35459
- link.target = target;
35460
- }
35461
- document.body.appendChild(link,);
35462
- link.click();
35463
- link.remove();
35464
- }
35465
- function maybeReplaceAnchorWithSpan(component,) {
35466
- if (component === 'a') return 'span';
35467
- if (isMotionComponent(component,) && unwrapMotionComponent(component,) === 'a') return motion.span;
35468
- return component;
35469
- }
35470
35612
  function useTrackLinkClick({
35471
35613
  nodeId,
35472
35614
  clickTrackingId,
@@ -35809,23 +35951,6 @@ function resolvePageScope(pageLink, router,) {
35809
35951
  siteCanonicalURL: void 0,
35810
35952
  },);
35811
35953
  }
35812
- var IgnoreErrors = class extends Component2 {
35813
- constructor() {
35814
- super(...arguments,);
35815
- __publicField(this, 'state', {
35816
- error: void 0,
35817
- },);
35818
- }
35819
- static getDerivedStateFromError(error,) {
35820
- return {
35821
- error,
35822
- };
35823
- }
35824
- render() {
35825
- if (this.state.error) return null;
35826
- return this.props.children;
35827
- }
35828
- };
35829
35954
  var salt = 'framer';
35830
35955
  var difficulty = 3;
35831
35956
  var tokenLength = 30;
@@ -36038,6 +36163,7 @@ var FormContainer = /* @__PURE__ */ React4.forwardRef(function FormContainer2({
36038
36163
  onError,
36039
36164
  onLoading,
36040
36165
  };
36166
+ const submissionInProgressRef = React4.useRef(false,);
36041
36167
  async function redirectTo(link,) {
36042
36168
  var _a, _b;
36043
36169
  if (isString(link,)) {
@@ -36066,15 +36192,18 @@ var FormContainer = /* @__PURE__ */ React4.forwardRef(function FormContainer2({
36066
36192
  const handleSubmit = async (event) => {
36067
36193
  var _a, _b, _c, _d, _e, _f;
36068
36194
  event.preventDefault();
36069
- if (!action || !projectHash) return;
36070
- dispatch({
36071
- type: 'submit',
36072
- },);
36195
+ if (!action || !projectHash || submissionInProgressRef.current) return;
36196
+ submissionInProgressRef.current = true;
36073
36197
  const data2 = new FormData(event.currentTarget,);
36074
36198
  await yieldToMain({
36075
- priority: 'user-blocking',
36199
+ priority: 'user-visible',
36076
36200
  continueAfter: 'paint',
36077
36201
  },);
36202
+ startTransition2(() =>
36203
+ dispatch({
36204
+ type: 'submit',
36205
+ },)
36206
+ );
36078
36207
  addUTMTagsToFormData(data2, safeWindow.document,);
36079
36208
  for (const [key7, value,] of data2) {
36080
36209
  if (value instanceof File) data2.delete(key7,);
@@ -36106,6 +36235,7 @@ var FormContainer = /* @__PURE__ */ React4.forwardRef(function FormContainer2({
36106
36235
  (_f = (_e = callbacks.current).onError) == null ? void 0 : _f.call(_e,);
36107
36236
  console.error(error,);
36108
36237
  }
36238
+ submissionInProgressRef.current = false;
36109
36239
  };
36110
36240
  const handleKeyDown = (event) => {
36111
36241
  const {
@@ -36182,6 +36312,61 @@ function responseHasError(response,) {
36182
36312
  return typeof response === 'object' && response !== null && 'error' in response && isObject2(response.error,) &&
36183
36313
  'message' in response.error && typeof response.error.message === 'string';
36184
36314
  }
36315
+ var FORCE_SHOW_EDITORBAR_LOCALSTORAGE_KEY = '__framer_force_showing_editorbar_since';
36316
+ var IgnoreErrors = class extends Component2 {
36317
+ constructor() {
36318
+ super(...arguments,);
36319
+ __publicField(this, 'state', {
36320
+ error: void 0,
36321
+ },);
36322
+ }
36323
+ static getDerivedStateFromError(error,) {
36324
+ return {
36325
+ error,
36326
+ };
36327
+ }
36328
+ render() {
36329
+ if (this.state.error) return null;
36330
+ return this.props.children;
36331
+ }
36332
+ };
36333
+ var isPrioritized = () => {
36334
+ try {
36335
+ return !!localStorage[FORCE_SHOW_EDITORBAR_LOCALSTORAGE_KEY];
36336
+ } catch (e) {
36337
+ return false;
36338
+ }
36339
+ };
36340
+ var isntPrioritized = () => !isPrioritized();
36341
+ var getServerSnapshot = () => false;
36342
+ var noOpSubscribe = () => () => {};
36343
+ function EditorBarLauncher({
36344
+ EditorBar,
36345
+ fast = false,
36346
+ },) {
36347
+ const libraryFeatures = useLibraryFeatures();
36348
+ const framerSiteId = useContext(FormContext,);
36349
+ const enabled = useSyncExternalStore(noOpSubscribe, fast ? isPrioritized : isntPrioritized, getServerSnapshot,);
36350
+ const editorBarFeatures = useMemo2(() => {
36351
+ const features = {};
36352
+ let key7;
36353
+ for (key7 in libraryFeatures) {
36354
+ if (libraryFeatures.hasOwnProperty(key7,) && key7.startsWith('editorBar',)) {
36355
+ features[key7] = libraryFeatures[key7];
36356
+ }
36357
+ }
36358
+ return features;
36359
+ }, [libraryFeatures,],);
36360
+ if (!EditorBar || !framerSiteId || !enabled) return null;
36361
+ return /* @__PURE__ */ jsx3(IgnoreErrors, {
36362
+ children: /* @__PURE__ */ jsx3(Suspense2, {
36363
+ children: /* @__PURE__ */ jsx3(EditorBar, {
36364
+ framerSiteId,
36365
+ features: editorBarFeatures,
36366
+ },),
36367
+ },),
36368
+ },);
36369
+ }
36185
36370
  function isSamePage(a, b,) {
36186
36371
  if (a.routeId !== b.routeId) return false;
36187
36372
  if (a.pathVariables === b.pathVariables) return true;
@@ -36356,7 +36541,7 @@ function Router({
36356
36541
  locales = EMPTY_ARRAY,
36357
36542
  preserveQueryParams = false,
36358
36543
  LayoutTemplate,
36359
- editorBar,
36544
+ EditorBar,
36360
36545
  siteCanonicalURL,
36361
36546
  },) {
36362
36547
  useMarkRouterEffects();
@@ -36653,38 +36838,46 @@ function Router({
36653
36838
  }));
36654
36839
  return /* @__PURE__ */ jsx3(RouterAPIProvider, {
36655
36840
  api,
36656
- children: /* @__PURE__ */ jsx3(LocaleInfoContext.Provider, {
36841
+ children: /* @__PURE__ */ jsxs(LocaleInfoContext.Provider, {
36657
36842
  value: localeInfo,
36658
- children: /* @__PURE__ */ jsx3(SynchronousSuspenseErrorBoundary, {
36659
- children: /* @__PURE__ */ jsxs(SuspenseThatPreservesDom, {
36660
- children: [
36661
- /* @__PURE__ */ jsxs(NotFoundErrorBoundary, {
36662
- notFoundPage,
36663
- defaultPageStyle,
36664
- forceUpdateKey: dep,
36665
- children: [
36666
- /* @__PURE__ */ jsx3(MarkSuspenseEffects.Start, {},),
36667
- /* @__PURE__ */ jsx3(WithLayoutTemplate, {
36668
- LayoutTemplate,
36669
- routeId: (currentRoute == null ? void 0 : currentRoute.abTestingVariantId) ?? currentRouteId,
36670
- style: defaultPageStyle,
36671
- children: (inLayoutTemplate) => {
36672
- return /* @__PURE__ */ jsx3(Fragment, {
36673
- children: pageExistsInCurrentLocale
36674
- ? renderPage(currentRoute.page, inLayoutTemplate ? templatePageStyle : defaultPageStyle,)
36675
- : // LAYOUT_TEMPLATE @TODO: display: content for not found page?
36676
- notFoundPage && renderPage(notFoundPage, defaultPageStyle,),
36677
- }, remountKey,);
36678
- },
36679
- },),
36680
- ],
36681
- },),
36682
- editorBar,
36683
- /* @__PURE__ */ jsx3(TurnOnReactEventHandling, {},),
36684
- /* @__PURE__ */ jsx3(MarkSuspenseEffects.End, {},),
36685
- ],
36843
+ children: [
36844
+ EditorBar && /* @__PURE__ */ jsx3(EditorBarLauncher, {
36845
+ EditorBar,
36846
+ fast: true,
36686
36847
  },),
36687
- },),
36848
+ /* @__PURE__ */ jsx3(SynchronousSuspenseErrorBoundary, {
36849
+ children: /* @__PURE__ */ jsxs(SuspenseThatPreservesDom, {
36850
+ children: [
36851
+ /* @__PURE__ */ jsxs(NotFoundErrorBoundary, {
36852
+ notFoundPage,
36853
+ defaultPageStyle,
36854
+ forceUpdateKey: dep,
36855
+ children: [
36856
+ /* @__PURE__ */ jsx3(MarkSuspenseEffects.Start, {},),
36857
+ /* @__PURE__ */ jsx3(WithLayoutTemplate, {
36858
+ LayoutTemplate,
36859
+ routeId: (currentRoute == null ? void 0 : currentRoute.abTestingVariantId) ?? currentRouteId,
36860
+ style: defaultPageStyle,
36861
+ children: (inLayoutTemplate) => {
36862
+ return /* @__PURE__ */ jsx3(Fragment, {
36863
+ children: pageExistsInCurrentLocale
36864
+ ? renderPage(currentRoute.page, inLayoutTemplate ? templatePageStyle : defaultPageStyle,)
36865
+ : // LAYOUT_TEMPLATE @TODO: display: content for not found page?
36866
+ notFoundPage && renderPage(notFoundPage, defaultPageStyle,),
36867
+ }, remountKey,);
36868
+ },
36869
+ },),
36870
+ ],
36871
+ },),
36872
+ EditorBar && /* @__PURE__ */ jsx3(EditorBarLauncher, {
36873
+ EditorBar,
36874
+ },),
36875
+ /* @__PURE__ */ jsx3(TurnOnReactEventHandling, {},),
36876
+ /* @__PURE__ */ jsx3(MarkSuspenseEffects.End, {},),
36877
+ ],
36878
+ },),
36879
+ },),
36880
+ ],
36688
36881
  },),
36689
36882
  },);
36690
36883
  }
@@ -36786,20 +36979,12 @@ function resolveFetchDataValue(result, request,) {
36786
36979
  }
36787
36980
  return resolvedValue;
36788
36981
  }
36982
+ var minimumCacheDurationMs = 5e3;
36789
36983
  function isCacheExpired(insertionTimestamp, cacheDuration,) {
36790
36984
  if (RenderTarget.current() === RenderTarget.canvas) {
36791
36985
  return false;
36792
36986
  }
36793
- const cacheDurationMs = cacheDuration === 0
36794
- ? // When the cache is set to 0 seconds we set use a 500ms cache delay
36795
- // to avoid triggering refetching when a variant switches from
36796
- // preloading to rendering the component (and
36797
- // resubscribing to the fetch client). When another component
36798
- // relying on the same endpoint (eg another page) is mounted again
36799
- // and the cache time is set to 0, the the data will be fetched
36800
- // again.
36801
- 500
36802
- : cacheDuration * 1e3;
36987
+ const cacheDurationMs = Math.max(cacheDuration * 1e3, minimumCacheDurationMs,);
36803
36988
  const currentTimestamp = Date.now();
36804
36989
  const expirationTimestamp = insertionTimestamp + cacheDurationMs;
36805
36990
  return currentTimestamp >= expirationTimestamp;
@@ -37239,9 +37424,7 @@ function PageRoot({
37239
37424
  width: 'auto',
37240
37425
  },
37241
37426
  preserveQueryParams,
37242
- editorBar: /* @__PURE__ */ jsx3(EditorBarLauncher, {
37243
- EditorBar,
37244
- },),
37427
+ EditorBar,
37245
37428
  disableHistory,
37246
37429
  LayoutTemplate,
37247
37430
  siteCanonicalURL,
@@ -37269,37 +37452,6 @@ function PageRoot({
37269
37452
  },);
37270
37453
  }
37271
37454
  }
37272
- function EditorBarLauncher({
37273
- EditorBar,
37274
- },) {
37275
- const libraryFeatures = useLibraryFeatures();
37276
- const [mounted, setMounted,] = useState(false,);
37277
- const framerSiteId = useContext(FormContext,);
37278
- const editorBarFeatures = useMemo2(() => {
37279
- const features = {};
37280
- let key7;
37281
- for (key7 in libraryFeatures) {
37282
- if (libraryFeatures.hasOwnProperty(key7,) && key7.startsWith('editorBar',)) {
37283
- features[key7] = libraryFeatures[key7];
37284
- }
37285
- }
37286
- return features;
37287
- }, [libraryFeatures,],);
37288
- useEffect(() => {
37289
- startTransition2(() => {
37290
- setMounted(true,);
37291
- },);
37292
- }, [],);
37293
- if (!EditorBar || !framerSiteId || !mounted) return null;
37294
- return /* @__PURE__ */ jsx3(IgnoreErrors, {
37295
- children: /* @__PURE__ */ jsx3(Suspense2, {
37296
- children: /* @__PURE__ */ jsx3(EditorBar, {
37297
- framerSiteId,
37298
- features: editorBarFeatures,
37299
- },),
37300
- },),
37301
- },);
37302
- }
37303
37455
  var ResolveLinks = /* @__PURE__ */ withChildrenCanSuspend(/* @__PURE__ */ forwardRef(function ResolveLinksInner({
37304
37456
  links,
37305
37457
  children,
@@ -42546,12 +42698,12 @@ function usePrototypeNavigate({
42546
42698
  navigation.goBack();
42547
42699
  return false;
42548
42700
  }
42549
- const Component17 = typeof target === 'string'
42701
+ const Component18 = typeof target === 'string'
42550
42702
  ? await componentForRoute(getRoute == null ? void 0 : getRoute(target,),).catch(() => {},)
42551
42703
  : React4.isValidElement(target,)
42552
42704
  ? target
42553
42705
  : null;
42554
- if (!Component17) return;
42706
+ if (!Component18) return;
42555
42707
  const {
42556
42708
  appearsFrom,
42557
42709
  backdropColor,
@@ -42560,40 +42712,40 @@ function usePrototypeNavigate({
42560
42712
  const transitionType = options.transition || 'instant';
42561
42713
  switch (transitionType) {
42562
42714
  case 'instant':
42563
- navigation.instant(Component17,);
42715
+ navigation.instant(Component18,);
42564
42716
  break;
42565
42717
  case 'fade':
42566
- navigation.fade(Component17, {
42718
+ navigation.fade(Component18, {
42567
42719
  animation,
42568
42720
  },);
42569
42721
  break;
42570
42722
  case 'push':
42571
- navigation.push(Component17, {
42723
+ navigation.push(Component18, {
42572
42724
  appearsFrom,
42573
42725
  animation,
42574
42726
  },);
42575
42727
  break;
42576
42728
  case 'flip':
42577
- navigation.flip(Component17, {
42729
+ navigation.flip(Component18, {
42578
42730
  appearsFrom,
42579
42731
  animation,
42580
42732
  },);
42581
42733
  break;
42582
42734
  case 'magicMotion':
42583
- navigation.magicMotion(Component17, {
42735
+ navigation.magicMotion(Component18, {
42584
42736
  animation,
42585
42737
  },);
42586
42738
  break;
42587
42739
  // Overlay stack navigation doesn't support updating the browser's
42588
42740
  // path.
42589
42741
  case 'modal':
42590
- navigation.modal(Component17, {
42742
+ navigation.modal(Component18, {
42591
42743
  backdropColor,
42592
42744
  animation,
42593
42745
  },);
42594
42746
  break;
42595
42747
  case 'overlay':
42596
- navigation.overlay(Component17, {
42748
+ navigation.overlay(Component18, {
42597
42749
  appearsFrom,
42598
42750
  backdropColor,
42599
42751
  animation,
@@ -43131,16 +43283,16 @@ function safeCSSValue(value,) {
43131
43283
  if (reUnsafeCharacters.test(value,)) return 'none';
43132
43284
  return value;
43133
43285
  }
43134
- function withCodeBoundaryForOverrides(Component17, {
43286
+ function withCodeBoundaryForOverrides(Component18, {
43135
43287
  scopeId,
43136
43288
  nodeId,
43137
43289
  override,
43138
43290
  inComponentSlot,
43139
43291
  },) {
43140
43292
  if (!shouldEnableCodeBoundaries()) {
43141
- return override(Component17,);
43293
+ return override(Component18,);
43142
43294
  }
43143
- const appliedOverride = tryToApplyOverride(Component17, override,);
43295
+ const appliedOverride = tryToApplyOverride(Component18, override,);
43144
43296
  let hasErrorBeenLogged = false;
43145
43297
  function CodeBoundaryForOverrides(props, ref,) {
43146
43298
  const nearestExternalComponent = useNearestExternalComponent();
@@ -43156,7 +43308,7 @@ function withCodeBoundaryForOverrides(Component17, {
43156
43308
  value: nodeId,
43157
43309
  children: /* @__PURE__ */ jsx3(CodeComponentBoundary, {
43158
43310
  getErrorMessage: getErrorMessageForOverride.bind(null, scopeId, nodeId,),
43159
- fallback: /* @__PURE__ */ jsx3(Component17, {
43311
+ fallback: /* @__PURE__ */ jsx3(Component18, {
43160
43312
  ...props,
43161
43313
  ref,
43162
43314
  },),
@@ -43173,7 +43325,7 @@ function withCodeBoundaryForOverrides(Component17, {
43173
43325
  collectErrorToAnalytics(appliedOverride.error,);
43174
43326
  hasErrorBeenLogged = true;
43175
43327
  }
43176
- return /* @__PURE__ */ jsx3(Component17, {
43328
+ return /* @__PURE__ */ jsx3(Component18, {
43177
43329
  ...props,
43178
43330
  ref,
43179
43331
  },);
@@ -43194,9 +43346,9 @@ function withCodeBoundaryForOverrides(Component17, {
43194
43346
  }
43195
43347
  return React4.forwardRef(CodeBoundaryForOverrides,);
43196
43348
  }
43197
- function tryToApplyOverride(Component17, override,) {
43349
+ function tryToApplyOverride(Component18, override,) {
43198
43350
  try {
43199
- const ComponentWithOverrides = override(Component17,);
43351
+ const ComponentWithOverrides = override(Component18,);
43200
43352
  return {
43201
43353
  status: 'success',
43202
43354
  Component: ComponentWithOverrides,
@@ -43216,7 +43368,7 @@ function singleFrame() {
43216
43368
  frame.postRender(() => resolve());
43217
43369
  },);
43218
43370
  }
43219
- var withV1StrokeFX = (Component17) =>
43371
+ var withV1StrokeFX = (Component18) =>
43220
43372
  forwardRef((props, forwardedRef,) => {
43221
43373
  const {
43222
43374
  strokeEffectLength,
@@ -43269,7 +43421,7 @@ var withV1StrokeFX = (Component17) =>
43269
43421
  strokeDashoffset: value,
43270
43422
  }
43271
43423
  : void 0;
43272
- return /* @__PURE__ */ jsx3(Component17, {
43424
+ return /* @__PURE__ */ jsx3(Component18, {
43273
43425
  ...restProps,
43274
43426
  ...effect,
43275
43427
  ref: forwardedRef,
@@ -43285,14 +43437,14 @@ function extractMappingFromInfo(info,) {
43285
43437
  return void 0;
43286
43438
  }
43287
43439
  }
43288
- function withMappedReactProps(Component17, info,) {
43440
+ function withMappedReactProps(Component18, info,) {
43289
43441
  return (rawProps) => {
43290
43442
  const props = {};
43291
43443
  const mapping = extractMappingFromInfo(info,);
43292
43444
  for (const key7 in rawProps) {
43293
43445
  asRecord(props,)[(mapping == null ? void 0 : mapping[key7]) ?? key7] = rawProps[key7];
43294
43446
  }
43295
- return /* @__PURE__ */ jsx3(Component17, {
43447
+ return /* @__PURE__ */ jsx3(Component18, {
43296
43448
  ...props,
43297
43449
  },);
43298
43450
  };
@@ -43333,10 +43485,10 @@ function createInputOutputRanges2(transformTargets, threshold, exitTarget,) {
43333
43485
  outputRange: [-1, -1, ...outputRange,],
43334
43486
  };
43335
43487
  }
43336
- var withVariantAppearEffect = (Component17) =>
43488
+ var withVariantAppearEffect = (Component18) =>
43337
43489
  React4.forwardRef((props, forwardedRef,) => {
43338
43490
  if (RenderTarget.current() === RenderTarget.canvas) {
43339
- return /* @__PURE__ */ jsx3(Component17, {
43491
+ return /* @__PURE__ */ jsx3(Component18, {
43340
43492
  ...props,
43341
43493
  ref: forwardedRef,
43342
43494
  },);
@@ -43408,18 +43560,18 @@ var withVariantAppearEffect = (Component17) =>
43408
43560
  startTransition2(() => setVariant(target,));
43409
43561
  },);
43410
43562
  if (!('variantAppearEffectEnabled' in options) || variantAppearEffectEnabled === true) {
43411
- return /* @__PURE__ */ jsx3(Component17, {
43563
+ return /* @__PURE__ */ jsx3(Component18, {
43412
43564
  ...rest,
43413
43565
  variant: activeVariant ?? props.variant,
43414
43566
  ref: observerRef,
43415
43567
  },);
43416
43568
  } else {
43417
- return /* @__PURE__ */ jsx3(Component17, {
43569
+ return /* @__PURE__ */ jsx3(Component18, {
43418
43570
  ...rest,
43419
43571
  },);
43420
43572
  }
43421
43573
  },);
43422
- var withVariantFX = (Component17) =>
43574
+ var withVariantFX = (Component18) =>
43423
43575
  React4.forwardRef(({
43424
43576
  initial,
43425
43577
  animate: animate3,
@@ -43436,7 +43588,7 @@ var withVariantFX = (Component17) =>
43436
43588
  observerRef,
43437
43589
  true,
43438
43590
  );
43439
- return /* @__PURE__ */ jsx3(Component17, {
43591
+ return /* @__PURE__ */ jsx3(Component18, {
43440
43592
  ...props,
43441
43593
  style: {
43442
43594
  ...(props == null ? void 0 : props.style),
@@ -44194,6 +44346,27 @@ function createVariantName(weight, style2,) {
44194
44346
  }
44195
44347
  return `${fontWeightNames[weight]}`;
44196
44348
  }
44349
+ var MapWithHash = class extends Map {
44350
+ constructor() {
44351
+ super(...arguments,);
44352
+ __publicField(this, '_hash', 0,);
44353
+ }
44354
+ get hash() {
44355
+ return this._hash;
44356
+ }
44357
+ set(key7, value,) {
44358
+ this._hash++;
44359
+ return super.set(key7, value,);
44360
+ }
44361
+ delete(key7,) {
44362
+ this._hash++;
44363
+ return super.delete(key7,);
44364
+ }
44365
+ clear() {
44366
+ this._hash++;
44367
+ return super.clear();
44368
+ }
44369
+ };
44197
44370
  function isVariableFont(font,) {
44198
44371
  return Boolean(font.variationAxes,);
44199
44372
  }
@@ -44710,8 +44883,10 @@ var Mixed = Symbol('Mixed',);
44710
44883
  var DEPENDENCIES_MODULE_NAME = 'dependencies';
44711
44884
  var DEPENDENCIES_MODULE_TYPE = 'config';
44712
44885
  var DEPENDENCIES_MODULE_TYPE_SLASH_NAME = `${DEPENDENCIES_MODULE_TYPE}/${DEPENDENCIES_MODULE_NAME}`;
44713
- var IMPORT_MAP_FILE_ID = `${DEPENDENCIES_MODULE_TYPE_SLASH_NAME}/importMap.json`;
44714
- var DEPENDENCIES_FILE_ID = `${DEPENDENCIES_MODULE_TYPE_SLASH_NAME}/dependencies.json`;
44886
+ var IMPORT_MAP_FILE_NAME = 'importMap.json';
44887
+ var DEPENDENCIES_FILE_NAME = 'dependencies.json';
44888
+ var IMPORT_MAP_FILE_ID = `${DEPENDENCIES_MODULE_TYPE_SLASH_NAME}/${IMPORT_MAP_FILE_NAME}`;
44889
+ var DEPENDENCIES_FILE_ID = `${DEPENDENCIES_MODULE_TYPE_SLASH_NAME}/${DEPENDENCIES_FILE_NAME}`;
44715
44890
  var USE_FREEZE = false;
44716
44891
  var List;
44717
44892
  ((List2) => {
@@ -46140,7 +46315,7 @@ function isValidVariationAxes(data2,) {
46140
46315
  var FontStore = class {
46141
46316
  constructor() {
46142
46317
  __publicField(this, 'enabled', false,);
46143
- __publicField(this, 'bySelector', /* @__PURE__ */ new Map(),);
46318
+ __publicField(this, 'bySelector', new MapWithHash(),);
46144
46319
  __publicField(this, 'loadedSelectors', /* @__PURE__ */ new Set(),);
46145
46320
  __publicField(this, 'getGoogleFontsListPromise',);
46146
46321
  __publicField(this, 'getFontshareFontsListPromise',);
@@ -46158,20 +46333,29 @@ var FontStore = class {
46158
46333
  __publicField(this, 'builtIn',);
46159
46334
  __publicField(this, 'framer',);
46160
46335
  __publicField(this, 'custom',);
46336
+ __publicField(this, 'bySelectorValuesCache',);
46161
46337
  this.local = new LocalFontSource();
46162
46338
  this.google = new GoogleFontSource();
46163
46339
  this.fontshare = new FontshareSource();
46164
46340
  this.framer = new FramerFontSource();
46165
46341
  this.custom = new CustomFontSource();
46166
46342
  this.builtIn = new BuiltInFontSource();
46167
- this.bySelector = /* @__PURE__ */ new Map();
46168
46343
  this.importLocalFonts();
46169
46344
  }
46345
+ get hash() {
46346
+ return this.bySelector.hash;
46347
+ }
46170
46348
  addFont(font,) {
46171
46349
  this.bySelector.set(font.selector, font,);
46172
46350
  }
46173
46351
  getAvailableFonts() {
46174
- return Array.from(this.bySelector.values(),);
46352
+ if (!this.bySelectorValuesCache || this.bySelectorValuesCache.hash !== this.bySelector.hash) {
46353
+ this.bySelectorValuesCache = {
46354
+ result: Array.from(this.bySelector.values(),),
46355
+ hash: this.bySelector.hash,
46356
+ };
46357
+ }
46358
+ return this.bySelectorValuesCache.result;
46175
46359
  }
46176
46360
  importLocalFonts() {
46177
46361
  for (const font of this.local.importFonts()) {
@@ -47201,7 +47385,367 @@ var styles3 = /* @__PURE__ */ (() => [
47201
47385
  },),
47202
47386
  ])();
47203
47387
  var FormSelect = /* @__PURE__ */ withCSS(Select, styles3, 'framer-lib-form-select',);
47204
- var Image2 = /* @__PURE__ */ React4.forwardRef(function Image3(props, ref,) {
47388
+ function useEscToClose(isOpen, close,) {
47389
+ useEffect(() => {
47390
+ function handleKeyDown(e,) {
47391
+ if (e.key === 'Escape' && isOpen) {
47392
+ e.preventDefault();
47393
+ e.stopPropagation();
47394
+ close();
47395
+ }
47396
+ }
47397
+ window.addEventListener('keyup', handleKeyDown,);
47398
+ return () => window.removeEventListener('keyup', handleKeyDown,);
47399
+ }, [isOpen, close,],);
47400
+ }
47401
+ var steps2 = [512, 1024, 2048, 4096,];
47402
+ function calculateImageWidth(aspectRatio2, maxWidth, totalHorizontalPadding, totalVerticalPadding,) {
47403
+ const availableHeight = window.innerHeight - totalVerticalPadding;
47404
+ const availableWidth = Math.min(window.innerWidth - totalHorizontalPadding, maxWidth,);
47405
+ const maxWidthBasedOnHeight = availableHeight / aspectRatio2;
47406
+ return Math.min(availableWidth, maxWidthBasedOnHeight,);
47407
+ }
47408
+ function optimisticallyDecodeImage(image, {
47409
+ width,
47410
+ height,
47411
+ },) {
47412
+ if (!image.src || !image.srcSet) return;
47413
+ const i = new window.Image();
47414
+ i.src = image.src;
47415
+ i.srcset = image.srcSet;
47416
+ i.width = width;
47417
+ i.height = height;
47418
+ return i.decode();
47419
+ }
47420
+ function getPortalContainer2() {
47421
+ return document.getElementById(templateOverlayContainerId,) ?? document.getElementById(overlayContainerId,) ?? document.body;
47422
+ }
47423
+ function getSidePadding(value, padding,) {
47424
+ if (isNumber2(value,)) return value;
47425
+ return padding ?? 0;
47426
+ }
47427
+ function getTotalVerticalPadding(lightbox,) {
47428
+ return getSidePadding(lightbox == null ? void 0 : lightbox.paddingTop, lightbox == null ? void 0 : lightbox.padding,) +
47429
+ getSidePadding(lightbox == null ? void 0 : lightbox.paddingBottom, lightbox == null ? void 0 : lightbox.padding,);
47430
+ }
47431
+ function getTotalHorizontalPadding(lightbox,) {
47432
+ return getSidePadding(lightbox == null ? void 0 : lightbox.paddingLeft, lightbox == null ? void 0 : lightbox.padding,) +
47433
+ getSidePadding(lightbox == null ? void 0 : lightbox.paddingRight, lightbox == null ? void 0 : lightbox.padding,);
47434
+ }
47435
+ function useStableCallback(callback,) {
47436
+ const latest = useRef3(callback,);
47437
+ latest.current = callback;
47438
+ return useCallback((...args) => latest.current(...args,), [],);
47439
+ }
47440
+ function createImageWithSrcSet(lightbox, background,) {
47441
+ if (!lightbox || !background || !background.src) return background;
47442
+ const base = new URL(background.src,);
47443
+ base.searchParams.delete('scale-down-to',);
47444
+ base.searchParams.delete('lossless',);
47445
+ return {
47446
+ ...background,
47447
+ sizes: `min(100vw, ${lightbox.maxWidth - getTotalHorizontalPadding(lightbox,)}px)`,
47448
+ // Use all steps since the lightbox can scale up and down with the viewport.
47449
+ srcSet: steps2.map((size) => {
47450
+ const src = new URL(base,);
47451
+ src.searchParams.set('scale-down-to', size.toString(),);
47452
+ return `${src.toString()} ${size}w`;
47453
+ },).join(', ',),
47454
+ };
47455
+ }
47456
+ var distortionTransforms = /* @__PURE__ */ (() => ({
47457
+ x: void 0,
47458
+ y: void 0,
47459
+ z: 0,
47460
+ translateX: void 0,
47461
+ translateY: void 0,
47462
+ translateZ: 0,
47463
+ rotate: void 0,
47464
+ rotateX: 0,
47465
+ rotateY: 0,
47466
+ rotateZ: void 0,
47467
+ scale: 1,
47468
+ scaleX: 1,
47469
+ scaleY: 1,
47470
+ scaleZ: 1,
47471
+ skew: 0,
47472
+ skewX: 0,
47473
+ skewY: 0,
47474
+ originX: void 0,
47475
+ originY: void 0,
47476
+ originZ: void 0,
47477
+ perspective: 0,
47478
+ transformPerspective: 0,
47479
+ }))();
47480
+ function isDistortionTransform(values,) {
47481
+ if (!values) return false;
47482
+ for (const k in values) {
47483
+ if (!(k in distortionTransforms)) continue;
47484
+ const identityValue = distortionTransforms[k];
47485
+ const value = values[k];
47486
+ if (!isNumber2(identityValue,) || !isNumber2(value,)) continue;
47487
+ if (identityValue === value) continue;
47488
+ return true;
47489
+ }
47490
+ return false;
47491
+ }
47492
+ function isDistorted(ref,) {
47493
+ var _a, _b;
47494
+ const element = visualElementStore.get(ref.current,);
47495
+ if (!element) return false;
47496
+ if (isDistortionTransform((_a = element.projection) == null ? void 0 : _a.latestValues,)) return true;
47497
+ const path = (_b = element.projection) == null ? void 0 : _b.path;
47498
+ if (!path || path.length === 0) return false;
47499
+ for (const p of path) {
47500
+ if (isDistortionTransform(p.latestValues,)) return true;
47501
+ }
47502
+ return false;
47503
+ }
47504
+ var enterExitBackdropAnimation = {
47505
+ opacity: 0,
47506
+ };
47507
+ var targetBackdropAnimation = {
47508
+ opacity: 1,
47509
+ };
47510
+ function withLightboxEffect(Component18,) {
47511
+ return forwardRef(function LightboxEffect({
47512
+ lightbox,
47513
+ lightboxClassName,
47514
+ onClick,
47515
+ ...props
47516
+ }, forwardedRef,) {
47517
+ const config = useContext(MotionConfigContext,);
47518
+ const fallbackRef = useRef3(null,);
47519
+ const ref = forwardedRef ?? fallbackRef;
47520
+ const decodePromiseRef = useRef3();
47521
+ const image = useMemo2(() => createImageWithSrcSet(lightbox, props.background,), [lightbox, props.background,],);
47522
+ const [open, setOpen,] = useState(false,);
47523
+ const [openOverrides, setOpenOverrides,] = useState();
47524
+ const onOpen = useCallback(() => {
47525
+ if (!lightbox) return;
47526
+ if (open) {
47527
+ startTransition2(() => {
47528
+ setOpen(true,);
47529
+ },);
47530
+ return;
47531
+ }
47532
+ frame.read(() => {
47533
+ if (!ref.current) return;
47534
+ const style22 = getComputedStyle(ref.current,);
47535
+ const hasBorder = ref.current.getAttribute('data-border',) === 'true';
47536
+ const borderStyle2 = hasBorder ? getComputedStyle(ref.current, '::after',) : void 0;
47537
+ const width = ref.current.offsetWidth ?? 1;
47538
+ const height = ref.current.offsetHeight ?? 1;
47539
+ const transition2 = isDistorted(ref,)
47540
+ ? {
47541
+ duration: 0,
47542
+ }
47543
+ : lightbox.transition;
47544
+ startTransition2(() => {
47545
+ setOpenOverrides({
47546
+ borderRadius: style22.borderRadius,
47547
+ aspectRatio: width / (height || 1),
47548
+ borderTop: borderStyle2 == null ? void 0 : borderStyle2.borderTopWidth,
47549
+ borderRight: borderStyle2 == null ? void 0 : borderStyle2.borderRightWidth,
47550
+ borderBottom: borderStyle2 == null ? void 0 : borderStyle2.borderBottomWidth,
47551
+ borderLeft: borderStyle2 == null ? void 0 : borderStyle2.borderLeftWidth,
47552
+ borderStyle: borderStyle2 == null ? void 0 : borderStyle2.borderStyle,
47553
+ borderColor: borderStyle2 == null ? void 0 : borderStyle2.borderColor,
47554
+ transition: transition2,
47555
+ imageRendering: style22.imageRendering,
47556
+ filter: style22.filter,
47557
+ },);
47558
+ setOpen(true,);
47559
+ },);
47560
+ },);
47561
+ }, [lightbox, open, ref,],);
47562
+ const aspectRatio2 = (openOverrides == null ? void 0 : openOverrides.aspectRatio) ?? 1;
47563
+ const decode = useStableCallback(() => {
47564
+ var _a;
47565
+ if (!lightbox || !image || !image.src) return;
47566
+ const srcDecodePromise = (_a = decodePromiseRef.current) == null ? void 0 : _a[image.src];
47567
+ if (srcDecodePromise) return srcDecodePromise;
47568
+ const width = calculateImageWidth(
47569
+ aspectRatio2,
47570
+ lightbox.maxWidth,
47571
+ getTotalHorizontalPadding(lightbox,),
47572
+ getTotalVerticalPadding(lightbox,),
47573
+ );
47574
+ const promise = optimisticallyDecodeImage(image, {
47575
+ width,
47576
+ height: width * aspectRatio2,
47577
+ },);
47578
+ decodePromiseRef.current = {
47579
+ [image.src]: promise,
47580
+ };
47581
+ return promise;
47582
+ },);
47583
+ const handleClick = useCallback(async (e) => {
47584
+ onClick == null ? void 0 : onClick(e,);
47585
+ if (open || !lightbox || !image) return;
47586
+ await decode();
47587
+ onOpen();
47588
+ }, [onClick, onOpen, open, image, lightbox, decode,],);
47589
+ const onClose = useCallback((e) => {
47590
+ e == null ? void 0 : e.stopPropagation();
47591
+ startTransition2(() => {
47592
+ setOpen(false,);
47593
+ },);
47594
+ }, [],);
47595
+ useEscToClose(open, onClose,);
47596
+ useEffect(() => {
47597
+ if (!lightbox) return;
47598
+ let timer;
47599
+ function enter() {
47600
+ timer = setTimeout(() => {
47601
+ void decode();
47602
+ }, 50,);
47603
+ }
47604
+ function clear() {
47605
+ clearTimeout(timer,);
47606
+ }
47607
+ const currentRef = ref.current;
47608
+ currentRef == null ? void 0 : currentRef.addEventListener('mouseenter', enter,);
47609
+ currentRef == null ? void 0 : currentRef.addEventListener('mouseleave', clear,);
47610
+ currentRef == null ? void 0 : currentRef.addEventListener('pointerdown', decode,);
47611
+ return () => {
47612
+ clear();
47613
+ currentRef == null ? void 0 : currentRef.removeEventListener('mouseenter', enter,);
47614
+ currentRef == null ? void 0 : currentRef.removeEventListener('mouseleave', clear,);
47615
+ currentRef == null ? void 0 : currentRef.removeEventListener('pointerdown', decode,);
47616
+ };
47617
+ }, [decode, ref, lightbox,],);
47618
+ const fallbackLayoutId = useId();
47619
+ const transition = (openOverrides == null ? void 0 : openOverrides.transition) ?? props.transition ?? config.transition;
47620
+ const borderRadius2 = openOverrides == null ? void 0 : openOverrides.borderRadius;
47621
+ const imageRendering = openOverrides == null ? void 0 : openOverrides.imageRendering;
47622
+ const filter2 = openOverrides == null ? void 0 : openOverrides.filter;
47623
+ const borderTop = openOverrides == null ? void 0 : openOverrides.borderTop;
47624
+ const borderRight = openOverrides == null ? void 0 : openOverrides.borderRight;
47625
+ const borderBottom = openOverrides == null ? void 0 : openOverrides.borderBottom;
47626
+ const borderLeft = openOverrides == null ? void 0 : openOverrides.borderLeft;
47627
+ const borderStyle = openOverrides == null ? void 0 : openOverrides.borderStyle;
47628
+ const borderColor = openOverrides == null ? void 0 : openOverrides.borderColor;
47629
+ const hasAnyBorder = Boolean(borderTop || borderRight || borderBottom || borderLeft || borderStyle || borderColor,);
47630
+ const border = hasAnyBorder
47631
+ ? {
47632
+ '--border-top-width': borderTop,
47633
+ '--border-right-width': borderRight,
47634
+ '--border-bottom-width': borderBottom,
47635
+ '--border-left-width': borderLeft,
47636
+ '--border-style': borderStyle,
47637
+ '--border-color': borderColor,
47638
+ }
47639
+ : void 0;
47640
+ const portalProps = {
47641
+ [portalIdAttribute]: props.id,
47642
+ };
47643
+ const paddingTop = getSidePadding(lightbox == null ? void 0 : lightbox.paddingTop, lightbox == null ? void 0 : lightbox.padding,);
47644
+ const paddingBottom = getSidePadding(lightbox == null ? void 0 : lightbox.paddingBottom, lightbox == null ? void 0 : lightbox.padding,);
47645
+ const paddingLeft = getSidePadding(lightbox == null ? void 0 : lightbox.paddingLeft, lightbox == null ? void 0 : lightbox.padding,);
47646
+ const paddingRight = getSidePadding(lightbox == null ? void 0 : lightbox.paddingRight, lightbox == null ? void 0 : lightbox.padding,);
47647
+ const style2 = (openOverrides == null ? void 0 : openOverrides.borderRadius)
47648
+ ? {
47649
+ ...props.style,
47650
+ borderRadius: openOverrides.borderRadius,
47651
+ }
47652
+ : props.style;
47653
+ const layoutDependency = open ? props.layoutDependency ? `${props.layoutDependency}-open` : 'open' : props.layoutDependency;
47654
+ return /* @__PURE__ */ jsxs(Fragment, {
47655
+ children: [
47656
+ /* @__PURE__ */ jsx3(Component18, {
47657
+ ...props,
47658
+ style: style2,
47659
+ onClick: handleClick,
47660
+ layoutId: props.layoutId ?? (lightbox ? fallbackLayoutId : void 0),
47661
+ ref,
47662
+ layoutDependency,
47663
+ transition,
47664
+ },),
47665
+ /* @__PURE__ */ jsx3(AnimatePresence, {
47666
+ children: open && lightbox && image && /* @__PURE__ */ jsx3(Fragment, {
47667
+ children: createPortal(
47668
+ /* @__PURE__ */ jsxs(Fragment, {
47669
+ children: [
47670
+ /* @__PURE__ */ jsx3(motion.div, {
47671
+ ...portalProps,
47672
+ className: lightboxClassName,
47673
+ onClick: onClose,
47674
+ style: {
47675
+ position: 'fixed',
47676
+ inset: 0,
47677
+ zIndex: lightbox.zIndex,
47678
+ backgroundColor: lightbox.backdrop ?? 'transparent',
47679
+ },
47680
+ transition,
47681
+ initial: enterExitBackdropAnimation,
47682
+ animate: targetBackdropAnimation,
47683
+ exit: enterExitBackdropAnimation,
47684
+ onTransitionEnd: () => {
47685
+ startTransition2(() => {
47686
+ setOpenOverrides(void 0,);
47687
+ },);
47688
+ },
47689
+ },),
47690
+ /* @__PURE__ */ jsx3('div', {
47691
+ ...portalProps,
47692
+ className: lightboxClassName,
47693
+ style: {
47694
+ alignItems: 'center',
47695
+ display: 'flex',
47696
+ inset: `${paddingTop}px ${paddingRight}px ${paddingBottom}px ${paddingLeft}px`,
47697
+ justifyContent: 'center',
47698
+ pointerEvents: 'none',
47699
+ position: 'fixed',
47700
+ zIndex: lightbox.zIndex,
47701
+ },
47702
+ children: /* @__PURE__ */ jsx3('div', {
47703
+ style: {
47704
+ alignItems: 'center',
47705
+ aspectRatio: aspectRatio2,
47706
+ display: 'flex',
47707
+ justifyContent: 'center',
47708
+ maxHeight: '100%',
47709
+ position: 'relative',
47710
+ width: '100%',
47711
+ maxWidth: lightbox.maxWidth,
47712
+ },
47713
+ children: /* @__PURE__ */ jsx3(motion.div, {
47714
+ layoutId: props.layoutId ?? fallbackLayoutId,
47715
+ transition,
47716
+ onClick: onOpen,
47717
+ className: 'framer-lightbox-container',
47718
+ 'data-border': hasAnyBorder,
47719
+ style: {
47720
+ aspectRatio: aspectRatio2,
47721
+ borderRadius: borderRadius2,
47722
+ bottom: 0,
47723
+ position: 'absolute',
47724
+ top: 0,
47725
+ userSelect: 'none',
47726
+ imageRendering,
47727
+ filter: filter2,
47728
+ ...border,
47729
+ },
47730
+ children: /* @__PURE__ */ jsx3(BackgroundImageComponent, {
47731
+ image,
47732
+ alt: image.alt,
47733
+ draggable: props.draggable,
47734
+ },),
47735
+ },),
47736
+ },),
47737
+ },),
47738
+ ],
47739
+ },),
47740
+ getPortalContainer2(),
47741
+ ),
47742
+ }, 'backdrop',),
47743
+ },),
47744
+ ],
47745
+ },);
47746
+ },);
47747
+ }
47748
+ var Component16 = /* @__PURE__ */ React4.forwardRef(function Image2(props, ref,) {
47205
47749
  const {
47206
47750
  background,
47207
47751
  children,
@@ -47254,6 +47798,7 @@ var Image2 = /* @__PURE__ */ React4.forwardRef(function Image3(props, ref,) {
47254
47798
  ],
47255
47799
  },);
47256
47800
  },);
47801
+ var Image3 = /* @__PURE__ */ withLightboxEffect(Component16,);
47257
47802
  var frameFromElement = (element) => {
47258
47803
  const frame2 = Rect.fromRect(element.getBoundingClientRect(),);
47259
47804
  frame2.x = frame2.x + safeWindow.scrollX;
@@ -47625,13 +48170,14 @@ var defaultValues2 = {
47625
48170
  function isEffectKey(key7,) {
47626
48171
  return key7 in defaultValues2;
47627
48172
  }
47628
- function createKeyframes(effect,) {
48173
+ function createKeyframes(effect, shouldReduceMotion,) {
47629
48174
  const out = {};
47630
48175
  for (const key7 in effect) {
47631
48176
  if (!isEffectKey(key7,)) continue;
47632
48177
  const effectValue = effect[key7];
47633
48178
  const defaultValue = defaultValues2[key7];
47634
48179
  if (isUndefined(effectValue,) || isUndefined(defaultValue,)) continue;
48180
+ if (shouldReduceMotion && key7 !== 'opacity') continue;
47635
48181
  out[key7] = [effectValue, defaultValue,];
47636
48182
  }
47637
48183
  return out;
@@ -47642,7 +48188,16 @@ var emojiSplitRe = /* @__PURE__ */ (() => {
47642
48188
  'gu',
47643
48189
  );
47644
48190
  })();
47645
- function tokenizeText(text, tokenization = 'character', elements, style2,) {
48191
+ function tokenizeText(text, tokenization = 'character', elements, shouldReduceMotion, style2,) {
48192
+ if (shouldReduceMotion) {
48193
+ const ref = newOverrideableRef();
48194
+ elements.add(ref,);
48195
+ return /* @__PURE__ */ jsx3('span', {
48196
+ ref,
48197
+ style: style2,
48198
+ children: text,
48199
+ },);
48200
+ }
47646
48201
  switch (tokenization) {
47647
48202
  case 'character':
47648
48203
  // When we want to animate "lines" that aren't split by newlines, but
@@ -47728,7 +48283,7 @@ function transformString(effect,) {
47728
48283
  if (isNumber2(effect.skewY,)) transforms.push(`skewY(${effect.skewY}deg)`,);
47729
48284
  return transforms.join(' ',);
47730
48285
  }
47731
- function getInitialEffectStyle(canPlay, canAnimate2, effect,) {
48286
+ function getInitialEffectStyle(canPlay, canAnimate2, effect, shouldReduceMotion,) {
47732
48287
  if (!effect || !effect.effect) return void 0;
47733
48288
  const type = effect.type;
47734
48289
  switch (type) {
@@ -47738,8 +48293,8 @@ function getInitialEffectStyle(canPlay, canAnimate2, effect,) {
47738
48293
  if (!canPlay || !canAnimate2) return void 0;
47739
48294
  return {
47740
48295
  opacity: effect.effect.opacity,
47741
- filter: effect.effect.filter,
47742
- transform: transformString(effect.effect,),
48296
+ filter: shouldReduceMotion ? void 0 : effect.effect.filter,
48297
+ transform: shouldReduceMotion ? void 0 : transformString(effect.effect,),
47743
48298
  };
47744
48299
  case 'line':
47745
48300
  case 'word':
@@ -47753,8 +48308,8 @@ function getInitialEffectStyle(canPlay, canAnimate2, effect,) {
47753
48308
  return {
47754
48309
  display: 'inline-block',
47755
48310
  opacity: effect.effect.opacity,
47756
- filter: effect.effect.filter,
47757
- transform: transformString(effect.effect,),
48311
+ filter: shouldReduceMotion ? void 0 : effect.effect.filter,
48312
+ transform: shouldReduceMotion ? void 0 : transformString(effect.effect,),
47758
48313
  };
47759
48314
  }
47760
48315
  default:
@@ -47765,6 +48320,7 @@ function useTextEffect(config, ref, preview,) {
47765
48320
  const elements = useConstant2(() => /* @__PURE__ */ new Set());
47766
48321
  const isRenderingStaticContent = isStaticRenderer();
47767
48322
  const canPlay = preview || !isRenderingStaticContent;
48323
+ const shouldReduceMotion = useReducedMotionConfig();
47768
48324
  const state = React2.useRef({
47769
48325
  hasMounted: false,
47770
48326
  hasAnimatedOnce: false,
@@ -47801,7 +48357,7 @@ function useTextEffect(config, ref, preview,) {
47801
48357
  const cleanupRef = {
47802
48358
  current: void 0,
47803
48359
  };
47804
- void runAppearEffect(tokenization2, effect.effect, elements, transition, startDelay, repeat, () => {
48360
+ void runAppearEffect(tokenization2, effect.effect, elements, transition, startDelay, repeat, shouldReduceMotion, () => {
47805
48361
  Object.assign(state.current, {
47806
48362
  isAnimating: false,
47807
48363
  },);
@@ -47857,9 +48413,10 @@ function useTextEffect(config, ref, preview,) {
47857
48413
  canPlay,
47858
48414
  preview || mayAnimate(hasMounted, hasAnimatedOnce, effect,),
47859
48415
  state.current.effect,
48416
+ shouldReduceMotion,
47860
48417
  );
47861
48418
  return {
47862
- text: (text) => tokenizeText(text, tokenization, elements, effectStyle,),
48419
+ text: (text) => tokenizeText(text, tokenization, elements, shouldReduceMotion, effectStyle,),
47863
48420
  props: (style2) => {
47864
48421
  if ((effect == null ? void 0 : effect.tokenization) !== 'element') return void 0;
47865
48422
  const r = newOverrideableRef();
@@ -47886,7 +48443,7 @@ function useTextEffect(config, ref, preview,) {
47886
48443
  transition,
47887
48444
  startDelay,
47888
48445
  } = effect;
47889
- void runAppearEffect(tokenization, effect.effect, elements, transition, startDelay,);
48446
+ void runAppearEffect(tokenization, effect.effect, elements, transition, startDelay, false, shouldReduceMotion,);
47890
48447
  break;
47891
48448
  }
47892
48449
  default:
@@ -47914,10 +48471,11 @@ async function runAppearEffect(
47914
48471
  transition,
47915
48472
  startDelay = 0,
47916
48473
  repeat = false,
48474
+ shouldReduceMotion,
47917
48475
  callback,
47918
48476
  cleanupRef,
47919
48477
  ) {
47920
- const enter = createKeyframes(effect,);
48478
+ const enter = createKeyframes(effect, shouldReduceMotion,);
47921
48479
  const controller = new AbortController();
47922
48480
  if (cleanupRef) cleanupRef.current = () => controller.abort();
47923
48481
  switch (tokenization) {
@@ -47934,14 +48492,20 @@ async function runAppearEffect(
47934
48492
  },),
47935
48493
  },).then(() => callback == null ? void 0 : callback());
47936
48494
  if (!repeat || !cleanupRef) return;
47937
- cleanupRef.current = () =>
47938
- void animate(list, effect, {
48495
+ cleanupRef.current = () => {
48496
+ const actualEffect = shouldReduceMotion
48497
+ ? {
48498
+ opacity: effect.opacity,
48499
+ }
48500
+ : effect;
48501
+ void animate(list, actualEffect, {
47939
48502
  ...transition,
47940
48503
  restDelta: 1e-3,
47941
48504
  delay: stagger((transition == null ? void 0 : transition.delay) ?? 0, {
47942
48505
  startDelay,
47943
48506
  },),
47944
48507
  },);
48508
+ };
47945
48509
  return;
47946
48510
  }
47947
48511
  case 'line': {
@@ -47974,8 +48538,13 @@ async function runAppearEffect(
47974
48538
  if (!repeat || !cleanupRef) return;
47975
48539
  cleanupRef.current = () => {
47976
48540
  if (list.length === 0) return;
48541
+ const actualEffect = shouldReduceMotion
48542
+ ? {
48543
+ opacity: effect.opacity,
48544
+ }
48545
+ : effect;
47977
48546
  list.forEach((group, i,) => {
47978
- void animate(group, effect, {
48547
+ void animate(group, actualEffect, {
47979
48548
  ...transition,
47980
48549
  restDelta: 1e-3,
47981
48550
  delay: startDelay + i * ((transition == null ? void 0 : transition.delay) ?? 0),
@@ -48115,13 +48684,12 @@ var RichTextContainer = /* @__PURE__ */ forwardRef(function RichTextContainer2(p
48115
48684
  if (!visible) return null;
48116
48685
  const isHidden = isEditable && environment2() === RenderTarget.canvas;
48117
48686
  const containerStyle = {
48118
- outline: 'none',
48119
- display: 'flex',
48120
- flexDirection: 'column',
48121
- justifyContent: convertVerticalAlignment(verticalAlignment,),
48122
48687
  opacity: isHidden ? 0 : opacity,
48123
- flexShrink: 0,
48124
48688
  };
48689
+ const justifyContent = convertVerticalAlignment(verticalAlignment,);
48690
+ if (justifyContent !== defaultRichTextContainerStyle.justifyContent) {
48691
+ containerStyle.justifyContent = justifyContent;
48692
+ }
48125
48693
  const positionStyle = {};
48126
48694
  const restrictedRenderTarget = RenderTarget.hasRestrictions();
48127
48695
  const frame2 = calculateRect(props, parentSize || 0, false,);
@@ -48165,11 +48733,11 @@ var RichTextContainer = /* @__PURE__ */ forwardRef(function RichTextContainer2(p
48165
48733
  if (layoutId) {
48166
48734
  rest.layout = 'preserve-aspect';
48167
48735
  }
48168
- const Component17 = htmlElementAsMotionComponent(props.as,);
48736
+ const Component18 = htmlElementAsMotionComponent(props.as,);
48169
48737
  const dataFramerName = rest['data-framer-name'] ?? name;
48170
48738
  if (isString(props.viewBox,)) {
48171
48739
  if (props.as !== void 0) {
48172
- return /* @__PURE__ */ jsx3(Component17, {
48740
+ return /* @__PURE__ */ jsx3(Component18, {
48173
48741
  ...rest,
48174
48742
  ref: containerRef,
48175
48743
  style: containerStyle,
@@ -48202,7 +48770,7 @@ var RichTextContainer = /* @__PURE__ */ forwardRef(function RichTextContainer2(p
48202
48770
  },);
48203
48771
  }
48204
48772
  }
48205
- return /* @__PURE__ */ jsx3(Component17, {
48773
+ return /* @__PURE__ */ jsx3(Component18, {
48206
48774
  ...rest,
48207
48775
  ref: containerRef,
48208
48776
  style: containerStyle,
@@ -50693,10 +51261,13 @@ function initialRouteComponent(component,) {
50693
51261
  function useInitialRouteComponent(routes, homeNodeId,) {
50694
51262
  var _a;
50695
51263
  const InitialRouteComponent = (_a = routes[homeNodeId]) == null ? void 0 : _a.page;
50696
- const [RouteComponent, setRouteComponent,] = useState(initialRouteComponent(InitialRouteComponent,),);
51264
+ const [RouteComponent, setRouteComponent,] = useState(() => initialRouteComponent(InitialRouteComponent,));
50697
51265
  useEffect(() => {
50698
51266
  if (withPreload(InitialRouteComponent,)) {
50699
- void InitialRouteComponent.preload().then(setRouteComponent,);
51267
+ void (async () => {
51268
+ await InitialRouteComponent.preload();
51269
+ setRouteComponent(InitialRouteComponent,);
51270
+ })();
50700
51271
  }
50701
51272
  }, [],);
50702
51273
  return RouteComponent;
@@ -50733,7 +51304,7 @@ var package_default = {
50733
51304
  '@types/dom-navigation': '^1.0.5',
50734
51305
  '@types/fontfaceobserver': '2.1',
50735
51306
  '@types/google.fonts': '1.0',
50736
- '@types/node': '22.17',
51307
+ '@types/node': '22.18',
50737
51308
  '@types/react': '18.2',
50738
51309
  '@types/react-dom': '18.2',
50739
51310
  '@types/yargs': '^17.0.33',
@@ -50747,7 +51318,6 @@ var package_default = {
50747
51318
  'jest-diff': '^29.3.1',
50748
51319
  'jest-environment-jsdom': '^29.3.1',
50749
51320
  'jest-environment-jsdom-global': '^4.0.0',
50750
- 'jest-junit': '^15.0.0',
50751
51321
  react: '^18.2.0',
50752
51322
  'react-dom': '^18.2.0',
50753
51323
  semver: '^7.7.1',
@@ -50755,7 +51325,7 @@ var package_default = {
50755
51325
  yargs: '^17.7.2',
50756
51326
  },
50757
51327
  peerDependencies: {
50758
- 'framer-motion': '>=12.14.0',
51328
+ 'framer-motion': '12.20.2',
50759
51329
  react: '^18.2.0',
50760
51330
  'react-dom': '^18.2.0',
50761
51331
  },
@@ -50859,6 +51429,7 @@ export {
50859
51429
  createRendererMotionComponent,
50860
51430
  createScopedAnimate,
50861
51431
  cssBackgroundSize,
51432
+ cssCollector,
50862
51433
  cubicBezier,
50863
51434
  cubicBezierAsString,
50864
51435
  CustomCursorHost,
@@ -50970,7 +51541,7 @@ export {
50970
51541
  hover,
50971
51542
  hsla,
50972
51543
  hslaToRgba,
50973
- Image2 as Image,
51544
+ Image3 as Image,
50974
51545
  imagePatternPropsForFill,
50975
51546
  imageUrlForAsset,
50976
51547
  inertia,
@@ -51125,6 +51696,7 @@ export {
51125
51696
  removeHiddenBreakpointLayersV2,
51126
51697
  removeItem,
51127
51698
  RenderTarget,
51699
+ ResetOuterLinkContext,
51128
51700
  resize,
51129
51701
  resolveElements,
51130
51702
  resolveLink,
@@ -51251,6 +51823,7 @@ export {
51251
51823
  useOnVariantChange,
51252
51824
  useOverlayState,
51253
51825
  usePageEffects,
51826
+ usePageInView,
51254
51827
  usePrefetch,
51255
51828
  usePreloadQuery,
51256
51829
  usePresence,