sanity-plugin-hotspot-array

5.0.165.0.17
dist/index.js.map
~dist/index.js.mapModified
+1−1
Index: package/dist/index.js.map
===================================================================
--- package/dist/index.js.map
+++ package/dist/index.js.map
@@ -1,1 +1,1 @@
-{"version":3,"file":"index.js","names":["Card","Text","Feedback","t0","$","_c","children","t1","Box","Text","Tooltip","get","motion","useMotionValue","ComponentType","CSSProperties","ReactNode","useCallback","useEffect","useState","ObjectSchemaType","RenderPreviewCallback","FnHotspotMove","HotspotItem","dragStyle","width","height","position","boxSizing","top","left","margin","cursor","display","justifyContent","alignItems","borderRadius","background","color","dragStyleWhileDrag","border","dragStyleWhileHover","dotStyle","visibility","pointerEvents","dotStyleWhileActive","labelStyle","fontSize","fontWeight","lineHeight","labelStyleWhileActive","round","num","Math","HotspotTooltipProps","key","value","HotspotFields","schemaType","renderPreview","HotspotProps","bounds","DOMRectReadOnly","update","hotspotDescriptionPath","tooltip","index","Spot","t0","$","_c","TooltipComponent","isDragging","setIsDragging","isHovering","setIsHovering","t1","x","t2","t3","y","t4","t5","set","t6","t7","_key","currentX","currentY","newX","newY","safeX","max","min","safeY","handleDragEnd","t8","Symbol","for","handleDragStart","t9","handleHoverStart","t10","handleHoverEnd","t11","t12","t13","t14","maxWidth","t15","t16","t17","t18","t19","t20","t21","t22","t23","ComponentType","ArrayOfObjectsInputProps","definePlugin","HotspotItem","ImageHotspotArray","HotspotTooltipProps","ImageHotspotOptions","key","pathRoot","imagePath","descriptionPath","tooltip","HotspotFields","ArrayOptions","imageHotspot","imageHotspotArrayPlugin","name","form","components","input","props","schemaType","jsonType","options","imageHotspotOptions","renderDefault","DependencyList","useEffect","useMemo","useRef","useUnmountEffect","effect","$","_c","effectRef","t0","t1","current","t2","t3","Symbol","for","DebouncedFunction","args","this","ThisParameterType","Fn","Parameters","useDebouncedCallback","callback","deps","delay","maxWait","timeout","ReturnType","setTimeout","undefined","waitTimeout","cb","lastCall","clear","clearTimeout","execute","context","apply","wrapped","Object","defineProperties","length","value","name","RefObject","useEffect","useRef","isBrowser","window","navigator","document","UseResizeObserverCallback","entry","ResizeObserverEntry","ResizeObserverSingleton","observer","ResizeObserver","subscribe","target","Element","callback","unsubscribe","observerSingleton","getResizeObserver","undefined","callbacks","Map","Set","entries","get","forEach","cb","setTimeout","cbs","set","observe","add","delete","size","unobserve","useResizeObserver","t0","$","_c","enabled","t1","ro","t2","t3","current","tgt","t4","_tgt","subscribed","handler","t5","args","getImageDimensions","createImageUrlBuilder","Card","Flex","Stack","randomKey","get","MouseEvent","ReactNode","useCallback","useMemo","useRef","useState","ArrayOfObjectsInputProps","ImageValue","insert","ObjectSchemaType","PatchEvent","set","setIfMissing","useClient","useFormValue","useResolveInitialValueForType","Feedback","ImageHotspotOptions","Spot","useDebouncedCallback","useResizeObserver","imageStyle","width","height","VALID_ROOT_PATHS","FnHotspotMove","key","x","y","HotspotItem","_key","_type","HotspotFields","ImageHotspotArray","props","$","_c","value","onChange","imageHotspotOptions","schemaType","renderPreview","t0","Symbol","for","apiVersion","sanityClient","pathRoot","includes","t1","path","slice","imageHotspotPathRoot","rootObject","resolveInitialValueForType","t2","type","then","_temp","catch","_temp2","resolveInitialValue","t3","imagePath","hotspotImage","t4","bb0","builder","dataset","config","urlFor","source","image","asset","_ref","t5","aspectRatio","t6","Math","round","url","t7","displayImage","descriptionPath","of","event","spotType","nativeEvent","currentTarget","Number","offsetX","toFixed","offsetY","description","initialValues","newRow","name","from","handleHotspotImageClick","x_0","y_0","handleHotspotMove","hotspotImageRef","imageRect","setImageRect","t8","e","contentRect","t9","t10","tooltip","position","length","map","spot","index","t11","join","t12","t13","renderDefault","t14","initialValue"],"sources":["../src/Feedback.tsx","../src/Spot.tsx","../src/plugin.tsx","../src/useDebouncedCallback.ts","../src/useResizeObserver.ts","../src/ImageHotspotArray.tsx"],"sourcesContent":["import {Card, Text} from '@sanity/ui'\n\nexport default function Feedback({children}: {children: React.ReactNode}): React.JSX.Element {\n  return (\n    <Card padding={4} radius={2} shadow={1} tone=\"caution\">\n      <Text>{children}</Text>\n    </Card>\n  )\n}\n","import {Box, Text} from '@sanity/ui'\nimport {Tooltip} from '@sanity/ui/tooltip'\nimport get from 'lodash-es/get.js'\nimport {motion, useMotionValue} from 'motion/react'\nimport {\n  type ComponentType,\n  type CSSProperties,\n  type ReactNode,\n  useCallback,\n  useEffect,\n  useState,\n} from 'react'\nimport {type ObjectSchemaType, type RenderPreviewCallback} from 'sanity'\n\nimport {type FnHotspotMove, type HotspotItem} from './ImageHotspotArray'\n\nconst dragStyle: CSSProperties = {\n  width: '1.4rem',\n  height: '1.4rem',\n  position: 'absolute',\n  boxSizing: 'border-box',\n  top: 0,\n  left: 0,\n  margin: '-0.7rem 0 0 -0.7rem',\n  cursor: 'pointer',\n  display: 'flex',\n  justifyContent: 'center',\n  alignItems: 'center',\n  borderRadius: '50%',\n  background: '#000',\n  color: 'white',\n}\n\nconst dragStyleWhileDrag: CSSProperties = {\n  background: 'rgba(0, 0, 0, 0.1)',\n  border: '1px solid #fff',\n  cursor: 'none',\n}\n\nconst dragStyleWhileHover: CSSProperties = {\n  background: 'rgba(0, 0, 0, 0.1)',\n  border: '1px solid #fff',\n}\n\nconst dotStyle: CSSProperties = {\n  position: 'absolute',\n  left: '50%',\n  top: '50%',\n  height: '0.2rem',\n  width: '0.2rem',\n  margin: '-0.1rem 0 0 -0.1rem',\n  background: '#fff',\n  visibility: 'hidden',\n  borderRadius: '50%',\n  // make sure pointer events only run on the parent\n  pointerEvents: 'none',\n}\n\nconst dotStyleWhileActive: CSSProperties = {\n  visibility: 'visible',\n}\n\nconst labelStyle: CSSProperties = {\n  color: 'white',\n  fontSize: '0.7rem',\n  fontWeight: 600,\n  lineHeight: '1',\n}\n\nconst labelStyleWhileActive: CSSProperties = {\n  visibility: 'hidden',\n}\n\nconst round = (num: number) => Math.round(num * 100) / 100\n\nexport interface HotspotTooltipProps<HotspotFields = {[key: string]: unknown}> {\n  value: HotspotItem<HotspotFields>\n  schemaType: ObjectSchemaType\n  renderPreview: RenderPreviewCallback\n}\n\ninterface HotspotProps<HotspotFields = {[key: string]: unknown}> {\n  value: HotspotItem\n  bounds: DOMRectReadOnly\n  update: FnHotspotMove\n  hotspotDescriptionPath?: string\n  tooltip?: ComponentType<HotspotTooltipProps<HotspotFields>>\n  index: number\n  schemaType: ObjectSchemaType\n  renderPreview: RenderPreviewCallback\n}\n\nexport default function Spot({\n  value,\n  bounds,\n  update,\n  hotspotDescriptionPath,\n  tooltip: TooltipComponent,\n  index,\n  schemaType,\n  renderPreview,\n}: HotspotProps): ReactNode {\n  const [isDragging, setIsDragging] = useState(false)\n  const [isHovering, setIsHovering] = useState(false)\n\n  // x/y are stored as % but need to be converted to px\n  const x = useMotionValue(round(bounds.width * (value.x / 100)))\n  const y = useMotionValue(round(bounds.height * (value.y / 100)))\n\n  /**\n   * update x/y if the bounds change when resizing the window\n   */\n  useEffect(() => {\n    x.set(round(bounds.width * (value.x / 100)))\n    y.set(round(bounds.height * (value.y / 100)))\n  }, [x, y, value, bounds])\n\n  const handleDragEnd = useCallback(() => {\n    setIsDragging(false)\n\n    // get current values for x/y in px\n    const currentX = x.get()\n    const currentY = y.get()\n\n    // Which we need to convert back to `%` to patch the document\n    const newX = round((currentX * 100) / bounds.width)\n    const newY = round((currentY * 100) / bounds.height)\n\n    // Don't go below 0 or above 100\n    const safeX = Math.max(0, Math.min(100, newX))\n    const safeY = Math.max(0, Math.min(100, newY))\n\n    update(value._key, safeX, safeY)\n  }, [x, y, value, update, bounds])\n  const handleDragStart = useCallback(() => setIsDragging(true), [])\n\n  const handleHoverStart = useCallback(() => setIsHovering(true), [])\n  const handleHoverEnd = useCallback(() => setIsHovering(false), [])\n\n  if (!x || !y) {\n    return null\n  }\n\n  return (\n    <motion.div\n      drag\n      dragConstraints={bounds}\n      dragElastic={0}\n      dragMomentum={false}\n      onDragEnd={handleDragEnd}\n      onDragStart={handleDragStart}\n      onHoverStart={handleHoverStart}\n      onHoverEnd={handleHoverEnd}\n      style={{\n        ...dragStyle,\n        x,\n        y,\n        ...(isDragging && {...dragStyleWhileDrag}),\n        ...(isHovering && {...dragStyleWhileHover}),\n      }}\n    >\n      <Tooltip\n        key={value._key}\n        disabled={isDragging}\n        portal\n        content={\n          TooltipComponent && typeof TooltipComponent === 'function' ? (\n            <TooltipComponent value={value} renderPreview={renderPreview} schemaType={schemaType} />\n          ) : (\n            <Box padding={2} style={{maxWidth: 200, pointerEvents: `none`}}>\n              <Text textOverflow=\"ellipsis\">\n                {hotspotDescriptionPath\n                  ? // oxlint-disable-next-line typescript-eslint/no-unsafe-type-assertion -- the configured descriptionPath is expected to point to a string field\n                    (get(value, hotspotDescriptionPath) as string)\n                  : `${value.x}% x ${value.y}%`}\n              </Text>\n            </Box>\n          )\n        }\n      >\n        <div>\n          {/* Dot */}\n          <Box\n            style={{\n              ...dotStyle,\n              ...((isDragging || isHovering) && {...dotStyleWhileActive}),\n            }}\n          />\n          {/* Label */}\n          <div\n            style={{\n              ...labelStyle,\n              ...((isDragging || isHovering) && {...labelStyleWhileActive}),\n            }}\n          >\n            {index + 1}\n          </div>\n        </div>\n      </Tooltip>\n    </motion.div>\n  )\n}\n","import {type ComponentType} from 'react'\nimport {type ArrayOfObjectsInputProps, definePlugin} from 'sanity'\n\nimport {type HotspotItem, ImageHotspotArray} from './ImageHotspotArray'\nimport {type HotspotTooltipProps} from './Spot'\n\nexport interface ImageHotspotOptions<HotspotFields = {[key: string]: unknown}> {\n  pathRoot?: 'document' | 'parent'\n  imagePath: string\n  descriptionPath?: string\n  tooltip?: ComponentType<HotspotTooltipProps<HotspotFields>>\n}\n\ndeclare module 'sanity' {\n  export interface ArrayOptions {\n    imageHotspot?: ImageHotspotOptions\n  }\n}\n\nexport const imageHotspotArrayPlugin = definePlugin({\n  name: 'image-hotspot-array',\n  form: {\n    components: {\n      input: (props) => {\n        if (props.schemaType.jsonType === 'array' && props.schemaType.options?.imageHotspot) {\n          const imageHotspotOptions = props.schemaType.options?.imageHotspot\n          if (imageHotspotOptions) {\n            return (\n              <ImageHotspotArray\n                // oxlint-disable-next-line typescript-eslint/no-unsafe-type-assertion -- narrowed by the jsonType/options checks above\n                {...(props as unknown as ArrayOfObjectsInputProps<HotspotItem>)}\n                imageHotspotOptions={imageHotspotOptions}\n              />\n            )\n          }\n        }\n        return props.renderDefault(props)\n      },\n    },\n  },\n})\n","// copied from react-hookz/web\n// https://github.com/react-hookz/web/blob/579a445fcc9f4f4bb5b9d5e670b2e57448b4ee50/src/useDebouncedCallback/index.ts\nimport {type DependencyList, useEffect, useMemo, useRef} from 'react'\n\n/**\n * Run effect only when component is unmounted.\n *\n * @param effect Effector to run on unmount\n */\nfunction useUnmountEffect(effect: CallableFunction): void {\n  const effectRef = useRef(effect)\n  useEffect(() => {\n    effectRef.current = effect\n  }, [effect])\n  useEffect(() => () => effectRef.current(), [])\n}\n\nexport type DebouncedFunction<Fn extends (...args: any[]) => any> = (\n  this: ThisParameterType<Fn>,\n  ...args: Parameters<Fn>\n) => void\n\n/**\n * Makes passed function debounced, otherwise acts like `useCallback`.\n *\n * @param callback Function that will be debounced.\n * @param deps Dependencies list when to update callback. It also replaces invoked\n * \tcallback for scheduled debounced invocations.\n * @param delay Debounce delay.\n * @param maxWait The maximum time `callback` is allowed to be delayed before\n * it's invoked. 0 means no max wait.\n */\nexport function useDebouncedCallback<Fn extends (...args: any[]) => any>(\n  callback: Fn,\n  deps: DependencyList,\n  delay: number,\n  maxWait = 0,\n): DebouncedFunction<Fn> {\n  const timeout = useRef<ReturnType<typeof setTimeout>>(undefined)\n  const waitTimeout = useRef<ReturnType<typeof setTimeout>>(undefined)\n  const cb = useRef(callback)\n  const lastCall = useRef<{args: Parameters<Fn>; this: ThisParameterType<Fn>}>(undefined)\n\n  const clear = () => {\n    if (timeout.current) {\n      clearTimeout(timeout.current)\n      timeout.current = undefined\n    }\n\n    if (waitTimeout.current) {\n      clearTimeout(waitTimeout.current)\n      waitTimeout.current = undefined\n    }\n  }\n\n  // Cancel scheduled execution on unmount\n  useUnmountEffect(clear)\n\n  useEffect(() => {\n    cb.current = callback\n    // oxlint-disable-next-line react/rule-suppression\n    // oxlint-disable-next-line react/exhaustive-deps -- deps are provided by the caller via the `deps` argument\n  }, deps)\n\n  return useMemo(() => {\n    const execute = () => {\n      clear()\n\n      // Barely possible to test this line\n      /* istanbul ignore next */\n      if (!lastCall.current) return\n\n      const context = lastCall.current\n      lastCall.current = undefined\n\n      cb.current.apply(context.this, context.args)\n    }\n\n    const wrapped = function (this, ...args) {\n      if (timeout.current) {\n        clearTimeout(timeout.current)\n      }\n\n      lastCall.current = {args, this: this}\n\n      // Plan regular execution\n      timeout.current = setTimeout(execute, delay)\n\n      // Plan maxWait execution if required\n      if (maxWait > 0 && !waitTimeout.current) {\n        waitTimeout.current = setTimeout(execute, maxWait)\n      }\n    } as DebouncedFunction<Fn>\n\n    Object.defineProperties(wrapped, {\n      length: {value: callback.length},\n      name: {value: `${callback.name || 'anonymous'}__debounced__${delay}`},\n    })\n\n    return wrapped\n    // oxlint-disable-next-line react/rule-suppression\n    // oxlint-disable-next-line react/exhaustive-deps -- deps are provided by the caller via the `deps` argument\n  }, [delay, maxWait, ...deps])\n}\n","// copied from react-hookz/web\n// https://github.com/react-hookz/web/blob/579a445fcc9f4f4bb5b9d5e670b2e57448b4ee50/src/useResizeObserver/index.ts\nimport {type RefObject, useEffect, useRef} from 'react'\n\nconst isBrowser =\n  typeof window !== 'undefined' &&\n  typeof navigator !== 'undefined' &&\n  typeof document !== 'undefined'\n\nexport type UseResizeObserverCallback = (entry: ResizeObserverEntry) => void\n\ntype ResizeObserverSingleton = {\n  observer: ResizeObserver\n  subscribe: (target: Element, callback: UseResizeObserverCallback) => void\n  unsubscribe: (target: Element, callback: UseResizeObserverCallback) => void\n}\n\nlet observerSingleton: ResizeObserverSingleton\n\nfunction getResizeObserver(): ResizeObserverSingleton | undefined {\n  if (!isBrowser) return undefined\n\n  if (observerSingleton) return observerSingleton\n\n  const callbacks = new Map<Element, Set<UseResizeObserverCallback>>()\n\n  const observer = new ResizeObserver((entries) => {\n    for (const entry of entries)\n      callbacks.get(entry.target)?.forEach((cb) =>\n        setTimeout(() => {\n          cb(entry)\n        }, 0),\n      )\n  })\n\n  observerSingleton = {\n    observer,\n    subscribe(target, callback) {\n      let cbs = callbacks.get(target)\n\n      if (!cbs) {\n        // If target has no observers yet - register it\n        cbs = new Set<UseResizeObserverCallback>()\n        callbacks.set(target, cbs)\n        observer.observe(target)\n      }\n\n      // As Set is duplicate-safe - simply add callback on each call\n      cbs.add(callback)\n    },\n    unsubscribe(target, callback) {\n      const cbs = callbacks.get(target)\n\n      // Else branch should never occur in case of normal execution\n      // because callbacks map is hidden in closure - it is impossible to\n      // simulate situation with non-existent `cbs` Set\n      /* istanbul ignore else */\n      if (cbs) {\n        // Remove current observer\n        cbs.delete(callback)\n\n        if (cbs.size === 0) {\n          // If no observers left unregister target completely\n          callbacks.delete(target)\n          observer.unobserve(target)\n        }\n      }\n    },\n  }\n\n  return observerSingleton\n}\n\n/**\n * Invokes a callback whenever ResizeObserver detects a change to target's size.\n *\n * @param target React reference or Element to track.\n * @param callback Callback that will be invoked on resize.\n * @param enabled Whether resize observer is enabled or not.\n */\nexport function useResizeObserver<T extends Element>(\n  target: RefObject<T | null>,\n  callback: UseResizeObserverCallback,\n  enabled = true,\n): void {\n  const ro = enabled && getResizeObserver()\n  const cb = useRef(callback)\n  useEffect(() => {\n    cb.current = callback\n  }, [callback])\n\n  const tgt = target && 'current' in target ? target.current : target\n\n  useEffect(() => {\n    // This secondary target resolve required for case when we receive ref object, which, most\n    // likely, contains null during render stage, but already populated with element during\n    // effect stage.\n\n    const _tgt = target && 'current' in target ? target.current : target\n\n    if (!ro || !_tgt) return undefined\n\n    // As unsubscription in internals of our ResizeObserver abstraction can\n    // happen a bit later than effect cleanup invocation - we need a marker,\n    // that this handler should not be invoked anymore\n    let subscribed = true\n\n    const handler: UseResizeObserverCallback = (...args) => {\n      // It is reinsurance for the highly asynchronous invocations, almost\n      // impossible to achieve in tests, thus excluding from LOC\n      /* istanbul ignore else */\n      if (subscribed) {\n        cb.current(...args)\n      }\n    }\n\n    ro.subscribe(_tgt, handler)\n\n    return () => {\n      subscribed = false\n      ro.unsubscribe(_tgt, handler)\n    }\n    // oxlint-disable-next-line react/rule-suppression\n    // oxlint-disable-next-line react/exhaustive-deps -- callback is kept current via cb.current\n  }, [tgt, ro])\n}\n","import {getImageDimensions} from '@sanity/asset-utils'\nimport {createImageUrlBuilder} from '@sanity/image-url'\nimport {Card, Flex, Stack} from '@sanity/ui'\nimport {randomKey} from '@sanity/util/content'\nimport get from 'lodash-es/get.js'\nimport {type MouseEvent, type ReactNode, useCallback, useMemo, useRef, useState} from 'react'\nimport {\n  type ArrayOfObjectsInputProps,\n  type ImageValue,\n  insert,\n  type ObjectSchemaType,\n  PatchEvent,\n  set,\n  setIfMissing,\n  useClient,\n  useFormValue,\n  useResolveInitialValueForType,\n} from 'sanity'\n\nimport Feedback from './Feedback'\nimport {type ImageHotspotOptions} from './plugin'\nimport Spot from './Spot'\nimport {useDebouncedCallback} from './useDebouncedCallback'\nimport {useResizeObserver} from './useResizeObserver'\n\nconst imageStyle = {width: `100%`, height: `auto`}\n\nconst VALID_ROOT_PATHS = ['document', 'parent']\n\nexport type FnHotspotMove = (key: string, x: number, y: number) => void\n\nexport type HotspotItem<HotspotFields = {[key: string]: unknown}> = {\n  _key: string\n  _type: string\n  x: number\n  y: number\n} & HotspotFields\n\nexport function ImageHotspotArray(\n  props: ArrayOfObjectsInputProps<HotspotItem> & {imageHotspotOptions: ImageHotspotOptions},\n): ReactNode {\n  const {value, onChange, imageHotspotOptions, schemaType, renderPreview} = props\n\n  const sanityClient = useClient({apiVersion: '2022-01-01'})\n\n  const imageHotspotPathRoot = useMemo(() => {\n    const pathRoot = VALID_ROOT_PATHS.includes(imageHotspotOptions.pathRoot ?? '')\n      ? imageHotspotOptions.pathRoot\n      : 'document'\n    return pathRoot === 'document' ? [] : props.path.slice(0, -1)\n  }, [imageHotspotOptions.pathRoot, props.path])\n\n  const rootObject = useFormValue(imageHotspotPathRoot)\n\n  const resolveInitialValueForType = useResolveInitialValueForType()\n  const resolveInitialValue = useCallback(\n    async (type: ObjectSchemaType) => {\n      return resolveInitialValueForType(type, {})\n        .then((initialValue) => {\n          return initialValue\n        })\n        .catch(() => {\n          return undefined\n        })\n    },\n    [resolveInitialValueForType],\n  )\n\n  /**\n   * Finding the image from the imageHotspotPathRoot (defaults to document),\n   * using the path from the hotspot's `options` field\n   *\n   * when changes in imageHotspotPathRoot (e.g. document) occur,\n   * check if there are any changes to the hotspotImage and update the reference\n   */\n  const hotspotImage = useMemo(() => {\n    // oxlint-disable-next-line typescript-eslint/no-unsafe-type-assertion -- the configured imagePath is expected to point to an image field\n    return (\n      imageHotspotOptions.imagePath ? get(rootObject, imageHotspotOptions.imagePath) : rootObject\n    ) as ImageValue | undefined\n  }, [rootObject, imageHotspotOptions.imagePath])\n\n  const displayImage = useMemo(() => {\n    const builder = createImageUrlBuilder(sanityClient).dataset(sanityClient.config().dataset ?? '')\n    const urlFor = (source: ImageValue) => builder.image(source)\n\n    if (hotspotImage?.asset?._ref) {\n      const {aspectRatio} = getImageDimensions(hotspotImage.asset._ref)\n      const width = 1200\n      const height = Math.round(width / aspectRatio)\n      const url = urlFor(hotspotImage).width(width).url()\n\n      return {width, height, url}\n    }\n\n    return null\n  }, [hotspotImage, sanityClient])\n\n  const handleHotspotImageClick = useCallback(\n    async (event: MouseEvent<HTMLImageElement>) => {\n      const spotType = schemaType.of[0]\n      if (!spotType) {\n        return\n      }\n\n      const {nativeEvent, currentTarget} = event\n\n      // Calculate the x/y percentage of the click position\n      const x = Number(((nativeEvent.offsetX * 100) / currentTarget.width).toFixed(2))\n      const y = Number(((nativeEvent.offsetY * 100) / currentTarget.height).toFixed(2))\n      const description = `New Hotspot at ${x}% x ${y}%`\n\n      // oxlint-disable-next-line typescript-eslint/no-unsafe-type-assertion -- hotspot arrays contain a single object type\n      const initialValues = await resolveInitialValue(spotType.type as ObjectSchemaType)\n\n      const newRow: HotspotItem = {\n        _key: randomKey(12),\n        _type: spotType.name,\n        ...initialValues,\n        x,\n        y,\n      }\n\n      if (imageHotspotOptions?.descriptionPath) {\n        newRow[imageHotspotOptions.descriptionPath] = description\n      }\n\n      onChange(PatchEvent.from([setIfMissing([]), insert([newRow], 'after', [-1])]))\n    },\n    [imageHotspotOptions, onChange, resolveInitialValue, schemaType],\n  )\n\n  const handleHotspotMove: FnHotspotMove = useCallback(\n    (key, x, y) => {\n      onChange(\n        PatchEvent.from([\n          // Set the `x` value of this array key item\n          set(x, [{_key: key}, 'x']),\n          // Set the `y` value of this array key item\n          set(y, [{_key: key}, 'y']),\n        ]),\n      )\n    },\n    [onChange],\n  )\n\n  const hotspotImageRef = useRef<HTMLImageElement | null>(null)\n\n  const [imageRect, setImageRect] = useState<DOMRectReadOnly>()\n\n  useResizeObserver<HTMLImageElement>(\n    hotspotImageRef,\n    useDebouncedCallback(\n      (e: ResizeObserverEntry) => setImageRect(e.contentRect),\n      [setImageRect],\n      200,\n    ),\n  )\n\n  return (\n    <Stack gap={[2, 2, 3]}>\n      {displayImage?.url ? (\n        <div style={{position: `relative`}}>\n          {imageRect &&\n            (value?.length ?? 0) > 0 &&\n            value?.map((spot, index) => (\n              <Spot\n                index={index}\n                key={spot._key}\n                value={spot}\n                bounds={imageRect}\n                update={handleHotspotMove}\n                hotspotDescriptionPath={imageHotspotOptions?.descriptionPath}\n                tooltip={imageHotspotOptions?.tooltip}\n                renderPreview={renderPreview}\n                // oxlint-disable-next-line typescript-eslint/no-unsafe-type-assertion -- hotspot arrays contain a single object type\n                schemaType={schemaType.of[0] as ObjectSchemaType}\n              />\n            ))}\n\n          <Card __unstable_checkered shadow={1}>\n            <Flex align=\"center\" justify=\"center\">\n              {/* oxlint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions -- hotspots are placed via pointer coordinates, which have no keyboard equivalent */}\n              <img\n                ref={hotspotImageRef}\n                src={displayImage.url}\n                width={displayImage.width}\n                height={displayImage.height}\n                alt=\"\"\n                style={imageStyle}\n                onClick={handleHotspotImageClick}\n              />\n            </Flex>\n          </Card>\n        </div>\n      ) : (\n        <Feedback>\n          {imageHotspotOptions.imagePath ? (\n            <>\n              No Hotspot image found at path <code>{imageHotspotOptions.imagePath}</code>\n            </>\n          ) : (\n            <>\n              Define a path in this field using to the image field in this document at{' '}\n              <code>options.hotspotImagePath</code>\n            </>\n          )}\n        </Feedback>\n      )}\n      {imageHotspotOptions.pathRoot && !VALID_ROOT_PATHS.includes(imageHotspotOptions.pathRoot) && (\n        <Feedback>\n          The supplied imageHotspotPathRoot &quot;{imageHotspotOptions.pathRoot}&quot; is not valid,\n          falling back to &quot;document&quot;. Available values are &quot;\n          {VALID_ROOT_PATHS.join(', ')}&quot;.\n        </Feedback>\n      )}\n      {/* oxlint-disable-next-line typescript-eslint/no-unsafe-type-assertion -- renderDefault expects the base input props */}\n      {props.renderDefault(props as unknown as ArrayOfObjectsInputProps)}\n    </Stack>\n  )\n}\n"],"mappings":";;;;;;;;;;;;AAEA,SAAeE,SAAAC,IAAA;CAAA,IAAAC,IAAAC,EAAA,CAAA,GAAkB,EAAAC,aAAAH,IAAuCI;CAI7D,OAJ6DH,EAAA,OAAAE,WAI7DC,KAAAH,EAAA,MAFPG,KAAA,oBAAC,MAAD;EAAe,SAAA;EAAW,QAAA;EAAW,QAAA;EAAQ,MAAA;EAC3C,UAAA,oBAAC,MAAD,EAAOD,SAAF,CAAA;CADF,CAAA,GAEEF,EAAA,KAAAE,UAAAF,EAAA,KAAAG,KAFPA;AAEO;ACUX,MAAMiB,YAA2B;CAC/BC,OAAO;CACPC,QAAQ;CACRC,UAAU;CACVC,WAAW;CACXC,KAAK;CACLC,MAAM;CACNC,QAAQ;CACRC,QAAQ;CACRC,SAAS;CACTC,gBAAgB;CAChBC,YAAY;CACZC,cAAc;CACdC,YAAY;CACZC,OAAO;AACT,GAEMC,qBAAoC;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A;GACGC;GAgDAO;GAQAG;EAzDG;KA0DEpF,EAAA,MAAA0E,KAAA1E,EAAA,MAAAiF,KAAAjF,EAAA,MAAAoF,KAAApF,EAAA,MAAAsF,OAAAA,MAAAtF,EAAA,KA1DRsF;AA0DQ;AApLL,SAAA7D,SAAA,CAAA;AAAA,SAAAF,MAAAgE,cAAA;CAAA,OAqBUA;AAAY"}
\ No newline at end of file
+{"version":3,"file":"index.js","names":["{children}: {children: React.ReactNode}","<Card padding={4} radius={2} shadow={1} tone=\"caution\">\n      <Text>{children}</Text>\n    </Card>","{\n  value,\n  bounds,\n  update,\n  hotspotDescriptionPath,\n  tooltip: TooltipComponent,\n  index,\n  schemaType,\n  renderPreview,\n}: HotspotProps","round(bounds.width * (value.x / 100))","bounds.width * (value.x / 100)","round(bounds.height * (value.y / 100))","bounds.height * (value.y / 100)","() => {\n    x.set(round(bounds.width * (value.x / 100)))\n    y.set(round(bounds.height * (value.y / 100)))\n  }","height","width","x","y","[x, y, value, bounds]","() => {\n    setIsDragging(false)\n\n    // get current values for x/y in px\n    const currentX = x.get()\n    const currentY = y.get()\n\n    // Which we need to convert back to `%` to patch the document\n    const newX = round((currentX * 100) / bounds.width)\n    const newY = round((currentY * 100) / bounds.height)\n\n    // Don't go below 0 or above 100\n    const safeX = Math.max(0, Math.min(100, newX))\n    const safeY = Math.max(0, Math.min(100, newY))\n\n    update(value._key, safeX, safeY)\n  }","_key","useCallback(() => {\n    setIsDragging(false)\n\n    // get current values for x/y in px\n    const currentX = x.get()\n    const currentY = y.get()\n\n    // Which we need to convert back to `%` to patch the document\n    const newX = round((currentX * 100) / bounds.width)\n    const newY = round((currentY * 100) / bounds.height)\n\n    // Don't go below 0 or above 100\n    const safeX = Math.max(0, Math.min(100, newX))\n    const safeY = Math.max(0, Math.min(100, newY))\n\n    update(value._key, safeX, safeY)\n  }, [x, y, value, update, bounds])","() => setIsDragging(true)","useCallback(() => setIsDragging(true), [])","() => setIsHovering(true)","useCallback(() => setIsHovering(true), [])","() => setIsHovering(false)","useCallback(() => setIsHovering(false), [])","isDragging && {...dragStyleWhileDrag}","isHovering && {...dragStyleWhileHover}","{\n        ...dragStyle,\n        x,\n        y,\n        ...(isDragging && {...dragStyleWhileDrag}),\n        ...(isHovering && {...dragStyleWhileHover}),\n      }","TooltipComponent && typeof TooltipComponent === 'function' ? (\n            <TooltipComponent value={value} renderPreview={renderPreview} schemaType={schemaType} />\n          ) : (\n            <Box padding={2} style={{maxWidth: 200, pointerEvents: `none`}}>\n              <Text textOverflow=\"ellipsis\">\n                {hotspotDescriptionPath\n                  ? // oxlint-disable-next-line typescript-eslint/no-unsafe-type-assertion -- the configured descriptionPath is expected to point to a string field\n                    (get(value, hotspotDescriptionPath) as string)\n                  : `${value.x}% x ${value.y}%`}\n              </Text>\n            </Box>\n          )","(isDragging || isHovering) && {...dotStyleWhileActive}","<Box\n            style={{\n              ...dotStyle,\n              ...((isDragging || isHovering) && {...dotStyleWhileActive}),\n            }}\n          />","(isDragging || isHovering) && {...labelStyleWhileActive}","{\n              ...labelStyle,\n              ...((isDragging || isHovering) && {...labelStyleWhileActive}),\n            }","<div\n            style={{\n              ...labelStyle,\n              ...((isDragging || isHovering) && {...labelStyleWhileActive}),\n            }}\n          >\n            {index + 1}\n          </div>","index + 1","<div>\n          {/* Dot */}\n          <Box\n            style={{\n              ...dotStyle,\n              ...((isDragging || isHovering) && {...dotStyleWhileActive}),\n            }}\n          />\n          {/* Label */}\n          <div\n            style={{\n              ...labelStyle,\n              ...((isDragging || isHovering) && {...labelStyleWhileActive}),\n            }}\n          >\n            {index + 1}\n          </div>\n        </div>","<Tooltip\n        key={value._key}\n        disabled={isDragging}\n        portal\n        content={\n          TooltipComponent && typeof TooltipComponent === 'function' ? (\n            <TooltipComponent value={value} renderPreview={renderPreview} schemaType={schemaType} />\n          ) : (\n            <Box padding={2} style={{maxWidth: 200, pointerEvents: `none`}}>\n              <Text textOverflow=\"ellipsis\">\n                {hotspotDescriptionPath\n                  ? // oxlint-disable-next-line typescript-eslint/no-unsafe-type-assertion -- the configured descriptionPath is expected to point to a string field\n                    (get(value, hotspotDescriptionPath) as string)\n                  : `${value.x}% x ${value.y}%`}\n              </Text>\n            </Box>\n          )\n        }\n      >\n        <div>\n          {/* Dot */}\n          <Box\n            style={{\n              ...dotStyle,\n              ...((isDragging || isHovering) && {...dotStyleWhileActive}),\n            }}\n          />\n          {/* Label */}\n          <div\n            style={{\n              ...labelStyle,\n              ...((isDragging || isHovering) && {...labelStyleWhileActive}),\n            }}\n          >\n            {index + 1}\n          </div>\n        </div>\n      </Tooltip>","<motion.div\n      drag\n      dragConstraints={bounds}\n      dragElastic={0}\n      dragMomentum={false}\n      onDragEnd={handleDragEnd}\n      onDragStart={handleDragStart}\n      onHoverStart={handleHoverStart}\n      onHoverEnd={handleHoverEnd}\n      style={{\n        ...dragStyle,\n        x,\n        y,\n        ...(isDragging && {...dragStyleWhileDrag}),\n        ...(isHovering && {...dragStyleWhileHover}),\n      }}\n    >\n      <Tooltip\n        key={value._key}\n        disabled={isDragging}\n        portal\n        content={\n          TooltipComponent && typeof TooltipComponent === 'function' ? (\n            <TooltipComponent value={value} renderPreview={renderPreview} schemaType={schemaType} />\n          ) : (\n            <Box padding={2} style={{maxWidth: 200, pointerEvents: `none`}}>\n              <Text textOverflow=\"ellipsis\">\n                {hotspotDescriptionPath\n                  ? // oxlint-disable-next-line typescript-eslint/no-unsafe-type-assertion -- the configured descriptionPath is expected to point to a string field\n                    (get(value, hotspotDescriptionPath) as string)\n                  : `${value.x}% x ${value.y}%`}\n              </Text>\n            </Box>\n          )\n        }\n      >\n        <div>\n          {/* Dot */}\n          <Box\n            style={{\n              ...dotStyle,\n              ...((isDragging || isHovering) && {...dotStyleWhileActive}),\n            }}\n          />\n          {/* Label */}\n          <div\n            style={{\n              ...labelStyle,\n              ...((isDragging || isHovering) && {...labelStyleWhileActive}),\n            }}\n          >\n            {index + 1}\n          </div>\n        </div>\n      </Tooltip>\n    </motion.div>","motion.div","() => {\n    effectRef.current = effect\n  }","[effect]","() => () => effectRef.current()","[]","enabled = true","enabled && getResizeObserver()","() => {\n    cb.current = callback\n  }","[callback]","() => {\n    // This secondary target resolve required for case when we receive ref object, which, most\n    // likely, contains null during render stage, but already populated with element during\n    // effect stage.\n\n    const _tgt = target && 'current' in target ? target.current : target\n\n    if (!ro || !_tgt) return undefined\n\n    // As unsubscription in internals of our ResizeObserver abstraction can\n    // happen a bit later than effect cleanup invocation - we need a marker,\n    // that this handler should not be invoked anymore\n    let subscribed = true\n\n    const handler: UseResizeObserverCallback = (...args) => {\n      // It is reinsurance for the highly asynchronous invocations, almost\n      // impossible to achieve in tests, thus excluding from LOC\n      /* istanbul ignore else */\n      if (subscribed) {\n        cb.current(...args)\n      }\n    }\n\n    ro.subscribe(_tgt, handler)\n\n    return () => {\n      subscribed = false\n      ro.unsubscribe(_tgt, handler)\n    }\n    // oxlint-disable-next-line react/rule-suppression\n    // oxlint-disable-next-line react/exhaustive-deps -- callback is kept current via cb.current\n  }","...args","[tgt, ro]","{apiVersion: '2022-01-01'}","pathRoot === 'document' ? [] : props.path.slice(0, -1)","path","useMemo(() => {\n    const pathRoot = VALID_ROOT_PATHS.includes(imageHotspotOptions.pathRoot ?? '')\n      ? imageHotspotOptions.pathRoot\n      : 'document'\n    return pathRoot === 'document' ? [] : props.path.slice(0, -1)\n  }, [imageHotspotOptions.pathRoot, props.path])","async (type: ObjectSchemaType) => {\n      return resolveInitialValueForType(type, {})\n        .then((initialValue) => {\n          return initialValue\n        })\n        .catch(() => {\n          return undefined\n        })\n    }","(initialValue) => {\n          return initialValue\n        }","() => {\n          return undefined\n        }","useCallback(\n    async (type: ObjectSchemaType) => {\n      return resolveInitialValueForType(type, {})\n        .then((initialValue) => {\n          return initialValue\n        })\n        .catch(() => {\n          return undefined\n        })\n    },\n    [resolveInitialValueForType],\n  )","imageHotspotOptions.imagePath ? get(rootObject, imageHotspotOptions.imagePath) : rootObject","imagePath","useMemo(() => {\n    const builder = createImageUrlBuilder(sanityClient).dataset(sanityClient.config().dataset ?? '')\n    const urlFor = (source: ImageValue) => builder.image(source)\n\n    if (hotspotImage?.asset?._ref) {\n      const {aspectRatio} = getImageDimensions(hotspotImage.asset._ref)\n      const width = 1200\n      const height = Math.round(width / aspectRatio)\n      const url = urlFor(hotspotImage).width(width).url()\n\n      return {width, height, url}\n    }\n\n    return null\n  }, [hotspotImage, sanityClient])","hotspotImage?.asset?._ref","getImageDimensions(hotspotImage.asset._ref)","_ref","Math.round(width / aspectRatio)","{width, height, url}","async (event: MouseEvent<HTMLImageElement>) => {\n      const spotType = schemaType.of[0]\n      if (!spotType) {\n        return\n      }\n\n      const {nativeEvent, currentTarget} = event\n\n      // Calculate the x/y percentage of the click position\n      const x = Number(((nativeEvent.offsetX * 100) / currentTarget.width).toFixed(2))\n      const y = Number(((nativeEvent.offsetY * 100) / currentTarget.height).toFixed(2))\n      const description = `New Hotspot at ${x}% x ${y}%`\n\n      // oxlint-disable-next-line typescript-eslint/no-unsafe-type-assertion -- hotspot arrays contain a single object type\n      const initialValues = await resolveInitialValue(spotType.type as ObjectSchemaType)\n\n      const newRow: HotspotItem = {\n        _key: randomKey(12),\n        _type: spotType.name,\n        ...initialValues,\n        x,\n        y,\n      }\n\n      if (imageHotspotOptions?.descriptionPath) {\n        newRow[imageHotspotOptions.descriptionPath] = description\n      }\n\n      onChange(PatchEvent.from([setIfMissing([]), insert([newRow], 'after', [-1])]))\n    }","descriptionPath","0","useCallback(\n    async (event: MouseEvent<HTMLImageElement>) => {\n      const spotType = schemaType.of[0]\n      if (!spotType) {\n        return\n      }\n\n      const {nativeEvent, currentTarget} = event\n\n      // Calculate the x/y percentage of the click position\n      const x = Number(((nativeEvent.offsetX * 100) / currentTarget.width).toFixed(2))\n      const y = Number(((nativeEvent.offsetY * 100) / currentTarget.height).toFixed(2))\n      const description = `New Hotspot at ${x}% x ${y}%`\n\n      // oxlint-disable-next-line typescript-eslint/no-unsafe-type-assertion -- hotspot arrays contain a single object type\n      const initialValues = await resolveInitialValue(spotType.type as ObjectSchemaType)\n\n      const newRow: HotspotItem = {\n        _key: randomKey(12),\n        _type: spotType.name,\n        ...initialValues,\n        x,\n        y,\n      }\n\n      if (imageHotspotOptions?.descriptionPath) {\n        newRow[imageHotspotOptions.descriptionPath] = description\n      }\n\n      onChange(PatchEvent.from([setIfMissing([]), insert([newRow], 'after', [-1])]))\n    },\n    [imageHotspotOptions, onChange, resolveInitialValue, schemaType],\n  )","(key, x, y) => {\n      onChange(\n        PatchEvent.from([\n          // Set the `x` value of this array key item\n          set(x, [{_key: key}, 'x']),\n          // Set the `y` value of this array key item\n          set(y, [{_key: key}, 'y']),\n        ]),\n      )\n    }","x","y","useCallback(\n    (key, x, y) => {\n      onChange(\n        PatchEvent.from([\n          // Set the `x` value of this array key item\n          set(x, [{_key: key}, 'x']),\n          // Set the `y` value of this array key item\n          set(y, [{_key: key}, 'y']),\n        ]),\n      )\n    },\n    [onChange],\n  )","(e: ResizeObserverEntry) => setImageRect(e.contentRect)","[setImageRect]","[2, 2, 3]","displayImage?.url ? (\n        <div style={{position: `relative`}}>\n          {imageRect &&\n            (value?.length ?? 0) > 0 &&\n            value?.map((spot, index) => (\n              <Spot\n                index={index}\n                key={spot._key}\n                value={spot}\n                bounds={imageRect}\n                update={handleHotspotMove}\n                hotspotDescriptionPath={imageHotspotOptions?.descriptionPath}\n                tooltip={imageHotspotOptions?.tooltip}\n                renderPreview={renderPreview}\n                // oxlint-disable-next-line typescript-eslint/no-unsafe-type-assertion -- hotspot arrays contain a single object type\n                schemaType={schemaType.of[0] as ObjectSchemaType}\n              />\n            ))}\n\n          <Card __unstable_checkered shadow={1}>\n            <Flex align=\"center\" justify=\"center\">\n              {/* oxlint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions -- hotspots are placed via pointer coordinates, which have no keyboard equivalent */}\n              <img\n                ref={hotspotImageRef}\n                src={displayImage.url}\n                width={displayImage.width}\n                height={displayImage.height}\n                alt=\"\"\n                style={imageStyle}\n                onClick={handleHotspotImageClick}\n              />\n            </Flex>\n          </Card>\n        </div>\n      ) : (\n        <Feedback>\n          {imageHotspotOptions.imagePath ? (\n            <>\n              No Hotspot image found at path <code>{imageHotspotOptions.imagePath}</code>\n            </>\n          ) : (\n            <>\n              Define a path in this field using to the image field in this document at{' '}\n              <code>options.hotspotImagePath</code>\n            </>\n          )}\n        </Feedback>\n      )","tooltip","value?.length","displayImage?.url","imageHotspotOptions.pathRoot && !VALID_ROOT_PATHS.includes(imageHotspotOptions.pathRoot) && (\n        <Feedback>\n          The supplied imageHotspotPathRoot &quot;{imageHotspotOptions.pathRoot}&quot; is not valid,\n          falling back to &quot;document&quot;. Available values are &quot;\n          {VALID_ROOT_PATHS.join(', ')}&quot;.\n        </Feedback>\n      )","pathRoot","props.renderDefault(props as unknown as ArrayOfObjectsInputProps)","renderDefault","props as unknown as ArrayOfObjectsInputProps","<Stack gap={[2, 2, 3]}>\n      {displayImage?.url ? (\n        <div style={{position: `relative`}}>\n          {imageRect &&\n            (value?.length ?? 0) > 0 &&\n            value?.map((spot, index) => (\n              <Spot\n                index={index}\n                key={spot._key}\n                value={spot}\n                bounds={imageRect}\n                update={handleHotspotMove}\n                hotspotDescriptionPath={imageHotspotOptions?.descriptionPath}\n                tooltip={imageHotspotOptions?.tooltip}\n                renderPreview={renderPreview}\n                // oxlint-disable-next-line typescript-eslint/no-unsafe-type-assertion -- hotspot arrays contain a single object type\n                schemaType={schemaType.of[0] as ObjectSchemaType}\n              />\n            ))}\n\n          <Card __unstable_checkered shadow={1}>\n            <Flex align=\"center\" justify=\"center\">\n              {/* oxlint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions -- hotspots are placed via pointer coordinates, which have no keyboard equivalent */}\n              <img\n                ref={hotspotImageRef}\n                src={displayImage.url}\n                width={displayImage.width}\n                height={displayImage.height}\n                alt=\"\"\n                style={imageStyle}\n                onClick={handleHotspotImageClick}\n              />\n            </Flex>\n          </Card>\n        </div>\n      ) : (\n        <Feedback>\n          {imageHotspotOptions.imagePath ? (\n            <>\n              No Hotspot image found at path <code>{imageHotspotOptions.imagePath}</code>\n            </>\n          ) : (\n            <>\n              Define a path in this field using to the image field in this document at{' '}\n              <code>options.hotspotImagePath</code>\n            </>\n          )}\n        </Feedback>\n      )}\n      {imageHotspotOptions.pathRoot && !VALID_ROOT_PATHS.includes(imageHotspotOptions.pathRoot) && (\n        <Feedback>\n          The supplied imageHotspotPathRoot &quot;{imageHotspotOptions.pathRoot}&quot; is not valid,\n          falling back to &quot;document&quot;. Available values are &quot;\n          {VALID_ROOT_PATHS.join(', ')}&quot;.\n        </Feedback>\n      )}\n      {/* oxlint-disable-next-line typescript-eslint/no-unsafe-type-assertion -- renderDefault expects the base input props */}\n      {props.renderDefault(props as unknown as ArrayOfObjectsInputProps)}\n    </Stack>"],"sources":["../src/Feedback.tsx","../src/Spot.tsx","../src/useDebouncedCallback.ts","../src/useResizeObserver.ts","../src/ImageHotspotArray.tsx","../src/plugin.tsx"],"sourcesContent":["import {Card, Text} from '@sanity/ui'\n\nexport default function Feedback({children}: {children: React.ReactNode}): React.JSX.Element {\n  return (\n    <Card padding={4} radius={2} shadow={1} tone=\"caution\">\n      <Text>{children}</Text>\n    </Card>\n  )\n}\n","import {Box, Text} from '@sanity/ui'\nimport {Tooltip} from '@sanity/ui/tooltip'\nimport get from 'lodash-es/get.js'\nimport {motion, useMotionValue} from 'motion/react'\nimport {\n  type ComponentType,\n  type CSSProperties,\n  type ReactNode,\n  useCallback,\n  useEffect,\n  useState,\n} from 'react'\nimport {type ObjectSchemaType, type RenderPreviewCallback} from 'sanity'\n\nimport {type FnHotspotMove, type HotspotItem} from './ImageHotspotArray'\n\nconst dragStyle: CSSProperties = {\n  width: '1.4rem',\n  height: '1.4rem',\n  position: 'absolute',\n  boxSizing: 'border-box',\n  top: 0,\n  left: 0,\n  margin: '-0.7rem 0 0 -0.7rem',\n  cursor: 'pointer',\n  display: 'flex',\n  justifyContent: 'center',\n  alignItems: 'center',\n  borderRadius: '50%',\n  background: '#000',\n  color: 'white',\n}\n\nconst dragStyleWhileDrag: CSSProperties = {\n  background: 'rgba(0, 0, 0, 0.1)',\n  border: '1px solid #fff',\n  cursor: 'none',\n}\n\nconst dragStyleWhileHover: CSSProperties = {\n  background: 'rgba(0, 0, 0, 0.1)',\n  border: '1px solid #fff',\n}\n\nconst dotStyle: CSSProperties = {\n  position: 'absolute',\n  left: '50%',\n  top: '50%',\n  height: '0.2rem',\n  width: '0.2rem',\n  margin: '-0.1rem 0 0 -0.1rem',\n  background: '#fff',\n  visibility: 'hidden',\n  borderRadius: '50%',\n  // make sure pointer events only run on the parent\n  pointerEvents: 'none',\n}\n\nconst dotStyleWhileActive: CSSProperties = {\n  visibility: 'visible',\n}\n\nconst labelStyle: CSSProperties = {\n  color: 'white',\n  fontSize: '0.7rem',\n  fontWeight: 600,\n  lineHeight: '1',\n}\n\nconst labelStyleWhileActive: CSSProperties = {\n  visibility: 'hidden',\n}\n\nconst round = (num: number) => Math.round(num * 100) / 100\n\nexport interface HotspotTooltipProps<HotspotFields = {[key: string]: unknown}> {\n  value: HotspotItem<HotspotFields>\n  schemaType: ObjectSchemaType\n  renderPreview: RenderPreviewCallback\n}\n\ninterface HotspotProps<HotspotFields = {[key: string]: unknown}> {\n  value: HotspotItem\n  bounds: DOMRectReadOnly\n  update: FnHotspotMove\n  hotspotDescriptionPath?: string\n  tooltip?: ComponentType<HotspotTooltipProps<HotspotFields>>\n  index: number\n  schemaType: ObjectSchemaType\n  renderPreview: RenderPreviewCallback\n}\n\nexport default function Spot({\n  value,\n  bounds,\n  update,\n  hotspotDescriptionPath,\n  tooltip: TooltipComponent,\n  index,\n  schemaType,\n  renderPreview,\n}: HotspotProps): ReactNode {\n  const [isDragging, setIsDragging] = useState(false)\n  const [isHovering, setIsHovering] = useState(false)\n\n  // x/y are stored as % but need to be converted to px\n  const x = useMotionValue(round(bounds.width * (value.x / 100)))\n  const y = useMotionValue(round(bounds.height * (value.y / 100)))\n\n  /**\n   * update x/y if the bounds change when resizing the window\n   */\n  useEffect(() => {\n    x.set(round(bounds.width * (value.x / 100)))\n    y.set(round(bounds.height * (value.y / 100)))\n  }, [x, y, value, bounds])\n\n  const handleDragEnd = useCallback(() => {\n    setIsDragging(false)\n\n    // get current values for x/y in px\n    const currentX = x.get()\n    const currentY = y.get()\n\n    // Which we need to convert back to `%` to patch the document\n    const newX = round((currentX * 100) / bounds.width)\n    const newY = round((currentY * 100) / bounds.height)\n\n    // Don't go below 0 or above 100\n    const safeX = Math.max(0, Math.min(100, newX))\n    const safeY = Math.max(0, Math.min(100, newY))\n\n    update(value._key, safeX, safeY)\n  }, [x, y, value, update, bounds])\n  const handleDragStart = useCallback(() => setIsDragging(true), [])\n\n  const handleHoverStart = useCallback(() => setIsHovering(true), [])\n  const handleHoverEnd = useCallback(() => setIsHovering(false), [])\n\n  if (!x || !y) {\n    return null\n  }\n\n  return (\n    <motion.div\n      drag\n      dragConstraints={bounds}\n      dragElastic={0}\n      dragMomentum={false}\n      onDragEnd={handleDragEnd}\n      onDragStart={handleDragStart}\n      onHoverStart={handleHoverStart}\n      onHoverEnd={handleHoverEnd}\n      style={{\n        ...dragStyle,\n        x,\n        y,\n        ...(isDragging && {...dragStyleWhileDrag}),\n        ...(isHovering && {...dragStyleWhileHover}),\n      }}\n    >\n      <Tooltip\n        key={value._key}\n        disabled={isDragging}\n        portal\n        content={\n          TooltipComponent && typeof TooltipComponent === 'function' ? (\n            <TooltipComponent value={value} renderPreview={renderPreview} schemaType={schemaType} />\n          ) : (\n            <Box padding={2} style={{maxWidth: 200, pointerEvents: `none`}}>\n              <Text textOverflow=\"ellipsis\">\n                {hotspotDescriptionPath\n                  ? // oxlint-disable-next-line typescript-eslint/no-unsafe-type-assertion -- the configured descriptionPath is expected to point to a string field\n                    (get(value, hotspotDescriptionPath) as string)\n                  : `${value.x}% x ${value.y}%`}\n              </Text>\n            </Box>\n          )\n        }\n      >\n        <div>\n          {/* Dot */}\n          <Box\n            style={{\n              ...dotStyle,\n              ...((isDragging || isHovering) && {...dotStyleWhileActive}),\n            }}\n          />\n          {/* Label */}\n          <div\n            style={{\n              ...labelStyle,\n              ...((isDragging || isHovering) && {...labelStyleWhileActive}),\n            }}\n          >\n            {index + 1}\n          </div>\n        </div>\n      </Tooltip>\n    </motion.div>\n  )\n}\n","// copied from react-hookz/web\n// https://github.com/react-hookz/web/blob/579a445fcc9f4f4bb5b9d5e670b2e57448b4ee50/src/useDebouncedCallback/index.ts\nimport {type DependencyList, useEffect, useMemo, useRef} from 'react'\n\n/**\n * Run effect only when component is unmounted.\n *\n * @param effect Effector to run on unmount\n */\nfunction useUnmountEffect(effect: CallableFunction): void {\n  const effectRef = useRef(effect)\n  useEffect(() => {\n    effectRef.current = effect\n  }, [effect])\n  useEffect(() => () => effectRef.current(), [])\n}\n\nexport type DebouncedFunction<Fn extends (...args: any[]) => any> = (\n  this: ThisParameterType<Fn>,\n  ...args: Parameters<Fn>\n) => void\n\n/**\n * Makes passed function debounced, otherwise acts like `useCallback`.\n *\n * @param callback Function that will be debounced.\n * @param deps Dependencies list when to update callback. It also replaces invoked\n * \tcallback for scheduled debounced invocations.\n * @param delay Debounce delay.\n * @param maxWait The maximum time `callback` is allowed to be delayed before\n * it's invoked. 0 means no max wait.\n */\nexport function useDebouncedCallback<Fn extends (...args: any[]) => any>(\n  callback: Fn,\n  deps: DependencyList,\n  delay: number,\n  maxWait = 0,\n): DebouncedFunction<Fn> {\n  const timeout = useRef<ReturnType<typeof setTimeout>>(undefined)\n  const waitTimeout = useRef<ReturnType<typeof setTimeout>>(undefined)\n  const cb = useRef(callback)\n  const lastCall = useRef<{args: Parameters<Fn>; this: ThisParameterType<Fn>}>(undefined)\n\n  const clear = () => {\n    if (timeout.current) {\n      clearTimeout(timeout.current)\n      timeout.current = undefined\n    }\n\n    if (waitTimeout.current) {\n      clearTimeout(waitTimeout.current)\n      waitTimeout.current = undefined\n    }\n  }\n\n  // Cancel scheduled execution on unmount\n  useUnmountEffect(clear)\n\n  useEffect(() => {\n    cb.current = callback\n    // oxlint-disable-next-line react/rule-suppression\n    // oxlint-disable-next-line react/exhaustive-deps -- deps are provided by the caller via the `deps` argument\n  }, deps)\n\n  return useMemo(() => {\n    const execute = () => {\n      clear()\n\n      // Barely possible to test this line\n      /* istanbul ignore next */\n      if (!lastCall.current) return\n\n      const context = lastCall.current\n      lastCall.current = undefined\n\n      cb.current.apply(context.this, context.args)\n    }\n\n    const wrapped = function (this, ...args) {\n      if (timeout.current) {\n        clearTimeout(timeout.current)\n      }\n\n      lastCall.current = {args, this: this}\n\n      // Plan regular execution\n      timeout.current = setTimeout(execute, delay)\n\n      // Plan maxWait execution if required\n      if (maxWait > 0 && !waitTimeout.current) {\n        waitTimeout.current = setTimeout(execute, maxWait)\n      }\n    } as DebouncedFunction<Fn>\n\n    Object.defineProperties(wrapped, {\n      length: {value: callback.length},\n      name: {value: `${callback.name || 'anonymous'}__debounced__${delay}`},\n    })\n\n    return wrapped\n    // oxlint-disable-next-line react/rule-suppression\n    // oxlint-disable-next-line react/exhaustive-deps -- deps are provided by the caller via the `deps` argument\n  }, [delay, maxWait, ...deps])\n}\n","// copied from react-hookz/web\n// https://github.com/react-hookz/web/blob/579a445fcc9f4f4bb5b9d5e670b2e57448b4ee50/src/useResizeObserver/index.ts\nimport {type RefObject, useEffect, useRef} from 'react'\n\nconst isBrowser =\n  typeof window !== 'undefined' &&\n  typeof navigator !== 'undefined' &&\n  typeof document !== 'undefined'\n\nexport type UseResizeObserverCallback = (entry: ResizeObserverEntry) => void\n\ntype ResizeObserverSingleton = {\n  observer: ResizeObserver\n  subscribe: (target: Element, callback: UseResizeObserverCallback) => void\n  unsubscribe: (target: Element, callback: UseResizeObserverCallback) => void\n}\n\nlet observerSingleton: ResizeObserverSingleton\n\nfunction getResizeObserver(): ResizeObserverSingleton | undefined {\n  if (!isBrowser) return undefined\n\n  if (observerSingleton) return observerSingleton\n\n  const callbacks = new Map<Element, Set<UseResizeObserverCallback>>()\n\n  const observer = new ResizeObserver((entries) => {\n    for (const entry of entries)\n      callbacks.get(entry.target)?.forEach((cb) =>\n        setTimeout(() => {\n          cb(entry)\n        }, 0),\n      )\n  })\n\n  observerSingleton = {\n    observer,\n    subscribe(target, callback) {\n      let cbs = callbacks.get(target)\n\n      if (!cbs) {\n        // If target has no observers yet - register it\n        cbs = new Set<UseResizeObserverCallback>()\n        callbacks.set(target, cbs)\n        observer.observe(target)\n      }\n\n      // As Set is duplicate-safe - simply add callback on each call\n      cbs.add(callback)\n    },\n    unsubscribe(target, callback) {\n      const cbs = callbacks.get(target)\n\n      // Else branch should never occur in case of normal execution\n      // because callbacks map is hidden in closure - it is impossible to\n      // simulate situation with non-existent `cbs` Set\n      /* istanbul ignore else */\n      if (cbs) {\n        // Remove current observer\n        cbs.delete(callback)\n\n        if (cbs.size === 0) {\n          // If no observers left unregister target completely\n          callbacks.delete(target)\n          observer.unobserve(target)\n        }\n      }\n    },\n  }\n\n  return observerSingleton\n}\n\n/**\n * Invokes a callback whenever ResizeObserver detects a change to target's size.\n *\n * @param target React reference or Element to track.\n * @param callback Callback that will be invoked on resize.\n * @param enabled Whether resize observer is enabled or not.\n */\nexport function useResizeObserver<T extends Element>(\n  target: RefObject<T | null>,\n  callback: UseResizeObserverCallback,\n  enabled = true,\n): void {\n  const ro = enabled && getResizeObserver()\n  const cb = useRef(callback)\n  useEffect(() => {\n    cb.current = callback\n  }, [callback])\n\n  const tgt = target && 'current' in target ? target.current : target\n\n  useEffect(() => {\n    // This secondary target resolve required for case when we receive ref object, which, most\n    // likely, contains null during render stage, but already populated with element during\n    // effect stage.\n\n    const _tgt = target && 'current' in target ? target.current : target\n\n    if (!ro || !_tgt) return undefined\n\n    // As unsubscription in internals of our ResizeObserver abstraction can\n    // happen a bit later than effect cleanup invocation - we need a marker,\n    // that this handler should not be invoked anymore\n    let subscribed = true\n\n    const handler: UseResizeObserverCallback = (...args) => {\n      // It is reinsurance for the highly asynchronous invocations, almost\n      // impossible to achieve in tests, thus excluding from LOC\n      /* istanbul ignore else */\n      if (subscribed) {\n        cb.current(...args)\n      }\n    }\n\n    ro.subscribe(_tgt, handler)\n\n    return () => {\n      subscribed = false\n      ro.unsubscribe(_tgt, handler)\n    }\n    // oxlint-disable-next-line react/rule-suppression\n    // oxlint-disable-next-line react/exhaustive-deps -- callback is kept current via cb.current\n  }, [tgt, ro])\n}\n","import {getImageDimensions} from '@sanity/asset-utils'\nimport {createImageUrlBuilder} from '@sanity/image-url'\nimport {Card, Flex, Stack} from '@sanity/ui'\nimport {randomKey} from '@sanity/util/content'\nimport get from 'lodash-es/get.js'\nimport {type MouseEvent, type ReactNode, useCallback, useMemo, useRef, useState} from 'react'\nimport {\n  type ArrayOfObjectsInputProps,\n  type ImageValue,\n  insert,\n  type ObjectSchemaType,\n  PatchEvent,\n  set,\n  setIfMissing,\n  useClient,\n  useFormValue,\n  useResolveInitialValueForType,\n} from 'sanity'\n\nimport Feedback from './Feedback'\nimport {type ImageHotspotOptions} from './plugin'\nimport Spot from './Spot'\nimport {useDebouncedCallback} from './useDebouncedCallback'\nimport {useResizeObserver} from './useResizeObserver'\n\nconst imageStyle = {width: `100%`, height: `auto`}\n\nconst VALID_ROOT_PATHS = ['document', 'parent']\n\nexport type FnHotspotMove = (key: string, x: number, y: number) => void\n\nexport type HotspotItem<HotspotFields = {[key: string]: unknown}> = {\n  _key: string\n  _type: string\n  x: number\n  y: number\n} & HotspotFields\n\nexport function ImageHotspotArray(\n  props: ArrayOfObjectsInputProps<HotspotItem> & {imageHotspotOptions: ImageHotspotOptions},\n): ReactNode {\n  const {value, onChange, imageHotspotOptions, schemaType, renderPreview} = props\n\n  const sanityClient = useClient({apiVersion: '2022-01-01'})\n\n  const imageHotspotPathRoot = useMemo(() => {\n    const pathRoot = VALID_ROOT_PATHS.includes(imageHotspotOptions.pathRoot ?? '')\n      ? imageHotspotOptions.pathRoot\n      : 'document'\n    return pathRoot === 'document' ? [] : props.path.slice(0, -1)\n  }, [imageHotspotOptions.pathRoot, props.path])\n\n  const rootObject = useFormValue(imageHotspotPathRoot)\n\n  const resolveInitialValueForType = useResolveInitialValueForType()\n  const resolveInitialValue = useCallback(\n    async (type: ObjectSchemaType) => {\n      return resolveInitialValueForType(type, {})\n        .then((initialValue) => {\n          return initialValue\n        })\n        .catch(() => {\n          return undefined\n        })\n    },\n    [resolveInitialValueForType],\n  )\n\n  /**\n   * Finding the image from the imageHotspotPathRoot (defaults to document),\n   * using the path from the hotspot's `options` field\n   *\n   * when changes in imageHotspotPathRoot (e.g. document) occur,\n   * check if there are any changes to the hotspotImage and update the reference\n   */\n  const hotspotImage = useMemo(() => {\n    // oxlint-disable-next-line typescript-eslint/no-unsafe-type-assertion -- the configured imagePath is expected to point to an image field\n    return (\n      imageHotspotOptions.imagePath ? get(rootObject, imageHotspotOptions.imagePath) : rootObject\n    ) as ImageValue | undefined\n  }, [rootObject, imageHotspotOptions.imagePath])\n\n  const displayImage = useMemo(() => {\n    const builder = createImageUrlBuilder(sanityClient).dataset(sanityClient.config().dataset ?? '')\n    const urlFor = (source: ImageValue) => builder.image(source)\n\n    if (hotspotImage?.asset?._ref) {\n      const {aspectRatio} = getImageDimensions(hotspotImage.asset._ref)\n      const width = 1200\n      const height = Math.round(width / aspectRatio)\n      const url = urlFor(hotspotImage).width(width).url()\n\n      return {width, height, url}\n    }\n\n    return null\n  }, [hotspotImage, sanityClient])\n\n  const handleHotspotImageClick = useCallback(\n    async (event: MouseEvent<HTMLImageElement>) => {\n      const spotType = schemaType.of[0]\n      if (!spotType) {\n        return\n      }\n\n      const {nativeEvent, currentTarget} = event\n\n      // Calculate the x/y percentage of the click position\n      const x = Number(((nativeEvent.offsetX * 100) / currentTarget.width).toFixed(2))\n      const y = Number(((nativeEvent.offsetY * 100) / currentTarget.height).toFixed(2))\n      const description = `New Hotspot at ${x}% x ${y}%`\n\n      // oxlint-disable-next-line typescript-eslint/no-unsafe-type-assertion -- hotspot arrays contain a single object type\n      const initialValues = await resolveInitialValue(spotType.type as ObjectSchemaType)\n\n      const newRow: HotspotItem = {\n        _key: randomKey(12),\n        _type: spotType.name,\n        ...initialValues,\n        x,\n        y,\n      }\n\n      if (imageHotspotOptions?.descriptionPath) {\n        newRow[imageHotspotOptions.descriptionPath] = description\n      }\n\n      onChange(PatchEvent.from([setIfMissing([]), insert([newRow], 'after', [-1])]))\n    },\n    [imageHotspotOptions, onChange, resolveInitialValue, schemaType],\n  )\n\n  const handleHotspotMove: FnHotspotMove = useCallback(\n    (key, x, y) => {\n      onChange(\n        PatchEvent.from([\n          // Set the `x` value of this array key item\n          set(x, [{_key: key}, 'x']),\n          // Set the `y` value of this array key item\n          set(y, [{_key: key}, 'y']),\n        ]),\n      )\n    },\n    [onChange],\n  )\n\n  const hotspotImageRef = useRef<HTMLImageElement | null>(null)\n\n  const [imageRect, setImageRect] = useState<DOMRectReadOnly>()\n\n  useResizeObserver<HTMLImageElement>(\n    hotspotImageRef,\n    useDebouncedCallback(\n      (e: ResizeObserverEntry) => setImageRect(e.contentRect),\n      [setImageRect],\n      200,\n    ),\n  )\n\n  return (\n    <Stack gap={[2, 2, 3]}>\n      {displayImage?.url ? (\n        <div style={{position: `relative`}}>\n          {imageRect &&\n            (value?.length ?? 0) > 0 &&\n            value?.map((spot, index) => (\n              <Spot\n                index={index}\n                key={spot._key}\n                value={spot}\n                bounds={imageRect}\n                update={handleHotspotMove}\n                hotspotDescriptionPath={imageHotspotOptions?.descriptionPath}\n                tooltip={imageHotspotOptions?.tooltip}\n                renderPreview={renderPreview}\n                // oxlint-disable-next-line typescript-eslint/no-unsafe-type-assertion -- hotspot arrays contain a single object type\n                schemaType={schemaType.of[0] as ObjectSchemaType}\n              />\n            ))}\n\n          <Card __unstable_checkered shadow={1}>\n            <Flex align=\"center\" justify=\"center\">\n              {/* oxlint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions -- hotspots are placed via pointer coordinates, which have no keyboard equivalent */}\n              <img\n                ref={hotspotImageRef}\n                src={displayImage.url}\n                width={displayImage.width}\n                height={displayImage.height}\n                alt=\"\"\n                style={imageStyle}\n                onClick={handleHotspotImageClick}\n              />\n            </Flex>\n          </Card>\n        </div>\n      ) : (\n        <Feedback>\n          {imageHotspotOptions.imagePath ? (\n            <>\n              No Hotspot image found at path <code>{imageHotspotOptions.imagePath}</code>\n            </>\n          ) : (\n            <>\n              Define a path in this field using to the image field in this document at{' '}\n              <code>options.hotspotImagePath</code>\n            </>\n          )}\n        </Feedback>\n      )}\n      {imageHotspotOptions.pathRoot && !VALID_ROOT_PATHS.includes(imageHotspotOptions.pathRoot) && (\n        <Feedback>\n          The supplied imageHotspotPathRoot &quot;{imageHotspotOptions.pathRoot}&quot; is not valid,\n          falling back to &quot;document&quot;. Available values are &quot;\n          {VALID_ROOT_PATHS.join(', ')}&quot;.\n        </Feedback>\n      )}\n      {/* oxlint-disable-next-line typescript-eslint/no-unsafe-type-assertion -- renderDefault expects the base input props */}\n      {props.renderDefault(props as unknown as ArrayOfObjectsInputProps)}\n    </Stack>\n  )\n}\n","import {type ComponentType} from 'react'\nimport {type ArrayOfObjectsInputProps, definePlugin} from 'sanity'\n\nimport {type HotspotItem, ImageHotspotArray} from './ImageHotspotArray'\nimport {type HotspotTooltipProps} from './Spot'\n\nexport interface ImageHotspotOptions<HotspotFields = {[key: string]: unknown}> {\n  pathRoot?: 'document' | 'parent'\n  imagePath: string\n  descriptionPath?: string\n  tooltip?: ComponentType<HotspotTooltipProps<HotspotFields>>\n}\n\ndeclare module 'sanity' {\n  export interface ArrayOptions {\n    imageHotspot?: ImageHotspotOptions\n  }\n}\n\nexport const imageHotspotArrayPlugin = definePlugin({\n  name: 'image-hotspot-array',\n  form: {\n    components: {\n      input: (props) => {\n        if (props.schemaType.jsonType === 'array' && props.schemaType.options?.imageHotspot) {\n          const imageHotspotOptions = props.schemaType.options?.imageHotspot\n          if (imageHotspotOptions) {\n            return (\n              <ImageHotspotArray\n                // oxlint-disable-next-line typescript-eslint/no-unsafe-type-assertion -- narrowed by the jsonType/options checks above\n                {...(props as unknown as ArrayOfObjectsInputProps<HotspotItem>)}\n                imageHotspotOptions={imageHotspotOptions}\n              />\n            )\n          }\n        }\n        return props.renderDefault(props)\n      },\n    },\n  },\n})\n"],"mappings":";;;;;;;;;;;;AAEA,SAAwB,SAAA,IAAqE;eAA5D,EAAC,aAADA,IAE7BC;CADF,OAEW,EAAA,OAAA,wBADT,KAAA,oBAAC,MAAD;EAAM,SAAS;EAAG,QAAQ;EAAG,QAAQ;EAAG,MAAK;EAC3C,UAAA,oBAAC,MAAD,EAAO,SAAe,CAAA;CAClB,CAAA,GADG,EAAA,KAAA,sBADTA;AAIJ;ACQA,MAAM,YAA2B;CAC/B,OAAO;CACP,QAAQ;CACR,UAAU;CACV,WAAW;CACX,KAAK;CACL,MAAM;CACN,QAAQ;CACR,QAAQ;CACR,SAAS;CACT,gBAAgB;CAChB,YAAY;CACZ,cAAc;CACd,YAAY;CACZ,OAAO;AACT,GAEM,qBAAoC;CACxC,YAAY;CACZ,QAAQ;CACR,QAAQ;AACV,GAEM,sBAAqC;CACzC,YAAY;CACZ,QAAQ;AACV,GAEM,WAA0B;CAC9B,UAAU;CACV,MAAM;CACN,KAAK;CACL,QAAQ;CACR,OAAO;CACP,QAAQ;CACR,YAAY;CACZ,YAAY;CACZ,cAAc;CAEd,eAAe;AACjB,GAEM,sBAAqC,EACzC,YAAY,UACd,GAEM,aAA4B;CAChC,OAAO;CACP,UAAU;CACV,YAAY;CACZ,YAAY;AACd,GAEM,wBAAuC,EAC3C,YAAY,SACd,GAEM,SAAS,QAAgB,KAAK,MAAM,MAAM,GAAG,IAAI;AAmBvD,SAAwB,KAAA,IASI;gBATC,EAC3B,OACA,QACA,QACA,wBACA,SAAS,kBACT,OACA,YACA,kBAR2BC,IAUrB,CAAC,YAAY,iBAAiB,SAAS,EAAK,GAC5C,CAAC,YAAY,iBAAiB,S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