whoami7 - Manager
:
/
home
/
dataiclx
/
vielorbe.com
/
wp-content
/
plugins
/
surecart
/
dist
/
components
/
surecart
/
Upload File:
files >> //home/dataiclx/vielorbe.com/wp-content/plugins/surecart/dist/components/surecart/p-c4264df6.js.map
{"version":3,"names":["animateTo","el","keyframes","options","Promise","resolve","duration","Infinity","Error","animate","animation","prefersReducedMotion","addEventListener","once","query","window","matchMedia","matches","stopAnimations","all","_a","getAnimations","call","map","handleAnimationEvent","requestAnimationFrame","cancel","shimKeyframesHeightAuto","calculatedHeight","keyframe","height","defaultAnimationRegistry","Map","customAnimationRegistry","WeakMap","ensureAnimation","setDefaultAnimation","animationName","set","getAnimation","customAnimation","get","defaultAnimation"],"sources":["src/functions/animate.ts","src/functions/animation-registry.ts"],"sourcesContent":["//\n// Animates an element using keyframes. Returns a promise that resolves after the animation completes or gets canceled.\n//\nexport function animateTo(el: HTMLElement, keyframes: Keyframe[], options?: KeyframeAnimationOptions) {\n return new Promise(resolve => {\n if (options?.duration === Infinity) {\n throw new Error('Promise-based animations must be finite.');\n }\n\n if (!el?.animate) {\n return;\n }\n\n const animation = el.animate(keyframes, {\n ...options,\n duration: prefersReducedMotion() ? 0 : options!.duration,\n });\n\n if (!animation) {\n return;\n }\n\n animation.addEventListener('cancel', resolve, { once: true });\n animation.addEventListener('finish', resolve, { once: true });\n });\n}\n\n//\n// Parses a CSS duration and returns the number of milliseconds.\n//\nexport function parseDuration(delay: number | string) {\n delay = delay.toString().toLowerCase();\n\n if (delay.indexOf('ms') > -1) {\n return parseFloat(delay);\n }\n\n if (delay.indexOf('s') > -1) {\n return parseFloat(delay) * 1000;\n }\n\n return parseFloat(delay);\n}\n\n//\n// Tells if the user has enabled the \"reduced motion\" setting in their browser or OS.\n//\nexport function prefersReducedMotion() {\n const query = window.matchMedia('(prefers-reduced-motion: reduce)');\n return query.matches;\n}\n\n//\n// Stops all active animations on the target element. Returns a promise that resolves after all animations are canceled.\n//\nexport function stopAnimations(el: HTMLElement) {\n return Promise.all(\n (el?.getAnimations?.() || []).map(animation => {\n return new Promise(resolve => {\n const handleAnimationEvent = requestAnimationFrame(resolve);\n\n animation.addEventListener('cancel', () => handleAnimationEvent, { once: true });\n animation.addEventListener('finish', () => handleAnimationEvent, { once: true });\n animation.cancel();\n });\n }),\n );\n}\n\n// We can't animate `height: auto`, but we can calculate the height and shim keyframes by replacing it with the\n// element's scrollHeight before the animation.\nexport function shimKeyframesHeightAuto(keyframes: Keyframe[], calculatedHeight: number) {\n return keyframes.map(keyframe => ({\n ...keyframe,\n height: keyframe.height === 'auto' ? `${calculatedHeight}px` : keyframe.height,\n }));\n}\n","interface ElementAnimation {\n keyframes: Keyframe[];\n options?: KeyframeAnimationOptions;\n}\n\ninterface ElementAnimationMap {\n [animationName: string]: ElementAnimation;\n}\n\nconst defaultAnimationRegistry = new Map<string, ElementAnimation>();\nconst customAnimationRegistry = new WeakMap<Element, ElementAnimationMap>();\n\nfunction ensureAnimation(animation: ElementAnimation | null) {\n return animation ?? { keyframes: [], options: { duration: 0 } };\n}\n\n//\n// Sets a default animation. Components should use the `name.animation` for primary animations and `name.part.animation`\n// for secondary animations, e.g. `dialog.show` and `dialog.overlay.show`. For modifiers, use `drawer.showTop`.\n//\nexport function setDefaultAnimation(animationName: string, animation: ElementAnimation | null) {\n defaultAnimationRegistry.set(animationName, ensureAnimation(animation));\n}\n\n//\n// Sets a custom animation for the specified element.\n//\nexport function setAnimation(el: Element, animationName: string, animation: ElementAnimation | null) {\n customAnimationRegistry.set(el, { ...customAnimationRegistry.get(el), [animationName]: ensureAnimation(animation) });\n}\n\n//\n// Gets an element's animation. Falls back to the default if no animation is found.\n//\nexport function getAnimation(el: Element, animationName: string) {\n const customAnimation = customAnimationRegistry.get(el);\n\n // Check for a custom animation\n if (customAnimation?.[animationName]) {\n return customAnimation[animationName];\n }\n\n // Check for a default animation\n const defaultAnimation = defaultAnimationRegistry.get(animationName);\n if (defaultAnimation) {\n return defaultAnimation;\n }\n\n // Fall back to an empty anim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