{"version":3,"file":"hero-section-BVH6j_gn.js","sources":["../../../node_modules/@sentry/remix/esm/utils/vendor/response.js","../../../node_modules/@sentry/remix/esm/client/errors.js","../../../node_modules/clsx/dist/clsx.mjs","../../../node_modules/framer-motion/dist/es/context/MotionConfigContext.mjs","../../../node_modules/framer-motion/dist/es/context/MotionContext/index.mjs","../../../node_modules/framer-motion/dist/es/context/PresenceContext.mjs","../../../node_modules/framer-motion/dist/es/utils/is-browser.mjs","../../../node_modules/framer-motion/dist/es/utils/use-isomorphic-effect.mjs","../../../node_modules/framer-motion/dist/es/context/LazyContext.mjs","../../../node_modules/framer-motion/dist/es/render/dom/utils/camel-to-dash.mjs","../../../node_modules/framer-motion/dist/es/animation/optimized-appear/data-id.mjs","../../../node_modules/framer-motion/dist/es/utils/GlobalConfig.mjs","../../../node_modules/framer-motion/dist/es/frameloop/render-step.mjs","../../../node_modules/framer-motion/dist/es/frameloop/batcher.mjs","../../../node_modules/framer-motion/dist/es/frameloop/microtask.mjs","../../../node_modules/framer-motion/dist/es/motion/utils/use-visual-element.mjs","../../../node_modules/framer-motion/dist/es/utils/is-ref-object.mjs","../../../node_modules/framer-motion/dist/es/motion/utils/use-motion-ref.mjs","../../../node_modules/framer-motion/dist/es/render/utils/is-variant-label.mjs","../../../node_modules/framer-motion/dist/es/animation/utils/is-animation-controls.mjs","../../../node_modules/framer-motion/dist/es/render/utils/variant-props.mjs","../../../node_modules/framer-motion/dist/es/render/utils/is-controlling-variants.mjs","../../../node_modules/framer-motion/dist/es/context/MotionContext/utils.mjs","../../../node_modules/framer-motion/dist/es/context/MotionContext/create.mjs","../../../node_modules/framer-motion/dist/es/motion/features/definitions.mjs","../../../node_modules/framer-motion/dist/es/motion/features/load-features.mjs","../../../node_modules/framer-motion/dist/es/context/LayoutGroupContext.mjs","../../../node_modules/framer-motion/dist/es/context/SwitchLayoutGroupContext.mjs","../../../node_modules/framer-motion/dist/es/motion/utils/symbol.mjs","../../../node_modules/framer-motion/dist/es/motion/index.mjs","../../../node_modules/framer-motion/dist/es/render/dom/motion-proxy.mjs","../../../node_modules/framer-motion/dist/es/render/svg/lowercase-elements.mjs","../../../node_modules/framer-motion/dist/es/render/dom/utils/is-svg-component.mjs","../../../node_modules/framer-motion/dist/es/projection/styles/scale-correction.mjs","../../../node_modules/framer-motion/dist/es/render/html/utils/transform.mjs","../../../node_modules/framer-motion/dist/es/motion/utils/is-forced-motion-value.mjs","../../../node_modules/framer-motion/dist/es/value/utils/is-motion-value.mjs","../../../node_modules/framer-motion/dist/es/render/html/utils/build-transform.mjs","../../../node_modules/framer-motion/dist/es/render/dom/utils/is-css-variable.mjs","../../../node_modules/framer-motion/dist/es/render/dom/value-types/get-as-type.mjs","../../../node_modules/framer-motion/dist/es/utils/clamp.mjs","../../../node_modules/framer-motion/dist/es/value/types/numbers/index.mjs","../../../node_modules/framer-motion/dist/es/value/types/utils.mjs","../../../node_modules/framer-motion/dist/es/value/types/numbers/units.mjs","../../../node_modules/framer-motion/dist/es/render/dom/value-types/type-int.mjs","../../../node_modules/framer-motion/dist/es/render/dom/value-types/number.mjs","../../../node_modules/framer-motion/dist/es/render/html/utils/build-styles.mjs","../../../node_modules/framer-motion/dist/es/render/html/utils/create-render-state.mjs","../../../node_modules/framer-motion/dist/es/render/html/use-props.mjs","../../../node_modules/framer-motion/dist/es/motion/utils/valid-prop.mjs","../../../node_modules/framer-motion/dist/es/render/dom/utils/filter-props.mjs","../../../node_modules/framer-motion/dist/es/render/svg/utils/transform-origin.mjs","../../../node_modules/framer-motion/dist/es/render/svg/utils/path.mjs","../../../node_modules/framer-motion/dist/es/render/svg/utils/build-attrs.mjs","../../../node_modules/framer-motion/dist/es/render/svg/utils/create-render-state.mjs","../../../node_modules/framer-motion/dist/es/render/svg/utils/is-svg-tag.mjs","../../../node_modules/framer-motion/dist/es/render/svg/use-props.mjs","../../../node_modules/framer-motion/dist/es/render/dom/use-render.mjs","../../../node_modules/framer-motion/dist/es/render/html/utils/render.mjs","../../../node_modules/framer-motion/dist/es/render/svg/utils/camel-case-attrs.mjs","../../../node_modules/framer-motion/dist/es/render/svg/utils/render.mjs","../../../node_modules/framer-motion/dist/es/render/html/utils/scrape-motion-values.mjs","../../../node_modules/framer-motion/dist/es/render/svg/utils/scrape-motion-values.mjs","../../../node_modules/framer-motion/dist/es/render/utils/resolve-variants.mjs","../../../node_modules/framer-motion/dist/es/utils/use-constant.mjs","../../../node_modules/framer-motion/dist/es/animation/utils/is-keyframes-target.mjs","../../../node_modules/framer-motion/dist/es/utils/resolve-value.mjs","../../../node_modules/framer-motion/dist/es/value/utils/resolve-motion-value.mjs","../../../node_modules/framer-motion/dist/es/motion/utils/use-visual-state.mjs","../../../node_modules/framer-motion/dist/es/utils/noop.mjs","../../../node_modules/framer-motion/dist/es/frameloop/frame.mjs","../../../node_modules/framer-motion/dist/es/render/svg/config-motion.mjs","../../../node_modules/framer-motion/dist/es/render/html/config-motion.mjs","../../../node_modules/framer-motion/dist/es/render/dom/utils/create-config.mjs","../../../node_modules/framer-motion/dist/es/events/add-dom-event.mjs","../../../node_modules/framer-motion/dist/es/events/utils/is-primary-pointer.mjs","../../../node_modules/framer-motion/dist/es/events/event-info.mjs","../../../node_modules/framer-motion/dist/es/events/add-pointer-event.mjs","../../../node_modules/framer-motion/dist/es/utils/pipe.mjs","../../../node_modules/framer-motion/dist/es/gestures/drag/utils/lock.mjs","../../../node_modules/framer-motion/dist/es/motion/features/Feature.mjs","../../../node_modules/framer-motion/dist/es/gestures/hover.mjs","../../../node_modules/framer-motion/dist/es/gestures/focus.mjs","../../../node_modules/framer-motion/dist/es/gestures/utils/is-node-or-child.mjs","../../../node_modules/framer-motion/dist/es/gestures/press.mjs","../../../node_modules/framer-motion/dist/es/motion/features/viewport/observers.mjs","../../../node_modules/framer-motion/dist/es/motion/features/viewport/index.mjs","../../../node_modules/framer-motion/dist/es/motion/features/gestures.mjs","../../../node_modules/framer-motion/dist/es/utils/shallow-compare.mjs","../../../node_modules/framer-motion/dist/es/render/utils/resolve-dynamic-variants.mjs","../../../node_modules/framer-motion/dist/es/utils/time-conversion.mjs","../../../node_modules/framer-motion/dist/es/animation/utils/default-transitions.mjs","../../../node_modules/framer-motion/dist/es/animation/utils/transitions.mjs","../../../node_modules/framer-motion/dist/es/animation/animators/waapi/utils/get-final-keyframe.mjs","../../../node_modules/framer-motion/dist/es/frameloop/sync-time.mjs","../../../node_modules/framer-motion/dist/es/utils/is-zero-value-string.mjs","../../../node_modules/framer-motion/dist/es/animation/utils/is-none.mjs","../../../node_modules/framer-motion/dist/es/utils/errors.mjs","../../../node_modules/framer-motion/dist/es/utils/is-numerical-string.mjs","../../../node_modules/framer-motion/dist/es/render/dom/utils/css-variables-conversion.mjs","../../../node_modules/framer-motion/dist/es/render/dom/utils/unit-conversion.mjs","../../../node_modules/framer-motion/dist/es/render/dom/value-types/test.mjs","../../../node_modules/framer-motion/dist/es/render/dom/value-types/type-auto.mjs","../../../node_modules/framer-motion/dist/es/render/dom/value-types/dimensions.mjs","../../../node_modules/framer-motion/dist/es/render/utils/KeyframesResolver.mjs","../../../node_modules/framer-motion/dist/es/value/types/color/utils.mjs","../../../node_modules/framer-motion/dist/es/value/types/color/rgba.mjs","../../../node_modules/framer-motion/dist/es/value/types/color/hex.mjs","../../../node_modules/framer-motion/dist/es/value/types/color/hsla.mjs","../../../node_modules/framer-motion/dist/es/value/types/color/index.mjs","../../../node_modules/framer-motion/dist/es/value/types/complex/index.mjs","../../../node_modules/framer-motion/dist/es/value/types/complex/filter.mjs","../../../node_modules/framer-motion/dist/es/render/dom/value-types/defaults.mjs","../../../node_modules/framer-motion/dist/es/render/dom/value-types/animatable-none.mjs","../../../node_modules/framer-motion/dist/es/render/html/utils/make-none-animatable.mjs","../../../node_modules/framer-motion/dist/es/render/dom/DOMKeyframesResolver.mjs","../../../node_modules/framer-motion/dist/es/utils/memo.mjs","../../../node_modules/framer-motion/dist/es/animation/utils/is-animatable.mjs","../../../node_modules/framer-motion/dist/es/animation/animators/utils/can-animate.mjs","../../../node_modules/framer-motion/dist/es/animation/animators/BaseAnimation.mjs","../../../node_modules/framer-motion/dist/es/utils/velocity-per-second.mjs","../../../node_modules/framer-motion/dist/es/animation/generators/utils/velocity.mjs","../../../node_modules/framer-motion/dist/es/animation/generators/spring/find.mjs","../../../node_modules/framer-motion/dist/es/animation/generators/spring/index.mjs","../../../node_modules/framer-motion/dist/es/animation/generators/inertia.mjs","../../../node_modules/framer-motion/dist/es/easing/cubic-bezier.mjs","../../../node_modules/framer-motion/dist/es/easing/ease.mjs","../../../node_modules/framer-motion/dist/es/easing/utils/is-easing-array.mjs","../../../node_modules/framer-motion/dist/es/easing/modifiers/mirror.mjs","../../../node_modules/framer-motion/dist/es/easing/modifiers/reverse.mjs","../../../node_modules/framer-motion/dist/es/easing/circ.mjs","../../../node_modules/framer-motion/dist/es/easing/back.mjs","../../../node_modules/framer-motion/dist/es/easing/anticipate.mjs","../../../node_modules/framer-motion/dist/es/easing/utils/map.mjs","../../../node_modules/framer-motion/dist/es/utils/progress.mjs","../../../node_modules/framer-motion/dist/es/utils/mix/number.mjs","../../../node_modules/framer-motion/dist/es/utils/hsla-to-rgba.mjs","../../../node_modules/framer-motion/dist/es/utils/mix/immediate.mjs","../../../node_modules/framer-motion/dist/es/utils/mix/color.mjs","../../../node_modules/framer-motion/dist/es/utils/mix/visibility.mjs","../../../node_modules/framer-motion/dist/es/utils/mix/complex.mjs","../../../node_modules/framer-motion/dist/es/utils/mix/index.mjs","../../../node_modules/framer-motion/dist/es/utils/interpolate.mjs","../../../node_modules/framer-motion/dist/es/utils/offsets/fill.mjs","../../../node_modules/framer-motion/dist/es/utils/offsets/default.mjs","../../../node_modules/framer-motion/dist/es/utils/offsets/time.mjs","../../../node_modules/framer-motion/dist/es/animation/generators/keyframes.mjs","../../../node_modules/framer-motion/dist/es/animation/generators/utils/calc-duration.mjs","../../../node_modules/framer-motion/dist/es/animation/animators/drivers/driver-frameloop.mjs","../../../node_modules/framer-motion/dist/es/animation/animators/MainThreadAnimation.mjs","../../../node_modules/framer-motion/dist/es/easing/utils/is-bezier-definition.mjs","../../../node_modules/framer-motion/dist/es/animation/animators/waapi/easing.mjs","../../../node_modules/framer-motion/dist/es/animation/animators/waapi/index.mjs","../../../node_modules/framer-motion/dist/es/animation/animators/AcceleratedAnimation.mjs","../../../node_modules/framer-motion/dist/es/render/dom/scroll/observe.mjs","../../../node_modules/framer-motion/dist/es/render/dom/scroll/supports.mjs","../../../node_modules/framer-motion/dist/es/animation/GroupPlaybackControls.mjs","../../../node_modules/framer-motion/dist/es/animation/interfaces/motion-value.mjs","../../../node_modules/framer-motion/dist/es/value/use-will-change/is.mjs","../../../node_modules/framer-motion/dist/es/utils/array.mjs","../../../node_modules/framer-motion/dist/es/utils/subscription-manager.mjs","../../../node_modules/framer-motion/dist/es/value/index.mjs","../../../node_modules/framer-motion/dist/es/render/utils/setters.mjs","../../../node_modules/framer-motion/dist/es/animation/optimized-appear/get-appear-id.mjs","../../../node_modules/framer-motion/dist/es/animation/interfaces/visual-element-target.mjs","../../../node_modules/framer-motion/dist/es/animation/interfaces/visual-element-variant.mjs","../../../node_modules/framer-motion/dist/es/animation/interfaces/visual-element.mjs","../../../node_modules/framer-motion/dist/es/render/utils/animation-state.mjs","../../../node_modules/framer-motion/dist/es/motion/features/animation/index.mjs","../../../node_modules/framer-motion/dist/es/motion/features/animation/exit.mjs","../../../node_modules/framer-motion/dist/es/motion/features/animations.mjs","../../../node_modules/framer-motion/dist/es/utils/distance.mjs","../../../node_modules/framer-motion/dist/es/gestures/pan/PanSession.mjs","../../../node_modules/framer-motion/dist/es/projection/geometry/delta-calc.mjs","../../../node_modules/framer-motion/dist/es/gestures/drag/utils/constraints.mjs","../../../node_modules/framer-motion/dist/es/projection/geometry/models.mjs","../../../node_modules/framer-motion/dist/es/projection/utils/each-axis.mjs","../../../node_modules/framer-motion/dist/es/projection/geometry/conversion.mjs","../../../node_modules/framer-motion/dist/es/projection/utils/has-transform.mjs","../../../node_modules/framer-motion/dist/es/projection/geometry/delta-apply.mjs","../../../node_modules/framer-motion/dist/es/projection/utils/measure.mjs","../../../node_modules/framer-motion/dist/es/utils/get-context-window.mjs","../../../node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.mjs","../../../node_modules/framer-motion/dist/es/gestures/drag/index.mjs","../../../node_modules/framer-motion/dist/es/gestures/pan/index.mjs","../../../node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence.mjs","../../../node_modules/framer-motion/dist/es/projection/node/state.mjs","../../../node_modules/framer-motion/dist/es/projection/styles/scale-border-radius.mjs","../../../node_modules/framer-motion/dist/es/projection/styles/scale-box-shadow.mjs","../../../node_modules/framer-motion/dist/es/motion/features/layout/MeasureLayout.mjs","../../../node_modules/framer-motion/dist/es/projection/animation/mix-values.mjs","../../../node_modules/framer-motion/dist/es/projection/geometry/copy.mjs","../../../node_modules/framer-motion/dist/es/projection/geometry/delta-remove.mjs","../../../node_modules/framer-motion/dist/es/projection/geometry/utils.mjs","../../../node_modules/framer-motion/dist/es/projection/shared/stack.mjs","../../../node_modules/framer-motion/dist/es/projection/styles/transform.mjs","../../../node_modules/framer-motion/dist/es/render/utils/compare-by-depth.mjs","../../../node_modules/framer-motion/dist/es/render/utils/flat-tree.mjs","../../../node_modules/framer-motion/dist/es/utils/delay.mjs","../../../node_modules/framer-motion/dist/es/debug/record.mjs","../../../node_modules/framer-motion/dist/es/render/dom/utils/is-svg-element.mjs","../../../node_modules/framer-motion/dist/es/animation/interfaces/single-value.mjs","../../../node_modules/framer-motion/dist/es/projection/node/create-projection-node.mjs","../../../node_modules/framer-motion/dist/es/projection/node/DocumentProjectionNode.mjs","../../../node_modules/framer-motion/dist/es/projection/node/HTMLProjectionNode.mjs","../../../node_modules/framer-motion/dist/es/motion/features/drag.mjs","../../../node_modules/framer-motion/dist/es/utils/reduced-motion/state.mjs","../../../node_modules/framer-motion/dist/es/utils/reduced-motion/index.mjs","../../../node_modules/framer-motion/dist/es/render/utils/motion-values.mjs","../../../node_modules/framer-motion/dist/es/render/store.mjs","../../../node_modules/framer-motion/dist/es/render/dom/value-types/find.mjs","../../../node_modules/framer-motion/dist/es/render/VisualElement.mjs","../../../node_modules/framer-motion/dist/es/render/dom/DOMVisualElement.mjs","../../../node_modules/framer-motion/dist/es/render/html/HTMLVisualElement.mjs","../../../node_modules/framer-motion/dist/es/render/svg/SVGVisualElement.mjs","../../../node_modules/framer-motion/dist/es/render/dom/create-visual-element.mjs","../../../node_modules/framer-motion/dist/es/motion/features/layout.mjs","../../../node_modules/framer-motion/dist/es/render/dom/motion.mjs","../../../node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion.mjs","../../../app/components/hooks/use-element-state.tsx","../../../app/components/icons.tsx","../../../app/components/typography.tsx","../../../app/components/arrow-button.tsx","../../../node_modules/@cld-apis/utils/dist/esm/constants/condition.js","../../../node_modules/@cld-apis/utils/dist/esm/constants/delivery.js","../../../node_modules/@cld-apis/utils/dist/esm/constants/variable.js","../../../node_modules/cloudinary-build-url/dist/esm/constants/index.js","../../../node_modules/cloudinary-build-url/dist/esm/constants/arithmetic.js","../../../node_modules/cloudinary-build-url/dist/esm/constants/condition.js","../../../node_modules/cloudinary-build-url/dist/esm/utils.js","../../../node_modules/cloudinary-build-url/dist/esm/transformers/condition.js","../../../node_modules/cloudinary-build-url/dist/esm/transformers/effect.js","../../../node_modules/cloudinary-build-url/dist/esm/constants/variable.js","../../../node_modules/cloudinary-build-url/dist/esm/transformers/expression.js","../../../node_modules/cloudinary-build-url/dist/esm/transformers/flags.js","../../../node_modules/cloudinary-build-url/dist/esm/transformers/rawTransformation.js","../../../node_modules/cloudinary-build-url/dist/esm/transformers/variables.js","../../../node_modules/cloudinary-build-url/dist/esm/transformers/video/fps.js","../../../node_modules/cloudinary-build-url/dist/esm/transformers/video/offset.js","../../../node_modules/cloudinary-build-url/dist/esm/transformers/resize.js","../../../node_modules/cloudinary-build-url/dist/esm/transformers/border.js","../../../node_modules/cloudinary-build-url/dist/esm/transformers/position.js","../../../node_modules/cloudinary-build-url/dist/esm/transformers/index.js","../../../node_modules/cloudinary-build-url/dist/esm/url.js","../../../node_modules/cloudinary-build-url/dist/esm/index.js","../../../node_modules/emoji-regex/index.mjs","../../../node_modules/md5-hash/dist/index.js","../../../app/utils/misc.tsx","../../../node_modules/@cloudinary/url-gen/config/BaseConfig.js","../../../node_modules/@cloudinary/url-gen/internal/internalConstants.js","../../../node_modules/@cloudinary/url-gen/config/URLConfig.js","../../../node_modules/@cloudinary/transformation-builder-sdk/internal/qualifier/QualifierValue.js","../../../node_modules/@cloudinary/transformation-builder-sdk/internal/utils/unsupportedError.js","../../../node_modules/@cloudinary/transformation-builder-sdk/internal/models/qualifierToJson.js","../../../node_modules/@cloudinary/transformation-builder-sdk/internal/models/QualifierModel.js","../../../node_modules/@cloudinary/transformation-builder-sdk/internal/qualifier/Qualifier.js","../../../node_modules/@cloudinary/transformation-builder-sdk/qualifiers/flag/FlagQualifier.js","../../../node_modules/@cloudinary/transformation-builder-sdk/internal/utils/dataStructureUtils.js","../../../node_modules/@cloudinary/transformation-builder-sdk/internal/models/actionToJson.js","../../../node_modules/@cloudinary/transformation-builder-sdk/internal/models/ActionModel.js","../../../node_modules/@cloudinary/transformation-builder-sdk/internal/Action.js","../../../node_modules/@cloudinary/transformation-builder-sdk/internal/utils/prepareColor.js","../../../node_modules/@cloudinary/transformation-builder-sdk/actions/background/actions/BackgroundColor.js","../../../node_modules/@cloudinary/transformation-builder-sdk/internal/RawAction.js","../../../node_modules/@cloudinary/transformation-builder-sdk/internal/models/IErrorObject.js","../../../node_modules/@cloudinary/transformation-builder-sdk/qualifiers/flag.js","../../../node_modules/@cloudinary/transformation-builder-sdk/qualifiers/format/FormatQualifier.js","../../../node_modules/@cloudinary/transformation-builder-sdk/internal/utils/objectFlip.js","../../../node_modules/@cloudinary/transformation-builder-sdk/internal/internalConstants.js","../../../node_modules/@cloudinary/transformation-builder-sdk/actions/delivery/DeliveryAction.js","../../../node_modules/@cloudinary/transformation-builder-sdk/qualifiers/progressive.js","../../../node_modules/@cloudinary/transformation-builder-sdk/actions/delivery/DeliveryFormatAction.js","../../../node_modules/@cloudinary/transformation-builder-sdk/transformation/Transformation.js","../../../node_modules/@cloudinary/transformation-builder-sdk/transformation/ImageTransformation.js","../../../node_modules/@cloudinary/transformation-builder-sdk/transformation/VideoTransformation.js","../../../node_modules/@cloudinary/url-gen/internal/url/urlUtils/isUrl.js","../../../node_modules/@cloudinary/url-gen/internal/url/urlUtils/isFileName.js","../../../node_modules/@cloudinary/url-gen/internal/url/urlUtils/publicIDContainsVersion.js","../../../node_modules/@cloudinary/url-gen/internal/url/cloudinaryURL.js","../../../node_modules/@cloudinary/url-gen/sdkAnalytics/stringPad.js","../../../node_modules/@cloudinary/url-gen/sdkAnalytics/base64Map.js","../../../node_modules/@cloudinary/url-gen/sdkAnalytics/reverseVersion.js","../../../node_modules/@cloudinary/url-gen/sdkAnalytics/padVersion.js","../../../node_modules/@cloudinary/url-gen/sdkAnalytics/encodeVersion.js","../../../node_modules/@cloudinary/url-gen/sdkAnalytics/getAnalyticsOptions.js","../../../node_modules/@cloudinary/url-gen/internal/utils/packageVersion.js","../../../node_modules/@cloudinary/url-gen/sdkAnalytics/encodeOSVersion.js","../../../node_modules/@cloudinary/url-gen/sdkAnalytics/getSDKAnalyticsSignature.js","../../../node_modules/@cloudinary/url-gen/assets/CloudinaryFile.js","../../../node_modules/@cloudinary/url-gen/assets/CloudinaryTransformable.js","../../../node_modules/@cloudinary/url-gen/assets/CloudinaryImage.js","../../../node_modules/@cloudinary/url-gen/assets/CloudinaryVideo.js","../../../node_modules/@cloudinary/url-gen/instance/Cloudinary.js","../../../app/images.tsx","../../../app/components/grid.tsx","../../../app/utils/animations.ts","../../../app/components/sections/hero-section.tsx"],"sourcesContent":["import { _optionalChain } from '@sentry/utils';\nimport { matchRoutes } from '@remix-run/router';\n\n/**\n * Based on Remix Implementation\n *\n * https://github.com/remix-run/remix/blob/7688da5c75190a2e29496c78721456d6e12e3abe/packages/remix-server-runtime/data.ts#L131-L145\n */\nasync function extractData(response) {\n const contentType = response.headers.get('Content-Type');\n\n // Cloning the response to avoid consuming the original body stream\n const responseClone = response.clone();\n\n if (contentType && /\\bapplication\\/json\\b/.test(contentType)) {\n return responseClone.json();\n }\n\n return responseClone.text();\n}\n\n/**\n * Taken from Remix Implementation\n *\n * https://github.com/remix-run/remix/blob/32300ec6e6e8025602cea63e17a2201989589eab/packages/remix-server-runtime/responses.ts#L60-L77\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction isResponse(value) {\n return (\n value != null &&\n /* eslint-disable @typescript-eslint/no-unsafe-member-access */\n typeof value.status === 'number' &&\n typeof value.statusText === 'string' &&\n typeof value.headers === 'object' &&\n typeof value.body !== 'undefined'\n /* eslint-enable @typescript-eslint/no-unsafe-member-access */\n );\n}\n\n// https://github.com/remix-run/remix/blob/7688da5c75190a2e29496c78721456d6e12e3abe/packages/remix-server-runtime/responses.ts#L1-L4\n\n/**\n * This is a shortcut for creating `application/json` responses. Converts `data`\n * to JSON and sets the `Content-Type` header.\n *\n * @see https://remix.run/api/remix#json\n *\n * https://github.com/remix-run/remix/blob/7688da5c75190a2e29496c78721456d6e12e3abe/packages/remix-server-runtime/responses.ts#L12-L24\n */\nconst json = (data, init = {}) => {\n const responseInit = typeof init === 'number' ? { status: init } : init;\n const headers = new Headers(responseInit.headers);\n if (!headers.has('Content-Type')) {\n headers.set('Content-Type', 'application/json; charset=utf-8');\n }\n return new Response(JSON.stringify(data), {\n ...responseInit,\n headers,\n });\n};\n\n/**\n * Remix Implementation:\n * https://github.com/remix-run/remix/blob/38e127b1d97485900b9c220d93503de0deb1fc81/packages/remix-server-runtime/routeMatching.ts#L12-L24\n *\n * Changed so that `matchRoutes` function is passed in.\n */\nfunction matchServerRoutes(\n routes,\n pathname,\n) {\n const matches = matchRoutes(routes, pathname);\n\n if (!matches) {\n return null;\n }\n\n return matches.map(match => ({\n params: match.params,\n pathname: match.pathname,\n route: match.route,\n pathnameBase: match.pathnameBase,\n }));\n}\n\n/**\n * https://github.com/remix-run/remix/blob/97999d02493e8114c39d48b76944069d58526e8d/packages/remix-server-runtime/server.ts#L573-L586\n */\nfunction isIndexRequestUrl(url) {\n for (const param of url.searchParams.getAll('index')) {\n // only use bare `?index` params without a value\n // ✅ /foo?index\n // ✅ /foo?index&index=123\n // ✅ /foo?index=123&index\n // ❌ /foo?index=123\n if (param === '') {\n return true;\n }\n }\n\n return false;\n}\n\n/**\n * https://github.com/remix-run/remix/blob/97999d02493e8114c39d48b76944069d58526e8d/packages/remix-server-runtime/server.ts#L588-L596\n */\nfunction getRequestMatch(\n url,\n matches,\n) {\n const match = matches.slice(-1)[0];\n\n if (!isIndexRequestUrl(url) && _optionalChain([match, 'access', _ => _.route, 'access', _2 => _2.id, 'optionalAccess', _3 => _3.endsWith, 'call', _4 => _4('/index')])) {\n return matches.slice(-2)[0];\n }\n\n return match;\n}\n\n/**\n * https://github.com/remix-run/remix/blob/3e589152bc717d04e2054c31bea5a1056080d4b9/packages/remix-server-runtime/responses.ts#L75-L85\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction isDeferredData(value) {\n const deferred = value;\n return (\n deferred &&\n typeof deferred === 'object' &&\n typeof deferred.data === 'object' &&\n typeof deferred.subscribe === 'function' &&\n typeof deferred.cancel === 'function' &&\n typeof deferred.resolveData === 'function'\n );\n}\n\n/**\n * https://github.com/remix-run/react-router/blob/f9b3dbd9cbf513366c456b33d95227f42f36da63/packages/router/utils.ts#L1574\n *\n * Check if the given error is an ErrorResponse generated from a 4xx/5xx\n * Response thrown from an action/loader\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction isRouteErrorResponse(value) {\n const error = value;\n\n return (\n error != null &&\n typeof error.status === 'number' &&\n typeof error.statusText === 'string' &&\n typeof error.internal === 'boolean' &&\n 'data' in error\n );\n}\n\nexport { extractData, getRequestMatch, isDeferredData, isIndexRequestUrl, isResponse, isRouteErrorResponse, json, matchServerRoutes };\n//# sourceMappingURL=response.js.map\n","import { captureException } from '@sentry/core';\nimport { isNodeEnv } from '@sentry/utils';\nimport { isResponse } from '../utils/vendor/response.js';\n\n/**\n * Captures an error that is thrown inside a Remix ErrorBoundary.\n *\n * @param error The error to capture.\n * @returns void\n */\nfunction captureRemixErrorBoundaryError(error) {\n // Server-side errors also appear here without their stacktraces.\n // So, we only capture client-side runtime errors here.\n // ErrorResponses that are 5xx errors captured at loader / action level by `captureRemixRouteError` function,\n // And other server-side errors captured in `handleError` function where stacktraces are available.\n //\n // We don't want to capture:\n // - Response Errors / Objects [They are originated and handled on the server-side]\n // - SSR Errors [They are originated and handled on the server-side]\n // - Anything without a stacktrace [Remix trims the stacktrace of the errors that are thrown on the server-side]\n if (isResponse(error) || isNodeEnv() || !(error instanceof Error)) {\n return;\n }\n\n return captureException(error, {\n mechanism: {\n type: 'instrument',\n handled: false,\n data: {\n function: 'ReactError',\n },\n },\n });\n}\n\nexport { captureRemixErrorBoundaryError };\n//# sourceMappingURL=errors.js.map\n","function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t p,\n isStatic: false,\n reducedMotion: \"never\",\n});\n\nexport { MotionConfigContext };\n","import { createContext } from 'react';\n\nconst MotionContext = createContext({});\n\nexport { MotionContext };\n","import { createContext } from 'react';\n\n/**\n * @public\n */\nconst PresenceContext = createContext(null);\n\nexport { PresenceContext };\n","const isBrowser = typeof document !== \"undefined\";\n\nexport { isBrowser };\n","import { useLayoutEffect, useEffect } from 'react';\nimport { isBrowser } from './is-browser.mjs';\n\nconst useIsomorphicLayoutEffect = isBrowser ? useLayoutEffect : useEffect;\n\nexport { useIsomorphicLayoutEffect };\n","import { createContext } from 'react';\n\nconst LazyContext = createContext({ strict: false });\n\nexport { LazyContext };\n","/**\n * Convert camelCase to dash-case properties.\n */\nconst camelToDash = (str) => str.replace(/([a-z])([A-Z])/gu, \"$1-$2\").toLowerCase();\n\nexport { camelToDash };\n","import { camelToDash } from '../../render/dom/utils/camel-to-dash.mjs';\n\nconst optimizedAppearDataId = \"framerAppearId\";\nconst optimizedAppearDataAttribute = \"data-\" + camelToDash(optimizedAppearDataId);\n\nexport { optimizedAppearDataAttribute, optimizedAppearDataId };\n","const MotionGlobalConfig = {\n skipAnimations: false,\n useManualTiming: false,\n};\n\nexport { MotionGlobalConfig };\n","class Queue {\n constructor() {\n this.order = [];\n this.scheduled = new Set();\n }\n add(process) {\n if (!this.scheduled.has(process)) {\n this.scheduled.add(process);\n this.order.push(process);\n return true;\n }\n }\n remove(process) {\n const index = this.order.indexOf(process);\n if (index !== -1) {\n this.order.splice(index, 1);\n this.scheduled.delete(process);\n }\n }\n clear() {\n this.order.length = 0;\n this.scheduled.clear();\n }\n}\nfunction createRenderStep(runNextFrame) {\n /**\n * We create and reuse two queues, one to queue jobs for the current frame\n * and one for the next. We reuse to avoid triggering GC after x frames.\n */\n let thisFrame = new Queue();\n let nextFrame = new Queue();\n let numToRun = 0;\n /**\n * Track whether we're currently processing jobs in this step. This way\n * we can decide whether to schedule new jobs for this frame or next.\n */\n let isProcessing = false;\n let flushNextFrame = false;\n /**\n * A set of processes which were marked keepAlive when scheduled.\n */\n const toKeepAlive = new WeakSet();\n const step = {\n /**\n * Schedule a process to run on the next frame.\n */\n schedule: (callback, keepAlive = false, immediate = false) => {\n const addToCurrentFrame = immediate && isProcessing;\n const queue = addToCurrentFrame ? thisFrame : nextFrame;\n if (keepAlive)\n toKeepAlive.add(callback);\n if (queue.add(callback) && addToCurrentFrame && isProcessing) {\n // If we're adding it to the currently running queue, update its measured size\n numToRun = thisFrame.order.length;\n }\n return callback;\n },\n /**\n * Cancel the provided callback from running on the next frame.\n */\n cancel: (callback) => {\n nextFrame.remove(callback);\n toKeepAlive.delete(callback);\n },\n /**\n * Execute all schedule callbacks.\n */\n process: (frameData) => {\n /**\n * If we're already processing we've probably been triggered by a flushSync\n * inside an existing process. Instead of executing, mark flushNextFrame\n * as true and ensure we flush the following frame at the end of this one.\n */\n if (isProcessing) {\n flushNextFrame = true;\n return;\n }\n isProcessing = true;\n [thisFrame, nextFrame] = [nextFrame, thisFrame];\n // Clear the next frame queue\n nextFrame.clear();\n // Execute this frame\n numToRun = thisFrame.order.length;\n if (numToRun) {\n for (let i = 0; i < numToRun; i++) {\n const callback = thisFrame.order[i];\n if (toKeepAlive.has(callback)) {\n step.schedule(callback);\n runNextFrame();\n }\n callback(frameData);\n }\n }\n isProcessing = false;\n if (flushNextFrame) {\n flushNextFrame = false;\n step.process(frameData);\n }\n },\n };\n return step;\n}\n\nexport { createRenderStep };\n","import { MotionGlobalConfig } from '../utils/GlobalConfig.mjs';\nimport { createRenderStep } from './render-step.mjs';\n\nconst stepsOrder = [\n \"read\", // Read\n \"resolveKeyframes\", // Write/Read/Write/Read\n \"update\", // Compute\n \"preRender\", // Compute\n \"render\", // Write\n \"postRender\", // Compute\n];\nconst maxElapsed = 40;\nfunction createRenderBatcher(scheduleNextBatch, allowKeepAlive) {\n let runNextFrame = false;\n let useDefaultElapsed = true;\n const state = {\n delta: 0,\n timestamp: 0,\n isProcessing: false,\n };\n const steps = stepsOrder.reduce((acc, key) => {\n acc[key] = createRenderStep(() => (runNextFrame = true));\n return acc;\n }, {});\n const processStep = (stepId) => {\n steps[stepId].process(state);\n };\n const processBatch = () => {\n const timestamp = MotionGlobalConfig.useManualTiming\n ? state.timestamp\n : performance.now();\n runNextFrame = false;\n state.delta = useDefaultElapsed\n ? 1000 / 60\n : Math.max(Math.min(timestamp - state.timestamp, maxElapsed), 1);\n state.timestamp = timestamp;\n state.isProcessing = true;\n stepsOrder.forEach(processStep);\n state.isProcessing = false;\n if (runNextFrame && allowKeepAlive) {\n useDefaultElapsed = false;\n scheduleNextBatch(processBatch);\n }\n };\n const wake = () => {\n runNextFrame = true;\n useDefaultElapsed = true;\n if (!state.isProcessing) {\n scheduleNextBatch(processBatch);\n }\n };\n const schedule = stepsOrder.reduce((acc, key) => {\n const step = steps[key];\n acc[key] = (process, keepAlive = false, immediate = false) => {\n if (!runNextFrame)\n wake();\n return step.schedule(process, keepAlive, immediate);\n };\n return acc;\n }, {});\n const cancel = (process) => stepsOrder.forEach((key) => steps[key].cancel(process));\n return { schedule, cancel, state, steps };\n}\n\nexport { createRenderBatcher, stepsOrder };\n","import { createRenderBatcher } from './batcher.mjs';\n\nconst { schedule: microtask, cancel: cancelMicrotask } = createRenderBatcher(queueMicrotask, false);\n\nexport { cancelMicrotask, microtask };\n","import { useContext, useRef, useInsertionEffect, useEffect } from 'react';\nimport { PresenceContext } from '../../context/PresenceContext.mjs';\nimport { MotionContext } from '../../context/MotionContext/index.mjs';\nimport { useIsomorphicLayoutEffect } from '../../utils/use-isomorphic-effect.mjs';\nimport { LazyContext } from '../../context/LazyContext.mjs';\nimport { MotionConfigContext } from '../../context/MotionConfigContext.mjs';\nimport { optimizedAppearDataAttribute } from '../../animation/optimized-appear/data-id.mjs';\nimport { microtask } from '../../frameloop/microtask.mjs';\n\nfunction useVisualElement(Component, visualState, props, createVisualElement) {\n const { visualElement: parent } = useContext(MotionContext);\n const lazyContext = useContext(LazyContext);\n const presenceContext = useContext(PresenceContext);\n const reducedMotionConfig = useContext(MotionConfigContext).reducedMotion;\n const visualElementRef = useRef();\n /**\n * If we haven't preloaded a renderer, check to see if we have one lazy-loaded\n */\n createVisualElement = createVisualElement || lazyContext.renderer;\n if (!visualElementRef.current && createVisualElement) {\n visualElementRef.current = createVisualElement(Component, {\n visualState,\n parent,\n props,\n presenceContext,\n blockInitialAnimation: presenceContext\n ? presenceContext.initial === false\n : false,\n reducedMotionConfig,\n });\n }\n const visualElement = visualElementRef.current;\n useInsertionEffect(() => {\n visualElement && visualElement.update(props, presenceContext);\n });\n /**\n * Cache this value as we want to know whether HandoffAppearAnimations\n * was present on initial render - it will be deleted after this.\n */\n const wantsHandoff = useRef(Boolean(props[optimizedAppearDataAttribute] &&\n !window.HandoffComplete));\n useIsomorphicLayoutEffect(() => {\n if (!visualElement)\n return;\n microtask.render(visualElement.render);\n /**\n * Ideally this function would always run in a useEffect.\n *\n * However, if we have optimised appear animations to handoff from,\n * it needs to happen synchronously to ensure there's no flash of\n * incorrect styles in the event of a hydration error.\n *\n * So if we detect a situtation where optimised appear animations\n * are running, we use useLayoutEffect to trigger animations.\n */\n if (wantsHandoff.current && visualElement.animationState) {\n visualElement.animationState.animateChanges();\n }\n });\n useEffect(() => {\n if (!visualElement)\n return;\n visualElement.updateFeatures();\n if (!wantsHandoff.current && visualElement.animationState) {\n visualElement.animationState.animateChanges();\n }\n if (wantsHandoff.current) {\n wantsHandoff.current = false;\n // This ensures all future calls to animateChanges() will run in useEffect\n window.HandoffComplete = true;\n }\n });\n return visualElement;\n}\n\nexport { useVisualElement };\n","function isRefObject(ref) {\n return (ref &&\n typeof ref === \"object\" &&\n Object.prototype.hasOwnProperty.call(ref, \"current\"));\n}\n\nexport { isRefObject };\n","import { useCallback } from 'react';\nimport { isRefObject } from '../../utils/is-ref-object.mjs';\n\n/**\n * Creates a ref function that, when called, hydrates the provided\n * external ref and VisualElement.\n */\nfunction useMotionRef(visualState, visualElement, externalRef) {\n return useCallback((instance) => {\n instance && visualState.mount && visualState.mount(instance);\n if (visualElement) {\n instance\n ? visualElement.mount(instance)\n : visualElement.unmount();\n }\n if (externalRef) {\n if (typeof externalRef === \"function\") {\n externalRef(instance);\n }\n else if (isRefObject(externalRef)) {\n externalRef.current = instance;\n }\n }\n }, \n /**\n * Only pass a new ref callback to React if we've received a visual element\n * factory. Otherwise we'll be mounting/remounting every time externalRef\n * or other dependencies change.\n */\n [visualElement]);\n}\n\nexport { useMotionRef };\n","/**\n * Decides if the supplied variable is variant label\n */\nfunction isVariantLabel(v) {\n return typeof v === \"string\" || Array.isArray(v);\n}\n\nexport { isVariantLabel };\n","function isAnimationControls(v) {\n return (v !== null &&\n typeof v === \"object\" &&\n typeof v.start === \"function\");\n}\n\nexport { isAnimationControls };\n","const variantPriorityOrder = [\n \"animate\",\n \"whileInView\",\n \"whileFocus\",\n \"whileHover\",\n \"whileTap\",\n \"whileDrag\",\n \"exit\",\n];\nconst variantProps = [\"initial\", ...variantPriorityOrder];\n\nexport { variantPriorityOrder, variantProps };\n","import { isAnimationControls } from '../../animation/utils/is-animation-controls.mjs';\nimport { isVariantLabel } from './is-variant-label.mjs';\nimport { variantProps } from './variant-props.mjs';\n\nfunction isControllingVariants(props) {\n return (isAnimationControls(props.animate) ||\n variantProps.some((name) => isVariantLabel(props[name])));\n}\nfunction isVariantNode(props) {\n return Boolean(isControllingVariants(props) || props.variants);\n}\n\nexport { isControllingVariants, isVariantNode };\n","import { isVariantLabel } from '../../render/utils/is-variant-label.mjs';\nimport { isControllingVariants } from '../../render/utils/is-controlling-variants.mjs';\n\nfunction getCurrentTreeVariants(props, context) {\n if (isControllingVariants(props)) {\n const { initial, animate } = props;\n return {\n initial: initial === false || isVariantLabel(initial)\n ? initial\n : undefined,\n animate: isVariantLabel(animate) ? animate : undefined,\n };\n }\n return props.inherit !== false ? context : {};\n}\n\nexport { getCurrentTreeVariants };\n","import { useContext, useMemo } from 'react';\nimport { MotionContext } from './index.mjs';\nimport { getCurrentTreeVariants } from './utils.mjs';\n\nfunction useCreateMotionContext(props) {\n const { initial, animate } = getCurrentTreeVariants(props, useContext(MotionContext));\n return useMemo(() => ({ initial, animate }), [variantLabelsAsDependency(initial), variantLabelsAsDependency(animate)]);\n}\nfunction variantLabelsAsDependency(prop) {\n return Array.isArray(prop) ? prop.join(\" \") : prop;\n}\n\nexport { useCreateMotionContext };\n","const featureProps = {\n animation: [\n \"animate\",\n \"variants\",\n \"whileHover\",\n \"whileTap\",\n \"exit\",\n \"whileInView\",\n \"whileFocus\",\n \"whileDrag\",\n ],\n exit: [\"exit\"],\n drag: [\"drag\", \"dragControls\"],\n focus: [\"whileFocus\"],\n hover: [\"whileHover\", \"onHoverStart\", \"onHoverEnd\"],\n tap: [\"whileTap\", \"onTap\", \"onTapStart\", \"onTapCancel\"],\n pan: [\"onPan\", \"onPanStart\", \"onPanSessionStart\", \"onPanEnd\"],\n inView: [\"whileInView\", \"onViewportEnter\", \"onViewportLeave\"],\n layout: [\"layout\", \"layoutId\"],\n};\nconst featureDefinitions = {};\nfor (const key in featureProps) {\n featureDefinitions[key] = {\n isEnabled: (props) => featureProps[key].some((name) => !!props[name]),\n };\n}\n\nexport { featureDefinitions };\n","import { featureDefinitions } from './definitions.mjs';\n\nfunction loadFeatures(features) {\n for (const key in features) {\n featureDefinitions[key] = {\n ...featureDefinitions[key],\n ...features[key],\n };\n }\n}\n\nexport { loadFeatures };\n","import { createContext } from 'react';\n\nconst LayoutGroupContext = createContext({});\n\nexport { LayoutGroupContext };\n","import { createContext } from 'react';\n\n/**\n * Internal, exported only for usage in Framer\n */\nconst SwitchLayoutGroupContext = createContext({});\n\nexport { SwitchLayoutGroupContext };\n","const motionComponentSymbol = Symbol.for(\"motionComponentSymbol\");\n\nexport { motionComponentSymbol };\n","import { jsxs, jsx } from 'react/jsx-runtime';\nimport { forwardRef, useContext } from 'react';\nimport { MotionConfigContext } from '../context/MotionConfigContext.mjs';\nimport { MotionContext } from '../context/MotionContext/index.mjs';\nimport { useVisualElement } from './utils/use-visual-element.mjs';\nimport { useMotionRef } from './utils/use-motion-ref.mjs';\nimport { useCreateMotionContext } from '../context/MotionContext/create.mjs';\nimport { loadFeatures } from './features/load-features.mjs';\nimport { isBrowser } from '../utils/is-browser.mjs';\nimport { LayoutGroupContext } from '../context/LayoutGroupContext.mjs';\nimport { LazyContext } from '../context/LazyContext.mjs';\nimport { SwitchLayoutGroupContext } from '../context/SwitchLayoutGroupContext.mjs';\nimport { motionComponentSymbol } from './utils/symbol.mjs';\n\n/**\n * Create a `motion` component.\n *\n * This function accepts a Component argument, which can be either a string (ie \"div\"\n * for `motion.div`), or an actual React component.\n *\n * Alongside this is a config option which provides a way of rendering the provided\n * component \"offline\", or outside the React render cycle.\n */\nfunction createMotionComponent({ preloadedFeatures, createVisualElement, useRender, useVisualState, Component, }) {\n preloadedFeatures && loadFeatures(preloadedFeatures);\n function MotionComponent(props, externalRef) {\n /**\n * If we need to measure the element we load this functionality in a\n * separate class component in order to gain access to getSnapshotBeforeUpdate.\n */\n let MeasureLayout;\n const configAndProps = {\n ...useContext(MotionConfigContext),\n ...props,\n layoutId: useLayoutId(props),\n };\n const { isStatic } = configAndProps;\n const context = useCreateMotionContext(props);\n const visualState = useVisualState(props, isStatic);\n if (!isStatic && isBrowser) {\n /**\n * Create a VisualElement for this component. A VisualElement provides a common\n * interface to renderer-specific APIs (ie DOM/Three.js etc) as well as\n * providing a way of rendering to these APIs outside of the React render loop\n * for more performant animations and interactions\n */\n context.visualElement = useVisualElement(Component, visualState, configAndProps, createVisualElement);\n /**\n * Load Motion gesture and animation features. These are rendered as renderless\n * components so each feature can optionally make use of React lifecycle methods.\n */\n const initialLayoutGroupConfig = useContext(SwitchLayoutGroupContext);\n const isStrict = useContext(LazyContext).strict;\n if (context.visualElement) {\n MeasureLayout = context.visualElement.loadFeatures(\n // Note: Pass the full new combined props to correctly re-render dynamic feature components.\n configAndProps, isStrict, preloadedFeatures, initialLayoutGroupConfig);\n }\n }\n /**\n * The mount order and hierarchy is specific to ensure our element ref\n * is hydrated by the time features fire their effects.\n */\n return (jsxs(MotionContext.Provider, { value: context, children: [MeasureLayout && context.visualElement ? (jsx(MeasureLayout, { visualElement: context.visualElement, ...configAndProps })) : null, useRender(Component, props, useMotionRef(visualState, context.visualElement, externalRef), visualState, isStatic, context.visualElement)] }));\n }\n const ForwardRefComponent = forwardRef(MotionComponent);\n ForwardRefComponent[motionComponentSymbol] = Component;\n return ForwardRefComponent;\n}\nfunction useLayoutId({ layoutId }) {\n const layoutGroupId = useContext(LayoutGroupContext).id;\n return layoutGroupId && layoutId !== undefined\n ? layoutGroupId + \"-\" + layoutId\n : layoutId;\n}\n\nexport { createMotionComponent };\n","import { createMotionComponent } from '../../motion/index.mjs';\n\n/**\n * Convert any React component into a `motion` component. The provided component\n * **must** use `React.forwardRef` to the underlying DOM component you want to animate.\n *\n * ```jsx\n * const Component = React.forwardRef((props, ref) => {\n * return
\n * })\n *\n * const MotionComponent = motion(Component)\n * ```\n *\n * @public\n */\nfunction createMotionProxy(createConfig) {\n function custom(Component, customMotionComponentConfig = {}) {\n return createMotionComponent(createConfig(Component, customMotionComponentConfig));\n }\n if (typeof Proxy === \"undefined\") {\n return custom;\n }\n /**\n * A cache of generated `motion` components, e.g `motion.div`, `motion.input` etc.\n * Rather than generating them anew every render.\n */\n const componentCache = new Map();\n return new Proxy(custom, {\n /**\n * Called when `motion` is referenced with a prop: `motion.div`, `motion.input` etc.\n * The prop name is passed through as `key` and we can use that to generate a `motion`\n * DOM component with that name.\n */\n get: (_target, key) => {\n /**\n * If this element doesn't exist in the component cache, create it and cache.\n */\n if (!componentCache.has(key)) {\n componentCache.set(key, custom(key));\n }\n return componentCache.get(key);\n },\n });\n}\n\nexport { createMotionProxy };\n","/**\n * We keep these listed seperately as we use the lowercase tag names as part\n * of the runtime bundle to detect SVG components\n */\nconst lowercaseSVGElements = [\n \"animate\",\n \"circle\",\n \"defs\",\n \"desc\",\n \"ellipse\",\n \"g\",\n \"image\",\n \"line\",\n \"filter\",\n \"marker\",\n \"mask\",\n \"metadata\",\n \"path\",\n \"pattern\",\n \"polygon\",\n \"polyline\",\n \"rect\",\n \"stop\",\n \"switch\",\n \"symbol\",\n \"svg\",\n \"text\",\n \"tspan\",\n \"use\",\n \"view\",\n];\n\nexport { lowercaseSVGElements };\n","import { lowercaseSVGElements } from '../../svg/lowercase-elements.mjs';\n\nfunction isSVGComponent(Component) {\n if (\n /**\n * If it's not a string, it's a custom React component. Currently we only support\n * HTML custom React components.\n */\n typeof Component !== \"string\" ||\n /**\n * If it contains a dash, the element is a custom HTML webcomponent.\n */\n Component.includes(\"-\")) {\n return false;\n }\n else if (\n /**\n * If it's in our list of lowercase SVG tags, it's an SVG component\n */\n lowercaseSVGElements.indexOf(Component) > -1 ||\n /**\n * If it contains a capital letter, it's an SVG component\n */\n /[A-Z]/u.test(Component)) {\n return true;\n }\n return false;\n}\n\nexport { isSVGComponent };\n","const scaleCorrectors = {};\nfunction addScaleCorrector(correctors) {\n Object.assign(scaleCorrectors, correctors);\n}\n\nexport { addScaleCorrector, scaleCorrectors };\n","/**\n * Generate a list of every possible transform key.\n */\nconst transformPropOrder = [\n \"transformPerspective\",\n \"x\",\n \"y\",\n \"z\",\n \"translateX\",\n \"translateY\",\n \"translateZ\",\n \"scale\",\n \"scaleX\",\n \"scaleY\",\n \"rotate\",\n \"rotateX\",\n \"rotateY\",\n \"rotateZ\",\n \"skew\",\n \"skewX\",\n \"skewY\",\n];\n/**\n * A quick lookup for transform props.\n */\nconst transformProps = new Set(transformPropOrder);\n\nexport { transformPropOrder, transformProps };\n","import { scaleCorrectors } from '../../projection/styles/scale-correction.mjs';\nimport { transformProps } from '../../render/html/utils/transform.mjs';\n\nfunction isForcedMotionValue(key, { layout, layoutId }) {\n return (transformProps.has(key) ||\n key.startsWith(\"origin\") ||\n ((layout || layoutId !== undefined) &&\n (!!scaleCorrectors[key] || key === \"opacity\")));\n}\n\nexport { isForcedMotionValue };\n","const isMotionValue = (value) => Boolean(value && value.getVelocity);\n\nexport { isMotionValue };\n","import { transformPropOrder } from './transform.mjs';\n\nconst translateAlias = {\n x: \"translateX\",\n y: \"translateY\",\n z: \"translateZ\",\n transformPerspective: \"perspective\",\n};\nconst numTransforms = transformPropOrder.length;\n/**\n * Build a CSS transform style from individual x/y/scale etc properties.\n *\n * This outputs with a default order of transforms/scales/rotations, this can be customised by\n * providing a transformTemplate function.\n */\nfunction buildTransform(transform, { enableHardwareAcceleration = true, allowTransformNone = true, }, transformIsDefault, transformTemplate) {\n // The transform string we're going to build into.\n let transformString = \"\";\n /**\n * Loop over all possible transforms in order, adding the ones that\n * are present to the transform string.\n */\n for (let i = 0; i < numTransforms; i++) {\n const key = transformPropOrder[i];\n if (transform[key] !== undefined) {\n const transformName = translateAlias[key] || key;\n transformString += `${transformName}(${transform[key]}) `;\n }\n }\n if (enableHardwareAcceleration && !transform.z) {\n transformString += \"translateZ(0)\";\n }\n transformString = transformString.trim();\n // If we have a custom `transform` template, pass our transform values and\n // generated transformString to that before returning\n if (transformTemplate) {\n transformString = transformTemplate(transform, transformIsDefault ? \"\" : transformString);\n }\n else if (allowTransformNone && transformIsDefault) {\n transformString = \"none\";\n }\n return transformString;\n}\n\nexport { buildTransform };\n","const checkStringStartsWith = (token) => (key) => typeof key === \"string\" && key.startsWith(token);\nconst isCSSVariableName = checkStringStartsWith(\"--\");\nconst startsAsVariableToken = checkStringStartsWith(\"var(--\");\nconst isCSSVariableToken = (value) => {\n const startsWithToken = startsAsVariableToken(value);\n if (!startsWithToken)\n return false;\n // Ensure any comments are stripped from the value as this can harm performance of the regex.\n return singleCssVariableRegex.test(value.split(\"/*\")[0].trim());\n};\nconst singleCssVariableRegex = /var\\(--(?:[\\w-]+\\s*|[\\w-]+\\s*,(?:\\s*[^)(\\s]|\\s*\\((?:[^)(]|\\([^)(]*\\))*\\))+\\s*)\\)$/iu;\n\nexport { isCSSVariableName, isCSSVariableToken };\n","/**\n * Provided a value and a ValueType, returns the value as that value type.\n */\nconst getValueAsType = (value, type) => {\n return type && typeof value === \"number\"\n ? type.transform(value)\n : value;\n};\n\nexport { getValueAsType };\n","const clamp = (min, max, v) => {\n if (v > max)\n return max;\n if (v < min)\n return min;\n return v;\n};\n\nexport { clamp };\n","import { clamp } from '../../../utils/clamp.mjs';\n\nconst number = {\n test: (v) => typeof v === \"number\",\n parse: parseFloat,\n transform: (v) => v,\n};\nconst alpha = {\n ...number,\n transform: (v) => clamp(0, 1, v),\n};\nconst scale = {\n ...number,\n default: 1,\n};\n\nexport { alpha, number, scale };\n","/**\n * TODO: When we move from string as a source of truth to data models\n * everything in this folder should probably be referred to as models vs types\n */\n// If this number is a decimal, make it just five decimal places\n// to avoid exponents\nconst sanitize = (v) => Math.round(v * 100000) / 100000;\nconst floatRegex = /-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)/gu;\nconst colorRegex = /(?:#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\))/giu;\nconst singleColorRegex = /^(?:#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\))$/iu;\nfunction isString(v) {\n return typeof v === \"string\";\n}\n\nexport { colorRegex, floatRegex, isString, sanitize, singleColorRegex };\n","import { isString } from '../utils.mjs';\n\nconst createUnitType = (unit) => ({\n test: (v) => isString(v) && v.endsWith(unit) && v.split(\" \").length === 1,\n parse: parseFloat,\n transform: (v) => `${v}${unit}`,\n});\nconst degrees = createUnitType(\"deg\");\nconst percent = createUnitType(\"%\");\nconst px = createUnitType(\"px\");\nconst vh = createUnitType(\"vh\");\nconst vw = createUnitType(\"vw\");\nconst progressPercentage = {\n ...percent,\n parse: (v) => percent.parse(v) / 100,\n transform: (v) => percent.transform(v * 100),\n};\n\nexport { degrees, percent, progressPercentage, px, vh, vw };\n","import { number } from '../../../value/types/numbers/index.mjs';\n\nconst int = {\n ...number,\n transform: Math.round,\n};\n\nexport { int };\n","import { scale, alpha } from '../../../value/types/numbers/index.mjs';\nimport { px, degrees, progressPercentage } from '../../../value/types/numbers/units.mjs';\nimport { int } from './type-int.mjs';\n\nconst numberValueTypes = {\n // Border props\n borderWidth: px,\n borderTopWidth: px,\n borderRightWidth: px,\n borderBottomWidth: px,\n borderLeftWidth: px,\n borderRadius: px,\n radius: px,\n borderTopLeftRadius: px,\n borderTopRightRadius: px,\n borderBottomRightRadius: px,\n borderBottomLeftRadius: px,\n // Positioning props\n width: px,\n maxWidth: px,\n height: px,\n maxHeight: px,\n size: px,\n top: px,\n right: px,\n bottom: px,\n left: px,\n // Spacing props\n padding: px,\n paddingTop: px,\n paddingRight: px,\n paddingBottom: px,\n paddingLeft: px,\n margin: px,\n marginTop: px,\n marginRight: px,\n marginBottom: px,\n marginLeft: px,\n // Transform props\n rotate: degrees,\n rotateX: degrees,\n rotateY: degrees,\n rotateZ: degrees,\n scale,\n scaleX: scale,\n scaleY: scale,\n scaleZ: scale,\n skew: degrees,\n skewX: degrees,\n skewY: degrees,\n distance: px,\n translateX: px,\n translateY: px,\n translateZ: px,\n x: px,\n y: px,\n z: px,\n perspective: px,\n transformPerspective: px,\n opacity: alpha,\n originX: progressPercentage,\n originY: progressPercentage,\n originZ: px,\n // Misc\n zIndex: int,\n backgroundPositionX: px,\n backgroundPositionY: px,\n // SVG\n fillOpacity: alpha,\n strokeOpacity: alpha,\n numOctaves: int,\n};\n\nexport { numberValueTypes };\n","import { buildTransform } from './build-transform.mjs';\nimport { isCSSVariableName } from '../../dom/utils/is-css-variable.mjs';\nimport { transformProps } from './transform.mjs';\nimport { getValueAsType } from '../../dom/value-types/get-as-type.mjs';\nimport { numberValueTypes } from '../../dom/value-types/number.mjs';\n\nfunction buildHTMLStyles(state, latestValues, options, transformTemplate) {\n const { style, vars, transform, transformOrigin } = state;\n // Track whether we encounter any transform or transformOrigin values.\n let hasTransform = false;\n let hasTransformOrigin = false;\n // Does the calculated transform essentially equal \"none\"?\n let transformIsNone = true;\n /**\n * Loop over all our latest animated values and decide whether to handle them\n * as a style or CSS variable.\n *\n * Transforms and transform origins are kept seperately for further processing.\n */\n for (const key in latestValues) {\n const value = latestValues[key];\n /**\n * If this is a CSS variable we don't do any further processing.\n */\n if (isCSSVariableName(key)) {\n vars[key] = value;\n continue;\n }\n // Convert the value to its default value type, ie 0 -> \"0px\"\n const valueType = numberValueTypes[key];\n const valueAsType = getValueAsType(value, valueType);\n if (transformProps.has(key)) {\n // If this is a transform, flag to enable further transform processing\n hasTransform = true;\n transform[key] = valueAsType;\n // If we already know we have a non-default transform, early return\n if (!transformIsNone)\n continue;\n // Otherwise check to see if this is a default transform\n if (value !== (valueType.default || 0))\n transformIsNone = false;\n }\n else if (key.startsWith(\"origin\")) {\n // If this is a transform origin, flag and enable further transform-origin processing\n hasTransformOrigin = true;\n transformOrigin[key] = valueAsType;\n }\n else {\n style[key] = valueAsType;\n }\n }\n if (!latestValues.transform) {\n if (hasTransform || transformTemplate) {\n style.transform = buildTransform(state.transform, options, transformIsNone, transformTemplate);\n }\n else if (style.transform) {\n /**\n * If we have previously created a transform but currently don't have any,\n * reset transform style to none.\n */\n style.transform = \"none\";\n }\n }\n /**\n * Build a transformOrigin style. Uses the same defaults as the browser for\n * undefined origins.\n */\n if (hasTransformOrigin) {\n const { originX = \"50%\", originY = \"50%\", originZ = 0, } = transformOrigin;\n style.transformOrigin = `${originX} ${originY} ${originZ}`;\n }\n}\n\nexport { buildHTMLStyles };\n","const createHtmlRenderState = () => ({\n style: {},\n transform: {},\n transformOrigin: {},\n vars: {},\n});\n\nexport { createHtmlRenderState };\n","import { useMemo } from 'react';\nimport { isForcedMotionValue } from '../../motion/utils/is-forced-motion-value.mjs';\nimport { isMotionValue } from '../../value/utils/is-motion-value.mjs';\nimport { buildHTMLStyles } from './utils/build-styles.mjs';\nimport { createHtmlRenderState } from './utils/create-render-state.mjs';\n\nfunction copyRawValuesOnly(target, source, props) {\n for (const key in source) {\n if (!isMotionValue(source[key]) && !isForcedMotionValue(key, props)) {\n target[key] = source[key];\n }\n }\n}\nfunction useInitialMotionValues({ transformTemplate }, visualState, isStatic) {\n return useMemo(() => {\n const state = createHtmlRenderState();\n buildHTMLStyles(state, visualState, { enableHardwareAcceleration: !isStatic }, transformTemplate);\n return Object.assign({}, state.vars, state.style);\n }, [visualState]);\n}\nfunction useStyle(props, visualState, isStatic) {\n const styleProp = props.style || {};\n const style = {};\n /**\n * Copy non-Motion Values straight into style\n */\n copyRawValuesOnly(style, styleProp, props);\n Object.assign(style, useInitialMotionValues(props, visualState, isStatic));\n return style;\n}\nfunction useHTMLProps(props, visualState, isStatic) {\n // The `any` isn't ideal but it is the type of createElement props argument\n const htmlProps = {};\n const style = useStyle(props, visualState, isStatic);\n if (props.drag && props.dragListener !== false) {\n // Disable the ghost element when a user drags\n htmlProps.draggable = false;\n // Disable text selection\n style.userSelect =\n style.WebkitUserSelect =\n style.WebkitTouchCallout =\n \"none\";\n // Disable scrolling on the draggable direction\n style.touchAction =\n props.drag === true\n ? \"none\"\n : `pan-${props.drag === \"x\" ? \"y\" : \"x\"}`;\n }\n if (props.tabIndex === undefined &&\n (props.onTap || props.onTapStart || props.whileTap)) {\n htmlProps.tabIndex = 0;\n }\n htmlProps.style = style;\n return htmlProps;\n}\n\nexport { copyRawValuesOnly, useHTMLProps };\n","/**\n * A list of all valid MotionProps.\n *\n * @privateRemarks\n * This doesn't throw if a `MotionProp` name is missing - it should.\n */\nconst validMotionProps = new Set([\n \"animate\",\n \"exit\",\n \"variants\",\n \"initial\",\n \"style\",\n \"values\",\n \"variants\",\n \"transition\",\n \"transformTemplate\",\n \"custom\",\n \"inherit\",\n \"onBeforeLayoutMeasure\",\n \"onAnimationStart\",\n \"onAnimationComplete\",\n \"onUpdate\",\n \"onDragStart\",\n \"onDrag\",\n \"onDragEnd\",\n \"onMeasureDragConstraints\",\n \"onDirectionLock\",\n \"onDragTransitionEnd\",\n \"_dragX\",\n \"_dragY\",\n \"onHoverStart\",\n \"onHoverEnd\",\n \"onViewportEnter\",\n \"onViewportLeave\",\n \"globalTapTarget\",\n \"ignoreStrict\",\n \"viewport\",\n]);\n/**\n * Check whether a prop name is a valid `MotionProp` key.\n *\n * @param key - Name of the property to check\n * @returns `true` is key is a valid `MotionProp`.\n *\n * @public\n */\nfunction isValidMotionProp(key) {\n return (key.startsWith(\"while\") ||\n (key.startsWith(\"drag\") && key !== \"draggable\") ||\n key.startsWith(\"layout\") ||\n key.startsWith(\"onTap\") ||\n key.startsWith(\"onPan\") ||\n key.startsWith(\"onLayout\") ||\n validMotionProps.has(key));\n}\n\nexport { isValidMotionProp };\n","import { isValidMotionProp } from '../../../motion/utils/valid-prop.mjs';\n\nlet shouldForward = (key) => !isValidMotionProp(key);\nfunction loadExternalIsValidProp(isValidProp) {\n if (!isValidProp)\n return;\n // Explicitly filter our events\n shouldForward = (key) => key.startsWith(\"on\") ? !isValidMotionProp(key) : isValidProp(key);\n}\n/**\n * Emotion and Styled Components both allow users to pass through arbitrary props to their components\n * to dynamically generate CSS. They both use the `@emotion/is-prop-valid` package to determine which\n * of these should be passed to the underlying DOM node.\n *\n * However, when styling a Motion component `styled(motion.div)`, both packages pass through *all* props\n * as it's seen as an arbitrary component rather than a DOM node. Motion only allows arbitrary props\n * passed through the `custom` prop so it doesn't *need* the payload or computational overhead of\n * `@emotion/is-prop-valid`, however to fix this problem we need to use it.\n *\n * By making it an optionalDependency we can offer this functionality only in the situations where it's\n * actually required.\n */\ntry {\n /**\n * We attempt to import this package but require won't be defined in esm environments, in that case\n * isPropValid will have to be provided via `MotionContext`. In a 6.0.0 this should probably be removed\n * in favour of explicit injection.\n */\n loadExternalIsValidProp(require(\"@emotion/is-prop-valid\").default);\n}\ncatch (_a) {\n // We don't need to actually do anything here - the fallback is the existing `isPropValid`.\n}\nfunction filterProps(props, isDom, forwardMotionProps) {\n const filteredProps = {};\n for (const key in props) {\n /**\n * values is considered a valid prop by Emotion, so if it's present\n * this will be rendered out to the DOM unless explicitly filtered.\n *\n * We check the type as it could be used with the `feColorMatrix`\n * element, which we support.\n */\n if (key === \"values\" && typeof props.values === \"object\")\n continue;\n if (shouldForward(key) ||\n (forwardMotionProps === true && isValidMotionProp(key)) ||\n (!isDom && !isValidMotionProp(key)) ||\n // If trying to use native HTML drag events, forward drag listeners\n (props[\"draggable\"] &&\n key.startsWith(\"onDrag\"))) {\n filteredProps[key] =\n props[key];\n }\n }\n return filteredProps;\n}\n\nexport { filterProps, loadExternalIsValidProp };\n","import { px } from '../../../value/types/numbers/units.mjs';\n\nfunction calcOrigin(origin, offset, size) {\n return typeof origin === \"string\"\n ? origin\n : px.transform(offset + size * origin);\n}\n/**\n * The SVG transform origin defaults are different to CSS and is less intuitive,\n * so we use the measured dimensions of the SVG to reconcile these.\n */\nfunction calcSVGTransformOrigin(dimensions, originX, originY) {\n const pxOriginX = calcOrigin(originX, dimensions.x, dimensions.width);\n const pxOriginY = calcOrigin(originY, dimensions.y, dimensions.height);\n return `${pxOriginX} ${pxOriginY}`;\n}\n\nexport { calcSVGTransformOrigin };\n","import { px } from '../../../value/types/numbers/units.mjs';\n\nconst dashKeys = {\n offset: \"stroke-dashoffset\",\n array: \"stroke-dasharray\",\n};\nconst camelKeys = {\n offset: \"strokeDashoffset\",\n array: \"strokeDasharray\",\n};\n/**\n * Build SVG path properties. Uses the path's measured length to convert\n * our custom pathLength, pathSpacing and pathOffset into stroke-dashoffset\n * and stroke-dasharray attributes.\n *\n * This function is mutative to reduce per-frame GC.\n */\nfunction buildSVGPath(attrs, length, spacing = 1, offset = 0, useDashCase = true) {\n // Normalise path length by setting SVG attribute pathLength to 1\n attrs.pathLength = 1;\n // We use dash case when setting attributes directly to the DOM node and camel case\n // when defining props on a React component.\n const keys = useDashCase ? dashKeys : camelKeys;\n // Build the dash offset\n attrs[keys.offset] = px.transform(-offset);\n // Build the dash array\n const pathLength = px.transform(length);\n const pathSpacing = px.transform(spacing);\n attrs[keys.array] = `${pathLength} ${pathSpacing}`;\n}\n\nexport { buildSVGPath };\n","import { buildHTMLStyles } from '../../html/utils/build-styles.mjs';\nimport { calcSVGTransformOrigin } from './transform-origin.mjs';\nimport { buildSVGPath } from './path.mjs';\n\n/**\n * Build SVG visual attrbutes, like cx and style.transform\n */\nfunction buildSVGAttrs(state, { attrX, attrY, attrScale, originX, originY, pathLength, pathSpacing = 1, pathOffset = 0, \n// This is object creation, which we try to avoid per-frame.\n...latest }, options, isSVGTag, transformTemplate) {\n buildHTMLStyles(state, latest, options, transformTemplate);\n /**\n * For svg tags we just want to make sure viewBox is animatable and treat all the styles\n * as normal HTML tags.\n */\n if (isSVGTag) {\n if (state.style.viewBox) {\n state.attrs.viewBox = state.style.viewBox;\n }\n return;\n }\n state.attrs = state.style;\n state.style = {};\n const { attrs, style, dimensions } = state;\n /**\n * However, we apply transforms as CSS transforms. So if we detect a transform we take it from attrs\n * and copy it into style.\n */\n if (attrs.transform) {\n if (dimensions)\n style.transform = attrs.transform;\n delete attrs.transform;\n }\n // Parse transformOrigin\n if (dimensions &&\n (originX !== undefined || originY !== undefined || style.transform)) {\n style.transformOrigin = calcSVGTransformOrigin(dimensions, originX !== undefined ? originX : 0.5, originY !== undefined ? originY : 0.5);\n }\n // Render attrX/attrY/attrScale as attributes\n if (attrX !== undefined)\n attrs.x = attrX;\n if (attrY !== undefined)\n attrs.y = attrY;\n if (attrScale !== undefined)\n attrs.scale = attrScale;\n // Build SVG path if one has been defined\n if (pathLength !== undefined) {\n buildSVGPath(attrs, pathLength, pathSpacing, pathOffset, false);\n }\n}\n\nexport { buildSVGAttrs };\n","import { createHtmlRenderState } from '../../html/utils/create-render-state.mjs';\n\nconst createSvgRenderState = () => ({\n ...createHtmlRenderState(),\n attrs: {},\n});\n\nexport { createSvgRenderState };\n","const isSVGTag = (tag) => typeof tag === \"string\" && tag.toLowerCase() === \"svg\";\n\nexport { isSVGTag };\n","import { useMemo } from 'react';\nimport { copyRawValuesOnly } from '../html/use-props.mjs';\nimport { buildSVGAttrs } from './utils/build-attrs.mjs';\nimport { createSvgRenderState } from './utils/create-render-state.mjs';\nimport { isSVGTag } from './utils/is-svg-tag.mjs';\n\nfunction useSVGProps(props, visualState, _isStatic, Component) {\n const visualProps = useMemo(() => {\n const state = createSvgRenderState();\n buildSVGAttrs(state, visualState, { enableHardwareAcceleration: false }, isSVGTag(Component), props.transformTemplate);\n return {\n ...state.attrs,\n style: { ...state.style },\n };\n }, [visualState]);\n if (props.style) {\n const rawStyles = {};\n copyRawValuesOnly(rawStyles, props.style, props);\n visualProps.style = { ...rawStyles, ...visualProps.style };\n }\n return visualProps;\n}\n\nexport { useSVGProps };\n","import { Fragment, useMemo, createElement } from 'react';\nimport { useHTMLProps } from '../html/use-props.mjs';\nimport { filterProps } from './utils/filter-props.mjs';\nimport { isSVGComponent } from './utils/is-svg-component.mjs';\nimport { useSVGProps } from '../svg/use-props.mjs';\nimport { isMotionValue } from '../../value/utils/is-motion-value.mjs';\n\nfunction createUseRender(forwardMotionProps = false) {\n const useRender = (Component, props, ref, { latestValues }, isStatic) => {\n const useVisualProps = isSVGComponent(Component)\n ? useSVGProps\n : useHTMLProps;\n const visualProps = useVisualProps(props, latestValues, isStatic, Component);\n const filteredProps = filterProps(props, typeof Component === \"string\", forwardMotionProps);\n const elementProps = Component !== Fragment\n ? { ...filteredProps, ...visualProps, ref }\n : {};\n /**\n * If component has been handed a motion value as its child,\n * memoise its initial value and render that. Subsequent updates\n * will be handled by the onChange handler\n */\n const { children } = props;\n const renderedChildren = useMemo(() => (isMotionValue(children) ? children.get() : children), [children]);\n return createElement(Component, {\n ...elementProps,\n children: renderedChildren,\n });\n };\n return useRender;\n}\n\nexport { createUseRender };\n","function renderHTML(element, { style, vars }, styleProp, projection) {\n Object.assign(element.style, style, projection && projection.getProjectionStyles(styleProp));\n // Loop over any CSS variables and assign those.\n for (const key in vars) {\n element.style.setProperty(key, vars[key]);\n }\n}\n\nexport { renderHTML };\n","/**\n * A set of attribute names that are always read/written as camel case.\n */\nconst camelCaseAttributes = new Set([\n \"baseFrequency\",\n \"diffuseConstant\",\n \"kernelMatrix\",\n \"kernelUnitLength\",\n \"keySplines\",\n \"keyTimes\",\n \"limitingConeAngle\",\n \"markerHeight\",\n \"markerWidth\",\n \"numOctaves\",\n \"targetX\",\n \"targetY\",\n \"surfaceScale\",\n \"specularConstant\",\n \"specularExponent\",\n \"stdDeviation\",\n \"tableValues\",\n \"viewBox\",\n \"gradientTransform\",\n \"pathLength\",\n \"startOffset\",\n \"textLength\",\n \"lengthAdjust\",\n]);\n\nexport { camelCaseAttributes };\n","import { camelToDash } from '../../dom/utils/camel-to-dash.mjs';\nimport { renderHTML } from '../../html/utils/render.mjs';\nimport { camelCaseAttributes } from './camel-case-attrs.mjs';\n\nfunction renderSVG(element, renderState, _styleProp, projection) {\n renderHTML(element, renderState, undefined, projection);\n for (const key in renderState.attrs) {\n element.setAttribute(!camelCaseAttributes.has(key) ? camelToDash(key) : key, renderState.attrs[key]);\n }\n}\n\nexport { renderSVG };\n","import { isForcedMotionValue } from '../../../motion/utils/is-forced-motion-value.mjs';\nimport { isMotionValue } from '../../../value/utils/is-motion-value.mjs';\n\nfunction scrapeMotionValuesFromProps(props, prevProps, visualElement) {\n var _a;\n const { style } = props;\n const newValues = {};\n for (const key in style) {\n if (isMotionValue(style[key]) ||\n (prevProps.style &&\n isMotionValue(prevProps.style[key])) ||\n isForcedMotionValue(key, props) ||\n ((_a = visualElement === null || visualElement === void 0 ? void 0 : visualElement.getValue(key)) === null || _a === void 0 ? void 0 : _a.liveStyle) !== undefined) {\n newValues[key] = style[key];\n }\n }\n return newValues;\n}\n\nexport { scrapeMotionValuesFromProps };\n","import { isMotionValue } from '../../../value/utils/is-motion-value.mjs';\nimport { scrapeMotionValuesFromProps as scrapeMotionValuesFromProps$1 } from '../../html/utils/scrape-motion-values.mjs';\nimport { transformPropOrder } from '../../html/utils/transform.mjs';\n\nfunction scrapeMotionValuesFromProps(props, prevProps, visualElement) {\n const newValues = scrapeMotionValuesFromProps$1(props, prevProps, visualElement);\n for (const key in props) {\n if (isMotionValue(props[key]) ||\n isMotionValue(prevProps[key])) {\n const targetKey = transformPropOrder.indexOf(key) !== -1\n ? \"attr\" + key.charAt(0).toUpperCase() + key.substring(1)\n : key;\n newValues[targetKey] = props[key];\n }\n }\n return newValues;\n}\n\nexport { scrapeMotionValuesFromProps };\n","function getValueState(visualElement) {\n const state = [{}, {}];\n visualElement === null || visualElement === void 0 ? void 0 : visualElement.values.forEach((value, key) => {\n state[0][key] = value.get();\n state[1][key] = value.getVelocity();\n });\n return state;\n}\nfunction resolveVariantFromProps(props, definition, custom, visualElement) {\n /**\n * If the variant definition is a function, resolve.\n */\n if (typeof definition === \"function\") {\n const [current, velocity] = getValueState(visualElement);\n definition = definition(custom !== undefined ? custom : props.custom, current, velocity);\n }\n /**\n * If the variant definition is a variant label, or\n * the function returned a variant label, resolve.\n */\n if (typeof definition === \"string\") {\n definition = props.variants && props.variants[definition];\n }\n /**\n * At this point we've resolved both functions and variant labels,\n * but the resolved variant label might itself have been a function.\n * If so, resolve. This can only have returned a valid target object.\n */\n if (typeof definition === \"function\") {\n const [current, velocity] = getValueState(visualElement);\n definition = definition(custom !== undefined ? custom : props.custom, current, velocity);\n }\n return definition;\n}\n\nexport { resolveVariantFromProps };\n","import { useRef } from 'react';\n\n/**\n * Creates a constant value over the lifecycle of a component.\n *\n * Even if `useMemo` is provided an empty array as its final argument, it doesn't offer\n * a guarantee that it won't re-run for performance reasons later on. By using `useConstant`\n * you can ensure that initialisers don't execute twice or more.\n */\nfunction useConstant(init) {\n const ref = useRef(null);\n if (ref.current === null) {\n ref.current = init();\n }\n return ref.current;\n}\n\nexport { useConstant };\n","const isKeyframesTarget = (v) => {\n return Array.isArray(v);\n};\n\nexport { isKeyframesTarget };\n","import { isKeyframesTarget } from '../animation/utils/is-keyframes-target.mjs';\n\nconst isCustomValue = (v) => {\n return Boolean(v && typeof v === \"object\" && v.mix && v.toValue);\n};\nconst resolveFinalValueInKeyframes = (v) => {\n // TODO maybe throw if v.length - 1 is placeholder token?\n return isKeyframesTarget(v) ? v[v.length - 1] || 0 : v;\n};\n\nexport { isCustomValue, resolveFinalValueInKeyframes };\n","import { isCustomValue } from '../../utils/resolve-value.mjs';\nimport { isMotionValue } from './is-motion-value.mjs';\n\n/**\n * If the provided value is a MotionValue, this returns the actual value, otherwise just the value itself\n *\n * TODO: Remove and move to library\n */\nfunction resolveMotionValue(value) {\n const unwrappedValue = isMotionValue(value) ? value.get() : value;\n return isCustomValue(unwrappedValue)\n ? unwrappedValue.toValue()\n : unwrappedValue;\n}\n\nexport { resolveMotionValue };\n","import { useContext } from 'react';\nimport { isAnimationControls } from '../../animation/utils/is-animation-controls.mjs';\nimport { PresenceContext } from '../../context/PresenceContext.mjs';\nimport { resolveVariantFromProps } from '../../render/utils/resolve-variants.mjs';\nimport { useConstant } from '../../utils/use-constant.mjs';\nimport { resolveMotionValue } from '../../value/utils/resolve-motion-value.mjs';\nimport { MotionContext } from '../../context/MotionContext/index.mjs';\nimport { isControllingVariants, isVariantNode } from '../../render/utils/is-controlling-variants.mjs';\n\nfunction makeState({ scrapeMotionValuesFromProps, createRenderState, onMount, }, props, context, presenceContext) {\n const state = {\n latestValues: makeLatestValues(props, context, presenceContext, scrapeMotionValuesFromProps),\n renderState: createRenderState(),\n };\n if (onMount) {\n state.mount = (instance) => onMount(props, instance, state);\n }\n return state;\n}\nconst makeUseVisualState = (config) => (props, isStatic) => {\n const context = useContext(MotionContext);\n const presenceContext = useContext(PresenceContext);\n const make = () => makeState(config, props, context, presenceContext);\n return isStatic ? make() : useConstant(make);\n};\nfunction makeLatestValues(props, context, presenceContext, scrapeMotionValues) {\n const values = {};\n const motionValues = scrapeMotionValues(props, {});\n for (const key in motionValues) {\n values[key] = resolveMotionValue(motionValues[key]);\n }\n let { initial, animate } = props;\n const isControllingVariants$1 = isControllingVariants(props);\n const isVariantNode$1 = isVariantNode(props);\n if (context &&\n isVariantNode$1 &&\n !isControllingVariants$1 &&\n props.inherit !== false) {\n if (initial === undefined)\n initial = context.initial;\n if (animate === undefined)\n animate = context.animate;\n }\n let isInitialAnimationBlocked = presenceContext\n ? presenceContext.initial === false\n : false;\n isInitialAnimationBlocked = isInitialAnimationBlocked || initial === false;\n const variantToSet = isInitialAnimationBlocked ? animate : initial;\n if (variantToSet &&\n typeof variantToSet !== \"boolean\" &&\n !isAnimationControls(variantToSet)) {\n const list = Array.isArray(variantToSet) ? variantToSet : [variantToSet];\n list.forEach((definition) => {\n const resolved = resolveVariantFromProps(props, definition);\n if (!resolved)\n return;\n const { transitionEnd, transition, ...target } = resolved;\n for (const key in target) {\n let valueTarget = target[key];\n if (Array.isArray(valueTarget)) {\n /**\n * Take final keyframe if the initial animation is blocked because\n * we want to initialise at the end of that blocked animation.\n */\n const index = isInitialAnimationBlocked\n ? valueTarget.length - 1\n : 0;\n valueTarget = valueTarget[index];\n }\n if (valueTarget !== null) {\n values[key] = valueTarget;\n }\n }\n for (const key in transitionEnd)\n values[key] = transitionEnd[key];\n });\n }\n return values;\n}\n\nexport { makeUseVisualState };\n","const noop = (any) => any;\n\nexport { noop };\n","import { noop } from '../utils/noop.mjs';\nimport { createRenderBatcher } from './batcher.mjs';\n\nconst { schedule: frame, cancel: cancelFrame, state: frameData, steps, } = createRenderBatcher(typeof requestAnimationFrame !== \"undefined\" ? requestAnimationFrame : noop, true);\n\nexport { cancelFrame, frame, frameData, steps };\n","import { renderSVG } from './utils/render.mjs';\nimport { scrapeMotionValuesFromProps } from './utils/scrape-motion-values.mjs';\nimport { makeUseVisualState } from '../../motion/utils/use-visual-state.mjs';\nimport { createSvgRenderState } from './utils/create-render-state.mjs';\nimport { buildSVGAttrs } from './utils/build-attrs.mjs';\nimport { isSVGTag } from './utils/is-svg-tag.mjs';\nimport { frame } from '../../frameloop/frame.mjs';\n\nconst svgMotionConfig = {\n useVisualState: makeUseVisualState({\n scrapeMotionValuesFromProps: scrapeMotionValuesFromProps,\n createRenderState: createSvgRenderState,\n onMount: (props, instance, { renderState, latestValues }) => {\n frame.read(() => {\n try {\n renderState.dimensions =\n typeof instance.getBBox ===\n \"function\"\n ? instance.getBBox()\n : instance.getBoundingClientRect();\n }\n catch (e) {\n // Most likely trying to measure an unrendered element under Firefox\n renderState.dimensions = {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n };\n }\n });\n frame.render(() => {\n buildSVGAttrs(renderState, latestValues, { enableHardwareAcceleration: false }, isSVGTag(instance.tagName), props.transformTemplate);\n renderSVG(instance, renderState);\n });\n },\n }),\n};\n\nexport { svgMotionConfig };\n","import { makeUseVisualState } from '../../motion/utils/use-visual-state.mjs';\nimport { scrapeMotionValuesFromProps } from './utils/scrape-motion-values.mjs';\nimport { createHtmlRenderState } from './utils/create-render-state.mjs';\n\nconst htmlMotionConfig = {\n useVisualState: makeUseVisualState({\n scrapeMotionValuesFromProps,\n createRenderState: createHtmlRenderState,\n }),\n};\n\nexport { htmlMotionConfig };\n","import { isSVGComponent } from './is-svg-component.mjs';\nimport { createUseRender } from '../use-render.mjs';\nimport { svgMotionConfig } from '../../svg/config-motion.mjs';\nimport { htmlMotionConfig } from '../../html/config-motion.mjs';\n\nfunction createDomMotionConfig(Component, { forwardMotionProps = false }, preloadedFeatures, createVisualElement) {\n const baseConfig = isSVGComponent(Component)\n ? svgMotionConfig\n : htmlMotionConfig;\n return {\n ...baseConfig,\n preloadedFeatures,\n useRender: createUseRender(forwardMotionProps),\n createVisualElement,\n Component,\n };\n}\n\nexport { createDomMotionConfig };\n","function addDomEvent(target, eventName, handler, options = { passive: true }) {\n target.addEventListener(eventName, handler, options);\n return () => target.removeEventListener(eventName, handler);\n}\n\nexport { addDomEvent };\n","const isPrimaryPointer = (event) => {\n if (event.pointerType === \"mouse\") {\n return typeof event.button !== \"number\" || event.button <= 0;\n }\n else {\n /**\n * isPrimary is true for all mice buttons, whereas every touch point\n * is regarded as its own input. So subsequent concurrent touch points\n * will be false.\n *\n * Specifically match against false here as incomplete versions of\n * PointerEvents in very old browser might have it set as undefined.\n */\n return event.isPrimary !== false;\n }\n};\n\nexport { isPrimaryPointer };\n","import { isPrimaryPointer } from './utils/is-primary-pointer.mjs';\n\nfunction extractEventInfo(event, pointType = \"page\") {\n return {\n point: {\n x: event[`${pointType}X`],\n y: event[`${pointType}Y`],\n },\n };\n}\nconst addPointerInfo = (handler) => {\n return (event) => isPrimaryPointer(event) && handler(event, extractEventInfo(event));\n};\n\nexport { addPointerInfo, extractEventInfo };\n","import { addDomEvent } from './add-dom-event.mjs';\nimport { addPointerInfo } from './event-info.mjs';\n\nfunction addPointerEvent(target, eventName, handler, options) {\n return addDomEvent(target, eventName, addPointerInfo(handler), options);\n}\n\nexport { addPointerEvent };\n","/**\n * Pipe\n * Compose other transformers to run linearily\n * pipe(min(20), max(40))\n * @param {...functions} transformers\n * @return {function}\n */\nconst combineFunctions = (a, b) => (v) => b(a(v));\nconst pipe = (...transformers) => transformers.reduce(combineFunctions);\n\nexport { pipe };\n","function createLock(name) {\n let lock = null;\n return () => {\n const openLock = () => {\n lock = null;\n };\n if (lock === null) {\n lock = name;\n return openLock;\n }\n return false;\n };\n}\nconst globalHorizontalLock = createLock(\"dragHorizontal\");\nconst globalVerticalLock = createLock(\"dragVertical\");\nfunction getGlobalLock(drag) {\n let lock = false;\n if (drag === \"y\") {\n lock = globalVerticalLock();\n }\n else if (drag === \"x\") {\n lock = globalHorizontalLock();\n }\n else {\n const openHorizontal = globalHorizontalLock();\n const openVertical = globalVerticalLock();\n if (openHorizontal && openVertical) {\n lock = () => {\n openHorizontal();\n openVertical();\n };\n }\n else {\n // Release the locks because we don't use them\n if (openHorizontal)\n openHorizontal();\n if (openVertical)\n openVertical();\n }\n }\n return lock;\n}\nfunction isDragActive() {\n // Check the gesture lock - if we get it, it means no drag gesture is active\n // and we can safely fire the tap gesture.\n const openGestureLock = getGlobalLock(true);\n if (!openGestureLock)\n return true;\n openGestureLock();\n return false;\n}\n\nexport { createLock, getGlobalLock, isDragActive };\n","class Feature {\n constructor(node) {\n this.isMounted = false;\n this.node = node;\n }\n update() { }\n}\n\nexport { Feature };\n","import { addPointerEvent } from '../events/add-pointer-event.mjs';\nimport { pipe } from '../utils/pipe.mjs';\nimport { isDragActive } from './drag/utils/lock.mjs';\nimport { Feature } from '../motion/features/Feature.mjs';\nimport { frame } from '../frameloop/frame.mjs';\n\nfunction addHoverEvent(node, isActive) {\n const eventName = isActive ? \"pointerenter\" : \"pointerleave\";\n const callbackName = isActive ? \"onHoverStart\" : \"onHoverEnd\";\n const handleEvent = (event, info) => {\n if (event.pointerType === \"touch\" || isDragActive())\n return;\n const props = node.getProps();\n if (node.animationState && props.whileHover) {\n node.animationState.setActive(\"whileHover\", isActive);\n }\n const callback = props[callbackName];\n if (callback) {\n frame.postRender(() => callback(event, info));\n }\n };\n return addPointerEvent(node.current, eventName, handleEvent, {\n passive: !node.getProps()[callbackName],\n });\n}\nclass HoverGesture extends Feature {\n mount() {\n this.unmount = pipe(addHoverEvent(this.node, true), addHoverEvent(this.node, false));\n }\n unmount() { }\n}\n\nexport { HoverGesture };\n","import { addDomEvent } from '../events/add-dom-event.mjs';\nimport { Feature } from '../motion/features/Feature.mjs';\nimport { pipe } from '../utils/pipe.mjs';\n\nclass FocusGesture extends Feature {\n constructor() {\n super(...arguments);\n this.isActive = false;\n }\n onFocus() {\n let isFocusVisible = false;\n /**\n * If this element doesn't match focus-visible then don't\n * apply whileHover. But, if matches throws that focus-visible\n * is not a valid selector then in that browser outline styles will be applied\n * to the element by default and we want to match that behaviour with whileFocus.\n */\n try {\n isFocusVisible = this.node.current.matches(\":focus-visible\");\n }\n catch (e) {\n isFocusVisible = true;\n }\n if (!isFocusVisible || !this.node.animationState)\n return;\n this.node.animationState.setActive(\"whileFocus\", true);\n this.isActive = true;\n }\n onBlur() {\n if (!this.isActive || !this.node.animationState)\n return;\n this.node.animationState.setActive(\"whileFocus\", false);\n this.isActive = false;\n }\n mount() {\n this.unmount = pipe(addDomEvent(this.node.current, \"focus\", () => this.onFocus()), addDomEvent(this.node.current, \"blur\", () => this.onBlur()));\n }\n unmount() { }\n}\n\nexport { FocusGesture };\n","/**\n * Recursively traverse up the tree to check whether the provided child node\n * is the parent or a descendant of it.\n *\n * @param parent - Element to find\n * @param child - Element to test against parent\n */\nconst isNodeOrChild = (parent, child) => {\n if (!child) {\n return false;\n }\n else if (parent === child) {\n return true;\n }\n else {\n return isNodeOrChild(parent, child.parentElement);\n }\n};\n\nexport { isNodeOrChild };\n","import { extractEventInfo } from '../events/event-info.mjs';\nimport { addDomEvent } from '../events/add-dom-event.mjs';\nimport { addPointerEvent } from '../events/add-pointer-event.mjs';\nimport { Feature } from '../motion/features/Feature.mjs';\nimport { pipe } from '../utils/pipe.mjs';\nimport { isDragActive } from './drag/utils/lock.mjs';\nimport { isNodeOrChild } from './utils/is-node-or-child.mjs';\nimport { noop } from '../utils/noop.mjs';\nimport { frame } from '../frameloop/frame.mjs';\n\nfunction fireSyntheticPointerEvent(name, handler) {\n if (!handler)\n return;\n const syntheticPointerEvent = new PointerEvent(\"pointer\" + name);\n handler(syntheticPointerEvent, extractEventInfo(syntheticPointerEvent));\n}\nclass PressGesture extends Feature {\n constructor() {\n super(...arguments);\n this.removeStartListeners = noop;\n this.removeEndListeners = noop;\n this.removeAccessibleListeners = noop;\n this.startPointerPress = (startEvent, startInfo) => {\n if (this.isPressing)\n return;\n this.removeEndListeners();\n const props = this.node.getProps();\n const endPointerPress = (endEvent, endInfo) => {\n if (!this.checkPressEnd())\n return;\n const { onTap, onTapCancel, globalTapTarget } = this.node.getProps();\n /**\n * We only count this as a tap gesture if the event.target is the same\n * as, or a child of, this component's element\n */\n const handler = !globalTapTarget &&\n !isNodeOrChild(this.node.current, endEvent.target)\n ? onTapCancel\n : onTap;\n if (handler) {\n frame.update(() => handler(endEvent, endInfo));\n }\n };\n const removePointerUpListener = addPointerEvent(window, \"pointerup\", endPointerPress, {\n passive: !(props.onTap || props[\"onPointerUp\"]),\n });\n const removePointerCancelListener = addPointerEvent(window, \"pointercancel\", (cancelEvent, cancelInfo) => this.cancelPress(cancelEvent, cancelInfo), {\n passive: !(props.onTapCancel ||\n props[\"onPointerCancel\"]),\n });\n this.removeEndListeners = pipe(removePointerUpListener, removePointerCancelListener);\n this.startPress(startEvent, startInfo);\n };\n this.startAccessiblePress = () => {\n const handleKeydown = (keydownEvent) => {\n if (keydownEvent.key !== \"Enter\" || this.isPressing)\n return;\n const handleKeyup = (keyupEvent) => {\n if (keyupEvent.key !== \"Enter\" || !this.checkPressEnd())\n return;\n fireSyntheticPointerEvent(\"up\", (event, info) => {\n const { onTap } = this.node.getProps();\n if (onTap) {\n frame.postRender(() => onTap(event, info));\n }\n });\n };\n this.removeEndListeners();\n this.removeEndListeners = addDomEvent(this.node.current, \"keyup\", handleKeyup);\n fireSyntheticPointerEvent(\"down\", (event, info) => {\n this.startPress(event, info);\n });\n };\n const removeKeydownListener = addDomEvent(this.node.current, \"keydown\", handleKeydown);\n const handleBlur = () => {\n if (!this.isPressing)\n return;\n fireSyntheticPointerEvent(\"cancel\", (cancelEvent, cancelInfo) => this.cancelPress(cancelEvent, cancelInfo));\n };\n const removeBlurListener = addDomEvent(this.node.current, \"blur\", handleBlur);\n this.removeAccessibleListeners = pipe(removeKeydownListener, removeBlurListener);\n };\n }\n startPress(event, info) {\n this.isPressing = true;\n const { onTapStart, whileTap } = this.node.getProps();\n /**\n * Ensure we trigger animations before firing event callback\n */\n if (whileTap && this.node.animationState) {\n this.node.animationState.setActive(\"whileTap\", true);\n }\n if (onTapStart) {\n frame.postRender(() => onTapStart(event, info));\n }\n }\n checkPressEnd() {\n this.removeEndListeners();\n this.isPressing = false;\n const props = this.node.getProps();\n if (props.whileTap && this.node.animationState) {\n this.node.animationState.setActive(\"whileTap\", false);\n }\n return !isDragActive();\n }\n cancelPress(event, info) {\n if (!this.checkPressEnd())\n return;\n const { onTapCancel } = this.node.getProps();\n if (onTapCancel) {\n frame.postRender(() => onTapCancel(event, info));\n }\n }\n mount() {\n const props = this.node.getProps();\n const removePointerListener = addPointerEvent(props.globalTapTarget ? window : this.node.current, \"pointerdown\", this.startPointerPress, {\n passive: !(props.onTapStart ||\n props[\"onPointerStart\"]),\n });\n const removeFocusListener = addDomEvent(this.node.current, \"focus\", this.startAccessiblePress);\n this.removeStartListeners = pipe(removePointerListener, removeFocusListener);\n }\n unmount() {\n this.removeStartListeners();\n this.removeEndListeners();\n this.removeAccessibleListeners();\n }\n}\n\nexport { PressGesture };\n","/**\n * Map an IntersectionHandler callback to an element. We only ever make one handler for one\n * element, so even though these handlers might all be triggered by different\n * observers, we can keep them in the same map.\n */\nconst observerCallbacks = new WeakMap();\n/**\n * Multiple observers can be created for multiple element/document roots. Each with\n * different settings. So here we store dictionaries of observers to each root,\n * using serialised settings (threshold/margin) as lookup keys.\n */\nconst observers = new WeakMap();\nconst fireObserverCallback = (entry) => {\n const callback = observerCallbacks.get(entry.target);\n callback && callback(entry);\n};\nconst fireAllObserverCallbacks = (entries) => {\n entries.forEach(fireObserverCallback);\n};\nfunction initIntersectionObserver({ root, ...options }) {\n const lookupRoot = root || document;\n /**\n * If we don't have an observer lookup map for this root, create one.\n */\n if (!observers.has(lookupRoot)) {\n observers.set(lookupRoot, {});\n }\n const rootObservers = observers.get(lookupRoot);\n const key = JSON.stringify(options);\n /**\n * If we don't have an observer for this combination of root and settings,\n * create one.\n */\n if (!rootObservers[key]) {\n rootObservers[key] = new IntersectionObserver(fireAllObserverCallbacks, { root, ...options });\n }\n return rootObservers[key];\n}\nfunction observeIntersection(element, options, callback) {\n const rootInteresectionObserver = initIntersectionObserver(options);\n observerCallbacks.set(element, callback);\n rootInteresectionObserver.observe(element);\n return () => {\n observerCallbacks.delete(element);\n rootInteresectionObserver.unobserve(element);\n };\n}\n\nexport { observeIntersection };\n","import { Feature } from '../Feature.mjs';\nimport { observeIntersection } from './observers.mjs';\n\nconst thresholdNames = {\n some: 0,\n all: 1,\n};\nclass InViewFeature extends Feature {\n constructor() {\n super(...arguments);\n this.hasEnteredView = false;\n this.isInView = false;\n }\n startObserver() {\n this.unmount();\n const { viewport = {} } = this.node.getProps();\n const { root, margin: rootMargin, amount = \"some\", once } = viewport;\n const options = {\n root: root ? root.current : undefined,\n rootMargin,\n threshold: typeof amount === \"number\" ? amount : thresholdNames[amount],\n };\n const onIntersectionUpdate = (entry) => {\n const { isIntersecting } = entry;\n /**\n * If there's been no change in the viewport state, early return.\n */\n if (this.isInView === isIntersecting)\n return;\n this.isInView = isIntersecting;\n /**\n * Handle hasEnteredView. If this is only meant to run once, and\n * element isn't visible, early return. Otherwise set hasEnteredView to true.\n */\n if (once && !isIntersecting && this.hasEnteredView) {\n return;\n }\n else if (isIntersecting) {\n this.hasEnteredView = true;\n }\n if (this.node.animationState) {\n this.node.animationState.setActive(\"whileInView\", isIntersecting);\n }\n /**\n * Use the latest committed props rather than the ones in scope\n * when this observer is created\n */\n const { onViewportEnter, onViewportLeave } = this.node.getProps();\n const callback = isIntersecting ? onViewportEnter : onViewportLeave;\n callback && callback(entry);\n };\n return observeIntersection(this.node.current, options, onIntersectionUpdate);\n }\n mount() {\n this.startObserver();\n }\n update() {\n if (typeof IntersectionObserver === \"undefined\")\n return;\n const { props, prevProps } = this.node;\n const hasOptionsChanged = [\"amount\", \"margin\", \"root\"].some(hasViewportOptionChanged(props, prevProps));\n if (hasOptionsChanged) {\n this.startObserver();\n }\n }\n unmount() { }\n}\nfunction hasViewportOptionChanged({ viewport = {} }, { viewport: prevViewport = {} } = {}) {\n return (name) => viewport[name] !== prevViewport[name];\n}\n\nexport { InViewFeature };\n","import { HoverGesture } from '../../gestures/hover.mjs';\nimport { FocusGesture } from '../../gestures/focus.mjs';\nimport { PressGesture } from '../../gestures/press.mjs';\nimport { InViewFeature } from './viewport/index.mjs';\n\nconst gestureAnimations = {\n inView: {\n Feature: InViewFeature,\n },\n tap: {\n Feature: PressGesture,\n },\n focus: {\n Feature: FocusGesture,\n },\n hover: {\n Feature: HoverGesture,\n },\n};\n\nexport { gestureAnimations };\n","function shallowCompare(next, prev) {\n if (!Array.isArray(prev))\n return false;\n const prevLength = prev.length;\n if (prevLength !== next.length)\n return false;\n for (let i = 0; i < prevLength; i++) {\n if (prev[i] !== next[i])\n return false;\n }\n return true;\n}\n\nexport { shallowCompare };\n","import { resolveVariantFromProps } from './resolve-variants.mjs';\n\nfunction resolveVariant(visualElement, definition, custom) {\n const props = visualElement.getProps();\n return resolveVariantFromProps(props, definition, custom !== undefined ? custom : props.custom, visualElement);\n}\n\nexport { resolveVariant };\n","/**\n * Converts seconds to milliseconds\n *\n * @param seconds - Time in seconds.\n * @return milliseconds - Converted time in milliseconds.\n */\nconst secondsToMilliseconds = (seconds) => seconds * 1000;\nconst millisecondsToSeconds = (milliseconds) => milliseconds / 1000;\n\nexport { millisecondsToSeconds, secondsToMilliseconds };\n","import { transformProps } from '../../render/html/utils/transform.mjs';\n\nconst underDampedSpring = {\n type: \"spring\",\n stiffness: 500,\n damping: 25,\n restSpeed: 10,\n};\nconst criticallyDampedSpring = (target) => ({\n type: \"spring\",\n stiffness: 550,\n damping: target === 0 ? 2 * Math.sqrt(550) : 30,\n restSpeed: 10,\n});\nconst keyframesTransition = {\n type: \"keyframes\",\n duration: 0.8,\n};\n/**\n * Default easing curve is a slightly shallower version of\n * the default browser easing curve.\n */\nconst ease = {\n type: \"keyframes\",\n ease: [0.25, 0.1, 0.35, 1],\n duration: 0.3,\n};\nconst getDefaultTransition = (valueKey, { keyframes }) => {\n if (keyframes.length > 2) {\n return keyframesTransition;\n }\n else if (transformProps.has(valueKey)) {\n return valueKey.startsWith(\"scale\")\n ? criticallyDampedSpring(keyframes[1])\n : underDampedSpring;\n }\n return ease;\n};\n\nexport { getDefaultTransition };\n","/**\n * Decide whether a transition is defined on a given Transition.\n * This filters out orchestration options and returns true\n * if any options are left.\n */\nfunction isTransitionDefined({ when, delay: _delay, delayChildren, staggerChildren, staggerDirection, repeat, repeatType, repeatDelay, from, elapsed, ...transition }) {\n return !!Object.keys(transition).length;\n}\nfunction getValueTransition(transition, key) {\n return (transition[key] ||\n transition[\"default\"] ||\n transition);\n}\n\nexport { getValueTransition, isTransitionDefined };\n","const isNotNull = (value) => value !== null;\nfunction getFinalKeyframe(keyframes, { repeat, repeatType = \"loop\" }, finalKeyframe) {\n const resolvedKeyframes = keyframes.filter(isNotNull);\n const index = repeat && repeatType !== \"loop\" && repeat % 2 === 1\n ? 0\n : resolvedKeyframes.length - 1;\n return !index || finalKeyframe === undefined\n ? resolvedKeyframes[index]\n : finalKeyframe;\n}\n\nexport { getFinalKeyframe };\n","import { MotionGlobalConfig } from '../utils/GlobalConfig.mjs';\nimport { frameData } from './frame.mjs';\n\nlet now;\nfunction clearTime() {\n now = undefined;\n}\n/**\n * An eventloop-synchronous alternative to performance.now().\n *\n * Ensures that time measurements remain consistent within a synchronous context.\n * Usually calling performance.now() twice within the same synchronous context\n * will return different values which isn't useful for animations when we're usually\n * trying to sync animations to the same frame.\n */\nconst time = {\n now: () => {\n if (now === undefined) {\n time.set(frameData.isProcessing || MotionGlobalConfig.useManualTiming\n ? frameData.timestamp\n : performance.now());\n }\n return now;\n },\n set: (newTime) => {\n now = newTime;\n queueMicrotask(clearTime);\n },\n};\n\nexport { time };\n","/**\n * Check if the value is a zero value string like \"0px\" or \"0%\"\n */\nconst isZeroValueString = (v) => /^0[^.\\s]+$/u.test(v);\n\nexport { isZeroValueString };\n","import { isZeroValueString } from '../../utils/is-zero-value-string.mjs';\n\nfunction isNone(value) {\n if (typeof value === \"number\") {\n return value === 0;\n }\n else if (value !== null) {\n return value === \"none\" || value === \"0\" || isZeroValueString(value);\n }\n else {\n return true;\n }\n}\n\nexport { isNone };\n","import { noop } from './noop.mjs';\n\nlet warning = noop;\nlet invariant = noop;\nif (process.env.NODE_ENV !== \"production\") {\n warning = (check, message) => {\n if (!check && typeof console !== \"undefined\") {\n console.warn(message);\n }\n };\n invariant = (check, message) => {\n if (!check) {\n throw new Error(message);\n }\n };\n}\n\nexport { invariant, warning };\n","/**\n * Check if value is a numerical string, ie a string that is purely a number eg \"100\" or \"-100.1\"\n */\nconst isNumericalString = (v) => /^-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)$/u.test(v);\n\nexport { isNumericalString };\n","import { invariant } from '../../../utils/errors.mjs';\nimport { isNumericalString } from '../../../utils/is-numerical-string.mjs';\nimport { isCSSVariableToken } from './is-css-variable.mjs';\n\n/**\n * Parse Framer's special CSS variable format into a CSS token and a fallback.\n *\n * ```\n * `var(--foo, #fff)` => [`--foo`, '#fff']\n * ```\n *\n * @param current\n */\nconst splitCSSVariableRegex = \n// eslint-disable-next-line redos-detector/no-unsafe-regex -- false positive, as it can match a lot of words\n/^var\\(--(?:([\\w-]+)|([\\w-]+), ?([a-zA-Z\\d ()%#.,-]+))\\)/u;\nfunction parseCSSVariable(current) {\n const match = splitCSSVariableRegex.exec(current);\n if (!match)\n return [,];\n const [, token1, token2, fallback] = match;\n return [`--${token1 !== null && token1 !== void 0 ? token1 : token2}`, fallback];\n}\nconst maxDepth = 4;\nfunction getVariableValue(current, element, depth = 1) {\n invariant(depth <= maxDepth, `Max CSS variable fallback depth detected in property \"${current}\". This may indicate a circular fallback dependency.`);\n const [token, fallback] = parseCSSVariable(current);\n // No CSS variable detected\n if (!token)\n return;\n // Attempt to read this CSS variable off the element\n const resolved = window.getComputedStyle(element).getPropertyValue(token);\n if (resolved) {\n const trimmed = resolved.trim();\n return isNumericalString(trimmed) ? parseFloat(trimmed) : trimmed;\n }\n return isCSSVariableToken(fallback)\n ? getVariableValue(fallback, element, depth + 1)\n : fallback;\n}\n\nexport { getVariableValue, parseCSSVariable };\n","import { transformPropOrder } from '../../html/utils/transform.mjs';\nimport { number } from '../../../value/types/numbers/index.mjs';\nimport { px } from '../../../value/types/numbers/units.mjs';\n\nconst positionalKeys = new Set([\n \"width\",\n \"height\",\n \"top\",\n \"left\",\n \"right\",\n \"bottom\",\n \"x\",\n \"y\",\n \"translateX\",\n \"translateY\",\n]);\nconst isNumOrPxType = (v) => v === number || v === px;\nconst getPosFromMatrix = (matrix, pos) => parseFloat(matrix.split(\", \")[pos]);\nconst getTranslateFromMatrix = (pos2, pos3) => (_bbox, { transform }) => {\n if (transform === \"none\" || !transform)\n return 0;\n const matrix3d = transform.match(/^matrix3d\\((.+)\\)$/u);\n if (matrix3d) {\n return getPosFromMatrix(matrix3d[1], pos3);\n }\n else {\n const matrix = transform.match(/^matrix\\((.+)\\)$/u);\n if (matrix) {\n return getPosFromMatrix(matrix[1], pos2);\n }\n else {\n return 0;\n }\n }\n};\nconst transformKeys = new Set([\"x\", \"y\", \"z\"]);\nconst nonTranslationalTransformKeys = transformPropOrder.filter((key) => !transformKeys.has(key));\nfunction removeNonTranslationalTransform(visualElement) {\n const removedTransforms = [];\n nonTranslationalTransformKeys.forEach((key) => {\n const value = visualElement.getValue(key);\n if (value !== undefined) {\n removedTransforms.push([key, value.get()]);\n value.set(key.startsWith(\"scale\") ? 1 : 0);\n }\n });\n return removedTransforms;\n}\nconst positionalValues = {\n // Dimensions\n width: ({ x }, { paddingLeft = \"0\", paddingRight = \"0\" }) => x.max - x.min - parseFloat(paddingLeft) - parseFloat(paddingRight),\n height: ({ y }, { paddingTop = \"0\", paddingBottom = \"0\" }) => y.max - y.min - parseFloat(paddingTop) - parseFloat(paddingBottom),\n top: (_bbox, { top }) => parseFloat(top),\n left: (_bbox, { left }) => parseFloat(left),\n bottom: ({ y }, { top }) => parseFloat(top) + (y.max - y.min),\n right: ({ x }, { left }) => parseFloat(left) + (x.max - x.min),\n // Transform\n x: getTranslateFromMatrix(4, 13),\n y: getTranslateFromMatrix(5, 14),\n};\n// Alias translate longform names\npositionalValues.translateX = positionalValues.x;\npositionalValues.translateY = positionalValues.y;\n\nexport { isNumOrPxType, positionalKeys, positionalValues, removeNonTranslationalTransform };\n","/**\n * Tests a provided value against a ValueType\n */\nconst testValueType = (v) => (type) => type.test(v);\n\nexport { testValueType };\n","/**\n * ValueType for \"auto\"\n */\nconst auto = {\n test: (v) => v === \"auto\",\n parse: (v) => v,\n};\n\nexport { auto };\n","import { number } from '../../../value/types/numbers/index.mjs';\nimport { px, percent, degrees, vw, vh } from '../../../value/types/numbers/units.mjs';\nimport { testValueType } from './test.mjs';\nimport { auto } from './type-auto.mjs';\n\n/**\n * A list of value types commonly used for dimensions\n */\nconst dimensionValueTypes = [number, px, percent, degrees, vw, vh, auto];\n/**\n * Tests a dimensional value against the list of dimension ValueTypes\n */\nconst findDimensionValueType = (v) => dimensionValueTypes.find(testValueType(v));\n\nexport { dimensionValueTypes, findDimensionValueType };\n","import { removeNonTranslationalTransform } from '../dom/utils/unit-conversion.mjs';\nimport { frame } from '../../frameloop/frame.mjs';\n\nconst toResolve = new Set();\nlet isScheduled = false;\nlet anyNeedsMeasurement = false;\nfunction measureAllKeyframes() {\n if (anyNeedsMeasurement) {\n const resolversToMeasure = Array.from(toResolve).filter((resolver) => resolver.needsMeasurement);\n const elementsToMeasure = new Set(resolversToMeasure.map((resolver) => resolver.element));\n const transformsToRestore = new Map();\n /**\n * Write pass\n * If we're measuring elements we want to remove bounding box-changing transforms.\n */\n elementsToMeasure.forEach((element) => {\n const removedTransforms = removeNonTranslationalTransform(element);\n if (!removedTransforms.length)\n return;\n transformsToRestore.set(element, removedTransforms);\n element.render();\n });\n // Read\n resolversToMeasure.forEach((resolver) => resolver.measureInitialState());\n // Write\n elementsToMeasure.forEach((element) => {\n element.render();\n const restore = transformsToRestore.get(element);\n if (restore) {\n restore.forEach(([key, value]) => {\n var _a;\n (_a = element.getValue(key)) === null || _a === void 0 ? void 0 : _a.set(value);\n });\n }\n });\n // Read\n resolversToMeasure.forEach((resolver) => resolver.measureEndState());\n // Write\n resolversToMeasure.forEach((resolver) => {\n if (resolver.suspendedScrollY !== undefined) {\n window.scrollTo(0, resolver.suspendedScrollY);\n }\n });\n }\n anyNeedsMeasurement = false;\n isScheduled = false;\n toResolve.forEach((resolver) => resolver.complete());\n toResolve.clear();\n}\nfunction readAllKeyframes() {\n toResolve.forEach((resolver) => {\n resolver.readKeyframes();\n if (resolver.needsMeasurement) {\n anyNeedsMeasurement = true;\n }\n });\n}\nfunction flushKeyframeResolvers() {\n readAllKeyframes();\n measureAllKeyframes();\n}\nclass KeyframeResolver {\n constructor(unresolvedKeyframes, onComplete, name, motionValue, element, isAsync = false) {\n /**\n * Track whether this resolver has completed. Once complete, it never\n * needs to attempt keyframe resolution again.\n */\n this.isComplete = false;\n /**\n * Track whether this resolver is async. If it is, it'll be added to the\n * resolver queue and flushed in the next frame. Resolvers that aren't going\n * to trigger read/write thrashing don't need to be async.\n */\n this.isAsync = false;\n /**\n * Track whether this resolver needs to perform a measurement\n * to resolve its keyframes.\n */\n this.needsMeasurement = false;\n /**\n * Track whether this resolver is currently scheduled to resolve\n * to allow it to be cancelled and resumed externally.\n */\n this.isScheduled = false;\n this.unresolvedKeyframes = [...unresolvedKeyframes];\n this.onComplete = onComplete;\n this.name = name;\n this.motionValue = motionValue;\n this.element = element;\n this.isAsync = isAsync;\n }\n scheduleResolve() {\n this.isScheduled = true;\n if (this.isAsync) {\n toResolve.add(this);\n if (!isScheduled) {\n isScheduled = true;\n frame.read(readAllKeyframes);\n frame.resolveKeyframes(measureAllKeyframes);\n }\n }\n else {\n this.readKeyframes();\n this.complete();\n }\n }\n readKeyframes() {\n const { unresolvedKeyframes, name, element, motionValue } = this;\n /**\n * If a keyframe is null, we hydrate it either by reading it from\n * the instance, or propagating from previous keyframes.\n */\n for (let i = 0; i < unresolvedKeyframes.length; i++) {\n if (unresolvedKeyframes[i] === null) {\n /**\n * If the first keyframe is null, we need to find its value by sampling the element\n */\n if (i === 0) {\n const currentValue = motionValue === null || motionValue === void 0 ? void 0 : motionValue.get();\n const finalKeyframe = unresolvedKeyframes[unresolvedKeyframes.length - 1];\n if (currentValue !== undefined) {\n unresolvedKeyframes[0] = currentValue;\n }\n else if (element && name) {\n const valueAsRead = element.readValue(name, finalKeyframe);\n if (valueAsRead !== undefined && valueAsRead !== null) {\n unresolvedKeyframes[0] = valueAsRead;\n }\n }\n if (unresolvedKeyframes[0] === undefined) {\n unresolvedKeyframes[0] = finalKeyframe;\n }\n if (motionValue && currentValue === undefined) {\n motionValue.set(unresolvedKeyframes[0]);\n }\n }\n else {\n unresolvedKeyframes[i] = unresolvedKeyframes[i - 1];\n }\n }\n }\n }\n setFinalKeyframe() { }\n measureInitialState() { }\n renderEndStyles() { }\n measureEndState() { }\n complete() {\n this.isComplete = true;\n this.onComplete(this.unresolvedKeyframes, this.finalKeyframe);\n toResolve.delete(this);\n }\n cancel() {\n if (!this.isComplete) {\n this.isScheduled = false;\n toResolve.delete(this);\n }\n }\n resume() {\n if (!this.isComplete)\n this.scheduleResolve();\n }\n}\n\nexport { KeyframeResolver, flushKeyframeResolvers };\n","import { isString, singleColorRegex, floatRegex } from '../utils.mjs';\n\n/**\n * Returns true if the provided string is a color, ie rgba(0,0,0,0) or #000,\n * but false if a number or multiple colors\n */\nconst isColorString = (type, testProp) => (v) => {\n return Boolean((isString(v) && singleColorRegex.test(v) && v.startsWith(type)) ||\n (testProp && Object.prototype.hasOwnProperty.call(v, testProp)));\n};\nconst splitColor = (aName, bName, cName) => (v) => {\n if (!isString(v))\n return v;\n const [a, b, c, alpha] = v.match(floatRegex);\n return {\n [aName]: parseFloat(a),\n [bName]: parseFloat(b),\n [cName]: parseFloat(c),\n alpha: alpha !== undefined ? parseFloat(alpha) : 1,\n };\n};\n\nexport { isColorString, splitColor };\n","import { clamp } from '../../../utils/clamp.mjs';\nimport { number, alpha } from '../numbers/index.mjs';\nimport { sanitize } from '../utils.mjs';\nimport { isColorString, splitColor } from './utils.mjs';\n\nconst clampRgbUnit = (v) => clamp(0, 255, v);\nconst rgbUnit = {\n ...number,\n transform: (v) => Math.round(clampRgbUnit(v)),\n};\nconst rgba = {\n test: isColorString(\"rgb\", \"red\"),\n parse: splitColor(\"red\", \"green\", \"blue\"),\n transform: ({ red, green, blue, alpha: alpha$1 = 1 }) => \"rgba(\" +\n rgbUnit.transform(red) +\n \", \" +\n rgbUnit.transform(green) +\n \", \" +\n rgbUnit.transform(blue) +\n \", \" +\n sanitize(alpha.transform(alpha$1)) +\n \")\",\n};\n\nexport { rgbUnit, rgba };\n","import { rgba } from './rgba.mjs';\nimport { isColorString } from './utils.mjs';\n\nfunction parseHex(v) {\n let r = \"\";\n let g = \"\";\n let b = \"\";\n let a = \"\";\n // If we have 6 characters, ie #FF0000\n if (v.length > 5) {\n r = v.substring(1, 3);\n g = v.substring(3, 5);\n b = v.substring(5, 7);\n a = v.substring(7, 9);\n // Or we have 3 characters, ie #F00\n }\n else {\n r = v.substring(1, 2);\n g = v.substring(2, 3);\n b = v.substring(3, 4);\n a = v.substring(4, 5);\n r += r;\n g += g;\n b += b;\n a += a;\n }\n return {\n red: parseInt(r, 16),\n green: parseInt(g, 16),\n blue: parseInt(b, 16),\n alpha: a ? parseInt(a, 16) / 255 : 1,\n };\n}\nconst hex = {\n test: isColorString(\"#\"),\n parse: parseHex,\n transform: rgba.transform,\n};\n\nexport { hex };\n","import { alpha } from '../numbers/index.mjs';\nimport { percent } from '../numbers/units.mjs';\nimport { sanitize } from '../utils.mjs';\nimport { isColorString, splitColor } from './utils.mjs';\n\nconst hsla = {\n test: isColorString(\"hsl\", \"hue\"),\n parse: splitColor(\"hue\", \"saturation\", \"lightness\"),\n transform: ({ hue, saturation, lightness, alpha: alpha$1 = 1 }) => {\n return (\"hsla(\" +\n Math.round(hue) +\n \", \" +\n percent.transform(sanitize(saturation)) +\n \", \" +\n percent.transform(sanitize(lightness)) +\n \", \" +\n sanitize(alpha.transform(alpha$1)) +\n \")\");\n },\n};\n\nexport { hsla };\n","import { isString } from '../utils.mjs';\nimport { hex } from './hex.mjs';\nimport { hsla } from './hsla.mjs';\nimport { rgba } from './rgba.mjs';\n\nconst color = {\n test: (v) => rgba.test(v) || hex.test(v) || hsla.test(v),\n parse: (v) => {\n if (rgba.test(v)) {\n return rgba.parse(v);\n }\n else if (hsla.test(v)) {\n return hsla.parse(v);\n }\n else {\n return hex.parse(v);\n }\n },\n transform: (v) => {\n return isString(v)\n ? v\n : v.hasOwnProperty(\"red\")\n ? rgba.transform(v)\n : hsla.transform(v);\n },\n};\n\nexport { color };\n","import { color } from '../color/index.mjs';\nimport { isString, floatRegex, colorRegex, sanitize } from '../utils.mjs';\n\nfunction test(v) {\n var _a, _b;\n return (isNaN(v) &&\n isString(v) &&\n (((_a = v.match(floatRegex)) === null || _a === void 0 ? void 0 : _a.length) || 0) +\n (((_b = v.match(colorRegex)) === null || _b === void 0 ? void 0 : _b.length) || 0) >\n 0);\n}\nconst NUMBER_TOKEN = \"number\";\nconst COLOR_TOKEN = \"color\";\nconst VAR_TOKEN = \"var\";\nconst VAR_FUNCTION_TOKEN = \"var(\";\nconst SPLIT_TOKEN = \"${}\";\n// this regex consists of the `singleCssVariableRegex|rgbHSLValueRegex|digitRegex`\nconst complexRegex = /var\\s*\\(\\s*--(?:[\\w-]+\\s*|[\\w-]+\\s*,(?:\\s*[^)(\\s]|\\s*\\((?:[^)(]|\\([^)(]*\\))*\\))+\\s*)\\)|#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\)|-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)/giu;\nfunction analyseComplexValue(value) {\n const originalValue = value.toString();\n const values = [];\n const indexes = {\n color: [],\n number: [],\n var: [],\n };\n const types = [];\n let i = 0;\n const tokenised = originalValue.replace(complexRegex, (parsedValue) => {\n if (color.test(parsedValue)) {\n indexes.color.push(i);\n types.push(COLOR_TOKEN);\n values.push(color.parse(parsedValue));\n }\n else if (parsedValue.startsWith(VAR_FUNCTION_TOKEN)) {\n indexes.var.push(i);\n types.push(VAR_TOKEN);\n values.push(parsedValue);\n }\n else {\n indexes.number.push(i);\n types.push(NUMBER_TOKEN);\n values.push(parseFloat(parsedValue));\n }\n ++i;\n return SPLIT_TOKEN;\n });\n const split = tokenised.split(SPLIT_TOKEN);\n return { values, split, indexes, types };\n}\nfunction parseComplexValue(v) {\n return analyseComplexValue(v).values;\n}\nfunction createTransformer(source) {\n const { split, types } = analyseComplexValue(source);\n const numSections = split.length;\n return (v) => {\n let output = \"\";\n for (let i = 0; i < numSections; i++) {\n output += split[i];\n if (v[i] !== undefined) {\n const type = types[i];\n if (type === NUMBER_TOKEN) {\n output += sanitize(v[i]);\n }\n else if (type === COLOR_TOKEN) {\n output += color.transform(v[i]);\n }\n else {\n output += v[i];\n }\n }\n }\n return output;\n };\n}\nconst convertNumbersToZero = (v) => typeof v === \"number\" ? 0 : v;\nfunction getAnimatableNone(v) {\n const parsed = parseComplexValue(v);\n const transformer = createTransformer(v);\n return transformer(parsed.map(convertNumbersToZero));\n}\nconst complex = {\n test,\n parse: parseComplexValue,\n createTransformer,\n getAnimatableNone,\n};\n\nexport { analyseComplexValue, complex };\n","import { complex } from './index.mjs';\nimport { floatRegex } from '../utils.mjs';\n\n/**\n * Properties that should default to 1 or 100%\n */\nconst maxDefaults = new Set([\"brightness\", \"contrast\", \"saturate\", \"opacity\"]);\nfunction applyDefaultFilter(v) {\n const [name, value] = v.slice(0, -1).split(\"(\");\n if (name === \"drop-shadow\")\n return v;\n const [number] = value.match(floatRegex) || [];\n if (!number)\n return v;\n const unit = value.replace(number, \"\");\n let defaultValue = maxDefaults.has(name) ? 1 : 0;\n if (number !== value)\n defaultValue *= 100;\n return name + \"(\" + defaultValue + unit + \")\";\n}\nconst functionRegex = /\\b([a-z-]*)\\(.*?\\)/gu;\nconst filter = {\n ...complex,\n getAnimatableNone: (v) => {\n const functions = v.match(functionRegex);\n return functions ? functions.map(applyDefaultFilter).join(\" \") : v;\n },\n};\n\nexport { filter };\n","import { color } from '../../../value/types/color/index.mjs';\nimport { filter } from '../../../value/types/complex/filter.mjs';\nimport { numberValueTypes } from './number.mjs';\n\n/**\n * A map of default value types for common values\n */\nconst defaultValueTypes = {\n ...numberValueTypes,\n // Color props\n color,\n backgroundColor: color,\n outlineColor: color,\n fill: color,\n stroke: color,\n // Border props\n borderColor: color,\n borderTopColor: color,\n borderRightColor: color,\n borderBottomColor: color,\n borderLeftColor: color,\n filter,\n WebkitFilter: filter,\n};\n/**\n * Gets the default ValueType for the provided value key\n */\nconst getDefaultValueType = (key) => defaultValueTypes[key];\n\nexport { defaultValueTypes, getDefaultValueType };\n","import { complex } from '../../../value/types/complex/index.mjs';\nimport { filter } from '../../../value/types/complex/filter.mjs';\nimport { getDefaultValueType } from './defaults.mjs';\n\nfunction getAnimatableNone(key, value) {\n let defaultValueType = getDefaultValueType(key);\n if (defaultValueType !== filter)\n defaultValueType = complex;\n // If value is not recognised as animatable, ie \"none\", create an animatable version origin based on the target\n return defaultValueType.getAnimatableNone\n ? defaultValueType.getAnimatableNone(value)\n : undefined;\n}\n\nexport { getAnimatableNone };\n","import { analyseComplexValue } from '../../../value/types/complex/index.mjs';\nimport { getAnimatableNone } from '../../dom/value-types/animatable-none.mjs';\n\n/**\n * If we encounter keyframes like \"none\" or \"0\" and we also have keyframes like\n * \"#fff\" or \"200px 200px\" we want to find a keyframe to serve as a template for\n * the \"none\" keyframes. In this case \"#fff\" or \"200px 200px\" - then these get turned into\n * zero equivalents, i.e. \"#fff0\" or \"0px 0px\".\n */\nconst invalidTemplates = new Set([\"auto\", \"none\", \"0\"]);\nfunction makeNoneKeyframesAnimatable(unresolvedKeyframes, noneKeyframeIndexes, name) {\n let i = 0;\n let animatableTemplate = undefined;\n while (i < unresolvedKeyframes.length && !animatableTemplate) {\n const keyframe = unresolvedKeyframes[i];\n if (typeof keyframe === \"string\" &&\n !invalidTemplates.has(keyframe) &&\n analyseComplexValue(keyframe).values.length) {\n animatableTemplate = unresolvedKeyframes[i];\n }\n i++;\n }\n if (animatableTemplate && name) {\n for (const noneIndex of noneKeyframeIndexes) {\n unresolvedKeyframes[noneIndex] = getAnimatableNone(name, animatableTemplate);\n }\n }\n}\n\nexport { makeNoneKeyframesAnimatable };\n","import { isNone } from '../../animation/utils/is-none.mjs';\nimport { getVariableValue } from './utils/css-variables-conversion.mjs';\nimport { isCSSVariableToken } from './utils/is-css-variable.mjs';\nimport { positionalKeys, isNumOrPxType, positionalValues } from './utils/unit-conversion.mjs';\nimport { findDimensionValueType } from './value-types/dimensions.mjs';\nimport { KeyframeResolver } from '../utils/KeyframesResolver.mjs';\nimport { makeNoneKeyframesAnimatable } from '../html/utils/make-none-animatable.mjs';\n\nclass DOMKeyframesResolver extends KeyframeResolver {\n constructor(unresolvedKeyframes, onComplete, name, motionValue) {\n super(unresolvedKeyframes, onComplete, name, motionValue, motionValue === null || motionValue === void 0 ? void 0 : motionValue.owner, true);\n }\n readKeyframes() {\n const { unresolvedKeyframes, element, name } = this;\n if (!element.current)\n return;\n super.readKeyframes();\n /**\n * If any keyframe is a CSS variable, we need to find its value by sampling the element\n */\n for (let i = 0; i < unresolvedKeyframes.length; i++) {\n let keyframe = unresolvedKeyframes[i];\n if (typeof keyframe === \"string\") {\n keyframe = keyframe.trim();\n if (isCSSVariableToken(keyframe)) {\n const resolved = getVariableValue(keyframe, element.current);\n if (resolved !== undefined) {\n unresolvedKeyframes[i] = resolved;\n }\n if (i === unresolvedKeyframes.length - 1) {\n this.finalKeyframe = keyframe;\n }\n }\n }\n }\n /**\n * Resolve \"none\" values. We do this potentially twice - once before and once after measuring keyframes.\n * This could be seen as inefficient but it's a trade-off to avoid measurements in more situations, which\n * have a far bigger performance impact.\n */\n this.resolveNoneKeyframes();\n /**\n * Check to see if unit type has changed. If so schedule jobs that will\n * temporarily set styles to the destination keyframes.\n * Skip if we have more than two keyframes or this isn't a positional value.\n * TODO: We can throw if there are multiple keyframes and the value type changes.\n */\n if (!positionalKeys.has(name) || unresolvedKeyframes.length !== 2) {\n return;\n }\n const [origin, target] = unresolvedKeyframes;\n const originType = findDimensionValueType(origin);\n const targetType = findDimensionValueType(target);\n /**\n * Either we don't recognise these value types or we can animate between them.\n */\n if (originType === targetType)\n return;\n /**\n * If both values are numbers or pixels, we can animate between them by\n * converting them to numbers.\n */\n if (isNumOrPxType(originType) && isNumOrPxType(targetType)) {\n for (let i = 0; i < unresolvedKeyframes.length; i++) {\n const value = unresolvedKeyframes[i];\n if (typeof value === \"string\") {\n unresolvedKeyframes[i] = parseFloat(value);\n }\n }\n }\n else {\n /**\n * Else, the only way to resolve this is by measuring the element.\n */\n this.needsMeasurement = true;\n }\n }\n resolveNoneKeyframes() {\n const { unresolvedKeyframes, name } = this;\n const noneKeyframeIndexes = [];\n for (let i = 0; i < unresolvedKeyframes.length; i++) {\n if (isNone(unresolvedKeyframes[i])) {\n noneKeyframeIndexes.push(i);\n }\n }\n if (noneKeyframeIndexes.length) {\n makeNoneKeyframesAnimatable(unresolvedKeyframes, noneKeyframeIndexes, name);\n }\n }\n measureInitialState() {\n const { element, unresolvedKeyframes, name } = this;\n if (!element.current)\n return;\n if (name === \"height\") {\n this.suspendedScrollY = window.pageYOffset;\n }\n this.measuredOrigin = positionalValues[name](element.measureViewportBox(), window.getComputedStyle(element.current));\n unresolvedKeyframes[0] = this.measuredOrigin;\n // Set final key frame to measure after next render\n const measureKeyframe = unresolvedKeyframes[unresolvedKeyframes.length - 1];\n if (measureKeyframe !== undefined) {\n element.getValue(name, measureKeyframe).jump(measureKeyframe, false);\n }\n }\n measureEndState() {\n var _a;\n const { element, name, unresolvedKeyframes } = this;\n if (!element.current)\n return;\n const value = element.getValue(name);\n value && value.jump(this.measuredOrigin, false);\n const finalKeyframeIndex = unresolvedKeyframes.length - 1;\n const finalKeyframe = unresolvedKeyframes[finalKeyframeIndex];\n unresolvedKeyframes[finalKeyframeIndex] = positionalValues[name](element.measureViewportBox(), window.getComputedStyle(element.current));\n if (finalKeyframe !== null && this.finalKeyframe === undefined) {\n this.finalKeyframe = finalKeyframe;\n }\n // If we removed transform values, reapply them before the next render\n if ((_a = this.removedTransforms) === null || _a === void 0 ? void 0 : _a.length) {\n this.removedTransforms.forEach(([unsetTransformName, unsetTransformValue]) => {\n element\n .getValue(unsetTransformName)\n .set(unsetTransformValue);\n });\n }\n this.resolveNoneKeyframes();\n }\n}\n\nexport { DOMKeyframesResolver };\n","function memo(callback) {\n let result;\n return () => {\n if (result === undefined)\n result = callback();\n return result;\n };\n}\n\nexport { memo };\n","import { complex } from '../../value/types/complex/index.mjs';\n\n/**\n * Check if a value is animatable. Examples:\n *\n * ✅: 100, \"100px\", \"#fff\"\n * ❌: \"block\", \"url(2.jpg)\"\n * @param value\n *\n * @internal\n */\nconst isAnimatable = (value, name) => {\n // If the list of keys tat might be non-animatable grows, replace with Set\n if (name === \"zIndex\")\n return false;\n // If it's a number or a keyframes array, we can animate it. We might at some point\n // need to do a deep isAnimatable check of keyframes, or let Popmotion handle this,\n // but for now lets leave it like this for performance reasons\n if (typeof value === \"number\" || Array.isArray(value))\n return true;\n if (typeof value === \"string\" && // It's animatable if we have a string\n (complex.test(value) || value === \"0\") && // And it contains numbers and/or colors\n !value.startsWith(\"url(\") // Unless it starts with \"url(\"\n ) {\n return true;\n }\n return false;\n};\n\nexport { isAnimatable };\n","import { warning } from '../../../utils/errors.mjs';\nimport { isAnimatable } from '../../utils/is-animatable.mjs';\n\nfunction hasKeyframesChanged(keyframes) {\n const current = keyframes[0];\n if (keyframes.length === 1)\n return true;\n for (let i = 0; i < keyframes.length; i++) {\n if (keyframes[i] !== current)\n return true;\n }\n}\nfunction canAnimate(keyframes, name, type, velocity) {\n /**\n * Check if we're able to animate between the start and end keyframes,\n * and throw a warning if we're attempting to animate between one that's\n * animatable and another that isn't.\n */\n const originKeyframe = keyframes[0];\n if (originKeyframe === null)\n return false;\n /**\n * These aren't traditionally animatable but we do support them.\n * In future we could look into making this more generic or replacing\n * this function with mix() === mixImmediate\n */\n if (name === \"display\" || name === \"visibility\")\n return true;\n const targetKeyframe = keyframes[keyframes.length - 1];\n const isOriginAnimatable = isAnimatable(originKeyframe, name);\n const isTargetAnimatable = isAnimatable(targetKeyframe, name);\n warning(isOriginAnimatable === isTargetAnimatable, `You are trying to animate ${name} from \"${originKeyframe}\" to \"${targetKeyframe}\". ${originKeyframe} is not an animatable value - to enable this animation set ${originKeyframe} to a value animatable to ${targetKeyframe} via the \\`style\\` property.`);\n // Always skip if any of these are true\n if (!isOriginAnimatable || !isTargetAnimatable) {\n return false;\n }\n return hasKeyframesChanged(keyframes) || (type === \"spring\" && velocity);\n}\n\nexport { canAnimate };\n","import { flushKeyframeResolvers } from '../../render/utils/KeyframesResolver.mjs';\nimport { instantAnimationState } from '../../utils/use-instant-transition-state.mjs';\nimport { canAnimate } from './utils/can-animate.mjs';\nimport { getFinalKeyframe } from './waapi/utils/get-final-keyframe.mjs';\n\nclass BaseAnimation {\n constructor({ autoplay = true, delay = 0, type = \"keyframes\", repeat = 0, repeatDelay = 0, repeatType = \"loop\", ...options }) {\n // Track whether the animation has been stopped. Stopped animations won't restart.\n this.isStopped = false;\n this.hasAttemptedResolve = false;\n this.options = {\n autoplay,\n delay,\n type,\n repeat,\n repeatDelay,\n repeatType,\n ...options,\n };\n this.updateFinishedPromise();\n }\n /**\n * A getter for resolved data. If keyframes are not yet resolved, accessing\n * this.resolved will synchronously flush all pending keyframe resolvers.\n * This is a deoptimisation, but at its worst still batches read/writes.\n */\n get resolved() {\n if (!this._resolved && !this.hasAttemptedResolve) {\n flushKeyframeResolvers();\n }\n return this._resolved;\n }\n /**\n * A method to be called when the keyframes resolver completes. This method\n * will check if its possible to run the animation and, if not, skip it.\n * Otherwise, it will call initPlayback on the implementing class.\n */\n onKeyframesResolved(keyframes, finalKeyframe) {\n this.hasAttemptedResolve = true;\n const { name, type, velocity, delay, onComplete, onUpdate, isGenerator, } = this.options;\n /**\n * If we can't animate this value with the resolved keyframes\n * then we should complete it immediately.\n */\n if (!isGenerator && !canAnimate(keyframes, name, type, velocity)) {\n // Finish immediately\n if (instantAnimationState.current || !delay) {\n onUpdate === null || onUpdate === void 0 ? void 0 : onUpdate(getFinalKeyframe(keyframes, this.options, finalKeyframe));\n onComplete === null || onComplete === void 0 ? void 0 : onComplete();\n this.resolveFinishedPromise();\n return;\n }\n // Finish after a delay\n else {\n this.options.duration = 0;\n }\n }\n const resolvedAnimation = this.initPlayback(keyframes, finalKeyframe);\n if (resolvedAnimation === false)\n return;\n this._resolved = {\n keyframes,\n finalKeyframe,\n ...resolvedAnimation,\n };\n this.onPostResolved();\n }\n onPostResolved() { }\n /**\n * Allows the returned animation to be awaited or promise-chained. Currently\n * resolves when the animation finishes at all but in a future update could/should\n * reject if its cancels.\n */\n then(resolve, reject) {\n return this.currentFinishedPromise.then(resolve, reject);\n }\n updateFinishedPromise() {\n this.currentFinishedPromise = new Promise((resolve) => {\n this.resolveFinishedPromise = resolve;\n });\n }\n}\n\nexport { BaseAnimation };\n","/*\n Convert velocity into velocity per second\n\n @param [number]: Unit per frame\n @param [number]: Frame duration in ms\n*/\nfunction velocityPerSecond(velocity, frameDuration) {\n return frameDuration ? velocity * (1000 / frameDuration) : 0;\n}\n\nexport { velocityPerSecond };\n","import { velocityPerSecond } from '../../../utils/velocity-per-second.mjs';\n\nconst velocitySampleDuration = 5; // ms\nfunction calcGeneratorVelocity(resolveValue, t, current) {\n const prevT = Math.max(t - velocitySampleDuration, 0);\n return velocityPerSecond(current - resolveValue(prevT), t - prevT);\n}\n\nexport { calcGeneratorVelocity };\n","import { warning } from '../../../utils/errors.mjs';\nimport { clamp } from '../../../utils/clamp.mjs';\nimport { secondsToMilliseconds, millisecondsToSeconds } from '../../../utils/time-conversion.mjs';\n\nconst safeMin = 0.001;\nconst minDuration = 0.01;\nconst maxDuration = 10.0;\nconst minDamping = 0.05;\nconst maxDamping = 1;\nfunction findSpring({ duration = 800, bounce = 0.25, velocity = 0, mass = 1, }) {\n let envelope;\n let derivative;\n warning(duration <= secondsToMilliseconds(maxDuration), \"Spring duration must be 10 seconds or less\");\n let dampingRatio = 1 - bounce;\n /**\n * Restrict dampingRatio and duration to within acceptable ranges.\n */\n dampingRatio = clamp(minDamping, maxDamping, dampingRatio);\n duration = clamp(minDuration, maxDuration, millisecondsToSeconds(duration));\n if (dampingRatio < 1) {\n /**\n * Underdamped spring\n */\n envelope = (undampedFreq) => {\n const exponentialDecay = undampedFreq * dampingRatio;\n const delta = exponentialDecay * duration;\n const a = exponentialDecay - velocity;\n const b = calcAngularFreq(undampedFreq, dampingRatio);\n const c = Math.exp(-delta);\n return safeMin - (a / b) * c;\n };\n derivative = (undampedFreq) => {\n const exponentialDecay = undampedFreq * dampingRatio;\n const delta = exponentialDecay * duration;\n const d = delta * velocity + velocity;\n const e = Math.pow(dampingRatio, 2) * Math.pow(undampedFreq, 2) * duration;\n const f = Math.exp(-delta);\n const g = calcAngularFreq(Math.pow(undampedFreq, 2), dampingRatio);\n const factor = -envelope(undampedFreq) + safeMin > 0 ? -1 : 1;\n return (factor * ((d - e) * f)) / g;\n };\n }\n else {\n /**\n * Critically-damped spring\n */\n envelope = (undampedFreq) => {\n const a = Math.exp(-undampedFreq * duration);\n const b = (undampedFreq - velocity) * duration + 1;\n return -safeMin + a * b;\n };\n derivative = (undampedFreq) => {\n const a = Math.exp(-undampedFreq * duration);\n const b = (velocity - undampedFreq) * (duration * duration);\n return a * b;\n };\n }\n const initialGuess = 5 / duration;\n const undampedFreq = approximateRoot(envelope, derivative, initialGuess);\n duration = secondsToMilliseconds(duration);\n if (isNaN(undampedFreq)) {\n return {\n stiffness: 100,\n damping: 10,\n duration,\n };\n }\n else {\n const stiffness = Math.pow(undampedFreq, 2) * mass;\n return {\n stiffness,\n damping: dampingRatio * 2 * Math.sqrt(mass * stiffness),\n duration,\n };\n }\n}\nconst rootIterations = 12;\nfunction approximateRoot(envelope, derivative, initialGuess) {\n let result = initialGuess;\n for (let i = 1; i < rootIterations; i++) {\n result = result - envelope(result) / derivative(result);\n }\n return result;\n}\nfunction calcAngularFreq(undampedFreq, dampingRatio) {\n return undampedFreq * Math.sqrt(1 - dampingRatio * dampingRatio);\n}\n\nexport { calcAngularFreq, findSpring, maxDamping, maxDuration, minDamping, minDuration };\n","import { millisecondsToSeconds } from '../../../utils/time-conversion.mjs';\nimport { calcGeneratorVelocity } from '../utils/velocity.mjs';\nimport { findSpring, calcAngularFreq } from './find.mjs';\n\nconst durationKeys = [\"duration\", \"bounce\"];\nconst physicsKeys = [\"stiffness\", \"damping\", \"mass\"];\nfunction isSpringType(options, keys) {\n return keys.some((key) => options[key] !== undefined);\n}\nfunction getSpringOptions(options) {\n let springOptions = {\n velocity: 0.0,\n stiffness: 100,\n damping: 10,\n mass: 1.0,\n isResolvedFromDuration: false,\n ...options,\n };\n // stiffness/damping/mass overrides duration/bounce\n if (!isSpringType(options, physicsKeys) &&\n isSpringType(options, durationKeys)) {\n const derived = findSpring(options);\n springOptions = {\n ...springOptions,\n ...derived,\n mass: 1.0,\n };\n springOptions.isResolvedFromDuration = true;\n }\n return springOptions;\n}\nfunction spring({ keyframes, restDelta, restSpeed, ...options }) {\n const origin = keyframes[0];\n const target = keyframes[keyframes.length - 1];\n /**\n * This is the Iterator-spec return value. We ensure it's mutable rather than using a generator\n * to reduce GC during animation.\n */\n const state = { done: false, value: origin };\n const { stiffness, damping, mass, duration, velocity, isResolvedFromDuration, } = getSpringOptions({\n ...options,\n velocity: -millisecondsToSeconds(options.velocity || 0),\n });\n const initialVelocity = velocity || 0.0;\n const dampingRatio = damping / (2 * Math.sqrt(stiffness * mass));\n const initialDelta = target - origin;\n const undampedAngularFreq = millisecondsToSeconds(Math.sqrt(stiffness / mass));\n /**\n * If we're working on a granular scale, use smaller defaults for determining\n * when the spring is finished.\n *\n * These defaults have been selected emprically based on what strikes a good\n * ratio between feeling good and finishing as soon as changes are imperceptible.\n */\n const isGranularScale = Math.abs(initialDelta) < 5;\n restSpeed || (restSpeed = isGranularScale ? 0.01 : 2);\n restDelta || (restDelta = isGranularScale ? 0.005 : 0.5);\n let resolveSpring;\n if (dampingRatio < 1) {\n const angularFreq = calcAngularFreq(undampedAngularFreq, dampingRatio);\n // Underdamped spring\n resolveSpring = (t) => {\n const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t);\n return (target -\n envelope *\n (((initialVelocity +\n dampingRatio * undampedAngularFreq * initialDelta) /\n angularFreq) *\n Math.sin(angularFreq * t) +\n initialDelta * Math.cos(angularFreq * t)));\n };\n }\n else if (dampingRatio === 1) {\n // Critically damped spring\n resolveSpring = (t) => target -\n Math.exp(-undampedAngularFreq * t) *\n (initialDelta +\n (initialVelocity + undampedAngularFreq * initialDelta) * t);\n }\n else {\n // Overdamped spring\n const dampedAngularFreq = undampedAngularFreq * Math.sqrt(dampingRatio * dampingRatio - 1);\n resolveSpring = (t) => {\n const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t);\n // When performing sinh or cosh values can hit Infinity so we cap them here\n const freqForT = Math.min(dampedAngularFreq * t, 300);\n return (target -\n (envelope *\n ((initialVelocity +\n dampingRatio * undampedAngularFreq * initialDelta) *\n Math.sinh(freqForT) +\n dampedAngularFreq *\n initialDelta *\n Math.cosh(freqForT))) /\n dampedAngularFreq);\n };\n }\n return {\n calculatedDuration: isResolvedFromDuration ? duration || null : null,\n next: (t) => {\n const current = resolveSpring(t);\n if (!isResolvedFromDuration) {\n let currentVelocity = initialVelocity;\n if (t !== 0) {\n /**\n * We only need to calculate velocity for under-damped springs\n * as over- and critically-damped springs can't overshoot, so\n * checking only for displacement is enough.\n */\n if (dampingRatio < 1) {\n currentVelocity = calcGeneratorVelocity(resolveSpring, t, current);\n }\n else {\n currentVelocity = 0;\n }\n }\n const isBelowVelocityThreshold = Math.abs(currentVelocity) <= restSpeed;\n const isBelowDisplacementThreshold = Math.abs(target - current) <= restDelta;\n state.done =\n isBelowVelocityThreshold && isBelowDisplacementThreshold;\n }\n else {\n state.done = t >= duration;\n }\n state.value = state.done ? target : current;\n return state;\n },\n };\n}\n\nexport { spring };\n","import { spring } from './spring/index.mjs';\nimport { calcGeneratorVelocity } from './utils/velocity.mjs';\n\nfunction inertia({ keyframes, velocity = 0.0, power = 0.8, timeConstant = 325, bounceDamping = 10, bounceStiffness = 500, modifyTarget, min, max, restDelta = 0.5, restSpeed, }) {\n const origin = keyframes[0];\n const state = {\n done: false,\n value: origin,\n };\n const isOutOfBounds = (v) => (min !== undefined && v < min) || (max !== undefined && v > max);\n const nearestBoundary = (v) => {\n if (min === undefined)\n return max;\n if (max === undefined)\n return min;\n return Math.abs(min - v) < Math.abs(max - v) ? min : max;\n };\n let amplitude = power * velocity;\n const ideal = origin + amplitude;\n const target = modifyTarget === undefined ? ideal : modifyTarget(ideal);\n /**\n * If the target has changed we need to re-calculate the amplitude, otherwise\n * the animation will start from the wrong position.\n */\n if (target !== ideal)\n amplitude = target - origin;\n const calcDelta = (t) => -amplitude * Math.exp(-t / timeConstant);\n const calcLatest = (t) => target + calcDelta(t);\n const applyFriction = (t) => {\n const delta = calcDelta(t);\n const latest = calcLatest(t);\n state.done = Math.abs(delta) <= restDelta;\n state.value = state.done ? target : latest;\n };\n /**\n * Ideally this would resolve for t in a stateless way, we could\n * do that by always precalculating the animation but as we know\n * this will be done anyway we can assume that spring will\n * be discovered during that.\n */\n let timeReachedBoundary;\n let spring$1;\n const checkCatchBoundary = (t) => {\n if (!isOutOfBounds(state.value))\n return;\n timeReachedBoundary = t;\n spring$1 = spring({\n keyframes: [state.value, nearestBoundary(state.value)],\n velocity: calcGeneratorVelocity(calcLatest, t, state.value), // TODO: This should be passing * 1000\n damping: bounceDamping,\n stiffness: bounceStiffness,\n restDelta,\n restSpeed,\n });\n };\n checkCatchBoundary(0);\n return {\n calculatedDuration: null,\n next: (t) => {\n /**\n * We need to resolve the friction to figure out if we need a\n * spring but we don't want to do this twice per frame. So here\n * we flag if we updated for this frame and later if we did\n * we can skip doing it again.\n */\n let hasUpdatedFrame = false;\n if (!spring$1 && timeReachedBoundary === undefined) {\n hasUpdatedFrame = true;\n applyFriction(t);\n checkCatchBoundary(t);\n }\n /**\n * If we have a spring and the provided t is beyond the moment the friction\n * animation crossed the min/max boundary, use the spring.\n */\n if (timeReachedBoundary !== undefined && t >= timeReachedBoundary) {\n return spring$1.next(t - timeReachedBoundary);\n }\n else {\n !hasUpdatedFrame && applyFriction(t);\n return state;\n }\n },\n };\n}\n\nexport { inertia };\n","import { noop } from '../utils/noop.mjs';\n\n/*\n Bezier function generator\n This has been modified from Gaëtan Renaudeau's BezierEasing\n https://github.com/gre/bezier-easing/blob/master/src/index.js\n https://github.com/gre/bezier-easing/blob/master/LICENSE\n \n I've removed the newtonRaphsonIterate algo because in benchmarking it\n wasn't noticiably faster than binarySubdivision, indeed removing it\n usually improved times, depending on the curve.\n I also removed the lookup table, as for the added bundle size and loop we're\n only cutting ~4 or so subdivision iterations. I bumped the max iterations up\n to 12 to compensate and this still tended to be faster for no perceivable\n loss in accuracy.\n Usage\n const easeOut = cubicBezier(.17,.67,.83,.67);\n const x = easeOut(0.5); // returns 0.627...\n*/\n// Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2.\nconst calcBezier = (t, a1, a2) => (((1.0 - 3.0 * a2 + 3.0 * a1) * t + (3.0 * a2 - 6.0 * a1)) * t + 3.0 * a1) *\n t;\nconst subdivisionPrecision = 0.0000001;\nconst subdivisionMaxIterations = 12;\nfunction binarySubdivide(x, lowerBound, upperBound, mX1, mX2) {\n let currentX;\n let currentT;\n let i = 0;\n do {\n currentT = lowerBound + (upperBound - lowerBound) / 2.0;\n currentX = calcBezier(currentT, mX1, mX2) - x;\n if (currentX > 0.0) {\n upperBound = currentT;\n }\n else {\n lowerBound = currentT;\n }\n } while (Math.abs(currentX) > subdivisionPrecision &&\n ++i < subdivisionMaxIterations);\n return currentT;\n}\nfunction cubicBezier(mX1, mY1, mX2, mY2) {\n // If this is a linear gradient, return linear easing\n if (mX1 === mY1 && mX2 === mY2)\n return noop;\n const getTForX = (aX) => binarySubdivide(aX, 0, 1, mX1, mX2);\n // If animation is at start/end, return t without easing\n return (t) => t === 0 || t === 1 ? t : calcBezier(getTForX(t), mY1, mY2);\n}\n\nexport { cubicBezier };\n","import { cubicBezier } from './cubic-bezier.mjs';\n\nconst easeIn = cubicBezier(0.42, 0, 1, 1);\nconst easeOut = cubicBezier(0, 0, 0.58, 1);\nconst easeInOut = cubicBezier(0.42, 0, 0.58, 1);\n\nexport { easeIn, easeInOut, easeOut };\n","const isEasingArray = (ease) => {\n return Array.isArray(ease) && typeof ease[0] !== \"number\";\n};\n\nexport { isEasingArray };\n","// Accepts an easing function and returns a new one that outputs mirrored values for\n// the second half of the animation. Turns easeIn into easeInOut.\nconst mirrorEasing = (easing) => (p) => p <= 0.5 ? easing(2 * p) / 2 : (2 - easing(2 * (1 - p))) / 2;\n\nexport { mirrorEasing };\n","// Accepts an easing function and returns a new one that outputs reversed values.\n// Turns easeIn into easeOut.\nconst reverseEasing = (easing) => (p) => 1 - easing(1 - p);\n\nexport { reverseEasing };\n","import { mirrorEasing } from './modifiers/mirror.mjs';\nimport { reverseEasing } from './modifiers/reverse.mjs';\n\nconst circIn = (p) => 1 - Math.sin(Math.acos(p));\nconst circOut = reverseEasing(circIn);\nconst circInOut = mirrorEasing(circIn);\n\nexport { circIn, circInOut, circOut };\n","import { cubicBezier } from './cubic-bezier.mjs';\nimport { mirrorEasing } from './modifiers/mirror.mjs';\nimport { reverseEasing } from './modifiers/reverse.mjs';\n\nconst backOut = cubicBezier(0.33, 1.53, 0.69, 0.99);\nconst backIn = reverseEasing(backOut);\nconst backInOut = mirrorEasing(backIn);\n\nexport { backIn, backInOut, backOut };\n","import { backIn } from './back.mjs';\n\nconst anticipate = (p) => (p *= 2) < 1 ? 0.5 * backIn(p) : 0.5 * (2 - Math.pow(2, -10 * (p - 1)));\n\nexport { anticipate };\n","import { invariant } from '../../utils/errors.mjs';\nimport { cubicBezier } from '../cubic-bezier.mjs';\nimport { noop } from '../../utils/noop.mjs';\nimport { easeIn, easeInOut, easeOut } from '../ease.mjs';\nimport { circIn, circInOut, circOut } from '../circ.mjs';\nimport { backIn, backInOut, backOut } from '../back.mjs';\nimport { anticipate } from '../anticipate.mjs';\n\nconst easingLookup = {\n linear: noop,\n easeIn,\n easeInOut,\n easeOut,\n circIn,\n circInOut,\n circOut,\n backIn,\n backInOut,\n backOut,\n anticipate,\n};\nconst easingDefinitionToFunction = (definition) => {\n if (Array.isArray(definition)) {\n // If cubic bezier definition, create bezier curve\n invariant(definition.length === 4, `Cubic bezier arrays must contain four numerical values.`);\n const [x1, y1, x2, y2] = definition;\n return cubicBezier(x1, y1, x2, y2);\n }\n else if (typeof definition === \"string\") {\n // Else lookup from table\n invariant(easingLookup[definition] !== undefined, `Invalid easing type '${definition}'`);\n return easingLookup[definition];\n }\n return definition;\n};\n\nexport { easingDefinitionToFunction };\n","/*\n Progress within given range\n\n Given a lower limit and an upper limit, we return the progress\n (expressed as a number 0-1) represented by the given value, and\n limit that progress to within 0-1.\n\n @param [number]: Lower limit\n @param [number]: Upper limit\n @param [number]: Value to find progress within given range\n @return [number]: Progress of value within range as expressed 0-1\n*/\nconst progress = (from, to, value) => {\n const toFromDifference = to - from;\n return toFromDifference === 0 ? 1 : (value - from) / toFromDifference;\n};\n\nexport { progress };\n","/*\n Value in range from progress\n\n Given a lower limit and an upper limit, we return the value within\n that range as expressed by progress (usually a number from 0 to 1)\n\n So progress = 0.5 would change\n\n from -------- to\n\n to\n\n from ---- to\n\n E.g. from = 10, to = 20, progress = 0.5 => 15\n\n @param [number]: Lower limit of range\n @param [number]: Upper limit of range\n @param [number]: The progress between lower and upper limits expressed 0-1\n @return [number]: Value as calculated from progress within range (not limited within range)\n*/\nconst mixNumber = (from, to, progress) => {\n return from + (to - from) * progress;\n};\n\nexport { mixNumber };\n","// Adapted from https://gist.github.com/mjackson/5311256\nfunction hueToRgb(p, q, t) {\n if (t < 0)\n t += 1;\n if (t > 1)\n t -= 1;\n if (t < 1 / 6)\n return p + (q - p) * 6 * t;\n if (t < 1 / 2)\n return q;\n if (t < 2 / 3)\n return p + (q - p) * (2 / 3 - t) * 6;\n return p;\n}\nfunction hslaToRgba({ hue, saturation, lightness, alpha }) {\n hue /= 360;\n saturation /= 100;\n lightness /= 100;\n let red = 0;\n let green = 0;\n let blue = 0;\n if (!saturation) {\n red = green = blue = lightness;\n }\n else {\n const q = lightness < 0.5\n ? lightness * (1 + saturation)\n : lightness + saturation - lightness * saturation;\n const p = 2 * lightness - q;\n red = hueToRgb(p, q, hue + 1 / 3);\n green = hueToRgb(p, q, hue);\n blue = hueToRgb(p, q, hue - 1 / 3);\n }\n return {\n red: Math.round(red * 255),\n green: Math.round(green * 255),\n blue: Math.round(blue * 255),\n alpha,\n };\n}\n\nexport { hslaToRgba };\n","function mixImmediate(a, b) {\n return (p) => (p > 0 ? b : a);\n}\n\nexport { mixImmediate };\n","import { mixNumber } from './number.mjs';\nimport { warning } from '../errors.mjs';\nimport { hslaToRgba } from '../hsla-to-rgba.mjs';\nimport { hex } from '../../value/types/color/hex.mjs';\nimport { rgba } from '../../value/types/color/rgba.mjs';\nimport { hsla } from '../../value/types/color/hsla.mjs';\nimport { mixImmediate } from './immediate.mjs';\n\n// Linear color space blending\n// Explained https://www.youtube.com/watch?v=LKnqECcg6Gw\n// Demonstrated http://codepen.io/osublake/pen/xGVVaN\nconst mixLinearColor = (from, to, v) => {\n const fromExpo = from * from;\n const expo = v * (to * to - fromExpo) + fromExpo;\n return expo < 0 ? 0 : Math.sqrt(expo);\n};\nconst colorTypes = [hex, rgba, hsla];\nconst getColorType = (v) => colorTypes.find((type) => type.test(v));\nfunction asRGBA(color) {\n const type = getColorType(color);\n warning(Boolean(type), `'${color}' is not an animatable color. Use the equivalent color code instead.`);\n if (!Boolean(type))\n return false;\n let model = type.parse(color);\n if (type === hsla) {\n // TODO Remove this cast - needed since Framer Motion's stricter typing\n model = hslaToRgba(model);\n }\n return model;\n}\nconst mixColor = (from, to) => {\n const fromRGBA = asRGBA(from);\n const toRGBA = asRGBA(to);\n if (!fromRGBA || !toRGBA) {\n return mixImmediate(from, to);\n }\n const blended = { ...fromRGBA };\n return (v) => {\n blended.red = mixLinearColor(fromRGBA.red, toRGBA.red, v);\n blended.green = mixLinearColor(fromRGBA.green, toRGBA.green, v);\n blended.blue = mixLinearColor(fromRGBA.blue, toRGBA.blue, v);\n blended.alpha = mixNumber(fromRGBA.alpha, toRGBA.alpha, v);\n return rgba.transform(blended);\n };\n};\n\nexport { mixColor, mixLinearColor };\n","const invisibleValues = new Set([\"none\", \"hidden\"]);\n/**\n * Returns a function that, when provided a progress value between 0 and 1,\n * will return the \"none\" or \"hidden\" string only when the progress is that of\n * the origin or target.\n */\nfunction mixVisibility(origin, target) {\n if (invisibleValues.has(origin)) {\n return (p) => (p <= 0 ? origin : target);\n }\n else {\n return (p) => (p >= 1 ? target : origin);\n }\n}\n\nexport { invisibleValues, mixVisibility };\n","import { mixNumber as mixNumber$1 } from './number.mjs';\nimport { mixColor } from './color.mjs';\nimport { pipe } from '../pipe.mjs';\nimport { warning } from '../errors.mjs';\nimport { color } from '../../value/types/color/index.mjs';\nimport { complex, analyseComplexValue } from '../../value/types/complex/index.mjs';\nimport { isCSSVariableToken } from '../../render/dom/utils/is-css-variable.mjs';\nimport { invisibleValues, mixVisibility } from './visibility.mjs';\nimport { mixImmediate } from './immediate.mjs';\n\nfunction mixNumber(a, b) {\n return (p) => mixNumber$1(a, b, p);\n}\nfunction getMixer(a) {\n if (typeof a === \"number\") {\n return mixNumber;\n }\n else if (typeof a === \"string\") {\n return isCSSVariableToken(a)\n ? mixImmediate\n : color.test(a)\n ? mixColor\n : mixComplex;\n }\n else if (Array.isArray(a)) {\n return mixArray;\n }\n else if (typeof a === \"object\") {\n return color.test(a) ? mixColor : mixObject;\n }\n return mixImmediate;\n}\nfunction mixArray(a, b) {\n const output = [...a];\n const numValues = output.length;\n const blendValue = a.map((v, i) => getMixer(v)(v, b[i]));\n return (p) => {\n for (let i = 0; i < numValues; i++) {\n output[i] = blendValue[i](p);\n }\n return output;\n };\n}\nfunction mixObject(a, b) {\n const output = { ...a, ...b };\n const blendValue = {};\n for (const key in output) {\n if (a[key] !== undefined && b[key] !== undefined) {\n blendValue[key] = getMixer(a[key])(a[key], b[key]);\n }\n }\n return (v) => {\n for (const key in blendValue) {\n output[key] = blendValue[key](v);\n }\n return output;\n };\n}\nfunction matchOrder(origin, target) {\n var _a;\n const orderedOrigin = [];\n const pointers = { color: 0, var: 0, number: 0 };\n for (let i = 0; i < target.values.length; i++) {\n const type = target.types[i];\n const originIndex = origin.indexes[type][pointers[type]];\n const originValue = (_a = origin.values[originIndex]) !== null && _a !== void 0 ? _a : 0;\n orderedOrigin[i] = originValue;\n pointers[type]++;\n }\n return orderedOrigin;\n}\nconst mixComplex = (origin, target) => {\n const template = complex.createTransformer(target);\n const originStats = analyseComplexValue(origin);\n const targetStats = analyseComplexValue(target);\n const canInterpolate = originStats.indexes.var.length === targetStats.indexes.var.length &&\n originStats.indexes.color.length === targetStats.indexes.color.length &&\n originStats.indexes.number.length >= targetStats.indexes.number.length;\n if (canInterpolate) {\n if ((invisibleValues.has(origin) &&\n !targetStats.values.length) ||\n (invisibleValues.has(target) &&\n !originStats.values.length)) {\n return mixVisibility(origin, target);\n }\n return pipe(mixArray(matchOrder(originStats, targetStats), targetStats.values), template);\n }\n else {\n warning(true, `Complex values '${origin}' and '${target}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`);\n return mixImmediate(origin, target);\n }\n};\n\nexport { getMixer, mixArray, mixComplex, mixObject };\n","import { getMixer } from './complex.mjs';\nimport { mixNumber } from './number.mjs';\n\nfunction mix(from, to, p) {\n if (typeof from === \"number\" &&\n typeof to === \"number\" &&\n typeof p === \"number\") {\n return mixNumber(from, to, p);\n }\n const mixer = getMixer(from);\n return mixer(from, to);\n}\n\nexport { mix };\n","import { invariant } from './errors.mjs';\nimport { clamp } from './clamp.mjs';\nimport { pipe } from './pipe.mjs';\nimport { progress } from './progress.mjs';\nimport { noop } from './noop.mjs';\nimport { mix } from './mix/index.mjs';\n\nfunction createMixers(output, ease, customMixer) {\n const mixers = [];\n const mixerFactory = customMixer || mix;\n const numMixers = output.length - 1;\n for (let i = 0; i < numMixers; i++) {\n let mixer = mixerFactory(output[i], output[i + 1]);\n if (ease) {\n const easingFunction = Array.isArray(ease) ? ease[i] || noop : ease;\n mixer = pipe(easingFunction, mixer);\n }\n mixers.push(mixer);\n }\n return mixers;\n}\n/**\n * Create a function that maps from a numerical input array to a generic output array.\n *\n * Accepts:\n * - Numbers\n * - Colors (hex, hsl, hsla, rgb, rgba)\n * - Complex (combinations of one or more numbers or strings)\n *\n * ```jsx\n * const mixColor = interpolate([0, 1], ['#fff', '#000'])\n *\n * mixColor(0.5) // 'rgba(128, 128, 128, 1)'\n * ```\n *\n * TODO Revist this approach once we've moved to data models for values,\n * probably not needed to pregenerate mixer functions.\n *\n * @public\n */\nfunction interpolate(input, output, { clamp: isClamp = true, ease, mixer } = {}) {\n const inputLength = input.length;\n invariant(inputLength === output.length, \"Both input and output ranges must be the same length\");\n /**\n * If we're only provided a single input, we can just make a function\n * that returns the output.\n */\n if (inputLength === 1)\n return () => output[0];\n if (inputLength === 2 && input[0] === input[1])\n return () => output[1];\n // If input runs highest -> lowest, reverse both arrays\n if (input[0] > input[inputLength - 1]) {\n input = [...input].reverse();\n output = [...output].reverse();\n }\n const mixers = createMixers(output, ease, mixer);\n const numMixers = mixers.length;\n const interpolator = (v) => {\n let i = 0;\n if (numMixers > 1) {\n for (; i < input.length - 2; i++) {\n if (v < input[i + 1])\n break;\n }\n }\n const progressInRange = progress(input[i], input[i + 1], v);\n return mixers[i](progressInRange);\n };\n return isClamp\n ? (v) => interpolator(clamp(input[0], input[inputLength - 1], v))\n : interpolator;\n}\n\nexport { interpolate };\n","import { mixNumber } from '../mix/number.mjs';\nimport { progress } from '../progress.mjs';\n\nfunction fillOffset(offset, remaining) {\n const min = offset[offset.length - 1];\n for (let i = 1; i <= remaining; i++) {\n const offsetProgress = progress(0, remaining, i);\n offset.push(mixNumber(min, 1, offsetProgress));\n }\n}\n\nexport { fillOffset };\n","import { fillOffset } from './fill.mjs';\n\nfunction defaultOffset(arr) {\n const offset = [0];\n fillOffset(offset, arr.length - 1);\n return offset;\n}\n\nexport { defaultOffset };\n","function convertOffsetToTimes(offset, duration) {\n return offset.map((o) => o * duration);\n}\n\nexport { convertOffsetToTimes };\n","import { easeInOut } from '../../easing/ease.mjs';\nimport { isEasingArray } from '../../easing/utils/is-easing-array.mjs';\nimport { easingDefinitionToFunction } from '../../easing/utils/map.mjs';\nimport { interpolate } from '../../utils/interpolate.mjs';\nimport { defaultOffset } from '../../utils/offsets/default.mjs';\nimport { convertOffsetToTimes } from '../../utils/offsets/time.mjs';\n\nfunction defaultEasing(values, easing) {\n return values.map(() => easing || easeInOut).splice(0, values.length - 1);\n}\nfunction keyframes({ duration = 300, keyframes: keyframeValues, times, ease = \"easeInOut\", }) {\n /**\n * Easing functions can be externally defined as strings. Here we convert them\n * into actual functions.\n */\n const easingFunctions = isEasingArray(ease)\n ? ease.map(easingDefinitionToFunction)\n : easingDefinitionToFunction(ease);\n /**\n * This is the Iterator-spec return value. We ensure it's mutable rather than using a generator\n * to reduce GC during animation.\n */\n const state = {\n done: false,\n value: keyframeValues[0],\n };\n /**\n * Create a times array based on the provided 0-1 offsets\n */\n const absoluteTimes = convertOffsetToTimes(\n // Only use the provided offsets if they're the correct length\n // TODO Maybe we should warn here if there's a length mismatch\n times && times.length === keyframeValues.length\n ? times\n : defaultOffset(keyframeValues), duration);\n const mapTimeToKeyframe = interpolate(absoluteTimes, keyframeValues, {\n ease: Array.isArray(easingFunctions)\n ? easingFunctions\n : defaultEasing(keyframeValues, easingFunctions),\n });\n return {\n calculatedDuration: duration,\n next: (t) => {\n state.value = mapTimeToKeyframe(t);\n state.done = t >= duration;\n return state;\n },\n };\n}\n\nexport { defaultEasing, keyframes };\n","/**\n * Implement a practical max duration for keyframe generation\n * to prevent infinite loops\n */\nconst maxGeneratorDuration = 20000;\nfunction calcGeneratorDuration(generator) {\n let duration = 0;\n const timeStep = 50;\n let state = generator.next(duration);\n while (!state.done && duration < maxGeneratorDuration) {\n duration += timeStep;\n state = generator.next(duration);\n }\n return duration >= maxGeneratorDuration ? Infinity : duration;\n}\n\nexport { calcGeneratorDuration, maxGeneratorDuration };\n","import { time } from '../../../frameloop/sync-time.mjs';\nimport { frame, cancelFrame, frameData } from '../../../frameloop/frame.mjs';\n\nconst frameloopDriver = (update) => {\n const passTimestamp = ({ timestamp }) => update(timestamp);\n return {\n start: () => frame.update(passTimestamp, true),\n stop: () => cancelFrame(passTimestamp),\n /**\n * If we're processing this frame we can use the\n * framelocked timestamp to keep things in sync.\n */\n now: () => (frameData.isProcessing ? frameData.timestamp : time.now()),\n };\n};\n\nexport { frameloopDriver };\n","import { KeyframeResolver } from '../../render/utils/KeyframesResolver.mjs';\nimport { spring } from '../generators/spring/index.mjs';\nimport { inertia } from '../generators/inertia.mjs';\nimport { keyframes } from '../generators/keyframes.mjs';\nimport { BaseAnimation } from './BaseAnimation.mjs';\nimport { pipe } from '../../utils/pipe.mjs';\nimport { mix } from '../../utils/mix/index.mjs';\nimport { calcGeneratorDuration } from '../generators/utils/calc-duration.mjs';\nimport { millisecondsToSeconds, secondsToMilliseconds } from '../../utils/time-conversion.mjs';\nimport { clamp } from '../../utils/clamp.mjs';\nimport { invariant } from '../../utils/errors.mjs';\nimport { frameloopDriver } from './drivers/driver-frameloop.mjs';\nimport { getFinalKeyframe } from './waapi/utils/get-final-keyframe.mjs';\n\nconst generators = {\n decay: inertia,\n inertia,\n tween: keyframes,\n keyframes: keyframes,\n spring,\n};\nconst percentToProgress = (percent) => percent / 100;\n/**\n * Animation that runs on the main thread. Designed to be WAAPI-spec in the subset of\n * features we expose publically. Mostly the compatibility is to ensure visual identity\n * between both WAAPI and main thread animations.\n */\nclass MainThreadAnimation extends BaseAnimation {\n constructor({ KeyframeResolver: KeyframeResolver$1 = KeyframeResolver, ...options }) {\n super(options);\n /**\n * The time at which the animation was paused.\n */\n this.holdTime = null;\n /**\n * The time at which the animation was started.\n */\n this.startTime = null;\n /**\n * The time at which the animation was cancelled.\n */\n this.cancelTime = null;\n /**\n * The current time of the animation.\n */\n this.currentTime = 0;\n /**\n * Playback speed as a factor. 0 would be stopped, -1 reverse and 2 double speed.\n */\n this.playbackSpeed = 1;\n /**\n * The state of the animation to apply when the animation is resolved. This\n * allows calls to the public API to control the animation before it is resolved,\n * without us having to resolve it first.\n */\n this.pendingPlayState = \"running\";\n this.state = \"idle\";\n /**\n * This method is bound to the instance to fix a pattern where\n * animation.stop is returned as a reference from a useEffect.\n */\n this.stop = () => {\n this.resolver.cancel();\n this.isStopped = true;\n if (this.state === \"idle\")\n return;\n this.teardown();\n const { onStop } = this.options;\n onStop && onStop();\n };\n const { name, motionValue, keyframes } = this.options;\n const onResolved = (resolvedKeyframes, finalKeyframe) => this.onKeyframesResolved(resolvedKeyframes, finalKeyframe);\n if (name && motionValue && motionValue.owner) {\n this.resolver = motionValue.owner.resolveKeyframes(keyframes, onResolved, name, motionValue);\n }\n else {\n this.resolver = new KeyframeResolver$1(keyframes, onResolved, name, motionValue);\n }\n this.resolver.scheduleResolve();\n }\n initPlayback(keyframes$1) {\n const { type = \"keyframes\", repeat = 0, repeatDelay = 0, repeatType, velocity = 0, } = this.options;\n const generatorFactory = generators[type] || keyframes;\n /**\n * If our generator doesn't support mixing numbers, we need to replace keyframes with\n * [0, 100] and then make a function that maps that to the actual keyframes.\n *\n * 100 is chosen instead of 1 as it works nicer with spring animations.\n */\n let mapPercentToKeyframes;\n let mirroredGenerator;\n if (generatorFactory !== keyframes &&\n typeof keyframes$1[0] !== \"number\") {\n if (process.env.NODE_ENV !== \"production\") {\n invariant(keyframes$1.length === 2, `Only two keyframes currently supported with spring and inertia animations. Trying to animate ${keyframes$1}`);\n }\n mapPercentToKeyframes = pipe(percentToProgress, mix(keyframes$1[0], keyframes$1[1]));\n keyframes$1 = [0, 100];\n }\n const generator = generatorFactory({ ...this.options, keyframes: keyframes$1 });\n /**\n * If we have a mirror repeat type we need to create a second generator that outputs the\n * mirrored (not reversed) animation and later ping pong between the two generators.\n */\n if (repeatType === \"mirror\") {\n mirroredGenerator = generatorFactory({\n ...this.options,\n keyframes: [...keyframes$1].reverse(),\n velocity: -velocity,\n });\n }\n /**\n * If duration is undefined and we have repeat options,\n * we need to calculate a duration from the generator.\n *\n * We set it to the generator itself to cache the duration.\n * Any timeline resolver will need to have already precalculated\n * the duration by this step.\n */\n if (generator.calculatedDuration === null) {\n generator.calculatedDuration = calcGeneratorDuration(generator);\n }\n const { calculatedDuration } = generator;\n const resolvedDuration = calculatedDuration + repeatDelay;\n const totalDuration = resolvedDuration * (repeat + 1) - repeatDelay;\n return {\n generator,\n mirroredGenerator,\n mapPercentToKeyframes,\n calculatedDuration,\n resolvedDuration,\n totalDuration,\n };\n }\n onPostResolved() {\n const { autoplay = true } = this.options;\n this.play();\n if (this.pendingPlayState === \"paused\" || !autoplay) {\n this.pause();\n }\n else {\n this.state = this.pendingPlayState;\n }\n }\n tick(timestamp, sample = false) {\n const { resolved } = this;\n // If the animations has failed to resolve, return the final keyframe.\n if (!resolved) {\n const { keyframes } = this.options;\n return { done: true, value: keyframes[keyframes.length - 1] };\n }\n const { finalKeyframe, generator, mirroredGenerator, mapPercentToKeyframes, keyframes, calculatedDuration, totalDuration, resolvedDuration, } = resolved;\n if (this.startTime === null)\n return generator.next(0);\n const { delay, repeat, repeatType, repeatDelay, onUpdate } = this.options;\n /**\n * requestAnimationFrame timestamps can come through as lower than\n * the startTime as set by performance.now(). Here we prevent this,\n * though in the future it could be possible to make setting startTime\n * a pending operation that gets resolved here.\n */\n if (this.speed > 0) {\n this.startTime = Math.min(this.startTime, timestamp);\n }\n else if (this.speed < 0) {\n this.startTime = Math.min(timestamp - totalDuration / this.speed, this.startTime);\n }\n // Update currentTime\n if (sample) {\n this.currentTime = timestamp;\n }\n else if (this.holdTime !== null) {\n this.currentTime = this.holdTime;\n }\n else {\n // Rounding the time because floating point arithmetic is not always accurate, e.g. 3000.367 - 1000.367 =\n // 2000.0000000000002. This is a problem when we are comparing the currentTime with the duration, for\n // example.\n this.currentTime =\n Math.round(timestamp - this.startTime) * this.speed;\n }\n // Rebase on delay\n const timeWithoutDelay = this.currentTime - delay * (this.speed >= 0 ? 1 : -1);\n const isInDelayPhase = this.speed >= 0\n ? timeWithoutDelay < 0\n : timeWithoutDelay > totalDuration;\n this.currentTime = Math.max(timeWithoutDelay, 0);\n // If this animation has finished, set the current time to the total duration.\n if (this.state === \"finished\" && this.holdTime === null) {\n this.currentTime = totalDuration;\n }\n let elapsed = this.currentTime;\n let frameGenerator = generator;\n if (repeat) {\n /**\n * Get the current progress (0-1) of the animation. If t is >\n * than duration we'll get values like 2.5 (midway through the\n * third iteration)\n */\n const progress = Math.min(this.currentTime, totalDuration) / resolvedDuration;\n /**\n * Get the current iteration (0 indexed). For instance the floor of\n * 2.5 is 2.\n */\n let currentIteration = Math.floor(progress);\n /**\n * Get the current progress of the iteration by taking the remainder\n * so 2.5 is 0.5 through iteration 2\n */\n let iterationProgress = progress % 1.0;\n /**\n * If iteration progress is 1 we count that as the end\n * of the previous iteration.\n */\n if (!iterationProgress && progress >= 1) {\n iterationProgress = 1;\n }\n iterationProgress === 1 && currentIteration--;\n currentIteration = Math.min(currentIteration, repeat + 1);\n /**\n * Reverse progress if we're not running in \"normal\" direction\n */\n const isOddIteration = Boolean(currentIteration % 2);\n if (isOddIteration) {\n if (repeatType === \"reverse\") {\n iterationProgress = 1 - iterationProgress;\n if (repeatDelay) {\n iterationProgress -= repeatDelay / resolvedDuration;\n }\n }\n else if (repeatType === \"mirror\") {\n frameGenerator = mirroredGenerator;\n }\n }\n elapsed = clamp(0, 1, iterationProgress) * resolvedDuration;\n }\n /**\n * If we're in negative time, set state as the initial keyframe.\n * This prevents delay: x, duration: 0 animations from finishing\n * instantly.\n */\n const state = isInDelayPhase\n ? { done: false, value: keyframes[0] }\n : frameGenerator.next(elapsed);\n if (mapPercentToKeyframes) {\n state.value = mapPercentToKeyframes(state.value);\n }\n let { done } = state;\n if (!isInDelayPhase && calculatedDuration !== null) {\n done =\n this.speed >= 0\n ? this.currentTime >= totalDuration\n : this.currentTime <= 0;\n }\n const isAnimationFinished = this.holdTime === null &&\n (this.state === \"finished\" || (this.state === \"running\" && done));\n if (isAnimationFinished && finalKeyframe !== undefined) {\n state.value = getFinalKeyframe(keyframes, this.options, finalKeyframe);\n }\n if (onUpdate) {\n onUpdate(state.value);\n }\n if (isAnimationFinished) {\n this.finish();\n }\n return state;\n }\n get duration() {\n const { resolved } = this;\n return resolved ? millisecondsToSeconds(resolved.calculatedDuration) : 0;\n }\n get time() {\n return millisecondsToSeconds(this.currentTime);\n }\n set time(newTime) {\n newTime = secondsToMilliseconds(newTime);\n this.currentTime = newTime;\n if (this.holdTime !== null || this.speed === 0) {\n this.holdTime = newTime;\n }\n else if (this.driver) {\n this.startTime = this.driver.now() - newTime / this.speed;\n }\n }\n get speed() {\n return this.playbackSpeed;\n }\n set speed(newSpeed) {\n const hasChanged = this.playbackSpeed !== newSpeed;\n this.playbackSpeed = newSpeed;\n if (hasChanged) {\n this.time = millisecondsToSeconds(this.currentTime);\n }\n }\n play() {\n if (!this.resolver.isScheduled) {\n this.resolver.resume();\n }\n if (!this._resolved) {\n this.pendingPlayState = \"running\";\n return;\n }\n if (this.isStopped)\n return;\n const { driver = frameloopDriver, onPlay } = this.options;\n if (!this.driver) {\n this.driver = driver((timestamp) => this.tick(timestamp));\n }\n onPlay && onPlay();\n const now = this.driver.now();\n if (this.holdTime !== null) {\n this.startTime = now - this.holdTime;\n }\n else if (!this.startTime || this.state === \"finished\") {\n this.startTime = now;\n }\n if (this.state === \"finished\") {\n this.updateFinishedPromise();\n }\n this.cancelTime = this.startTime;\n this.holdTime = null;\n /**\n * Set playState to running only after we've used it in\n * the previous logic.\n */\n this.state = \"running\";\n this.driver.start();\n }\n pause() {\n var _a;\n if (!this._resolved) {\n this.pendingPlayState = \"paused\";\n return;\n }\n this.state = \"paused\";\n this.holdTime = (_a = this.currentTime) !== null && _a !== void 0 ? _a : 0;\n }\n complete() {\n if (this.state !== \"running\") {\n this.play();\n }\n this.pendingPlayState = this.state = \"finished\";\n this.holdTime = null;\n }\n finish() {\n this.teardown();\n this.state = \"finished\";\n const { onComplete } = this.options;\n onComplete && onComplete();\n }\n cancel() {\n if (this.cancelTime !== null) {\n this.tick(this.cancelTime);\n }\n this.teardown();\n this.updateFinishedPromise();\n }\n teardown() {\n this.state = \"idle\";\n this.stopDriver();\n this.resolveFinishedPromise();\n this.updateFinishedPromise();\n this.startTime = this.cancelTime = null;\n this.resolver.cancel();\n }\n stopDriver() {\n if (!this.driver)\n return;\n this.driver.stop();\n this.driver = undefined;\n }\n sample(time) {\n this.startTime = 0;\n return this.tick(time, true);\n }\n}\n// Legacy interface\nfunction animateValue(options) {\n return new MainThreadAnimation(options);\n}\n\nexport { MainThreadAnimation, animateValue };\n","const isBezierDefinition = (easing) => Array.isArray(easing) && typeof easing[0] === \"number\";\n\nexport { isBezierDefinition };\n","import { isBezierDefinition } from '../../../easing/utils/is-bezier-definition.mjs';\n\nfunction isWaapiSupportedEasing(easing) {\n return Boolean(!easing ||\n (typeof easing === \"string\" && easing in supportedWaapiEasing) ||\n isBezierDefinition(easing) ||\n (Array.isArray(easing) && easing.every(isWaapiSupportedEasing)));\n}\nconst cubicBezierAsString = ([a, b, c, d]) => `cubic-bezier(${a}, ${b}, ${c}, ${d})`;\nconst supportedWaapiEasing = {\n linear: \"linear\",\n ease: \"ease\",\n easeIn: \"ease-in\",\n easeOut: \"ease-out\",\n easeInOut: \"ease-in-out\",\n circIn: cubicBezierAsString([0, 0.65, 0.55, 1]),\n circOut: cubicBezierAsString([0.55, 0, 1, 0.45]),\n backIn: cubicBezierAsString([0.31, 0.01, 0.66, -0.59]),\n backOut: cubicBezierAsString([0.33, 1.53, 0.69, 0.99]),\n};\nfunction mapEasingToNativeEasingWithDefault(easing) {\n return (mapEasingToNativeEasing(easing) ||\n supportedWaapiEasing.easeOut);\n}\nfunction mapEasingToNativeEasing(easing) {\n if (!easing) {\n return undefined;\n }\n else if (isBezierDefinition(easing)) {\n return cubicBezierAsString(easing);\n }\n else if (Array.isArray(easing)) {\n return easing.map(mapEasingToNativeEasingWithDefault);\n }\n else {\n return supportedWaapiEasing[easing];\n }\n}\n\nexport { cubicBezierAsString, isWaapiSupportedEasing, mapEasingToNativeEasing, supportedWaapiEasing };\n","import { mapEasingToNativeEasing } from './easing.mjs';\n\nfunction animateStyle(element, valueName, keyframes, { delay = 0, duration = 300, repeat = 0, repeatType = \"loop\", ease, times, } = {}) {\n const keyframeOptions = { [valueName]: keyframes };\n if (times)\n keyframeOptions.offset = times;\n const easing = mapEasingToNativeEasing(ease);\n /**\n * If this is an easing array, apply to keyframes, not animation as a whole\n */\n if (Array.isArray(easing))\n keyframeOptions.easing = easing;\n return element.animate(keyframeOptions, {\n delay,\n duration,\n easing: !Array.isArray(easing) ? easing : \"linear\",\n fill: \"both\",\n iterations: repeat + 1,\n direction: repeatType === \"reverse\" ? \"alternate\" : \"normal\",\n });\n}\n\nexport { animateStyle };\n","import { time } from '../../frameloop/sync-time.mjs';\nimport { DOMKeyframesResolver } from '../../render/dom/DOMKeyframesResolver.mjs';\nimport { memo } from '../../utils/memo.mjs';\nimport { noop } from '../../utils/noop.mjs';\nimport { millisecondsToSeconds, secondsToMilliseconds } from '../../utils/time-conversion.mjs';\nimport { BaseAnimation } from './BaseAnimation.mjs';\nimport { MainThreadAnimation } from './MainThreadAnimation.mjs';\nimport { animateStyle } from './waapi/index.mjs';\nimport { isWaapiSupportedEasing } from './waapi/easing.mjs';\nimport { getFinalKeyframe } from './waapi/utils/get-final-keyframe.mjs';\n\nconst supportsWaapi = memo(() => Object.hasOwnProperty.call(Element.prototype, \"animate\"));\n/**\n * A list of values that can be hardware-accelerated.\n */\nconst acceleratedValues = new Set([\n \"opacity\",\n \"clipPath\",\n \"filter\",\n \"transform\",\n // TODO: Can be accelerated but currently disabled until https://issues.chromium.org/issues/41491098 is resolved\n // or until we implement support for linear() easing.\n // \"background-color\"\n]);\n/**\n * 10ms is chosen here as it strikes a balance between smooth\n * results (more than one keyframe per frame at 60fps) and\n * keyframe quantity.\n */\nconst sampleDelta = 10; //ms\n/**\n * Implement a practical max duration for keyframe generation\n * to prevent infinite loops\n */\nconst maxDuration = 20000;\n/**\n * Check if an animation can run natively via WAAPI or requires pregenerated keyframes.\n * WAAPI doesn't support spring or function easings so we run these as JS animation before\n * handing off.\n */\nfunction requiresPregeneratedKeyframes(options) {\n return (options.type === \"spring\" ||\n options.name === \"backgroundColor\" ||\n !isWaapiSupportedEasing(options.ease));\n}\nfunction pregenerateKeyframes(keyframes, options) {\n /**\n * Create a main-thread animation to pregenerate keyframes.\n * We sample this at regular intervals to generate keyframes that we then\n * linearly interpolate between.\n */\n const sampleAnimation = new MainThreadAnimation({\n ...options,\n keyframes,\n repeat: 0,\n delay: 0,\n isGenerator: true,\n });\n let state = { done: false, value: keyframes[0] };\n const pregeneratedKeyframes = [];\n /**\n * Bail after 20 seconds of pre-generated keyframes as it's likely\n * we're heading for an infinite loop.\n */\n let t = 0;\n while (!state.done && t < maxDuration) {\n state = sampleAnimation.sample(t);\n pregeneratedKeyframes.push(state.value);\n t += sampleDelta;\n }\n return {\n times: undefined,\n keyframes: pregeneratedKeyframes,\n duration: t - sampleDelta,\n ease: \"linear\",\n };\n}\nclass AcceleratedAnimation extends BaseAnimation {\n constructor(options) {\n super(options);\n const { name, motionValue, keyframes } = this.options;\n this.resolver = new DOMKeyframesResolver(keyframes, (resolvedKeyframes, finalKeyframe) => this.onKeyframesResolved(resolvedKeyframes, finalKeyframe), name, motionValue);\n this.resolver.scheduleResolve();\n }\n initPlayback(keyframes, finalKeyframe) {\n var _a;\n let { duration = 300, times, ease, type, motionValue, name, } = this.options;\n /**\n * If element has since been unmounted, return false to indicate\n * the animation failed to initialised.\n */\n if (!((_a = motionValue.owner) === null || _a === void 0 ? void 0 : _a.current)) {\n return false;\n }\n /**\n * If this animation needs pre-generated keyframes then generate.\n */\n if (requiresPregeneratedKeyframes(this.options)) {\n const { onComplete, onUpdate, motionValue, ...options } = this.options;\n const pregeneratedAnimation = pregenerateKeyframes(keyframes, options);\n keyframes = pregeneratedAnimation.keyframes;\n // If this is a very short animation, ensure we have\n // at least two keyframes to animate between as older browsers\n // can't animate between a single keyframe.\n if (keyframes.length === 1) {\n keyframes[1] = keyframes[0];\n }\n duration = pregeneratedAnimation.duration;\n times = pregeneratedAnimation.times;\n ease = pregeneratedAnimation.ease;\n type = \"keyframes\";\n }\n const animation = animateStyle(motionValue.owner.current, name, keyframes, { ...this.options, duration, times, ease });\n // Override the browser calculated startTime with one synchronised to other JS\n // and WAAPI animations starting this event loop.\n animation.startTime = time.now();\n if (this.pendingTimeline) {\n animation.timeline = this.pendingTimeline;\n this.pendingTimeline = undefined;\n }\n else {\n /**\n * Prefer the `onfinish` prop as it's more widely supported than\n * the `finished` promise.\n *\n * Here, we synchronously set the provided MotionValue to the end\n * keyframe. If we didn't, when the WAAPI animation is finished it would\n * be removed from the element which would then revert to its old styles.\n */\n animation.onfinish = () => {\n const { onComplete } = this.options;\n motionValue.set(getFinalKeyframe(keyframes, this.options, finalKeyframe));\n onComplete && onComplete();\n this.cancel();\n this.resolveFinishedPromise();\n };\n }\n return {\n animation,\n duration,\n times,\n type,\n ease,\n keyframes: keyframes,\n };\n }\n get duration() {\n const { resolved } = this;\n if (!resolved)\n return 0;\n const { duration } = resolved;\n return millisecondsToSeconds(duration);\n }\n get time() {\n const { resolved } = this;\n if (!resolved)\n return 0;\n const { animation } = resolved;\n return millisecondsToSeconds(animation.currentTime || 0);\n }\n set time(newTime) {\n const { resolved } = this;\n if (!resolved)\n return;\n const { animation } = resolved;\n animation.currentTime = secondsToMilliseconds(newTime);\n }\n get speed() {\n const { resolved } = this;\n if (!resolved)\n return 1;\n const { animation } = resolved;\n return animation.playbackRate;\n }\n set speed(newSpeed) {\n const { resolved } = this;\n if (!resolved)\n return;\n const { animation } = resolved;\n animation.playbackRate = newSpeed;\n }\n get state() {\n const { resolved } = this;\n if (!resolved)\n return \"idle\";\n const { animation } = resolved;\n return animation.playState;\n }\n /**\n * Replace the default DocumentTimeline with another AnimationTimeline.\n * Currently used for scroll animations.\n */\n attachTimeline(timeline) {\n if (!this._resolved) {\n this.pendingTimeline = timeline;\n }\n else {\n const { resolved } = this;\n if (!resolved)\n return noop;\n const { animation } = resolved;\n animation.timeline = timeline;\n animation.onfinish = null;\n }\n return noop;\n }\n play() {\n if (this.isStopped)\n return;\n const { resolved } = this;\n if (!resolved)\n return;\n const { animation } = resolved;\n if (animation.playState === \"finished\") {\n this.updateFinishedPromise();\n }\n animation.play();\n }\n pause() {\n const { resolved } = this;\n if (!resolved)\n return;\n const { animation } = resolved;\n animation.pause();\n }\n stop() {\n this.resolver.cancel();\n this.isStopped = true;\n if (this.state === \"idle\")\n return;\n const { resolved } = this;\n if (!resolved)\n return;\n const { animation, keyframes, duration, type, ease, times } = resolved;\n if (animation.playState === \"idle\" ||\n animation.playState === \"finished\") {\n return;\n }\n /**\n * WAAPI doesn't natively have any interruption capabilities.\n *\n * Rather than read commited styles back out of the DOM, we can\n * create a renderless JS animation and sample it twice to calculate\n * its current value, \"previous\" value, and therefore allow\n * Motion to calculate velocity for any subsequent animation.\n */\n if (this.time) {\n const { motionValue, onUpdate, onComplete, ...options } = this.options;\n const sampleAnimation = new MainThreadAnimation({\n ...options,\n keyframes,\n duration,\n type,\n ease,\n times,\n isGenerator: true,\n });\n const sampleTime = secondsToMilliseconds(this.time);\n motionValue.setWithVelocity(sampleAnimation.sample(sampleTime - sampleDelta).value, sampleAnimation.sample(sampleTime).value, sampleDelta);\n }\n this.cancel();\n }\n complete() {\n const { resolved } = this;\n if (!resolved)\n return;\n resolved.animation.finish();\n }\n cancel() {\n const { resolved } = this;\n if (!resolved)\n return;\n resolved.animation.cancel();\n }\n static supports(options) {\n const { motionValue, name, repeatDelay, repeatType, damping, type } = options;\n return (supportsWaapi() &&\n name &&\n acceleratedValues.has(name) &&\n motionValue &&\n motionValue.owner &&\n motionValue.owner.current instanceof HTMLElement &&\n /**\n * If we're outputting values to onUpdate then we can't use WAAPI as there's\n * no way to read the value from WAAPI every frame.\n */\n !motionValue.owner.getProps().onUpdate &&\n !repeatDelay &&\n repeatType !== \"mirror\" &&\n damping !== 0 &&\n type !== \"inertia\");\n }\n}\n\nexport { AcceleratedAnimation };\n","import { frame, cancelFrame } from '../../../frameloop/frame.mjs';\n\nfunction observeTimeline(update, timeline) {\n let prevProgress;\n const onFrame = () => {\n const { currentTime } = timeline;\n const percentage = currentTime === null ? 0 : currentTime.value;\n const progress = percentage / 100;\n if (prevProgress !== progress) {\n update(progress);\n }\n prevProgress = progress;\n };\n frame.update(onFrame, true);\n return () => cancelFrame(onFrame);\n}\n\nexport { observeTimeline };\n","import { memo } from '../../../utils/memo.mjs';\n\nconst supportsScrollTimeline = memo(() => window.ScrollTimeline !== undefined);\n\nexport { supportsScrollTimeline };\n","import { observeTimeline } from '../render/dom/scroll/observe.mjs';\nimport { supportsScrollTimeline } from '../render/dom/scroll/supports.mjs';\n\nclass GroupPlaybackControls {\n constructor(animations) {\n // Bound to accomodate common `return animation.stop` pattern\n this.stop = () => this.runAll(\"stop\");\n this.animations = animations.filter(Boolean);\n }\n then(onResolve, onReject) {\n return Promise.all(this.animations).then(onResolve).catch(onReject);\n }\n /**\n * TODO: Filter out cancelled or stopped animations before returning\n */\n getAll(propName) {\n return this.animations[0][propName];\n }\n setAll(propName, newValue) {\n for (let i = 0; i < this.animations.length; i++) {\n this.animations[i][propName] = newValue;\n }\n }\n attachTimeline(timeline) {\n const cancelAll = this.animations.map((animation) => {\n if (supportsScrollTimeline() && animation.attachTimeline) {\n animation.attachTimeline(timeline);\n }\n else {\n animation.pause();\n return observeTimeline((progress) => {\n animation.time = animation.duration * progress;\n }, timeline);\n }\n });\n return () => {\n cancelAll.forEach((cancelTimeline, i) => {\n if (cancelTimeline)\n cancelTimeline();\n this.animations[i].stop();\n });\n };\n }\n get time() {\n return this.getAll(\"time\");\n }\n set time(time) {\n this.setAll(\"time\", time);\n }\n get speed() {\n return this.getAll(\"speed\");\n }\n set speed(speed) {\n this.setAll(\"speed\", speed);\n }\n get duration() {\n let max = 0;\n for (let i = 0; i < this.animations.length; i++) {\n max = Math.max(max, this.animations[i].duration);\n }\n return max;\n }\n runAll(methodName) {\n this.animations.forEach((controls) => controls[methodName]());\n }\n play() {\n this.runAll(\"play\");\n }\n pause() {\n this.runAll(\"pause\");\n }\n cancel() {\n this.runAll(\"cancel\");\n }\n complete() {\n this.runAll(\"complete\");\n }\n}\n\nexport { GroupPlaybackControls };\n","import { secondsToMilliseconds } from '../../utils/time-conversion.mjs';\nimport { getDefaultTransition } from '../utils/default-transitions.mjs';\nimport { getValueTransition, isTransitionDefined } from '../utils/transitions.mjs';\nimport { MotionGlobalConfig } from '../../utils/GlobalConfig.mjs';\nimport { instantAnimationState } from '../../utils/use-instant-transition-state.mjs';\nimport { getFinalKeyframe } from '../animators/waapi/utils/get-final-keyframe.mjs';\nimport { frame } from '../../frameloop/frame.mjs';\nimport { AcceleratedAnimation } from '../animators/AcceleratedAnimation.mjs';\nimport { MainThreadAnimation } from '../animators/MainThreadAnimation.mjs';\nimport { GroupPlaybackControls } from '../GroupPlaybackControls.mjs';\n\nconst animateMotionValue = (name, value, target, transition = {}, element, isHandoff) => (onComplete) => {\n const valueTransition = getValueTransition(transition, name) || {};\n /**\n * Most transition values are currently completely overwritten by value-specific\n * transitions. In the future it'd be nicer to blend these transitions. But for now\n * delay actually does inherit from the root transition if not value-specific.\n */\n const delay = valueTransition.delay || transition.delay || 0;\n /**\n * Elapsed isn't a public transition option but can be passed through from\n * optimized appear effects in milliseconds.\n */\n let { elapsed = 0 } = transition;\n elapsed = elapsed - secondsToMilliseconds(delay);\n let options = {\n keyframes: Array.isArray(target) ? target : [null, target],\n ease: \"easeOut\",\n velocity: value.getVelocity(),\n ...valueTransition,\n delay: -elapsed,\n onUpdate: (v) => {\n value.set(v);\n valueTransition.onUpdate && valueTransition.onUpdate(v);\n },\n onComplete: () => {\n onComplete();\n valueTransition.onComplete && valueTransition.onComplete();\n },\n name,\n motionValue: value,\n element: isHandoff ? undefined : element,\n };\n /**\n * If there's no transition defined for this value, we can generate\n * unqiue transition settings for this value.\n */\n if (!isTransitionDefined(valueTransition)) {\n options = {\n ...options,\n ...getDefaultTransition(name, options),\n };\n }\n /**\n * Both WAAPI and our internal animation functions use durations\n * as defined by milliseconds, while our external API defines them\n * as seconds.\n */\n if (options.duration) {\n options.duration = secondsToMilliseconds(options.duration);\n }\n if (options.repeatDelay) {\n options.repeatDelay = secondsToMilliseconds(options.repeatDelay);\n }\n if (options.from !== undefined) {\n options.keyframes[0] = options.from;\n }\n let shouldSkip = false;\n if (options.type === false ||\n (options.duration === 0 && !options.repeatDelay)) {\n options.duration = 0;\n if (options.delay === 0) {\n shouldSkip = true;\n }\n }\n if (instantAnimationState.current ||\n MotionGlobalConfig.skipAnimations) {\n shouldSkip = true;\n options.duration = 0;\n options.delay = 0;\n }\n /**\n * If we can or must skip creating the animation, and apply only\n * the final keyframe, do so. We also check once keyframes are resolved but\n * this early check prevents the need to create an animation at all.\n */\n if (shouldSkip && !isHandoff && value.get() !== undefined) {\n const finalKeyframe = getFinalKeyframe(options.keyframes, valueTransition);\n if (finalKeyframe !== undefined) {\n frame.update(() => {\n options.onUpdate(finalKeyframe);\n options.onComplete();\n });\n // We still want to return some animation controls here rather\n // than returning undefined\n return new GroupPlaybackControls([]);\n }\n }\n /**\n * Animate via WAAPI if possible. If this is a handoff animation, the optimised animation will be running via\n * WAAPI. Therefore, this animation must be JS to ensure it runs \"under\" the\n * optimised animation.\n */\n if (!isHandoff && AcceleratedAnimation.supports(options)) {\n return new AcceleratedAnimation(options);\n }\n else {\n return new MainThreadAnimation(options);\n }\n};\n\nexport { animateMotionValue };\n","import { isMotionValue } from '../utils/is-motion-value.mjs';\n\nfunction isWillChangeMotionValue(value) {\n return Boolean(isMotionValue(value) && value.add);\n}\n\nexport { isWillChangeMotionValue };\n","function addUniqueItem(arr, item) {\n if (arr.indexOf(item) === -1)\n arr.push(item);\n}\nfunction removeItem(arr, item) {\n const index = arr.indexOf(item);\n if (index > -1)\n arr.splice(index, 1);\n}\n// Adapted from array-move\nfunction moveItem([...arr], fromIndex, toIndex) {\n const startIndex = fromIndex < 0 ? arr.length + fromIndex : fromIndex;\n if (startIndex >= 0 && startIndex < arr.length) {\n const endIndex = toIndex < 0 ? arr.length + toIndex : toIndex;\n const [item] = arr.splice(fromIndex, 1);\n arr.splice(endIndex, 0, item);\n }\n return arr;\n}\n\nexport { addUniqueItem, moveItem, removeItem };\n","import { addUniqueItem, removeItem } from './array.mjs';\n\nclass SubscriptionManager {\n constructor() {\n this.subscriptions = [];\n }\n add(handler) {\n addUniqueItem(this.subscriptions, handler);\n return () => removeItem(this.subscriptions, handler);\n }\n notify(a, b, c) {\n const numSubscriptions = this.subscriptions.length;\n if (!numSubscriptions)\n return;\n if (numSubscriptions === 1) {\n /**\n * If there's only a single handler we can just call it without invoking a loop.\n */\n this.subscriptions[0](a, b, c);\n }\n else {\n for (let i = 0; i < numSubscriptions; i++) {\n /**\n * Check whether the handler exists before firing as it's possible\n * the subscriptions were modified during this loop running.\n */\n const handler = this.subscriptions[i];\n handler && handler(a, b, c);\n }\n }\n }\n getSize() {\n return this.subscriptions.length;\n }\n clear() {\n this.subscriptions.length = 0;\n }\n}\n\nexport { SubscriptionManager };\n","import { SubscriptionManager } from '../utils/subscription-manager.mjs';\nimport { velocityPerSecond } from '../utils/velocity-per-second.mjs';\nimport { warnOnce } from '../utils/warn-once.mjs';\nimport { time } from '../frameloop/sync-time.mjs';\nimport { frame } from '../frameloop/frame.mjs';\n\n/**\n * Maximum time between the value of two frames, beyond which we\n * assume the velocity has since been 0.\n */\nconst MAX_VELOCITY_DELTA = 30;\nconst isFloat = (value) => {\n return !isNaN(parseFloat(value));\n};\nconst collectMotionValues = {\n current: undefined,\n};\n/**\n * `MotionValue` is used to track the state and velocity of motion values.\n *\n * @public\n */\nclass MotionValue {\n /**\n * @param init - The initiating value\n * @param config - Optional configuration options\n *\n * - `transformer`: A function to transform incoming values with.\n *\n * @internal\n */\n constructor(init, options = {}) {\n /**\n * This will be replaced by the build step with the latest version number.\n * When MotionValues are provided to motion components, warn if versions are mixed.\n */\n this.version = \"11.2.10\";\n /**\n * Tracks whether this value can output a velocity. Currently this is only true\n * if the value is numerical, but we might be able to widen the scope here and support\n * other value types.\n *\n * @internal\n */\n this.canTrackVelocity = null;\n /**\n * An object containing a SubscriptionManager for each active event.\n */\n this.events = {};\n this.updateAndNotify = (v, render = true) => {\n const currentTime = time.now();\n /**\n * If we're updating the value during another frame or eventloop\n * than the previous frame, then the we set the previous frame value\n * to current.\n */\n if (this.updatedAt !== currentTime) {\n this.setPrevFrameValue();\n }\n this.prev = this.current;\n this.setCurrent(v);\n // Update update subscribers\n if (this.current !== this.prev && this.events.change) {\n this.events.change.notify(this.current);\n }\n // Update render subscribers\n if (render && this.events.renderRequest) {\n this.events.renderRequest.notify(this.current);\n }\n };\n this.hasAnimated = false;\n this.setCurrent(init);\n this.owner = options.owner;\n }\n setCurrent(current) {\n this.current = current;\n this.updatedAt = time.now();\n if (this.canTrackVelocity === null && current !== undefined) {\n this.canTrackVelocity = isFloat(this.current);\n }\n }\n setPrevFrameValue(prevFrameValue = this.current) {\n this.prevFrameValue = prevFrameValue;\n this.prevUpdatedAt = this.updatedAt;\n }\n /**\n * Adds a function that will be notified when the `MotionValue` is updated.\n *\n * It returns a function that, when called, will cancel the subscription.\n *\n * When calling `onChange` inside a React component, it should be wrapped with the\n * `useEffect` hook. As it returns an unsubscribe function, this should be returned\n * from the `useEffect` function to ensure you don't add duplicate subscribers..\n *\n * ```jsx\n * export const MyComponent = () => {\n * const x = useMotionValue(0)\n * const y = useMotionValue(0)\n * const opacity = useMotionValue(1)\n *\n * useEffect(() => {\n * function updateOpacity() {\n * const maxXY = Math.max(x.get(), y.get())\n * const newOpacity = transform(maxXY, [0, 100], [1, 0])\n * opacity.set(newOpacity)\n * }\n *\n * const unsubscribeX = x.on(\"change\", updateOpacity)\n * const unsubscribeY = y.on(\"change\", updateOpacity)\n *\n * return () => {\n * unsubscribeX()\n * unsubscribeY()\n * }\n * }, [])\n *\n * return \n * }\n * ```\n *\n * @param subscriber - A function that receives the latest value.\n * @returns A function that, when called, will cancel this subscription.\n *\n * @deprecated\n */\n onChange(subscription) {\n if (process.env.NODE_ENV !== \"production\") {\n warnOnce(false, `value.onChange(callback) is deprecated. Switch to value.on(\"change\", callback).`);\n }\n return this.on(\"change\", subscription);\n }\n on(eventName, callback) {\n if (!this.events[eventName]) {\n this.events[eventName] = new SubscriptionManager();\n }\n const unsubscribe = this.events[eventName].add(callback);\n if (eventName === \"change\") {\n return () => {\n unsubscribe();\n /**\n * If we have no more change listeners by the start\n * of the next frame, stop active animations.\n */\n frame.read(() => {\n if (!this.events.change.getSize()) {\n this.stop();\n }\n });\n };\n }\n return unsubscribe;\n }\n clearListeners() {\n for (const eventManagers in this.events) {\n this.events[eventManagers].clear();\n }\n }\n /**\n * Attaches a passive effect to the `MotionValue`.\n *\n * @internal\n */\n attach(passiveEffect, stopPassiveEffect) {\n this.passiveEffect = passiveEffect;\n this.stopPassiveEffect = stopPassiveEffect;\n }\n /**\n * Sets the state of the `MotionValue`.\n *\n * @remarks\n *\n * ```jsx\n * const x = useMotionValue(0)\n * x.set(10)\n * ```\n *\n * @param latest - Latest value to set.\n * @param render - Whether to notify render subscribers. Defaults to `true`\n *\n * @public\n */\n set(v, render = true) {\n if (!render || !this.passiveEffect) {\n this.updateAndNotify(v, render);\n }\n else {\n this.passiveEffect(v, this.updateAndNotify);\n }\n }\n setWithVelocity(prev, current, delta) {\n this.set(current);\n this.prev = undefined;\n this.prevFrameValue = prev;\n this.prevUpdatedAt = this.updatedAt - delta;\n }\n /**\n * Set the state of the `MotionValue`, stopping any active animations,\n * effects, and resets velocity to `0`.\n */\n jump(v, endAnimation = true) {\n this.updateAndNotify(v);\n this.prev = v;\n this.prevUpdatedAt = this.prevFrameValue = undefined;\n endAnimation && this.stop();\n if (this.stopPassiveEffect)\n this.stopPassiveEffect();\n }\n /**\n * Returns the latest state of `MotionValue`\n *\n * @returns - The latest state of `MotionValue`\n *\n * @public\n */\n get() {\n if (collectMotionValues.current) {\n collectMotionValues.current.push(this);\n }\n return this.current;\n }\n /**\n * @public\n */\n getPrevious() {\n return this.prev;\n }\n /**\n * Returns the latest velocity of `MotionValue`\n *\n * @returns - The latest velocity of `MotionValue`. Returns `0` if the state is non-numerical.\n *\n * @public\n */\n getVelocity() {\n const currentTime = time.now();\n if (!this.canTrackVelocity ||\n this.prevFrameValue === undefined ||\n currentTime - this.updatedAt > MAX_VELOCITY_DELTA) {\n return 0;\n }\n const delta = Math.min(this.updatedAt - this.prevUpdatedAt, MAX_VELOCITY_DELTA);\n // Casts because of parseFloat's poor typing\n return velocityPerSecond(parseFloat(this.current) -\n parseFloat(this.prevFrameValue), delta);\n }\n /**\n * Registers a new animation to control this `MotionValue`. Only one\n * animation can drive a `MotionValue` at one time.\n *\n * ```jsx\n * value.start()\n * ```\n *\n * @param animation - A function that starts the provided animation\n *\n * @internal\n */\n start(startAnimation) {\n this.stop();\n return new Promise((resolve) => {\n this.hasAnimated = true;\n this.animation = startAnimation(resolve);\n if (this.events.animationStart) {\n this.events.animationStart.notify();\n }\n }).then(() => {\n if (this.events.animationComplete) {\n this.events.animationComplete.notify();\n }\n this.clearAnimation();\n });\n }\n /**\n * Stop the currently active animation.\n *\n * @public\n */\n stop() {\n if (this.animation) {\n this.animation.stop();\n if (this.events.animationCancel) {\n this.events.animationCancel.notify();\n }\n }\n this.clearAnimation();\n }\n /**\n * Returns `true` if this value is currently animating.\n *\n * @public\n */\n isAnimating() {\n return !!this.animation;\n }\n clearAnimation() {\n delete this.animation;\n }\n /**\n * Destroy and clean up subscribers to this `MotionValue`.\n *\n * The `MotionValue` hooks like `useMotionValue` and `useTransform` automatically\n * handle the lifecycle of the returned `MotionValue`, so this method is only necessary if you've manually\n * created a `MotionValue` via the `motionValue` function.\n *\n * @public\n */\n destroy() {\n this.clearListeners();\n this.stop();\n if (this.stopPassiveEffect) {\n this.stopPassiveEffect();\n }\n }\n}\nfunction motionValue(init, options) {\n return new MotionValue(init, options);\n}\n\nexport { MotionValue, collectMotionValues, motionValue };\n","import { resolveFinalValueInKeyframes } from '../../utils/resolve-value.mjs';\nimport { motionValue } from '../../value/index.mjs';\nimport { resolveVariant } from './resolve-dynamic-variants.mjs';\n\n/**\n * Set VisualElement's MotionValue, creating a new MotionValue for it if\n * it doesn't exist.\n */\nfunction setMotionValue(visualElement, key, value) {\n if (visualElement.hasValue(key)) {\n visualElement.getValue(key).set(value);\n }\n else {\n visualElement.addValue(key, motionValue(value));\n }\n}\nfunction setTarget(visualElement, definition) {\n const resolved = resolveVariant(visualElement, definition);\n let { transitionEnd = {}, transition = {}, ...target } = resolved || {};\n target = { ...target, ...transitionEnd };\n for (const key in target) {\n const value = resolveFinalValueInKeyframes(target[key]);\n setMotionValue(visualElement, key, value);\n }\n}\n\nexport { setTarget };\n","import { optimizedAppearDataAttribute } from './data-id.mjs';\n\nfunction getOptimisedAppearId(visualElement) {\n return visualElement.getProps()[optimizedAppearDataAttribute];\n}\n\nexport { getOptimisedAppearId };\n","import { transformProps } from '../../render/html/utils/transform.mjs';\nimport { animateMotionValue } from './motion-value.mjs';\nimport { isWillChangeMotionValue } from '../../value/use-will-change/is.mjs';\nimport { setTarget } from '../../render/utils/setters.mjs';\nimport { getValueTransition } from '../utils/transitions.mjs';\nimport { getOptimisedAppearId } from '../optimized-appear/get-appear-id.mjs';\nimport { frame } from '../../frameloop/frame.mjs';\n\n/**\n * Decide whether we should block this animation. Previously, we achieved this\n * just by checking whether the key was listed in protectedKeys, but this\n * posed problems if an animation was triggered by afterChildren and protectedKeys\n * had been set to true in the meantime.\n */\nfunction shouldBlockAnimation({ protectedKeys, needsAnimating }, key) {\n const shouldBlock = protectedKeys.hasOwnProperty(key) && needsAnimating[key] !== true;\n needsAnimating[key] = false;\n return shouldBlock;\n}\nfunction animateTarget(visualElement, targetAndTransition, { delay = 0, transitionOverride, type } = {}) {\n var _a;\n let { transition = visualElement.getDefaultTransition(), transitionEnd, ...target } = targetAndTransition;\n const willChange = visualElement.getValue(\"willChange\");\n if (transitionOverride)\n transition = transitionOverride;\n const animations = [];\n const animationTypeState = type &&\n visualElement.animationState &&\n visualElement.animationState.getState()[type];\n for (const key in target) {\n const value = visualElement.getValue(key, (_a = visualElement.latestValues[key]) !== null && _a !== void 0 ? _a : null);\n const valueTarget = target[key];\n if (valueTarget === undefined ||\n (animationTypeState &&\n shouldBlockAnimation(animationTypeState, key))) {\n continue;\n }\n const valueTransition = {\n delay,\n elapsed: 0,\n ...getValueTransition(transition || {}, key),\n };\n /**\n * If this is the first time a value is being animated, check\n * to see if we're handling off from an existing animation.\n */\n let isHandoff = false;\n if (window.HandoffAppearAnimations) {\n const appearId = getOptimisedAppearId(visualElement);\n if (appearId) {\n const elapsed = window.HandoffAppearAnimations(appearId, key, value, frame);\n if (elapsed !== null) {\n valueTransition.elapsed = elapsed;\n isHandoff = true;\n }\n }\n }\n value.start(animateMotionValue(key, value, valueTarget, visualElement.shouldReduceMotion && transformProps.has(key)\n ? { type: false }\n : valueTransition, visualElement, isHandoff));\n const animation = value.animation;\n if (animation) {\n if (isWillChangeMotionValue(willChange)) {\n willChange.add(key);\n animation.then(() => willChange.remove(key));\n }\n animations.push(animation);\n }\n }\n if (transitionEnd) {\n Promise.all(animations).then(() => {\n frame.update(() => {\n transitionEnd && setTarget(visualElement, transitionEnd);\n });\n });\n }\n return animations;\n}\n\nexport { animateTarget };\n","import { resolveVariant } from '../../render/utils/resolve-dynamic-variants.mjs';\nimport { animateTarget } from './visual-element-target.mjs';\n\nfunction animateVariant(visualElement, variant, options = {}) {\n var _a;\n const resolved = resolveVariant(visualElement, variant, options.type === \"exit\"\n ? (_a = visualElement.presenceContext) === null || _a === void 0 ? void 0 : _a.custom\n : undefined);\n let { transition = visualElement.getDefaultTransition() || {} } = resolved || {};\n if (options.transitionOverride) {\n transition = options.transitionOverride;\n }\n /**\n * If we have a variant, create a callback that runs it as an animation.\n * Otherwise, we resolve a Promise immediately for a composable no-op.\n */\n const getAnimation = resolved\n ? () => Promise.all(animateTarget(visualElement, resolved, options))\n : () => Promise.resolve();\n /**\n * If we have children, create a callback that runs all their animations.\n * Otherwise, we resolve a Promise immediately for a composable no-op.\n */\n const getChildAnimations = visualElement.variantChildren && visualElement.variantChildren.size\n ? (forwardDelay = 0) => {\n const { delayChildren = 0, staggerChildren, staggerDirection, } = transition;\n return animateChildren(visualElement, variant, delayChildren + forwardDelay, staggerChildren, staggerDirection, options);\n }\n : () => Promise.resolve();\n /**\n * If the transition explicitly defines a \"when\" option, we need to resolve either\n * this animation or all children animations before playing the other.\n */\n const { when } = transition;\n if (when) {\n const [first, last] = when === \"beforeChildren\"\n ? [getAnimation, getChildAnimations]\n : [getChildAnimations, getAnimation];\n return first().then(() => last());\n }\n else {\n return Promise.all([getAnimation(), getChildAnimations(options.delay)]);\n }\n}\nfunction animateChildren(visualElement, variant, delayChildren = 0, staggerChildren = 0, staggerDirection = 1, options) {\n const animations = [];\n const maxStaggerDuration = (visualElement.variantChildren.size - 1) * staggerChildren;\n const generateStaggerDuration = staggerDirection === 1\n ? (i = 0) => i * staggerChildren\n : (i = 0) => maxStaggerDuration - i * staggerChildren;\n Array.from(visualElement.variantChildren)\n .sort(sortByTreeOrder)\n .forEach((child, i) => {\n child.notify(\"AnimationStart\", variant);\n animations.push(animateVariant(child, variant, {\n ...options,\n delay: delayChildren + generateStaggerDuration(i),\n }).then(() => child.notify(\"AnimationComplete\", variant)));\n });\n return Promise.all(animations);\n}\nfunction sortByTreeOrder(a, b) {\n return a.sortNodePosition(b);\n}\n\nexport { animateVariant, sortByTreeOrder };\n","import { resolveVariant } from '../../render/utils/resolve-dynamic-variants.mjs';\nimport { animateTarget } from './visual-element-target.mjs';\nimport { animateVariant } from './visual-element-variant.mjs';\nimport { frame } from '../../frameloop/frame.mjs';\n\nfunction animateVisualElement(visualElement, definition, options = {}) {\n visualElement.notify(\"AnimationStart\", definition);\n let animation;\n if (Array.isArray(definition)) {\n const animations = definition.map((variant) => animateVariant(visualElement, variant, options));\n animation = Promise.all(animations);\n }\n else if (typeof definition === \"string\") {\n animation = animateVariant(visualElement, definition, options);\n }\n else {\n const resolvedDefinition = typeof definition === \"function\"\n ? resolveVariant(visualElement, definition, options.custom)\n : definition;\n animation = Promise.all(animateTarget(visualElement, resolvedDefinition, options));\n }\n return animation.then(() => {\n frame.postRender(() => {\n visualElement.notify(\"AnimationComplete\", definition);\n });\n });\n}\n\nexport { animateVisualElement };\n","import { isAnimationControls } from '../../animation/utils/is-animation-controls.mjs';\nimport { isKeyframesTarget } from '../../animation/utils/is-keyframes-target.mjs';\nimport { shallowCompare } from '../../utils/shallow-compare.mjs';\nimport { isVariantLabel } from './is-variant-label.mjs';\nimport { resolveVariant } from './resolve-dynamic-variants.mjs';\nimport { variantPriorityOrder } from './variant-props.mjs';\nimport { animateVisualElement } from '../../animation/interfaces/visual-element.mjs';\n\nconst reversePriorityOrder = [...variantPriorityOrder].reverse();\nconst numAnimationTypes = variantPriorityOrder.length;\nfunction animateList(visualElement) {\n return (animations) => Promise.all(animations.map(({ animation, options }) => animateVisualElement(visualElement, animation, options)));\n}\nfunction createAnimationState(visualElement) {\n let animate = animateList(visualElement);\n const state = createState();\n let isInitialRender = true;\n /**\n * This function will be used to reduce the animation definitions for\n * each active animation type into an object of resolved values for it.\n */\n const buildResolvedTypeValues = (type) => (acc, definition) => {\n var _a;\n const resolved = resolveVariant(visualElement, definition, type === \"exit\"\n ? (_a = visualElement.presenceContext) === null || _a === void 0 ? void 0 : _a.custom\n : undefined);\n if (resolved) {\n const { transition, transitionEnd, ...target } = resolved;\n acc = { ...acc, ...target, ...transitionEnd };\n }\n return acc;\n };\n /**\n * This just allows us to inject mocked animation functions\n * @internal\n */\n function setAnimateFunction(makeAnimator) {\n animate = makeAnimator(visualElement);\n }\n /**\n * When we receive new props, we need to:\n * 1. Create a list of protected keys for each type. This is a directory of\n * value keys that are currently being \"handled\" by types of a higher priority\n * so that whenever an animation is played of a given type, these values are\n * protected from being animated.\n * 2. Determine if an animation type needs animating.\n * 3. Determine if any values have been removed from a type and figure out\n * what to animate those to.\n */\n function animateChanges(changedActiveType) {\n const props = visualElement.getProps();\n const context = visualElement.getVariantContext(true) || {};\n /**\n * A list of animations that we'll build into as we iterate through the animation\n * types. This will get executed at the end of the function.\n */\n const animations = [];\n /**\n * Keep track of which values have been removed. Then, as we hit lower priority\n * animation types, we can check if they contain removed values and animate to that.\n */\n const removedKeys = new Set();\n /**\n * A dictionary of all encountered keys. This is an object to let us build into and\n * copy it without iteration. Each time we hit an animation type we set its protected\n * keys - the keys its not allowed to animate - to the latest version of this object.\n */\n let encounteredKeys = {};\n /**\n * If a variant has been removed at a given index, and this component is controlling\n * variant animations, we want to ensure lower-priority variants are forced to animate.\n */\n let removedVariantIndex = Infinity;\n /**\n * Iterate through all animation types in reverse priority order. For each, we want to\n * detect which values it's handling and whether or not they've changed (and therefore\n * need to be animated). If any values have been removed, we want to detect those in\n * lower priority props and flag for animation.\n */\n for (let i = 0; i < numAnimationTypes; i++) {\n const type = reversePriorityOrder[i];\n const typeState = state[type];\n const prop = props[type] !== undefined\n ? props[type]\n : context[type];\n const propIsVariant = isVariantLabel(prop);\n /**\n * If this type has *just* changed isActive status, set activeDelta\n * to that status. Otherwise set to null.\n */\n const activeDelta = type === changedActiveType ? typeState.isActive : null;\n if (activeDelta === false)\n removedVariantIndex = i;\n /**\n * If this prop is an inherited variant, rather than been set directly on the\n * component itself, we want to make sure we allow the parent to trigger animations.\n *\n * TODO: Can probably change this to a !isControllingVariants check\n */\n let isInherited = prop === context[type] &&\n prop !== props[type] &&\n propIsVariant;\n /**\n *\n */\n if (isInherited &&\n isInitialRender &&\n visualElement.manuallyAnimateOnMount) {\n isInherited = false;\n }\n /**\n * Set all encountered keys so far as the protected keys for this type. This will\n * be any key that has been animated or otherwise handled by active, higher-priortiy types.\n */\n typeState.protectedKeys = { ...encounteredKeys };\n // Check if we can skip analysing this prop early\n if (\n // If it isn't active and hasn't *just* been set as inactive\n (!typeState.isActive && activeDelta === null) ||\n // If we didn't and don't have any defined prop for this animation type\n (!prop && !typeState.prevProp) ||\n // Or if the prop doesn't define an animation\n isAnimationControls(prop) ||\n typeof prop === \"boolean\") {\n continue;\n }\n /**\n * As we go look through the values defined on this type, if we detect\n * a changed value or a value that was removed in a higher priority, we set\n * this to true and add this prop to the animation list.\n */\n const variantDidChange = checkVariantsDidChange(typeState.prevProp, prop);\n let shouldAnimateType = variantDidChange ||\n // If we're making this variant active, we want to always make it active\n (type === changedActiveType &&\n typeState.isActive &&\n !isInherited &&\n propIsVariant) ||\n // If we removed a higher-priority variant (i is in reverse order)\n (i > removedVariantIndex && propIsVariant);\n let handledRemovedValues = false;\n /**\n * As animations can be set as variant lists, variants or target objects, we\n * coerce everything to an array if it isn't one already\n */\n const definitionList = Array.isArray(prop) ? prop : [prop];\n /**\n * Build an object of all the resolved values. We'll use this in the subsequent\n * animateChanges calls to determine whether a value has changed.\n */\n let resolvedValues = definitionList.reduce(buildResolvedTypeValues(type), {});\n if (activeDelta === false)\n resolvedValues = {};\n /**\n * Now we need to loop through all the keys in the prev prop and this prop,\n * and decide:\n * 1. If the value has changed, and needs animating\n * 2. If it has been removed, and needs adding to the removedKeys set\n * 3. If it has been removed in a higher priority type and needs animating\n * 4. If it hasn't been removed in a higher priority but hasn't changed, and\n * needs adding to the type's protectedKeys list.\n */\n const { prevResolvedValues = {} } = typeState;\n const allKeys = {\n ...prevResolvedValues,\n ...resolvedValues,\n };\n const markToAnimate = (key) => {\n shouldAnimateType = true;\n if (removedKeys.has(key)) {\n handledRemovedValues = true;\n removedKeys.delete(key);\n }\n typeState.needsAnimating[key] = true;\n const motionValue = visualElement.getValue(key);\n if (motionValue)\n motionValue.liveStyle = false;\n };\n for (const key in allKeys) {\n const next = resolvedValues[key];\n const prev = prevResolvedValues[key];\n // If we've already handled this we can just skip ahead\n if (encounteredKeys.hasOwnProperty(key))\n continue;\n /**\n * If the value has changed, we probably want to animate it.\n */\n let valueHasChanged = false;\n if (isKeyframesTarget(next) && isKeyframesTarget(prev)) {\n valueHasChanged = !shallowCompare(next, prev);\n }\n else {\n valueHasChanged = next !== prev;\n }\n if (valueHasChanged) {\n if (next !== undefined && next !== null) {\n // If next is defined and doesn't equal prev, it needs animating\n markToAnimate(key);\n }\n else {\n // If it's undefined, it's been removed.\n removedKeys.add(key);\n }\n }\n else if (next !== undefined && removedKeys.has(key)) {\n /**\n * If next hasn't changed and it isn't undefined, we want to check if it's\n * been removed by a higher priority\n */\n markToAnimate(key);\n }\n else {\n /**\n * If it hasn't changed, we add it to the list of protected values\n * to ensure it doesn't get animated.\n */\n typeState.protectedKeys[key] = true;\n }\n }\n /**\n * Update the typeState so next time animateChanges is called we can compare the\n * latest prop and resolvedValues to these.\n */\n typeState.prevProp = prop;\n typeState.prevResolvedValues = resolvedValues;\n /**\n *\n */\n if (typeState.isActive) {\n encounteredKeys = { ...encounteredKeys, ...resolvedValues };\n }\n if (isInitialRender && visualElement.blockInitialAnimation) {\n shouldAnimateType = false;\n }\n /**\n * If this is an inherited prop we want to hard-block animations\n */\n if (shouldAnimateType && (!isInherited || handledRemovedValues)) {\n animations.push(...definitionList.map((animation) => ({\n animation: animation,\n options: { type },\n })));\n }\n }\n /**\n * If there are some removed value that haven't been dealt with,\n * we need to create a new animation that falls back either to the value\n * defined in the style prop, or the last read value.\n */\n if (removedKeys.size) {\n const fallbackAnimation = {};\n removedKeys.forEach((key) => {\n const fallbackTarget = visualElement.getBaseTarget(key);\n const motionValue = visualElement.getValue(key);\n if (motionValue)\n motionValue.liveStyle = true;\n // @ts-expect-error - @mattgperry to figure if we should do something here\n fallbackAnimation[key] = fallbackTarget !== null && fallbackTarget !== void 0 ? fallbackTarget : null;\n });\n animations.push({ animation: fallbackAnimation });\n }\n let shouldAnimate = Boolean(animations.length);\n if (isInitialRender &&\n (props.initial === false || props.initial === props.animate) &&\n !visualElement.manuallyAnimateOnMount) {\n shouldAnimate = false;\n }\n isInitialRender = false;\n return shouldAnimate ? animate(animations) : Promise.resolve();\n }\n /**\n * Change whether a certain animation type is active.\n */\n function setActive(type, isActive) {\n var _a;\n // If the active state hasn't changed, we can safely do nothing here\n if (state[type].isActive === isActive)\n return Promise.resolve();\n // Propagate active change to children\n (_a = visualElement.variantChildren) === null || _a === void 0 ? void 0 : _a.forEach((child) => { var _a; return (_a = child.animationState) === null || _a === void 0 ? void 0 : _a.setActive(type, isActive); });\n state[type].isActive = isActive;\n const animations = animateChanges(type);\n for (const key in state) {\n state[key].protectedKeys = {};\n }\n return animations;\n }\n return {\n animateChanges,\n setActive,\n setAnimateFunction,\n getState: () => state,\n };\n}\nfunction checkVariantsDidChange(prev, next) {\n if (typeof next === \"string\") {\n return next !== prev;\n }\n else if (Array.isArray(next)) {\n return !shallowCompare(next, prev);\n }\n return false;\n}\nfunction createTypeState(isActive = false) {\n return {\n isActive,\n protectedKeys: {},\n needsAnimating: {},\n prevResolvedValues: {},\n };\n}\nfunction createState() {\n return {\n animate: createTypeState(true),\n whileInView: createTypeState(),\n whileHover: createTypeState(),\n whileTap: createTypeState(),\n whileDrag: createTypeState(),\n whileFocus: createTypeState(),\n exit: createTypeState(),\n };\n}\n\nexport { checkVariantsDidChange, createAnimationState };\n","import { isAnimationControls } from '../../../animation/utils/is-animation-controls.mjs';\nimport { createAnimationState } from '../../../render/utils/animation-state.mjs';\nimport { Feature } from '../Feature.mjs';\n\nclass AnimationFeature extends Feature {\n /**\n * We dynamically generate the AnimationState manager as it contains a reference\n * to the underlying animation library. We only want to load that if we load this,\n * so people can optionally code split it out using the `m` component.\n */\n constructor(node) {\n super(node);\n node.animationState || (node.animationState = createAnimationState(node));\n }\n updateAnimationControlsSubscription() {\n const { animate } = this.node.getProps();\n this.unmount();\n if (isAnimationControls(animate)) {\n this.unmount = animate.subscribe(this.node);\n }\n }\n /**\n * Subscribe any provided AnimationControls to the component's VisualElement\n */\n mount() {\n this.updateAnimationControlsSubscription();\n }\n update() {\n const { animate } = this.node.getProps();\n const { animate: prevAnimate } = this.node.prevProps || {};\n if (animate !== prevAnimate) {\n this.updateAnimationControlsSubscription();\n }\n }\n unmount() { }\n}\n\nexport { AnimationFeature };\n","import { Feature } from '../Feature.mjs';\n\nlet id = 0;\nclass ExitAnimationFeature extends Feature {\n constructor() {\n super(...arguments);\n this.id = id++;\n }\n update() {\n if (!this.node.presenceContext)\n return;\n const { isPresent, onExitComplete } = this.node.presenceContext;\n const { isPresent: prevIsPresent } = this.node.prevPresenceContext || {};\n if (!this.node.animationState || isPresent === prevIsPresent) {\n return;\n }\n const exitAnimation = this.node.animationState.setActive(\"exit\", !isPresent);\n if (onExitComplete && !isPresent) {\n exitAnimation.then(() => onExitComplete(this.id));\n }\n }\n mount() {\n const { register } = this.node.presenceContext || {};\n if (register) {\n this.unmount = register(this.id);\n }\n }\n unmount() { }\n}\n\nexport { ExitAnimationFeature };\n","import { AnimationFeature } from './animation/index.mjs';\nimport { ExitAnimationFeature } from './animation/exit.mjs';\n\nconst animations = {\n animation: {\n Feature: AnimationFeature,\n },\n exit: {\n Feature: ExitAnimationFeature,\n },\n};\n\nexport { animations };\n","const distance = (a, b) => Math.abs(a - b);\nfunction distance2D(a, b) {\n // Multi-dimensional\n const xDelta = distance(a.x, b.x);\n const yDelta = distance(a.y, b.y);\n return Math.sqrt(xDelta ** 2 + yDelta ** 2);\n}\n\nexport { distance, distance2D };\n","import { extractEventInfo } from '../../events/event-info.mjs';\nimport { secondsToMilliseconds, millisecondsToSeconds } from '../../utils/time-conversion.mjs';\nimport { addPointerEvent } from '../../events/add-pointer-event.mjs';\nimport { pipe } from '../../utils/pipe.mjs';\nimport { distance2D } from '../../utils/distance.mjs';\nimport { isPrimaryPointer } from '../../events/utils/is-primary-pointer.mjs';\nimport { frame, cancelFrame, frameData } from '../../frameloop/frame.mjs';\n\n/**\n * @internal\n */\nclass PanSession {\n constructor(event, handlers, { transformPagePoint, contextWindow, dragSnapToOrigin = false } = {}) {\n /**\n * @internal\n */\n this.startEvent = null;\n /**\n * @internal\n */\n this.lastMoveEvent = null;\n /**\n * @internal\n */\n this.lastMoveEventInfo = null;\n /**\n * @internal\n */\n this.handlers = {};\n /**\n * @internal\n */\n this.contextWindow = window;\n this.updatePoint = () => {\n if (!(this.lastMoveEvent && this.lastMoveEventInfo))\n return;\n const info = getPanInfo(this.lastMoveEventInfo, this.history);\n const isPanStarted = this.startEvent !== null;\n // Only start panning if the offset is larger than 3 pixels. If we make it\n // any larger than this we'll want to reset the pointer history\n // on the first update to avoid visual snapping to the cursoe.\n const isDistancePastThreshold = distance2D(info.offset, { x: 0, y: 0 }) >= 3;\n if (!isPanStarted && !isDistancePastThreshold)\n return;\n const { point } = info;\n const { timestamp } = frameData;\n this.history.push({ ...point, timestamp });\n const { onStart, onMove } = this.handlers;\n if (!isPanStarted) {\n onStart && onStart(this.lastMoveEvent, info);\n this.startEvent = this.lastMoveEvent;\n }\n onMove && onMove(this.lastMoveEvent, info);\n };\n this.handlePointerMove = (event, info) => {\n this.lastMoveEvent = event;\n this.lastMoveEventInfo = transformPoint(info, this.transformPagePoint);\n // Throttle mouse move event to once per frame\n frame.update(this.updatePoint, true);\n };\n this.handlePointerUp = (event, info) => {\n this.end();\n const { onEnd, onSessionEnd, resumeAnimation } = this.handlers;\n if (this.dragSnapToOrigin)\n resumeAnimation && resumeAnimation();\n if (!(this.lastMoveEvent && this.lastMoveEventInfo))\n return;\n const panInfo = getPanInfo(event.type === \"pointercancel\"\n ? this.lastMoveEventInfo\n : transformPoint(info, this.transformPagePoint), this.history);\n if (this.startEvent && onEnd) {\n onEnd(event, panInfo);\n }\n onSessionEnd && onSessionEnd(event, panInfo);\n };\n // If we have more than one touch, don't start detecting this gesture\n if (!isPrimaryPointer(event))\n return;\n this.dragSnapToOrigin = dragSnapToOrigin;\n this.handlers = handlers;\n this.transformPagePoint = transformPagePoint;\n this.contextWindow = contextWindow || window;\n const info = extractEventInfo(event);\n const initialInfo = transformPoint(info, this.transformPagePoint);\n const { point } = initialInfo;\n const { timestamp } = frameData;\n this.history = [{ ...point, timestamp }];\n const { onSessionStart } = handlers;\n onSessionStart &&\n onSessionStart(event, getPanInfo(initialInfo, this.history));\n this.removeListeners = pipe(addPointerEvent(this.contextWindow, \"pointermove\", this.handlePointerMove), addPointerEvent(this.contextWindow, \"pointerup\", this.handlePointerUp), addPointerEvent(this.contextWindow, \"pointercancel\", this.handlePointerUp));\n }\n updateHandlers(handlers) {\n this.handlers = handlers;\n }\n end() {\n this.removeListeners && this.removeListeners();\n cancelFrame(this.updatePoint);\n }\n}\nfunction transformPoint(info, transformPagePoint) {\n return transformPagePoint ? { point: transformPagePoint(info.point) } : info;\n}\nfunction subtractPoint(a, b) {\n return { x: a.x - b.x, y: a.y - b.y };\n}\nfunction getPanInfo({ point }, history) {\n return {\n point,\n delta: subtractPoint(point, lastDevicePoint(history)),\n offset: subtractPoint(point, startDevicePoint(history)),\n velocity: getVelocity(history, 0.1),\n };\n}\nfunction startDevicePoint(history) {\n return history[0];\n}\nfunction lastDevicePoint(history) {\n return history[history.length - 1];\n}\nfunction getVelocity(history, timeDelta) {\n if (history.length < 2) {\n return { x: 0, y: 0 };\n }\n let i = history.length - 1;\n let timestampedPoint = null;\n const lastPoint = lastDevicePoint(history);\n while (i >= 0) {\n timestampedPoint = history[i];\n if (lastPoint.timestamp - timestampedPoint.timestamp >\n secondsToMilliseconds(timeDelta)) {\n break;\n }\n i--;\n }\n if (!timestampedPoint) {\n return { x: 0, y: 0 };\n }\n const time = millisecondsToSeconds(lastPoint.timestamp - timestampedPoint.timestamp);\n if (time === 0) {\n return { x: 0, y: 0 };\n }\n const currentVelocity = {\n x: (lastPoint.x - timestampedPoint.x) / time,\n y: (lastPoint.y - timestampedPoint.y) / time,\n };\n if (currentVelocity.x === Infinity) {\n currentVelocity.x = 0;\n }\n if (currentVelocity.y === Infinity) {\n currentVelocity.y = 0;\n }\n return currentVelocity;\n}\n\nexport { PanSession };\n","import { mixNumber } from '../../utils/mix/number.mjs';\n\nfunction calcLength(axis) {\n return axis.max - axis.min;\n}\nfunction isNear(value, target = 0, maxDistance = 0.01) {\n return Math.abs(value - target) <= maxDistance;\n}\nfunction calcAxisDelta(delta, source, target, origin = 0.5) {\n delta.origin = origin;\n delta.originPoint = mixNumber(source.min, source.max, delta.origin);\n delta.scale = calcLength(target) / calcLength(source);\n if (isNear(delta.scale, 1, 0.0001) || isNaN(delta.scale))\n delta.scale = 1;\n delta.translate =\n mixNumber(target.min, target.max, delta.origin) - delta.originPoint;\n if (isNear(delta.translate) || isNaN(delta.translate))\n delta.translate = 0;\n}\nfunction calcBoxDelta(delta, source, target, origin) {\n calcAxisDelta(delta.x, source.x, target.x, origin ? origin.originX : undefined);\n calcAxisDelta(delta.y, source.y, target.y, origin ? origin.originY : undefined);\n}\nfunction calcRelativeAxis(target, relative, parent) {\n target.min = parent.min + relative.min;\n target.max = target.min + calcLength(relative);\n}\nfunction calcRelativeBox(target, relative, parent) {\n calcRelativeAxis(target.x, relative.x, parent.x);\n calcRelativeAxis(target.y, relative.y, parent.y);\n}\nfunction calcRelativeAxisPosition(target, layout, parent) {\n target.min = layout.min - parent.min;\n target.max = target.min + calcLength(layout);\n}\nfunction calcRelativePosition(target, layout, parent) {\n calcRelativeAxisPosition(target.x, layout.x, parent.x);\n calcRelativeAxisPosition(target.y, layout.y, parent.y);\n}\n\nexport { calcAxisDelta, calcBoxDelta, calcLength, calcRelativeAxis, calcRelativeAxisPosition, calcRelativeBox, calcRelativePosition, isNear };\n","import { progress } from '../../../utils/progress.mjs';\nimport { calcLength } from '../../../projection/geometry/delta-calc.mjs';\nimport { clamp } from '../../../utils/clamp.mjs';\nimport { mixNumber } from '../../../utils/mix/number.mjs';\n\n/**\n * Apply constraints to a point. These constraints are both physical along an\n * axis, and an elastic factor that determines how much to constrain the point\n * by if it does lie outside the defined parameters.\n */\nfunction applyConstraints(point, { min, max }, elastic) {\n if (min !== undefined && point < min) {\n // If we have a min point defined, and this is outside of that, constrain\n point = elastic\n ? mixNumber(min, point, elastic.min)\n : Math.max(point, min);\n }\n else if (max !== undefined && point > max) {\n // If we have a max point defined, and this is outside of that, constrain\n point = elastic\n ? mixNumber(max, point, elastic.max)\n : Math.min(point, max);\n }\n return point;\n}\n/**\n * Calculate constraints in terms of the viewport when defined relatively to the\n * measured axis. This is measured from the nearest edge, so a max constraint of 200\n * on an axis with a max value of 300 would return a constraint of 500 - axis length\n */\nfunction calcRelativeAxisConstraints(axis, min, max) {\n return {\n min: min !== undefined ? axis.min + min : undefined,\n max: max !== undefined\n ? axis.max + max - (axis.max - axis.min)\n : undefined,\n };\n}\n/**\n * Calculate constraints in terms of the viewport when\n * defined relatively to the measured bounding box.\n */\nfunction calcRelativeConstraints(layoutBox, { top, left, bottom, right }) {\n return {\n x: calcRelativeAxisConstraints(layoutBox.x, left, right),\n y: calcRelativeAxisConstraints(layoutBox.y, top, bottom),\n };\n}\n/**\n * Calculate viewport constraints when defined as another viewport-relative axis\n */\nfunction calcViewportAxisConstraints(layoutAxis, constraintsAxis) {\n let min = constraintsAxis.min - layoutAxis.min;\n let max = constraintsAxis.max - layoutAxis.max;\n // If the constraints axis is actually smaller than the layout axis then we can\n // flip the constraints\n if (constraintsAxis.max - constraintsAxis.min <\n layoutAxis.max - layoutAxis.min) {\n [min, max] = [max, min];\n }\n return { min, max };\n}\n/**\n * Calculate viewport constraints when defined as another viewport-relative box\n */\nfunction calcViewportConstraints(layoutBox, constraintsBox) {\n return {\n x: calcViewportAxisConstraints(layoutBox.x, constraintsBox.x),\n y: calcViewportAxisConstraints(layoutBox.y, constraintsBox.y),\n };\n}\n/**\n * Calculate a transform origin relative to the source axis, between 0-1, that results\n * in an asthetically pleasing scale/transform needed to project from source to target.\n */\nfunction calcOrigin(source, target) {\n let origin = 0.5;\n const sourceLength = calcLength(source);\n const targetLength = calcLength(target);\n if (targetLength > sourceLength) {\n origin = progress(target.min, target.max - sourceLength, source.min);\n }\n else if (sourceLength > targetLength) {\n origin = progress(source.min, source.max - targetLength, target.min);\n }\n return clamp(0, 1, origin);\n}\n/**\n * Rebase the calculated viewport constraints relative to the layout.min point.\n */\nfunction rebaseAxisConstraints(layout, constraints) {\n const relativeConstraints = {};\n if (constraints.min !== undefined) {\n relativeConstraints.min = constraints.min - layout.min;\n }\n if (constraints.max !== undefined) {\n relativeConstraints.max = constraints.max - layout.min;\n }\n return relativeConstraints;\n}\nconst defaultElastic = 0.35;\n/**\n * Accepts a dragElastic prop and returns resolved elastic values for each axis.\n */\nfunction resolveDragElastic(dragElastic = defaultElastic) {\n if (dragElastic === false) {\n dragElastic = 0;\n }\n else if (dragElastic === true) {\n dragElastic = defaultElastic;\n }\n return {\n x: resolveAxisElastic(dragElastic, \"left\", \"right\"),\n y: resolveAxisElastic(dragElastic, \"top\", \"bottom\"),\n };\n}\nfunction resolveAxisElastic(dragElastic, minLabel, maxLabel) {\n return {\n min: resolvePointElastic(dragElastic, minLabel),\n max: resolvePointElastic(dragElastic, maxLabel),\n };\n}\nfunction resolvePointElastic(dragElastic, label) {\n return typeof dragElastic === \"number\"\n ? dragElastic\n : dragElastic[label] || 0;\n}\n\nexport { applyConstraints, calcOrigin, calcRelativeAxisConstraints, calcRelativeConstraints, calcViewportAxisConstraints, calcViewportConstraints, defaultElastic, rebaseAxisConstraints, resolveAxisElastic, resolveDragElastic, resolvePointElastic };\n","const createAxisDelta = () => ({\n translate: 0,\n scale: 1,\n origin: 0,\n originPoint: 0,\n});\nconst createDelta = () => ({\n x: createAxisDelta(),\n y: createAxisDelta(),\n});\nconst createAxis = () => ({ min: 0, max: 0 });\nconst createBox = () => ({\n x: createAxis(),\n y: createAxis(),\n});\n\nexport { createAxis, createAxisDelta, createBox, createDelta };\n","function eachAxis(callback) {\n return [callback(\"x\"), callback(\"y\")];\n}\n\nexport { eachAxis };\n","/**\n * Bounding boxes tend to be defined as top, left, right, bottom. For various operations\n * it's easier to consider each axis individually. This function returns a bounding box\n * as a map of single-axis min/max values.\n */\nfunction convertBoundingBoxToBox({ top, left, right, bottom, }) {\n return {\n x: { min: left, max: right },\n y: { min: top, max: bottom },\n };\n}\nfunction convertBoxToBoundingBox({ x, y }) {\n return { top: y.min, right: x.max, bottom: y.max, left: x.min };\n}\n/**\n * Applies a TransformPoint function to a bounding box. TransformPoint is usually a function\n * provided by Framer to allow measured points to be corrected for device scaling. This is used\n * when measuring DOM elements and DOM event points.\n */\nfunction transformBoxPoints(point, transformPoint) {\n if (!transformPoint)\n return point;\n const topLeft = transformPoint({ x: point.left, y: point.top });\n const bottomRight = transformPoint({ x: point.right, y: point.bottom });\n return {\n top: topLeft.y,\n left: topLeft.x,\n bottom: bottomRight.y,\n right: bottomRight.x,\n };\n}\n\nexport { convertBoundingBoxToBox, convertBoxToBoundingBox, transformBoxPoints };\n","function isIdentityScale(scale) {\n return scale === undefined || scale === 1;\n}\nfunction hasScale({ scale, scaleX, scaleY }) {\n return (!isIdentityScale(scale) ||\n !isIdentityScale(scaleX) ||\n !isIdentityScale(scaleY));\n}\nfunction hasTransform(values) {\n return (hasScale(values) ||\n has2DTranslate(values) ||\n values.z ||\n values.rotate ||\n values.rotateX ||\n values.rotateY ||\n values.skewX ||\n values.skewY);\n}\nfunction has2DTranslate(values) {\n return is2DTranslate(values.x) || is2DTranslate(values.y);\n}\nfunction is2DTranslate(value) {\n return value && value !== \"0%\";\n}\n\nexport { has2DTranslate, hasScale, hasTransform };\n","import { mixNumber } from '../../utils/mix/number.mjs';\nimport { hasTransform } from '../utils/has-transform.mjs';\n\n/**\n * Scales a point based on a factor and an originPoint\n */\nfunction scalePoint(point, scale, originPoint) {\n const distanceFromOrigin = point - originPoint;\n const scaled = scale * distanceFromOrigin;\n return originPoint + scaled;\n}\n/**\n * Applies a translate/scale delta to a point\n */\nfunction applyPointDelta(point, translate, scale, originPoint, boxScale) {\n if (boxScale !== undefined) {\n point = scalePoint(point, boxScale, originPoint);\n }\n return scalePoint(point, scale, originPoint) + translate;\n}\n/**\n * Applies a translate/scale delta to an axis\n */\nfunction applyAxisDelta(axis, translate = 0, scale = 1, originPoint, boxScale) {\n axis.min = applyPointDelta(axis.min, translate, scale, originPoint, boxScale);\n axis.max = applyPointDelta(axis.max, translate, scale, originPoint, boxScale);\n}\n/**\n * Applies a translate/scale delta to a box\n */\nfunction applyBoxDelta(box, { x, y }) {\n applyAxisDelta(box.x, x.translate, x.scale, x.originPoint);\n applyAxisDelta(box.y, y.translate, y.scale, y.originPoint);\n}\n/**\n * Apply a tree of deltas to a box. We do this to calculate the effect of all the transforms\n * in a tree upon our box before then calculating how to project it into our desired viewport-relative box\n *\n * This is the final nested loop within updateLayoutDelta for future refactoring\n */\nfunction applyTreeDeltas(box, treeScale, treePath, isSharedTransition = false) {\n const treeLength = treePath.length;\n if (!treeLength)\n return;\n // Reset the treeScale\n treeScale.x = treeScale.y = 1;\n let node;\n let delta;\n for (let i = 0; i < treeLength; i++) {\n node = treePath[i];\n delta = node.projectionDelta;\n /**\n * TODO: Prefer to remove this, but currently we have motion components with\n * display: contents in Framer.\n */\n const instance = node.instance;\n if (instance &&\n instance.style &&\n instance.style.display === \"contents\") {\n continue;\n }\n if (isSharedTransition &&\n node.options.layoutScroll &&\n node.scroll &&\n node !== node.root) {\n transformBox(box, {\n x: -node.scroll.offset.x,\n y: -node.scroll.offset.y,\n });\n }\n if (delta) {\n // Incoporate each ancestor's scale into a culmulative treeScale for this component\n treeScale.x *= delta.x.scale;\n treeScale.y *= delta.y.scale;\n // Apply each ancestor's calculated delta into this component's recorded layout box\n applyBoxDelta(box, delta);\n }\n if (isSharedTransition && hasTransform(node.latestValues)) {\n transformBox(box, node.latestValues);\n }\n }\n /**\n * Snap tree scale back to 1 if it's within a non-perceivable threshold.\n * This will help reduce useless scales getting rendered.\n */\n treeScale.x = snapToDefault(treeScale.x);\n treeScale.y = snapToDefault(treeScale.y);\n}\nfunction snapToDefault(scale) {\n if (Number.isInteger(scale))\n return scale;\n return scale > 1.0000000000001 || scale < 0.999999999999 ? scale : 1;\n}\nfunction translateAxis(axis, distance) {\n axis.min = axis.min + distance;\n axis.max = axis.max + distance;\n}\n/**\n * Apply a transform to an axis from the latest resolved motion values.\n * This function basically acts as a bridge between a flat motion value map\n * and applyAxisDelta\n */\nfunction transformAxis(axis, transforms, [key, scaleKey, originKey]) {\n const axisOrigin = transforms[originKey] !== undefined ? transforms[originKey] : 0.5;\n const originPoint = mixNumber(axis.min, axis.max, axisOrigin);\n // Apply the axis delta to the final axis\n applyAxisDelta(axis, transforms[key], transforms[scaleKey], originPoint, transforms.scale);\n}\n/**\n * The names of the motion values we want to apply as translation, scale and origin.\n */\nconst xKeys = [\"x\", \"scaleX\", \"originX\"];\nconst yKeys = [\"y\", \"scaleY\", \"originY\"];\n/**\n * Apply a transform to a box from the latest resolved motion values.\n */\nfunction transformBox(box, transform) {\n transformAxis(box.x, transform, xKeys);\n transformAxis(box.y, transform, yKeys);\n}\n\nexport { applyAxisDelta, applyBoxDelta, applyPointDelta, applyTreeDeltas, scalePoint, transformAxis, transformBox, translateAxis };\n","import { convertBoundingBoxToBox, transformBoxPoints } from '../geometry/conversion.mjs';\nimport { translateAxis } from '../geometry/delta-apply.mjs';\n\nfunction measureViewportBox(instance, transformPoint) {\n return convertBoundingBoxToBox(transformBoxPoints(instance.getBoundingClientRect(), transformPoint));\n}\nfunction measurePageBox(element, rootProjectionNode, transformPagePoint) {\n const viewportBox = measureViewportBox(element, transformPagePoint);\n const { scroll } = rootProjectionNode;\n if (scroll) {\n translateAxis(viewportBox.x, scroll.offset.x);\n translateAxis(viewportBox.y, scroll.offset.y);\n }\n return viewportBox;\n}\n\nexport { measurePageBox, measureViewportBox };\n","// Fixes https://github.com/framer/motion/issues/2270\nconst getContextWindow = ({ current }) => {\n return current ? current.ownerDocument.defaultView : null;\n};\n\nexport { getContextWindow };\n","import { invariant } from '../../utils/errors.mjs';\nimport { PanSession } from '../pan/PanSession.mjs';\nimport { getGlobalLock } from './utils/lock.mjs';\nimport { isRefObject } from '../../utils/is-ref-object.mjs';\nimport { addPointerEvent } from '../../events/add-pointer-event.mjs';\nimport { applyConstraints, calcRelativeConstraints, resolveDragElastic, calcViewportConstraints, rebaseAxisConstraints, calcOrigin, defaultElastic } from './utils/constraints.mjs';\nimport { createBox } from '../../projection/geometry/models.mjs';\nimport { eachAxis } from '../../projection/utils/each-axis.mjs';\nimport { measurePageBox } from '../../projection/utils/measure.mjs';\nimport { extractEventInfo } from '../../events/event-info.mjs';\nimport { convertBoxToBoundingBox, convertBoundingBoxToBox } from '../../projection/geometry/conversion.mjs';\nimport { addDomEvent } from '../../events/add-dom-event.mjs';\nimport { calcLength } from '../../projection/geometry/delta-calc.mjs';\nimport { mixNumber } from '../../utils/mix/number.mjs';\nimport { percent } from '../../value/types/numbers/units.mjs';\nimport { animateMotionValue } from '../../animation/interfaces/motion-value.mjs';\nimport { getContextWindow } from '../../utils/get-context-window.mjs';\nimport { frame } from '../../frameloop/frame.mjs';\n\nconst elementDragControls = new WeakMap();\n/**\n *\n */\n// let latestPointerEvent: PointerEvent\nclass VisualElementDragControls {\n constructor(visualElement) {\n // This is a reference to the global drag gesture lock, ensuring only one component\n // can \"capture\" the drag of one or both axes.\n // TODO: Look into moving this into pansession?\n this.openGlobalLock = null;\n this.isDragging = false;\n this.currentDirection = null;\n this.originPoint = { x: 0, y: 0 };\n /**\n * The permitted boundaries of travel, in pixels.\n */\n this.constraints = false;\n this.hasMutatedConstraints = false;\n /**\n * The per-axis resolved elastic values.\n */\n this.elastic = createBox();\n this.visualElement = visualElement;\n }\n start(originEvent, { snapToCursor = false } = {}) {\n /**\n * Don't start dragging if this component is exiting\n */\n const { presenceContext } = this.visualElement;\n if (presenceContext && presenceContext.isPresent === false)\n return;\n const onSessionStart = (event) => {\n const { dragSnapToOrigin } = this.getProps();\n // Stop or pause any animations on both axis values immediately. This allows the user to throw and catch\n // the component.\n dragSnapToOrigin ? this.pauseAnimation() : this.stopAnimation();\n if (snapToCursor) {\n this.snapToCursor(extractEventInfo(event, \"page\").point);\n }\n };\n const onStart = (event, info) => {\n // Attempt to grab the global drag gesture lock - maybe make this part of PanSession\n const { drag, dragPropagation, onDragStart } = this.getProps();\n if (drag && !dragPropagation) {\n if (this.openGlobalLock)\n this.openGlobalLock();\n this.openGlobalLock = getGlobalLock(drag);\n // If we don 't have the lock, don't start dragging\n if (!this.openGlobalLock)\n return;\n }\n this.isDragging = true;\n this.currentDirection = null;\n this.resolveConstraints();\n if (this.visualElement.projection) {\n this.visualElement.projection.isAnimationBlocked = true;\n this.visualElement.projection.target = undefined;\n }\n /**\n * Record gesture origin\n */\n eachAxis((axis) => {\n let current = this.getAxisMotionValue(axis).get() || 0;\n /**\n * If the MotionValue is a percentage value convert to px\n */\n if (percent.test(current)) {\n const { projection } = this.visualElement;\n if (projection && projection.layout) {\n const measuredAxis = projection.layout.layoutBox[axis];\n if (measuredAxis) {\n const length = calcLength(measuredAxis);\n current = length * (parseFloat(current) / 100);\n }\n }\n }\n this.originPoint[axis] = current;\n });\n // Fire onDragStart event\n if (onDragStart) {\n frame.postRender(() => onDragStart(event, info));\n }\n const { animationState } = this.visualElement;\n animationState && animationState.setActive(\"whileDrag\", true);\n };\n const onMove = (event, info) => {\n // latestPointerEvent = event\n const { dragPropagation, dragDirectionLock, onDirectionLock, onDrag, } = this.getProps();\n // If we didn't successfully receive the gesture lock, early return.\n if (!dragPropagation && !this.openGlobalLock)\n return;\n const { offset } = info;\n // Attempt to detect drag direction if directionLock is true\n if (dragDirectionLock && this.currentDirection === null) {\n this.currentDirection = getCurrentDirection(offset);\n // If we've successfully set a direction, notify listener\n if (this.currentDirection !== null) {\n onDirectionLock && onDirectionLock(this.currentDirection);\n }\n return;\n }\n // Update each point with the latest position\n this.updateAxis(\"x\", info.point, offset);\n this.updateAxis(\"y\", info.point, offset);\n /**\n * Ideally we would leave the renderer to fire naturally at the end of\n * this frame but if the element is about to change layout as the result\n * of a re-render we want to ensure the browser can read the latest\n * bounding box to ensure the pointer and element don't fall out of sync.\n */\n this.visualElement.render();\n /**\n * This must fire after the render call as it might trigger a state\n * change which itself might trigger a layout update.\n */\n onDrag && onDrag(event, info);\n };\n const onSessionEnd = (event, info) => this.stop(event, info);\n const resumeAnimation = () => eachAxis((axis) => {\n var _a;\n return this.getAnimationState(axis) === \"paused\" &&\n ((_a = this.getAxisMotionValue(axis).animation) === null || _a === void 0 ? void 0 : _a.play());\n });\n const { dragSnapToOrigin } = this.getProps();\n this.panSession = new PanSession(originEvent, {\n onSessionStart,\n onStart,\n onMove,\n onSessionEnd,\n resumeAnimation,\n }, {\n transformPagePoint: this.visualElement.getTransformPagePoint(),\n dragSnapToOrigin,\n contextWindow: getContextWindow(this.visualElement),\n });\n }\n stop(event, info) {\n const isDragging = this.isDragging;\n this.cancel();\n if (!isDragging)\n return;\n const { velocity } = info;\n this.startAnimation(velocity);\n const { onDragEnd } = this.getProps();\n if (onDragEnd) {\n frame.postRender(() => onDragEnd(event, info));\n }\n }\n cancel() {\n this.isDragging = false;\n const { projection, animationState } = this.visualElement;\n if (projection) {\n projection.isAnimationBlocked = false;\n }\n this.panSession && this.panSession.end();\n this.panSession = undefined;\n const { dragPropagation } = this.getProps();\n if (!dragPropagation && this.openGlobalLock) {\n this.openGlobalLock();\n this.openGlobalLock = null;\n }\n animationState && animationState.setActive(\"whileDrag\", false);\n }\n updateAxis(axis, _point, offset) {\n const { drag } = this.getProps();\n // If we're not dragging this axis, do an early return.\n if (!offset || !shouldDrag(axis, drag, this.currentDirection))\n return;\n const axisValue = this.getAxisMotionValue(axis);\n let next = this.originPoint[axis] + offset[axis];\n // Apply constraints\n if (this.constraints && this.constraints[axis]) {\n next = applyConstraints(next, this.constraints[axis], this.elastic[axis]);\n }\n axisValue.set(next);\n }\n resolveConstraints() {\n var _a;\n const { dragConstraints, dragElastic } = this.getProps();\n const layout = this.visualElement.projection &&\n !this.visualElement.projection.layout\n ? this.visualElement.projection.measure(false)\n : (_a = this.visualElement.projection) === null || _a === void 0 ? void 0 : _a.layout;\n const prevConstraints = this.constraints;\n if (dragConstraints && isRefObject(dragConstraints)) {\n if (!this.constraints) {\n this.constraints = this.resolveRefConstraints();\n }\n }\n else {\n if (dragConstraints && layout) {\n this.constraints = calcRelativeConstraints(layout.layoutBox, dragConstraints);\n }\n else {\n this.constraints = false;\n }\n }\n this.elastic = resolveDragElastic(dragElastic);\n /**\n * If we're outputting to external MotionValues, we want to rebase the measured constraints\n * from viewport-relative to component-relative.\n */\n if (prevConstraints !== this.constraints &&\n layout &&\n this.constraints &&\n !this.hasMutatedConstraints) {\n eachAxis((axis) => {\n if (this.constraints !== false &&\n this.getAxisMotionValue(axis)) {\n this.constraints[axis] = rebaseAxisConstraints(layout.layoutBox[axis], this.constraints[axis]);\n }\n });\n }\n }\n resolveRefConstraints() {\n const { dragConstraints: constraints, onMeasureDragConstraints } = this.getProps();\n if (!constraints || !isRefObject(constraints))\n return false;\n const constraintsElement = constraints.current;\n invariant(constraintsElement !== null, \"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.\");\n const { projection } = this.visualElement;\n // TODO\n if (!projection || !projection.layout)\n return false;\n const constraintsBox = measurePageBox(constraintsElement, projection.root, this.visualElement.getTransformPagePoint());\n let measuredConstraints = calcViewportConstraints(projection.layout.layoutBox, constraintsBox);\n /**\n * If there's an onMeasureDragConstraints listener we call it and\n * if different constraints are returned, set constraints to that\n */\n if (onMeasureDragConstraints) {\n const userConstraints = onMeasureDragConstraints(convertBoxToBoundingBox(measuredConstraints));\n this.hasMutatedConstraints = !!userConstraints;\n if (userConstraints) {\n measuredConstraints = convertBoundingBoxToBox(userConstraints);\n }\n }\n return measuredConstraints;\n }\n startAnimation(velocity) {\n const { drag, dragMomentum, dragElastic, dragTransition, dragSnapToOrigin, onDragTransitionEnd, } = this.getProps();\n const constraints = this.constraints || {};\n const momentumAnimations = eachAxis((axis) => {\n if (!shouldDrag(axis, drag, this.currentDirection)) {\n return;\n }\n let transition = (constraints && constraints[axis]) || {};\n if (dragSnapToOrigin)\n transition = { min: 0, max: 0 };\n /**\n * Overdamp the boundary spring if `dragElastic` is disabled. There's still a frame\n * of spring animations so we should look into adding a disable spring option to `inertia`.\n * We could do something here where we affect the `bounceStiffness` and `bounceDamping`\n * using the value of `dragElastic`.\n */\n const bounceStiffness = dragElastic ? 200 : 1000000;\n const bounceDamping = dragElastic ? 40 : 10000000;\n const inertia = {\n type: \"inertia\",\n velocity: dragMomentum ? velocity[axis] : 0,\n bounceStiffness,\n bounceDamping,\n timeConstant: 750,\n restDelta: 1,\n restSpeed: 10,\n ...dragTransition,\n ...transition,\n };\n // If we're not animating on an externally-provided `MotionValue` we can use the\n // component's animation controls which will handle interactions with whileHover (etc),\n // otherwise we just have to animate the `MotionValue` itself.\n return this.startAxisValueAnimation(axis, inertia);\n });\n // Run all animations and then resolve the new drag constraints.\n return Promise.all(momentumAnimations).then(onDragTransitionEnd);\n }\n startAxisValueAnimation(axis, transition) {\n const axisValue = this.getAxisMotionValue(axis);\n return axisValue.start(animateMotionValue(axis, axisValue, 0, transition, this.visualElement));\n }\n stopAnimation() {\n eachAxis((axis) => this.getAxisMotionValue(axis).stop());\n }\n pauseAnimation() {\n eachAxis((axis) => { var _a; return (_a = this.getAxisMotionValue(axis).animation) === null || _a === void 0 ? void 0 : _a.pause(); });\n }\n getAnimationState(axis) {\n var _a;\n return (_a = this.getAxisMotionValue(axis).animation) === null || _a === void 0 ? void 0 : _a.state;\n }\n /**\n * Drag works differently depending on which props are provided.\n *\n * - If _dragX and _dragY are provided, we output the gesture delta directly to those motion values.\n * - Otherwise, we apply the delta to the x/y motion values.\n */\n getAxisMotionValue(axis) {\n const dragKey = `_drag${axis.toUpperCase()}`;\n const props = this.visualElement.getProps();\n const externalMotionValue = props[dragKey];\n return externalMotionValue\n ? externalMotionValue\n : this.visualElement.getValue(axis, (props.initial\n ? props.initial[axis]\n : undefined) || 0);\n }\n snapToCursor(point) {\n eachAxis((axis) => {\n const { drag } = this.getProps();\n // If we're not dragging this axis, do an early return.\n if (!shouldDrag(axis, drag, this.currentDirection))\n return;\n const { projection } = this.visualElement;\n const axisValue = this.getAxisMotionValue(axis);\n if (projection && projection.layout) {\n const { min, max } = projection.layout.layoutBox[axis];\n axisValue.set(point[axis] - mixNumber(min, max, 0.5));\n }\n });\n }\n /**\n * When the viewport resizes we want to check if the measured constraints\n * have changed and, if so, reposition the element within those new constraints\n * relative to where it was before the resize.\n */\n scalePositionWithinConstraints() {\n if (!this.visualElement.current)\n return;\n const { drag, dragConstraints } = this.getProps();\n const { projection } = this.visualElement;\n if (!isRefObject(dragConstraints) || !projection || !this.constraints)\n return;\n /**\n * Stop current animations as there can be visual glitching if we try to do\n * this mid-animation\n */\n this.stopAnimation();\n /**\n * Record the relative position of the dragged element relative to the\n * constraints box and save as a progress value.\n */\n const boxProgress = { x: 0, y: 0 };\n eachAxis((axis) => {\n const axisValue = this.getAxisMotionValue(axis);\n if (axisValue && this.constraints !== false) {\n const latest = axisValue.get();\n boxProgress[axis] = calcOrigin({ min: latest, max: latest }, this.constraints[axis]);\n }\n });\n /**\n * Update the layout of this element and resolve the latest drag constraints\n */\n const { transformTemplate } = this.visualElement.getProps();\n this.visualElement.current.style.transform = transformTemplate\n ? transformTemplate({}, \"\")\n : \"none\";\n projection.root && projection.root.updateScroll();\n projection.updateLayout();\n this.resolveConstraints();\n /**\n * For each axis, calculate the current progress of the layout axis\n * within the new constraints.\n */\n eachAxis((axis) => {\n if (!shouldDrag(axis, drag, null))\n return;\n /**\n * Calculate a new transform based on the previous box progress\n */\n const axisValue = this.getAxisMotionValue(axis);\n const { min, max } = this.constraints[axis];\n axisValue.set(mixNumber(min, max, boxProgress[axis]));\n });\n }\n addListeners() {\n if (!this.visualElement.current)\n return;\n elementDragControls.set(this.visualElement, this);\n const element = this.visualElement.current;\n /**\n * Attach a pointerdown event listener on this DOM element to initiate drag tracking.\n */\n const stopPointerListener = addPointerEvent(element, \"pointerdown\", (event) => {\n const { drag, dragListener = true } = this.getProps();\n drag && dragListener && this.start(event);\n });\n const measureDragConstraints = () => {\n const { dragConstraints } = this.getProps();\n if (isRefObject(dragConstraints)) {\n this.constraints = this.resolveRefConstraints();\n }\n };\n const { projection } = this.visualElement;\n const stopMeasureLayoutListener = projection.addEventListener(\"measure\", measureDragConstraints);\n if (projection && !projection.layout) {\n projection.root && projection.root.updateScroll();\n projection.updateLayout();\n }\n measureDragConstraints();\n /**\n * Attach a window resize listener to scale the draggable target within its defined\n * constraints as the window resizes.\n */\n const stopResizeListener = addDomEvent(window, \"resize\", () => this.scalePositionWithinConstraints());\n /**\n * If the element's layout changes, calculate the delta and apply that to\n * the drag gesture's origin point.\n */\n const stopLayoutUpdateListener = projection.addEventListener(\"didUpdate\", (({ delta, hasLayoutChanged }) => {\n if (this.isDragging && hasLayoutChanged) {\n eachAxis((axis) => {\n const motionValue = this.getAxisMotionValue(axis);\n if (!motionValue)\n return;\n this.originPoint[axis] += delta[axis].translate;\n motionValue.set(motionValue.get() + delta[axis].translate);\n });\n this.visualElement.render();\n }\n }));\n return () => {\n stopResizeListener();\n stopPointerListener();\n stopMeasureLayoutListener();\n stopLayoutUpdateListener && stopLayoutUpdateListener();\n };\n }\n getProps() {\n const props = this.visualElement.getProps();\n const { drag = false, dragDirectionLock = false, dragPropagation = false, dragConstraints = false, dragElastic = defaultElastic, dragMomentum = true, } = props;\n return {\n ...props,\n drag,\n dragDirectionLock,\n dragPropagation,\n dragConstraints,\n dragElastic,\n dragMomentum,\n };\n }\n}\nfunction shouldDrag(direction, drag, currentDirection) {\n return ((drag === true || drag === direction) &&\n (currentDirection === null || currentDirection === direction));\n}\n/**\n * Based on an x/y offset determine the current drag direction. If both axis' offsets are lower\n * than the provided threshold, return `null`.\n *\n * @param offset - The x/y offset from origin.\n * @param lockThreshold - (Optional) - the minimum absolute offset before we can determine a drag direction.\n */\nfunction getCurrentDirection(offset, lockThreshold = 10) {\n let direction = null;\n if (Math.abs(offset.y) > lockThreshold) {\n direction = \"y\";\n }\n else if (Math.abs(offset.x) > lockThreshold) {\n direction = \"x\";\n }\n return direction;\n}\n\nexport { VisualElementDragControls, elementDragControls };\n","import { Feature } from '../../motion/features/Feature.mjs';\nimport { noop } from '../../utils/noop.mjs';\nimport { VisualElementDragControls } from './VisualElementDragControls.mjs';\n\nclass DragGesture extends Feature {\n constructor(node) {\n super(node);\n this.removeGroupControls = noop;\n this.removeListeners = noop;\n this.controls = new VisualElementDragControls(node);\n }\n mount() {\n // If we've been provided a DragControls for manual control over the drag gesture,\n // subscribe this component to it on mount.\n const { dragControls } = this.node.getProps();\n if (dragControls) {\n this.removeGroupControls = dragControls.subscribe(this.controls);\n }\n this.removeListeners = this.controls.addListeners() || noop;\n }\n unmount() {\n this.removeGroupControls();\n this.removeListeners();\n }\n}\n\nexport { DragGesture };\n","import { PanSession } from './PanSession.mjs';\nimport { addPointerEvent } from '../../events/add-pointer-event.mjs';\nimport { Feature } from '../../motion/features/Feature.mjs';\nimport { noop } from '../../utils/noop.mjs';\nimport { getContextWindow } from '../../utils/get-context-window.mjs';\nimport { frame } from '../../frameloop/frame.mjs';\n\nconst asyncHandler = (handler) => (event, info) => {\n if (handler) {\n frame.postRender(() => handler(event, info));\n }\n};\nclass PanGesture extends Feature {\n constructor() {\n super(...arguments);\n this.removePointerDownListener = noop;\n }\n onPointerDown(pointerDownEvent) {\n this.session = new PanSession(pointerDownEvent, this.createPanHandlers(), {\n transformPagePoint: this.node.getTransformPagePoint(),\n contextWindow: getContextWindow(this.node),\n });\n }\n createPanHandlers() {\n const { onPanSessionStart, onPanStart, onPan, onPanEnd } = this.node.getProps();\n return {\n onSessionStart: asyncHandler(onPanSessionStart),\n onStart: asyncHandler(onPanStart),\n onMove: onPan,\n onEnd: (event, info) => {\n delete this.session;\n if (onPanEnd) {\n frame.postRender(() => onPanEnd(event, info));\n }\n },\n };\n }\n mount() {\n this.removePointerDownListener = addPointerEvent(this.node.current, \"pointerdown\", (event) => this.onPointerDown(event));\n }\n update() {\n this.session && this.session.updateHandlers(this.createPanHandlers());\n }\n unmount() {\n this.removePointerDownListener();\n this.session && this.session.end();\n }\n}\n\nexport { PanGesture };\n","import { useContext, useId, useEffect } from 'react';\nimport { PresenceContext } from '../../context/PresenceContext.mjs';\n\n/**\n * When a component is the child of `AnimatePresence`, it can use `usePresence`\n * to access information about whether it's still present in the React tree.\n *\n * ```jsx\n * import { usePresence } from \"framer-motion\"\n *\n * export const Component = () => {\n * const [isPresent, safeToRemove] = usePresence()\n *\n * useEffect(() => {\n * !isPresent && setTimeout(safeToRemove, 1000)\n * }, [isPresent])\n *\n * return
\n * }\n * ```\n *\n * If `isPresent` is `false`, it means that a component has been removed the tree, but\n * `AnimatePresence` won't really remove it until `safeToRemove` has been called.\n *\n * @public\n */\nfunction usePresence() {\n const context = useContext(PresenceContext);\n if (context === null)\n return [true, null];\n const { isPresent, onExitComplete, register } = context;\n // It's safe to call the following hooks conditionally (after an early return) because the context will always\n // either be null or non-null for the lifespan of the component.\n const id = useId();\n useEffect(() => register(id), []);\n const safeToRemove = () => onExitComplete && onExitComplete(id);\n return !isPresent && onExitComplete ? [false, safeToRemove] : [true];\n}\n/**\n * Similar to `usePresence`, except `useIsPresent` simply returns whether or not the component is present.\n * There is no `safeToRemove` function.\n *\n * ```jsx\n * import { useIsPresent } from \"framer-motion\"\n *\n * export const Component = () => {\n * const isPresent = useIsPresent()\n *\n * useEffect(() => {\n * !isPresent && console.log(\"I've been removed!\")\n * }, [isPresent])\n *\n * return
\n * }\n * ```\n *\n * @public\n */\nfunction useIsPresent() {\n return isPresent(useContext(PresenceContext));\n}\nfunction isPresent(context) {\n return context === null ? true : context.isPresent;\n}\n\nexport { isPresent, useIsPresent, usePresence };\n","/**\n * This should only ever be modified on the client otherwise it'll\n * persist through server requests. If we need instanced states we\n * could lazy-init via root.\n */\nconst globalProjectionState = {\n /**\n * Global flag as to whether the tree has animated since the last time\n * we resized the window\n */\n hasAnimatedSinceResize: true,\n /**\n * We set this to true once, on the first update. Any nodes added to the tree beyond that\n * update will be given a `data-projection-id` attribute.\n */\n hasEverUpdated: false,\n};\n\nexport { globalProjectionState };\n","import { px } from '../../value/types/numbers/units.mjs';\n\nfunction pixelsToPercent(pixels, axis) {\n if (axis.max === axis.min)\n return 0;\n return (pixels / (axis.max - axis.min)) * 100;\n}\n/**\n * We always correct borderRadius as a percentage rather than pixels to reduce paints.\n * For example, if you are projecting a box that is 100px wide with a 10px borderRadius\n * into a box that is 200px wide with a 20px borderRadius, that is actually a 10%\n * borderRadius in both states. If we animate between the two in pixels that will trigger\n * a paint each time. If we animate between the two in percentage we'll avoid a paint.\n */\nconst correctBorderRadius = {\n correct: (latest, node) => {\n if (!node.target)\n return latest;\n /**\n * If latest is a string, if it's a percentage we can return immediately as it's\n * going to be stretched appropriately. Otherwise, if it's a pixel, convert it to a number.\n */\n if (typeof latest === \"string\") {\n if (px.test(latest)) {\n latest = parseFloat(latest);\n }\n else {\n return latest;\n }\n }\n /**\n * If latest is a number, it's a pixel value. We use the current viewportBox to calculate that\n * pixel value as a percentage of each axis\n */\n const x = pixelsToPercent(latest, node.target.x);\n const y = pixelsToPercent(latest, node.target.y);\n return `${x}% ${y}%`;\n },\n};\n\nexport { correctBorderRadius, pixelsToPercent };\n","import { mixNumber } from '../../utils/mix/number.mjs';\nimport { complex } from '../../value/types/complex/index.mjs';\n\nconst correctBoxShadow = {\n correct: (latest, { treeScale, projectionDelta }) => {\n const original = latest;\n const shadow = complex.parse(latest);\n // TODO: Doesn't support multiple shadows\n if (shadow.length > 5)\n return original;\n const template = complex.createTransformer(latest);\n const offset = typeof shadow[0] !== \"number\" ? 1 : 0;\n // Calculate the overall context scale\n const xScale = projectionDelta.x.scale * treeScale.x;\n const yScale = projectionDelta.y.scale * treeScale.y;\n shadow[0 + offset] /= xScale;\n shadow[1 + offset] /= yScale;\n /**\n * Ideally we'd correct x and y scales individually, but because blur and\n * spread apply to both we have to take a scale average and apply that instead.\n * We could potentially improve the outcome of this by incorporating the ratio between\n * the two scales.\n */\n const averageScale = mixNumber(xScale, yScale, 0.5);\n // Blur\n if (typeof shadow[2 + offset] === \"number\")\n shadow[2 + offset] /= averageScale;\n // Spread\n if (typeof shadow[3 + offset] === \"number\")\n shadow[3 + offset] /= averageScale;\n return template(shadow);\n },\n};\n\nexport { correctBoxShadow };\n","import { jsx } from 'react/jsx-runtime';\nimport { useContext, Component } from 'react';\nimport { usePresence } from '../../../components/AnimatePresence/use-presence.mjs';\nimport { LayoutGroupContext } from '../../../context/LayoutGroupContext.mjs';\nimport { SwitchLayoutGroupContext } from '../../../context/SwitchLayoutGroupContext.mjs';\nimport { globalProjectionState } from '../../../projection/node/state.mjs';\nimport { correctBorderRadius } from '../../../projection/styles/scale-border-radius.mjs';\nimport { correctBoxShadow } from '../../../projection/styles/scale-box-shadow.mjs';\nimport { addScaleCorrector } from '../../../projection/styles/scale-correction.mjs';\nimport { microtask } from '../../../frameloop/microtask.mjs';\nimport { frame } from '../../../frameloop/frame.mjs';\n\nclass MeasureLayoutWithContext extends Component {\n /**\n * This only mounts projection nodes for components that\n * need measuring, we might want to do it for all components\n * in order to incorporate transforms\n */\n componentDidMount() {\n const { visualElement, layoutGroup, switchLayoutGroup, layoutId } = this.props;\n const { projection } = visualElement;\n addScaleCorrector(defaultScaleCorrectors);\n if (projection) {\n if (layoutGroup.group)\n layoutGroup.group.add(projection);\n if (switchLayoutGroup && switchLayoutGroup.register && layoutId) {\n switchLayoutGroup.register(projection);\n }\n projection.root.didUpdate();\n projection.addEventListener(\"animationComplete\", () => {\n this.safeToRemove();\n });\n projection.setOptions({\n ...projection.options,\n onExitComplete: () => this.safeToRemove(),\n });\n }\n globalProjectionState.hasEverUpdated = true;\n }\n getSnapshotBeforeUpdate(prevProps) {\n const { layoutDependency, visualElement, drag, isPresent } = this.props;\n const projection = visualElement.projection;\n if (!projection)\n return null;\n /**\n * TODO: We use this data in relegate to determine whether to\n * promote a previous element. There's no guarantee its presence data\n * will have updated by this point - if a bug like this arises it will\n * have to be that we markForRelegation and then find a new lead some other way,\n * perhaps in didUpdate\n */\n projection.isPresent = isPresent;\n if (drag ||\n prevProps.layoutDependency !== layoutDependency ||\n layoutDependency === undefined) {\n projection.willUpdate();\n }\n else {\n this.safeToRemove();\n }\n if (prevProps.isPresent !== isPresent) {\n if (isPresent) {\n projection.promote();\n }\n else if (!projection.relegate()) {\n /**\n * If there's another stack member taking over from this one,\n * it's in charge of the exit animation and therefore should\n * be in charge of the safe to remove. Otherwise we call it here.\n */\n frame.postRender(() => {\n const stack = projection.getStack();\n if (!stack || !stack.members.length) {\n this.safeToRemove();\n }\n });\n }\n }\n return null;\n }\n componentDidUpdate() {\n const { projection } = this.props.visualElement;\n if (projection) {\n projection.root.didUpdate();\n microtask.postRender(() => {\n if (!projection.currentAnimation && projection.isLead()) {\n this.safeToRemove();\n }\n });\n }\n }\n componentWillUnmount() {\n const { visualElement, layoutGroup, switchLayoutGroup: promoteContext, } = this.props;\n const { projection } = visualElement;\n if (projection) {\n projection.scheduleCheckAfterUnmount();\n if (layoutGroup && layoutGroup.group)\n layoutGroup.group.remove(projection);\n if (promoteContext && promoteContext.deregister)\n promoteContext.deregister(projection);\n }\n }\n safeToRemove() {\n const { safeToRemove } = this.props;\n safeToRemove && safeToRemove();\n }\n render() {\n return null;\n }\n}\nfunction MeasureLayout(props) {\n const [isPresent, safeToRemove] = usePresence();\n const layoutGroup = useContext(LayoutGroupContext);\n return (jsx(MeasureLayoutWithContext, { ...props, layoutGroup: layoutGroup, switchLayoutGroup: useContext(SwitchLayoutGroupContext), isPresent: isPresent, safeToRemove: safeToRemove }));\n}\nconst defaultScaleCorrectors = {\n borderRadius: {\n ...correctBorderRadius,\n applyTo: [\n \"borderTopLeftRadius\",\n \"borderTopRightRadius\",\n \"borderBottomLeftRadius\",\n \"borderBottomRightRadius\",\n ],\n },\n borderTopLeftRadius: correctBorderRadius,\n borderTopRightRadius: correctBorderRadius,\n borderBottomLeftRadius: correctBorderRadius,\n borderBottomRightRadius: correctBorderRadius,\n boxShadow: correctBoxShadow,\n};\n\nexport { MeasureLayout };\n","import { circOut } from '../../easing/circ.mjs';\nimport { progress } from '../../utils/progress.mjs';\nimport { mixNumber } from '../../utils/mix/number.mjs';\nimport { noop } from '../../utils/noop.mjs';\nimport { percent, px } from '../../value/types/numbers/units.mjs';\n\nconst borders = [\"TopLeft\", \"TopRight\", \"BottomLeft\", \"BottomRight\"];\nconst numBorders = borders.length;\nconst asNumber = (value) => typeof value === \"string\" ? parseFloat(value) : value;\nconst isPx = (value) => typeof value === \"number\" || px.test(value);\nfunction mixValues(target, follow, lead, progress, shouldCrossfadeOpacity, isOnlyMember) {\n if (shouldCrossfadeOpacity) {\n target.opacity = mixNumber(0, \n // TODO Reinstate this if only child\n lead.opacity !== undefined ? lead.opacity : 1, easeCrossfadeIn(progress));\n target.opacityExit = mixNumber(follow.opacity !== undefined ? follow.opacity : 1, 0, easeCrossfadeOut(progress));\n }\n else if (isOnlyMember) {\n target.opacity = mixNumber(follow.opacity !== undefined ? follow.opacity : 1, lead.opacity !== undefined ? lead.opacity : 1, progress);\n }\n /**\n * Mix border radius\n */\n for (let i = 0; i < numBorders; i++) {\n const borderLabel = `border${borders[i]}Radius`;\n let followRadius = getRadius(follow, borderLabel);\n let leadRadius = getRadius(lead, borderLabel);\n if (followRadius === undefined && leadRadius === undefined)\n continue;\n followRadius || (followRadius = 0);\n leadRadius || (leadRadius = 0);\n const canMix = followRadius === 0 ||\n leadRadius === 0 ||\n isPx(followRadius) === isPx(leadRadius);\n if (canMix) {\n target[borderLabel] = Math.max(mixNumber(asNumber(followRadius), asNumber(leadRadius), progress), 0);\n if (percent.test(leadRadius) || percent.test(followRadius)) {\n target[borderLabel] += \"%\";\n }\n }\n else {\n target[borderLabel] = leadRadius;\n }\n }\n /**\n * Mix rotation\n */\n if (follow.rotate || lead.rotate) {\n target.rotate = mixNumber(follow.rotate || 0, lead.rotate || 0, progress);\n }\n}\nfunction getRadius(values, radiusName) {\n return values[radiusName] !== undefined\n ? values[radiusName]\n : values.borderRadius;\n}\n// /**\n// * We only want to mix the background color if there's a follow element\n// * that we're not crossfading opacity between. For instance with switch\n// * AnimateSharedLayout animations, this helps the illusion of a continuous\n// * element being animated but also cuts down on the number of paints triggered\n// * for elements where opacity is doing that work for us.\n// */\n// if (\n// !hasFollowElement &&\n// latestLeadValues.backgroundColor &&\n// latestFollowValues.backgroundColor\n// ) {\n// /**\n// * This isn't ideal performance-wise as mixColor is creating a new function every frame.\n// * We could probably create a mixer that runs at the start of the animation but\n// * the idea behind the crossfader is that it runs dynamically between two potentially\n// * changing targets (ie opacity or borderRadius may be animating independently via variants)\n// */\n// leadState.backgroundColor = followState.backgroundColor = mixColor(\n// latestFollowValues.backgroundColor as string,\n// latestLeadValues.backgroundColor as string\n// )(p)\n// }\nconst easeCrossfadeIn = compress(0, 0.5, circOut);\nconst easeCrossfadeOut = compress(0.5, 0.95, noop);\nfunction compress(min, max, easing) {\n return (p) => {\n // Could replace ifs with clamp\n if (p < min)\n return 0;\n if (p > max)\n return 1;\n return easing(progress(min, max, p));\n };\n}\n\nexport { mixValues };\n","/**\n * Reset an axis to the provided origin box.\n *\n * This is a mutative operation.\n */\nfunction copyAxisInto(axis, originAxis) {\n axis.min = originAxis.min;\n axis.max = originAxis.max;\n}\n/**\n * Reset a box to the provided origin box.\n *\n * This is a mutative operation.\n */\nfunction copyBoxInto(box, originBox) {\n copyAxisInto(box.x, originBox.x);\n copyAxisInto(box.y, originBox.y);\n}\n\nexport { copyAxisInto, copyBoxInto };\n","import { mixNumber } from '../../utils/mix/number.mjs';\nimport { percent } from '../../value/types/numbers/units.mjs';\nimport { scalePoint } from './delta-apply.mjs';\n\n/**\n * Remove a delta from a point. This is essentially the steps of applyPointDelta in reverse\n */\nfunction removePointDelta(point, translate, scale, originPoint, boxScale) {\n point -= translate;\n point = scalePoint(point, 1 / scale, originPoint);\n if (boxScale !== undefined) {\n point = scalePoint(point, 1 / boxScale, originPoint);\n }\n return point;\n}\n/**\n * Remove a delta from an axis. This is essentially the steps of applyAxisDelta in reverse\n */\nfunction removeAxisDelta(axis, translate = 0, scale = 1, origin = 0.5, boxScale, originAxis = axis, sourceAxis = axis) {\n if (percent.test(translate)) {\n translate = parseFloat(translate);\n const relativeProgress = mixNumber(sourceAxis.min, sourceAxis.max, translate / 100);\n translate = relativeProgress - sourceAxis.min;\n }\n if (typeof translate !== \"number\")\n return;\n let originPoint = mixNumber(originAxis.min, originAxis.max, origin);\n if (axis === originAxis)\n originPoint -= translate;\n axis.min = removePointDelta(axis.min, translate, scale, originPoint, boxScale);\n axis.max = removePointDelta(axis.max, translate, scale, originPoint, boxScale);\n}\n/**\n * Remove a transforms from an axis. This is essentially the steps of applyAxisTransforms in reverse\n * and acts as a bridge between motion values and removeAxisDelta\n */\nfunction removeAxisTransforms(axis, transforms, [key, scaleKey, originKey], origin, sourceAxis) {\n removeAxisDelta(axis, transforms[key], transforms[scaleKey], transforms[originKey], transforms.scale, origin, sourceAxis);\n}\n/**\n * The names of the motion values we want to apply as translation, scale and origin.\n */\nconst xKeys = [\"x\", \"scaleX\", \"originX\"];\nconst yKeys = [\"y\", \"scaleY\", \"originY\"];\n/**\n * Remove a transforms from an box. This is essentially the steps of applyAxisBox in reverse\n * and acts as a bridge between motion values and removeAxisDelta\n */\nfunction removeBoxTransforms(box, transforms, originBox, sourceBox) {\n removeAxisTransforms(box.x, transforms, xKeys, originBox ? originBox.x : undefined, sourceBox ? sourceBox.x : undefined);\n removeAxisTransforms(box.y, transforms, yKeys, originBox ? originBox.y : undefined, sourceBox ? sourceBox.y : undefined);\n}\n\nexport { removeAxisDelta, removeAxisTransforms, removeBoxTransforms, removePointDelta };\n","import { calcLength } from './delta-calc.mjs';\n\nfunction isAxisDeltaZero(delta) {\n return delta.translate === 0 && delta.scale === 1;\n}\nfunction isDeltaZero(delta) {\n return isAxisDeltaZero(delta.x) && isAxisDeltaZero(delta.y);\n}\nfunction boxEquals(a, b) {\n return (a.x.min === b.x.min &&\n a.x.max === b.x.max &&\n a.y.min === b.y.min &&\n a.y.max === b.y.max);\n}\nfunction boxEqualsRounded(a, b) {\n return (Math.round(a.x.min) === Math.round(b.x.min) &&\n Math.round(a.x.max) === Math.round(b.x.max) &&\n Math.round(a.y.min) === Math.round(b.y.min) &&\n Math.round(a.y.max) === Math.round(b.y.max));\n}\nfunction aspectRatio(box) {\n return calcLength(box.x) / calcLength(box.y);\n}\n\nexport { aspectRatio, boxEquals, boxEqualsRounded, isDeltaZero };\n","import { addUniqueItem, removeItem } from '../../utils/array.mjs';\n\nclass NodeStack {\n constructor() {\n this.members = [];\n }\n add(node) {\n addUniqueItem(this.members, node);\n node.scheduleRender();\n }\n remove(node) {\n removeItem(this.members, node);\n if (node === this.prevLead) {\n this.prevLead = undefined;\n }\n if (node === this.lead) {\n const prevLead = this.members[this.members.length - 1];\n if (prevLead) {\n this.promote(prevLead);\n }\n }\n }\n relegate(node) {\n const indexOfNode = this.members.findIndex((member) => node === member);\n if (indexOfNode === 0)\n return false;\n /**\n * Find the next projection node that is present\n */\n let prevLead;\n for (let i = indexOfNode; i >= 0; i--) {\n const member = this.members[i];\n if (member.isPresent !== false) {\n prevLead = member;\n break;\n }\n }\n if (prevLead) {\n this.promote(prevLead);\n return true;\n }\n else {\n return false;\n }\n }\n promote(node, preserveFollowOpacity) {\n const prevLead = this.lead;\n if (node === prevLead)\n return;\n this.prevLead = prevLead;\n this.lead = node;\n node.show();\n if (prevLead) {\n prevLead.instance && prevLead.scheduleRender();\n node.scheduleRender();\n node.resumeFrom = prevLead;\n if (preserveFollowOpacity) {\n node.resumeFrom.preserveOpacity = true;\n }\n if (prevLead.snapshot) {\n node.snapshot = prevLead.snapshot;\n node.snapshot.latestValues =\n prevLead.animationValues || prevLead.latestValues;\n }\n if (node.root && node.root.isUpdating) {\n node.isLayoutDirty = true;\n }\n const { crossfade } = node.options;\n if (crossfade === false) {\n prevLead.hide();\n }\n /**\n * TODO:\n * - Test border radius when previous node was deleted\n * - boxShadow mixing\n * - Shared between element A in scrolled container and element B (scroll stays the same or changes)\n * - Shared between element A in transformed container and element B (transform stays the same or changes)\n * - Shared between element A in scrolled page and element B (scroll stays the same or changes)\n * ---\n * - Crossfade opacity of root nodes\n * - layoutId changes after animation\n * - layoutId changes mid animation\n */\n }\n }\n exitAnimationComplete() {\n this.members.forEach((node) => {\n const { options, resumingFrom } = node;\n options.onExitComplete && options.onExitComplete();\n if (resumingFrom) {\n resumingFrom.options.onExitComplete &&\n resumingFrom.options.onExitComplete();\n }\n });\n }\n scheduleRender() {\n this.members.forEach((node) => {\n node.instance && node.scheduleRender(false);\n });\n }\n /**\n * Clear any leads that have been removed this render to prevent them from being\n * used in future animations and to prevent memory leaks\n */\n removeLeadSnapshot() {\n if (this.lead && this.lead.snapshot) {\n this.lead.snapshot = undefined;\n }\n }\n}\n\nexport { NodeStack };\n","function buildProjectionTransform(delta, treeScale, latestTransform) {\n let transform = \"\";\n /**\n * The translations we use to calculate are always relative to the viewport coordinate space.\n * But when we apply scales, we also scale the coordinate space of an element and its children.\n * For instance if we have a treeScale (the culmination of all parent scales) of 0.5 and we need\n * to move an element 100 pixels, we actually need to move it 200 in within that scaled space.\n */\n const xTranslate = delta.x.translate / treeScale.x;\n const yTranslate = delta.y.translate / treeScale.y;\n const zTranslate = (latestTransform === null || latestTransform === void 0 ? void 0 : latestTransform.z) || 0;\n if (xTranslate || yTranslate || zTranslate) {\n transform = `translate3d(${xTranslate}px, ${yTranslate}px, ${zTranslate}px) `;\n }\n /**\n * Apply scale correction for the tree transform.\n * This will apply scale to the screen-orientated axes.\n */\n if (treeScale.x !== 1 || treeScale.y !== 1) {\n transform += `scale(${1 / treeScale.x}, ${1 / treeScale.y}) `;\n }\n if (latestTransform) {\n const { transformPerspective, rotate, rotateX, rotateY, skewX, skewY } = latestTransform;\n if (transformPerspective)\n transform = `perspective(${transformPerspective}px) ${transform}`;\n if (rotate)\n transform += `rotate(${rotate}deg) `;\n if (rotateX)\n transform += `rotateX(${rotateX}deg) `;\n if (rotateY)\n transform += `rotateY(${rotateY}deg) `;\n if (skewX)\n transform += `skewX(${skewX}deg) `;\n if (skewY)\n transform += `skewY(${skewY}deg) `;\n }\n /**\n * Apply scale to match the size of the element to the size we want it.\n * This will apply scale to the element-orientated axes.\n */\n const elementScaleX = delta.x.scale * treeScale.x;\n const elementScaleY = delta.y.scale * treeScale.y;\n if (elementScaleX !== 1 || elementScaleY !== 1) {\n transform += `scale(${elementScaleX}, ${elementScaleY})`;\n }\n return transform || \"none\";\n}\n\nexport { buildProjectionTransform };\n","const compareByDepth = (a, b) => a.depth - b.depth;\n\nexport { compareByDepth };\n","import { addUniqueItem, removeItem } from '../../utils/array.mjs';\nimport { compareByDepth } from './compare-by-depth.mjs';\n\nclass FlatTree {\n constructor() {\n this.children = [];\n this.isDirty = false;\n }\n add(child) {\n addUniqueItem(this.children, child);\n this.isDirty = true;\n }\n remove(child) {\n removeItem(this.children, child);\n this.isDirty = true;\n }\n forEach(callback) {\n this.isDirty && this.children.sort(compareByDepth);\n this.isDirty = false;\n this.children.forEach(callback);\n }\n}\n\nexport { FlatTree };\n","import { time } from '../frameloop/sync-time.mjs';\nimport { frame, cancelFrame } from '../frameloop/frame.mjs';\n\n/**\n * Timeout defined in ms\n */\nfunction delay(callback, timeout) {\n const start = time.now();\n const checkElapsed = ({ timestamp }) => {\n const elapsed = timestamp - start;\n if (elapsed >= timeout) {\n cancelFrame(checkElapsed);\n callback(elapsed - timeout);\n }\n };\n frame.read(checkElapsed, true);\n return () => cancelFrame(checkElapsed);\n}\n\nexport { delay };\n","function record(data) {\n if (window.MotionDebug) {\n window.MotionDebug.record(data);\n }\n}\n\nexport { record };\n","function isSVGElement(element) {\n return element instanceof SVGElement && element.tagName !== \"svg\";\n}\n\nexport { isSVGElement };\n","import { animateMotionValue } from './motion-value.mjs';\nimport { motionValue } from '../../value/index.mjs';\nimport { isMotionValue } from '../../value/utils/is-motion-value.mjs';\n\nfunction animateSingleValue(value, keyframes, options) {\n const motionValue$1 = isMotionValue(value) ? value : motionValue(value);\n motionValue$1.start(animateMotionValue(\"\", motionValue$1, keyframes, options));\n return motionValue$1.animation;\n}\n\nexport { animateSingleValue };\n","import { SubscriptionManager } from '../../utils/subscription-manager.mjs';\nimport { mixValues } from '../animation/mix-values.mjs';\nimport { copyBoxInto } from '../geometry/copy.mjs';\nimport { translateAxis, transformBox, applyBoxDelta, applyTreeDeltas } from '../geometry/delta-apply.mjs';\nimport { calcRelativePosition, calcRelativeBox, calcBoxDelta, calcLength, isNear } from '../geometry/delta-calc.mjs';\nimport { removeBoxTransforms } from '../geometry/delta-remove.mjs';\nimport { createBox, createDelta } from '../geometry/models.mjs';\nimport { getValueTransition } from '../../animation/utils/transitions.mjs';\nimport { boxEqualsRounded, isDeltaZero, aspectRatio, boxEquals } from '../geometry/utils.mjs';\nimport { NodeStack } from '../shared/stack.mjs';\nimport { scaleCorrectors } from '../styles/scale-correction.mjs';\nimport { buildProjectionTransform } from '../styles/transform.mjs';\nimport { eachAxis } from '../utils/each-axis.mjs';\nimport { hasTransform, hasScale, has2DTranslate } from '../utils/has-transform.mjs';\nimport { FlatTree } from '../../render/utils/flat-tree.mjs';\nimport { resolveMotionValue } from '../../value/utils/resolve-motion-value.mjs';\nimport { globalProjectionState } from './state.mjs';\nimport { delay } from '../../utils/delay.mjs';\nimport { mixNumber } from '../../utils/mix/number.mjs';\nimport { record } from '../../debug/record.mjs';\nimport { isSVGElement } from '../../render/dom/utils/is-svg-element.mjs';\nimport { animateSingleValue } from '../../animation/interfaces/single-value.mjs';\nimport { clamp } from '../../utils/clamp.mjs';\nimport { cancelFrame, frameData, steps, frame } from '../../frameloop/frame.mjs';\nimport { noop } from '../../utils/noop.mjs';\nimport { time } from '../../frameloop/sync-time.mjs';\nimport { microtask } from '../../frameloop/microtask.mjs';\nimport { getOptimisedAppearId } from '../../animation/optimized-appear/get-appear-id.mjs';\n\nconst transformAxes = [\"\", \"X\", \"Y\", \"Z\"];\nconst hiddenVisibility = { visibility: \"hidden\" };\n/**\n * We use 1000 as the animation target as 0-1000 maps better to pixels than 0-1\n * which has a noticeable difference in spring animations\n */\nconst animationTarget = 1000;\nlet id = 0;\n/**\n * Use a mutable data object for debug data so as to not create a new\n * object every frame.\n */\nconst projectionFrameData = {\n type: \"projectionFrame\",\n totalNodes: 0,\n resolvedTargetDeltas: 0,\n recalculatedProjection: 0,\n};\nfunction resetDistortingTransform(key, visualElement, values, sharedAnimationValues) {\n const { latestValues } = visualElement;\n // Record the distorting transform and then temporarily set it to 0\n if (latestValues[key]) {\n values[key] = latestValues[key];\n visualElement.setStaticValue(key, 0);\n if (sharedAnimationValues) {\n sharedAnimationValues[key] = 0;\n }\n }\n}\nfunction isOptimisedAppearTree(projectionNode) {\n projectionNode.hasCheckedOptimisedAppear = true;\n if (projectionNode.root === projectionNode)\n return false;\n const { visualElement } = projectionNode.options;\n if (!visualElement) {\n return false;\n }\n else if (getOptimisedAppearId(visualElement)) {\n return true;\n }\n else if (projectionNode.parent &&\n !projectionNode.parent.hasCheckedOptimisedAppear) {\n return isOptimisedAppearTree(projectionNode.parent);\n }\n else {\n return false;\n }\n}\nfunction createProjectionNode({ attachResizeListener, defaultParent, measureScroll, checkIsScrollRoot, resetTransform, }) {\n return class ProjectionNode {\n constructor(latestValues = {}, parent = defaultParent === null || defaultParent === void 0 ? void 0 : defaultParent()) {\n /**\n * A unique ID generated for every projection node.\n */\n this.id = id++;\n /**\n * An id that represents a unique session instigated by startUpdate.\n */\n this.animationId = 0;\n /**\n * A Set containing all this component's children. This is used to iterate\n * through the children.\n *\n * TODO: This could be faster to iterate as a flat array stored on the root node.\n */\n this.children = new Set();\n /**\n * Options for the node. We use this to configure what kind of layout animations\n * we should perform (if any).\n */\n this.options = {};\n /**\n * We use this to detect when its safe to shut down part of a projection tree.\n * We have to keep projecting children for scale correction and relative projection\n * until all their parents stop performing layout animations.\n */\n this.isTreeAnimating = false;\n this.isAnimationBlocked = false;\n /**\n * Flag to true if we think this layout has been changed. We can't always know this,\n * currently we set it to true every time a component renders, or if it has a layoutDependency\n * if that has changed between renders. Additionally, components can be grouped by LayoutGroup\n * and if one node is dirtied, they all are.\n */\n this.isLayoutDirty = false;\n /**\n * Flag to true if we think the projection calculations for this node needs\n * recalculating as a result of an updated transform or layout animation.\n */\n this.isProjectionDirty = false;\n /**\n * Flag to true if the layout *or* transform has changed. This then gets propagated\n * throughout the projection tree, forcing any element below to recalculate on the next frame.\n */\n this.isSharedProjectionDirty = false;\n /**\n * Flag transform dirty. This gets propagated throughout the whole tree but is only\n * respected by shared nodes.\n */\n this.isTransformDirty = false;\n /**\n * Block layout updates for instant layout transitions throughout the tree.\n */\n this.updateManuallyBlocked = false;\n this.updateBlockedByResize = false;\n /**\n * Set to true between the start of the first `willUpdate` call and the end of the `didUpdate`\n * call.\n */\n this.isUpdating = false;\n /**\n * If this is an SVG element we currently disable projection transforms\n */\n this.isSVG = false;\n /**\n * Flag to true (during promotion) if a node doing an instant layout transition needs to reset\n * its projection styles.\n */\n this.needsReset = false;\n /**\n * Flags whether this node should have its transform reset prior to measuring.\n */\n this.shouldResetTransform = false;\n /**\n * Store whether this node has been checked for optimised appear animations. As\n * effects fire bottom-up, and we want to look up the tree for appear animations,\n * this makes sure we only check each path once, stopping at nodes that\n * have already been checked.\n */\n this.hasCheckedOptimisedAppear = false;\n /**\n * An object representing the calculated contextual/accumulated/tree scale.\n * This will be used to scale calculcated projection transforms, as these are\n * calculated in screen-space but need to be scaled for elements to layoutly\n * make it to their calculated destinations.\n *\n * TODO: Lazy-init\n */\n this.treeScale = { x: 1, y: 1 };\n /**\n *\n */\n this.eventHandlers = new Map();\n this.hasTreeAnimated = false;\n // Note: Currently only running on root node\n this.updateScheduled = false;\n this.projectionUpdateScheduled = false;\n this.checkUpdateFailed = () => {\n if (this.isUpdating) {\n this.isUpdating = false;\n this.clearAllSnapshots();\n }\n };\n /**\n * This is a multi-step process as shared nodes might be of different depths. Nodes\n * are sorted by depth order, so we need to resolve the entire tree before moving to\n * the next step.\n */\n this.updateProjection = () => {\n this.projectionUpdateScheduled = false;\n /**\n * Reset debug counts. Manually resetting rather than creating a new\n * object each frame.\n */\n projectionFrameData.totalNodes =\n projectionFrameData.resolvedTargetDeltas =\n projectionFrameData.recalculatedProjection =\n 0;\n this.nodes.forEach(propagateDirtyNodes);\n this.nodes.forEach(resolveTargetDelta);\n this.nodes.forEach(calcProjection);\n this.nodes.forEach(cleanDirtyNodes);\n record(projectionFrameData);\n };\n this.hasProjected = false;\n this.isVisible = true;\n this.animationProgress = 0;\n /**\n * Shared layout\n */\n // TODO Only running on root node\n this.sharedNodes = new Map();\n this.latestValues = latestValues;\n this.root = parent ? parent.root || parent : this;\n this.path = parent ? [...parent.path, parent] : [];\n this.parent = parent;\n this.depth = parent ? parent.depth + 1 : 0;\n for (let i = 0; i < this.path.length; i++) {\n this.path[i].shouldResetTransform = true;\n }\n if (this.root === this)\n this.nodes = new FlatTree();\n }\n addEventListener(name, handler) {\n if (!this.eventHandlers.has(name)) {\n this.eventHandlers.set(name, new SubscriptionManager());\n }\n return this.eventHandlers.get(name).add(handler);\n }\n notifyListeners(name, ...args) {\n const subscriptionManager = this.eventHandlers.get(name);\n subscriptionManager && subscriptionManager.notify(...args);\n }\n hasListeners(name) {\n return this.eventHandlers.has(name);\n }\n /**\n * Lifecycles\n */\n mount(instance, isLayoutDirty = this.root.hasTreeAnimated) {\n if (this.instance)\n return;\n this.isSVG = isSVGElement(instance);\n this.instance = instance;\n const { layoutId, layout, visualElement } = this.options;\n if (visualElement && !visualElement.current) {\n visualElement.mount(instance);\n }\n this.root.nodes.add(this);\n this.parent && this.parent.children.add(this);\n if (isLayoutDirty && (layout || layoutId)) {\n this.isLayoutDirty = true;\n }\n if (attachResizeListener) {\n let cancelDelay;\n const resizeUnblockUpdate = () => (this.root.updateBlockedByResize = false);\n attachResizeListener(instance, () => {\n this.root.updateBlockedByResize = true;\n cancelDelay && cancelDelay();\n cancelDelay = delay(resizeUnblockUpdate, 250);\n if (globalProjectionState.hasAnimatedSinceResize) {\n globalProjectionState.hasAnimatedSinceResize = false;\n this.nodes.forEach(finishAnimation);\n }\n });\n }\n if (layoutId) {\n this.root.registerSharedNode(layoutId, this);\n }\n // Only register the handler if it requires layout animation\n if (this.options.animate !== false &&\n visualElement &&\n (layoutId || layout)) {\n this.addEventListener(\"didUpdate\", ({ delta, hasLayoutChanged, hasRelativeTargetChanged, layout: newLayout, }) => {\n if (this.isTreeAnimationBlocked()) {\n this.target = undefined;\n this.relativeTarget = undefined;\n return;\n }\n // TODO: Check here if an animation exists\n const layoutTransition = this.options.transition ||\n visualElement.getDefaultTransition() ||\n defaultLayoutTransition;\n const { onLayoutAnimationStart, onLayoutAnimationComplete, } = visualElement.getProps();\n /**\n * The target layout of the element might stay the same,\n * but its position relative to its parent has changed.\n */\n const targetChanged = !this.targetLayout ||\n !boxEqualsRounded(this.targetLayout, newLayout) ||\n hasRelativeTargetChanged;\n /**\n * If the layout hasn't seemed to have changed, it might be that the\n * element is visually in the same place in the document but its position\n * relative to its parent has indeed changed. So here we check for that.\n */\n const hasOnlyRelativeTargetChanged = !hasLayoutChanged && hasRelativeTargetChanged;\n if (this.options.layoutRoot ||\n (this.resumeFrom && this.resumeFrom.instance) ||\n hasOnlyRelativeTargetChanged ||\n (hasLayoutChanged &&\n (targetChanged || !this.currentAnimation))) {\n if (this.resumeFrom) {\n this.resumingFrom = this.resumeFrom;\n this.resumingFrom.resumingFrom = undefined;\n }\n this.setAnimationOrigin(delta, hasOnlyRelativeTargetChanged);\n const animationOptions = {\n ...getValueTransition(layoutTransition, \"layout\"),\n onPlay: onLayoutAnimationStart,\n onComplete: onLayoutAnimationComplete,\n };\n if (visualElement.shouldReduceMotion ||\n this.options.layoutRoot) {\n animationOptions.delay = 0;\n animationOptions.type = false;\n }\n this.startAnimation(animationOptions);\n }\n else {\n /**\n * If the layout hasn't changed and we have an animation that hasn't started yet,\n * finish it immediately. Otherwise it will be animating from a location\n * that was probably never commited to screen and look like a jumpy box.\n */\n if (!hasLayoutChanged) {\n finishAnimation(this);\n }\n if (this.isLead() && this.options.onExitComplete) {\n this.options.onExitComplete();\n }\n }\n this.targetLayout = newLayout;\n });\n }\n }\n unmount() {\n this.options.layoutId && this.willUpdate();\n this.root.nodes.remove(this);\n const stack = this.getStack();\n stack && stack.remove(this);\n this.parent && this.parent.children.delete(this);\n this.instance = undefined;\n cancelFrame(this.updateProjection);\n }\n // only on the root\n blockUpdate() {\n this.updateManuallyBlocked = true;\n }\n unblockUpdate() {\n this.updateManuallyBlocked = false;\n }\n isUpdateBlocked() {\n return this.updateManuallyBlocked || this.updateBlockedByResize;\n }\n isTreeAnimationBlocked() {\n return (this.isAnimationBlocked ||\n (this.parent && this.parent.isTreeAnimationBlocked()) ||\n false);\n }\n // Note: currently only running on root node\n startUpdate() {\n if (this.isUpdateBlocked())\n return;\n this.isUpdating = true;\n this.nodes && this.nodes.forEach(resetSkewAndRotation);\n this.animationId++;\n }\n getTransformTemplate() {\n const { visualElement } = this.options;\n return visualElement && visualElement.getProps().transformTemplate;\n }\n willUpdate(shouldNotifyListeners = true) {\n this.root.hasTreeAnimated = true;\n if (this.root.isUpdateBlocked()) {\n this.options.onExitComplete && this.options.onExitComplete();\n return;\n }\n /**\n * If we're running optimised appear animations then these must be\n * cancelled before measuring the DOM. This is so we can measure\n * the true layout of the element rather than the WAAPI animation\n * which will be unaffected by the resetSkewAndRotate step.\n *\n * Note: This is a DOM write. Worst case scenario is this is sandwiched\n * between other snapshot reads which will cause unnecessary style recalculations.\n * This has to happen here though, as we don't yet know which nodes will need\n * snapshots in startUpdate(), but we only want to cancel optimised animations\n * if a layout animation measurement is actually going to be affected by them.\n */\n if (window.HandoffCancelAllAnimations &&\n isOptimisedAppearTree(this)) {\n window.HandoffCancelAllAnimations();\n }\n !this.root.isUpdating && this.root.startUpdate();\n if (this.isLayoutDirty)\n return;\n this.isLayoutDirty = true;\n for (let i = 0; i < this.path.length; i++) {\n const node = this.path[i];\n node.shouldResetTransform = true;\n node.updateScroll(\"snapshot\");\n if (node.options.layoutRoot) {\n node.willUpdate(false);\n }\n }\n const { layoutId, layout } = this.options;\n if (layoutId === undefined && !layout)\n return;\n const transformTemplate = this.getTransformTemplate();\n this.prevTransformTemplateValue = transformTemplate\n ? transformTemplate(this.latestValues, \"\")\n : undefined;\n this.updateSnapshot();\n shouldNotifyListeners && this.notifyListeners(\"willUpdate\");\n }\n update() {\n this.updateScheduled = false;\n const updateWasBlocked = this.isUpdateBlocked();\n // When doing an instant transition, we skip the layout update,\n // but should still clean up the measurements so that the next\n // snapshot could be taken correctly.\n if (updateWasBlocked) {\n this.unblockUpdate();\n this.clearAllSnapshots();\n this.nodes.forEach(clearMeasurements);\n return;\n }\n if (!this.isUpdating) {\n this.nodes.forEach(clearIsLayoutDirty);\n }\n this.isUpdating = false;\n /**\n * Write\n */\n this.nodes.forEach(resetTransformStyle);\n /**\n * Read ==================\n */\n // Update layout measurements of updated children\n this.nodes.forEach(updateLayout);\n /**\n * Write\n */\n // Notify listeners that the layout is updated\n this.nodes.forEach(notifyLayoutUpdate);\n this.clearAllSnapshots();\n /**\n * Manually flush any pending updates. Ideally\n * we could leave this to the following requestAnimationFrame but this seems\n * to leave a flash of incorrectly styled content.\n */\n const now = time.now();\n frameData.delta = clamp(0, 1000 / 60, now - frameData.timestamp);\n frameData.timestamp = now;\n frameData.isProcessing = true;\n steps.update.process(frameData);\n steps.preRender.process(frameData);\n steps.render.process(frameData);\n frameData.isProcessing = false;\n }\n didUpdate() {\n if (!this.updateScheduled) {\n this.updateScheduled = true;\n microtask.read(() => this.update());\n }\n }\n clearAllSnapshots() {\n this.nodes.forEach(clearSnapshot);\n this.sharedNodes.forEach(removeLeadSnapshots);\n }\n scheduleUpdateProjection() {\n if (!this.projectionUpdateScheduled) {\n this.projectionUpdateScheduled = true;\n frame.preRender(this.updateProjection, false, true);\n }\n }\n scheduleCheckAfterUnmount() {\n /**\n * If the unmounting node is in a layoutGroup and did trigger a willUpdate,\n * we manually call didUpdate to give a chance to the siblings to animate.\n * Otherwise, cleanup all snapshots to prevents future nodes from reusing them.\n */\n frame.postRender(() => {\n if (this.isLayoutDirty) {\n this.root.didUpdate();\n }\n else {\n this.root.checkUpdateFailed();\n }\n });\n }\n /**\n * Update measurements\n */\n updateSnapshot() {\n if (this.snapshot || !this.instance)\n return;\n this.snapshot = this.measure();\n }\n updateLayout() {\n if (!this.instance)\n return;\n // TODO: Incorporate into a forwarded scroll offset\n this.updateScroll();\n if (!(this.options.alwaysMeasureLayout && this.isLead()) &&\n !this.isLayoutDirty) {\n return;\n }\n /**\n * When a node is mounted, it simply resumes from the prevLead's\n * snapshot instead of taking a new one, but the ancestors scroll\n * might have updated while the prevLead is unmounted. We need to\n * update the scroll again to make sure the layout we measure is\n * up to date.\n */\n if (this.resumeFrom && !this.resumeFrom.instance) {\n for (let i = 0; i < this.path.length; i++) {\n const node = this.path[i];\n node.updateScroll();\n }\n }\n const prevLayout = this.layout;\n this.layout = this.measure(false);\n this.layoutCorrected = createBox();\n this.isLayoutDirty = false;\n this.projectionDelta = undefined;\n this.notifyListeners(\"measure\", this.layout.layoutBox);\n const { visualElement } = this.options;\n visualElement &&\n visualElement.notify(\"LayoutMeasure\", this.layout.layoutBox, prevLayout ? prevLayout.layoutBox : undefined);\n }\n updateScroll(phase = \"measure\") {\n let needsMeasurement = Boolean(this.options.layoutScroll && this.instance);\n if (this.scroll &&\n this.scroll.animationId === this.root.animationId &&\n this.scroll.phase === phase) {\n needsMeasurement = false;\n }\n if (needsMeasurement) {\n this.scroll = {\n animationId: this.root.animationId,\n phase,\n isRoot: checkIsScrollRoot(this.instance),\n offset: measureScroll(this.instance),\n };\n }\n }\n resetTransform() {\n if (!resetTransform)\n return;\n const isResetRequested = this.isLayoutDirty || this.shouldResetTransform;\n const hasProjection = this.projectionDelta && !isDeltaZero(this.projectionDelta);\n const transformTemplate = this.getTransformTemplate();\n const transformTemplateValue = transformTemplate\n ? transformTemplate(this.latestValues, \"\")\n : undefined;\n const transformTemplateHasChanged = transformTemplateValue !== this.prevTransformTemplateValue;\n if (isResetRequested &&\n (hasProjection ||\n hasTransform(this.latestValues) ||\n transformTemplateHasChanged)) {\n resetTransform(this.instance, transformTemplateValue);\n this.shouldResetTransform = false;\n this.scheduleRender();\n }\n }\n measure(removeTransform = true) {\n const pageBox = this.measurePageBox();\n let layoutBox = this.removeElementScroll(pageBox);\n /**\n * Measurements taken during the pre-render stage\n * still have transforms applied so we remove them\n * via calculation.\n */\n if (removeTransform) {\n layoutBox = this.removeTransform(layoutBox);\n }\n roundBox(layoutBox);\n return {\n animationId: this.root.animationId,\n measuredBox: pageBox,\n layoutBox,\n latestValues: {},\n source: this.id,\n };\n }\n measurePageBox() {\n const { visualElement } = this.options;\n if (!visualElement)\n return createBox();\n const box = visualElement.measureViewportBox();\n // Remove viewport scroll to give page-relative coordinates\n const { scroll } = this.root;\n if (scroll) {\n translateAxis(box.x, scroll.offset.x);\n translateAxis(box.y, scroll.offset.y);\n }\n return box;\n }\n removeElementScroll(box) {\n const boxWithoutScroll = createBox();\n copyBoxInto(boxWithoutScroll, box);\n /**\n * Performance TODO: Keep a cumulative scroll offset down the tree\n * rather than loop back up the path.\n */\n for (let i = 0; i < this.path.length; i++) {\n const node = this.path[i];\n const { scroll, options } = node;\n if (node !== this.root && scroll && options.layoutScroll) {\n /**\n * If this is a new scroll root, we want to remove all previous scrolls\n * from the viewport box.\n */\n if (scroll.isRoot) {\n copyBoxInto(boxWithoutScroll, box);\n const { scroll: rootScroll } = this.root;\n /**\n * Undo the application of page scroll that was originally added\n * to the measured bounding box.\n */\n if (rootScroll) {\n translateAxis(boxWithoutScroll.x, -rootScroll.offset.x);\n translateAxis(boxWithoutScroll.y, -rootScroll.offset.y);\n }\n }\n translateAxis(boxWithoutScroll.x, scroll.offset.x);\n translateAxis(boxWithoutScroll.y, scroll.offset.y);\n }\n }\n return boxWithoutScroll;\n }\n applyTransform(box, transformOnly = false) {\n const withTransforms = createBox();\n copyBoxInto(withTransforms, box);\n for (let i = 0; i < this.path.length; i++) {\n const node = this.path[i];\n if (!transformOnly &&\n node.options.layoutScroll &&\n node.scroll &&\n node !== node.root) {\n transformBox(withTransforms, {\n x: -node.scroll.offset.x,\n y: -node.scroll.offset.y,\n });\n }\n if (!hasTransform(node.latestValues))\n continue;\n transformBox(withTransforms, node.latestValues);\n }\n if (hasTransform(this.latestValues)) {\n transformBox(withTransforms, this.latestValues);\n }\n return withTransforms;\n }\n removeTransform(box) {\n const boxWithoutTransform = createBox();\n copyBoxInto(boxWithoutTransform, box);\n for (let i = 0; i < this.path.length; i++) {\n const node = this.path[i];\n if (!node.instance)\n continue;\n if (!hasTransform(node.latestValues))\n continue;\n hasScale(node.latestValues) && node.updateSnapshot();\n const sourceBox = createBox();\n const nodeBox = node.measurePageBox();\n copyBoxInto(sourceBox, nodeBox);\n removeBoxTransforms(boxWithoutTransform, node.latestValues, node.snapshot ? node.snapshot.layoutBox : undefined, sourceBox);\n }\n if (hasTransform(this.latestValues)) {\n removeBoxTransforms(boxWithoutTransform, this.latestValues);\n }\n return boxWithoutTransform;\n }\n setTargetDelta(delta) {\n this.targetDelta = delta;\n this.root.scheduleUpdateProjection();\n this.isProjectionDirty = true;\n }\n setOptions(options) {\n this.options = {\n ...this.options,\n ...options,\n crossfade: options.crossfade !== undefined ? options.crossfade : true,\n };\n }\n clearMeasurements() {\n this.scroll = undefined;\n this.layout = undefined;\n this.snapshot = undefined;\n this.prevTransformTemplateValue = undefined;\n this.targetDelta = undefined;\n this.target = undefined;\n this.isLayoutDirty = false;\n }\n forceRelativeParentToResolveTarget() {\n if (!this.relativeParent)\n return;\n /**\n * If the parent target isn't up-to-date, force it to update.\n * This is an unfortunate de-optimisation as it means any updating relative\n * projection will cause all the relative parents to recalculate back\n * up the tree.\n */\n if (this.relativeParent.resolvedRelativeTargetAt !==\n frameData.timestamp) {\n this.relativeParent.resolveTargetDelta(true);\n }\n }\n resolveTargetDelta(forceRecalculation = false) {\n var _a;\n /**\n * Once the dirty status of nodes has been spread through the tree, we also\n * need to check if we have a shared node of a different depth that has itself\n * been dirtied.\n */\n const lead = this.getLead();\n this.isProjectionDirty || (this.isProjectionDirty = lead.isProjectionDirty);\n this.isTransformDirty || (this.isTransformDirty = lead.isTransformDirty);\n this.isSharedProjectionDirty || (this.isSharedProjectionDirty = lead.isSharedProjectionDirty);\n const isShared = Boolean(this.resumingFrom) || this !== lead;\n /**\n * We don't use transform for this step of processing so we don't\n * need to check whether any nodes have changed transform.\n */\n const canSkip = !(forceRecalculation ||\n (isShared && this.isSharedProjectionDirty) ||\n this.isProjectionDirty ||\n ((_a = this.parent) === null || _a === void 0 ? void 0 : _a.isProjectionDirty) ||\n this.attemptToResolveRelativeTarget);\n if (canSkip)\n return;\n const { layout, layoutId } = this.options;\n /**\n * If we have no layout, we can't perform projection, so early return\n */\n if (!this.layout || !(layout || layoutId))\n return;\n this.resolvedRelativeTargetAt = frameData.timestamp;\n /**\n * If we don't have a targetDelta but do have a layout, we can attempt to resolve\n * a relativeParent. This will allow a component to perform scale correction\n * even if no animation has started.\n */\n if (!this.targetDelta && !this.relativeTarget) {\n const relativeParent = this.getClosestProjectingParent();\n if (relativeParent &&\n relativeParent.layout &&\n this.animationProgress !== 1) {\n this.relativeParent = relativeParent;\n this.forceRelativeParentToResolveTarget();\n this.relativeTarget = createBox();\n this.relativeTargetOrigin = createBox();\n calcRelativePosition(this.relativeTargetOrigin, this.layout.layoutBox, relativeParent.layout.layoutBox);\n copyBoxInto(this.relativeTarget, this.relativeTargetOrigin);\n }\n else {\n this.relativeParent = this.relativeTarget = undefined;\n }\n }\n /**\n * If we have no relative target or no target delta our target isn't valid\n * for this frame.\n */\n if (!this.relativeTarget && !this.targetDelta)\n return;\n /**\n * Lazy-init target data structure\n */\n if (!this.target) {\n this.target = createBox();\n this.targetWithTransforms = createBox();\n }\n /**\n * If we've got a relative box for this component, resolve it into a target relative to the parent.\n */\n if (this.relativeTarget &&\n this.relativeTargetOrigin &&\n this.relativeParent &&\n this.relativeParent.target) {\n this.forceRelativeParentToResolveTarget();\n calcRelativeBox(this.target, this.relativeTarget, this.relativeParent.target);\n /**\n * If we've only got a targetDelta, resolve it into a target\n */\n }\n else if (this.targetDelta) {\n if (Boolean(this.resumingFrom)) {\n // TODO: This is creating a new object every frame\n this.target = this.applyTransform(this.layout.layoutBox);\n }\n else {\n copyBoxInto(this.target, this.layout.layoutBox);\n }\n applyBoxDelta(this.target, this.targetDelta);\n }\n else {\n /**\n * If no target, use own layout as target\n */\n copyBoxInto(this.target, this.layout.layoutBox);\n }\n /**\n * If we've been told to attempt to resolve a relative target, do so.\n */\n if (this.attemptToResolveRelativeTarget) {\n this.attemptToResolveRelativeTarget = false;\n const relativeParent = this.getClosestProjectingParent();\n if (relativeParent &&\n Boolean(relativeParent.resumingFrom) ===\n Boolean(this.resumingFrom) &&\n !relativeParent.options.layoutScroll &&\n relativeParent.target &&\n this.animationProgress !== 1) {\n this.relativeParent = relativeParent;\n this.forceRelativeParentToResolveTarget();\n this.relativeTarget = createBox();\n this.relativeTargetOrigin = createBox();\n calcRelativePosition(this.relativeTargetOrigin, this.target, relativeParent.target);\n copyBoxInto(this.relativeTarget, this.relativeTargetOrigin);\n }\n else {\n this.relativeParent = this.relativeTarget = undefined;\n }\n }\n /**\n * Increase debug counter for resolved target deltas\n */\n projectionFrameData.resolvedTargetDeltas++;\n }\n getClosestProjectingParent() {\n if (!this.parent ||\n hasScale(this.parent.latestValues) ||\n has2DTranslate(this.parent.latestValues)) {\n return undefined;\n }\n if (this.parent.isProjecting()) {\n return this.parent;\n }\n else {\n return this.parent.getClosestProjectingParent();\n }\n }\n isProjecting() {\n return Boolean((this.relativeTarget ||\n this.targetDelta ||\n this.options.layoutRoot) &&\n this.layout);\n }\n calcProjection() {\n var _a;\n const lead = this.getLead();\n const isShared = Boolean(this.resumingFrom) || this !== lead;\n let canSkip = true;\n /**\n * If this is a normal layout animation and neither this node nor its nearest projecting\n * is dirty then we can't skip.\n */\n if (this.isProjectionDirty || ((_a = this.parent) === null || _a === void 0 ? void 0 : _a.isProjectionDirty)) {\n canSkip = false;\n }\n /**\n * If this is a shared layout animation and this node's shared projection is dirty then\n * we can't skip.\n */\n if (isShared &&\n (this.isSharedProjectionDirty || this.isTransformDirty)) {\n canSkip = false;\n }\n /**\n * If we have resolved the target this frame we must recalculate the\n * projection to ensure it visually represents the internal calculations.\n */\n if (this.resolvedRelativeTargetAt === frameData.timestamp) {\n canSkip = false;\n }\n if (canSkip)\n return;\n const { layout, layoutId } = this.options;\n /**\n * If this section of the tree isn't animating we can\n * delete our target sources for the following frame.\n */\n this.isTreeAnimating = Boolean((this.parent && this.parent.isTreeAnimating) ||\n this.currentAnimation ||\n this.pendingAnimation);\n if (!this.isTreeAnimating) {\n this.targetDelta = this.relativeTarget = undefined;\n }\n if (!this.layout || !(layout || layoutId))\n return;\n /**\n * Reset the corrected box with the latest values from box, as we're then going\n * to perform mutative operations on it.\n */\n copyBoxInto(this.layoutCorrected, this.layout.layoutBox);\n /**\n * Record previous tree scales before updating.\n */\n const prevTreeScaleX = this.treeScale.x;\n const prevTreeScaleY = this.treeScale.y;\n /**\n * Apply all the parent deltas to this box to produce the corrected box. This\n * is the layout box, as it will appear on screen as a result of the transforms of its parents.\n */\n applyTreeDeltas(this.layoutCorrected, this.treeScale, this.path, isShared);\n /**\n * If this layer needs to perform scale correction but doesn't have a target,\n * use the layout as the target.\n */\n if (lead.layout &&\n !lead.target &&\n (this.treeScale.x !== 1 || this.treeScale.y !== 1)) {\n lead.target = lead.layout.layoutBox;\n lead.targetWithTransforms = createBox();\n }\n const { target } = lead;\n if (!target) {\n /**\n * If we don't have a target to project into, but we were previously\n * projecting, we want to remove the stored transform and schedule\n * a render to ensure the elements reflect the removed transform.\n */\n if (this.projectionTransform) {\n this.projectionDelta = createDelta();\n this.projectionTransform = \"none\";\n this.scheduleRender();\n }\n return;\n }\n if (!this.projectionDelta) {\n this.projectionDelta = createDelta();\n this.projectionDeltaWithTransform = createDelta();\n }\n const prevProjectionTransform = this.projectionTransform;\n /**\n * Update the delta between the corrected box and the target box before user-set transforms were applied.\n * This will allow us to calculate the corrected borderRadius and boxShadow to compensate\n * for our layout reprojection, but still allow them to be scaled correctly by the user.\n * It might be that to simplify this we may want to accept that user-set scale is also corrected\n * and we wouldn't have to keep and calc both deltas, OR we could support a user setting\n * to allow people to choose whether these styles are corrected based on just the\n * layout reprojection or the final bounding box.\n */\n calcBoxDelta(this.projectionDelta, this.layoutCorrected, target, this.latestValues);\n this.projectionTransform = buildProjectionTransform(this.projectionDelta, this.treeScale);\n if (this.projectionTransform !== prevProjectionTransform ||\n this.treeScale.x !== prevTreeScaleX ||\n this.treeScale.y !== prevTreeScaleY) {\n this.hasProjected = true;\n this.scheduleRender();\n this.notifyListeners(\"projectionUpdate\", target);\n }\n /**\n * Increase debug counter for recalculated projections\n */\n projectionFrameData.recalculatedProjection++;\n }\n hide() {\n this.isVisible = false;\n // TODO: Schedule render\n }\n show() {\n this.isVisible = true;\n // TODO: Schedule render\n }\n scheduleRender(notifyAll = true) {\n this.options.scheduleRender && this.options.scheduleRender();\n if (notifyAll) {\n const stack = this.getStack();\n stack && stack.scheduleRender();\n }\n if (this.resumingFrom && !this.resumingFrom.instance) {\n this.resumingFrom = undefined;\n }\n }\n setAnimationOrigin(delta, hasOnlyRelativeTargetChanged = false) {\n const snapshot = this.snapshot;\n const snapshotLatestValues = snapshot\n ? snapshot.latestValues\n : {};\n const mixedValues = { ...this.latestValues };\n const targetDelta = createDelta();\n if (!this.relativeParent ||\n !this.relativeParent.options.layoutRoot) {\n this.relativeTarget = this.relativeTargetOrigin = undefined;\n }\n this.attemptToResolveRelativeTarget = !hasOnlyRelativeTargetChanged;\n const relativeLayout = createBox();\n const snapshotSource = snapshot ? snapshot.source : undefined;\n const layoutSource = this.layout ? this.layout.source : undefined;\n const isSharedLayoutAnimation = snapshotSource !== layoutSource;\n const stack = this.getStack();\n const isOnlyMember = !stack || stack.members.length <= 1;\n const shouldCrossfadeOpacity = Boolean(isSharedLayoutAnimation &&\n !isOnlyMember &&\n this.options.crossfade === true &&\n !this.path.some(hasOpacityCrossfade));\n this.animationProgress = 0;\n let prevRelativeTarget;\n this.mixTargetDelta = (latest) => {\n const progress = latest / 1000;\n mixAxisDelta(targetDelta.x, delta.x, progress);\n mixAxisDelta(targetDelta.y, delta.y, progress);\n this.setTargetDelta(targetDelta);\n if (this.relativeTarget &&\n this.relativeTargetOrigin &&\n this.layout &&\n this.relativeParent &&\n this.relativeParent.layout) {\n calcRelativePosition(relativeLayout, this.layout.layoutBox, this.relativeParent.layout.layoutBox);\n mixBox(this.relativeTarget, this.relativeTargetOrigin, relativeLayout, progress);\n /**\n * If this is an unchanged relative target we can consider the\n * projection not dirty.\n */\n if (prevRelativeTarget &&\n boxEquals(this.relativeTarget, prevRelativeTarget)) {\n this.isProjectionDirty = false;\n }\n if (!prevRelativeTarget)\n prevRelativeTarget = createBox();\n copyBoxInto(prevRelativeTarget, this.relativeTarget);\n }\n if (isSharedLayoutAnimation) {\n this.animationValues = mixedValues;\n mixValues(mixedValues, snapshotLatestValues, this.latestValues, progress, shouldCrossfadeOpacity, isOnlyMember);\n }\n this.root.scheduleUpdateProjection();\n this.scheduleRender();\n this.animationProgress = progress;\n };\n this.mixTargetDelta(this.options.layoutRoot ? 1000 : 0);\n }\n startAnimation(options) {\n this.notifyListeners(\"animationStart\");\n this.currentAnimation && this.currentAnimation.stop();\n if (this.resumingFrom && this.resumingFrom.currentAnimation) {\n this.resumingFrom.currentAnimation.stop();\n }\n if (this.pendingAnimation) {\n cancelFrame(this.pendingAnimation);\n this.pendingAnimation = undefined;\n }\n /**\n * Start the animation in the next frame to have a frame with progress 0,\n * where the target is the same as when the animation started, so we can\n * calculate the relative positions correctly for instant transitions.\n */\n this.pendingAnimation = frame.update(() => {\n globalProjectionState.hasAnimatedSinceResize = true;\n this.currentAnimation = animateSingleValue(0, animationTarget, {\n ...options,\n onUpdate: (latest) => {\n this.mixTargetDelta(latest);\n options.onUpdate && options.onUpdate(latest);\n },\n onComplete: () => {\n options.onComplete && options.onComplete();\n this.completeAnimation();\n },\n });\n if (this.resumingFrom) {\n this.resumingFrom.currentAnimation = this.currentAnimation;\n }\n this.pendingAnimation = undefined;\n });\n }\n completeAnimation() {\n if (this.resumingFrom) {\n this.resumingFrom.currentAnimation = undefined;\n this.resumingFrom.preserveOpacity = undefined;\n }\n const stack = this.getStack();\n stack && stack.exitAnimationComplete();\n this.resumingFrom =\n this.currentAnimation =\n this.animationValues =\n undefined;\n this.notifyListeners(\"animationComplete\");\n }\n finishAnimation() {\n if (this.currentAnimation) {\n this.mixTargetDelta && this.mixTargetDelta(animationTarget);\n this.currentAnimation.stop();\n }\n this.completeAnimation();\n }\n applyTransformsToTarget() {\n const lead = this.getLead();\n let { targetWithTransforms, target, layout, latestValues } = lead;\n if (!targetWithTransforms || !target || !layout)\n return;\n /**\n * If we're only animating position, and this element isn't the lead element,\n * then instead of projecting into the lead box we instead want to calculate\n * a new target that aligns the two boxes but maintains the layout shape.\n */\n if (this !== lead &&\n this.layout &&\n layout &&\n shouldAnimatePositionOnly(this.options.animationType, this.layout.layoutBox, layout.layoutBox)) {\n target = this.target || createBox();\n const xLength = calcLength(this.layout.layoutBox.x);\n target.x.min = lead.target.x.min;\n target.x.max = target.x.min + xLength;\n const yLength = calcLength(this.layout.layoutBox.y);\n target.y.min = lead.target.y.min;\n target.y.max = target.y.min + yLength;\n }\n copyBoxInto(targetWithTransforms, target);\n /**\n * Apply the latest user-set transforms to the targetBox to produce the targetBoxFinal.\n * This is the final box that we will then project into by calculating a transform delta and\n * applying it to the corrected box.\n */\n transformBox(targetWithTransforms, latestValues);\n /**\n * Update the delta between the corrected box and the final target box, after\n * user-set transforms are applied to it. This will be used by the renderer to\n * create a transform style that will reproject the element from its layout layout\n * into the desired bounding box.\n */\n calcBoxDelta(this.projectionDeltaWithTransform, this.layoutCorrected, targetWithTransforms, latestValues);\n }\n registerSharedNode(layoutId, node) {\n if (!this.sharedNodes.has(layoutId)) {\n this.sharedNodes.set(layoutId, new NodeStack());\n }\n const stack = this.sharedNodes.get(layoutId);\n stack.add(node);\n const config = node.options.initialPromotionConfig;\n node.promote({\n transition: config ? config.transition : undefined,\n preserveFollowOpacity: config && config.shouldPreserveFollowOpacity\n ? config.shouldPreserveFollowOpacity(node)\n : undefined,\n });\n }\n isLead() {\n const stack = this.getStack();\n return stack ? stack.lead === this : true;\n }\n getLead() {\n var _a;\n const { layoutId } = this.options;\n return layoutId ? ((_a = this.getStack()) === null || _a === void 0 ? void 0 : _a.lead) || this : this;\n }\n getPrevLead() {\n var _a;\n const { layoutId } = this.options;\n return layoutId ? (_a = this.getStack()) === null || _a === void 0 ? void 0 : _a.prevLead : undefined;\n }\n getStack() {\n const { layoutId } = this.options;\n if (layoutId)\n return this.root.sharedNodes.get(layoutId);\n }\n promote({ needsReset, transition, preserveFollowOpacity, } = {}) {\n const stack = this.getStack();\n if (stack)\n stack.promote(this, preserveFollowOpacity);\n if (needsReset) {\n this.projectionDelta = undefined;\n this.needsReset = true;\n }\n if (transition)\n this.setOptions({ transition });\n }\n relegate() {\n const stack = this.getStack();\n if (stack) {\n return stack.relegate(this);\n }\n else {\n return false;\n }\n }\n resetSkewAndRotation() {\n const { visualElement } = this.options;\n if (!visualElement)\n return;\n // If there's no detected skew or rotation values, we can early return without a forced render.\n let hasDistortingTransform = false;\n /**\n * An unrolled check for rotation values. Most elements don't have any rotation and\n * skipping the nested loop and new object creation is 50% faster.\n */\n const { latestValues } = visualElement;\n if (latestValues.z ||\n latestValues.rotate ||\n latestValues.rotateX ||\n latestValues.rotateY ||\n latestValues.rotateZ ||\n latestValues.skewX ||\n latestValues.skewY) {\n hasDistortingTransform = true;\n }\n // If there's no distorting values, we don't need to do any more.\n if (!hasDistortingTransform)\n return;\n const resetValues = {};\n if (latestValues.z) {\n resetDistortingTransform(\"z\", visualElement, resetValues, this.animationValues);\n }\n // Check the skew and rotate value of all axes and reset to 0\n for (let i = 0; i < transformAxes.length; i++) {\n resetDistortingTransform(`rotate${transformAxes[i]}`, visualElement, resetValues, this.animationValues);\n resetDistortingTransform(`skew${transformAxes[i]}`, visualElement, resetValues, this.animationValues);\n }\n // Force a render of this element to apply the transform with all skews and rotations\n // set to 0.\n visualElement.render();\n // Put back all the values we reset\n for (const key in resetValues) {\n visualElement.setStaticValue(key, resetValues[key]);\n if (this.animationValues) {\n this.animationValues[key] = resetValues[key];\n }\n }\n // Schedule a render for the next frame. This ensures we won't visually\n // see the element with the reset rotate value applied.\n visualElement.scheduleRender();\n }\n getProjectionStyles(styleProp) {\n var _a, _b;\n if (!this.instance || this.isSVG)\n return undefined;\n if (!this.isVisible) {\n return hiddenVisibility;\n }\n const styles = {\n visibility: \"\",\n };\n const transformTemplate = this.getTransformTemplate();\n if (this.needsReset) {\n this.needsReset = false;\n styles.opacity = \"\";\n styles.pointerEvents =\n resolveMotionValue(styleProp === null || styleProp === void 0 ? void 0 : styleProp.pointerEvents) || \"\";\n styles.transform = transformTemplate\n ? transformTemplate(this.latestValues, \"\")\n : \"none\";\n return styles;\n }\n const lead = this.getLead();\n if (!this.projectionDelta || !this.layout || !lead.target) {\n const emptyStyles = {};\n if (this.options.layoutId) {\n emptyStyles.opacity =\n this.latestValues.opacity !== undefined\n ? this.latestValues.opacity\n : 1;\n emptyStyles.pointerEvents =\n resolveMotionValue(styleProp === null || styleProp === void 0 ? void 0 : styleProp.pointerEvents) || \"\";\n }\n if (this.hasProjected && !hasTransform(this.latestValues)) {\n emptyStyles.transform = transformTemplate\n ? transformTemplate({}, \"\")\n : \"none\";\n this.hasProjected = false;\n }\n return emptyStyles;\n }\n const valuesToRender = lead.animationValues || lead.latestValues;\n this.applyTransformsToTarget();\n styles.transform = buildProjectionTransform(this.projectionDeltaWithTransform, this.treeScale, valuesToRender);\n if (transformTemplate) {\n styles.transform = transformTemplate(valuesToRender, styles.transform);\n }\n const { x, y } = this.projectionDelta;\n styles.transformOrigin = `${x.origin * 100}% ${y.origin * 100}% 0`;\n if (lead.animationValues) {\n /**\n * If the lead component is animating, assign this either the entering/leaving\n * opacity\n */\n styles.opacity =\n lead === this\n ? (_b = (_a = valuesToRender.opacity) !== null && _a !== void 0 ? _a : this.latestValues.opacity) !== null && _b !== void 0 ? _b : 1\n : this.preserveOpacity\n ? this.latestValues.opacity\n : valuesToRender.opacityExit;\n }\n else {\n /**\n * Or we're not animating at all, set the lead component to its layout\n * opacity and other components to hidden.\n */\n styles.opacity =\n lead === this\n ? valuesToRender.opacity !== undefined\n ? valuesToRender.opacity\n : \"\"\n : valuesToRender.opacityExit !== undefined\n ? valuesToRender.opacityExit\n : 0;\n }\n /**\n * Apply scale correction\n */\n for (const key in scaleCorrectors) {\n if (valuesToRender[key] === undefined)\n continue;\n const { correct, applyTo } = scaleCorrectors[key];\n /**\n * Only apply scale correction to the value if we have an\n * active projection transform. Otherwise these values become\n * vulnerable to distortion if the element changes size without\n * a corresponding layout animation.\n */\n const corrected = styles.transform === \"none\"\n ? valuesToRender[key]\n : correct(valuesToRender[key], lead);\n if (applyTo) {\n const num = applyTo.length;\n for (let i = 0; i < num; i++) {\n styles[applyTo[i]] = corrected;\n }\n }\n else {\n styles[key] = corrected;\n }\n }\n /**\n * Disable pointer events on follow components. This is to ensure\n * that if a follow component covers a lead component it doesn't block\n * pointer events on the lead.\n */\n if (this.options.layoutId) {\n styles.pointerEvents =\n lead === this\n ? resolveMotionValue(styleProp === null || styleProp === void 0 ? void 0 : styleProp.pointerEvents) || \"\"\n : \"none\";\n }\n return styles;\n }\n clearSnapshot() {\n this.resumeFrom = this.snapshot = undefined;\n }\n // Only run on root\n resetTree() {\n this.root.nodes.forEach((node) => { var _a; return (_a = node.currentAnimation) === null || _a === void 0 ? void 0 : _a.stop(); });\n this.root.nodes.forEach(clearMeasurements);\n this.root.sharedNodes.clear();\n }\n };\n}\nfunction updateLayout(node) {\n node.updateLayout();\n}\nfunction notifyLayoutUpdate(node) {\n var _a;\n const snapshot = ((_a = node.resumeFrom) === null || _a === void 0 ? void 0 : _a.snapshot) || node.snapshot;\n if (node.isLead() &&\n node.layout &&\n snapshot &&\n node.hasListeners(\"didUpdate\")) {\n const { layoutBox: layout, measuredBox: measuredLayout } = node.layout;\n const { animationType } = node.options;\n const isShared = snapshot.source !== node.layout.source;\n // TODO Maybe we want to also resize the layout snapshot so we don't trigger\n // animations for instance if layout=\"size\" and an element has only changed position\n if (animationType === \"size\") {\n eachAxis((axis) => {\n const axisSnapshot = isShared\n ? snapshot.measuredBox[axis]\n : snapshot.layoutBox[axis];\n const length = calcLength(axisSnapshot);\n axisSnapshot.min = layout[axis].min;\n axisSnapshot.max = axisSnapshot.min + length;\n });\n }\n else if (shouldAnimatePositionOnly(animationType, snapshot.layoutBox, layout)) {\n eachAxis((axis) => {\n const axisSnapshot = isShared\n ? snapshot.measuredBox[axis]\n : snapshot.layoutBox[axis];\n const length = calcLength(layout[axis]);\n axisSnapshot.max = axisSnapshot.min + length;\n /**\n * Ensure relative target gets resized and rerendererd\n */\n if (node.relativeTarget && !node.currentAnimation) {\n node.isProjectionDirty = true;\n node.relativeTarget[axis].max =\n node.relativeTarget[axis].min + length;\n }\n });\n }\n const layoutDelta = createDelta();\n calcBoxDelta(layoutDelta, layout, snapshot.layoutBox);\n const visualDelta = createDelta();\n if (isShared) {\n calcBoxDelta(visualDelta, node.applyTransform(measuredLayout, true), snapshot.measuredBox);\n }\n else {\n calcBoxDelta(visualDelta, layout, snapshot.layoutBox);\n }\n const hasLayoutChanged = !isDeltaZero(layoutDelta);\n let hasRelativeTargetChanged = false;\n if (!node.resumeFrom) {\n const relativeParent = node.getClosestProjectingParent();\n /**\n * If the relativeParent is itself resuming from a different element then\n * the relative snapshot is not relavent\n */\n if (relativeParent && !relativeParent.resumeFrom) {\n const { snapshot: parentSnapshot, layout: parentLayout } = relativeParent;\n if (parentSnapshot && parentLayout) {\n const relativeSnapshot = createBox();\n calcRelativePosition(relativeSnapshot, snapshot.layoutBox, parentSnapshot.layoutBox);\n const relativeLayout = createBox();\n calcRelativePosition(relativeLayout, layout, parentLayout.layoutBox);\n if (!boxEqualsRounded(relativeSnapshot, relativeLayout)) {\n hasRelativeTargetChanged = true;\n }\n if (relativeParent.options.layoutRoot) {\n node.relativeTarget = relativeLayout;\n node.relativeTargetOrigin = relativeSnapshot;\n node.relativeParent = relativeParent;\n }\n }\n }\n }\n node.notifyListeners(\"didUpdate\", {\n layout,\n snapshot,\n delta: visualDelta,\n layoutDelta,\n hasLayoutChanged,\n hasRelativeTargetChanged,\n });\n }\n else if (node.isLead()) {\n const { onExitComplete } = node.options;\n onExitComplete && onExitComplete();\n }\n /**\n * Clearing transition\n * TODO: Investigate why this transition is being passed in as {type: false } from Framer\n * and why we need it at all\n */\n node.options.transition = undefined;\n}\nfunction propagateDirtyNodes(node) {\n /**\n * Increase debug counter for nodes encountered this frame\n */\n projectionFrameData.totalNodes++;\n if (!node.parent)\n return;\n /**\n * If this node isn't projecting, propagate isProjectionDirty. It will have\n * no performance impact but it will allow the next child that *is* projecting\n * but *isn't* dirty to just check its parent to see if *any* ancestor needs\n * correcting.\n */\n if (!node.isProjecting()) {\n node.isProjectionDirty = node.parent.isProjectionDirty;\n }\n /**\n * Propagate isSharedProjectionDirty and isTransformDirty\n * throughout the whole tree. A future revision can take another look at\n * this but for safety we still recalcualte shared nodes.\n */\n node.isSharedProjectionDirty || (node.isSharedProjectionDirty = Boolean(node.isProjectionDirty ||\n node.parent.isProjectionDirty ||\n node.parent.isSharedProjectionDirty));\n node.isTransformDirty || (node.isTransformDirty = node.parent.isTransformDirty);\n}\nfunction cleanDirtyNodes(node) {\n node.isProjectionDirty =\n node.isSharedProjectionDirty =\n node.isTransformDirty =\n false;\n}\nfunction clearSnapshot(node) {\n node.clearSnapshot();\n}\nfunction clearMeasurements(node) {\n node.clearMeasurements();\n}\nfunction clearIsLayoutDirty(node) {\n node.isLayoutDirty = false;\n}\nfunction resetTransformStyle(node) {\n const { visualElement } = node.options;\n if (visualElement && visualElement.getProps().onBeforeLayoutMeasure) {\n visualElement.notify(\"BeforeLayoutMeasure\");\n }\n node.resetTransform();\n}\nfunction finishAnimation(node) {\n node.finishAnimation();\n node.targetDelta = node.relativeTarget = node.target = undefined;\n node.isProjectionDirty = true;\n}\nfunction resolveTargetDelta(node) {\n node.resolveTargetDelta();\n}\nfunction calcProjection(node) {\n node.calcProjection();\n}\nfunction resetSkewAndRotation(node) {\n node.resetSkewAndRotation();\n}\nfunction removeLeadSnapshots(stack) {\n stack.removeLeadSnapshot();\n}\nfunction mixAxisDelta(output, delta, p) {\n output.translate = mixNumber(delta.translate, 0, p);\n output.scale = mixNumber(delta.scale, 1, p);\n output.origin = delta.origin;\n output.originPoint = delta.originPoint;\n}\nfunction mixAxis(output, from, to, p) {\n output.min = mixNumber(from.min, to.min, p);\n output.max = mixNumber(from.max, to.max, p);\n}\nfunction mixBox(output, from, to, p) {\n mixAxis(output.x, from.x, to.x, p);\n mixAxis(output.y, from.y, to.y, p);\n}\nfunction hasOpacityCrossfade(node) {\n return (node.animationValues && node.animationValues.opacityExit !== undefined);\n}\nconst defaultLayoutTransition = {\n duration: 0.45,\n ease: [0.4, 0, 0.1, 1],\n};\nconst userAgentContains = (string) => typeof navigator !== \"undefined\" &&\n navigator.userAgent &&\n navigator.userAgent.toLowerCase().includes(string);\n/**\n * Measured bounding boxes must be rounded in Safari and\n * left untouched in Chrome, otherwise non-integer layouts within scaled-up elements\n * can appear to jump.\n */\nconst roundPoint = userAgentContains(\"applewebkit/\") && !userAgentContains(\"chrome/\")\n ? Math.round\n : noop;\nfunction roundAxis(axis) {\n // Round to the nearest .5 pixels to support subpixel layouts\n axis.min = roundPoint(axis.min);\n axis.max = roundPoint(axis.max);\n}\nfunction roundBox(box) {\n roundAxis(box.x);\n roundAxis(box.y);\n}\nfunction shouldAnimatePositionOnly(animationType, snapshot, layout) {\n return (animationType === \"position\" ||\n (animationType === \"preserve-aspect\" &&\n !isNear(aspectRatio(snapshot), aspectRatio(layout), 0.2)));\n}\n\nexport { cleanDirtyNodes, createProjectionNode, mixAxis, mixAxisDelta, mixBox, propagateDirtyNodes };\n","import { createProjectionNode } from './create-projection-node.mjs';\nimport { addDomEvent } from '../../events/add-dom-event.mjs';\n\nconst DocumentProjectionNode = createProjectionNode({\n attachResizeListener: (ref, notify) => addDomEvent(ref, \"resize\", notify),\n measureScroll: () => ({\n x: document.documentElement.scrollLeft || document.body.scrollLeft,\n y: document.documentElement.scrollTop || document.body.scrollTop,\n }),\n checkIsScrollRoot: () => true,\n});\n\nexport { DocumentProjectionNode };\n","import { createProjectionNode } from './create-projection-node.mjs';\nimport { DocumentProjectionNode } from './DocumentProjectionNode.mjs';\n\nconst rootProjectionNode = {\n current: undefined,\n};\nconst HTMLProjectionNode = createProjectionNode({\n measureScroll: (instance) => ({\n x: instance.scrollLeft,\n y: instance.scrollTop,\n }),\n defaultParent: () => {\n if (!rootProjectionNode.current) {\n const documentNode = new DocumentProjectionNode({});\n documentNode.mount(window);\n documentNode.setOptions({ layoutScroll: true });\n rootProjectionNode.current = documentNode;\n }\n return rootProjectionNode.current;\n },\n resetTransform: (instance, value) => {\n instance.style.transform = value !== undefined ? value : \"none\";\n },\n checkIsScrollRoot: (instance) => Boolean(window.getComputedStyle(instance).position === \"fixed\"),\n});\n\nexport { HTMLProjectionNode, rootProjectionNode };\n","import { DragGesture } from '../../gestures/drag/index.mjs';\nimport { PanGesture } from '../../gestures/pan/index.mjs';\nimport { MeasureLayout } from './layout/MeasureLayout.mjs';\nimport { HTMLProjectionNode } from '../../projection/node/HTMLProjectionNode.mjs';\n\nconst drag = {\n pan: {\n Feature: PanGesture,\n },\n drag: {\n Feature: DragGesture,\n ProjectionNode: HTMLProjectionNode,\n MeasureLayout,\n },\n};\n\nexport { drag };\n","// Does this device prefer reduced motion? Returns `null` server-side.\nconst prefersReducedMotion = { current: null };\nconst hasReducedMotionListener = { current: false };\n\nexport { hasReducedMotionListener, prefersReducedMotion };\n","import { isBrowser } from '../is-browser.mjs';\nimport { hasReducedMotionListener, prefersReducedMotion } from './state.mjs';\n\nfunction initPrefersReducedMotion() {\n hasReducedMotionListener.current = true;\n if (!isBrowser)\n return;\n if (window.matchMedia) {\n const motionMediaQuery = window.matchMedia(\"(prefers-reduced-motion)\");\n const setReducedMotionPreferences = () => (prefersReducedMotion.current = motionMediaQuery.matches);\n motionMediaQuery.addListener(setReducedMotionPreferences);\n setReducedMotionPreferences();\n }\n else {\n prefersReducedMotion.current = false;\n }\n}\n\nexport { initPrefersReducedMotion };\n","import { isWillChangeMotionValue } from '../../value/use-will-change/is.mjs';\nimport { warnOnce } from '../../utils/warn-once.mjs';\nimport { motionValue } from '../../value/index.mjs';\nimport { isMotionValue } from '../../value/utils/is-motion-value.mjs';\n\nfunction updateMotionValuesFromProps(element, next, prev) {\n const { willChange } = next;\n for (const key in next) {\n const nextValue = next[key];\n const prevValue = prev[key];\n if (isMotionValue(nextValue)) {\n /**\n * If this is a motion value found in props or style, we want to add it\n * to our visual element's motion value map.\n */\n element.addValue(key, nextValue);\n if (isWillChangeMotionValue(willChange)) {\n willChange.add(key);\n }\n /**\n * Check the version of the incoming motion value with this version\n * and warn against mismatches.\n */\n if (process.env.NODE_ENV === \"development\") {\n warnOnce(nextValue.version === \"11.2.10\", `Attempting to mix Framer Motion versions ${nextValue.version} with 11.2.10 may not work as expected.`);\n }\n }\n else if (isMotionValue(prevValue)) {\n /**\n * If we're swapping from a motion value to a static value,\n * create a new motion value from that\n */\n element.addValue(key, motionValue(nextValue, { owner: element }));\n if (isWillChangeMotionValue(willChange)) {\n willChange.remove(key);\n }\n }\n else if (prevValue !== nextValue) {\n /**\n * If this is a flat value that has changed, update the motion value\n * or create one if it doesn't exist. We only want to do this if we're\n * not handling the value with our animation state.\n */\n if (element.hasValue(key)) {\n const existingValue = element.getValue(key);\n if (existingValue.liveStyle === true) {\n existingValue.jump(nextValue);\n }\n else if (!existingValue.hasAnimated) {\n existingValue.set(nextValue);\n }\n }\n else {\n const latestValue = element.getStaticValue(key);\n element.addValue(key, motionValue(latestValue !== undefined ? latestValue : nextValue, { owner: element }));\n }\n }\n }\n // Handle removed values\n for (const key in prev) {\n if (next[key] === undefined)\n element.removeValue(key);\n }\n return next;\n}\n\nexport { updateMotionValuesFromProps };\n","const visualElementStore = new WeakMap();\n\nexport { visualElementStore };\n","import { color } from '../../../value/types/color/index.mjs';\nimport { complex } from '../../../value/types/complex/index.mjs';\nimport { dimensionValueTypes } from './dimensions.mjs';\nimport { testValueType } from './test.mjs';\n\n/**\n * A list of all ValueTypes\n */\nconst valueTypes = [...dimensionValueTypes, color, complex];\n/**\n * Tests a value against the list of ValueTypes\n */\nconst findValueType = (v) => valueTypes.find(testValueType(v));\n\nexport { findValueType };\n","import { warning, invariant } from '../utils/errors.mjs';\nimport { createBox } from '../projection/geometry/models.mjs';\nimport { isRefObject } from '../utils/is-ref-object.mjs';\nimport { initPrefersReducedMotion } from '../utils/reduced-motion/index.mjs';\nimport { hasReducedMotionListener, prefersReducedMotion } from '../utils/reduced-motion/state.mjs';\nimport { SubscriptionManager } from '../utils/subscription-manager.mjs';\nimport { motionValue } from '../value/index.mjs';\nimport { isWillChangeMotionValue } from '../value/use-will-change/is.mjs';\nimport { isMotionValue } from '../value/utils/is-motion-value.mjs';\nimport { transformProps } from './html/utils/transform.mjs';\nimport { isControllingVariants, isVariantNode } from './utils/is-controlling-variants.mjs';\nimport { isVariantLabel } from './utils/is-variant-label.mjs';\nimport { updateMotionValuesFromProps } from './utils/motion-values.mjs';\nimport { resolveVariantFromProps } from './utils/resolve-variants.mjs';\nimport { warnOnce } from '../utils/warn-once.mjs';\nimport { featureDefinitions } from '../motion/features/definitions.mjs';\nimport { variantProps } from './utils/variant-props.mjs';\nimport { visualElementStore } from './store.mjs';\nimport { KeyframeResolver } from './utils/KeyframesResolver.mjs';\nimport { isNumericalString } from '../utils/is-numerical-string.mjs';\nimport { isZeroValueString } from '../utils/is-zero-value-string.mjs';\nimport { findValueType } from './dom/value-types/find.mjs';\nimport { complex } from '../value/types/complex/index.mjs';\nimport { getAnimatableNone } from './dom/value-types/animatable-none.mjs';\nimport { frame, cancelFrame } from '../frameloop/frame.mjs';\n\nconst featureNames = Object.keys(featureDefinitions);\nconst numFeatures = featureNames.length;\nconst propEventHandlers = [\n \"AnimationStart\",\n \"AnimationComplete\",\n \"Update\",\n \"BeforeLayoutMeasure\",\n \"LayoutMeasure\",\n \"LayoutAnimationStart\",\n \"LayoutAnimationComplete\",\n];\nconst numVariantProps = variantProps.length;\nfunction getClosestProjectingNode(visualElement) {\n if (!visualElement)\n return undefined;\n return visualElement.options.allowProjection !== false\n ? visualElement.projection\n : getClosestProjectingNode(visualElement.parent);\n}\n/**\n * A VisualElement is an imperative abstraction around UI elements such as\n * HTMLElement, SVGElement, Three.Object3D etc.\n */\nclass VisualElement {\n /**\n * This method takes React props and returns found MotionValues. For example, HTML\n * MotionValues will be found within the style prop, whereas for Three.js within attribute arrays.\n *\n * This isn't an abstract method as it needs calling in the constructor, but it is\n * intended to be one.\n */\n scrapeMotionValuesFromProps(_props, _prevProps, _visualElement) {\n return {};\n }\n constructor({ parent, props, presenceContext, reducedMotionConfig, blockInitialAnimation, visualState, }, options = {}) {\n this.resolveKeyframes = (keyframes, \n // We use an onComplete callback here rather than a Promise as a Promise\n // resolution is a microtask and we want to retain the ability to force\n // the resolution of keyframes synchronously.\n onComplete, name, value) => {\n return new this.KeyframeResolver(keyframes, onComplete, name, value, this);\n };\n /**\n * A reference to the current underlying Instance, e.g. a HTMLElement\n * or Three.Mesh etc.\n */\n this.current = null;\n /**\n * A set containing references to this VisualElement's children.\n */\n this.children = new Set();\n /**\n * Determine what role this visual element should take in the variant tree.\n */\n this.isVariantNode = false;\n this.isControllingVariants = false;\n /**\n * Decides whether this VisualElement should animate in reduced motion\n * mode.\n *\n * TODO: This is currently set on every individual VisualElement but feels\n * like it could be set globally.\n */\n this.shouldReduceMotion = null;\n /**\n * A map of all motion values attached to this visual element. Motion\n * values are source of truth for any given animated value. A motion\n * value might be provided externally by the component via props.\n */\n this.values = new Map();\n this.KeyframeResolver = KeyframeResolver;\n /**\n * Cleanup functions for active features (hover/tap/exit etc)\n */\n this.features = {};\n /**\n * A map of every subscription that binds the provided or generated\n * motion values onChange listeners to this visual element.\n */\n this.valueSubscriptions = new Map();\n /**\n * A reference to the previously-provided motion values as returned\n * from scrapeMotionValuesFromProps. We use the keys in here to determine\n * if any motion values need to be removed after props are updated.\n */\n this.prevMotionValues = {};\n /**\n * An object containing a SubscriptionManager for each active event.\n */\n this.events = {};\n /**\n * An object containing an unsubscribe function for each prop event subscription.\n * For example, every \"Update\" event can have multiple subscribers via\n * VisualElement.on(), but only one of those can be defined via the onUpdate prop.\n */\n this.propEventSubscriptions = {};\n this.notifyUpdate = () => this.notify(\"Update\", this.latestValues);\n this.render = () => {\n if (!this.current)\n return;\n this.triggerBuild();\n this.renderInstance(this.current, this.renderState, this.props.style, this.projection);\n };\n this.scheduleRender = () => frame.render(this.render, false, true);\n const { latestValues, renderState } = visualState;\n this.latestValues = latestValues;\n this.baseTarget = { ...latestValues };\n this.initialValues = props.initial ? { ...latestValues } : {};\n this.renderState = renderState;\n this.parent = parent;\n this.props = props;\n this.presenceContext = presenceContext;\n this.depth = parent ? parent.depth + 1 : 0;\n this.reducedMotionConfig = reducedMotionConfig;\n this.options = options;\n this.blockInitialAnimation = Boolean(blockInitialAnimation);\n this.isControllingVariants = isControllingVariants(props);\n this.isVariantNode = isVariantNode(props);\n if (this.isVariantNode) {\n this.variantChildren = new Set();\n }\n this.manuallyAnimateOnMount = Boolean(parent && parent.current);\n /**\n * Any motion values that are provided to the element when created\n * aren't yet bound to the element, as this would technically be impure.\n * However, we iterate through the motion values and set them to the\n * initial values for this component.\n *\n * TODO: This is impure and we should look at changing this to run on mount.\n * Doing so will break some tests but this isn't neccessarily a breaking change,\n * more a reflection of the test.\n */\n const { willChange, ...initialMotionValues } = this.scrapeMotionValuesFromProps(props, {}, this);\n for (const key in initialMotionValues) {\n const value = initialMotionValues[key];\n if (latestValues[key] !== undefined && isMotionValue(value)) {\n value.set(latestValues[key], false);\n if (isWillChangeMotionValue(willChange)) {\n willChange.add(key);\n }\n }\n }\n }\n mount(instance) {\n this.current = instance;\n visualElementStore.set(instance, this);\n if (this.projection && !this.projection.instance) {\n this.projection.mount(instance);\n }\n if (this.parent && this.isVariantNode && !this.isControllingVariants) {\n this.removeFromVariantTree = this.parent.addVariantChild(this);\n }\n this.values.forEach((value, key) => this.bindToMotionValue(key, value));\n if (!hasReducedMotionListener.current) {\n initPrefersReducedMotion();\n }\n this.shouldReduceMotion =\n this.reducedMotionConfig === \"never\"\n ? false\n : this.reducedMotionConfig === \"always\"\n ? true\n : prefersReducedMotion.current;\n if (process.env.NODE_ENV !== \"production\") {\n warnOnce(this.shouldReduceMotion !== true, \"You have Reduced Motion enabled on your device. Animations may not appear as expected.\");\n }\n if (this.parent)\n this.parent.children.add(this);\n this.update(this.props, this.presenceContext);\n }\n unmount() {\n var _a;\n visualElementStore.delete(this.current);\n this.projection && this.projection.unmount();\n cancelFrame(this.notifyUpdate);\n cancelFrame(this.render);\n this.valueSubscriptions.forEach((remove) => remove());\n this.removeFromVariantTree && this.removeFromVariantTree();\n this.parent && this.parent.children.delete(this);\n for (const key in this.events) {\n this.events[key].clear();\n }\n for (const key in this.features) {\n (_a = this.features[key]) === null || _a === void 0 ? void 0 : _a.unmount();\n }\n this.current = null;\n }\n bindToMotionValue(key, value) {\n const valueIsTransform = transformProps.has(key);\n const removeOnChange = value.on(\"change\", (latestValue) => {\n this.latestValues[key] = latestValue;\n this.props.onUpdate && frame.preRender(this.notifyUpdate);\n if (valueIsTransform && this.projection) {\n this.projection.isTransformDirty = true;\n }\n });\n const removeOnRenderRequest = value.on(\"renderRequest\", this.scheduleRender);\n this.valueSubscriptions.set(key, () => {\n removeOnChange();\n removeOnRenderRequest();\n if (value.owner)\n value.stop();\n });\n }\n sortNodePosition(other) {\n /**\n * If these nodes aren't even of the same type we can't compare their depth.\n */\n if (!this.current ||\n !this.sortInstanceNodePosition ||\n this.type !== other.type) {\n return 0;\n }\n return this.sortInstanceNodePosition(this.current, other.current);\n }\n loadFeatures({ children, ...renderedProps }, isStrict, preloadedFeatures, initialLayoutGroupConfig) {\n let ProjectionNodeConstructor;\n let MeasureLayout;\n /**\n * If we're in development mode, check to make sure we're not rendering a motion component\n * as a child of LazyMotion, as this will break the file-size benefits of using it.\n */\n if (process.env.NODE_ENV !== \"production\" &&\n preloadedFeatures &&\n isStrict) {\n const strictMessage = \"You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.\";\n renderedProps.ignoreStrict\n ? warning(false, strictMessage)\n : invariant(false, strictMessage);\n }\n for (let i = 0; i < numFeatures; i++) {\n const name = featureNames[i];\n const { isEnabled, Feature: FeatureConstructor, ProjectionNode, MeasureLayout: MeasureLayoutComponent, } = featureDefinitions[name];\n if (ProjectionNode)\n ProjectionNodeConstructor = ProjectionNode;\n if (isEnabled(renderedProps)) {\n if (!this.features[name] && FeatureConstructor) {\n this.features[name] = new FeatureConstructor(this);\n }\n if (MeasureLayoutComponent) {\n MeasureLayout = MeasureLayoutComponent;\n }\n }\n }\n if ((this.type === \"html\" || this.type === \"svg\") &&\n !this.projection &&\n ProjectionNodeConstructor) {\n const { layoutId, layout, drag, dragConstraints, layoutScroll, layoutRoot, } = renderedProps;\n this.projection = new ProjectionNodeConstructor(this.latestValues, renderedProps[\"data-framer-portal-id\"]\n ? undefined\n : getClosestProjectingNode(this.parent));\n this.projection.setOptions({\n layoutId,\n layout,\n alwaysMeasureLayout: Boolean(drag) ||\n (dragConstraints && isRefObject(dragConstraints)),\n visualElement: this,\n scheduleRender: () => this.scheduleRender(),\n /**\n * TODO: Update options in an effect. This could be tricky as it'll be too late\n * to update by the time layout animations run.\n * We also need to fix this safeToRemove by linking it up to the one returned by usePresence,\n * ensuring it gets called if there's no potential layout animations.\n *\n */\n animationType: typeof layout === \"string\" ? layout : \"both\",\n initialPromotionConfig: initialLayoutGroupConfig,\n layoutScroll,\n layoutRoot,\n });\n }\n return MeasureLayout;\n }\n updateFeatures() {\n for (const key in this.features) {\n const feature = this.features[key];\n if (feature.isMounted) {\n feature.update();\n }\n else {\n feature.mount();\n feature.isMounted = true;\n }\n }\n }\n triggerBuild() {\n this.build(this.renderState, this.latestValues, this.options, this.props);\n }\n /**\n * Measure the current viewport box with or without transforms.\n * Only measures axis-aligned boxes, rotate and skew must be manually\n * removed with a re-render to work.\n */\n measureViewportBox() {\n return this.current\n ? this.measureInstanceViewportBox(this.current, this.props)\n : createBox();\n }\n getStaticValue(key) {\n return this.latestValues[key];\n }\n setStaticValue(key, value) {\n this.latestValues[key] = value;\n }\n /**\n * Update the provided props. Ensure any newly-added motion values are\n * added to our map, old ones removed, and listeners updated.\n */\n update(props, presenceContext) {\n if (props.transformTemplate || this.props.transformTemplate) {\n this.scheduleRender();\n }\n this.prevProps = this.props;\n this.props = props;\n this.prevPresenceContext = this.presenceContext;\n this.presenceContext = presenceContext;\n /**\n * Update prop event handlers ie onAnimationStart, onAnimationComplete\n */\n for (let i = 0; i < propEventHandlers.length; i++) {\n const key = propEventHandlers[i];\n if (this.propEventSubscriptions[key]) {\n this.propEventSubscriptions[key]();\n delete this.propEventSubscriptions[key];\n }\n const listenerName = (\"on\" + key);\n const listener = props[listenerName];\n if (listener) {\n this.propEventSubscriptions[key] = this.on(key, listener);\n }\n }\n this.prevMotionValues = updateMotionValuesFromProps(this, this.scrapeMotionValuesFromProps(props, this.prevProps, this), this.prevMotionValues);\n if (this.handleChildMotionValue) {\n this.handleChildMotionValue();\n }\n }\n getProps() {\n return this.props;\n }\n /**\n * Returns the variant definition with a given name.\n */\n getVariant(name) {\n return this.props.variants ? this.props.variants[name] : undefined;\n }\n /**\n * Returns the defined default transition on this component.\n */\n getDefaultTransition() {\n return this.props.transition;\n }\n getTransformPagePoint() {\n return this.props.transformPagePoint;\n }\n getClosestVariantNode() {\n return this.isVariantNode\n ? this\n : this.parent\n ? this.parent.getClosestVariantNode()\n : undefined;\n }\n getVariantContext(startAtParent = false) {\n if (startAtParent) {\n return this.parent ? this.parent.getVariantContext() : undefined;\n }\n if (!this.isControllingVariants) {\n const context = this.parent\n ? this.parent.getVariantContext() || {}\n : {};\n if (this.props.initial !== undefined) {\n context.initial = this.props.initial;\n }\n return context;\n }\n const context = {};\n for (let i = 0; i < numVariantProps; i++) {\n const name = variantProps[i];\n const prop = this.props[name];\n if (isVariantLabel(prop) || prop === false) {\n context[name] = prop;\n }\n }\n return context;\n }\n /**\n * Add a child visual element to our set of children.\n */\n addVariantChild(child) {\n const closestVariantNode = this.getClosestVariantNode();\n if (closestVariantNode) {\n closestVariantNode.variantChildren &&\n closestVariantNode.variantChildren.add(child);\n return () => closestVariantNode.variantChildren.delete(child);\n }\n }\n /**\n * Add a motion value and bind it to this visual element.\n */\n addValue(key, value) {\n // Remove existing value if it exists\n const existingValue = this.values.get(key);\n if (value !== existingValue) {\n if (existingValue)\n this.removeValue(key);\n this.bindToMotionValue(key, value);\n this.values.set(key, value);\n this.latestValues[key] = value.get();\n }\n }\n /**\n * Remove a motion value and unbind any active subscriptions.\n */\n removeValue(key) {\n this.values.delete(key);\n const unsubscribe = this.valueSubscriptions.get(key);\n if (unsubscribe) {\n unsubscribe();\n this.valueSubscriptions.delete(key);\n }\n delete this.latestValues[key];\n this.removeValueFromRenderState(key, this.renderState);\n }\n /**\n * Check whether we have a motion value for this key\n */\n hasValue(key) {\n return this.values.has(key);\n }\n getValue(key, defaultValue) {\n if (this.props.values && this.props.values[key]) {\n return this.props.values[key];\n }\n let value = this.values.get(key);\n if (value === undefined && defaultValue !== undefined) {\n value = motionValue(defaultValue === null ? undefined : defaultValue, { owner: this });\n this.addValue(key, value);\n }\n return value;\n }\n /**\n * If we're trying to animate to a previously unencountered value,\n * we need to check for it in our state and as a last resort read it\n * directly from the instance (which might have performance implications).\n */\n readValue(key, target) {\n var _a;\n let value = this.latestValues[key] !== undefined || !this.current\n ? this.latestValues[key]\n : (_a = this.getBaseTargetFromProps(this.props, key)) !== null && _a !== void 0 ? _a : this.readValueFromInstance(this.current, key, this.options);\n if (value !== undefined && value !== null) {\n if (typeof value === \"string\" &&\n (isNumericalString(value) || isZeroValueString(value))) {\n // If this is a number read as a string, ie \"0\" or \"200\", convert it to a number\n value = parseFloat(value);\n }\n else if (!findValueType(value) && complex.test(target)) {\n value = getAnimatableNone(key, target);\n }\n this.setBaseTarget(key, isMotionValue(value) ? value.get() : value);\n }\n return isMotionValue(value) ? value.get() : value;\n }\n /**\n * Set the base target to later animate back to. This is currently\n * only hydrated on creation and when we first read a value.\n */\n setBaseTarget(key, value) {\n this.baseTarget[key] = value;\n }\n /**\n * Find the base target for a value thats been removed from all animation\n * props.\n */\n getBaseTarget(key) {\n var _a;\n const { initial } = this.props;\n let valueFromInitial;\n if (typeof initial === \"string\" || typeof initial === \"object\") {\n const variant = resolveVariantFromProps(this.props, initial, (_a = this.presenceContext) === null || _a === void 0 ? void 0 : _a.custom);\n if (variant) {\n valueFromInitial = variant[key];\n }\n }\n /**\n * If this value still exists in the current initial variant, read that.\n */\n if (initial && valueFromInitial !== undefined) {\n return valueFromInitial;\n }\n /**\n * Alternatively, if this VisualElement config has defined a getBaseTarget\n * so we can read the value from an alternative source, try that.\n */\n const target = this.getBaseTargetFromProps(this.props, key);\n if (target !== undefined && !isMotionValue(target))\n return target;\n /**\n * If the value was initially defined on initial, but it doesn't any more,\n * return undefined. Otherwise return the value as initially read from the DOM.\n */\n return this.initialValues[key] !== undefined &&\n valueFromInitial === undefined\n ? undefined\n : this.baseTarget[key];\n }\n on(eventName, callback) {\n if (!this.events[eventName]) {\n this.events[eventName] = new SubscriptionManager();\n }\n return this.events[eventName].add(callback);\n }\n notify(eventName, ...args) {\n if (this.events[eventName]) {\n this.events[eventName].notify(...args);\n }\n }\n}\n\nexport { VisualElement };\n","import { VisualElement } from '../VisualElement.mjs';\nimport { DOMKeyframesResolver } from './DOMKeyframesResolver.mjs';\n\nclass DOMVisualElement extends VisualElement {\n constructor() {\n super(...arguments);\n this.KeyframeResolver = DOMKeyframesResolver;\n }\n sortInstanceNodePosition(a, b) {\n /**\n * compareDocumentPosition returns a bitmask, by using the bitwise &\n * we're returning true if 2 in that bitmask is set to true. 2 is set\n * to true if b preceeds a.\n */\n return a.compareDocumentPosition(b) & 2 ? 1 : -1;\n }\n getBaseTargetFromProps(props, key) {\n return props.style\n ? props.style[key]\n : undefined;\n }\n removeValueFromRenderState(key, { vars, style }) {\n delete vars[key];\n delete style[key];\n }\n}\n\nexport { DOMVisualElement };\n","import { buildHTMLStyles } from './utils/build-styles.mjs';\nimport { isCSSVariableName } from '../dom/utils/is-css-variable.mjs';\nimport { transformProps } from './utils/transform.mjs';\nimport { scrapeMotionValuesFromProps } from './utils/scrape-motion-values.mjs';\nimport { renderHTML } from './utils/render.mjs';\nimport { getDefaultValueType } from '../dom/value-types/defaults.mjs';\nimport { measureViewportBox } from '../../projection/utils/measure.mjs';\nimport { DOMVisualElement } from '../dom/DOMVisualElement.mjs';\nimport { isMotionValue } from '../../value/utils/is-motion-value.mjs';\n\nfunction getComputedStyle(element) {\n return window.getComputedStyle(element);\n}\nclass HTMLVisualElement extends DOMVisualElement {\n constructor() {\n super(...arguments);\n this.type = \"html\";\n }\n readValueFromInstance(instance, key) {\n if (transformProps.has(key)) {\n const defaultType = getDefaultValueType(key);\n return defaultType ? defaultType.default || 0 : 0;\n }\n else {\n const computedStyle = getComputedStyle(instance);\n const value = (isCSSVariableName(key)\n ? computedStyle.getPropertyValue(key)\n : computedStyle[key]) || 0;\n return typeof value === \"string\" ? value.trim() : value;\n }\n }\n measureInstanceViewportBox(instance, { transformPagePoint }) {\n return measureViewportBox(instance, transformPagePoint);\n }\n build(renderState, latestValues, options, props) {\n buildHTMLStyles(renderState, latestValues, options, props.transformTemplate);\n }\n scrapeMotionValuesFromProps(props, prevProps, visualElement) {\n return scrapeMotionValuesFromProps(props, prevProps, visualElement);\n }\n handleChildMotionValue() {\n if (this.childSubscription) {\n this.childSubscription();\n delete this.childSubscription;\n }\n const { children } = this.props;\n if (isMotionValue(children)) {\n this.childSubscription = children.on(\"change\", (latest) => {\n if (this.current)\n this.current.textContent = `${latest}`;\n });\n }\n }\n renderInstance(instance, renderState, styleProp, projection) {\n renderHTML(instance, renderState, styleProp, projection);\n }\n}\n\nexport { HTMLVisualElement, getComputedStyle };\n","import { scrapeMotionValuesFromProps } from './utils/scrape-motion-values.mjs';\nimport { DOMVisualElement } from '../dom/DOMVisualElement.mjs';\nimport { buildSVGAttrs } from './utils/build-attrs.mjs';\nimport { camelToDash } from '../dom/utils/camel-to-dash.mjs';\nimport { camelCaseAttributes } from './utils/camel-case-attrs.mjs';\nimport { transformProps } from '../html/utils/transform.mjs';\nimport { renderSVG } from './utils/render.mjs';\nimport { getDefaultValueType } from '../dom/value-types/defaults.mjs';\nimport { createBox } from '../../projection/geometry/models.mjs';\nimport { isSVGTag } from './utils/is-svg-tag.mjs';\n\nclass SVGVisualElement extends DOMVisualElement {\n constructor() {\n super(...arguments);\n this.type = \"svg\";\n this.isSVGTag = false;\n }\n getBaseTargetFromProps(props, key) {\n return props[key];\n }\n readValueFromInstance(instance, key) {\n if (transformProps.has(key)) {\n const defaultType = getDefaultValueType(key);\n return defaultType ? defaultType.default || 0 : 0;\n }\n key = !camelCaseAttributes.has(key) ? camelToDash(key) : key;\n return instance.getAttribute(key);\n }\n measureInstanceViewportBox() {\n return createBox();\n }\n scrapeMotionValuesFromProps(props, prevProps, visualElement) {\n return scrapeMotionValuesFromProps(props, prevProps, visualElement);\n }\n build(renderState, latestValues, options, props) {\n buildSVGAttrs(renderState, latestValues, options, this.isSVGTag, props.transformTemplate);\n }\n renderInstance(instance, renderState, styleProp, projection) {\n renderSVG(instance, renderState, styleProp, projection);\n }\n mount(instance) {\n this.isSVGTag = isSVGTag(instance.tagName);\n super.mount(instance);\n }\n}\n\nexport { SVGVisualElement };\n","import { Fragment } from 'react';\nimport { HTMLVisualElement } from '../html/HTMLVisualElement.mjs';\nimport { SVGVisualElement } from '../svg/SVGVisualElement.mjs';\nimport { isSVGComponent } from './utils/is-svg-component.mjs';\n\nconst createDomVisualElement = (Component, options) => {\n return isSVGComponent(Component)\n ? new SVGVisualElement(options, { enableHardwareAcceleration: false })\n : new HTMLVisualElement(options, {\n allowProjection: Component !== Fragment,\n enableHardwareAcceleration: true,\n });\n};\n\nexport { createDomVisualElement };\n","import { HTMLProjectionNode } from '../../projection/node/HTMLProjectionNode.mjs';\nimport { MeasureLayout } from './layout/MeasureLayout.mjs';\n\nconst layout = {\n layout: {\n ProjectionNode: HTMLProjectionNode,\n MeasureLayout,\n },\n};\n\nexport { layout };\n","import { createMotionComponent } from '../../motion/index.mjs';\nimport { createMotionProxy } from './motion-proxy.mjs';\nimport { createDomMotionConfig } from './utils/create-config.mjs';\nimport { gestureAnimations } from '../../motion/features/gestures.mjs';\nimport { animations } from '../../motion/features/animations.mjs';\nimport { drag } from '../../motion/features/drag.mjs';\nimport { createDomVisualElement } from './create-visual-element.mjs';\nimport { layout } from '../../motion/features/layout.mjs';\n\nconst preloadedFeatures = {\n ...animations,\n ...gestureAnimations,\n ...drag,\n ...layout,\n};\n/**\n * HTML & SVG components, optimised for use with gestures and animation. These can be used as\n * drop-in replacements for any HTML & SVG component, all CSS & SVG properties are supported.\n *\n * @public\n */\nconst motion = /*@__PURE__*/ createMotionProxy((Component, config) => createDomMotionConfig(Component, config, preloadedFeatures, createDomVisualElement));\n/**\n * Create a DOM `motion` component with the provided string. This is primarily intended\n * as a full alternative to `motion` for consumers who have to support environments that don't\n * support `Proxy`.\n *\n * ```javascript\n * import { createDomMotionComponent } from \"framer-motion\"\n *\n * const motion = {\n * div: createDomMotionComponent('div')\n * }\n * ```\n *\n * @public\n */\nfunction createDomMotionComponent(key) {\n return createMotionComponent(createDomMotionConfig(key, { forwardMotionProps: false }, preloadedFeatures, createDomVisualElement));\n}\n\nexport { createDomMotionComponent, motion };\n","import { useState } from 'react';\nimport { initPrefersReducedMotion } from './index.mjs';\nimport { warnOnce } from '../warn-once.mjs';\nimport { hasReducedMotionListener, prefersReducedMotion } from './state.mjs';\n\n/**\n * A hook that returns `true` if we should be using reduced motion based on the current device's Reduced Motion setting.\n *\n * This can be used to implement changes to your UI based on Reduced Motion. For instance, replacing motion-sickness inducing\n * `x`/`y` animations with `opacity`, disabling the autoplay of background videos, or turning off parallax motion.\n *\n * It will actively respond to changes and re-render your components with the latest setting.\n *\n * ```jsx\n * export function Sidebar({ isOpen }) {\n * const shouldReduceMotion = useReducedMotion()\n * const closedX = shouldReduceMotion ? 0 : \"-100%\"\n *\n * return (\n * \n * )\n * }\n * ```\n *\n * @return boolean\n *\n * @public\n */\nfunction useReducedMotion() {\n /**\n * Lazy initialisation of prefersReducedMotion\n */\n !hasReducedMotionListener.current && initPrefersReducedMotion();\n const [shouldReduceMotion] = useState(prefersReducedMotion.current);\n if (process.env.NODE_ENV !== \"production\") {\n warnOnce(shouldReduceMotion !== true, \"You have Reduced Motion enabled on your device. Animations may not appear as expected.\");\n }\n /**\n * TODO See if people miss automatically updating shouldReduceMotion setting\n */\n return shouldReduceMotion;\n}\n\nexport { useReducedMotion };\n","import {\n useCallback,\n useEffect,\n useRef,\n useState,\n type RefCallback,\n} from 'react'\n\nexport type ElementState = 'active' | 'focus' | 'hover' | 'initial'\n\n// This started as a work around for https://github.com/framer/motion/issues/1221,\n// but it's so much more now. The variants in framer motion support hover, focus\n// and tap, while this effect also listens to the keypress, so that `Enter`\n// results in an active state as well.\nfunction useElementState(): [RefCallback, ElementState] {\n const ref = useRef(null)\n const [state, setState] = useState({\n focus: false,\n hover: false,\n active: false,\n })\n\n const setRef: RefCallback = useCallback(element => {\n ref.current = element\n }, [])\n\n useEffect(() => {\n const el = ref.current\n if (!el) return\n\n const pointerenter = () => setState(s => ({ ...s, hover: true }))\n const pointerleave = () => setState(s => ({ ...s, hover: false }))\n const focus = () => setState(s => ({ ...s, focus: true }))\n const blur = () => setState(s => ({ ...s, focus: false }))\n const pointerdown = () => {\n setState(s => ({ ...s, active: true }))\n\n // pointer events can be cancelled due to which el would never receive\n // a pointerup nor pointercancel event. Listen on the window for those\n // after we received the pointerdown event, and only catch it once. But\n // not with { once: true }, because we want te remove both of them, once\n // of them has been received.\n const pointerup = () => {\n setState(s => ({ ...s, active: false }))\n window.removeEventListener('pointerup', pointerup)\n window.removeEventListener('pointercancel', pointerup)\n }\n\n window.addEventListener('pointerup', pointerup)\n window.addEventListener('pointercancel', pointerup)\n }\n\n const keydown = (event: KeyboardEvent) => {\n if (event.key !== 'Enter') {\n return\n }\n\n setState(s => ({ ...s, active: true }))\n\n // when clicking a link, the keyup doesn't need to come from the keydown\n // element. We listen on the window instead, but only once.\n const keyup = () => setState(s => ({ ...s, active: false }))\n window.addEventListener('keyup', keyup, { once: true })\n }\n\n el.addEventListener('pointerenter', pointerenter)\n el.addEventListener('pointerleave', pointerleave)\n el.addEventListener('focus', focus)\n el.addEventListener('blur', blur)\n el.addEventListener('pointerdown', pointerdown)\n el.addEventListener('keydown', keydown)\n\n return () => {\n el.removeEventListener('pointerenter', pointerenter)\n el.removeEventListener('pointerleave', pointerleave)\n el.removeEventListener('focus', focus)\n el.removeEventListener('blur', blur)\n el.removeEventListener('pointerdown', pointerdown)\n el.removeEventListener('keydown', keydown)\n }\n }, [])\n\n const status: ElementState = state.active\n ? 'active'\n : state.focus\n ? 'focus'\n : state.hover\n ? 'hover'\n : 'initial'\n\n return [setRef, status]\n}\n\nexport { useElementState }\n","import { clsx } from 'clsx'\n\nconst arrowRotationMap = {\n up: 'rotate-180',\n right: '-rotate-90',\n down: 'rotate-0',\n left: 'rotate-90',\n 'top-right': '-rotate-135',\n}\n\nexport function ArrowIcon({\n direction,\n size = 32,\n className,\n}: {\n direction: 'up' | 'right' | 'down' | 'left' | 'top-right'\n size?: number\n className?: string\n}) {\n return (\n \n \n \n )\n}\n\nexport function CheckIcon() {\n return (\n \n \n \n )\n}\n\nexport function CopyIcon() {\n return (\n \n \n \n \n )\n}\n\nexport function GithubIcon({\n size = 24,\n title = 'GitHub',\n}: {\n size?: number\n title?: string\n}) {\n return (\n \n {title}\n \n \n )\n}\n\nexport function LaptopIcon({ size = 24 }: { size?: number } = {}) {\n return (\n \n \n \n )\n}\n\nexport function MoonIcon() {\n return (\n \n \n \n )\n}\n\nexport function PlayIcon() {\n return (\n \n \n \n \n )\n}\n\nexport function PlusIcon() {\n return (\n \n \n \n \n )\n}\n\nexport function RssIcon({\n size = 24,\n title = 'RSS',\n className,\n}: {\n size?: number\n title?: string\n className?: string\n}) {\n return (\n \n {title}\n \n \n \n \n )\n}\n\nexport function SearchIcon() {\n return (\n \n \n \n )\n}\n\nexport function SpinnerIcon({\n size = 24,\n ...svgProps\n}: { size?: number } & React.SVGProps) {\n return (\n \n \n \n \n )\n}\n\nexport function SunIcon() {\n return (\n \n \n \n \n \n \n \n \n \n \n \n )\n}\n\nexport function XIcon({\n size = 24,\n title = '𝕏',\n}: {\n size?: number\n title?: string\n}) {\n return (\n \n {title}\n \n \n )\n}\n","import { clsx } from 'clsx'\nimport * as React from 'react'\n\ntype TitleProps = {\n variant?: 'primary' | 'secondary'\n as?: React.ElementType\n className?: string\n id?: string\n style?: React.CSSProperties\n} & (\n | { children: React.ReactNode }\n | {\n dangerouslySetInnerHTML: {\n __html: string\n }\n }\n)\n\nconst fontSize = {\n h1: 'leading-tight text-4xl md:text-5xl',\n h2: 'leading-tight text-3xl md:text-4xl',\n h3: 'text-2xl font-medium md:text-3xl',\n h4: 'text-xl font-medium md:text-2xl',\n h5: 'text-lg font-medium md:text-xl',\n h6: 'text-lg font-medium',\n}\n\nconst titleColors = {\n primary: 'text-black dark:text-white',\n secondary: 'text-gray-600 dark:text-slate-500',\n}\n\nfunction Title({\n variant = 'primary',\n size,\n as,\n className,\n ...rest\n}: TitleProps & { size: keyof typeof fontSize }) {\n const Tag = as ?? size\n return (\n \n )\n}\n\nfunction H1(props: TitleProps) {\n return \n}\n\nfunction H2(props: TitleProps) {\n return <Title {...props} size=\"h2\" />\n}\n\nfunction H3(props: TitleProps) {\n return <Title {...props} size=\"h3\" />\n}\n\nfunction H4(props: TitleProps) {\n return <Title {...props} size=\"h4\" />\n}\n\nfunction H5(props: TitleProps) {\n return <Title {...props} size=\"h5\" />\n}\n\nfunction H6(props: TitleProps) {\n return <Title {...props} size=\"h6\" />\n}\n\ntype ParagraphProps = {\n className?: string\n prose?: boolean\n textColorClassName?: string\n as?: React.ElementType\n} & (\n | { children: React.ReactNode }\n | { dangerouslySetInnerHTML: { __html: string } }\n)\n\nfunction Paragraph({\n className,\n prose = true,\n as = 'p',\n textColorClassName = 'text-secondary',\n ...rest\n}: ParagraphProps) {\n return React.createElement(as, {\n className: clsx('max-w-full text-lg', textColorClassName, className, {\n 'prose prose-light dark:prose-dark': prose,\n }),\n ...rest,\n })\n}\n\nexport { H1, H2, H3, H4, H5, H6, Paragraph }\n","import { Link, type LinkProps } from '@remix-run/react'\nimport { clsx } from 'clsx'\nimport { motion, useReducedMotion, type Variant } from 'framer-motion'\nimport {\n useElementState,\n type ElementState,\n} from './hooks/use-element-state.tsx'\nimport { ArrowIcon } from './icons.tsx'\nimport { H6 } from './typography.tsx'\n\ntype ArrowIconProps = React.ComponentProps<typeof ArrowIcon>\n\nconst arrowVariants: Record<\n ArrowIconProps['direction'],\n Record<ElementState, Variant>\n> = {\n down: {\n initial: { y: 0 },\n hover: { y: 4 },\n focus: {\n y: [0, 4, 0],\n transition: { repeat: Infinity },\n },\n active: { y: 12 },\n },\n up: {\n initial: { y: 0 },\n hover: { y: -4 },\n focus: {\n y: [0, -4, 0],\n transition: { repeat: Infinity },\n },\n active: { y: -12 },\n },\n left: {\n initial: { x: 0 },\n hover: { x: -4 },\n focus: {\n x: [0, -4, 0],\n transition: { repeat: Infinity },\n },\n active: { x: -12 },\n },\n right: {\n initial: { x: 0 },\n hover: { x: 4 },\n focus: {\n x: [0, 4, 0],\n transition: { repeat: Infinity },\n },\n active: { x: 12 },\n },\n 'top-right': {\n initial: { x: 0, y: 0 },\n hover: { x: 4, y: -4 },\n focus: {\n x: [0, 4, 0],\n y: [0, -4, 0],\n transition: { repeat: Infinity },\n },\n active: { x: 12, y: -12 },\n },\n}\n\ntype ArrowButtonBaseProps = {\n direction?: ArrowIconProps['direction']\n children?: React.ReactNode | React.ReactNode[]\n className?: string\n textSize?: 'small' | 'medium'\n}\n\ntype ArrowLinkProps = {\n direction?: ArrowIconProps['direction']\n} & ({ href?: string; to?: never } | { href?: never; to: LinkProps['to'] }) &\n ArrowButtonBaseProps & { prefetch?: 'intent' | 'render' | 'none' }\n\ntype ArrowButtonProps = {\n onClick?: JSX.IntrinsicElements['button']['onClick']\n type?: JSX.IntrinsicElements['button']['type']\n} & ArrowButtonBaseProps\n\n// whileFocus takes precedence over whileTap, so while we can't move the arrow\n// on focus (or on tap), we can still color and animate the circle.\n// See: https://github.com/framer/motion/issues/1221\nfunction getBaseProps({ textSize, className }: ArrowButtonBaseProps) {\n return {\n className: clsx(\n 'text-primary inline-flex items-center text-left font-medium focus:outline-none cursor-pointer transition',\n {\n 'text-xl': textSize === 'medium',\n 'text-lg': textSize === 'small',\n },\n className,\n ),\n }\n}\n\nfunction ArrowButtonContent({\n children,\n direction = 'right',\n}: Pick<ArrowButtonBaseProps, 'children' | 'direction'>) {\n const shouldReduceMotion = useReducedMotion()\n\n return (\n <>\n {children &&\n (direction === 'right' ||\n direction === 'up' ||\n direction === 'top-right') ? (\n <span className=\"text-xl font-medium\">{children}</span>\n ) : null}\n\n <div className=\"relative inline-flex h-14 w-14 flex-none items-center justify-center p-1\">\n <motion.span\n transition={shouldReduceMotion ? { duration: 0 } : {}}\n variants={shouldReduceMotion ? {} : arrowVariants[direction]}\n >\n <ArrowIcon direction={direction} />\n </motion.span>\n </div>\n\n {children && (direction === 'left' || direction === 'down') ? (\n <span className=\"ml-8 text-xl font-medium\">{children}</span>\n ) : null}\n </>\n )\n}\n\nfunction ArrowButton({ onClick, type, ...props }: ArrowButtonProps) {\n const [ref, state] = useElementState()\n const shouldReduceMotion = useReducedMotion()\n\n return (\n <motion.button\n onClick={onClick}\n type={type}\n {...getBaseProps(props)}\n ref={ref}\n animate={state}\n transition={shouldReduceMotion ? { duration: 0 } : {}}\n >\n <ArrowButtonContent {...props} />\n </motion.button>\n )\n}\n\nconst MotionLink = motion(Link)\n\nfunction ArrowLink({ to, href, ...props }: ArrowLinkProps) {\n const [ref, state] = useElementState()\n const shouldReduceMotion = useReducedMotion()\n\n if (href) {\n return (\n <motion.a\n href={href}\n {...getBaseProps(props)}\n ref={ref}\n animate={state}\n transition={shouldReduceMotion ? { duration: 0 } : {}}\n >\n <ArrowButtonContent {...props} />\n </motion.a>\n )\n } else if (to) {\n return (\n <MotionLink\n to={to}\n {...getBaseProps(props)}\n ref={ref}\n animate={state}\n transition={shouldReduceMotion ? { duration: 0 } : {}}\n >\n <ArrowButtonContent {...props} />\n </MotionLink>\n )\n }\n throw new Error('Must provide either to or href to ArrowLink')\n}\n\nfunction BackLink({\n to,\n className,\n children,\n}: { to: LinkProps['to'] } & Pick<ArrowLinkProps, 'className' | 'children'>) {\n const [ref, state] = useElementState()\n const shouldReduceMotion = useReducedMotion()\n return (\n <MotionLink\n to={to}\n className={clsx(\n 'text-primary flex space-x-4 focus:outline-none',\n className,\n )}\n ref={ref}\n animate={state}\n transition={shouldReduceMotion ? { duration: 0 } : {}}\n >\n <motion.span\n variants={shouldReduceMotion ? {} : arrowVariants.left}\n transition={shouldReduceMotion ? { duration: 0 } : {}}\n >\n <ArrowIcon direction=\"left\" />\n </motion.span>\n <H6 as=\"span\">{children}</H6>\n </MotionLink>\n )\n}\n\nexport { ArrowButton, ArrowLink, BackLink }\n","export var ConditionOperators = {\n equal: \"eq\",\n notEqual: \"ne\",\n lessThan: \"lt\",\n greaterThan: \"gt\",\n lessOrEqual: \"lte\",\n greaterOrEqual: \"gte\",\n include: \"in\",\n notInclude: \"nin\",\n};\n","export var STORAGE_TYPES = {\n UPLOAD: 'upload',\n FETCH: 'fetch',\n PRIVATE: 'private',\n AUTHENTICATED: 'authenticated',\n SPRITE: 'sprite',\n FACEBOOK: 'facebook',\n TWITTER: 'twitter',\n YOUTUBE: 'youtube',\n VIMEO: 'vimeo',\n MULTI: 'multi',\n INSTAGRAM: 'instagram',\n HULU: 'hulu',\n ANIMOTO: 'animoto',\n DAILYMOTION: 'dailymotion'\n};\nexport var RESOURCE_TYPES = {\n IMAGE: 'image',\n VIDEO: 'video',\n RAW: 'raw'\n};\nexport var VIDEO_SOURCE_TYPES = {\n WEBM: 'webm',\n MP4: 'mp4',\n OGV: 'ogv',\n FLV: 'flv',\n M3U8: 'm3u8',\n TS: 'ts',\n MOV: 'mov',\n MKV: 'mkv',\n MPD: 'mpd'\n};\nexport var ImageFormats = {\n GIF: \"gif\",\n PNG: \"png\",\n JPG: \"jpg\",\n BMP: \"bmp\",\n ICO: \"ico\",\n PDF: \"pdf\",\n TIFF: \"tiff\",\n EPS: \"eps\",\n JPC: \"jpc\",\n JP2: \"jp2\",\n PSD: \"psd\",\n WEBP: \"webp\",\n ZIP: \"zip\",\n SVG: \"svg\",\n WDP: \"wdp\",\n HDX: \"hpx\",\n DJVU: \"djvu\",\n AI: \"ai\",\n FLIF: \"flif\",\n BPG: \"bpg\",\n MIFF: \"miff\",\n TGA: \"tga\",\n HEIC: \"heic\",\n};\n","export var ValueAssignable = {\n context: \"ctx\",\n structureMetadata: \"md\"\n};\nexport var VariableFormats = {\n integer: 'integer',\n float: 'float'\n};\n","export var SEO_TYPES = {\n \"image/upload\": \"images\",\n \"image/private\": \"private_images\",\n \"image/authenticated\": \"authenticated_images\",\n \"raw/upload\": \"files\",\n \"video/upload\": \"videos\"\n};\nexport var TRANSFORMERS = {\n angle: 'a',\n rotate: 'a',\n background: 'b',\n color: 'co',\n colorSpace: 'cs',\n customFunction: 'fn',\n defaultImage: 'd',\n density: 'dn',\n dpr: 'dpr',\n opacity: 'o',\n format: 'f',\n gravity: 'g',\n overlay: 'l',\n page: 'pg',\n prefix: 'p',\n quality: 'q',\n radius: 'r',\n bitRate: 'br',\n keyframeInterval: 'ki',\n audioCodec: 'ac',\n audioFrequency: 'af',\n delay: 'dl',\n ocr: 'ocr',\n streamingProfile: 'sp',\n transformation: 't',\n underlay: 'u',\n videoCodec: 'vc',\n videoSampling: 'vs',\n zoom: 'z'\n};\n","export var ArithmeticExpression = {\n \"=\": 'eq',\n \"!=\": 'ne',\n \"<\": 'lt',\n \">\": 'gt',\n \"<=\": 'lte',\n \">=\": 'gte',\n \"&&\": 'and',\n \"||\": 'or',\n \"*\": \"mul\",\n \"/\": \"div\",\n \"+\": \"add\",\n \"-\": \"sub\",\n \"^\": \"pow\",\n};\nexport var PredefinedVariables = {\n width: 'w',\n height: 'h',\n x: 'x',\n y: 'y',\n quality: 'q',\n if: 'if',\n aspectRatio: 'ar',\n rotate: 'a',\n opacity: 'o',\n radius: 'r',\n dpr: 'dpr',\n effect: 'e',\n border: 'bo',\n currentPage: 'cp',\n preview: 'preview:duration',\n duration: 'du',\n faceCount: 'fc',\n initialAspectRatio: 'iar',\n initialDuration: 'idu',\n initialHeight: 'ih',\n initialWidth: 'iw',\n pageCount: 'pc',\n pageX: 'px',\n pageY: 'py',\n tags: 'tags',\n};\nexport var Prefix = '$';\nexport var PreDefinedPatterns = \"(\" + Object.keys(PredefinedVariables).join('|') + \")\";\nexport var AcceptNumbericVars = ['quality', 'if', 'rotate', 'zoom', 'opacity', 'radius', 'effect', 'dpr'];\n","export var ConditionalParams = {\n width: 'w',\n initialWidth: 'iw',\n height: 'h',\n initialHeight: 'ih',\n aspectRatio: 'ar',\n intialAspectRatio: 'iar',\n context: 'ctx',\n metadata: 'md',\n tags: 'tags',\n trimmedAspectRatio: 'tar',\n currentPage: 'cp',\n faceCount: 'fc',\n pageCount: 'pc',\n pageXOffset: 'px',\n pageYOffset: 'py',\n initialDensity: 'idn',\n illustration: 'ils',\n pageNames: 'pgnames'\n};\n","export var toString = function (arr, separation) {\n if (separation === void 0) { separation = ':'; }\n return arr.filter(Boolean).join(separation);\n};\nexport var cleanText = function (text) { return encodeURIComponent(text).replace(/%(23|2C|2F|3F|5C)/g, '%25$1'); };\n","import transform, { toTransformationStr } from \".\";\nimport { ConditionOperators } from \"@cld-apis/utils\";\nimport { ConditionalParams } from '../constants/condition';\nimport { toString } from \"../utils\";\nexport var computeCondition = function (conditionObj) {\n var expression = conditionObj.expression ? toString(conditionObj.expression.map(function (exp) { return computeConditionExpression(exp); }), '_and_') : '';\n var transformations = conditionObj.transformations.map(function (transformation) { return toTransformationStr(transform(transformation)); });\n return {\n expression: expression,\n transformations: toString(transformations, '/')\n };\n};\nexport var mapCharacteristic = function (expression) { return ConditionalParams[expression] || expression; };\nexport var computeConditionExpression = function (expression) {\n var characteristic = Array.isArray(expression.characteristic) ? toString(expression.characteristic.map(mapCharacteristic)) : mapCharacteristic(expression.characteristic);\n var operator = ConditionOperators[expression.operator];\n var value = isNaN(expression.value) ? \"!\" + expression.value + \"!\" : expression.value;\n return toString([characteristic, operator, value], '_');\n};\nexport var condition = function (conditionObj) {\n if (!conditionObj || !conditionObj.if || !conditionObj.if.expression)\n return '';\n var ifCondition = computeCondition(conditionObj.if);\n var elseCondition = conditionObj.else ? computeCondition(conditionObj.else) : null;\n var formattedIf = toString([\"if_\" + ifCondition.expression, ifCondition.transformations], '/');\n var formattedElse = elseCondition ? toString(['if_else', elseCondition.transformations], '/') : '';\n return [toString([formattedIf, formattedElse, 'if_end'], '/')];\n};\n","import { toString } from '../utils';\nexport var effect = function (obj) {\n var isString = typeof obj === 'string';\n if (!obj || (!isString && !obj.name))\n return '';\n if (isString || !obj.value)\n return \"e_\" + (obj.name || obj);\n var value = Array.isArray(obj.value) ? obj.value.join(':') : obj.value;\n var effectValue = toString([obj.name, value]);\n return \"e_\" + effectValue;\n};\n","export var Prefix = '$';\nexport var StringBound = '!';\nexport var ValueAssignable = {\n context: \"ctx\",\n structureMetadata: \"md\"\n};\nexport var Formats = {\n integer: 'to_i',\n float: 'to_f'\n};\n","import { ArithmeticExpression, PreDefinedPatterns, PredefinedVariables } from '../constants/arithmetic';\nimport { Prefix } from '../constants/variable';\nvar OPERATORS_REGEX = \"((\\\\|\\\\||>=|<=|&&|!=|>|=|<|/|-|\\\\+|\\\\*|\\\\^)(?=[ _]))\";\nvar mapArithmeticExpression = function (orgExpression) {\n var regex = new RegExp(OPERATORS_REGEX, 'g');\n return orgExpression.replace(regex, function (match) { return ArithmeticExpression[match]; });\n};\nvar mapPredefinedVariables = function (orgExpression) {\n var regex = new RegExp(PreDefinedPatterns, 'g');\n return orgExpression.replace(regex, function (match, p, index) { return orgExpression[index - 1] === Prefix ? match : PredefinedVariables[match]; });\n};\nexport var formatValue = function (value) { return isNaN(value) ? convert(value) : value; };\nexport var convert = function (expression) {\n if (!expression)\n return '';\n var mappedArithmetic = mapArithmeticExpression(expression);\n var converted = mapPredefinedVariables(mappedArithmetic);\n return converted.replace(/[ _]+/g, '_');\n};\nexport var hasArithmeticExpression = function (expression) {\n var regex = new RegExp(OPERATORS_REGEX, 'g');\n return regex.test(expression);\n};\n","export var flags = function (value) {\n if (!value || value.length === 0)\n return '';\n var flagValue = typeof value === 'string' ? value : value.join(':');\n return \"fl_\" + flagValue;\n};\n","export var rawTransformation = function (value) { return value; };\n","import { Formats, Prefix } from \"../constants/variable\";\nimport { ValueAssignable } from '@cld-apis/utils';\nimport { toString } from \"../utils\";\nimport { convert, hasArithmeticExpression } from \"./expression\";\nexport var convertStringValueType = function (value) {\n if (!value || !value.expression)\n return '';\n var expression = Array.isArray(value.expression) ? toString(value.expression) : value.expression;\n var isArithmetic = hasArithmeticExpression(expression);\n var convertedExpression = convert(expression);\n var format = Formats[value.formatAs] || '';\n var mappedExpression = convertedExpression && !isArithmetic ? \"!\" + convertedExpression + \"!\" : convertedExpression;\n return toString([mappedExpression, format], '_');\n};\nexport var computeVariable = function (variable) {\n var name = \"\" + Prefix + variable.name;\n var value = variable.value;\n if (isNaN(variable.value)) {\n if (Array.isArray(variable.value)) {\n value = toString(variable.value);\n }\n else {\n value = convertStringValueType(variable.value);\n }\n }\n var varValue = toString([ValueAssignable[variable.assignFrom], value], ':');\n return varValue ? toString([name, varValue], '_') : '';\n};\nexport var variables = function (value) {\n if (!value)\n return '';\n if (!Array.isArray(value))\n return computeVariable(value);\n return toString(value.map(function (variable) { return computeVariable(variable); }), ',');\n};\n","import { toString } from \"../../utils\";\nexport var fps = function (value) {\n var isObj = typeof value === 'object';\n if (!value || (isObj && !value.min))\n return '';\n var range = isObj ? toString([value.min, value.max], '-') : value;\n return \"fps_\" + range;\n};\n","export var offset = function (obj) {\n if (!obj)\n return '';\n var start = obj.start ? \"so_\" + obj.start : '';\n var end = obj.end ? \"eo_\" + obj.end : '';\n var duration = obj.duration ? \"du_\" + obj.duration : '';\n return [start, end, duration].filter(Boolean).join(',');\n};\n","import { formatValue } from \"./expression\";\nexport var resize = function (_a) {\n var type = _a.type, width = _a.width, height = _a.height, aspectRatio = _a.aspectRatio;\n var w = width ? \"w_\" + formatValue(width) : '';\n var h = height ? \"h_\" + formatValue(height) : '';\n var crop = type ? \"c_\" + type : '';\n var ar = aspectRatio ? \"ar_\" + formatValue(aspectRatio) : '';\n return [crop, w, h, ar].filter(Boolean).join();\n};\n","import { convert } from './expression';\nexport var border = function (_a) {\n var _b = _a.type, type = _b === void 0 ? 'solid' : _b, _c = _a.color, color = _c === void 0 ? 'black' : _c, width = _a.width;\n if (!width)\n return '';\n var formattedValue = isNaN(width) ? convert(width) : width + \"px\";\n return \"bo_\" + formattedValue + \"_\" + type + \"_\" + color;\n};\n","import { formatValue } from './expression';\nexport var position = function (_a) {\n var x = _a.x, y = _a.y;\n var xAxis = x ? \"x_\" + formatValue(x) : '';\n var yAxis = y ? \"y_\" + formatValue(y) : '';\n return [xAxis, yAxis].filter(Boolean).join();\n};\n","import { TRANSFORMERS } from '../constants';\nimport { AcceptNumbericVars } from '../constants/arithmetic';\nimport { condition } from './condition';\nimport { effect } from './effect';\nimport { formatValue } from './expression';\nimport { flags } from './flags';\nimport { rawTransformation } from './rawTransformation';\nimport { variables } from './variables';\nimport { fps } from './video/fps';\nimport { offset } from './video/offset';\nimport { resize } from './resize';\nimport { border } from './border';\nimport { position } from './position';\nexport var getResize = function (options) {\n var hasResize = options.resize || options.width || options.height || options.aspectRatio;\n if (!hasResize)\n return '';\n return resize(options.resize || { width: options.width, height: options.height, type: options.crop, aspectRatio: options.aspectRatio });\n};\nexport var getBorder = function (options) {\n if (!options.border)\n return '';\n var borderModification = (typeof options.border === 'string') ? \"bo_\" + options.border : border(options.border);\n return borderModification;\n};\nexport var getPosition = function (options) {\n if (!options.x && !options.y && !options.position)\n return '';\n return position(options.position || { x: options.x, y: options.y });\n};\nexport var getTransformations = function (options) {\n var result = [];\n result.push(variables(options.variables));\n result.push(getResize(options));\n result.push(getBorder(options));\n result.push(getPosition(options));\n result.push(fps(options.fps));\n result.push(offset(options.offset));\n for (var modifier in options) {\n var value = options[modifier];\n var mapping = TRANSFORMERS[modifier];\n if (!mapping || !value)\n continue;\n var isAcceptedNumberic = AcceptNumbericVars.includes(modifier);\n result.push(mapping + \"_\" + (isAcceptedNumberic ? formatValue(value) : value));\n }\n result.push(effect(options.effect));\n result.push(flags(options.flags));\n result.push(rawTransformation(options.rawTransformation));\n result.push(condition(options.condition));\n return result.filter(Boolean);\n};\nexport var transform = function (options) {\n var transformations = getTransformations(options);\n var chainedTransformations = options.transformation || options.chaining;\n if (chainedTransformations && Array.isArray(chainedTransformations)) {\n chainedTransformations.forEach(function (chained) {\n var chainedTransformation = getTransformations(chained);\n chainedTransformation.length > 0 && transformations.push(chainedTransformation);\n });\n }\n return transformations.filter(Boolean);\n};\nexport var toTransformationStr = function (transformations) { return transformations.reduce(function (str, transformation) {\n var isChained = Array.isArray(transformation);\n var separation = isChained ? '/' : ',';\n return \"\" + str + (str ? separation : '') + transformation.toString();\n}, ''); };\nexport default transform;\n","var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nimport { SEO_TYPES } from \"./constants\";\nimport { RESOURCE_TYPES, STORAGE_TYPES } from '@cld-apis/utils';\nimport { toTransformationStr, transform } from './transformers';\nvar SHARED_CDNS = [\"cloudinary-a.akamaihd.net\", \"res.cloudinary.com\"];\nvar CLOUDINARY_REGEX = /^.+\\.cloudinary\\.com\\/(?:[^\\/]+\\/)(?:(image|video|raw)\\/)?(?:(upload|fetch|private|authenticated|sprite|facebook|twitter|youtube|vimeo)\\/)?(?:(?:[^_/]+_[^,/]+,?)*\\/)?(?:v(\\d+|\\w{1,2})\\/)?([^\\.^\\s]+)(?:\\.(.+))?$/;\nexport var extractPublicId = function (link) {\n if (!link)\n return '';\n var parts = CLOUDINARY_REGEX.exec(link);\n return parts && parts.length > 2 ? parts[parts.length - 2] : link;\n};\nexport var getSignature = function (signature) {\n if (!signature)\n return '';\n var isFormatted = signature.indexOf('s--') === 0 && signature.endsWith('--');\n return isFormatted ? signature : \"s--\" + signature + \"--\";\n};\nvar doesPathNeedVersion = function (publicId) { return !publicId.match(/^v[0-9]+/) && !publicId.match(/^https?:\\//); };\nexport var encodePublicId = function (publicId) { return encodeURIComponent(publicId).replace(/%3A/g, ':').replace(/%2F/g, '/'); };\nexport var getVersion = function (publicId, _a) {\n var _b = _a.forceVersion, forceVersion = _b === void 0 ? false : _b, _c = _a.version, version = _c === void 0 ? 1 : _c;\n var needVersion = doesPathNeedVersion(publicId) && forceVersion;\n return needVersion ? \"v\" + version : '';\n};\nexport var getSubDomain = function (publicId, _a) {\n var _b = _a.cdnSubdomain, cdnSubdomain = _b === void 0 ? false : _b, cname = _a.cname;\n if (!cname)\n return \"res\" + (cdnSubdomain ? \"-\" + publicId : '');\n return cdnSubdomain ? \"a\" + publicId + \".\" : '';\n};\nexport var getPrefix = function (publicId, _a) {\n var cloudName = _a.cloudName, _b = _a.privateCdn, privateCdn = _b === void 0 ? false : _b, _c = _a.cdnSubdomain, cdnSubdomain = _c === void 0 ? false : _c, secureDistribution = _a.secureDistribution, cname = _a.cname, _d = _a.secure, secure = _d === void 0 ? true : _d;\n var hasSecureDistribution = secure && secureDistribution && !SHARED_CDNS.includes(secureDistribution);\n var protocol = \"http\" + (secure ? 's' : '') + \"://\";\n var cdn = privateCdn && !hasSecureDistribution ? cloudName + \"-\" : '';\n var accountPath = privateCdn ? '' : \"/\" + cloudName;\n var subDomain = hasSecureDistribution ? '' : getSubDomain(publicId, { cdnSubdomain: cdnSubdomain, cname: cname });\n var host = hasSecureDistribution ? secureDistribution : (cname || '.cloudinary.com');\n return \"\" + protocol + cdn + subDomain + host + accountPath;\n};\nexport var getResourceType = function (_a) {\n var _b = _a.resourceType, resourceType = _b === void 0 ? RESOURCE_TYPES.IMAGE : _b, _c = _a.storageType, storageType = _c === void 0 ? STORAGE_TYPES.UPLOAD : _c, urlSuffix = _a.urlSuffix, useRootPath = _a.useRootPath, shortern = _a.shortern;\n var isUploadImage = resourceType === RESOURCE_TYPES.IMAGE && storageType === STORAGE_TYPES.UPLOAD;\n var useRootForNonUploadedImages = useRootPath && !isUploadImage;\n var shortenForUploadedImages = shortern && isUploadImage;\n var typePath = resourceType + \"/\" + storageType;\n if (useRootForNonUploadedImages) {\n throw new Error(\"Root path only supported for image/upload\");\n }\n if (useRootPath)\n return \"\" + (shortenForUploadedImages ? 'iu' : '');\n if (urlSuffix) {\n var seo = SEO_TYPES[typePath];\n if (seo) {\n return seo;\n }\n throw new Error(\"URL Suffix only supported for \" + Object.keys(SEO_TYPES).join(', '));\n }\n return typePath;\n};\nvar isUrl = function (str) { return str && !!str.match(/^https?:\\//); };\nexport var getPathToAsset = function (publicId, _a) {\n var _b = _a.urlSuffix, urlSuffix = _b === void 0 ? '' : _b;\n if (isUrl(publicId))\n return encodePublicId(publicId);\n var path = [publicId, urlSuffix].filter(Boolean).join('/');\n return encodePublicId(path);\n};\nexport var url = function (publicId, cloud, options) {\n if (cloud === void 0) { cloud = { cloudName: '' }; }\n if (!cloud.cloudName) {\n throw Error('cloudName is required!');\n }\n var _publicId = isUrl(publicId) ? extractPublicId(publicId) : publicId;\n var version = getVersion(_publicId, cloud);\n var prefix = getPrefix(_publicId, cloud);\n var signature = getSignature(cloud.signature);\n var typePath = getResourceType(cloud);\n var pathToAsset = getPathToAsset(_publicId, { urlSuffix: cloud.urlSuffix });\n var format = options.fetchFormat || options.format || 'auto';\n var $options = __assign(__assign({ quality: 'auto' }, options), { format: format });\n var trans = toTransformationStr(transform($options));\n return [prefix, typePath, signature, trans, version, pathToAsset].filter(Boolean).join('/').replace(' ', '%20');\n};\nexport default url;\n","var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nimport { RESOURCE_TYPES } from '@cld-apis/utils';\nimport { url, extractPublicId } from './url';\nimport { transform, toTransformationStr } from './transformers';\nvar config = {};\nexport var getConfig = function () { return Object.freeze(config); };\nexport var setConfig = function (options) { return config = __assign(__assign({}, config), options); };\nexport var buildUrl = function (publicId, _a) {\n var _b = _a.cloud, cloud = _b === void 0 ? {} : _b, _c = _a.transformations, transformations = _c === void 0 ? {} : _c;\n var cloudConfig = __assign(__assign({}, config), cloud);\n return url(publicId, cloudConfig, transformations);\n};\nexport var buildImageUrl = function (publicId, _a) {\n var _b = _a.cloud, cloud = _b === void 0 ? {} : _b, _c = _a.transformations, transformations = _c === void 0 ? {} : _c;\n return buildUrl(publicId, {\n cloud: __assign(__assign({}, cloud), { resourceType: RESOURCE_TYPES.IMAGE }),\n transformations: transformations\n });\n};\nexport var buildVideoUrl = function (publicId, _a) {\n var _b = _a.cloud, cloud = _b === void 0 ? {} : _b, _c = _a.transformations, transformations = _c === void 0 ? {} : _c;\n return buildUrl(publicId, {\n cloud: __assign(__assign({}, cloud), { resourceType: RESOURCE_TYPES.VIDEO }),\n transformations: transformations\n });\n};\nvar Transformer = { transform: transform, toString: toTransformationStr };\nexport { extractPublicId, Transformer };\nexport default buildUrl;\n","export default () => {\n\t// https://mths.be/emoji\n\treturn /[#*0-9]\\uFE0F?\\u20E3|[\\xA9\\xAE\\u203C\\u2049\\u2122\\u2139\\u2194-\\u2199\\u21A9\\u21AA\\u231A\\u231B\\u2328\\u23CF\\u23ED-\\u23EF\\u23F1\\u23F2\\u23F8-\\u23FA\\u24C2\\u25AA\\u25AB\\u25B6\\u25C0\\u25FB\\u25FC\\u25FE\\u2600-\\u2604\\u260E\\u2611\\u2614\\u2615\\u2618\\u2620\\u2622\\u2623\\u2626\\u262A\\u262E\\u262F\\u2638-\\u263A\\u2640\\u2642\\u2648-\\u2653\\u265F\\u2660\\u2663\\u2665\\u2666\\u2668\\u267B\\u267E\\u267F\\u2692\\u2694-\\u2697\\u2699\\u269B\\u269C\\u26A0\\u26A7\\u26AA\\u26B0\\u26B1\\u26BD\\u26BE\\u26C4\\u26C8\\u26CF\\u26D1\\u26E9\\u26F0-\\u26F5\\u26F7\\u26F8\\u26FA\\u2702\\u2708\\u2709\\u270F\\u2712\\u2714\\u2716\\u271D\\u2721\\u2733\\u2734\\u2744\\u2747\\u2757\\u2763\\u27A1\\u2934\\u2935\\u2B05-\\u2B07\\u2B1B\\u2B1C\\u2B55\\u3030\\u303D\\u3297\\u3299]\\uFE0F?|[\\u261D\\u270C\\u270D](?:\\uFE0F|\\uD83C[\\uDFFB-\\uDFFF])?|[\\u270A\\u270B](?:\\uD83C[\\uDFFB-\\uDFFF])?|[\\u23E9-\\u23EC\\u23F0\\u23F3\\u25FD\\u2693\\u26A1\\u26AB\\u26C5\\u26CE\\u26D4\\u26EA\\u26FD\\u2705\\u2728\\u274C\\u274E\\u2753-\\u2755\\u2795-\\u2797\\u27B0\\u27BF\\u2B50]|\\u26D3\\uFE0F?(?:\\u200D\\uD83D\\uDCA5)?|\\u26F9(?:\\uFE0F|\\uD83C[\\uDFFB-\\uDFFF])?(?:\\u200D[\\u2640\\u2642]\\uFE0F?)?|\\u2764\\uFE0F?(?:\\u200D(?:\\uD83D\\uDD25|\\uD83E\\uDE79))?|\\uD83C(?:[\\uDC04\\uDD70\\uDD71\\uDD7E\\uDD7F\\uDE02\\uDE37\\uDF21\\uDF24-\\uDF2C\\uDF36\\uDF7D\\uDF96\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83D(?:\\uDC66(?:\\u200D\\uD83D\\uDC66)?|\\uDC67(?:\\u200D\\uD83D[\\uDC66\\uDC67])?)|[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uDC66(?:\\u200D\\uD83D\\uDC66)?|\\uDC67(?:\\u200D\\uD83D[\\uDC66\\uDC67])?)|\\uD83E(?:[\\uDDAF\\uDDBC\\uDDBD](?:\\u200D\\u27A1\\uFE0F?)?|[\\uDDB0-\\uDDB3]))|\\uD83C(?:\\uDFFB(?:\\u200D(?:[\\u2695\\u2696\\u2708]\\uFE0F?|\\u2764\\uFE0F?\\u200D\\uD83D(?:\\uDC8B\\u200D\\uD83D)?\\uDC68\\uD83C[\\uDFFB-\\uDFFF]|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E(?:[\\uDDAF\\uDDBC\\uDDBD](?:\\u200D\\u27A1\\uFE0F?)?|[\\uDDB0-\\uDDB3]|\\uDD1D\\u200D\\uD83D\\uDC68\\uD83C[\\uDFFC-\\uDFFF])))?|\\uDFFC(?:\\u200D(?:[\\u2695\\u2696\\u2708]\\uFE0F?|\\u2764\\uFE0F?\\u200D\\uD83D(?:\\uDC8B\\u200D\\uD83D)?\\uDC68\\uD83C[\\uDFFB-\\uDFFF]|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E(?:[\\uDDAF\\uDDBC\\uDDBD](?:\\u200D\\u27A1\\uFE0F?)?|[\\uDDB0-\\uDDB3]|\\uDD1D\\u200D\\uD83D\\uDC68\\uD83C[\\uDFFB\\uDFFD-\\uDFFF])))?|\\uDFFD(?:\\u200D(?:[\\u2695\\u2696\\u2708]\\uFE0F?|\\u2764\\uFE0F?\\u200D\\uD83D(?:\\uDC8B\\u200D\\uD83D)?\\uDC68\\uD83C[\\uDFFB-\\uDFFF]|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E(?:[\\uDDAF\\uDDBC\\uDDBD](?:\\u200D\\u27A1\\uFE0F?)?|[\\uDDB0-\\uDDB3]|\\uDD1D\\u200D\\uD83D\\uDC68\\uD83C[\\uDFFB\\uDFFC\\uDFFE\\uDFFF])))?|\\uDFFE(?:\\u200D(?:[\\u2695\\u2696\\u2708]\\uFE0F?|\\u2764\\uFE0F?\\u200D\\uD83D(?:\\uDC8B\\u200D\\uD83D)?\\uDC68\\uD83C[\\uDFFB-\\uDFFF]|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E(?:[\\uDDAF\\uDDBC\\uDDBD](?:\\u200D\\u27A1\\uFE0F?)?|[\\uDDB0-\\uDDB3]|\\uDD1D\\u200D\\uD83D\\uDC68\\uD83C[\\uDFFB-\\uDFFD\\uDFFF])))?|\\uDFFF(?:\\u200D(?:[\\u2695\\u2696\\u2708]\\uFE0F?|\\u2764\\uFE0F?\\u200D\\uD83D(?:\\uDC8B\\u200D\\uD83D)?\\uDC68\\uD83C[\\uDFFB-\\uDFFF]|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E(?:[\\uDDAF\\uDDBC\\uDDBD](?:\\u200D\\u27A1\\uFE0F?)?|[\\uDDB0-\\uDDB3]|\\uDD1D\\u200D\\uD83D\\uDC68\\uD83C[\\uDFFB-\\uDFFE])))?))?|\\uDC69(?:\\u200D(?:[\\u2695\\u2696\\u2708]\\uFE0F?|\\u2764\\uFE0F?\\u200D\\uD83D(?:\\uDC8B\\u200D\\uD83D)?[\\uDC68\\uDC69]|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D(?:[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uDC66(?:\\u200D\\uD83D\\uDC66)?|\\uDC67(?:\\u200D\\uD83D[\\uDC66\\uDC67])?|\\uDC69\\u200D\\uD83D(?:\\uDC66(?:\\u200D\\uD83D\\uDC66)?|\\uDC67(?:\\u200D\\uD83D[\\uDC66\\uDC67])?))|\\uD83E(?:[\\uDDAF\\uDDBC\\uDDBD](?:\\u200D\\u27A1\\uFE0F?)?|[\\uDDB0-\\uDDB3]))|\\uD83C(?:\\uDFFB(?:\\u200D(?:[\\u2695\\u2696\\u2708]\\uFE0F?|\\u2764\\uFE0F?\\u200D\\uD83D(?:[\\uDC68\\uDC69]|\\uDC8B\\u200D\\uD83D[\\uDC68\\uDC69])\\uD83C[\\uDFFB-\\uDFFF]|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E(?:[\\uDDAF\\uDDBC\\uDDBD](?:\\u200D\\u27A1\\uFE0F?)?|[\\uDDB0-\\uDDB3]|\\uDD1D\\u200D\\uD83D[\\uDC68\\uDC69]\\uD83C[\\uDFFC-\\uDFFF])))?|\\uDFFC(?:\\u200D(?:[\\u2695\\u2696\\u2708]\\uFE0F?|\\u2764\\uFE0F?\\u200D\\uD83D(?:[\\uDC68\\uDC69]|\\uDC8B\\u200D\\uD83D[\\uDC68\\uDC69])\\uD83C[\\uDFFB-\\uDFFF]|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E(?:[\\uDDAF\\uDDBC\\uDDBD](?:\\u200D\\u27A1\\uFE0F?)?|[\\uDDB0-\\uDDB3]|\\uDD1D\\u200D\\uD83D[\\uDC68\\uDC69]\\uD83C[\\uDFFB\\uDFFD-\\uDFFF])))?|\\uDFFD(?:\\u200D(?:[\\u2695\\u2696\\u2708]\\uFE0F?|\\u2764\\uFE0F?\\u200D\\uD83D(?:[\\uDC68\\uDC69]|\\uDC8B\\u200D\\uD83D[\\uDC68\\uDC69])\\uD83C[\\uDFFB-\\uDFFF]|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E(?:[\\uDDAF\\uDDBC\\uDDBD](?:\\u200D\\u27A1\\uFE0F?)?|[\\uDDB0-\\uDDB3]|\\uDD1D\\u200D\\uD83D[\\uDC68\\uDC69]\\uD83C[\\uDFFB\\uDFFC\\uDFFE\\uDFFF])))?|\\uDFFE(?:\\u200D(?:[\\u2695\\u2696\\u2708]\\uFE0F?|\\u2764\\uFE0F?\\u200D\\uD83D(?:[\\uDC68\\uDC69]|\\uDC8B\\u200D\\uD83D[\\uDC68\\uDC69])\\uD83C[\\uDFFB-\\uDFFF]|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E(?:[\\uDDAF\\uDDBC\\uDDBD](?:\\u200D\\u27A1\\uFE0F?)?|[\\uDDB0-\\uDDB3]|\\uDD1D\\u200D\\uD83D[\\uDC68\\uDC69]\\uD83C[\\uDFFB-\\uDFFD\\uDFFF])))?|\\uDFFF(?:\\u200D(?:[\\u2695\\u2696\\u2708]\\uFE0F?|\\u2764\\uFE0F?\\u200D\\uD83D(?:[\\uDC68\\uDC69]|\\uDC8B\\u200D\\uD83D[\\uDC68\\uDC69])\\uD83C[\\uDFFB-\\uDFFF]|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E(?:[\\uDDAF\\uDDBC\\uDDBD](?:\\u200D\\u27A1\\uFE0F?)?|[\\uDDB0-\\uDDB3]|\\uDD1D\\u200D\\uD83D[\\uDC68\\uDC69]\\uD83C[\\uDFFB-\\uDFFE])))?))?|\\uDC6F(?:\\u200D[\\u2640\\u2642]\\uFE0F?)?|\\uDD75(?:\\uFE0F|\\uD83C[\\uDFFB-\\uDFFF])?(?:\\u200D[\\u2640\\u2642]\\uFE0F?)?|\\uDE2E(?:\\u200D\\uD83D\\uDCA8)?|\\uDE35(?:\\u200D\\uD83D\\uDCAB)?|\\uDE36(?:\\u200D\\uD83C\\uDF2B\\uFE0F?)?|\\uDE42(?:\\u200D[\\u2194\\u2195]\\uFE0F?)?|\\uDEB6(?:\\uD83C[\\uDFFB-\\uDFFF])?(?:\\u200D(?:[\\u2640\\u2642]\\uFE0F?(?:\\u200D\\u27A1\\uFE0F?)?|\\u27A1\\uFE0F?))?)|\\uD83E(?:[\\uDD0C\\uDD0F\\uDD18-\\uDD1F\\uDD30-\\uDD34\\uDD36\\uDD77\\uDDB5\\uDDB6\\uDDBB\\uDDD2\\uDDD3\\uDDD5\\uDEC3-\\uDEC5\\uDEF0\\uDEF2-\\uDEF8](?:\\uD83C[\\uDFFB-\\uDFFF])?|[\\uDD26\\uDD35\\uDD37-\\uDD39\\uDD3D\\uDD3E\\uDDB8\\uDDB9\\uDDCD\\uDDCF\\uDDD4\\uDDD6-\\uDDDD](?:\\uD83C[\\uDFFB-\\uDFFF])?(?:\\u200D[\\u2640\\u2642]\\uFE0F?)?|[\\uDDDE\\uDDDF](?:\\u200D[\\u2640\\u2642]\\uFE0F?)?|[\\uDD0D\\uDD0E\\uDD10-\\uDD17\\uDD20-\\uDD25\\uDD27-\\uDD2F\\uDD3A\\uDD3F-\\uDD45\\uDD47-\\uDD76\\uDD78-\\uDDB4\\uDDB7\\uDDBA\\uDDBC-\\uDDCC\\uDDD0\\uDDE0-\\uDDFF\\uDE70-\\uDE7C\\uDE80-\\uDE88\\uDE90-\\uDEBD\\uDEBF-\\uDEC2\\uDECE-\\uDEDB\\uDEE0-\\uDEE8]|\\uDD3C(?:\\u200D[\\u2640\\u2642]\\uFE0F?|\\uD83C[\\uDFFB-\\uDFFF])?|\\uDDCE(?:\\uD83C[\\uDFFB-\\uDFFF])?(?:\\u200D(?:[\\u2640\\u2642]\\uFE0F?(?:\\u200D\\u27A1\\uFE0F?)?|\\u27A1\\uFE0F?))?|\\uDDD1(?:\\u200D(?:[\\u2695\\u2696\\u2708]\\uFE0F?|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF84\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E(?:[\\uDDAF\\uDDBC\\uDDBD](?:\\u200D\\u27A1\\uFE0F?)?|[\\uDDB0-\\uDDB3]|\\uDD1D\\u200D\\uD83E\\uDDD1|\\uDDD1\\u200D\\uD83E\\uDDD2(?:\\u200D\\uD83E\\uDDD2)?|\\uDDD2(?:\\u200D\\uD83E\\uDDD2)?))|\\uD83C(?:\\uDFFB(?:\\u200D(?:[\\u2695\\u2696\\u2708]\\uFE0F?|\\u2764\\uFE0F?\\u200D(?:\\uD83D\\uDC8B\\u200D)?\\uD83E\\uDDD1\\uD83C[\\uDFFC-\\uDFFF]|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF84\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E(?:[\\uDDAF\\uDDBC\\uDDBD](?:\\u200D\\u27A1\\uFE0F?)?|[\\uDDB0-\\uDDB3]|\\uDD1D\\u200D\\uD83E\\uDDD1\\uD83C[\\uDFFB-\\uDFFF])))?|\\uDFFC(?:\\u200D(?:[\\u2695\\u2696\\u2708]\\uFE0F?|\\u2764\\uFE0F?\\u200D(?:\\uD83D\\uDC8B\\u200D)?\\uD83E\\uDDD1\\uD83C[\\uDFFB\\uDFFD-\\uDFFF]|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF84\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E(?:[\\uDDAF\\uDDBC\\uDDBD](?:\\u200D\\u27A1\\uFE0F?)?|[\\uDDB0-\\uDDB3]|\\uDD1D\\u200D\\uD83E\\uDDD1\\uD83C[\\uDFFB-\\uDFFF])))?|\\uDFFD(?:\\u200D(?:[\\u2695\\u2696\\u2708]\\uFE0F?|\\u2764\\uFE0F?\\u200D(?:\\uD83D\\uDC8B\\u200D)?\\uD83E\\uDDD1\\uD83C[\\uDFFB\\uDFFC\\uDFFE\\uDFFF]|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF84\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E(?:[\\uDDAF\\uDDBC\\uDDBD](?:\\u200D\\u27A1\\uFE0F?)?|[\\uDDB0-\\uDDB3]|\\uDD1D\\u200D\\uD83E\\uDDD1\\uD83C[\\uDFFB-\\uDFFF])))?|\\uDFFE(?:\\u200D(?:[\\u2695\\u2696\\u2708]\\uFE0F?|\\u2764\\uFE0F?\\u200D(?:\\uD83D\\uDC8B\\u200D)?\\uD83E\\uDDD1\\uD83C[\\uDFFB-\\uDFFD\\uDFFF]|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF84\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E(?:[\\uDDAF\\uDDBC\\uDDBD](?:\\u200D\\u27A1\\uFE0F?)?|[\\uDDB0-\\uDDB3]|\\uDD1D\\u200D\\uD83E\\uDDD1\\uD83C[\\uDFFB-\\uDFFF])))?|\\uDFFF(?:\\u200D(?:[\\u2695\\u2696\\u2708]\\uFE0F?|\\u2764\\uFE0F?\\u200D(?:\\uD83D\\uDC8B\\u200D)?\\uD83E\\uDDD1\\uD83C[\\uDFFB-\\uDFFE]|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF84\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E(?:[\\uDDAF\\uDDBC\\uDDBD](?:\\u200D\\u27A1\\uFE0F?)?|[\\uDDB0-\\uDDB3]|\\uDD1D\\u200D\\uD83E\\uDDD1\\uD83C[\\uDFFB-\\uDFFF])))?))?|\\uDEF1(?:\\uD83C(?:\\uDFFB(?:\\u200D\\uD83E\\uDEF2\\uD83C[\\uDFFC-\\uDFFF])?|\\uDFFC(?:\\u200D\\uD83E\\uDEF2\\uD83C[\\uDFFB\\uDFFD-\\uDFFF])?|\\uDFFD(?:\\u200D\\uD83E\\uDEF2\\uD83C[\\uDFFB\\uDFFC\\uDFFE\\uDFFF])?|\\uDFFE(?:\\u200D\\uD83E\\uDEF2\\uD83C[\\uDFFB-\\uDFFD\\uDFFF])?|\\uDFFF(?:\\u200D\\uD83E\\uDEF2\\uD83C[\\uDFFB-\\uDFFE])?))?)/g;\n};\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar md5 = function md5(str) {\n /**\n * bitwise left shift or zero fill right shift\n * @param {*} k\n * @param {*} d\n */\n var L = function L(k, d) {\n return k << d | k >>> 32 - d;\n };\n\n var K = function K(G, k) {\n var I = void 0,\n d = void 0,\n F = void 0,\n H = void 0,\n x = void 0;\n\n F = G & 2147483648;\n H = k & 2147483648;\n I = G & 1073741824;\n d = k & 1073741824;\n x = (G & 1073741823) + (k & 1073741823);\n\n if (I & d) return x ^ 2147483648 ^ F ^ H;\n\n if (I | d) {\n if (x & 1073741824) return x ^ 3221225472 ^ F ^ H;else return x ^ 1073741824 ^ F ^ H;\n } else return x ^ F ^ H;\n };\n\n var r = function r(d, F, k) {\n return d & F | ~d & k;\n };\n\n var q = function q(d, F, k) {\n return d & k | F & ~k;\n };\n\n var p = function p(d, F, k) {\n return d ^ F ^ k;\n };\n\n var n = function n(d, F, k) {\n return F ^ (d | ~k);\n };\n\n var u = function u(G, F, aa, Z, k, H, I) {\n G = K(G, K(K(r(F, aa, Z), k), I));\n return K(L(G, H), F);\n };\n\n var f = function f(G, F, aa, Z, k, H, I) {\n G = K(G, K(K(q(F, aa, Z), k), I));\n return K(L(G, H), F);\n };\n\n var D = function D(G, F, aa, Z, k, H, I) {\n G = K(G, K(K(p(F, aa, Z), k), I));\n return K(L(G, H), F);\n };\n\n var t = function t(G, F, aa, Z, k, H, I) {\n G = K(G, K(K(n(F, aa, Z), k), I));\n return K(L(G, H), F);\n };\n\n var e = function e(G) {\n var Z = void 0;\n var F = G.length;\n var x = F + 8;\n var k = (x - x % 64) / 64;\n var I = (k + 1) * 16;\n var aa = Array(I - 1);\n var d = 0;\n var H = 0;\n\n while (H < F) {\n Z = (H - H % 4) / 4;\n d = H % 4 * 8;\n aa[Z] = aa[Z] | G.charCodeAt(H) << d;\n H++;\n }\n\n Z = (H - H % 4) / 4;\n d = H % 4 * 8;\n aa[Z] = aa[Z] | 128 << d;\n aa[I - 2] = F << 3;\n aa[I - 1] = F >>> 29;\n\n return aa;\n };\n\n var B = function B(x) {\n var k = \"\",\n F = \"\",\n G = void 0,\n d = void 0;\n\n for (d = 0; d <= 3; d++) {\n G = x >>> d * 8 & 255;\n F = \"0\" + G.toString(16);\n k = k + F.substr(F.length - 2, 2);\n }\n\n return k;\n };\n\n var J = function J(k) {\n k = k.replace(/rn/g, \"n\");\n var d = \"\";\n for (var F = 0; F < k.length; F++) {\n var x = k.charCodeAt(F);\n if (x < 128) {\n d += String.fromCharCode(x);\n } else {\n if (x > 127 && x < 2048) {\n d += String.fromCharCode(x >> 6 | 192);\n d += String.fromCharCode(x & 63 | 128);\n } else {\n d += String.fromCharCode(x >> 12 | 224);\n d += String.fromCharCode(x >> 6 & 63 | 128);\n d += String.fromCharCode(x & 63 | 128);\n }\n }\n }\n return d;\n };\n\n var C = Array();\n var P = void 0,\n h = void 0,\n E = void 0,\n v = void 0,\n g = void 0,\n Y = void 0,\n X = void 0,\n W = void 0,\n V = void 0;\n var S = 7,\n Q = 12,\n N = 17,\n M = 22;\n var A = 5,\n z = 9,\n y = 14,\n w = 20;\n var o = 4,\n m = 11,\n l = 16,\n j = 23;\n var U = 6,\n T = 10,\n R = 15,\n O = 21;\n\n str = J(str);\n C = e(str);\n Y = 1732584193;\n X = 4023233417;\n W = 2562383102;\n V = 271733878;\n\n for (P = 0; P < C.length; P += 16) {\n h = Y;\n E = X;\n v = W;\n g = V;\n Y = u(Y, X, W, V, C[P + 0], S, 3614090360);\n V = u(V, Y, X, W, C[P + 1], Q, 3905402710);\n W = u(W, V, Y, X, C[P + 2], N, 606105819);\n X = u(X, W, V, Y, C[P + 3], M, 3250441966);\n Y = u(Y, X, W, V, C[P + 4], S, 4118548399);\n V = u(V, Y, X, W, C[P + 5], Q, 1200080426);\n W = u(W, V, Y, X, C[P + 6], N, 2821735955);\n X = u(X, W, V, Y, C[P + 7], M, 4249261313);\n Y = u(Y, X, W, V, C[P + 8], S, 1770035416);\n V = u(V, Y, X, W, C[P + 9], Q, 2336552879);\n W = u(W, V, Y, X, C[P + 10], N, 4294925233);\n X = u(X, W, V, Y, C[P + 11], M, 2304563134);\n Y = u(Y, X, W, V, C[P + 12], S, 1804603682);\n V = u(V, Y, X, W, C[P + 13], Q, 4254626195);\n W = u(W, V, Y, X, C[P + 14], N, 2792965006);\n X = u(X, W, V, Y, C[P + 15], M, 1236535329);\n Y = f(Y, X, W, V, C[P + 1], A, 4129170786);\n V = f(V, Y, X, W, C[P + 6], z, 3225465664);\n W = f(W, V, Y, X, C[P + 11], y, 643717713);\n X = f(X, W, V, Y, C[P + 0], w, 3921069994);\n Y = f(Y, X, W, V, C[P + 5], A, 3593408605);\n V = f(V, Y, X, W, C[P + 10], z, 38016083);\n W = f(W, V, Y, X, C[P + 15], y, 3634488961);\n X = f(X, W, V, Y, C[P + 4], w, 3889429448);\n Y = f(Y, X, W, V, C[P + 9], A, 568446438);\n V = f(V, Y, X, W, C[P + 14], z, 3275163606);\n W = f(W, V, Y, X, C[P + 3], y, 4107603335);\n X = f(X, W, V, Y, C[P + 8], w, 1163531501);\n Y = f(Y, X, W, V, C[P + 13], A, 2850285829);\n V = f(V, Y, X, W, C[P + 2], z, 4243563512);\n W = f(W, V, Y, X, C[P + 7], y, 1735328473);\n X = f(X, W, V, Y, C[P + 12], w, 2368359562);\n Y = D(Y, X, W, V, C[P + 5], o, 4294588738);\n V = D(V, Y, X, W, C[P + 8], m, 2272392833);\n W = D(W, V, Y, X, C[P + 11], l, 1839030562);\n X = D(X, W, V, Y, C[P + 14], j, 4259657740);\n Y = D(Y, X, W, V, C[P + 1], o, 2763975236);\n V = D(V, Y, X, W, C[P + 4], m, 1272893353);\n W = D(W, V, Y, X, C[P + 7], l, 4139469664);\n X = D(X, W, V, Y, C[P + 10], j, 3200236656);\n Y = D(Y, X, W, V, C[P + 13], o, 681279174);\n V = D(V, Y, X, W, C[P + 0], m, 3936430074);\n W = D(W, V, Y, X, C[P + 3], l, 3572445317);\n X = D(X, W, V, Y, C[P + 6], j, 76029189);\n Y = D(Y, X, W, V, C[P + 9], o, 3654602809);\n V = D(V, Y, X, W, C[P + 12], m, 3873151461);\n W = D(W, V, Y, X, C[P + 15], l, 530742520);\n X = D(X, W, V, Y, C[P + 2], j, 3299628645);\n Y = t(Y, X, W, V, C[P + 0], U, 4096336452);\n V = t(V, Y, X, W, C[P + 7], T, 1126891415);\n W = t(W, V, Y, X, C[P + 14], R, 2878612391);\n X = t(X, W, V, Y, C[P + 5], O, 4237533241);\n Y = t(Y, X, W, V, C[P + 12], U, 1700485571);\n V = t(V, Y, X, W, C[P + 3], T, 2399980690);\n W = t(W, V, Y, X, C[P + 10], R, 4293915773);\n X = t(X, W, V, Y, C[P + 1], O, 2240044497);\n Y = t(Y, X, W, V, C[P + 8], U, 1873313359);\n V = t(V, Y, X, W, C[P + 15], T, 4264355552);\n W = t(W, V, Y, X, C[P + 6], R, 2734768916);\n X = t(X, W, V, Y, C[P + 13], O, 1309151649);\n Y = t(Y, X, W, V, C[P + 4], U, 4149444226);\n V = t(V, Y, X, W, C[P + 11], T, 3174756917);\n W = t(W, V, Y, X, C[P + 2], R, 718787259);\n X = t(X, W, V, Y, C[P + 9], O, 3951481745);\n Y = K(Y, h);\n X = K(X, E);\n W = K(W, v);\n V = K(V, g);\n\n var i = B(Y) + B(X) + B(W) + B(V);\n return i.toLowerCase();\n }\n};\n\nexports.default = md5;","import { type HeadersFunction } from '@remix-run/node'\nimport { captureRemixErrorBoundaryError } from '@sentry/remix'\nimport { Link, useRouteError, type LinkProps } from '@remix-run/react'\nimport * as dateFns from 'date-fns'\nimport md5 from 'md5-hash'\nimport * as React from 'react'\nimport { type NonNullProperties, type User } from '~/types.ts'\nimport { type getEnv } from './env.server.ts'\n\nconst defaultAvatarSize = 128\nfunction getAvatar(\n email: string,\n { size = defaultAvatarSize }: { size?: number; origin?: string | null } = {},\n) {\n const hash = md5(email)\n const url = new URL(`https://www.gravatar.com/avatar/${hash}`)\n url.searchParams.set('size', String(size))\n return url.toString()\n}\n\nfunction getAvatarForUser(\n { email, firstName }: Pick<User, 'email' | 'firstName'>,\n { size = defaultAvatarSize, origin }: { size?: number; origin?: string } = {},\n) {\n return {\n src: getAvatar(email, {\n size,\n origin,\n }),\n alt: firstName,\n }\n}\n\nconst useSSRLayoutEffect =\n typeof window === 'undefined' ? () => {} : React.useLayoutEffect\n\ntype AnchorProps = React.DetailedHTMLProps<\n React.AnchorHTMLAttributes<HTMLAnchorElement>,\n HTMLAnchorElement\n>\n\nconst AnchorOrLink = React.forwardRef<\n HTMLAnchorElement,\n AnchorProps & {\n reload?: boolean\n to?: LinkProps['to']\n prefetch?: LinkProps['prefetch']\n }\n>(function AnchorOrLink(props, ref) {\n const {\n to,\n href,\n download,\n reload = false,\n prefetch,\n children,\n ...rest\n } = props\n let toUrl = ''\n let shouldUserRegularAnchor = reload || download\n\n if (!shouldUserRegularAnchor && typeof href === 'string') {\n shouldUserRegularAnchor = href.includes(':') || href.startsWith('#')\n }\n\n if (!shouldUserRegularAnchor && typeof to === 'string') {\n toUrl = to\n shouldUserRegularAnchor = to.includes(':')\n }\n\n if (!shouldUserRegularAnchor && typeof to === 'object') {\n toUrl = `${to.pathname ?? ''}${to.hash ? `#${to.hash}` : ''}${\n to.search ? `?${to.search}` : ''\n }`\n shouldUserRegularAnchor = to.pathname?.includes(':')\n }\n\n if (shouldUserRegularAnchor) {\n return (\n <a {...rest} download={download} href={href ?? toUrl} ref={ref}>\n {children}\n </a>\n )\n } else {\n return (\n <Link prefetch={prefetch} to={to ?? href ?? ''} {...rest} ref={ref}>\n {children}\n </Link>\n )\n }\n})\n\nfunction formatDuration(seconds: number) {\n const mins = Math.floor(seconds / 60)\n .toString()\n .padStart(2, '0')\n const secs = (seconds % 60).toFixed().toString().padStart(2, '0')\n return `${mins}:${secs}`\n}\n\nconst formatNumber = (num: number) => new Intl.NumberFormat().format(num)\n\nfunction formatAbbreviatedNumber(num: number) {\n return num < 1_000\n ? formatNumber(num)\n : num < 1_000_000\n ? `${formatNumber(Number((num / 1_000).toFixed(2)))}k`\n : num < 1_000_000_000\n ? `${formatNumber(Number((num / 1_000_000).toFixed(2)))}m`\n : num < 1_000_000_000_000\n ? `${formatNumber(Number((num / 1_000_000_000).toFixed(2)))}b`\n : 'a lot'\n}\n\nfunction formatDate(dateString: string | Date, format = 'PPP') {\n if (typeof dateString !== 'string') {\n dateString = dateString.toISOString()\n }\n return dateFns.format(parseDate(dateString), format)\n}\n\nfunction parseDate(dateString: string) {\n return dateFns.add(dateFns.parseISO(dateString), {\n minutes: new Date().getTimezoneOffset(),\n })\n}\n\nfunction getErrorMessage(error: unknown, fallback: string = 'Unknown Error') {\n if (typeof error === 'string') return error\n if (error instanceof Error) return error.message\n return fallback\n}\n\nfunction getErrorStack(error: unknown, fallback: string = 'Unknown Error') {\n if (typeof error === 'string') return error\n if (error instanceof Error) return error.stack\n return fallback\n}\n\nfunction getNonNull<Type extends Record<string, null | undefined | unknown>>(\n obj: Type,\n): NonNullProperties<Type> {\n for (const [key, val] of Object.entries(obj)) {\n assertNonNull(val, `The value of ${key} is null but it should not be.`)\n }\n return obj as NonNullProperties<Type>\n}\n\nfunction typedBoolean<T>(\n value: T,\n): value is Exclude<T, '' | 0 | false | null | undefined> {\n return Boolean(value)\n}\n\nfunction assertNonNull<PossibleNullType>(\n possibleNull: PossibleNullType,\n errorMessage: string,\n): asserts possibleNull is Exclude<PossibleNullType, null | undefined> {\n if (possibleNull == null) throw new Error(errorMessage)\n}\n\nfunction getRequiredEnvVarFromObj(\n obj: Record<string, string | undefined>,\n key: string,\n devValue: string = `${key}-dev-value`,\n) {\n let value = devValue\n const envVal = obj[key]\n if (envVal) {\n value = envVal\n } else if (obj.NODE_ENV === 'production') {\n throw new Error(`${key} is a required env variable`)\n }\n return value\n}\n\nfunction getRequiredServerEnvVar(key: string, devValue?: string) {\n return getRequiredEnvVarFromObj(process.env, key, devValue)\n}\n\nfunction getRequiredGlobalEnvVar(\n key: keyof ReturnType<typeof getEnv>,\n devValue?: string,\n) {\n return getRequiredEnvVarFromObj(ENV, key, devValue)\n}\n\nfunction getDomainUrl(request: Request) {\n const host =\n request.headers.get('X-Forwarded-Host') ?? request.headers.get('host')\n if (!host) {\n throw new Error('Could not determine domain URL.')\n }\n const protocol = host.includes('localhost') ? 'http' : 'https'\n return `${protocol}://${host}`\n}\n\nexport function isResponse(response: unknown): response is Response {\n return (\n typeof response === 'object' &&\n response !== null &&\n 'status' in response &&\n 'headers' in response &&\n 'body' in response\n )\n}\n\nfunction removeTrailingSlash(s: string) {\n return s.endsWith('/') ? s.slice(0, -1) : s\n}\n\nfunction getDisplayUrl(requestInfo?: { origin: string; path: string }) {\n return getUrl(requestInfo).replace(/^https?:\\/\\//, '')\n}\n\nfunction getOrigin(requestInfo?: { origin?: string; path: string }) {\n return requestInfo?.origin ?? 'https://vinhnguyen.xyz'\n}\n\nfunction getUrl(requestInfo?: { origin: string; path: string }) {\n return removeTrailingSlash(\n `${getOrigin(requestInfo)}${requestInfo?.path ?? ''}`,\n )\n}\n\nfunction toBase64(string: string) {\n if (typeof window === 'undefined') {\n return Buffer.from(string).toString('base64')\n } else {\n return window.btoa(string)\n }\n}\n\nfunction useUpdateQueryStringValueWithoutNavigation(\n queryKey: string,\n queryValue: string,\n) {\n React.useEffect(() => {\n const currentSearchParams = new URLSearchParams(window.location.search)\n const oldQuery = currentSearchParams.get(queryKey) ?? ''\n if (queryValue === oldQuery) return\n\n if (queryValue) {\n currentSearchParams.set(queryKey, queryValue)\n } else {\n currentSearchParams.delete(queryKey)\n }\n const newUrl = [window.location.pathname, currentSearchParams.toString()]\n .filter(Boolean)\n .join('?')\n // alright, let's talk about this...\n // Normally with remix, you'd update the params via useSearchParams from react-router-dom\n // and updating the search params will trigger the search to update for you.\n // However, it also triggers a navigation to the new url, which will trigger\n // the loader to run which we do not want because all our data is already\n // on the client and we're just doing client-side filtering of data we\n // already have. So we manually call `window.history.pushState` to avoid\n // the router from triggering the loader.\n window.history.replaceState(null, '', newUrl)\n }, [queryKey, queryValue])\n}\n\nfunction debounce<Callback extends (...args: Parameters<Callback>) => void>(\n fn: Callback,\n delay: number,\n) {\n let timer: ReturnType<typeof setTimeout> | null = null\n return (...args: Parameters<Callback>) => {\n if (timer) clearTimeout(timer)\n timer = setTimeout(() => {\n fn(...args)\n }, delay)\n }\n}\n\nfunction useDebounce<\n Callback extends (...args: Parameters<Callback>) => ReturnType<Callback>,\n>(callback: Callback, delay: number) {\n const callbackRef = React.useRef(callback)\n React.useEffect(() => {\n callbackRef.current = callback\n })\n return React.useMemo(\n () =>\n debounce(\n (...args: Parameters<Callback>) => callbackRef.current(...args),\n delay,\n ),\n [delay],\n )\n}\n\nconst reuseUsefulLoaderHeaders: HeadersFunction = ({\n loaderHeaders,\n parentHeaders,\n}) => {\n const headers = new Headers()\n const usefulHeaders = ['Cache-Control', 'Vary', 'Server-Timing']\n for (const headerName of usefulHeaders) {\n if (loaderHeaders.has(headerName)) {\n headers.set(headerName, loaderHeaders.get(headerName)!)\n }\n }\n const appendHeaders = ['Server-Timing']\n for (const headerName of appendHeaders) {\n if (parentHeaders.has(headerName)) {\n headers.append(headerName, parentHeaders.get(headerName)!)\n }\n }\n const useIfNotExistsHeaders = ['Cache-Control', 'Vary']\n for (const headerName of useIfNotExistsHeaders) {\n if (!headers.has(headerName) && parentHeaders.has(headerName)) {\n headers.set(headerName, parentHeaders.get(headerName)!)\n }\n }\n\n return headers\n}\n\nfunction callAll<Args extends Array<unknown>>(\n ...fns: Array<((...args: Args) => unknown) | undefined>\n) {\n return (...args: Args) => fns.forEach(fn => fn?.(...args))\n}\n\nfunction useDoubleCheck() {\n const [doubleCheck, setDoubleCheck] = React.useState(false)\n\n function getButtonProps(props?: JSX.IntrinsicElements['button']) {\n const onBlur: JSX.IntrinsicElements['button']['onBlur'] = () =>\n setDoubleCheck(false)\n\n const onClick: JSX.IntrinsicElements['button']['onClick'] = doubleCheck\n ? undefined\n : e => {\n e.preventDefault()\n setDoubleCheck(true)\n }\n\n return {\n ...props,\n onBlur: callAll(onBlur, props?.onBlur),\n onClick: callAll(onClick, props?.onClick),\n }\n }\n\n return { doubleCheck, getButtonProps }\n}\n\n/**\n * Provide a condition and if that condition is falsey, this throws an error\n * with the given message.\n *\n * inspired by invariant from 'tiny-invariant' except will still include the\n * message in production.\n *\n * @example\n * invariant(typeof value === 'string', `value must be a string`)\n *\n * @param condition The condition to check\n * @param message The message to throw (or a callback to generate the message)\n * @param responseInit Additional response init options if a response is thrown\n *\n * @throws {Error} if condition is falsey\n */\nexport function invariant(\n condition: any,\n message: string | (() => string),\n): asserts condition {\n if (!condition) {\n throw new Error(typeof message === 'function' ? message() : message)\n }\n}\n\n/**\n * Provide a condition and if that condition is falsey, this throws a 400\n * Response with the given message.\n *\n * inspired by invariant from 'tiny-invariant'\n *\n * @example\n * invariantResponse(typeof value === 'string', `value must be a string`)\n *\n * @param condition The condition to check\n * @param message The message to throw (or a callback to generate the message)\n * @param responseInit Additional response init options if a response is thrown\n *\n * @throws {Response} if condition is falsey\n */\nexport function invariantResponse(\n condition: any,\n message: string | (() => string),\n responseInit?: ResponseInit,\n): asserts condition {\n if (!condition) {\n throw new Response(typeof message === 'function' ? message() : message, {\n status: 400,\n ...responseInit,\n })\n }\n}\n\nexport function useCapturedRouteError() {\n const error = useRouteError()\n captureRemixErrorBoundaryError(error)\n return error\n}\n\nexport function requireValidSlug(slug: unknown): asserts slug is string {\n if (typeof slug !== 'string' || !/^[a-zA-Z0-9-_.]+$/.test(slug)) {\n throw new Response(`This is not a valid slug: \"${slug}\"`, { status: 400 })\n }\n}\n\nexport { listify } from './listify.ts'\nexport {\n getAvatar,\n getAvatarForUser,\n AnchorOrLink,\n getErrorMessage,\n getErrorStack,\n getNonNull,\n assertNonNull,\n useUpdateQueryStringValueWithoutNavigation,\n useSSRLayoutEffect,\n useDoubleCheck,\n useDebounce,\n typedBoolean,\n getRequiredServerEnvVar,\n getRequiredGlobalEnvVar,\n getDomainUrl,\n getUrl,\n getDisplayUrl,\n getOrigin,\n toBase64,\n removeTrailingSlash,\n reuseUsefulLoaderHeaders,\n parseDate,\n formatDate,\n formatDuration,\n formatNumber,\n formatAbbreviatedNumber,\n}\n","/**\n *\n * @private\n * @param {any} a\n */\nfunction isObject(a) {\n if (typeof a !== 'object' || a instanceof Array) {\n return false;\n }\n else {\n return true;\n }\n}\nclass Config {\n filterOutNonSupportedKeys(userProvidedConfig, validKeys) {\n const obj = Object.create({});\n if (isObject(userProvidedConfig)) {\n Object.keys(userProvidedConfig).forEach((key) => {\n if (validKeys.indexOf(key) >= 0) {\n obj[key] = userProvidedConfig[key];\n }\n else {\n console.warn('Warning - unsupported key provided to configuration: ', key);\n }\n });\n return obj;\n }\n else {\n return Object.create({});\n }\n }\n}\nexport default Config;\n","/**\n * This file is for internal constants only.\n * It is not intended for public use and is not part of the public API\n */\n/**\n * @private\n */\nexport const ALLOWED_URL_CONFIG = [\n 'cname',\n 'secureDistribution',\n 'privateCdn',\n 'signUrl',\n 'longUrlSignature',\n 'shorten',\n 'useRootPath',\n 'secure',\n 'forceVersion',\n 'analytics',\n 'queryParams'\n];\n/**\n * @private\n */\nexport const ALLOWED_CLOUD_CONFIG = [\n 'cloudName',\n 'apiKey',\n 'apiSecret',\n 'authToken'\n];\n","import Config from \"./BaseConfig.js\";\nimport { ALLOWED_URL_CONFIG } from \"../internal/internalConstants.js\";\nclass URLConfig extends Config {\n /**\n * @param {IURLConfig} userURLConfig\n */\n constructor(userURLConfig) {\n super();\n const urlConfig = this.filterOutNonSupportedKeys(userURLConfig, ALLOWED_URL_CONFIG);\n Object.assign(this, {\n secure: true\n }, urlConfig);\n }\n extend(userURLConfig) {\n const urlConfig = this.filterOutNonSupportedKeys(userURLConfig, ALLOWED_URL_CONFIG);\n return new URLConfig(Object.assign({}, this, urlConfig));\n }\n /**\n * @param {string} value Sets the cname\n */\n setCname(value) {\n this.cname = value;\n return this;\n }\n /**\n * @param {string} value Sets the secureDistribution\n */\n setSecureDistribution(value) {\n this.secureDistribution = value;\n return this;\n }\n /**\n * @param {boolean} value Sets whether to use a private CDN (Removes cloudName from URL)\n */\n setPrivateCdn(value) {\n this.privateCdn = value;\n return this;\n }\n /**\n * @param value Sets whether or not to sign the URL\n */\n setSignUrl(value) {\n this.signUrl = value;\n return this;\n }\n /**\n * @param value Sets whether or not to use a long signature\n */\n setLongUrlSignature(value) {\n this.longUrlSignature = value;\n return this;\n }\n /**\n * @param value Sets whether or not to shorten the URL\n */\n setShorten(value) {\n this.shorten = value;\n return this;\n }\n /**\n * @param value Sets whether or not to use a root path\n */\n setUseRootPath(value) {\n this.useRootPath = value;\n return this;\n }\n /**\n * @param value Sets whether or not to deliver the asset through https\n */\n setSecure(value) {\n this.secure = value;\n return this;\n }\n /**\n * @param value Sets whether to force a version in the URL\n */\n setForceVersion(value) {\n this.forceVersion = value;\n return this;\n }\n /**\n * @param params Sets additional params\n */\n setQueryParams(params) {\n this.queryParams = params;\n return this;\n }\n}\nexport default URLConfig;\n","/**\n * @summary SDK\n * @memberOf SDK\n */\nclass QualifierValue {\n /**\n *\n * @param {QualifierValue | QualifierValue[] | any[] | string | number}qualifierValue\n */\n constructor(qualifierValue) {\n this.values = [];\n this.delimiter = ':'; // {value}{delimiter}{value}...\n if (this.hasValue(qualifierValue)) {\n this.addValue(qualifierValue);\n }\n }\n /**\n * @description Joins the provided values with the provided delimiter\n */\n toString() {\n return this.values.join(this.delimiter);\n }\n /**\n * @description Checks if the provided argument has a value\n * @param {any} v\n * @private\n * @return {boolean}\n */\n hasValue(v) {\n return typeof v !== 'undefined' && v !== null && v !== '';\n }\n /**\n * @desc Adds a value for the this qualifier instance\n * @param {any} value\n * @return {this}\n */\n addValue(value) {\n // Append value or array of values\n if (Array.isArray(value)) {\n this.values = this.values.concat(value);\n }\n else {\n this.values.push(value);\n }\n // Remove falsy values\n this.values = this.values.filter((v) => this.hasValue(v));\n return this;\n }\n /**\n * @description Sets the delimiter for this instance\n * @param delimiter\n */\n setDelimiter(delimiter) {\n this.delimiter = delimiter;\n return this;\n }\n}\nexport { QualifierValue };\n","class UnsupportedError extends Error {\n constructor(message = 'Unsupported') {\n super(message);\n }\n}\n/**\n * Creates a new UnsupportedError\n * @param message\n */\nfunction createUnsupportedError(message) {\n return new UnsupportedError(message);\n}\nexport { UnsupportedError, createUnsupportedError };\n","import { createUnsupportedError } from \"../utils/unsupportedError.js\";\n/**\n * Returns the action's model\n */\nexport function qualifierToJson() {\n return this._qualifierModel || { error: createUnsupportedError(`unsupported qualifier ${this.constructor.name}`) };\n}\n","import { qualifierToJson } from \"./qualifierToJson.js\";\nexport class QualifierModel {\n constructor() {\n this._qualifierModel = {};\n }\n toJson() {\n return qualifierToJson.apply(this);\n }\n}\n","import { QualifierValue } from './QualifierValue.js';\nimport { QualifierModel } from '../models/QualifierModel.js';\n/**\n * @summary SDK\n * @memberOf SDK\n */\nclass Qualifier extends QualifierModel {\n constructor(key, qualifierValue) {\n super();\n this.delimiter = '_'; // {key}{delimiter}{qualifierValue}\n this.key = key;\n if (qualifierValue instanceof QualifierValue) {\n this.qualifierValue = qualifierValue;\n }\n else {\n this.qualifierValue = new QualifierValue();\n this.qualifierValue.addValue(qualifierValue);\n }\n }\n toString() {\n const { key, delimiter, qualifierValue } = this;\n return `${key}${delimiter}${qualifierValue.toString()}`;\n }\n addValue(value) {\n this.qualifierValue.addValue(value);\n return this;\n }\n}\nexport { Qualifier };\n","import { QualifierValue } from \"../../internal/qualifier/QualifierValue.js\";\nimport { Qualifier } from \"../../internal/qualifier/Qualifier.js\";\n/**\n * @memberOf Qualifiers.Flag\n * @extends {SDK.Qualifier}\n * @description the FlagQualifier class\n */\nclass FlagQualifier extends Qualifier {\n constructor(flagType, flagValue) {\n let qualifierValue;\n if (flagValue) {\n qualifierValue = new QualifierValue([flagType, `${flagValue}`]).setDelimiter(':');\n }\n else {\n qualifierValue = flagType;\n }\n super('fl', qualifierValue);\n this.flagValue = flagValue;\n }\n toString() {\n return super.toString().replace(/\\./g, '%2E');\n }\n getFlagValue() {\n return this.flagValue;\n }\n}\nexport { FlagQualifier };\n","/**\n * Sort a map by key\n * @private\n * @param map <string, any>\n * @Return array of map's values sorted by key\n */\nfunction mapToSortedArray(map, flags) {\n const array = Array.from(map.entries());\n // objects from the Array.from() method above are stored in array of arrays:\n // [[qualifierKey, QualifierObj], [qualifierKey, QualifierObj]]\n // Flags is an array of FlagQualifierObj\n // We need to convert it to the same form: [flagQualifier] => ['fl', flagQualifier]\n flags.forEach((flag) => {\n array.push(['fl', flag]); // push ['fl', flagQualifier]\n });\n return array.sort().map((v) => v[1]);\n}\n/**\n * Checks if `value` is a string.\n * @private\n * @param {*} value The value to check.\n * @return {boolean} `true` if `value` is a string, else `false`.\n */\nfunction isString(value) {\n return (typeof value === 'string' || value instanceof String);\n}\nexport { isString, mapToSortedArray };\n","import { createUnsupportedError } from \"../utils/unsupportedError.js\";\n/**\n * Returns the action's model\n */\nexport function actionToJson() {\n var _a, _b, _c;\n const actionModelIsNotEmpty = this._actionModel && Object.keys(this._actionModel).length;\n const sourceTransformationError = (_c = (_b = (_a = this._actionModel) === null || _a === void 0 ? void 0 : _a.source) === null || _b === void 0 ? void 0 : _b.transformation) === null || _c === void 0 ? void 0 : _c.error;\n // Should return error when there is unsupported transformation inside\n if (sourceTransformationError && sourceTransformationError instanceof Error) {\n return { error: sourceTransformationError };\n }\n if (actionModelIsNotEmpty) {\n return this._actionModel;\n }\n return { error: createUnsupportedError(`unsupported action ${this.constructor.name}`) };\n}\n","import { actionToJson } from \"./actionToJson.js\";\nexport class ActionModel {\n constructor() {\n this._actionModel = {};\n }\n toJson() {\n return actionToJson.apply(this);\n }\n}\n","import { FlagQualifier } from \"../qualifiers/flag/FlagQualifier.js\";\nimport { Qualifier } from \"./qualifier/Qualifier.js\";\nimport { mapToSortedArray } from \"./utils/dataStructureUtils.js\";\nimport { ActionModel } from \"./models/ActionModel.js\";\n/**\n * @summary SDK\n * @memberOf SDK\n * @description Defines the category of transformation to perform.\n */\nclass Action extends ActionModel {\n constructor() {\n super(...arguments);\n // We're using map, to overwrite existing keys. for example:\n // addParam(w_100).addQualifier(w_200) should result in w_200. and not w_100,w_200\n this.qualifiers = new Map();\n // Unlike regular qualifiers, there can be multiple flags in each url component /fl_1,fl_2/\n // If the falgs are added to the qualifiers map, only a single flag could exist in a component (it's a map)\n // So flags are stored separately until the very end because of that reason\n this.flags = [];\n this.delimiter = ','; // {qualifier}{delimiter}{qualifier} for example: `${'w_100'}${','}${'c_fill'}`\n this.actionTag = ''; // A custom name tag to identify this action in the future\n }\n prepareQualifiers() { }\n /**\n * @description Returns the custom name tag that was given to this action\n * @return {string}\n */\n getActionTag() {\n return this.actionTag;\n }\n /**\n * @description Sets the custom name tag for this action\n * @return {this}\n */\n setActionTag(tag) {\n this.actionTag = tag;\n return this;\n }\n /**\n * @description Calls toString() on all child qualifiers (implicitly by using .join()).\n * @return {string}\n */\n toString() {\n this.prepareQualifiers();\n return mapToSortedArray(this.qualifiers, this.flags).join(this.delimiter);\n }\n /**\n * @description Adds the parameter to the action.\n * @param {SDK.Qualifier} qualifier\n * @return {this}\n */\n addQualifier(qualifier) {\n // if string, find the key and value\n if (typeof qualifier === 'string') {\n const [key, value] = qualifier.toLowerCase().split('_');\n if (key === 'fl') {\n // if string qualifier is a flag, store it in the flags arrays\n this.flags.push(new FlagQualifier(value));\n }\n else {\n // if the string qualifier is not a flag, create a new qualifier from it\n this.qualifiers.set(key, new Qualifier(key, value));\n }\n }\n else {\n // if a qualifier object, insert to the qualifiers map\n this.qualifiers.set(qualifier.key, qualifier);\n }\n return this;\n }\n /**\n * @description Adds a flag to the current action.\n * @param {Qualifiers.Flag} flag\n * @return {this}\n */\n addFlag(flag) {\n if (typeof flag === 'string') {\n this.flags.push(new FlagQualifier(flag));\n }\n else {\n if (flag instanceof FlagQualifier) {\n this.flags.push(flag);\n }\n }\n return this;\n }\n addValueToQualifier(qualifierKey, qualifierValue) {\n this.qualifiers.get(qualifierKey).addValue(qualifierValue);\n return this;\n }\n}\nexport { Action };\n","/**\n * Returns RGB or Color\n * @private\n * @param color\n */\nexport function prepareColor(color) {\n if (color) {\n return color.match(/^#/) ? `rgb:${color.substr(1)}` : color;\n }\n else {\n return color;\n }\n}\n","import { Action } from \"../../../internal/Action.js\";\nimport { QualifierValue } from \"../../../internal/qualifier/QualifierValue.js\";\nimport { Qualifier } from \"../../../internal/qualifier/Qualifier.js\";\nimport { prepareColor } from \"../../../internal/utils/prepareColor.js\";\n/**\n * @extends SDK.Action\n * @description A class for background transformations.\n */\nclass BackgroundColor extends Action {\n constructor(color) {\n super();\n this._actionModel = {};\n this.addQualifier(new Qualifier('b', new QualifierValue(prepareColor(color)).setDelimiter('_')));\n this._actionModel.color = color;\n this._actionModel.actionType = 'backgroundColor';\n }\n static fromJson(actionModel) {\n const { color } = actionModel;\n // We are using this() to allow inheriting classes to use super.fromJson.apply(this, [actionModel])\n // This allows the inheriting classes to determine the class to be created\n const result = new this(color);\n return result;\n }\n}\nexport { BackgroundColor };\n","import { createUnsupportedError } from \"./utils/unsupportedError.js\";\n/**\n * @summary SDK\n * @memberOf SDK\n * @description Defines an action that's a string literal, no validations or manipulations are performed\n */\nclass RawAction {\n constructor(raw) {\n this.raw = raw;\n }\n toString() {\n return this.raw;\n }\n toJson() {\n return { error: createUnsupportedError(`unsupported action ${this.constructor.name}`) };\n }\n}\nexport { RawAction };\n","/**\n * Validates obj is an instance of IErrorObject\n * @param obj\n */\nfunction isErrorObject(obj) {\n const errorObj = obj;\n return ('error' in errorObj) && !!errorObj.error;\n}\nexport { isErrorObject };\n","/**\n * @description Defines flags that you can use to alter the default transformation behavior.\n * @namespace Flag\n * @memberOf Qualifiers\n */\nimport { FlagQualifier } from \"./flag/FlagQualifier.js\";\n/**\n * @summary qualifier\n * @memberOf Qualifiers.Flag\n * @description Used when delivering a video file as an image format that supports animation, such as animated WebP.\n * Plays all frames rather than just delivering the first one as a static image.\n * Use this flag in addition to the flag or parameter controlling the delivery format,\n * for example f_auto or fl_awebp.\n\n * Note: When delivering a video in GIF format, it is delivered as an animated GIF by default and this flag is not\n * necessary. To deliver a single frame of a video in GIF format, use the page parameter.\n * @return {Qualifiers.Flag.FlagQualifier}\n */\nfunction animated() {\n return new FlagQualifier('animated');\n}\n/**\n * @summary qualifier\n * @memberOf Qualifiers.Flag\n * @description When converting animated images to WebP format, generate an animated WebP from all the frames in the\n * original\n * animated file instead of only from the first still frame.\n *\n * Note that animated WebPs are not supported in all browsers and versions.\n * @return {Qualifiers.Flag.FlagQualifier}\n */\nfunction animatedWebP() {\n return new FlagQualifier('awebp');\n}\n/**\n * @summary qualifier\n * @memberOf Qualifiers.Flag\n * @description When used together with automatic quality (q_auto):\n * allow switching to PNG8 encoding if the quality algorithm decides that it's more efficient.\n * @return {Qualifiers.Flag.FlagQualifier}\n */\nfunction anyFormat() {\n return new FlagQualifier('any_format');\n}\n/**\n * @summary qualifier\n * @memberOf Qualifiers.Flag\n * @description When converting animated images to PNG format, generates an animated PNG from all the frames in the\n * original\n * animated file instead of only from the first still frame.\n *\n * Note that animated PNGs are not supported in all browsers and versions.\n * @return {Qualifiers.Flag.FlagQualifier}\n */\nfunction animatedPng() {\n return new FlagQualifier('apng');\n}\n/**\n * @summary qualifier\n * @memberOf Qualifiers.Flag\n * @description Trims pixels according to a clipping path included in the original image\n * (e.g., manually created using PhotoShop).\n * @return {Qualifiers.Flag.FlagQualifier}\n */\nfunction clip() {\n return new FlagQualifier('clip');\n}\n/**\n * @summary qualifier\n * @memberOf Qualifiers.Flag\n * @description Trims pixels according to a clipping path included in the original image (e.g., manually created\n * using PhotoShop)\n * using an evenodd clipping rule.\n * @return {Qualifiers.Flag.FlagQualifier}\n */\nfunction clipEvenOdd() {\n return new FlagQualifier('clip_evenodd');\n}\n/**\n * @summary qualifier\n * @memberOf Qualifiers.Flag\n * @description Instructs Cloudinary to clear all image meta-data (IPTC, Exif and XMP) while applying an incoming\n * transformation.\n * @return {Qualifiers.Flag.FlagQualifier}\n */\nfunction forceStrip() {\n return new FlagQualifier('force_strip');\n}\n/**\n * @summary qualifier\n * @memberOf Qualifiers.Flag\n * @description Allows custom flag\n * @return {Qualifiers.Flag.FlagQualifier}\n */\nfunction custom(value) {\n return new FlagQualifier(value);\n}\n/**\n * @summary qualifier\n * @memberOf Qualifiers.Flag\n * @description Adds ICC color space metadata to the image, even when the original image doesn't contain any ICC data.\n * @return {Qualifiers.Flag.FlagQualifier}\n */\nfunction forceIcc() {\n return new FlagQualifier('force_icc');\n}\n/**\n * @summary qualifier\n * @memberOf Qualifiers.Flag\n * @description Delivers the image as an attachment.\n * @param {string} filename The attachment's filename\n * @return {Qualifiers.Flag.FlagQualifier}\n */\nfunction attachment(filename) {\n return new FlagQualifier('attachment', filename);\n}\n/**\n * @summary qualifier\n * @memberOf Qualifiers.Flag\n * @description Returns metadata of the input asset and of the transformed output asset in JSON instead of the\n * transformed image.\n * @return {Qualifiers.Flag.FlagQualifier}\n */\nfunction getInfo() {\n return new FlagQualifier('getinfo');\n}\n/**\n * @summary qualifier\n * @memberOf Qualifiers.Flag\n * @description Deliver an HLS adaptive bitrate streaming file as HLS v3 instead of the default version (HLS v4).\n * Delivering in this format requires a private CDN configuration.\n * @return {Qualifiers.Flag.FlagQualifier}\n */\nfunction hlsv3() {\n return new FlagQualifier('hlsv3');\n}\n/**\n * @summary qualifier\n * @memberOf Qualifiers.Flag\n * @description Sets the cache-control to immutable for the asset.\n * @return {Qualifiers.Flag.FlagQualifier}\n */\nfunction immutableCache() {\n return new FlagQualifier('immutable_cache');\n}\n/**\n * @summary qualifier\n * @memberOf Qualifiers.Flag\n * @description * Allows specifying only either width or height so the value of the second axis remains as is, and is not\n * recalculated to maintain the aspect ratio of the original image.\n * @return {Qualifiers.Flag.FlagQualifier}\n */\nfunction ignoreInitialAspectRatio() {\n return new FlagQualifier('ignore_aspect_ratio');\n}\n/**\n * @summary qualifier\n * @memberOf Qualifiers.Flag\n * @description Keeps the copyright related fields when stripping meta-data.\n * @return {Qualifiers.Flag.FlagQualifier}\n */\nfunction keepAttribution() {\n return new FlagQualifier('keep_attribution');\n}\n/**\n * @summary qualifier\n * @memberOf Qualifiers.Flag\n * Keep the Display Aspect Ratio metadata of the uploaded video (if it’s different from the current video\n * dimensions).\n * @return {Qualifiers.Flag.FlagQualifier}\n */\nfunction keepDar() {\n return new FlagQualifier('keep_dar');\n}\n/**\n * @summary qualifier\n * @memberOf Qualifiers.Flag\n * @description Keeps all meta-data.\n * @return {Qualifiers.Flag.FlagQualifier}\n */\nfunction keepIptc() {\n return new FlagQualifier('keep_iptc');\n}\n/**\n * @summary qualifier\n * @memberOf Qualifiers.Flag\n * @description Applies all chained transformations, until a transformation component that includes this flag, on the last added\n * overlay or underlay instead of applying on the containing image.\n * @return {Qualifiers.Flag.FlagQualifier}\n */\nfunction layerApply() {\n return new FlagQualifier('layer_apply');\n}\n/**\n * @summary qualifier\n * @memberOf Qualifiers.Flag\n * @description Automatically use lossy compression when delivering animated GIF files.\n *\n * This flag can also be used as a conditional flag for delivering PNG files: it tells Cloudinary to deliver the\n * image in PNG format (as requested) unless there is no transparency channel - in which case deliver in JPEG\n * format.\n * @return {Qualifiers.Flag.FlagQualifier}\n */\nfunction lossy() {\n return new FlagQualifier('lossy');\n}\n/**\n * @summary qualifier\n * @memberOf Qualifiers.Flag\n * @description Convert the audio channel to mono\n * @return {Qualifiers.Flag.FlagQualifier}\n */\nfunction mono() {\n return new FlagQualifier('mono');\n}\n/**\n * @summary qualifier\n * @memberOf Qualifiers.Flag\n * @description Used internally by Position within an Overlay, this flag will tile the overlay across your image.\n *\n * <b>Learn more:</b> {@link https://cloudinary.com/documentation/transformation_reference#fl_no_overflow|Overflow in overlays}\n * @return {Qualifiers.Flag.FlagQualifier}\n */\nfunction noOverflow() {\n return new FlagQualifier('no_overflow');\n}\n/**\n * @summary qualifier\n * @memberOf Qualifiers.Flag\n * @description Don't stream a video that is currently being generated on the fly. Wait until the video is fully generated.\n * @return {Qualifiers.Flag.FlagQualifier}\n */\nfunction noStream() {\n return new FlagQualifier('no_stream');\n}\n/**\n * @summary qualifier\n * @memberOf Qualifiers.Flag\n * @description Generate PNG images in the png24 format.\n * @return {Qualifiers.Flag.FlagQualifier}\n */\nfunction png24() {\n return new FlagQualifier('png24');\n}\n/**\n * @summary qualifier\n * @memberOf Qualifiers.Flag\n * @description Generate PNG images in the png32 format.\n * @return {Qualifiers.Flag.FlagQualifier}\n */\nfunction png32() {\n return new FlagQualifier('png32');\n}\n/**\n * @summary qualifier\n * @memberOf Qualifiers.Flag\n * @description Generate PNG images in the PNG8 format.\n * @return {Qualifiers.Flag.FlagQualifier}\n */\nfunction png8() {\n return new FlagQualifier('png8');\n}\n/**\n * @summary qualifier\n * @memberOf Qualifiers.Flag\n * @description When used with automatic fetch_format (f_auto): ensures that images with a transparency channel will be\n * delivered in PNG format.\n * @return {Qualifiers.Flag.FlagQualifier}\n */\nfunction preserveTransparency() {\n return new FlagQualifier('preserve_transparency');\n}\n/**\n * @summary qualifier\n * @memberOf Qualifiers.Flag\n * @description Generates a JPG image using the progressive (interlaced) JPG format.\n *\n * This format allows the browser to quickly show a low-quality rendering of the image until the full-quality\n * image is loaded.\n *\n * @param {string} mode? The mode to determine a specific progressive outcome as follows:\n * * semi - A smart optimization of the decoding time, compression level and progressive rendering\n * (less iterations). This is the default mode when using q_auto.\n * * steep - Delivers a preview very quickly, and in a single later phase improves the image to\n * the required resolution.\n * * none - Use this to deliver a non-progressive image. This is the default mode when setting\n * a specific value for quality.\n * @return {Qualifiers.Flag.FlagQualifier}\n */\nfunction progressive(mode) {\n return new FlagQualifier('progressive', mode);\n}\n/**\n * @summary qualifier\n * @memberOf Qualifiers.Flag\n * @description Modifies percentage-based width & height parameters of overlays and underlays (e.g., 1.0) to be relative to the overlaid region\n * @return {Qualifiers.Flag.FlagQualifier}\n */\nfunction regionRelative() {\n return new FlagQualifier('region_relative');\n}\n/**\n * @summary qualifier\n * @memberOf Qualifiers.Flag\n * @description Reduces the image to one flat pixelated layer (as opposed to the default vector based graphic) in\n * order to enable\n * PDF resizing and overlay manipulations.\n * @return {Qualifiers.Flag.FlagQualifier}\n */\nfunction rasterize() {\n return new FlagQualifier('rasterize');\n}\n/**\n * @summary qualifier\n * @memberOf Qualifiers.Flag\n * @description Modifies percentage-based width & height parameters of overlays and underlays (e.g., 1.0) to be relative to the containing image instead of the added layer.\n * @return {Qualifiers.Flag.FlagQualifier}\n */\nfunction relative() {\n return new FlagQualifier('relative');\n}\n/**\n * @summary qualifier\n * @memberOf Qualifiers.Flag\n * @description Instructs Cloudinary to run a sanitizer on the image (relevant only for the SVG format).\n * @return {Qualifiers.Flag.FlagQualifier}\n */\nfunction sanitize() {\n return new FlagQualifier('sanitize');\n}\n/**\n * @summary qualifier\n * @memberOf Qualifiers.Flag\n * @description Splices the video stipulated as an overlay on to the end of the container video instead of adding it as an\n * overlay.\n * @return {Qualifiers.Flag.FlagQualifier}\n */\nfunction splice() {\n return new FlagQualifier('splice');\n}\n/**\n * @summary qualifier\n * @memberOf Qualifiers.Flag\n * @description Instructs Cloudinary to clear all ICC color profile data included with the image.\n * @return {Qualifiers.Flag.FlagQualifier}\n */\nfunction stripProfile() {\n return new FlagQualifier('strip_profile');\n}\n/**\n * @summary qualifier\n * @memberOf Qualifiers.Flag\n * @description If the requested video transformation has already been generated, this flag works identically to\n * Flag::attachment.\n *\n * However, if the video transformation is being requested for the first time, this flag causes the video download\n * to begin immediately, streaming it as a fragmented video file.\n *\n * In contrast, if the regular fl_attachment flag is used when a user requests a new video transformation,\n * the download will begin only after the complete transformed video has been generated.\n *\n * Most standard video players successfully play fragmented video files without issue.\n *\n * @param {string} filename The attachment's filename\n * @return {Qualifiers.Flag.FlagQualifier}\n */\nfunction streamingAttachment(filename) {\n return new FlagQualifier('streaming_attachment', filename);\n}\n/**\n * @summary qualifier\n * @memberOf Qualifiers.Flag\n * @description Generates TIFF images using LZW compression and in the TIFF8 format.\n * @return {Qualifiers.Flag.FlagQualifier}\n */\nfunction tiff8Lzw() {\n return new FlagQualifier('tiff8_lzw');\n}\n/**\n * @summary qualifier\n * @memberOf Qualifiers.Flag\n * @description Used internally by Position within an Overlay, this flag will tile the overlay across your image.\n *\n * <b>Learn more:</b> {@link https://cloudinary.com/documentation/layers#automatic_tiling|Tiling overlay}\n * @return {Qualifiers.Flag.FlagQualifier}\n */\nfunction tiled() {\n return new FlagQualifier('tiled');\n}\n/**\n * @summary qualifier\n * @memberOf Qualifiers.Flag\n * @description Truncate (trim) a video file based on the start time defined in the metadata (relevant only where the metadata\n * includes a directive to play only a section of the video).\n * @return {Qualifiers.Flag.FlagQualifier}\n */\nfunction truncateTS() {\n return new FlagQualifier('truncate_ts');\n}\n/**\n * @summary qualifier\n * @memberOf Qualifiers.Flag\n * @description Create a waveform image (in the format specified by the file extension) from the audio or video file.\n * @return {Qualifiers.Flag.FlagQualifier}\n */\nfunction waveform() {\n return new FlagQualifier('waveform');\n}\n/**\n * @summary qualifier\n * @memberOf Qualifiers.Flag\n * @description A qualifier that ensures that an alpha channel is not applied to a TIFF image if it is a mask channel.\n * @return {Qualifiers.Flag.FlagQualifier}\n */\nfunction ignoreMaskChannels() {\n return new FlagQualifier('ignore_mask_channels');\n}\nconst Flag = {\n animated, anyFormat, animatedPng, animatedWebP,\n clipEvenOdd, lossy, preserveTransparency, png8, png24, png32, progressive, rasterize,\n sanitize, stripProfile, tiff8Lzw, attachment, forceIcc, forceStrip, getInfo, immutableCache,\n keepAttribution, keepIptc, custom, streamingAttachment, hlsv3, keepDar, noStream, mono,\n layerApply, relative, regionRelative, splice, truncateTS, waveform, ignoreInitialAspectRatio, clip,\n tiled, noOverflow, ignoreMaskChannels\n};\nexport { Flag, animated, anyFormat, animatedPng, animatedWebP, clipEvenOdd, lossy, preserveTransparency, png8, png24, png32, progressive, rasterize, sanitize, stripProfile, tiff8Lzw, attachment, forceIcc, forceStrip, getInfo, immutableCache, keepAttribution, keepIptc, custom, streamingAttachment, hlsv3, keepDar, noStream, mono, layerApply, relative, regionRelative, splice, truncateTS, waveform, ignoreInitialAspectRatio, clip, tiled, noOverflow, ignoreMaskChannels };\n","import { QualifierValue } from \"../../internal/qualifier/QualifierValue.js\";\n/**\n * @memberOf Qualifiers.Format\n * @extends {SDK.QualifierValue}\n */\nclass FormatQualifier extends QualifierValue {\n constructor(val) {\n super(val);\n this.val = val;\n }\n getValue() {\n return this.val;\n }\n}\nexport { FormatQualifier };\n","/**\n * Flip keys and values for given object\n * @param obj\n */\nfunction objectFlip(obj) {\n const result = {};\n Object.keys(obj).forEach((key) => {\n result[obj[key]] = key;\n });\n return result;\n}\nexport { objectFlip };\n","/**\n * This file is for internal constants only.\n * It is not intended for public use and is not part of the public API\n */\nimport { objectFlip } from \"./utils/objectFlip.js\";\nexport const CONDITIONAL_OPERATORS = {\n \"=\": \"eq\",\n \"!=\": \"ne\",\n \"<\": \"lt\",\n \">\": \"gt\",\n \"<=\": \"lte\",\n \">=\": \"gte\",\n \"&&\": \"and\",\n \"||\": \"or\",\n \"*\": \"mul\",\n \"/\": \"div\",\n \"+\": \"add\",\n \"-\": \"sub\",\n \"^\": \"pow\"\n};\nexport const RESERVED_NAMES = {\n \"aspect_ratio\": \"ar\",\n \"aspectRatio\": \"ar\",\n \"current_page\": \"cp\",\n \"currentPage\": \"cp\",\n \"duration\": \"du\",\n \"face_count\": \"fc\",\n \"faceCount\": \"fc\",\n \"height\": \"h\",\n \"initial_aspect_ratio\": \"iar\",\n \"initial_height\": \"ih\",\n \"initial_width\": \"iw\",\n \"initialAspectRatio\": \"iar\",\n \"initialHeight\": \"ih\",\n \"initialWidth\": \"iw\",\n \"initial_duration\": \"idu\",\n \"initialDuration\": \"idu\",\n \"page_count\": \"pc\",\n \"page_x\": \"px\",\n \"page_y\": \"py\",\n \"pageCount\": \"pc\",\n \"pageX\": \"px\",\n \"pageY\": \"py\",\n \"tags\": \"tags\",\n \"width\": \"w\",\n \"trimmed_aspect_ratio\": \"tar\",\n \"current_public_id\": \"cpi\",\n \"initial_density\": \"idn\",\n \"page_names\": \"pgnames\"\n};\nexport const ACTION_TYPE_TO_CROP_MODE_MAP = {\n limitFit: 'limit',\n limitFill: 'lfill',\n minimumFit: 'mfit',\n thumbnail: 'thumb',\n limitPad: 'lpad',\n minimumPad: 'mpad',\n autoPad: 'auto_pad'\n};\nexport const ACTION_TYPE_TO_DELIVERY_MODE_MAP = {\n colorSpace: 'cs',\n dpr: 'dpr',\n density: 'dn',\n defaultImage: 'd',\n format: 'f',\n quality: 'q'\n};\nexport const ACTION_TYPE_TO_EFFECT_MODE_MAP = {\n redEye: 'redeye',\n advancedRedEye: 'adv_redeye',\n oilPaint: 'oil_paint',\n unsharpMask: 'unsharp_mask',\n makeTransparent: 'make_transparent',\n generativeRestore: 'gen_restore',\n upscale: 'upscale'\n};\nexport const ACTION_TYPE_TO_QUALITY_MODE_MAP = {\n autoBest: 'auto:best',\n autoEco: 'auto:eco',\n autoGood: 'auto:good',\n autoLow: 'auto:low',\n jpegminiHigh: 'jpegmini:1',\n jpegminiMedium: 'jpegmini:2',\n jpegminiBest: 'jpegmini:0'\n};\nexport const ACTION_TYPE_TO_STREAMING_PROFILE_MODE_MAP = {\n fullHd: 'full_hd',\n fullHdWifi: 'full_hd_wifi',\n fullHdLean: 'full_hd_lean',\n hdLean: 'hd_lean'\n};\nexport const CHROMA_VALUE_TO_CHROMA_MODEL_ENUM = {\n 444: \"CHROMA_444\",\n 420: \"CHROMA_420\"\n};\nexport const COLOR_SPACE_MODEL_MODE_TO_COLOR_SPACE_MODE_MAP = {\n 'noCmyk': 'no_cmyk',\n 'keepCmyk': 'keep_cmyk',\n 'tinySrgb': 'tinysrgb',\n 'srgbTrueColor': 'srgb:truecolor'\n};\nexport const ACTION_TYPE_TO_BLEND_MODE_MAP = {\n 'antiRemoval': 'anti_removal'\n};\nexport const CHROMA_MODEL_ENUM_TO_CHROMA_VALUE = objectFlip(CHROMA_VALUE_TO_CHROMA_MODEL_ENUM);\nexport const COLOR_SPACE_MODE_TO_COLOR_SPACE_MODEL_MODE_MAP = objectFlip(COLOR_SPACE_MODEL_MODE_TO_COLOR_SPACE_MODE_MAP);\nexport const CROP_MODE_TO_ACTION_TYPE_MAP = objectFlip(ACTION_TYPE_TO_CROP_MODE_MAP);\nexport const DELIVERY_MODE_TO_ACTION_TYPE_MAP = objectFlip(ACTION_TYPE_TO_DELIVERY_MODE_MAP);\nexport const EFFECT_MODE_TO_ACTION_TYPE_MAP = objectFlip(ACTION_TYPE_TO_EFFECT_MODE_MAP);\nexport const QUALITY_MODE_TO_ACTION_TYPE_MAP = objectFlip(ACTION_TYPE_TO_QUALITY_MODE_MAP);\nexport const STREAMING_PROFILE_TO_ACTION_TYPE_MAP = objectFlip(ACTION_TYPE_TO_STREAMING_PROFILE_MODE_MAP);\n","import { Action } from \"../../internal/Action.js\";\nimport { FormatQualifier } from \"../../qualifiers/format/FormatQualifier.js\";\nimport { Qualifier } from \"../../internal/qualifier/Qualifier.js\";\nimport { DELIVERY_MODE_TO_ACTION_TYPE_MAP } from \"../../internal/internalConstants.js\";\n/**\n * @description Qualifies the delivery of an asset.\n * @memberOf Actions.Delivery\n * @extends SDK.Action\n */\nclass DeliveryAction extends Action {\n /**\n * @param {string} deliveryKey A generic Delivery Action Key (such as q, f, dn, etc.)\n * @param {string} deliveryType A Format Qualifiers for the action, such as Quality.auto()\n * @param {string} modelProperty internal model property of the action, for example quality uses `level` while dpr uses `density`\n * @see Visit {@link Actions.Delivery|Delivery} for an example\n */\n constructor(deliveryKey, deliveryType, modelProperty) {\n super();\n this._actionModel = {};\n let deliveryTypeValue;\n if (deliveryType instanceof FormatQualifier) {\n deliveryTypeValue = deliveryType.getValue();\n }\n else {\n deliveryTypeValue = deliveryType;\n }\n this._actionModel.actionType = DELIVERY_MODE_TO_ACTION_TYPE_MAP[deliveryKey];\n this._actionModel[modelProperty] = deliveryTypeValue;\n this.addQualifier(new Qualifier(deliveryKey, deliveryType));\n }\n}\nexport { DeliveryAction };\n","/**\n * @description Contains functions to select the mode when using a progressive format.\n * <b>Learn more</b>: {@link https://cloudinary.com/documentation/transformation_reference#fl_progressive|Progressive modes}\n * @memberOf Qualifiers\n * @namespace Progressive\n * @example\n * import {Cloudinary} from \"@cloudinary/url-gen\";\n * import {format} from \"@cloudinary/url-gen/actions/delivery\";\n * import {jpg} from \"@cloudinary/url-gen/qualifiers/format\";\n * import {steep} from \"@cloudinary/url-gen/qualifiers/progressive\";\n *\n * const yourCldInstance = new Cloudinary({cloud: {cloudName: 'demo'}});\n * const image = yourCldInstance.image('woman');\n * image.delivery(format(jpg()).progressive(steep()))\n */\nimport { FlagQualifier } from \"./flag/FlagQualifier.js\";\nclass ProgressiveQualifier extends FlagQualifier {\n constructor(mode) {\n super('progressive', mode);\n }\n}\n/**\n * @memberOf Qualifiers.Progressive\n */\nfunction none() {\n return new ProgressiveQualifier('none');\n}\n/**\n * @memberOf Qualifiers.Progressive\n */\nfunction semi() {\n return new ProgressiveQualifier('semi');\n}\n/**\n * @memberOf Qualifiers.Progressive\n */\nfunction steep() {\n return new ProgressiveQualifier('steep');\n}\n/**\n * @memberOf Qualifiers.Progressive\n */\nfunction progressive() {\n return new ProgressiveQualifier();\n}\nconst Progressive = {\n semi,\n none,\n steep,\n progressive,\n ProgressiveQualifier\n};\nexport { Progressive, semi, none, steep, progressive, ProgressiveQualifier };\n","import { lossy, preserveTransparency, progressive } from \"../../qualifiers/flag.js\";\nimport { DeliveryAction } from \"./DeliveryAction.js\";\nimport { ProgressiveQualifier } from \"../../qualifiers/progressive.js\";\n/**\n * @memberOf Actions.Delivery\n * @extends {Actions.Delivery.DeliveryAction}\n * @see Visit {@link Actions.Delivery|Delivery} for an example\n */\nclass DeliveryFormatAction extends DeliveryAction {\n constructor(deliveryKey, deliveryType) {\n super(deliveryKey, deliveryType, 'formatType');\n }\n /**\n * @description Uses lossy compression when delivering animated GIF files.\n * @return {this}\n */\n lossy() {\n this._actionModel.lossy = true;\n this.addFlag(lossy());\n return this;\n }\n /**\n * @description Uses progressive compression when delivering JPG file format.\n * @return {this}\n */\n progressive(mode) {\n if (mode instanceof ProgressiveQualifier) {\n this._actionModel.progressive = { mode: mode.getFlagValue() };\n this.addFlag(mode);\n }\n else {\n this._actionModel.progressive = { mode: mode };\n this.addFlag(progressive(mode));\n }\n return this;\n }\n /**\n * @description Ensures that images with a transparency channel are delivered in PNG format.\n */\n preserveTransparency() {\n this._actionModel.preserveTransparency = true;\n this.addFlag(preserveTransparency());\n return this;\n }\n static fromJson(actionModel) {\n const { formatType, lossy, progressive, preserveTransparency } = actionModel;\n let result;\n if (formatType) {\n result = new this('f', formatType);\n }\n else {\n result = new this('f');\n }\n if (progressive) {\n if (progressive.mode) {\n result.progressive(progressive.mode);\n }\n else {\n result.progressive();\n }\n }\n lossy && result.lossy();\n preserveTransparency && result.preserveTransparency();\n return result;\n }\n}\nexport { DeliveryFormatAction };\n","import { Action } from \"../internal/Action.js\";\nimport { BackgroundColor } from \"../actions/background/actions/BackgroundColor.js\";\nimport { FlagQualifier } from \"../qualifiers/flag/FlagQualifier.js\";\nimport { RawAction } from \"../internal/RawAction.js\";\nimport { isErrorObject } from \"../internal/models/IErrorObject.js\";\nimport { DeliveryFormatAction } from \"../actions/delivery/DeliveryFormatAction.js\";\n/**\n * @summary SDK\n * @description - Defines how to transform an asset\n * @memberOf SDK\n */\nclass Transformation {\n constructor() {\n this.actions = [];\n }\n /**\n * @param {SDK.Action | string} action\n * @return {this}\n */\n addAction(action) {\n let actionToAdd;\n if (typeof action === 'string') {\n if (action.indexOf('/') >= 0) {\n throw 'addAction cannot accept a string with a forward slash in it - /, use .addTransformation() instead';\n }\n else {\n actionToAdd = new RawAction(action);\n }\n }\n else {\n actionToAdd = action;\n }\n this.actions.push(actionToAdd);\n return this;\n }\n /**\n * @description Allows the injection of a raw transformation as a string into the transformation, or a Transformation instance that was previously created\n * @param {string | SDK.Transformation} tx\n * @example\n * import {Transformation} from \"@cloudinary/url-gen\";\n *\n * const transformation = new Transformation();\n * transformation.addTransformation('w_100/w_200/w_300');\n * @return {this}\n */\n addTransformation(tx) {\n if (tx instanceof Transformation) {\n // Concat the new actions into the existing actions\n this.actions = this.actions.concat(tx.actions);\n }\n else {\n this.actions.push(new RawAction(tx));\n }\n return this;\n }\n /**\n * @return {string}\n */\n toString() {\n return this.actions\n .map((action) => {\n return action.toString();\n })\n .filter((a) => a)\n .join('/');\n }\n /**\n * @description Delivers an animated GIF.\n * @param {AnimatedAction} animatedAction\n * @return {this}\n */\n animated(animatedAction) {\n return this.addAction(animatedAction);\n }\n /**\n * @description Adds a border around the image.\n * @param {Border} borderAction\n * @return {this}\n */\n border(borderAction) {\n return this.addAction(borderAction);\n }\n /**\n * @description Adjusts the shape of the delivered image. </br>\n * <b>Learn more:</b> {@link https://cloudinary.com/documentation/effects_and_artistic_enhancements#distort|Shape changes and distortion effects}\n * @param {IReshape} reshapeAction\n * @return {this}\n */\n reshape(reshapeAction) {\n return this.addAction(reshapeAction);\n }\n /**\n * @description Resize the asset using provided resize action\n * @param {ResizeSimpleAction} resizeAction\n * @return {this}\n */\n resize(resizeAction) {\n return this.addAction(resizeAction);\n }\n /**\n * @desc An alias to Action Delivery.quality\n * @param {string|number} quality\n * @return {this}\n */\n quality(quality) {\n this.addAction(new DeliveryFormatAction('q', quality));\n return this;\n }\n /**\n * @desc An alias to Action Delivery.format\n * @param {string} format\n * @return {this}\n */\n format(format) {\n this.addAction(new DeliveryFormatAction('f', format));\n return this;\n }\n /**\n * @description Rounds the specified corners of an image.\n * @param roundCornersAction\n * @return {this}\n */\n roundCorners(roundCornersAction) {\n return this.addAction(roundCornersAction);\n }\n /**\n * @description Adds an overlay over the base image.\n * @param {LayerAction} overlayAction\n * @return {this}\n */\n overlay(overlayAction) {\n return this.addAction(overlayAction);\n }\n /**\n * @description Adds an underlay under the base image.\n * @param {LayerAction} underlayAction\n * @return {this}\n */\n underlay(underlayAction) {\n underlayAction.setLayerType('u');\n return this.addAction(underlayAction);\n }\n /**\n * @description Defines an new user variable.\n * @param {VariableAction} variableAction\n * @return {this}\n */\n addVariable(variableAction) {\n return this.addAction(variableAction);\n }\n /**\n * @description Specifies a condition to be met before applying a transformation.\n * @param {ConditionalAction} conditionAction\n * @return {this}\n */\n conditional(conditionAction) {\n return this.addAction(conditionAction);\n }\n /**\n * @description Applies a filter or an effect on an asset.\n * @param {SimpleEffectAction} effectAction\n * @return {this}\n */\n effect(effectAction) {\n return this.addAction(effectAction);\n }\n /**\n * @description Applies adjustment effect on an asset.\n * @param action\n * @return {this}\n */\n adjust(action) {\n return this.addAction(action);\n }\n /**\n * @description Rotates the asset by the given angle.\n * @param {RotateAction} rotateAction\n * @return {this}\n */\n rotate(rotateAction) {\n return this.addAction(rotateAction);\n }\n /**\n * @description Applies a pre-defined named transformation of the given name.\n * @param {NamedTransformation} namedTransformation\n * @return {this}\n */\n namedTransformation(namedTransformation) {\n return this.addAction(namedTransformation);\n }\n /**\n * @description Applies delivery action.\n * @param deliveryAction\n * @return {this}\n */\n delivery(deliveryAction) {\n return this.addAction(deliveryAction);\n }\n /**\n * @description Sets the color of the background.\n * @param {Qualifiers.Color} color\n * @return {this}\n */\n backgroundColor(color) {\n return this.addAction(new BackgroundColor(color));\n }\n /**\n * @description Adds a layer in a Photoshop document.\n * @param action\n * @return {this}\n */\n psdTools(action) {\n return this.addAction(action);\n }\n /**\n * @description Extracts an image or a page using an index, a range, or a name from a layered media asset.\n * @param action\n * @return {this}\n */\n extract(action) {\n return this.addAction(action);\n }\n /**\n * @description Adds a flag as a separate action.\n * @param {Qualifiers.Flag | string} flagQualifier\n * @return {this}\n */\n addFlag(flagQualifier) {\n const action = new Action();\n let flagToAdd = flagQualifier;\n if (typeof flagQualifier === 'string') {\n flagToAdd = new FlagQualifier(flagQualifier);\n }\n action.addQualifier(flagToAdd);\n return this.addAction(action);\n }\n /**\n * @description Inject a custom function into the image transformation pipeline.\n * @return {this}\n */\n customFunction(customFunction) {\n return this.addAction(customFunction);\n }\n /**\n * Transcodes the video (or audio) to another format.\n * @param {Action} action\n * @return {this}\n */\n transcode(action) {\n return this.addAction(action);\n }\n /**\n * Applies the specified video edit action.\n *\n * @param {videoEditType} action\n * @return {this}\n */\n videoEdit(action) {\n return this.addAction(action);\n }\n toJson() {\n const actions = [];\n for (const action of this.actions) {\n const json = action.toJson();\n if (isErrorObject(json)) {\n // Fail early and return an IErrorObject\n return json;\n }\n actions.push(json);\n }\n return { actions };\n }\n}\nexport { Transformation };\n","import { Transformation } from \"./Transformation.js\";\n/**\n * @summary SDK\n * @extends {SDK.Transformation}\n * @memberOf SDK\n */\nclass ImageTransformation extends Transformation {\n}\nexport { ImageTransformation };\n","import { Transformation } from \"./Transformation.js\";\n/**\n * @summary SDK\n * @extends {SDK.Transformation}\n * @memberOf SDK\n */\nclass VideoTransformation extends Transformation {\n}\nexport { VideoTransformation };\n","/**\n *\n * @param publicID\n */\nexport function isUrl(publicID) {\n return publicID.match(/^https?:\\//);\n}\n","/**\n *\n * @param publicID\n */\nexport function isFileName(publicID) {\n return publicID.indexOf('/') < 0;\n}\n","/**\n *\n * @param publicID\n */\nexport function publicIDContainsVersion(publicID) {\n return publicID.match(/^v[0-9]+/);\n}\n","import { isUrl } from \"./urlUtils/isUrl.js\";\nimport { isFileName } from \"./urlUtils/isFileName.js\";\nimport { publicIDContainsVersion } from \"./urlUtils/publicIDContainsVersion.js\";\n/**\n * Create the URL prefix for Cloudinary resources.\n * Available use cases\n * http://res.cloudinary.com/{cloudName}\n * https://res.cloudinary.com/{cloudName}\n * https://{cloudName}-res.cloudinary.com/\n * http://{domain}/${cloudName}\n * https://{domain}/${cloudName}\n * https://{domain}\n * @private\n *\n * @param {string} cloudName\n * @param {IURLConfig} urlConfig\n */\nfunction getUrlPrefix(cloudName, urlConfig) {\n const secure = urlConfig.secure;\n const privateCDN = urlConfig.privateCdn;\n const cname = urlConfig.cname;\n const secureDistribution = urlConfig.secureDistribution;\n if (!secure && !cname) {\n return `http://res.cloudinary.com/${cloudName}`;\n }\n if (secure && !secureDistribution && privateCDN) {\n return `https://${cloudName}-res.cloudinary.com`;\n }\n if (secure && !secureDistribution) {\n return `https://res.cloudinary.com/${cloudName}`;\n }\n if (secure && secureDistribution && privateCDN) {\n return `https://${secureDistribution}`;\n }\n if (secure && secureDistribution) {\n return `https://${secureDistribution}/${cloudName}`;\n }\n if (!secure && cname) {\n return `http://${cname}/${cloudName}`;\n }\n else {\n return 'ERROR';\n }\n}\n/**\n * @private\n * @param assetType\n */\nfunction handleAssetType(assetType) {\n //default to image\n if (!assetType) {\n return 'image';\n }\n return assetType;\n}\n/**\n * @private\n * @param deliveryType\n */\nfunction handleDeliveryType(deliveryType) {\n //default to upload\n if (!deliveryType) {\n return 'upload';\n }\n return deliveryType;\n}\n/**\n *\n * @param {string} publicID\n * @param {number} version\n * @param {boolean} forceVersion\n */\nfunction getUrlVersion(publicID, version, forceVersion) {\n const shouldForceVersion = forceVersion !== false;\n if (version) {\n return `v${version}`;\n }\n // In all these conditions we never force a version\n if (publicIDContainsVersion(publicID) || isUrl(publicID) || isFileName(publicID)) {\n return '';\n }\n return shouldForceVersion ? 'v1' : '';\n}\nexport { handleAssetType, getUrlVersion, handleDeliveryType, getUrlPrefix };\n","/**\n * @private\n * @description Adds left padding to a string with the desired substring the provided number of times\n * @example stringPad(foo, 3, 'a'') // -> aaafoo\n * @param {string} value\n * @param {number} _targetLength\n * @param {string} _padString\n */\nexport function stringPad(value, _targetLength, _padString) {\n let targetLength = _targetLength >> 0; //truncate if number or convert non-number to 0;\n let padString = String((typeof _padString !== 'undefined' ? _padString : ' '));\n if (value.length > targetLength) {\n return String(value);\n }\n else {\n targetLength = targetLength - value.length;\n if (targetLength > padString.length) {\n padString += repeatStringNumTimes(padString, targetLength / padString.length);\n }\n return padString.slice(0, targetLength) + String(value);\n }\n}\n/**\n * @description Repeat a string multiple times, cross-browser-safe alternative to string.repeat()\n * @param string\n * @param _times\n */\nfunction repeatStringNumTimes(string, _times) {\n let times = _times;\n let repeatedString = \"\";\n while (times > 0) {\n repeatedString += string;\n times--;\n }\n return repeatedString;\n}\n","import { stringPad } from \"./stringPad.js\";\n/**\n * This file maps sequences of 6 bit binary digits to a character in base64.\n * 000000 -> A\n * 110011 -> Z\n * 111111 -> /\n */\nconst chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\nconst base64Map = {};\nlet num = 0;\nchars.split('').forEach((char) => {\n let key = num.toString(2);\n key = stringPad(key, 6, '0');\n base64Map[key] = char;\n num++;\n});\n/**\n * Map of [six-bit binary codes] -> [Base64 characters]\n */\nexport { base64Map };\n","/**\n * @private\n * @description Reverses the version positions, x.y.z turns to z.y.x\n * Example: 1.2.3 -> 03.02.01\n * @param {string} semVer Input can be either x.y.z or x.y\n * @return {string} in the form of zz.yy.xx (\n */\nexport function reverseVersion(semVer) {\n if (semVer.split('.').length < 2) {\n throw new Error('invalid semVer, must have at least two segments');\n }\n // Split by '.', reverse, create new array\n return semVer.split('.').reverse().join('.');\n}\n","import { stringPad } from \"./stringPad.js\";\n/**\n * @private\n * @description Pads each segment with '0' so they have length of 2\n * @param {string} semVer Input can be either x.y.z or x.y\n * @return {string} in the form of xx.yy.zz (\n */\nexport function padVersion(semVer) {\n if (semVer.split('.').length < 2) {\n throw new Error('invalid semVer, must have at least two segments');\n }\n // Split by '.', reverse, create new array with padded values and concat it together\n return semVer.split('.').map((segment) => {\n // try to cast to number\n const asNumber = +segment;\n if (isNaN(asNumber) || asNumber < 0) {\n throw 'Invalid version number provided';\n }\n return stringPad(segment, 2, '0');\n }).join('.');\n}\n","import { base64Map } from \"./base64Map.js\";\nimport { stringPad } from \"./stringPad.js\";\nimport { reverseVersion } from \"./reverseVersion.js\";\nimport { padVersion } from \"./padVersion.js\";\n/**\n * @private\n * @description Encodes a semVer-like version string\n * @param {string} semVer Input can be either x.y.z or x.y\n * @return {string} A string built from 3 characters of the base64 table that encode the semVer\n */\nexport function encodeVersion(semVer) {\n let strResult = '';\n // support x.y or x.y.z by using 'parts' as a variable\n const parts = semVer.split('.').length;\n const paddedStringLength = parts * 6; // we pad to either 12 or 18 characters\n // reverse (but don't mirror) the version. 1.5.15 -> 15.5.1\n const reversedSemver = reverseVersion(semVer);\n // Pad to two spaces, 15.5.1 -> 15.05.01\n const paddedSemver = padVersion(reversedSemver);\n // turn 15.05.01 to a string '150501' then to a number 150501\n const num = parseInt(paddedSemver.split('.').join(''));\n // Represent as binary, add left padding to 12 or 18 characters.\n // 150,501 -> 100100101111100101\n let paddedBinary = num.toString(2);\n paddedBinary = stringPad(paddedBinary, paddedStringLength, '0');\n // Stop in case an invalid version number was provided\n // paddedBinary must be built from sections of 6 bits\n if (paddedBinary.length % 6 !== 0) {\n throw 'Version must be smaller than 43.21.26)';\n }\n // turn every 6 bits into a character using the base64Map\n paddedBinary.match(/.{1,6}/g).forEach((bitString) => {\n // console.log(bitString);\n strResult += base64Map[bitString];\n });\n return strResult;\n}\n","/**\n * @private\n * @description Gets the analyticsOptions from options- should include sdkSemver, techVersion, sdkCode, and feature\n * @param {ITrackedPropertiesThroughAnalytics} options\n * @returns {IAnalyticsOptions}\n */\nexport function getAnalyticsOptions(options) {\n const analyticsOptions = {\n sdkSemver: options.sdkSemver,\n techVersion: options.techVersion,\n sdkCode: options.sdkCode,\n product: options.product,\n feature: '0',\n osType: options.osType,\n osVersion: options.osVersion,\n };\n if (options.accessibility) {\n analyticsOptions.feature = 'D';\n }\n if (options.lazyload) {\n analyticsOptions.feature = 'C';\n }\n if (options.responsive) {\n analyticsOptions.feature = 'A';\n }\n if (options.placeholder) {\n analyticsOptions.feature = 'B';\n }\n return analyticsOptions;\n}\n","const packageVersion = '1.19.0';\n/**\n * Export package version (injected during our build).\n * Reason for this is that If we import values from from package.json,\n * it will cause an error for users who do not have an 'import from json' plugin\n * as part of their build process / bundler.\n */\nexport { packageVersion };\n","import { base64Map } from \"./base64Map.js\";\n/**\n * @private\n * @description Encodes a semVer-like version string for OS\n * @param {string} semVer Input is x.y\n * @return {string} A string built from 2 characters of the base64 table that encode the semVer\n */\nexport function encodeOSVersion(semVer) {\n const [major, minor] = semVer.split('.');\n //convert to binary\n const binaryMajorVersion = parseInt(major).toString(2);\n const binaryMinorVersion = parseInt(minor).toString(2);\n //pad to 6\n const paddedMajor = binaryMajorVersion.padStart(6, '0');\n const paddedMinor = binaryMinorVersion.padStart(6, '0');\n return base64Map[paddedMajor] + base64Map[paddedMinor];\n}\n","import { encodeVersion } from \"./encodeVersion.js\";\nimport { getAnalyticsOptions } from \"./getAnalyticsOptions.js\";\nimport { packageVersion } from \"../internal/utils/packageVersion.js\";\nimport { encodeOSVersion } from \"./encodeOSVersion.js\";\n/**\n * @private\n * @description Try to get the node version out of process, if browser just return 0.0.0\n */\nfunction getNodeVersion() {\n const failedVersion = '0.0.0';\n if (typeof window !== 'undefined') {\n return failedVersion;\n }\n else {\n // node env\n try {\n return process.versions.node || failedVersion;\n }\n catch (e) {\n return failedVersion;\n }\n }\n}\n/**\n * @private\n * @description Ensure that all values ITrackedPropertiesThroughAnalytics are populated.\n * Accept a partial map of values and returns the complete interface of ITrackedPropertiesThroughAnalytics\n * @param {ITrackedPropertiesThroughAnalytics} trackedAnalytics\n * @param {ITrackedPropertiesThroughAnalytics} trackedAnalytics\n */\nfunction ensureShapeOfTrackedProperties(trackedAnalytics) {\n // try to get the process version from node, but if we're on the client return 0.0.0\n const defaults = {\n techVersion: getNodeVersion(),\n sdkCode: 'T',\n sdkSemver: packageVersion.split('-')[0],\n product: 'A',\n osType: 'Z',\n osVersion: '0.0',\n responsive: false,\n placeholder: false,\n lazyload: false,\n accessibility: false\n };\n if (!trackedAnalytics) {\n return defaults;\n }\n else {\n return Object.assign(Object.assign({}, defaults), trackedAnalytics);\n }\n}\n/**\n * @private\n * @description Creates the complete SDK signature by using all the values provided by ITrackedPropertiesThroughAnalytics\n * Creation of the signature\n * - Set the AlgoVersion of the encoding, this is an internal letter that represents the version\n * of our encoding algorithm, it will allow us to perform breaking changes if we'll need them.\n * - Take the constant SDK code (Arbitrary letter chosen for each SDK, for Base that letter is 'T')\n * this is used to tell apart which SDK is being tracked.\n * - Take the {major.minor} versions of the node version (techVersion) (14.2, 16.2 etc.)\n * - Take the full semver of the SDK you wish to track\n * - Take the features used(lazy, placeholder etc.) and turn them to a letter (for example accessibility -> D)\n * - Before appending the string, the Versions must be encoded, see the function `encodeVersion` for more details\n * - Append all the variables to a single string\n * - In any case of an error, return the single letter 'E'\n *\n * @return {string} sdkAnalyticsSignature\n */\nexport function getSDKAnalyticsSignature(_trackedAnalytics) {\n const trackedAnalytics = ensureShapeOfTrackedProperties(_trackedAnalytics);\n const analyticsOptions = getAnalyticsOptions(trackedAnalytics);\n try {\n const twoPartVersion = removePatchFromSemver(analyticsOptions.techVersion);\n const encodedSDKVersion = encodeVersion(analyticsOptions.sdkSemver);\n const encodedTechVersion = encodeVersion(twoPartVersion);\n const encodedOSVersion = encodeOSVersion(analyticsOptions.osVersion);\n const featureCode = analyticsOptions.feature;\n const SDKCode = analyticsOptions.sdkCode;\n const { product, osType } = analyticsOptions;\n const algoVersion = 'D'; // The algo version is determined here, it should not be an argument\n return `${algoVersion}${product}${SDKCode}${encodedSDKVersion}${encodedTechVersion}${osType}${encodedOSVersion}${featureCode}`;\n }\n catch (e) {\n // Either SDK or Node versions were unparsable\n return 'E';\n }\n}\n/**\n * @private\n * @description Removes patch version from the semver if it exists\n * Turns x.y.z OR x.y into x.y\n * @param {'x.y.z' | 'x.y' | string} semVerStr\n */\nfunction removePatchFromSemver(semVerStr) {\n const parts = semVerStr.split('.');\n return `${parts[0]}.${parts[1]}`;\n}\n","import { getUrlPrefix, getUrlVersion, handleAssetType, handleDeliveryType } from \"../internal/url/cloudinaryURL.js\";\nimport URLConfig from \"../config/URLConfig.js\";\nimport { getSDKAnalyticsSignature } from \"../sdkAnalytics/getSDKAnalyticsSignature.js\";\n/**\n * This const contains all the valid combination of asset/delivery for URL shortening purposes\n * It's exported because it's used in a test, but it's not really shared enough to belong in a separate file\n */\nexport const SEO_TYPES = {\n \"image/upload\": \"images\",\n \"image/private\": \"private_images\",\n \"image/authenticated\": \"authenticated_images\",\n \"raw/upload\": \"files\",\n \"video/upload\": \"videos\"\n};\n/**\n * @description Cloudinary file without a transformation\n * @summary SDK\n * @memberOf SDK\n */\nclass CloudinaryFile {\n constructor(publicID, cloudConfig = {}, urlConfig) {\n this.setPublicID(publicID);\n this.setCloudConfig(cloudConfig);\n this.setURLConfig(urlConfig);\n }\n /**\n * @description Sets the URL Config for this asset\n * @param urlConfig\n * @return {this}\n */\n setURLConfig(urlConfig) {\n this.urlConfig = new URLConfig(urlConfig);\n return this;\n }\n /**\n * @description Sets the Cloud Config for this asset\n * @param urlConfig\n * @return {this}\n */\n setCloudConfig(cloudConfig) {\n this.cloudName = cloudConfig.cloudName;\n this.apiKey = cloudConfig.apiKey;\n this.apiSecret = cloudConfig.apiSecret;\n this.authToken = cloudConfig.authToken;\n return this;\n }\n /**\n * @description Sets the public ID of the asset.\n * @param {string} publicID The public ID of the asset.\n * @return {this}\n */\n setPublicID(publicID) {\n // PublicID must be a string!\n this.publicID = publicID ? publicID.toString() : '';\n return this;\n }\n /**\n * @description Sets the delivery type of the asset.\n * @param {DELIVERY_TYPE | string} newType The type of the asset.\n * @return {this}\n */\n setDeliveryType(newType) {\n this.deliveryType = newType;\n return this;\n }\n /**\n * @description Sets the URL SEO suffix of the asset.\n * @param {string} newSuffix The SEO suffix.\n * @return {this}\n */\n setSuffix(newSuffix) {\n this.suffix = newSuffix;\n return this;\n }\n /**\n * @description Sets the signature of the asset.\n * @param {string} signature The signature.\n * @return {this}\n */\n setSignature(signature) {\n this.signature = signature;\n return this;\n }\n /**\n * @description Sets the version of the asset.\n * @param {string} newVersion The version of the asset.\n * @return {this}\n */\n setVersion(newVersion) {\n if (newVersion) {\n this.version = newVersion;\n }\n return this;\n }\n /**\n * @description Sets the asset type.\n * @param {string} newType The type of the asset.\n * @return {this}\n */\n setAssetType(newType) {\n if (newType) {\n this.assetType = newType;\n }\n return this;\n }\n sign() {\n return this;\n }\n /**\n * @description Serializes to URL string\n * @param overwriteOptions\n */\n toURL(overwriteOptions = {}) {\n return this.createCloudinaryURL(null, overwriteOptions.trackedAnalytics);\n }\n /**\n * @description Validate various options before attempting to create a URL\n * The function will throw in case a violation\n * @throws Validation errors\n */\n validateAssetForURLCreation() {\n if (typeof this.cloudName === 'undefined') {\n throw 'You must supply a cloudName when initializing the asset';\n }\n const suffixContainsDot = this.suffix && this.suffix.indexOf('.') >= 0;\n const suffixContainsSlash = this.suffix && this.suffix.indexOf('/') >= 0;\n if (suffixContainsDot || suffixContainsSlash) {\n throw '`suffix`` should not include . or /';\n }\n }\n /**\n * @description return an SEO friendly name for a combination of asset/delivery, some examples:\n * * image/upload -> images\n * * video/upload -> videos\n * If no match is found, return `{asset}/{delivery}`\n */\n getResourceType() {\n const assetType = handleAssetType(this.assetType);\n const deliveryType = handleDeliveryType(this.deliveryType);\n const hasSuffix = !!this.suffix;\n const regularSEOType = `${assetType}/${deliveryType}`;\n const shortSEOType = SEO_TYPES[`${assetType}/${deliveryType}`];\n const useRootPath = this.urlConfig.useRootPath;\n const shorten = this.urlConfig.shorten;\n // Quick exit incase of useRootPath\n if (useRootPath) {\n if (regularSEOType === 'image/upload') {\n return ''; // For image/upload we're done, just return nothing\n }\n else {\n throw new Error(`useRootPath can only be used with assetType: 'image' and deliveryType: 'upload'. Provided: ${regularSEOType} instead`);\n }\n }\n if (shorten && regularSEOType === 'image/upload') {\n return 'iu';\n }\n if (hasSuffix) {\n if (shortSEOType) {\n return shortSEOType;\n }\n else {\n throw new Error(`URL Suffix only supported for ${Object.keys(SEO_TYPES).join(', ')}, Provided: ${regularSEOType} instead`);\n }\n }\n // If all else fails, return the regular image/upload combination (asset/delivery)\n return regularSEOType;\n }\n getSignature() {\n if (this.signature) {\n return `s--${this.signature}--`;\n }\n else {\n return '';\n }\n }\n /**\n *\n * @description Creates a fully qualified CloudinaryURL\n * @return {string} CloudinaryURL\n * @throws Validation Errors\n */\n createCloudinaryURL(transformation, trackedAnalytics) {\n // In accordance with the existing implementation, if no publicID exists we should return nothing.\n if (!this.publicID) {\n return '';\n }\n // Throws if some options are mis-configured\n // See the function for more information on when it throws\n this.validateAssetForURLCreation();\n const prefix = getUrlPrefix(this.cloudName, this.urlConfig);\n const transformationString = transformation ? transformation.toString() : '';\n const version = getUrlVersion(this.publicID, this.version, this.urlConfig.forceVersion);\n const publicID = this.publicID;\n if (typeof transformation === 'string') {\n const url = [prefix, this.getResourceType(), this.getSignature(), transformationString, version, publicID.replace(/,/g, '%2C'), this.suffix]\n .filter((a) => a)\n .join('/');\n return url;\n }\n else {\n // Avoid applying encodeURI on entire string in case where we have transformations with comma (i.e. f_auto,q_auto)\n // Since encodeURI does not encode commas we replace commas *only* on the publicID\n const safeURL = [\n encodeURI(prefix),\n this.getResourceType(),\n this.getSignature(),\n encodeURI(transformationString),\n version,\n encodeURI(publicID).replace(/,/g, '%2C'),\n this.suffix && encodeURI(this.suffix)\n ]\n .filter((a) => a)\n .join('/')\n .replace(/\\?/g, '%3F')\n .replace(/=/g, '%3D');\n const shouldAddAnalytics = this.urlConfig.analytics !== false && !(publicID.includes('?'));\n let queryParamsString = '';\n if (typeof (this.urlConfig.queryParams) === 'object') {\n try {\n const queryParams = new URLSearchParams(this.urlConfig.queryParams);\n if (shouldAddAnalytics) {\n queryParams.set(\"_a\", getSDKAnalyticsSignature(trackedAnalytics));\n }\n queryParamsString = queryParams.toString();\n }\n catch (err) {\n console.error('Error: URLSearchParams is not available so the queryParams object cannot be parsed, please try passing as an already parsed string');\n }\n }\n else {\n queryParamsString = this.urlConfig.queryParams || '';\n if (shouldAddAnalytics) {\n queryParamsString += `${(queryParamsString.length > 0 ? '&' : '')}_a=${getSDKAnalyticsSignature(trackedAnalytics)}`;\n }\n }\n if (queryParamsString) {\n return `${safeURL}?${queryParamsString}`;\n }\n else {\n return safeURL;\n }\n }\n }\n}\nexport { CloudinaryFile };\n","import { CloudinaryFile } from \"./CloudinaryFile.js\";\nimport { DeliveryFormatAction } from \"@cloudinary/transformation-builder-sdk/actions/delivery/DeliveryFormatAction\";\n/**\n * @desc Cloudinary Transformable interface, extended by any class that needs a Transformation Interface\n * @summary SDK\n * @memberOf SDK\n */\nclass CloudinaryTransformable extends CloudinaryFile {\n constructor(publicID, cloudConfig, urlConfig, transformation) {\n /* istanbul ignore next */\n super(publicID, cloudConfig, urlConfig);\n this.transformation = transformation;\n }\n /**\n * @desc A proxy to {@link SDK.Transformation| Transformation} - Calls the same method contained in this.transformation\n * @param {Actions.Animated} animated\n * @return {this}\n */\n animated(animated) {\n this.transformation.animated(animated);\n return this;\n }\n /**\n * @desc A proxy to {@link SDK.Transformation| Transformation} - Calls the same method contained in this.transformation\n * @param {Actions.Border} border\n * @return {this}\n */\n border(border) {\n this.transformation.border(border);\n return this;\n }\n /**\n * @desc A proxy to {@link SDK.Transformation| Transformation} - Calls the same method contained in this.transformation\n * @param {Actions.Reshape} reshape\n * @return {this}\n */\n reshape(reshape) {\n this.transformation.reshape(reshape);\n return this;\n }\n /**\n * @desc A proxy to {@link SDK.Transformation| Transformation} - Calls the same method contained in this.transformation\n * @param {Actions.Resize} resize\n * @return {this}\n */\n resize(resize) {\n this.transformation.resize(resize);\n return this;\n }\n /**\n * @desc An alias to Action Delivery.quality\n * @param {string|number} quality\n * @return {this}\n */\n quality(quality) {\n this.addAction(new DeliveryFormatAction('q', quality));\n return this;\n }\n /**\n * @desc An alias to Action Delivery.format\n * @param {string} format\n * @return {this}\n */\n format(format) {\n this.addAction(new DeliveryFormatAction('f', format));\n return this;\n }\n /**\n * @desc A proxy to {@link SDK.Transformation| Transformation} - Calls the same method contained in this.transformation\n * @param {Actions.RoundCorners} roundCorners\n * @return {this}\n */\n roundCorners(roundCorners) {\n this.transformation.roundCorners(roundCorners);\n return this;\n }\n /**\n * @desc A proxy to {@link SDK.Transformation| Transformation} - Calls the same method contained in this.transformation\n * @return {this}\n */\n overlay(overlayAction) {\n this.transformation.overlay(overlayAction);\n return this;\n }\n /**\n * @desc A proxy to {@link SDK.Transformation| Transformation} - Calls the same method contained in this.transformation\n * @param {Actions.Variable} variableAction\n * @return {this}\n */\n addVariable(variableAction) {\n this.transformation.addVariable(variableAction);\n return this;\n }\n /**\n * @desc A proxy to {@link SDK.Transformation| Transformation} - Calls the same method contained in this.transformation\n * @param {Actions.Condition} conditionalAction\n * @return {this}\n */\n conditional(conditionalAction) {\n this.transformation.conditional(conditionalAction);\n return this;\n }\n /**\n * @desc A proxy to {@link SDK.Transformation| Transformation} - Calls the same method contained in this.transformation\n * @param {Actions.Effect} effect\n * @return {this}\n */\n effect(effect) {\n this.transformation.effect(effect);\n return this;\n }\n /**\n * @desc A proxy to {@link SDK.Transformation| Transformation} - Calls the same method contained in this.transformation\n * @param {Actions.Adjust} action\n * @return {this}\n */\n adjust(action) {\n this.transformation.adjust(action);\n return this;\n }\n /**\n * @desc A proxy to {@link SDK.Transformation| Transformation} - Calls the same method contained in this.transformation\n * @param {Actions.Rotate} rotate\n * @return {this}\n */\n rotate(rotate) {\n this.transformation.rotate(rotate);\n return this;\n }\n /**\n * @desc A proxy to {@link SDK.Transformation| Transformation} - Calls the same method contained in this.transformation\n * @param {Actions.NamedTransformation} namedTransformation\n * @return {this}\n */\n namedTransformation(namedTransformation) {\n this.transformation.namedTransformation(namedTransformation);\n return this;\n }\n /**\n * @desc A proxy to {@link SDK.Transformation| Transformation} - Calls the same method contained in this.transformation\n * @param {Actions.Delivery} deliveryAction\n * @return {this}\n */\n delivery(deliveryAction) {\n this.transformation.delivery(deliveryAction);\n return this;\n }\n /**\n * @desc A proxy to {@link SDK.Transformation| Transformation} - Calls the same method contained in this.transformation\n * @param {Qualifiers.color} color\n * @return {this}\n */\n backgroundColor(color) {\n this.transformation.backgroundColor(color);\n return this;\n }\n /**\n * @desc A proxy to {@link SDK.Transformation| Transformation} - Calls the same method contained in this.transformation\n * @param {Actions.PSDTools} action\n * @return {this}\n */\n psdTools(action) {\n this.transformation.psdTools(action);\n return this;\n }\n /**\n * @desc A proxy to {@link SDK.Transformation| Transformation} - Calls the same method contained in this.transformation\n * @param {Actions.Extract} action\n * @return {this}\n */\n extract(action) {\n this.transformation.extract(action);\n return this;\n }\n /**\n * @desc A proxy to {@link SDK.Transformation| Transformation} - Calls the same method contained in this.transformation\n * @param {Qualifiers.Flag | string} flagQualifier\n * @return {this}\n */\n addFlag(flagQualifier) {\n this.transformation.addFlag(flagQualifier);\n return this;\n }\n /**\n * @desc A proxy to {@link SDK.Transformation| Transformation} - Calls the same method contained in this.transformation\n * @param {Actions.CustomFunction} customFunction\n * @return {this}\n */\n customFunction(customFunction) {\n this.transformation.customFunction(customFunction);\n return this;\n }\n /**\n * @desc A proxy to {@link SDK.Transformation| Transformation} - Calls the same method contained in this.transformation\n * @param {SDK.Action | string} action\n * @return {this}\n */\n addAction(action) {\n this.transformation.addAction(action);\n return this;\n }\n /**\n * @description Extend your transformation with another transformation\n * @param { string | SDK.Transformation } tx\n */\n addTransformation(tx) {\n this.transformation.addTransformation(tx);\n return this;\n }\n /**\n * @desc A proxy to {@link SDK.Transformation| Transformation} - Calls the same method contained in this.transformation\n * @return {string}\n */\n toString() {\n return this.transformation.toString();\n }\n /**\n * @desc A proxy to {@link SDK.Transformation| Transformation} - Calls the same method contained in this.transformation\n * @return {this}\n */\n underlay(underlayAction) {\n this.transformation.underlay(underlayAction);\n return this;\n }\n toURL(overwriteOptions = {}) {\n return this.createCloudinaryURL(this.transformation, overwriteOptions === null || overwriteOptions === void 0 ? void 0 : overwriteOptions.trackedAnalytics);\n }\n}\nexport { CloudinaryTransformable };\n","import { ImageTransformation } from \"@cloudinary/transformation-builder-sdk/transformation/ImageTransformation\";\nimport { CloudinaryTransformable } from \"./CloudinaryTransformable.js\";\n/**\n * @desc Cloudinary image asset, with image-related transformations\n * @summary SDK\n * @memberOf SDK\n */\nclass CloudinaryImage extends CloudinaryTransformable {\n constructor(publicID, cloudConfig, urlConfig) {\n /* istanbul ignore next */\n super(publicID, cloudConfig, urlConfig, new ImageTransformation());\n }\n}\nexport { CloudinaryImage };\n","import { CloudinaryTransformable } from \"./CloudinaryTransformable.js\";\nimport { VideoTransformation } from \"../transformation/VideoTransformation.js\";\n/**\n * @desc Cloudinary video asset, with video-related transformations\n * @summary SDK\n * @memberOf SDK\n */\nclass CloudinaryVideo extends CloudinaryTransformable {\n constructor(publicID, cloudConfig, urlConfig) {\n /* istanbul ignore next */\n super(publicID, cloudConfig, urlConfig, new VideoTransformation());\n this.assetType = 'video';\n }\n /**\n * @desc A proxy to {@link SDK.Transformation| Transformation} - Calls the same method contained in this.transformation\n * @param {Actions.Transcode} action\n * @return {this}\n */\n transcode(action) {\n this.transformation.transcode(action);\n return this;\n }\n /**\n * @desc A proxy to {@link SDK.Transformation| Transformation} - Calls the same method contained in this.transformation\n * @param {Actions.VideoEdit} action\n * @return {this}\n */\n videoEdit(action) {\n this.transformation.videoEdit(action);\n return this;\n }\n}\nexport { CloudinaryVideo };\n","import { CloudinaryImage } from \"../assets/CloudinaryImage.js\";\nimport { CloudinaryVideo } from \"../assets/CloudinaryVideo.js\";\nclass Cloudinary {\n constructor(cloudinaryConfig) {\n if (cloudinaryConfig) {\n this.cloudinaryConfig = cloudinaryConfig;\n }\n }\n image(publicID) {\n return new CloudinaryImage(publicID, this.cloudinaryConfig.cloud, this.cloudinaryConfig.url);\n }\n video(publicID) {\n return new CloudinaryVideo(publicID, this.cloudinaryConfig.cloud, this.cloudinaryConfig.url);\n }\n setConfig(cloudinaryConfig) {\n this.cloudinaryConfig = cloudinaryConfig;\n return this;\n }\n getConfig() {\n return this.cloudinaryConfig;\n }\n extendConfig() {\n // Future implementation\n }\n}\nexport { Cloudinary };\n","import { type TransformerOption } from '@cld-apis/types'\nimport { buildImageUrl, setConfig } from 'cloudinary-build-url'\nimport emojiRegex from 'emoji-regex'\nimport { toBase64 } from './utils/misc.tsx'\nimport { type CSSProperties } from 'react'\nimport clsx from 'clsx'\nimport { Cloudinary } from '@cloudinary/url-gen'\n\nconst cloudName = 'dnpe4swr2'\n\nsetConfig({\n cloudName,\n})\n\nexport const cloudinaryInstance = new Cloudinary({\n cloud: {\n cloudName,\n },\n})\n\ntype ImageBuilder = {\n (transformations?: TransformerOption): string\n alt: string\n id: string\n className?: string\n style?: CSSProperties\n}\nconst createImages = <\n ImageType extends Record<\n string,\n Pick<ImageBuilder, 'id' | 'alt' | 'className' | 'style'>\n >,\n>(\n images: ImageType,\n) => {\n const imageBuilders: Record<string, ImageBuilder> = {}\n for (const [name, { id, alt, className, style }] of Object.entries(images)) {\n imageBuilders[name] = getImageBuilder(id, alt, { className, style })\n }\n return imageBuilders as { [Name in keyof ImageType]: ImageBuilder }\n}\n\nfunction getImageBuilder(\n id: string,\n alt: string = '',\n { className, style }: { className?: string; style?: CSSProperties } = {},\n): ImageBuilder {\n function imageBuilder(transformations?: TransformerOption) {\n return buildImageUrl(id, { transformations })\n }\n imageBuilder.alt = alt\n imageBuilder.id = id\n imageBuilder.className = className\n imageBuilder.style = style\n return imageBuilder\n}\n\nconst square = { aspectRatio: '1/1' } satisfies CSSProperties\n\nconst images = createImages({\n vinhAvatar: {\n id: 'vinh/avatar',\n alt: 'Young Vinh',\n style: square,\n },\n defaultFeaturedImage: {\n id: 'blog/default-featured-image.jpg',\n alt: 'Vinh Nguyen',\n },\n homeCover1: {\n id: 'blog/home-illustrations/black-hole-universe-1_yexnay',\n alt: 'Credit: Kurzgesagt – In a Nutshell - Back Hole Universe',\n },\n homeCover2: {\n id: 'blog/home-illustrations/black-hole-universe-2_sotdd0',\n alt: 'Credit: Kurzgesagt – In a Nutshell - Back Hole Universe',\n },\n homeCover3: {\n id: 'blog/home-illustrations/black-hole-universe-3_w4kjep',\n alt: 'Credit: Kurzgesagt – In a Nutshell - Back Hole Universe',\n },\n homeCover4: {\n id: 'blog/home-illustrations/infinite-universe-1_wt3ohc',\n alt: 'Credit: Kurzgesagt – In a Nutshell - Infinite Universe',\n },\n homeCover5: {\n id: 'blog/home-illustrations/infinite-universe-2_snym75',\n alt: 'Credit: Kurzgesagt – In a Nutshell - Infinite Universe',\n },\n seriesCover: {\n id: 'blog/series/hero_flegru',\n alt: 'Photo by Clay Banks on Unsplash',\n },\n})\n\nfunction getImgProps(\n imageBuilder: ImageBuilder,\n {\n widths,\n sizes,\n transformations,\n className,\n style,\n }: {\n widths: Array<number>\n sizes: Array<string>\n transformations?: TransformerOption\n className?: string\n style?: CSSProperties\n },\n) {\n const averageSize = Math.ceil(widths.reduce((a, s) => a + s) / widths.length)\n const aspectRatio = transformations?.resize?.aspectRatio\n ? transformations.resize.aspectRatio.replace(':', '/')\n : transformations?.resize?.height && transformations.resize.width\n ? `${transformations.resize.width}/${transformations.resize.height}`\n : imageBuilder.style?.aspectRatio\n\n return {\n style: {\n ...imageBuilder.style,\n aspectRatio,\n ...style,\n },\n className: clsx(imageBuilder.className, className),\n alt: imageBuilder.alt,\n src: imageBuilder({\n quality: 'auto',\n format: 'auto',\n ...transformations,\n resize: { width: averageSize, ...transformations?.resize },\n }),\n srcSet: widths\n .map(width =>\n [\n imageBuilder({\n quality: 'auto',\n format: 'auto',\n ...transformations,\n resize: { width, ...transformations?.resize },\n }),\n `${width}w`,\n ].join(' '),\n )\n .join(', '),\n sizes: sizes.join(', '),\n crossOrigin: 'anonymous',\n } as const\n}\n\nfunction getSocialImageWithPreTitle({\n title,\n preTitle,\n featuredImage: img,\n}: {\n title: string\n preTitle: string\n featuredImage: string\n url: string\n}) {\n const vars = `$th_1256,$tw_2400,$gw_$tw_div_24,$gh_$th_div_12`\n\n const encodedPreTitle = doubleEncode(emojiStrip(preTitle))\n const preTitleSection = `co_rgb:a9adc1,c_fit,g_north_west,w_$gw_mul_14,h_$gh,x_$gw_mul_1.5,y_$gh_mul_1.3,l_text:Arial_24_bold:${encodedPreTitle}`\n\n const encodedTitle = doubleEncode(emojiStrip(title))\n const titleSection = `co_white,c_fit,g_north_west,w_$gw_mul_13.5,h_$gh_mul_7,x_$gw_mul_1.5,y_$gh_mul_2.3,l_text:roboto_100_normal_left:${encodedTitle}`\n\n const featuredImageIsRemote = img.startsWith('http')\n const featuredImageCloudinaryId = featuredImageIsRemote\n ? toBase64(img)\n : img.replace(/\\//g, ':')\n const featuredImageLayerType = featuredImageIsRemote ? 'l_fetch:' : 'l_'\n const featuredImageSection = `c_fill,ar_3:4,r_12,g_east,h_$gh_mul_10,x_$gw,${featuredImageLayerType}${featuredImageCloudinaryId}`\n\n return [\n `https://res.cloudinary.com/${cloudName}/image/upload`,\n vars,\n preTitleSection,\n titleSection,\n featuredImageSection,\n `c_fill,w_$tw,h_$th/blog/default-social-background.png`,\n ].join('/')\n}\n\nfunction getGenericSocialImage({\n words,\n featuredImage: img,\n}: {\n words: string\n featuredImage: string\n url: string\n}) {\n const vars = `$th_1256,$tw_2400,$gw_$tw_div_24,$gh_$th_div_12`\n\n const encodedWords = doubleEncode(emojiStrip(words))\n const primaryWordsSection = `co_white,c_fit,g_north_west,w_$gw_mul_10,h_$gh_mul_7,x_$gw_mul_1.3,y_$gh_mul_1.5,l_text:roboto_80_normal_left:${encodedWords}`\n\n const featuredImageIsRemote = img.startsWith('http')\n const featuredImageCloudinaryId = featuredImageIsRemote\n ? toBase64(img)\n : img.replace(/\\//g, ':')\n const featuredImageLayerType = featuredImageIsRemote ? 'l_fetch:' : 'l_'\n\n const featureImageSection = `c_fit,g_east,w_$gw_mul_11,h_$gh_mul_11,x_$gw,${featuredImageLayerType}${featuredImageCloudinaryId}`\n\n const backgroundSection = `c_fill,w_$tw,h_$th/blog/default-social-background.png`\n return [\n `https://res.cloudinary.com/${cloudName}/image/upload`,\n vars,\n primaryWordsSection,\n featureImageSection,\n backgroundSection,\n ].join('/')\n}\n\nfunction emojiStrip(string: string) {\n return string\n .replace(emojiRegex(), '')\n .split(' ')\n .filter(Boolean)\n .join(' ')\n .trim()\n}\n\nfunction doubleEncode(s: string) {\n return encodeURIComponent(encodeURIComponent(s))\n}\n\nexport {\n images,\n getImgProps,\n getImageBuilder,\n getGenericSocialImage,\n getSocialImageWithPreTitle,\n}\nexport type { ImageBuilder }\n","import { clsx } from 'clsx'\nimport * as React from 'react'\n\ninterface GridProps {\n children: React.ReactNode\n overflow?: boolean\n className?: string\n as?: React.ElementType\n id?: string\n nested?: boolean\n rowGap?: boolean\n featured?: boolean\n}\n\nconst Grid = React.forwardRef<HTMLElement, GridProps>(function Grid(\n { children, className, as: Tag = 'div', featured, nested, rowGap, id },\n ref,\n) {\n return (\n <Tag\n ref={ref}\n id={id}\n className={clsx('relative', {\n 'mx-10vw': !nested,\n 'w-full': nested,\n 'py-10 md:py-24 lg:pb-40 lg:pt-36': featured,\n })}\n >\n {featured ? (\n <div className=\"absolute inset-0 -mx-5vw\">\n <div className=\"bg-secondary mx-auto h-full w-full max-w-8xl rounded-lg\" />\n </div>\n ) : null}\n\n <div\n className={clsx(\n 'relative grid grid-cols-4 gap-x-4 md:grid-cols-8 lg:grid-cols-12 lg:gap-x-6',\n {\n 'mx-auto max-w-7xl': !nested,\n 'gap-y-4 lg:gap-y-6': rowGap,\n },\n className,\n )}\n >\n {children}\n </div>\n </Tag>\n )\n})\n\n/**\n * Use for development only! It renders the grid columns and gaps as page overlay\n */\nfunction GridLines() {\n if (ENV.NODE_ENV !== 'development') {\n throw new Error('<GridLines /> should only be used during development')\n }\n\n return (\n <div className=\"pointer-events-none fixed inset-0 z-10 select-none\">\n <Grid>\n {Array.from({ length: 12 }).map((_, idx) => (\n <div\n key={idx}\n className=\"flex h-screen items-start bg-black text-black opacity-10 dark:bg-white dark:text-white\"\n >\n <div className=\"w-full pt-4 text-center text-lg text-black dark:text-white\">\n {idx + 1}\n </div>\n </div>\n ))}\n </Grid>\n </div>\n )\n}\n\nexport { Grid, GridLines }\n","/**\n * This file generates keyframes for any animation, you can extend it with more properties if needed.\n * It is designed to be used with Tailwind config and CSS variables.\n * Main problem it solves is implementing a sequence of animations with static keyframes\n * and allowing it to be controlled with CSS variables.\n * @param name Name of the animation, will be used as a prefix for CSS variables\n * @param steps Maximum amount of steps the animation will have including all conditional steps\n * @param initial Initial style for the animation\n * @param visible Visible style for the animation\n */\nfunction generateAnimation({\n name,\n steps,\n initial,\n visible,\n}: {\n name: string\n steps: number\n initial: { opacity?: number; x?: string; y?: string }\n visible: { opacity?: number; x?: string; y?: string }\n}) {\n const keyframes = new Map<string, { opacity: string; transform: string }>()\n\n keyframes.set('0%', {\n opacity: (initial.opacity ?? 0).toString(),\n transform: `translate(${initial.x ?? 0}, ${initial.y ?? 0})`,\n })\n\n for (let step = 0; step < steps; step++) {\n keyframes.set(`${(100 * (step + 1)) / steps}%`, {\n opacity: `var(--${name}-opacity-step-${step})`,\n transform: `translate(var(--${name}-x-step-${step}), var(--${name}-y-step-${step}))`,\n })\n }\n\n function getVariables(activeStep: number) {\n const variables = new Map<string, string | number>()\n for (let step = 0; step < steps; step++) {\n const value = step >= activeStep ? visible : initial\n variables.set(`--${name}-opacity-step-${step}`, value.opacity ?? 0)\n variables.set(`--${name}-x-step-${step}`, value.x ?? 0)\n variables.set(`--${name}-y-step-${step}`, value.y ?? 0)\n }\n return Object.fromEntries(variables)\n }\n\n return {\n name,\n keyframes: Object.fromEntries(keyframes),\n getVariables,\n }\n}\n\nexport const heroTextAnimation = generateAnimation({\n name: 'hero-text-reveal',\n steps: 4,\n initial: {\n opacity: 0,\n y: '25px',\n },\n visible: {\n opacity: 1,\n y: '0px',\n },\n})\n","import { type TransformerOption } from '@cld-apis/types'\nimport { clsx } from 'clsx'\nimport { motion, useReducedMotion, type HTMLMotionProps } from 'framer-motion'\nimport { getImgProps, type ImageBuilder } from '~/images.tsx'\nimport { ArrowLink } from '../arrow-button.tsx'\nimport { Grid } from '../grid.tsx'\nimport { H2, H6 } from '../typography.tsx'\nimport { heroTextAnimation } from '~/utils/animations.ts'\n\nexport type HeroSectionProps = {\n title: string | React.ReactNode\n subtitle?: string | React.ReactNode\n smallSubtitle?: string\n action?: React.ReactNode\n animatedTitle?: boolean\n animatedTitleStyles?: string\n as?: React.ElementType\n} & (\n | {\n imageProps?: HTMLMotionProps<'img'>\n imageSize?: 'medium' | 'large' | 'giant'\n image?: never\n imageBuilder?: never\n imageTransformations?: never\n }\n | {\n imageProps?: never\n imageSize?: never\n image?: never\n imageBuilder?: never\n imageTransformations?: never\n }\n | {\n imageProps?: never\n imageSize?: 'medium' | 'large' | 'giant'\n image: React.ReactNode\n imageBuilder?: never\n imageTransformations?: never\n }\n | {\n imageProps?: never\n imageSize?: 'medium' | 'large' | 'giant'\n image?: never\n imageBuilder: ImageBuilder\n imageTransformations?: TransformerOption\n }\n) &\n (\n | {\n arrowUrl: string\n arrowLabel: string\n }\n | {\n arrowUrl?: never\n arrowLabel?: never\n }\n )\n\nfunction HeroSection({\n action,\n title,\n subtitle,\n smallSubtitle,\n arrowUrl,\n arrowLabel,\n image,\n imageProps,\n imageBuilder,\n imageSize = 'medium',\n as = 'header',\n animatedTitle,\n animatedTitleStyles,\n}: HeroSectionProps) {\n const hasImage = Boolean(image ?? imageProps ?? imageBuilder)\n const shouldReduceMotion = useReducedMotion()\n let animationStep = 0\n return (\n <Grid\n as={as}\n className={clsx('lg: mb-24 h-auto pt-24 lg:min-h-[10rem] lg:pb-12', {\n 'lg:mb-64': arrowLabel,\n 'lg:mb-0': !arrowLabel,\n })}\n >\n {hasImage ? (\n <div\n className={clsx('col-span-full mb-12 lg:mb-0', {\n 'px-10 lg:col-span-5 lg:col-start-7': imageSize === 'medium',\n 'flex items-start justify-end lg:col-span-6 lg:col-start-7':\n imageSize === 'large',\n 'flex items-center justify-center lg:col-span-7 lg:col-start-6 lg:-mr-5vw lg:px-0':\n imageSize === 'giant',\n })}\n >\n {imageProps ? (\n <motion.img\n {...imageProps}\n className={clsx(\n 'h-auto w-full object-contain',\n {\n 'max-h-50vh': imageSize === 'medium',\n 'max-h-75vh': imageSize === 'giant',\n },\n imageProps.className,\n )}\n initial={{ scale: shouldReduceMotion ? 1 : 1.5, opacity: 0 }}\n animate={{ scale: 1, opacity: 1 }}\n transition={{ duration: 0.75 }}\n />\n ) : imageBuilder ? (\n <img\n {...getHeroImageProps(imageBuilder, {\n className: clsx(\n 'h-auto w-full object-contain motion-safe:animate-hero-image-reveal rounded-lg',\n {\n 'max-h-50vh': imageSize === 'medium',\n 'max-h-75vh': imageSize === 'giant',\n },\n ),\n })}\n />\n ) : (\n image\n )}\n </div>\n ) : null}\n\n <div\n className={clsx(\n 'col-span-full pt-6 lg:col-start-1 lg:row-start-1 lg:flex lg:h-full lg:flex-col',\n {\n 'lg:col-span-5': hasImage,\n 'lg:col-span-7': !hasImage,\n },\n )}\n >\n <div className=\"flex flex-auto flex-col\">\n <H2\n as=\"h2\"\n className={clsx(\n `motion-safe:animate-hero-text-reveal ${animatedTitleStyles}`,\n {\n 'text-gradient-animated': animatedTitle,\n },\n )}\n style={heroTextAnimation.getVariables(animationStep++)}\n >\n {title}\n </H2>\n {subtitle ? (\n <H2\n as=\"p\"\n variant=\"secondary\"\n className=\"mt-3 motion-safe:animate-hero-text-reveal\"\n style={heroTextAnimation.getVariables(animationStep++)}\n >\n {subtitle}\n </H2>\n ) : null}\n {smallSubtitle ? (\n <H6\n variant=\"secondary\"\n className=\"mt-3 motion-safe:animate-hero-text-reveal\"\n style={heroTextAnimation.getVariables(animationStep++)}\n >\n {smallSubtitle}\n </H6>\n ) : null}\n {action ? (\n <div\n className=\"mt-14 flex flex-col space-y-4 motion-safe:animate-hero-text-reveal\"\n style={heroTextAnimation.getVariables(animationStep++)}\n >\n {action}\n </div>\n ) : null}\n </div>\n {arrowUrl ? (\n <div\n className=\"hidden pt-12 lg:block motion-safe:animate-hero-text-reveal\"\n style={heroTextAnimation.getVariables(animationStep++)}\n >\n <ArrowLink to={arrowUrl} direction=\"down\" textSize=\"small\">\n {arrowLabel}\n </ArrowLink>\n </div>\n ) : null}\n </div>\n </Grid>\n )\n}\n\nfunction getHeroImageProps(\n imageBuilder: ImageBuilder,\n {\n transformations,\n style,\n className,\n }: {\n transformations?: TransformerOption\n style?: React.CSSProperties\n className?: string\n } = {},\n) {\n return getImgProps(imageBuilder, {\n style,\n className,\n widths: [256, 550, 700, 900, 1300, 1800],\n sizes: [\n '(max-width: 1023px) 80vw',\n '(min-width: 1024px) and (max-width: 1279px) 50vw',\n '(min-width: 1280px) 900px',\n ],\n transformations,\n })\n}\n\nexport { HeroSection, getHeroImageProps }\n"],"names":["isResponse","value","captureRemixErrorBoundaryError","error","isNodeEnv","captureException","r","f","n","o","clsx","MotionConfigContext","createContext","p","MotionContext","PresenceContext","isBrowser","useIsomorphicLayoutEffect","useLayoutEffect","useEffect","LazyContext","camelToDash","str","optimizedAppearDataId","optimizedAppearDataAttribute","MotionGlobalConfig","Queue","process","index","createRenderStep","runNextFrame","thisFrame","nextFrame","numToRun","isProcessing","flushNextFrame","toKeepAlive","step","callback","keepAlive","immediate","addToCurrentFrame","queue","frameData","i","stepsOrder","maxElapsed","createRenderBatcher","scheduleNextBatch","allowKeepAlive","useDefaultElapsed","state","steps","acc","key","processStep","stepId","processBatch","timestamp","wake","microtask","cancelMicrotask","useVisualElement","Component","visualState","props","createVisualElement","parent","useContext","lazyContext","presenceContext","reducedMotionConfig","visualElementRef","useRef","visualElement","useInsertionEffect","wantsHandoff","isRefObject","ref","useMotionRef","externalRef","useCallback","instance","isVariantLabel","v","isAnimationControls","variantPriorityOrder","variantProps","isControllingVariants","name","isVariantNode","getCurrentTreeVariants","context","initial","animate","useCreateMotionContext","useMemo","variantLabelsAsDependency","prop","featureProps","featureDefinitions","loadFeatures","features","LayoutGroupContext","SwitchLayoutGroupContext","motionComponentSymbol","createMotionComponent","preloadedFeatures","useRender","useVisualState","MotionComponent","MeasureLayout","configAndProps","useLayoutId","isStatic","initialLayoutGroupConfig","isStrict","jsxs","jsx","ForwardRefComponent","forwardRef","layoutId","layoutGroupId","createMotionProxy","createConfig","custom","customMotionComponentConfig","componentCache","_target","lowercaseSVGElements","isSVGComponent","scaleCorrectors","addScaleCorrector","correctors","transformPropOrder","transformProps","isForcedMotionValue","layout","isMotionValue","translateAlias","numTransforms","buildTransform","transform","enableHardwareAcceleration","allowTransformNone","transformIsDefault","transformTemplate","transformString","transformName","checkStringStartsWith","token","isCSSVariableName","startsAsVariableToken","isCSSVariableToken","singleCssVariableRegex","getValueAsType","type","clamp","min","max","number","alpha","scale","sanitize","floatRegex","colorRegex","singleColorRegex","isString","createUnitType","unit","degrees","percent","px","vh","vw","progressPercentage","int","numberValueTypes","buildHTMLStyles","latestValues","options","style","vars","transformOrigin","hasTransform","hasTransformOrigin","transformIsNone","valueType","valueAsType","originX","originY","originZ","createHtmlRenderState","copyRawValuesOnly","target","source","useInitialMotionValues","useStyle","styleProp","useHTMLProps","htmlProps","validMotionProps","isValidMotionProp","shouldForward","loadExternalIsValidProp","isValidProp","filterProps","isDom","forwardMotionProps","filteredProps","calcOrigin","origin","offset","size","calcSVGTransformOrigin","dimensions","pxOriginX","pxOriginY","dashKeys","camelKeys","buildSVGPath","attrs","length","spacing","useDashCase","keys","pathLength","pathSpacing","buildSVGAttrs","attrX","attrY","attrScale","pathOffset","latest","isSVGTag","createSvgRenderState","tag","useSVGProps","_isStatic","visualProps","rawStyles","createUseRender","elementProps","Fragment","children","renderedChildren","createElement","renderHTML","element","projection","camelCaseAttributes","renderSVG","renderState","_styleProp","scrapeMotionValuesFromProps","prevProps","_a","newValues","scrapeMotionValuesFromProps$1","targetKey","getValueState","resolveVariantFromProps","definition","current","velocity","useConstant","init","isKeyframesTarget","isCustomValue","resolveFinalValueInKeyframes","resolveMotionValue","unwrappedValue","makeState","createRenderState","onMount","makeLatestValues","makeUseVisualState","config","make","scrapeMotionValues","values","motionValues","isControllingVariants$1","isVariantNode$1","isInitialAnimationBlocked","variantToSet","resolved","transitionEnd","transition","valueTarget","noop","any","frame","cancelFrame","svgMotionConfig","htmlMotionConfig","createDomMotionConfig","addDomEvent","eventName","handler","isPrimaryPointer","event","extractEventInfo","pointType","addPointerInfo","addPointerEvent","combineFunctions","a","b","pipe","transformers","createLock","lock","openLock","globalHorizontalLock","globalVerticalLock","getGlobalLock","drag","openHorizontal","openVertical","isDragActive","openGestureLock","Feature","node","addHoverEvent","isActive","callbackName","handleEvent","info","HoverGesture","FocusGesture","isFocusVisible","isNodeOrChild","child","fireSyntheticPointerEvent","syntheticPointerEvent","PressGesture","startEvent","startInfo","removePointerUpListener","endEvent","endInfo","onTap","onTapCancel","globalTapTarget","removePointerCancelListener","cancelEvent","cancelInfo","handleKeydown","keydownEvent","handleKeyup","keyupEvent","removeKeydownListener","handleBlur","removeBlurListener","onTapStart","whileTap","removePointerListener","removeFocusListener","observerCallbacks","observers","fireObserverCallback","entry","fireAllObserverCallbacks","entries","initIntersectionObserver","root","lookupRoot","rootObservers","observeIntersection","rootInteresectionObserver","thresholdNames","InViewFeature","viewport","rootMargin","amount","once","onIntersectionUpdate","isIntersecting","onViewportEnter","onViewportLeave","hasViewportOptionChanged","prevViewport","gestureAnimations","shallowCompare","next","prev","prevLength","resolveVariant","secondsToMilliseconds","seconds","millisecondsToSeconds","milliseconds","underDampedSpring","criticallyDampedSpring","keyframesTransition","ease","getDefaultTransition","valueKey","keyframes","isTransitionDefined","when","_delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed","getValueTransition","isNotNull","getFinalKeyframe","finalKeyframe","resolvedKeyframes","now","clearTime","time","newTime","isZeroValueString","isNone","invariant","isNumericalString","splitCSSVariableRegex","parseCSSVariable","match","token1","token2","fallback","getVariableValue","depth","trimmed","positionalKeys","isNumOrPxType","getPosFromMatrix","matrix","pos","getTranslateFromMatrix","pos2","pos3","_bbox","matrix3d","transformKeys","nonTranslationalTransformKeys","removeNonTranslationalTransform","removedTransforms","positionalValues","x","paddingLeft","paddingRight","y","paddingTop","paddingBottom","top","left","testValueType","auto","dimensionValueTypes","findDimensionValueType","toResolve","isScheduled","anyNeedsMeasurement","measureAllKeyframes","resolversToMeasure","resolver","elementsToMeasure","transformsToRestore","restore","readAllKeyframes","flushKeyframeResolvers","KeyframeResolver","unresolvedKeyframes","onComplete","motionValue","isAsync","currentValue","valueAsRead","isColorString","testProp","splitColor","aName","bName","cName","c","clampRgbUnit","rgbUnit","rgba","red","green","blue","alpha$1","parseHex","g","hex","hsla","hue","saturation","lightness","color","test","_b","NUMBER_TOKEN","COLOR_TOKEN","VAR_TOKEN","VAR_FUNCTION_TOKEN","SPLIT_TOKEN","complexRegex","analyseComplexValue","originalValue","indexes","types","split","parsedValue","parseComplexValue","createTransformer","numSections","output","convertNumbersToZero","getAnimatableNone","parsed","complex","maxDefaults","applyDefaultFilter","defaultValue","functionRegex","filter","functions","defaultValueTypes","getDefaultValueType","defaultValueType","invalidTemplates","makeNoneKeyframesAnimatable","noneKeyframeIndexes","animatableTemplate","keyframe","noneIndex","DOMKeyframesResolver","originType","targetType","measureKeyframe","finalKeyframeIndex","unsetTransformName","unsetTransformValue","memo","result","isAnimatable","hasKeyframesChanged","canAnimate","originKeyframe","targetKeyframe","isOriginAnimatable","isTargetAnimatable","BaseAnimation","autoplay","delay","onUpdate","isGenerator","resolvedAnimation","resolve","reject","velocityPerSecond","frameDuration","velocitySampleDuration","calcGeneratorVelocity","resolveValue","prevT","safeMin","minDuration","maxDuration","minDamping","maxDamping","findSpring","duration","bounce","mass","envelope","derivative","dampingRatio","undampedFreq","exponentialDecay","delta","calcAngularFreq","e","initialGuess","approximateRoot","stiffness","rootIterations","durationKeys","physicsKeys","isSpringType","getSpringOptions","springOptions","derived","spring","restDelta","restSpeed","damping","isResolvedFromDuration","initialVelocity","initialDelta","undampedAngularFreq","isGranularScale","resolveSpring","angularFreq","t","dampedAngularFreq","freqForT","currentVelocity","isBelowVelocityThreshold","isBelowDisplacementThreshold","inertia","power","timeConstant","bounceDamping","bounceStiffness","modifyTarget","isOutOfBounds","nearestBoundary","amplitude","ideal","calcDelta","calcLatest","applyFriction","timeReachedBoundary","spring$1","checkCatchBoundary","hasUpdatedFrame","calcBezier","a1","a2","subdivisionPrecision","subdivisionMaxIterations","binarySubdivide","lowerBound","upperBound","mX1","mX2","currentX","currentT","cubicBezier","mY1","mY2","getTForX","aX","easeIn","easeOut","easeInOut","isEasingArray","mirrorEasing","easing","reverseEasing","circIn","circOut","circInOut","backOut","backIn","backInOut","anticipate","easingLookup","easingDefinitionToFunction","x1","y1","x2","y2","progress","to","toFromDifference","mixNumber","hueToRgb","q","hslaToRgba","mixImmediate","mixLinearColor","fromExpo","expo","colorTypes","getColorType","asRGBA","model","mixColor","fromRGBA","toRGBA","blended","invisibleValues","mixVisibility","mixNumber$1","getMixer","mixComplex","mixArray","mixObject","numValues","blendValue","matchOrder","orderedOrigin","pointers","originIndex","originValue","template","originStats","targetStats","mix","createMixers","customMixer","mixers","mixerFactory","numMixers","mixer","easingFunction","interpolate","input","isClamp","inputLength","interpolator","progressInRange","fillOffset","remaining","offsetProgress","defaultOffset","arr","convertOffsetToTimes","defaultEasing","keyframeValues","times","easingFunctions","absoluteTimes","mapTimeToKeyframe","maxGeneratorDuration","calcGeneratorDuration","generator","timeStep","frameloopDriver","update","passTimestamp","generators","percentToProgress","MainThreadAnimation","KeyframeResolver$1","onStop","onResolved","keyframes$1","generatorFactory","mapPercentToKeyframes","mirroredGenerator","calculatedDuration","resolvedDuration","totalDuration","sample","timeWithoutDelay","isInDelayPhase","frameGenerator","currentIteration","iterationProgress","done","isAnimationFinished","newSpeed","hasChanged","driver","onPlay","isBezierDefinition","isWaapiSupportedEasing","supportedWaapiEasing","cubicBezierAsString","d","mapEasingToNativeEasingWithDefault","mapEasingToNativeEasing","animateStyle","valueName","keyframeOptions","supportsWaapi","acceleratedValues","sampleDelta","requiresPregeneratedKeyframes","pregenerateKeyframes","sampleAnimation","pregeneratedKeyframes","AcceleratedAnimation","pregeneratedAnimation","animation","timeline","sampleTime","observeTimeline","prevProgress","onFrame","currentTime","supportsScrollTimeline","GroupPlaybackControls","animations","onResolve","onReject","propName","newValue","cancelAll","cancelTimeline","speed","methodName","controls","animateMotionValue","isHandoff","valueTransition","shouldSkip","isWillChangeMotionValue","addUniqueItem","item","removeItem","SubscriptionManager","numSubscriptions","MAX_VELOCITY_DELTA","isFloat","MotionValue","render","prevFrameValue","subscription","unsubscribe","eventManagers","passiveEffect","stopPassiveEffect","endAnimation","startAnimation","setMotionValue","setTarget","getOptimisedAppearId","shouldBlockAnimation","protectedKeys","needsAnimating","shouldBlock","animateTarget","targetAndTransition","transitionOverride","willChange","animationTypeState","appearId","animateVariant","variant","getAnimation","getChildAnimations","forwardDelay","animateChildren","first","last","maxStaggerDuration","generateStaggerDuration","sortByTreeOrder","animateVisualElement","resolvedDefinition","reversePriorityOrder","numAnimationTypes","animateList","createAnimationState","createState","isInitialRender","buildResolvedTypeValues","setAnimateFunction","makeAnimator","animateChanges","changedActiveType","removedKeys","encounteredKeys","removedVariantIndex","typeState","propIsVariant","activeDelta","isInherited","shouldAnimateType","checkVariantsDidChange","handledRemovedValues","definitionList","resolvedValues","prevResolvedValues","allKeys","markToAnimate","valueHasChanged","fallbackAnimation","fallbackTarget","shouldAnimate","setActive","createTypeState","AnimationFeature","prevAnimate","id","ExitAnimationFeature","isPresent","onExitComplete","prevIsPresent","exitAnimation","register","distance","distance2D","xDelta","yDelta","PanSession","handlers","transformPagePoint","contextWindow","dragSnapToOrigin","getPanInfo","isPanStarted","isDistancePastThreshold","point","onStart","onMove","transformPoint","onEnd","onSessionEnd","resumeAnimation","panInfo","initialInfo","onSessionStart","subtractPoint","history","lastDevicePoint","startDevicePoint","getVelocity","timeDelta","timestampedPoint","lastPoint","calcLength","axis","isNear","maxDistance","calcAxisDelta","calcBoxDelta","calcRelativeAxis","relative","calcRelativeBox","calcRelativeAxisPosition","calcRelativePosition","applyConstraints","elastic","calcRelativeAxisConstraints","calcRelativeConstraints","layoutBox","bottom","right","calcViewportAxisConstraints","layoutAxis","constraintsAxis","calcViewportConstraints","constraintsBox","sourceLength","targetLength","rebaseAxisConstraints","constraints","relativeConstraints","defaultElastic","resolveDragElastic","dragElastic","resolveAxisElastic","minLabel","maxLabel","resolvePointElastic","label","createAxisDelta","createDelta","createAxis","createBox","eachAxis","convertBoundingBoxToBox","convertBoxToBoundingBox","transformBoxPoints","topLeft","bottomRight","isIdentityScale","hasScale","scaleX","scaleY","has2DTranslate","is2DTranslate","scalePoint","originPoint","distanceFromOrigin","scaled","applyPointDelta","translate","boxScale","applyAxisDelta","applyBoxDelta","box","applyTreeDeltas","treeScale","treePath","isSharedTransition","treeLength","transformBox","snapToDefault","translateAxis","transformAxis","transforms","scaleKey","originKey","axisOrigin","xKeys","yKeys","measureViewportBox","measurePageBox","rootProjectionNode","viewportBox","scroll","getContextWindow","elementDragControls","VisualElementDragControls","originEvent","snapToCursor","dragPropagation","onDragStart","measuredAxis","animationState","dragDirectionLock","onDirectionLock","onDrag","getCurrentDirection","isDragging","onDragEnd","_point","shouldDrag","axisValue","dragConstraints","prevConstraints","onMeasureDragConstraints","constraintsElement","measuredConstraints","userConstraints","dragMomentum","dragTransition","onDragTransitionEnd","momentumAnimations","dragKey","externalMotionValue","boxProgress","stopPointerListener","dragListener","measureDragConstraints","stopMeasureLayoutListener","stopResizeListener","stopLayoutUpdateListener","hasLayoutChanged","direction","currentDirection","lockThreshold","DragGesture","dragControls","asyncHandler","PanGesture","pointerDownEvent","onPanSessionStart","onPanStart","onPan","onPanEnd","usePresence","useId","globalProjectionState","pixelsToPercent","pixels","correctBorderRadius","correctBoxShadow","projectionDelta","original","shadow","xScale","yScale","averageScale","MeasureLayoutWithContext","layoutGroup","switchLayoutGroup","defaultScaleCorrectors","layoutDependency","stack","promoteContext","safeToRemove","borders","numBorders","asNumber","isPx","mixValues","follow","lead","shouldCrossfadeOpacity","isOnlyMember","easeCrossfadeIn","easeCrossfadeOut","borderLabel","followRadius","getRadius","leadRadius","radiusName","compress","copyAxisInto","originAxis","copyBoxInto","originBox","removePointDelta","removeAxisDelta","sourceAxis","removeAxisTransforms","removeBoxTransforms","sourceBox","isAxisDeltaZero","isDeltaZero","boxEquals","boxEqualsRounded","aspectRatio","NodeStack","prevLead","indexOfNode","member","preserveFollowOpacity","crossfade","resumingFrom","buildProjectionTransform","latestTransform","xTranslate","yTranslate","zTranslate","transformPerspective","rotate","rotateX","rotateY","skewX","skewY","elementScaleX","elementScaleY","compareByDepth","FlatTree","timeout","start","checkElapsed","record","data","isSVGElement","animateSingleValue","motionValue$1","transformAxes","hiddenVisibility","animationTarget","projectionFrameData","resetDistortingTransform","sharedAnimationValues","isOptimisedAppearTree","projectionNode","createProjectionNode","attachResizeListener","defaultParent","measureScroll","checkIsScrollRoot","resetTransform","propagateDirtyNodes","resolveTargetDelta","calcProjection","cleanDirtyNodes","args","subscriptionManager","isLayoutDirty","cancelDelay","resizeUnblockUpdate","finishAnimation","hasRelativeTargetChanged","newLayout","layoutTransition","defaultLayoutTransition","onLayoutAnimationStart","onLayoutAnimationComplete","targetChanged","hasOnlyRelativeTargetChanged","animationOptions","resetSkewAndRotation","shouldNotifyListeners","clearMeasurements","clearIsLayoutDirty","resetTransformStyle","updateLayout","notifyLayoutUpdate","clearSnapshot","removeLeadSnapshots","prevLayout","phase","needsMeasurement","isResetRequested","hasProjection","transformTemplateValue","transformTemplateHasChanged","removeTransform","pageBox","roundBox","boxWithoutScroll","rootScroll","transformOnly","withTransforms","boxWithoutTransform","nodeBox","forceRecalculation","isShared","relativeParent","canSkip","prevTreeScaleX","prevTreeScaleY","prevProjectionTransform","notifyAll","snapshot","snapshotLatestValues","mixedValues","targetDelta","relativeLayout","snapshotSource","layoutSource","isSharedLayoutAnimation","hasOpacityCrossfade","prevRelativeTarget","mixAxisDelta","mixBox","targetWithTransforms","shouldAnimatePositionOnly","xLength","yLength","needsReset","hasDistortingTransform","resetValues","styles","emptyStyles","valuesToRender","correct","applyTo","corrected","num","measuredLayout","animationType","axisSnapshot","layoutDelta","visualDelta","parentSnapshot","parentLayout","relativeSnapshot","mixAxis","userAgentContains","string","roundPoint","roundAxis","DocumentProjectionNode","notify","HTMLProjectionNode","documentNode","prefersReducedMotion","hasReducedMotionListener","initPrefersReducedMotion","motionMediaQuery","setReducedMotionPreferences","updateMotionValuesFromProps","nextValue","prevValue","existingValue","latestValue","visualElementStore","valueTypes","findValueType","featureNames","numFeatures","propEventHandlers","numVariantProps","getClosestProjectingNode","VisualElement","_props","_prevProps","_visualElement","blockInitialAnimation","initialMotionValues","remove","valueIsTransform","removeOnChange","removeOnRenderRequest","other","renderedProps","ProjectionNodeConstructor","isEnabled","FeatureConstructor","ProjectionNode","MeasureLayoutComponent","layoutScroll","layoutRoot","feature","listenerName","listener","startAtParent","closestVariantNode","valueFromInitial","DOMVisualElement","getComputedStyle","HTMLVisualElement","defaultType","computedStyle","SVGVisualElement","createDomVisualElement","motion","useReducedMotion","shouldReduceMotion","useState","useElementState","setState","setRef","el","pointerenter","s","pointerleave","focus","blur","pointerdown","pointerup","keydown","keyup","status","arrowRotationMap","ArrowIcon","className","CheckIcon","CopyIcon","GithubIcon","title","LaptopIcon","MoonIcon","PlusIcon","RssIcon","SearchIcon","SunIcon","fontSize","titleColors","Title","as","rest","Tag","H2","H3","H4","H6","Paragraph","prose","textColorClassName","React.createElement","arrowVariants","getBaseProps","textSize","ArrowButtonContent","MotionLink","Link","ArrowLink","href","BackLink","ConditionOperators","STORAGE_TYPES","RESOURCE_TYPES","ValueAssignable","SEO_TYPES","TRANSFORMERS","ArithmeticExpression","PredefinedVariables","PreDefinedPatterns","AcceptNumbericVars","ConditionalParams","toString","separation","computeCondition","conditionObj","expression","exp","computeConditionExpression","transformations","transformation","toTransformationStr","mapCharacteristic","characteristic","operator","condition","ifCondition","elseCondition","formattedIf","formattedElse","effect","obj","effectValue","Prefix","Formats","OPERATORS_REGEX","mapArithmeticExpression","orgExpression","regex","mapPredefinedVariables","formatValue","convert","mappedArithmetic","converted","hasArithmeticExpression","flags","flagValue","rawTransformation","convertStringValueType","isArithmetic","convertedExpression","format","mappedExpression","computeVariable","variable","varValue","variables","fps","isObj","range","end","resize","width","height","w","h","crop","ar","border","_c","formattedValue","position","xAxis","yAxis","getResize","hasResize","getBorder","borderModification","getPosition","getTransformations","modifier","mapping","isAcceptedNumberic","chainedTransformations","chained","chainedTransformation","isChained","__assign","SHARED_CDNS","CLOUDINARY_REGEX","extractPublicId","link","parts","getSignature","signature","isFormatted","doesPathNeedVersion","publicId","encodePublicId","getVersion","forceVersion","version","needVersion","getSubDomain","cdnSubdomain","cname","getPrefix","cloudName","privateCdn","secureDistribution","_d","secure","hasSecureDistribution","protocol","cdn","accountPath","subDomain","host","getResourceType","resourceType","storageType","urlSuffix","useRootPath","shortern","isUploadImage","useRootForNonUploadedImages","shortenForUploadedImages","typePath","seo","isUrl","getPathToAsset","path","url","cloud","_publicId","prefix","pathToAsset","$options","trans","setConfig","buildUrl","cloudConfig","buildImageUrl","emojiRegex","dist","md5","L","k","K","G","I","F","H","aa","Z","D","B","J","C","P","E","Y","X","W","V","S","Q","N","M","A","z","m","l","j","U","T","R","O","AnchorOrLink","React.forwardRef","download","reload","prefetch","toUrl","shouldUserRegularAnchor","formatNumber","getErrorMessage","typedBoolean","removeTrailingSlash","getDisplayUrl","requestInfo","getUrl","getOrigin","toBase64","useUpdateQueryStringValueWithoutNavigation","queryKey","queryValue","React.useEffect","currentSearchParams","oldQuery","newUrl","message","useCapturedRouteError","useRouteError","isObject","Config","userProvidedConfig","validKeys","ALLOWED_URL_CONFIG","URLConfig","userURLConfig","urlConfig","params","QualifierValue","qualifierValue","delimiter","UnsupportedError","createUnsupportedError","qualifierToJson","QualifierModel","Qualifier","FlagQualifier","flagType","mapToSortedArray","map","array","flag","actionToJson","actionModelIsNotEmpty","sourceTransformationError","ActionModel","Action","qualifier","qualifierKey","prepareColor","BackgroundColor","actionModel","RawAction","raw","isErrorObject","errorObj","lossy","preserveTransparency","progressive","mode","FormatQualifier","val","objectFlip","ACTION_TYPE_TO_CROP_MODE_MAP","ACTION_TYPE_TO_DELIVERY_MODE_MAP","ACTION_TYPE_TO_EFFECT_MODE_MAP","ACTION_TYPE_TO_QUALITY_MODE_MAP","ACTION_TYPE_TO_STREAMING_PROFILE_MODE_MAP","CHROMA_VALUE_TO_CHROMA_MODEL_ENUM","COLOR_SPACE_MODEL_MODE_TO_COLOR_SPACE_MODE_MAP","DELIVERY_MODE_TO_ACTION_TYPE_MAP","DeliveryAction","deliveryKey","deliveryType","modelProperty","deliveryTypeValue","ProgressiveQualifier","DeliveryFormatAction","formatType","Transformation","action","actionToAdd","tx","animatedAction","borderAction","reshapeAction","resizeAction","quality","roundCornersAction","overlayAction","underlayAction","variableAction","conditionAction","effectAction","rotateAction","namedTransformation","deliveryAction","flagQualifier","flagToAdd","customFunction","actions","json","ImageTransformation","VideoTransformation","publicID","isFileName","publicIDContainsVersion","getUrlPrefix","privateCDN","handleAssetType","assetType","handleDeliveryType","getUrlVersion","shouldForceVersion","stringPad","_targetLength","_padString","padString","repeatStringNumTimes","_times","repeatedString","chars","base64Map","char","reverseVersion","semVer","padVersion","segment","encodeVersion","strResult","paddedStringLength","reversedSemver","paddedSemver","paddedBinary","bitString","getAnalyticsOptions","analyticsOptions","packageVersion","encodeOSVersion","major","minor","binaryMajorVersion","binaryMinorVersion","paddedMajor","paddedMinor","getNodeVersion","failedVersion","ensureShapeOfTrackedProperties","trackedAnalytics","defaults","getSDKAnalyticsSignature","_trackedAnalytics","twoPartVersion","removePatchFromSemver","encodedSDKVersion","encodedTechVersion","encodedOSVersion","featureCode","SDKCode","product","osType","semVerStr","CloudinaryFile","newType","newSuffix","newVersion","overwriteOptions","suffixContainsDot","suffixContainsSlash","hasSuffix","regularSEOType","shortSEOType","shorten","transformationString","safeURL","shouldAddAnalytics","queryParamsString","queryParams","CloudinaryTransformable","animated","reshape","roundCorners","conditionalAction","CloudinaryImage","CloudinaryVideo","Cloudinary","cloudinaryConfig","cloudinaryInstance","createImages","images","imageBuilders","alt","getImageBuilder","imageBuilder","square","getImgProps","widths","sizes","averageSize","getSocialImageWithPreTitle","preTitle","img","preTitleSection","doubleEncode","emojiStrip","titleSection","featuredImageIsRemote","featuredImageCloudinaryId","featuredImageSection","getGenericSocialImage","words","primaryWordsSection","featureImageSection","Grid","featured","nested","rowGap","generateAnimation","visible","getVariables","activeStep","heroTextAnimation","HeroSection","subtitle","smallSubtitle","arrowUrl","arrowLabel","image","imageProps","imageSize","animatedTitle","animatedTitleStyles","hasImage","animationStep","getHeroImageProps"],"mappings":"uHA2BA,SAASA,GAAWC,EAAO,CACzB,OACEA,GAAS,MAET,OAAOA,EAAM,QAAW,UACxB,OAAOA,EAAM,YAAe,UAC5B,OAAOA,EAAM,SAAY,UACzB,OAAOA,EAAM,KAAS,GAG1B,CC3BA,SAASC,GAA+BC,EAAO,CAU7C,GAAI,EAAAH,GAAWG,CAAK,GAAKC,GAAW,GAAI,EAAED,aAAiB,QAI3D,OAAOE,GAAiBF,EAAO,CAC7B,UAAW,CACT,KAAM,aACN,QAAS,GACT,KAAM,CACJ,SAAU,YACX,CACF,CACL,CAAG,CACH,CCjCA,SAASG,GAAE,EAAE,CAAC,IAAI,EAAEC,EAAEC,EAAE,GAAG,GAAa,OAAO,GAAjB,UAA8B,OAAO,GAAjB,SAAmBA,GAAG,UAAoB,OAAO,GAAjB,SAAmB,GAAG,MAAM,QAAQ,CAAC,EAAE,CAAC,IAAIC,EAAE,EAAE,OAAO,IAAI,EAAE,EAAE,EAAEA,EAAE,IAAI,EAAE,CAAC,IAAIF,EAAED,GAAE,EAAE,CAAC,CAAC,KAAKE,IAAIA,GAAG,KAAKA,GAAGD,EAAE,KAAM,KAAIA,KAAK,EAAE,EAAEA,CAAC,IAAIC,IAAIA,GAAG,KAAKA,GAAGD,GAAG,OAAOC,CAAC,CAAQ,SAASE,GAAM,CAAC,QAAQ,EAAE,EAAEH,EAAE,EAAEC,EAAE,GAAGC,EAAE,UAAU,OAAOF,EAAEE,EAAEF,KAAK,EAAE,UAAUA,CAAC,KAAK,EAAED,GAAE,CAAC,KAAKE,IAAIA,GAAG,KAAKA,GAAG,GAAG,OAAOA,CAAC,CCK1W,MAACG,GAAsBC,EAAAA,cAAc,CACtC,mBAAqBC,GAAMA,EAC3B,SAAU,GACV,cAAe,OACnB,CAAC,ECPKC,GAAgBF,EAAa,cAAC,EA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,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292]}