@soomo/react-text-annotator 3.0.0-staging.15 → 3.0.0-staging.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/dist/index.d.ts +1 -0
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/react-text-annotator.es.js +2 -0
  4. package/dist/react-text-annotator.es.js.map +1 -1
  5. package/dist/react-text-annotator.es10.js +210 -562
  6. package/dist/react-text-annotator.es10.js.map +1 -1
  7. package/dist/react-text-annotator.es11.js +535 -444
  8. package/dist/react-text-annotator.es11.js.map +1 -1
  9. package/dist/react-text-annotator.es12.js +488 -2
  10. package/dist/react-text-annotator.es12.js.map +1 -1
  11. package/dist/react-text-annotator.es13.js +2 -35
  12. package/dist/react-text-annotator.es13.js.map +1 -1
  13. package/dist/react-text-annotator.es14.js +24 -888
  14. package/dist/react-text-annotator.es14.js.map +1 -1
  15. package/dist/react-text-annotator.es15.js +891 -220
  16. package/dist/react-text-annotator.es15.js.map +1 -1
  17. package/dist/react-text-annotator.es16.js +218 -126
  18. package/dist/react-text-annotator.es16.js.map +1 -1
  19. package/dist/react-text-annotator.es17.js +134 -112
  20. package/dist/react-text-annotator.es17.js.map +1 -1
  21. package/dist/react-text-annotator.es18.js +2 -309
  22. package/dist/react-text-annotator.es18.js.map +1 -1
  23. package/dist/react-text-annotator.es19.js +2 -58
  24. package/dist/react-text-annotator.es19.js.map +1 -1
  25. package/dist/react-text-annotator.es2.js +2 -2
  26. package/dist/react-text-annotator.es20.js +113 -19
  27. package/dist/react-text-annotator.es20.js.map +1 -1
  28. package/dist/react-text-annotator.es21.js +309 -2
  29. package/dist/react-text-annotator.es21.js.map +1 -1
  30. package/dist/react-text-annotator.es22.js +58 -2
  31. package/dist/react-text-annotator.es22.js.map +1 -1
  32. package/dist/react-text-annotator.es23.js +17 -118
  33. package/dist/react-text-annotator.es23.js.map +1 -1
  34. package/dist/react-text-annotator.es24.js +107 -538
  35. package/dist/react-text-annotator.es24.js.map +1 -1
  36. package/dist/react-text-annotator.es25.js +555 -0
  37. package/dist/react-text-annotator.es25.js.map +1 -0
  38. package/dist/react-text-annotator.es3.js +2 -2
  39. package/dist/react-text-annotator.es4.js +2 -2
  40. package/dist/react-text-annotator.es5.js +4 -4
  41. package/dist/react-text-annotator.es6.js +178 -9
  42. package/dist/react-text-annotator.es6.js.map +1 -1
  43. package/dist/react-text-annotator.es7.js +12 -1
  44. package/dist/react-text-annotator.es7.js.map +1 -1
  45. package/dist/react-text-annotator.es9.js +20 -223
  46. package/dist/react-text-annotator.es9.js.map +1 -1
  47. package/package.json +13 -7
  48. package/dist/react-text-annotator.es8.js +0 -27
  49. package/dist/react-text-annotator.es8.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"react-text-annotator.es25.js","sources":["../../../node_modules/@floating-ui/core/dist/floating-ui.core.mjs"],"sourcesContent":["import { getSideAxis, getAlignmentAxis, getAxisLength, getSide, getAlignment, evaluate, getPaddingObject, rectToClientRect, min, clamp, placements, getAlignmentSides, getOppositeAlignmentPlacement, getOppositePlacement, getExpandedPlacements, getOppositeAxisPlacements, sides, max, getOppositeAxis } from '@floating-ui/utils';\nexport { rectToClientRect } from '@floating-ui/utils';\n\nfunction computeCoordsFromPlacement(_ref, placement, rtl) {\n let {\n reference,\n floating\n } = _ref;\n const sideAxis = getSideAxis(placement);\n const alignmentAxis = getAlignmentAxis(placement);\n const alignLength = getAxisLength(alignmentAxis);\n const side = getSide(placement);\n const isVertical = sideAxis === 'y';\n const commonX = reference.x + reference.width / 2 - floating.width / 2;\n const commonY = reference.y + reference.height / 2 - floating.height / 2;\n const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;\n let coords;\n switch (side) {\n case 'top':\n coords = {\n x: commonX,\n y: reference.y - floating.height\n };\n break;\n case 'bottom':\n coords = {\n x: commonX,\n y: reference.y + reference.height\n };\n break;\n case 'right':\n coords = {\n x: reference.x + reference.width,\n y: commonY\n };\n break;\n case 'left':\n coords = {\n x: reference.x - floating.width,\n y: commonY\n };\n break;\n default:\n coords = {\n x: reference.x,\n y: reference.y\n };\n }\n switch (getAlignment(placement)) {\n case 'start':\n coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);\n break;\n case 'end':\n coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1);\n break;\n }\n return coords;\n}\n\n/**\n * Computes the `x` and `y` coordinates that will place the floating element\n * next to a given reference element.\n *\n * This export does not have any `platform` interface logic. You will need to\n * write one for the platform you are using Floating UI with.\n */\nconst computePosition = async (reference, floating, config) => {\n const {\n placement = 'bottom',\n strategy = 'absolute',\n middleware = [],\n platform\n } = config;\n const validMiddleware = middleware.filter(Boolean);\n const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating));\n let rects = await platform.getElementRects({\n reference,\n floating,\n strategy\n });\n let {\n x,\n y\n } = computeCoordsFromPlacement(rects, placement, rtl);\n let statefulPlacement = placement;\n let middlewareData = {};\n let resetCount = 0;\n for (let i = 0; i < validMiddleware.length; i++) {\n const {\n name,\n fn\n } = validMiddleware[i];\n const {\n x: nextX,\n y: nextY,\n data,\n reset\n } = await fn({\n x,\n y,\n initialPlacement: placement,\n placement: statefulPlacement,\n strategy,\n middlewareData,\n rects,\n platform,\n elements: {\n reference,\n floating\n }\n });\n x = nextX != null ? nextX : x;\n y = nextY != null ? nextY : y;\n middlewareData = {\n ...middlewareData,\n [name]: {\n ...middlewareData[name],\n ...data\n }\n };\n if (reset && resetCount <= 50) {\n resetCount++;\n if (typeof reset === 'object') {\n if (reset.placement) {\n statefulPlacement = reset.placement;\n }\n if (reset.rects) {\n rects = reset.rects === true ? await platform.getElementRects({\n reference,\n floating,\n strategy\n }) : reset.rects;\n }\n ({\n x,\n y\n } = computeCoordsFromPlacement(rects, statefulPlacement, rtl));\n }\n i = -1;\n }\n }\n return {\n x,\n y,\n placement: statefulPlacement,\n strategy,\n middlewareData\n };\n};\n\n/**\n * Resolves with an object of overflow side offsets that determine how much the\n * element is overflowing a given clipping boundary on each side.\n * - positive = overflowing the boundary by that number of pixels\n * - negative = how many pixels left before it will overflow\n * - 0 = lies flush with the boundary\n * @see https://floating-ui.com/docs/detectOverflow\n */\nasync function detectOverflow(state, options) {\n var _await$platform$isEle;\n if (options === void 0) {\n options = {};\n }\n const {\n x,\n y,\n platform,\n rects,\n elements,\n strategy\n } = state;\n const {\n boundary = 'clippingAncestors',\n rootBoundary = 'viewport',\n elementContext = 'floating',\n altBoundary = false,\n padding = 0\n } = evaluate(options, state);\n const paddingObject = getPaddingObject(padding);\n const altContext = elementContext === 'floating' ? 'reference' : 'floating';\n const element = elements[altBoundary ? altContext : elementContext];\n const clippingClientRect = rectToClientRect(await platform.getClippingRect({\n element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))),\n boundary,\n rootBoundary,\n strategy\n }));\n const rect = elementContext === 'floating' ? {\n x,\n y,\n width: rects.floating.width,\n height: rects.floating.height\n } : rects.reference;\n const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));\n const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {\n x: 1,\n y: 1\n } : {\n x: 1,\n y: 1\n };\n const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({\n elements,\n rect,\n offsetParent,\n strategy\n }) : rect);\n return {\n top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,\n bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,\n left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,\n right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x\n };\n}\n\n/**\n * Provides data to position an inner element of the floating element so that it\n * appears centered to the reference element.\n * @see https://floating-ui.com/docs/arrow\n */\nconst arrow = options => ({\n name: 'arrow',\n options,\n async fn(state) {\n const {\n x,\n y,\n placement,\n rects,\n platform,\n elements,\n middlewareData\n } = state;\n // Since `element` is required, we don't Partial<> the type.\n const {\n element,\n padding = 0\n } = evaluate(options, state) || {};\n if (element == null) {\n return {};\n }\n const paddingObject = getPaddingObject(padding);\n const coords = {\n x,\n y\n };\n const axis = getAlignmentAxis(placement);\n const length = getAxisLength(axis);\n const arrowDimensions = await platform.getDimensions(element);\n const isYAxis = axis === 'y';\n const minProp = isYAxis ? 'top' : 'left';\n const maxProp = isYAxis ? 'bottom' : 'right';\n const clientProp = isYAxis ? 'clientHeight' : 'clientWidth';\n const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];\n const startDiff = coords[axis] - rects.reference[axis];\n const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element));\n let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;\n\n // DOM platform can return `window` as the `offsetParent`.\n if (!clientSize || !(await (platform.isElement == null ? void 0 : platform.isElement(arrowOffsetParent)))) {\n clientSize = elements.floating[clientProp] || rects.floating[length];\n }\n const centerToReference = endDiff / 2 - startDiff / 2;\n\n // If the padding is large enough that it causes the arrow to no longer be\n // centered, modify the padding so that it is centered.\n const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;\n const minPadding = min(paddingObject[minProp], largestPossiblePadding);\n const maxPadding = min(paddingObject[maxProp], largestPossiblePadding);\n\n // Make sure the arrow doesn't overflow the floating element if the center\n // point is outside the floating element's bounds.\n const min$1 = minPadding;\n const max = clientSize - arrowDimensions[length] - maxPadding;\n const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;\n const offset = clamp(min$1, center, max);\n\n // If the reference is small enough that the arrow's padding causes it to\n // to point to nothing for an aligned placement, adjust the offset of the\n // floating element itself. To ensure `shift()` continues to take action,\n // a single reset is performed when this is true.\n const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;\n const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max : 0;\n return {\n [axis]: coords[axis] + alignmentOffset,\n data: {\n [axis]: offset,\n centerOffset: center - offset - alignmentOffset,\n ...(shouldAddOffset && {\n alignmentOffset\n })\n },\n reset: shouldAddOffset\n };\n }\n});\n\nfunction getPlacementList(alignment, autoAlignment, allowedPlacements) {\n const allowedPlacementsSortedByAlignment = alignment ? [...allowedPlacements.filter(placement => getAlignment(placement) === alignment), ...allowedPlacements.filter(placement => getAlignment(placement) !== alignment)] : allowedPlacements.filter(placement => getSide(placement) === placement);\n return allowedPlacementsSortedByAlignment.filter(placement => {\n if (alignment) {\n return getAlignment(placement) === alignment || (autoAlignment ? getOppositeAlignmentPlacement(placement) !== placement : false);\n }\n return true;\n });\n}\n/**\n * Optimizes the visibility of the floating element by choosing the placement\n * that has the most space available automatically, without needing to specify a\n * preferred placement. Alternative to `flip`.\n * @see https://floating-ui.com/docs/autoPlacement\n */\nconst autoPlacement = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'autoPlacement',\n options,\n async fn(state) {\n var _middlewareData$autoP, _middlewareData$autoP2, _placementsThatFitOnE;\n const {\n rects,\n middlewareData,\n placement,\n platform,\n elements\n } = state;\n const {\n crossAxis = false,\n alignment,\n allowedPlacements = placements,\n autoAlignment = true,\n ...detectOverflowOptions\n } = evaluate(options, state);\n const placements$1 = alignment !== undefined || allowedPlacements === placements ? getPlacementList(alignment || null, autoAlignment, allowedPlacements) : allowedPlacements;\n const overflow = await detectOverflow(state, detectOverflowOptions);\n const currentIndex = ((_middlewareData$autoP = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP.index) || 0;\n const currentPlacement = placements$1[currentIndex];\n if (currentPlacement == null) {\n return {};\n }\n const alignmentSides = getAlignmentSides(currentPlacement, rects, await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)));\n\n // Make `computeCoords` start from the right place.\n if (placement !== currentPlacement) {\n return {\n reset: {\n placement: placements$1[0]\n }\n };\n }\n const currentOverflows = [overflow[getSide(currentPlacement)], overflow[alignmentSides[0]], overflow[alignmentSides[1]]];\n const allOverflows = [...(((_middlewareData$autoP2 = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP2.overflows) || []), {\n placement: currentPlacement,\n overflows: currentOverflows\n }];\n const nextPlacement = placements$1[currentIndex + 1];\n\n // There are more placements to check.\n if (nextPlacement) {\n return {\n data: {\n index: currentIndex + 1,\n overflows: allOverflows\n },\n reset: {\n placement: nextPlacement\n }\n };\n }\n const placementsSortedByMostSpace = allOverflows.map(d => {\n const alignment = getAlignment(d.placement);\n return [d.placement, alignment && crossAxis ?\n // Check along the mainAxis and main crossAxis side.\n d.overflows.slice(0, 2).reduce((acc, v) => acc + v, 0) :\n // Check only the mainAxis.\n d.overflows[0], d.overflows];\n }).sort((a, b) => a[1] - b[1]);\n const placementsThatFitOnEachSide = placementsSortedByMostSpace.filter(d => d[2].slice(0,\n // Aligned placements should not check their opposite crossAxis\n // side.\n getAlignment(d[0]) ? 2 : 3).every(v => v <= 0));\n const resetPlacement = ((_placementsThatFitOnE = placementsThatFitOnEachSide[0]) == null ? void 0 : _placementsThatFitOnE[0]) || placementsSortedByMostSpace[0][0];\n if (resetPlacement !== placement) {\n return {\n data: {\n index: currentIndex + 1,\n overflows: allOverflows\n },\n reset: {\n placement: resetPlacement\n }\n };\n }\n return {};\n }\n };\n};\n\n/**\n * Optimizes the visibility of the floating element by flipping the `placement`\n * in order to keep it in view when the preferred placement(s) will overflow the\n * clipping boundary. Alternative to `autoPlacement`.\n * @see https://floating-ui.com/docs/flip\n */\nconst flip = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'flip',\n options,\n async fn(state) {\n var _middlewareData$arrow, _middlewareData$flip;\n const {\n placement,\n middlewareData,\n rects,\n initialPlacement,\n platform,\n elements\n } = state;\n const {\n mainAxis: checkMainAxis = true,\n crossAxis: checkCrossAxis = true,\n fallbackPlacements: specifiedFallbackPlacements,\n fallbackStrategy = 'bestFit',\n fallbackAxisSideDirection = 'none',\n flipAlignment = true,\n ...detectOverflowOptions\n } = evaluate(options, state);\n\n // If a reset by the arrow was caused due to an alignment offset being\n // added, we should skip any logic now since `flip()` has already done its\n // work.\n // https://github.com/floating-ui/floating-ui/issues/2549#issuecomment-1719601643\n if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {\n return {};\n }\n const side = getSide(placement);\n const isBasePlacement = getSide(initialPlacement) === initialPlacement;\n const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));\n const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));\n if (!specifiedFallbackPlacements && fallbackAxisSideDirection !== 'none') {\n fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));\n }\n const placements = [initialPlacement, ...fallbackPlacements];\n const overflow = await detectOverflow(state, detectOverflowOptions);\n const overflows = [];\n let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];\n if (checkMainAxis) {\n overflows.push(overflow[side]);\n }\n if (checkCrossAxis) {\n const sides = getAlignmentSides(placement, rects, rtl);\n overflows.push(overflow[sides[0]], overflow[sides[1]]);\n }\n overflowsData = [...overflowsData, {\n placement,\n overflows\n }];\n\n // One or more sides is overflowing.\n if (!overflows.every(side => side <= 0)) {\n var _middlewareData$flip2, _overflowsData$filter;\n const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;\n const nextPlacement = placements[nextIndex];\n if (nextPlacement) {\n // Try next placement and re-run the lifecycle.\n return {\n data: {\n index: nextIndex,\n overflows: overflowsData\n },\n reset: {\n placement: nextPlacement\n }\n };\n }\n\n // First, find the candidates that fit on the mainAxis side of overflow,\n // then find the placement that fits the best on the main crossAxis side.\n let resetPlacement = (_overflowsData$filter = overflowsData.filter(d => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;\n\n // Otherwise fallback.\n if (!resetPlacement) {\n switch (fallbackStrategy) {\n case 'bestFit':\n {\n var _overflowsData$map$so;\n const placement = (_overflowsData$map$so = overflowsData.map(d => [d.placement, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$map$so[0];\n if (placement) {\n resetPlacement = placement;\n }\n break;\n }\n case 'initialPlacement':\n resetPlacement = initialPlacement;\n break;\n }\n }\n if (placement !== resetPlacement) {\n return {\n reset: {\n placement: resetPlacement\n }\n };\n }\n }\n return {};\n }\n };\n};\n\nfunction getSideOffsets(overflow, rect) {\n return {\n top: overflow.top - rect.height,\n right: overflow.right - rect.width,\n bottom: overflow.bottom - rect.height,\n left: overflow.left - rect.width\n };\n}\nfunction isAnySideFullyClipped(overflow) {\n return sides.some(side => overflow[side] >= 0);\n}\n/**\n * Provides data to hide the floating element in applicable situations, such as\n * when it is not in the same clipping context as the reference element.\n * @see https://floating-ui.com/docs/hide\n */\nconst hide = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'hide',\n options,\n async fn(state) {\n const {\n rects\n } = state;\n const {\n strategy = 'referenceHidden',\n ...detectOverflowOptions\n } = evaluate(options, state);\n switch (strategy) {\n case 'referenceHidden':\n {\n const overflow = await detectOverflow(state, {\n ...detectOverflowOptions,\n elementContext: 'reference'\n });\n const offsets = getSideOffsets(overflow, rects.reference);\n return {\n data: {\n referenceHiddenOffsets: offsets,\n referenceHidden: isAnySideFullyClipped(offsets)\n }\n };\n }\n case 'escaped':\n {\n const overflow = await detectOverflow(state, {\n ...detectOverflowOptions,\n altBoundary: true\n });\n const offsets = getSideOffsets(overflow, rects.floating);\n return {\n data: {\n escapedOffsets: offsets,\n escaped: isAnySideFullyClipped(offsets)\n }\n };\n }\n default:\n {\n return {};\n }\n }\n }\n };\n};\n\nfunction getBoundingRect(rects) {\n const minX = min(...rects.map(rect => rect.left));\n const minY = min(...rects.map(rect => rect.top));\n const maxX = max(...rects.map(rect => rect.right));\n const maxY = max(...rects.map(rect => rect.bottom));\n return {\n x: minX,\n y: minY,\n width: maxX - minX,\n height: maxY - minY\n };\n}\nfunction getRectsByLine(rects) {\n const sortedRects = rects.slice().sort((a, b) => a.y - b.y);\n const groups = [];\n let prevRect = null;\n for (let i = 0; i < sortedRects.length; i++) {\n const rect = sortedRects[i];\n if (!prevRect || rect.y - prevRect.y > prevRect.height / 2) {\n groups.push([rect]);\n } else {\n groups[groups.length - 1].push(rect);\n }\n prevRect = rect;\n }\n return groups.map(rect => rectToClientRect(getBoundingRect(rect)));\n}\n/**\n * Provides improved positioning for inline reference elements that can span\n * over multiple lines, such as hyperlinks or range selections.\n * @see https://floating-ui.com/docs/inline\n */\nconst inline = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'inline',\n options,\n async fn(state) {\n const {\n placement,\n elements,\n rects,\n platform,\n strategy\n } = state;\n // A MouseEvent's client{X,Y} coords can be up to 2 pixels off a\n // ClientRect's bounds, despite the event listener being triggered. A\n // padding of 2 seems to handle this issue.\n const {\n padding = 2,\n x,\n y\n } = evaluate(options, state);\n const nativeClientRects = Array.from((await (platform.getClientRects == null ? void 0 : platform.getClientRects(elements.reference))) || []);\n const clientRects = getRectsByLine(nativeClientRects);\n const fallback = rectToClientRect(getBoundingRect(nativeClientRects));\n const paddingObject = getPaddingObject(padding);\n function getBoundingClientRect() {\n // There are two rects and they are disjoined.\n if (clientRects.length === 2 && clientRects[0].left > clientRects[1].right && x != null && y != null) {\n // Find the first rect in which the point is fully inside.\n return clientRects.find(rect => x > rect.left - paddingObject.left && x < rect.right + paddingObject.right && y > rect.top - paddingObject.top && y < rect.bottom + paddingObject.bottom) || fallback;\n }\n\n // There are 2 or more connected rects.\n if (clientRects.length >= 2) {\n if (getSideAxis(placement) === 'y') {\n const firstRect = clientRects[0];\n const lastRect = clientRects[clientRects.length - 1];\n const isTop = getSide(placement) === 'top';\n const top = firstRect.top;\n const bottom = lastRect.bottom;\n const left = isTop ? firstRect.left : lastRect.left;\n const right = isTop ? firstRect.right : lastRect.right;\n const width = right - left;\n const height = bottom - top;\n return {\n top,\n bottom,\n left,\n right,\n width,\n height,\n x: left,\n y: top\n };\n }\n const isLeftSide = getSide(placement) === 'left';\n const maxRight = max(...clientRects.map(rect => rect.right));\n const minLeft = min(...clientRects.map(rect => rect.left));\n const measureRects = clientRects.filter(rect => isLeftSide ? rect.left === minLeft : rect.right === maxRight);\n const top = measureRects[0].top;\n const bottom = measureRects[measureRects.length - 1].bottom;\n const left = minLeft;\n const right = maxRight;\n const width = right - left;\n const height = bottom - top;\n return {\n top,\n bottom,\n left,\n right,\n width,\n height,\n x: left,\n y: top\n };\n }\n return fallback;\n }\n const resetRects = await platform.getElementRects({\n reference: {\n getBoundingClientRect\n },\n floating: elements.floating,\n strategy\n });\n if (rects.reference.x !== resetRects.reference.x || rects.reference.y !== resetRects.reference.y || rects.reference.width !== resetRects.reference.width || rects.reference.height !== resetRects.reference.height) {\n return {\n reset: {\n rects: resetRects\n }\n };\n }\n return {};\n }\n };\n};\n\n// For type backwards-compatibility, the `OffsetOptions` type was also\n// Derivable.\n\nasync function convertValueToCoords(state, options) {\n const {\n placement,\n platform,\n elements\n } = state;\n const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));\n const side = getSide(placement);\n const alignment = getAlignment(placement);\n const isVertical = getSideAxis(placement) === 'y';\n const mainAxisMulti = ['left', 'top'].includes(side) ? -1 : 1;\n const crossAxisMulti = rtl && isVertical ? -1 : 1;\n const rawValue = evaluate(options, state);\n\n // eslint-disable-next-line prefer-const\n let {\n mainAxis,\n crossAxis,\n alignmentAxis\n } = typeof rawValue === 'number' ? {\n mainAxis: rawValue,\n crossAxis: 0,\n alignmentAxis: null\n } : {\n mainAxis: 0,\n crossAxis: 0,\n alignmentAxis: null,\n ...rawValue\n };\n if (alignment && typeof alignmentAxis === 'number') {\n crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis;\n }\n return isVertical ? {\n x: crossAxis * crossAxisMulti,\n y: mainAxis * mainAxisMulti\n } : {\n x: mainAxis * mainAxisMulti,\n y: crossAxis * crossAxisMulti\n };\n}\n\n/**\n * Modifies the placement by translating the floating element along the\n * specified axes.\n * A number (shorthand for `mainAxis` or distance), or an axes configuration\n * object may be passed.\n * @see https://floating-ui.com/docs/offset\n */\nconst offset = function (options) {\n if (options === void 0) {\n options = 0;\n }\n return {\n name: 'offset',\n options,\n async fn(state) {\n var _middlewareData$offse, _middlewareData$arrow;\n const {\n x,\n y,\n placement,\n middlewareData\n } = state;\n const diffCoords = await convertValueToCoords(state, options);\n\n // If the placement is the same and the arrow caused an alignment offset\n // then we don't need to change the positioning coordinates.\n if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {\n return {};\n }\n return {\n x: x + diffCoords.x,\n y: y + diffCoords.y,\n data: {\n ...diffCoords,\n placement\n }\n };\n }\n };\n};\n\n/**\n * Optimizes the visibility of the floating element by shifting it in order to\n * keep it in view when it will overflow the clipping boundary.\n * @see https://floating-ui.com/docs/shift\n */\nconst shift = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'shift',\n options,\n async fn(state) {\n const {\n x,\n y,\n placement\n } = state;\n const {\n mainAxis: checkMainAxis = true,\n crossAxis: checkCrossAxis = false,\n limiter = {\n fn: _ref => {\n let {\n x,\n y\n } = _ref;\n return {\n x,\n y\n };\n }\n },\n ...detectOverflowOptions\n } = evaluate(options, state);\n const coords = {\n x,\n y\n };\n const overflow = await detectOverflow(state, detectOverflowOptions);\n const crossAxis = getSideAxis(getSide(placement));\n const mainAxis = getOppositeAxis(crossAxis);\n let mainAxisCoord = coords[mainAxis];\n let crossAxisCoord = coords[crossAxis];\n if (checkMainAxis) {\n const minSide = mainAxis === 'y' ? 'top' : 'left';\n const maxSide = mainAxis === 'y' ? 'bottom' : 'right';\n const min = mainAxisCoord + overflow[minSide];\n const max = mainAxisCoord - overflow[maxSide];\n mainAxisCoord = clamp(min, mainAxisCoord, max);\n }\n if (checkCrossAxis) {\n const minSide = crossAxis === 'y' ? 'top' : 'left';\n const maxSide = crossAxis === 'y' ? 'bottom' : 'right';\n const min = crossAxisCoord + overflow[minSide];\n const max = crossAxisCoord - overflow[maxSide];\n crossAxisCoord = clamp(min, crossAxisCoord, max);\n }\n const limitedCoords = limiter.fn({\n ...state,\n [mainAxis]: mainAxisCoord,\n [crossAxis]: crossAxisCoord\n });\n return {\n ...limitedCoords,\n data: {\n x: limitedCoords.x - x,\n y: limitedCoords.y - y\n }\n };\n }\n };\n};\n/**\n * Built-in `limiter` that will stop `shift()` at a certain point.\n */\nconst limitShift = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n options,\n fn(state) {\n const {\n x,\n y,\n placement,\n rects,\n middlewareData\n } = state;\n const {\n offset = 0,\n mainAxis: checkMainAxis = true,\n crossAxis: checkCrossAxis = true\n } = evaluate(options, state);\n const coords = {\n x,\n y\n };\n const crossAxis = getSideAxis(placement);\n const mainAxis = getOppositeAxis(crossAxis);\n let mainAxisCoord = coords[mainAxis];\n let crossAxisCoord = coords[crossAxis];\n const rawOffset = evaluate(offset, state);\n const computedOffset = typeof rawOffset === 'number' ? {\n mainAxis: rawOffset,\n crossAxis: 0\n } : {\n mainAxis: 0,\n crossAxis: 0,\n ...rawOffset\n };\n if (checkMainAxis) {\n const len = mainAxis === 'y' ? 'height' : 'width';\n const limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis;\n const limitMax = rects.reference[mainAxis] + rects.reference[len] - computedOffset.mainAxis;\n if (mainAxisCoord < limitMin) {\n mainAxisCoord = limitMin;\n } else if (mainAxisCoord > limitMax) {\n mainAxisCoord = limitMax;\n }\n }\n if (checkCrossAxis) {\n var _middlewareData$offse, _middlewareData$offse2;\n const len = mainAxis === 'y' ? 'width' : 'height';\n const isOriginSide = ['top', 'left'].includes(getSide(placement));\n const limitMin = rects.reference[crossAxis] - rects.floating[len] + (isOriginSide ? ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse[crossAxis]) || 0 : 0) + (isOriginSide ? 0 : computedOffset.crossAxis);\n const limitMax = rects.reference[crossAxis] + rects.reference[len] + (isOriginSide ? 0 : ((_middlewareData$offse2 = middlewareData.offset) == null ? void 0 : _middlewareData$offse2[crossAxis]) || 0) - (isOriginSide ? computedOffset.crossAxis : 0);\n if (crossAxisCoord < limitMin) {\n crossAxisCoord = limitMin;\n } else if (crossAxisCoord > limitMax) {\n crossAxisCoord = limitMax;\n }\n }\n return {\n [mainAxis]: mainAxisCoord,\n [crossAxis]: crossAxisCoord\n };\n }\n };\n};\n\n/**\n * Provides data that allows you to change the size of the floating element —\n * for instance, prevent it from overflowing the clipping boundary or match the\n * width of the reference element.\n * @see https://floating-ui.com/docs/size\n */\nconst size = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'size',\n options,\n async fn(state) {\n const {\n placement,\n rects,\n platform,\n elements\n } = state;\n const {\n apply = () => {},\n ...detectOverflowOptions\n } = evaluate(options, state);\n const overflow = await detectOverflow(state, detectOverflowOptions);\n const side = getSide(placement);\n const alignment = getAlignment(placement);\n const isYAxis = getSideAxis(placement) === 'y';\n const {\n width,\n height\n } = rects.floating;\n let heightSide;\n let widthSide;\n if (side === 'top' || side === 'bottom') {\n heightSide = side;\n widthSide = alignment === ((await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating))) ? 'start' : 'end') ? 'left' : 'right';\n } else {\n widthSide = side;\n heightSide = alignment === 'end' ? 'top' : 'bottom';\n }\n const overflowAvailableHeight = height - overflow[heightSide];\n const overflowAvailableWidth = width - overflow[widthSide];\n const noShift = !state.middlewareData.shift;\n let availableHeight = overflowAvailableHeight;\n let availableWidth = overflowAvailableWidth;\n if (isYAxis) {\n const maximumClippingWidth = width - overflow.left - overflow.right;\n availableWidth = alignment || noShift ? min(overflowAvailableWidth, maximumClippingWidth) : maximumClippingWidth;\n } else {\n const maximumClippingHeight = height - overflow.top - overflow.bottom;\n availableHeight = alignment || noShift ? min(overflowAvailableHeight, maximumClippingHeight) : maximumClippingHeight;\n }\n if (noShift && !alignment) {\n const xMin = max(overflow.left, 0);\n const xMax = max(overflow.right, 0);\n const yMin = max(overflow.top, 0);\n const yMax = max(overflow.bottom, 0);\n if (isYAxis) {\n availableWidth = width - 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : max(overflow.left, overflow.right));\n } else {\n availableHeight = height - 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : max(overflow.top, overflow.bottom));\n }\n }\n await apply({\n ...state,\n availableWidth,\n availableHeight\n });\n const nextDimensions = await platform.getDimensions(elements.floating);\n if (width !== nextDimensions.width || height !== nextDimensions.height) {\n return {\n reset: {\n rects: true\n }\n };\n }\n return {};\n }\n };\n};\n\nexport { arrow, autoPlacement, computePosition, detectOverflow, flip, hide, inline, limitShift, offset, shift, size };\n"],"names":["alignment","top","bottom","left","right","width","height","x","y","min","max"],"mappings":";AAGA,SAAS,2BAA2B,MAAM,WAAW,KAAK;AACxD,MAAI;AAAA,IACF;AAAA,IACA;AAAA,EACD,IAAG;AACJ,QAAM,WAAW,YAAY,SAAS;AACtC,QAAM,gBAAgB,iBAAiB,SAAS;AAChD,QAAM,cAAc,cAAc,aAAa;AAC/C,QAAM,OAAO,QAAQ,SAAS;AAC9B,QAAM,aAAa,aAAa;AAChC,QAAM,UAAU,UAAU,IAAI,UAAU,QAAQ,IAAI,SA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,OAAM,gBAAgB,SAAS,OAAO;AAC5C,wBAAgB,MAAMD,MAAK,eAAeC,IAAG;AAAA,MAC9C;AACD,UAAI,gBAAgB;AAClB,cAAM,UAAU,cAAc,MAAM,QAAQ;AAC5C,cAAM,UAAU,cAAc,MAAM,WAAW;AAC/C,cAAMD,OAAM,iBAAiB,SAAS,OAAO;AAC7C,cAAMC,OAAM,iBAAiB,SAAS,OAAO;AAC7C,yBAAiB,MAAMD,MAAK,gBAAgBC,IAAG;AAAA,MAChD;AACD,YAAM,gBAAgB,QAAQ,GAAG;AAAA,QAC/B,GAAG;AAAA,QACH,CAAC,QAAQ,GAAG;AAAA,QACZ,CAAC,SAAS,GAAG;AAAA,MACrB,CAAO;AACD,aAAO;AAAA,QACL,GAAG;AAAA,QACH,MAAM;AAAA,UACJ,GAAG,cAAc,IAAI;AAAA,UACrB,GAAG,cAAc,IAAI;AAAA,QACtB;AAAA,MACT;AAAA,IACK;AAAA,EACL;AACA;","x_google_ignoreList":[0]}
@@ -1,9 +1,9 @@
1
- import { j as jsxRuntimeExports } from "./react-text-annotator.es6.js";
1
+ import { j as jsxRuntimeExports } from "./react-text-annotator.es7.js";
2
2
  import { useContext, useEffect, Children, cloneElement } from "react";
3
3
  import { AnnotoriousContext } from "@annotorious/react";
4
4
  import { TEIPlugin } from "@recogito/text-annotator-tei";
5
5
  import { createTextAnnotator } from "@soomo/text-annotator";
6
- import "./react-text-annotator.es7.js";
6
+ /* empty css */
7
7
  const TEIAnnotator = (props) => {
8
8
  const { children, ...opts } = props;
9
9
  const { anno, setAnno } = useContext(AnnotoriousContext);
@@ -1,8 +1,8 @@
1
- import { j as jsxRuntimeExports } from "./react-text-annotator.es6.js";
1
+ import { j as jsxRuntimeExports } from "./react-text-annotator.es7.js";
2
2
  import { useRef, useContext, useEffect } from "react";
3
3
  import { AnnotoriousContext } from "@annotorious/react";
4
4
  import { createTextAnnotator } from "@soomo/text-annotator";
5
- import "./react-text-annotator.es7.js";
5
+ /* empty css */
6
6
  const TextAnnotator = (props) => {
7
7
  const el = useRef(null);
8
8
  const { className, children, ...opts } = props;
@@ -1,9 +1,9 @@
1
- import { j as jsxRuntimeExports } from "./react-text-annotator.es6.js";
1
+ import { j as jsxRuntimeExports } from "./react-text-annotator.es7.js";
2
2
  import { useState, useEffect } from "react";
3
3
  import { useSelection } from "@annotorious/react";
4
- import { getClosestRect, toClientRects } from "./react-text-annotator.es8.js";
5
- import { useFloating } from "./react-text-annotator.es9.js";
6
- import { autoPlacement, inline, offset, shift, autoUpdate } from "./react-text-annotator.es10.js";
4
+ import { getClosestRect, toClientRects } from "./react-text-annotator.es9.js";
5
+ import { useFloating } from "./react-text-annotator.es10.js";
6
+ import { autoPlacement, inline, offset, shift, autoUpdate } from "./react-text-annotator.es11.js";
7
7
  const TextAnnotatorPopup = (props) => {
8
8
  const { selected, pointerEvent } = useSelection();
9
9
  const [mousePos, setMousePos] = useState();
@@ -1,13 +1,182 @@
1
- import { __module as jsxRuntime } from "./react-text-annotator.es12.js";
2
- import { __require as requireReactJsxRuntime_production_min } from "./react-text-annotator.es13.js";
3
- import { __require as requireReactJsxRuntime_development } from "./react-text-annotator.es14.js";
4
- if (process.env.NODE_ENV === "production") {
5
- jsxRuntime.exports = requireReactJsxRuntime_production_min();
6
- } else {
7
- jsxRuntime.exports = requireReactJsxRuntime_development();
1
+ const Vt = "not-annotatable", X = `.${Vt}`, ft = (t) => {
2
+ const e = t.cloneContents();
3
+ return e.querySelectorAll(X).forEach((n) => n.remove()), e;
4
+ }, te = (t, e, n = 10, o) => {
5
+ const i = e, r = document.createRange();
6
+ r.setStart(i, 0), r.setEnd(t.startContainer, t.startOffset);
7
+ const a = ft(r).textContent, s = document.createRange();
8
+ s.setStart(t.endContainer, t.endOffset), i === document.body ? s.setEnd(i, i.childNodes.length) : s.setEndAfter(i);
9
+ const u = ft(s).textContent;
10
+ return {
11
+ prefix: a.substring(a.length - n),
12
+ suffix: u.substring(0, n)
13
+ };
14
+ };
15
+ let Z;
16
+ const Ce = new Uint8Array(16);
17
+ function Te() {
18
+ if (!Z && (Z = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !Z))
19
+ throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
20
+ return Z(Ce);
21
+ }
22
+ const V = [];
23
+ for (let t = 0; t < 256; ++t)
24
+ V.push((t + 256).toString(16).slice(1));
25
+ function Ne(t, e = 0) {
26
+ return V[t[e + 0]] + V[t[e + 1]] + V[t[e + 2]] + V[t[e + 3]] + "-" + V[t[e + 4]] + V[t[e + 5]] + "-" + V[t[e + 6]] + V[t[e + 7]] + "-" + V[t[e + 8]] + V[t[e + 9]] + "-" + V[t[e + 10]] + V[t[e + 11]] + V[t[e + 12]] + V[t[e + 13]] + V[t[e + 14]] + V[t[e + 15]];
27
+ }
28
+ const Re = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), Lt = {
29
+ randomUUID: Re
30
+ };
31
+ function kt(t, e, n) {
32
+ if (Lt.randomUUID && !e && !t)
33
+ return Lt.randomUUID();
34
+ t = t || {};
35
+ const o = t.random || (t.rng || Te)();
36
+ return o[6] = o[6] & 15 | 64, o[8] = o[8] & 63 | 128, Ne(o);
8
37
  }
9
- var jsxRuntimeExports = jsxRuntime.exports;
38
+ const _ = [];
39
+ for (let t = 0; t < 256; ++t)
40
+ _.push((t + 256).toString(16).slice(1));
41
+ typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
42
+ const tn = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
43
+ let rn = (t = 21) => {
44
+ let e = "", n = crypto.getRandomValues(new Uint8Array(t));
45
+ for (; t--; )
46
+ e += tn[n[t] & 63];
47
+ return e;
48
+ };
49
+ const an = (t) => {
50
+ const e = JSON.stringify(t);
51
+ let n = 0;
52
+ for (let o = 0, i = e.length; o < i; o++) {
53
+ let r = e.charCodeAt(o);
54
+ n = (n << 5) - n + r, n |= 0;
55
+ }
56
+ return `${n}`;
57
+ }, Ht = (t) => t ? typeof t == "object" ? { ...t } : t : void 0, cn = (t, e) => (Array.isArray(t) ? t : [t]).map((n) => {
58
+ const { id: o, type: i, purpose: r, value: a, created: s, modified: u, creator: f, ...m } = n;
59
+ return {
60
+ id: o || `temp-${an(n)}`,
61
+ annotation: e,
62
+ type: i,
63
+ purpose: r,
64
+ value: a,
65
+ creator: Ht(f),
66
+ created: s ? new Date(s) : void 0,
67
+ updated: u ? new Date(u) : void 0,
68
+ ...m
69
+ };
70
+ }), ln = (t) => t.map((e) => {
71
+ var n;
72
+ const { annotation: o, created: i, updated: r, ...a } = e, s = {
73
+ ...a,
74
+ created: i == null ? void 0 : i.toISOString(),
75
+ modified: r == null ? void 0 : r.toISOString()
76
+ };
77
+ return (n = s.id) != null && n.startsWith("temp-") && delete s.id, s;
78
+ });
79
+ rn();
80
+ const In = (t, e) => ({
81
+ parse: (n) => hn(n),
82
+ serialize: (n) => fn(n, t, e)
83
+ }), dn = (t) => t.quote !== void 0 && t.start !== void 0 && t.end !== void 0, un = (t) => {
84
+ const {
85
+ id: e,
86
+ creator: n,
87
+ created: o,
88
+ modified: i,
89
+ target: r
90
+ } = t, a = Array.isArray(r) ? r : [r], s = {
91
+ creator: Ht(n),
92
+ created: o ? new Date(o) : void 0,
93
+ updated: i ? new Date(i) : void 0,
94
+ annotation: e,
95
+ selector: []
96
+ };
97
+ for (const u of a) {
98
+ const m = (Array.isArray(u.selector) ? u.selector : [u.selector]).reduce((c, p) => {
99
+ switch (p.type) {
100
+ case "TextQuoteSelector":
101
+ c.quote = p.exact;
102
+ break;
103
+ case "TextPositionSelector":
104
+ c.start = p.start, c.end = p.end;
105
+ break;
106
+ }
107
+ return c;
108
+ }, {});
109
+ if (dn(m))
110
+ s.selector.push({ id: u.id, ...m });
111
+ else {
112
+ const c = [
113
+ m.start ? void 0 : "TextPositionSelector",
114
+ m.quote ? void 0 : "TextQuoteSelector"
115
+ ].filter(Boolean);
116
+ return { error: Error(`Missing selector types: ${c.join(" and ")} for annotation: ${t.id}`) };
117
+ }
118
+ }
119
+ return { parsed: s };
120
+ }, hn = (t) => {
121
+ const e = t.id || kt(), {
122
+ creator: n,
123
+ created: o,
124
+ modified: i,
125
+ body: r,
126
+ ...a
127
+ } = t, s = cn(r, e), u = un(t);
128
+ return "error" in u ? { error: u.error } : {
129
+ parsed: {
130
+ ...a,
131
+ id: e,
132
+ bodies: s,
133
+ target: u.parsed
134
+ }
135
+ };
136
+ }, fn = (t, e, n) => {
137
+ const { bodies: o, target: i, ...r } = t, {
138
+ selector: a,
139
+ creator: s,
140
+ created: u,
141
+ updated: f,
142
+ ...m
143
+ } = i, c = a.map((p) => {
144
+ const { quote: g, start: x, end: v, range: h } = p, { prefix: d, suffix: l } = te(h, n), y = [{
145
+ type: "TextQuoteSelector",
146
+ exact: g,
147
+ prefix: d,
148
+ suffix: l
149
+ }, {
150
+ type: "TextPositionSelector",
151
+ start: x,
152
+ end: v
153
+ }];
154
+ return {
155
+ ...m,
156
+ id: p.id,
157
+ source: e,
158
+ selector: y
159
+ };
160
+ });
161
+ return {
162
+ ...r,
163
+ "@context": "http://www.w3.org/ns/anno.jsonld",
164
+ id: t.id,
165
+ type: "Annotation",
166
+ body: ln(t.bodies),
167
+ creator: s,
168
+ created: u == null ? void 0 : u.toISOString(),
169
+ modified: f == null ? void 0 : f.toISOString(),
170
+ target: c
171
+ };
172
+ };
10
173
  export {
11
- jsxRuntimeExports as j
174
+ Vt as NOT_ANNOTATABLE_CLASS,
175
+ X as NOT_ANNOTATABLE_SELECTOR,
176
+ In as W3CTextFormat,
177
+ te as getQuoteContext,
178
+ ft as getRangeAnnotatableContents,
179
+ hn as parseW3CTextAnnotation,
180
+ fn as serializeW3CTextAnnotation
12
181
  };
13
182
  //# sourceMappingURL=react-text-annotator.es6.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"react-text-annotator.es6.js","sources":["../../../node_modules/react/jsx-runtime.js"],"sourcesContent":["'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.production.min.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.development.js');\n}\n"],"names":["jsxRuntimeModule","require$$0","require$$1"],"mappings":";;;AAEA,IAAI,QAAQ,IAAI,aAAa,cAAc;AACzCA,aAAA,UAAiBC;AACnB,OAAO;AACLD,aAAA,UAAiBE;AACnB;;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"react-text-annotator.es6.js","sources":["../../../node_modules/@recogito/text-annotator/dist/text-annotator.es.js"],"sourcesContent":["const P = {\n fill: \"rgb(0, 128, 255)\",\n fillOpacity: 0.18\n}, ot = {\n fill: \"rgb(0, 128, 255)\",\n fillOpacity: 0.45\n}, qt = (t, e, n, o, i) => {\n var a, s;\n const r = n ? typeof n == \"function\" ? n(t.annotation, t.state, i) || ((a = t.state) != null && a.selected ? ot : P) : n : (s = t.state) != null && s.selected ? ot : P;\n return o && o.paint(t, e) || r;\n}, Vt = \"not-annotatable\", X = `.${Vt}`, jt = (t) => {\n var n;\n const e = t.commonAncestorContainer;\n return e instanceof HTMLElement ? !e.closest(X) : !((n = e.parentElement) != null && n.closest(X));\n}, Gt = function* (t) {\n const e = document.createNodeIterator(\n t.commonAncestorContainer,\n NodeFilter.SHOW_ELEMENT,\n (o) => o instanceof HTMLElement && o.classList.contains(Vt) && !o.parentElement.closest(X) && t.intersectsNode(o) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP\n );\n let n;\n for (; n = e.nextNode(); )\n n instanceof HTMLElement && (yield n);\n}, Kt = (t) => {\n if (!jt(t))\n return [];\n const e = [];\n let n = null;\n for (const o of Gt(t)) {\n let i;\n n ? (i = document.createRange(), i.setStartAfter(n), i.setEndBefore(o)) : (i = t.cloneRange(), i.setEndBefore(o)), i.collapsed || e.push(i), n = o;\n }\n if (n) {\n const o = t.cloneRange();\n o.setStartAfter(n), o.collapsed || e.push(o);\n }\n return e.length > 0 ? e : [t];\n}, ft = (t) => {\n const e = t.cloneContents();\n return e.querySelectorAll(X).forEach((n) => n.remove()), e;\n}, Qt = (t) => {\n t.addEventListener(\"click\", (e) => {\n // Allow clicks within not-annotatable elements\n !e.target.closest(X) && !e.target.closest(\"a\") && e.preventDefault();\n });\n}, pt = (t, e = 10) => {\n let n;\n return (...o) => {\n clearTimeout(n), n = setTimeout(() => t.apply(void 0, o), e);\n };\n}, Ln = (t) => {\n const e = t.cloneContents();\n return e.querySelectorAll(X).forEach((n) => n.remove()), e;\n}, vt = (t, e) => {\n const n = document.createNodeIterator(e);\n let o = 0, i = n.nextNode();\n for (; i !== null; ) {\n if (i === t)\n return o;\n o += 1, i = n.nextNode();\n }\n}, yt = (t, e) => {\n const n = document.createNodeIterator(e);\n let o = null;\n for (let i = 0; i < t + 1; i++)\n o = n.nextNode();\n return o;\n}, Jt = (t) => {\n const {\n commonAncestorContainer: e,\n startContainer: n,\n startOffset: o,\n endContainer: i,\n endOffset: r\n } = t, a = Array.from(e.childNodes).map((c) => {\n const p = c.cloneNode(!0);\n return c.nodeName === \"CANVAS\" ? c : p;\n }), s = vt(n, e), u = vt(i, e), f = () => {\n const c = e;\n c.replaceChildren(...a);\n const p = yt(s, c), g = yt(u, c);\n return t.setStart(p, o), t.setEnd(g, r), t;\n }, m = (c) => {\n const p = document.createElement(\"SPAN\");\n return c.surroundContents(p), p;\n };\n if (n === i)\n throw \"Not implemented\";\n {\n const c = document.createRange();\n c.selectNodeContents(n), c.setStart(n, o);\n const p = m(c), g = document.createRange();\n g.selectNode(i), g.setEnd(i, r);\n const x = m(g), h = Zt(t).reverse().map((d) => {\n var y;\n const l = document.createElement(\"SPAN\");\n return (y = d.parentNode) == null || y.insertBefore(l, d), l.appendChild(d), l;\n });\n return { unwrap: f, nodes: [p, ...h, x] };\n }\n}, Zt = (t) => {\n const {\n commonAncestorContainer: e,\n startContainer: n,\n endContainer: o\n } = t, i = document.createNodeIterator(e, NodeFilter.SHOW_TEXT);\n let r = i.nextNode(), a = !1;\n const s = [];\n for (; r != null; )\n r === o && (a = !1), a && s.push(r), r === n && (a = !0), r = i.nextNode();\n return s;\n}, Bn = (t) => {\n const { startContainer: e, endContainer: n } = t;\n if (e === n)\n return Array.from(t.getClientRects());\n {\n const { unwrap: o, nodes: i } = Jt(t), r = i.reduce((a, s) => [...a, ...s.getClientRects()], []);\n return o(), r;\n }\n}, te = (t, e, n = 10, o) => {\n const i = o ? t.startContainer.parentElement.closest(o) : e, r = document.createRange();\n r.setStart(i, 0), r.setEnd(t.startContainer, t.startOffset);\n const a = ft(r).textContent, s = document.createRange();\n s.setStart(t.endContainer, t.endOffset), i === document.body ? s.setEnd(i, i.childNodes.length) : s.setEndAfter(i);\n const u = ft(s).textContent;\n return {\n prefix: a.substring(a.length - n),\n suffix: u.substring(0, n)\n };\n}, $ = (t) => t.every((e) => e.range instanceof Range && !e.range.collapsed), ee = (t, e) => {\n const n = (r) => Math.round(r * 10) / 10, o = {\n top: n(t.top),\n bottom: n(t.bottom),\n left: n(t.left),\n right: n(t.right)\n }, i = {\n top: n(e.top),\n bottom: n(e.bottom),\n left: n(e.left),\n right: n(e.right)\n };\n if (Math.abs(o.top - i.top) < 0.5 && Math.abs(o.bottom - i.bottom) < 0.5) {\n if (Math.abs(o.left - i.right) < 0.5 || Math.abs(o.right - i.left) < 0.5)\n return \"inline-adjacent\";\n if (o.left >= i.left && o.right <= i.right)\n return \"inline-is-contained\";\n if (o.left <= i.left && o.right >= i.right)\n return \"inline-contains\";\n } else if (o.top <= i.top && o.bottom >= i.bottom) {\n if (o.left <= i.left && o.right >= i.right)\n return \"block-contains\";\n } else if (o.top >= i.top && o.bottom <= i.bottom && o.left >= i.left && o.right <= i.right)\n return \"block-is-contained\";\n}, ne = (t, e) => {\n const n = Math.min(t.left, e.left), o = Math.max(t.right, e.right), i = Math.min(t.top, e.top), r = Math.max(t.bottom, e.bottom);\n return new DOMRect(n, i, o - n, r - i);\n}, oe = (t) => t.reduce((e, n) => {\n if (n.width === 0 || n.height === 0)\n return e;\n let o = [...e], i = !1;\n for (const r of e) {\n const a = ee(n, r);\n if (a === \"inline-adjacent\") {\n o = o.map((s) => s === r ? ne(n, r) : s), i = !0;\n break;\n } else if (a === \"inline-contains\") {\n o = o.map((s) => s === r ? n : s), i = !0;\n break;\n } else if (a === \"inline-is-contained\") {\n i = !0;\n break;\n } else if (a === \"block-contains\" || a === \"block-is-contained\") {\n n.width < r.width && (o = o.map((s) => s === r ? n : s)), i = !0;\n break;\n }\n }\n return i ? o : [...o, n];\n}, []), ie = (t, e, n) => {\n const o = document.createRange(), i = n ? t.startContainer.parentElement.closest(n) : e;\n o.setStart(i, 0), o.setEnd(t.startContainer, t.startOffset);\n const r = ft(o).textContent, a = t.toString(), s = r.length || 0, u = s + a.length;\n return n ? { quote: a, start: s, end: u, range: t, offsetReference: i } : { quote: a, start: s, end: u, range: t };\n}, _t = (t, e) => {\n var m, c;\n const { start: n, end: o } = t, i = t.offsetReference || e, r = document.createNodeIterator(\n e,\n NodeFilter.SHOW_TEXT,\n (p) => {\n var g;\n return (g = p.parentElement) != null && g.closest(X) ? NodeFilter.FILTER_SKIP : NodeFilter.FILTER_ACCEPT;\n }\n );\n let a = 0;\n const s = document.createRange();\n let u = r.nextNode();\n u === null && console.error(\"Could not revive annotation target. Content missing.\");\n let f = !i;\n for (; u !== null; ) {\n if (f || (f = i == null ? void 0 : i.contains(u)), f) {\n const p = ((m = u.textContent) == null ? void 0 : m.length) || 0;\n if (a + p > n) {\n s.setStart(u, n - a);\n break;\n }\n a += p;\n }\n u = r.nextNode();\n }\n for (; u !== null; ) {\n const p = ((c = u.textContent) == null ? void 0 : c.length) || 0;\n if (a + p >= o) {\n s.setEnd(u, o - a);\n break;\n }\n a += p, u = r.nextNode();\n }\n return {\n ...t,\n range: s\n };\n}, it = (t, e) => $(t.selector) ? t : {\n ...t,\n selector: t.selector.map((n) => n.range instanceof Range && !n.range.collapsed ? n : _t(n, e))\n}, rt = (t, e) => $(t.target.selector) ? t : { ...t, target: it(t.target, e) }, re = (t) => {\n var i;\n const { startContainer: e, endContainer: n } = t;\n if (e.nodeType === Node.TEXT_NODE && n.nodeType === Node.TEXT_NODE)\n return t;\n if (e.nodeType !== Node.TEXT_NODE) {\n const r = e.nextSibling || e.parentNode, a = (r == null ? void 0 : r.nodeType) === Node.TEXT_NODE ? r : Array.from(r.childNodes).filter((s) => s.nodeType === Node.TEXT_NODE).shift();\n t.setEnd(a, 0);\n }\n if (n.nodeType !== Node.TEXT_NODE) {\n const r = n.previousSibling || n.parentNode, a = (r == null ? void 0 : r.nodeType) === Node.TEXT_NODE ? r : Array.from(r.childNodes).filter((s) => s.nodeType === Node.TEXT_NODE).pop();\n t.setEnd(a, ((i = a == null ? void 0 : a.textContent) == null ? void 0 : i.length) || 0);\n }\n return t;\n}, se = (t) => {\n const { top: e, left: n } = t.getBoundingClientRect(), { innerWidth: o, innerHeight: i } = window, r = -n, a = -e, s = o - n, u = i - e;\n return { top: e, left: n, minX: r, minY: a, maxX: s, maxY: u };\n}, ae = (t) => {\n let e = /* @__PURE__ */ new Set();\n return (o) => {\n const i = o.map((r) => r.id);\n (e.size !== i.length || i.some((r) => !e.has(r))) && t.set(i), e = new Set(i);\n };\n}, mt = (t, e, n, o) => {\n const { store: i, selection: r, hover: a } = e;\n let s, u, f;\n const m = ae(n), c = (R) => {\n const { x: O, y: b } = t.getBoundingClientRect(), w = i.getAt(R.clientX - O, R.clientY - b);\n w && (!u || u(w)) ? a.current !== w.id && (t.classList.add(\"hovered\"), a.set(w.id)) : a.current && (t.classList.remove(\"hovered\"), a.set(null));\n };\n t.addEventListener(\"pointermove\", c);\n const p = (R = !1) => {\n f && f.clear();\n const O = se(t), { minX: b, minY: w, maxX: A, maxY: S } = O, L = u ? i.getIntersecting(b, w, A, S).filter(({ annotation: k }) => u(k)) : i.getIntersecting(b, w, A, S), I = r.selected.map(({ id: k }) => k), H = L.map(({ annotation: k, rects: zt }) => {\n const Ft = I.includes(k.id), Wt = k.id === a.current;\n return { annotation: k, rects: zt, state: { selected: Ft, hover: Wt } };\n });\n o.redraw(H, O, s, f, R), setTimeout(() => m(L.map(({ annotation: k }) => k)), 1);\n }, g = (R) => {\n f = R, p();\n }, x = (R) => {\n s = R, p();\n }, v = (R) => {\n u = R, p(!1);\n }, h = () => p();\n i.observe(h);\n const d = r.subscribe(() => p()), l = () => p(!0);\n document.addEventListener(\"scroll\", l, { capture: !0, passive: !0 });\n const y = pt(() => {\n i.recalculatePositions(), f && f.reset(), p();\n });\n window.addEventListener(\"resize\", y);\n const T = new ResizeObserver(y);\n T.observe(t);\n const C = { attributes: !0, childList: !0, subtree: !0 }, E = new MutationObserver((R) => {\n R.every((b) => b.target === t || t.contains(b.target)) || p(!0);\n });\n return E.observe(document.body, C), {\n destroy: () => {\n t.removeEventListener(\"pointermove\", c), o.destroy(), i.unobserve(h), d(), document.removeEventListener(\"scroll\", l), window.removeEventListener(\"resize\", y), T.disconnect(), E.disconnect();\n },\n redraw: p,\n setStyle: x,\n setFilter: v,\n setPainter: g,\n setVisible: o.setVisible\n };\n}, ce = () => {\n const t = document.createElement(\"canvas\");\n return t.width = window.innerWidth, t.height = window.innerHeight, t.className = \"r6o-highlight-layer bg\", t;\n}, le = (t, e) => {\n t.width = window.innerWidth, t.height = window.innerHeight;\n}, de = (t) => {\n t.classList.add(\"r6o-annotatable\");\n const e = ce(), n = e.getContext(\"2d\");\n t.insertBefore(e, t.firstChild);\n const o = (s, u, f, m) => requestAnimationFrame(() => {\n const { width: c, height: p } = e;\n n.clearRect(-0.5, -0.5, c + 1, p + 1), m && m.clear();\n const { top: g, left: x } = u;\n [...s].sort((h, d) => {\n const { annotation: { target: { created: l } } } = h, { annotation: { target: { created: y } } } = d;\n return l.getTime() - y.getTime();\n }).forEach((h) => {\n var C;\n const d = f ? typeof f == \"function\" ? f(h.annotation, h.state) : f : (C = h.state) != null && C.selected ? ot : P, l = m && m.paint(h, u) || d, y = h.rects.map(({ x: E, y: N, width: R, height: O }) => ({\n x: E + x,\n y: N + g,\n width: R,\n height: O\n }));\n n.fillStyle = l.fill, n.globalAlpha = l.fillOpacity || 1;\n const T = 5;\n if (y.forEach(\n ({ x: E, y: N, width: R, height: O }) => n.fillRect(\n E,\n N - T / 2,\n R,\n O + T\n )\n ), l.underlineColor) {\n n.globalAlpha = 1, n.strokeStyle = l.underlineColor, n.lineWidth = l.underlineThickness ?? 1;\n const E = T / 2 + (l.underlineOffset ?? 0);\n y.forEach(({ x: N, y: R, width: O, height: b }) => {\n n.beginPath(), n.moveTo(N, R + b + E), n.lineTo(N + O, R + b + E), n.stroke();\n });\n }\n });\n }), i = pt(() => {\n le(e);\n });\n return window.addEventListener(\"resize\", i), {\n destroy: () => {\n t.removeChild(e), window.removeEventListener(\"resize\", i);\n },\n setVisible: (s) => {\n console.log(\"setVisible not implemented on Canvas renderer\");\n },\n redraw: o\n };\n}, ue = (t, e, n) => mt(t, e, n, de(t));\nvar he = { grad: 0.9, turn: 360, rad: 360 / (2 * Math.PI) }, Y = function(t) {\n return typeof t == \"string\" ? t.length > 0 : typeof t == \"number\";\n}, M = function(t, e, n) {\n return e === void 0 && (e = 0), n === void 0 && (n = Math.pow(10, e)), Math.round(n * t) / n + 0;\n}, U = function(t, e, n) {\n return e === void 0 && (e = 0), n === void 0 && (n = 1), t > n ? n : t > e ? t : e;\n}, Ut = function(t) {\n return (t = isFinite(t) ? t % 360 : 0) > 0 ? t : t + 360;\n}, wt = function(t) {\n return { r: U(t.r, 0, 255), g: U(t.g, 0, 255), b: U(t.b, 0, 255), a: U(t.a) };\n}, st = function(t) {\n return { r: M(t.r), g: M(t.g), b: M(t.b), a: M(t.a, 3) };\n}, fe = /^#([0-9a-f]{3,8})$/i, J = function(t) {\n var e = t.toString(16);\n return e.length < 2 ? \"0\" + e : e;\n}, Dt = function(t) {\n var e = t.r, n = t.g, o = t.b, i = t.a, r = Math.max(e, n, o), a = r - Math.min(e, n, o), s = a ? r === e ? (n - o) / a : r === n ? 2 + (o - e) / a : 4 + (e - n) / a : 0;\n return { h: 60 * (s < 0 ? s + 6 : s), s: r ? a / r * 100 : 0, v: r / 255 * 100, a: i };\n}, Xt = function(t) {\n var e = t.h, n = t.s, o = t.v, i = t.a;\n e = e / 360 * 6, n /= 100, o /= 100;\n var r = Math.floor(e), a = o * (1 - n), s = o * (1 - (e - r) * n), u = o * (1 - (1 - e + r) * n), f = r % 6;\n return { r: 255 * [o, s, a, a, u, o][f], g: 255 * [u, o, o, s, a, a][f], b: 255 * [a, a, u, o, o, s][f], a: i };\n}, xt = function(t) {\n return { h: Ut(t.h), s: U(t.s, 0, 100), l: U(t.l, 0, 100), a: U(t.a) };\n}, At = function(t) {\n return { h: M(t.h), s: M(t.s), l: M(t.l), a: M(t.a, 3) };\n}, Et = function(t) {\n return Xt((n = (e = t).s, { h: e.h, s: (n *= ((o = e.l) < 50 ? o : 100 - o) / 100) > 0 ? 2 * n / (o + n) * 100 : 0, v: o + n, a: e.a }));\n var e, n, o;\n}, Q = function(t) {\n return { h: (e = Dt(t)).h, s: (i = (200 - (n = e.s)) * (o = e.v) / 100) > 0 && i < 200 ? n * o / 100 / (i <= 100 ? i : 200 - i) * 100 : 0, l: i / 2, a: e.a };\n var e, n, o, i;\n}, ge = /^hsla?\\(\\s*([+-]?\\d*\\.?\\d+)(deg|rad|grad|turn)?\\s*,\\s*([+-]?\\d*\\.?\\d+)%\\s*,\\s*([+-]?\\d*\\.?\\d+)%\\s*(?:,\\s*([+-]?\\d*\\.?\\d+)(%)?\\s*)?\\)$/i, pe = /^hsla?\\(\\s*([+-]?\\d*\\.?\\d+)(deg|rad|grad|turn)?\\s+([+-]?\\d*\\.?\\d+)%\\s+([+-]?\\d*\\.?\\d+)%\\s*(?:\\/\\s*([+-]?\\d*\\.?\\d+)(%)?\\s*)?\\)$/i, me = /^rgba?\\(\\s*([+-]?\\d*\\.?\\d+)(%)?\\s*,\\s*([+-]?\\d*\\.?\\d+)(%)?\\s*,\\s*([+-]?\\d*\\.?\\d+)(%)?\\s*(?:,\\s*([+-]?\\d*\\.?\\d+)(%)?\\s*)?\\)$/i, be = /^rgba?\\(\\s*([+-]?\\d*\\.?\\d+)(%)?\\s+([+-]?\\d*\\.?\\d+)(%)?\\s+([+-]?\\d*\\.?\\d+)(%)?\\s*(?:\\/\\s*([+-]?\\d*\\.?\\d+)(%)?\\s*)?\\)$/i, St = { string: [[function(t) {\n var e = fe.exec(t);\n return e ? (t = e[1]).length <= 4 ? { r: parseInt(t[0] + t[0], 16), g: parseInt(t[1] + t[1], 16), b: parseInt(t[2] + t[2], 16), a: t.length === 4 ? M(parseInt(t[3] + t[3], 16) / 255, 2) : 1 } : t.length === 6 || t.length === 8 ? { r: parseInt(t.substr(0, 2), 16), g: parseInt(t.substr(2, 2), 16), b: parseInt(t.substr(4, 2), 16), a: t.length === 8 ? M(parseInt(t.substr(6, 2), 16) / 255, 2) : 1 } : null : null;\n}, \"hex\"], [function(t) {\n var e = me.exec(t) || be.exec(t);\n return e ? e[2] !== e[4] || e[4] !== e[6] ? null : wt({ r: Number(e[1]) / (e[2] ? 100 / 255 : 1), g: Number(e[3]) / (e[4] ? 100 / 255 : 1), b: Number(e[5]) / (e[6] ? 100 / 255 : 1), a: e[7] === void 0 ? 1 : Number(e[7]) / (e[8] ? 100 : 1) }) : null;\n}, \"rgb\"], [function(t) {\n var e = ge.exec(t) || pe.exec(t);\n if (!e)\n return null;\n var n, o, i = xt({ h: (n = e[1], o = e[2], o === void 0 && (o = \"deg\"), Number(n) * (he[o] || 1)), s: Number(e[3]), l: Number(e[4]), a: e[5] === void 0 ? 1 : Number(e[5]) / (e[6] ? 100 : 1) });\n return Et(i);\n}, \"hsl\"]], object: [[function(t) {\n var e = t.r, n = t.g, o = t.b, i = t.a, r = i === void 0 ? 1 : i;\n return Y(e) && Y(n) && Y(o) ? wt({ r: Number(e), g: Number(n), b: Number(o), a: Number(r) }) : null;\n}, \"rgb\"], [function(t) {\n var e = t.h, n = t.s, o = t.l, i = t.a, r = i === void 0 ? 1 : i;\n if (!Y(e) || !Y(n) || !Y(o))\n return null;\n var a = xt({ h: Number(e), s: Number(n), l: Number(o), a: Number(r) });\n return Et(a);\n}, \"hsl\"], [function(t) {\n var e = t.h, n = t.s, o = t.v, i = t.a, r = i === void 0 ? 1 : i;\n if (!Y(e) || !Y(n) || !Y(o))\n return null;\n var a = function(s) {\n return { h: Ut(s.h), s: U(s.s, 0, 100), v: U(s.v, 0, 100), a: U(s.a) };\n }({ h: Number(e), s: Number(n), v: Number(o), a: Number(r) });\n return Xt(a);\n}, \"hsv\"]] }, Ct = function(t, e) {\n for (var n = 0; n < e.length; n++) {\n var o = e[n][0](t);\n if (o)\n return [o, e[n][1]];\n }\n return [null, void 0];\n}, ve = function(t) {\n return typeof t == \"string\" ? Ct(t.trim(), St.string) : typeof t == \"object\" && t !== null ? Ct(t, St.object) : [null, void 0];\n}, at = function(t, e) {\n var n = Q(t);\n return { h: n.h, s: U(n.s + 100 * e, 0, 100), l: n.l, a: n.a };\n}, ct = function(t) {\n return (299 * t.r + 587 * t.g + 114 * t.b) / 1e3 / 255;\n}, Tt = function(t, e) {\n var n = Q(t);\n return { h: n.h, s: n.s, l: U(n.l + 100 * e, 0, 100), a: n.a };\n}, Nt = function() {\n function t(e) {\n this.parsed = ve(e)[0], this.rgba = this.parsed || { r: 0, g: 0, b: 0, a: 1 };\n }\n return t.prototype.isValid = function() {\n return this.parsed !== null;\n }, t.prototype.brightness = function() {\n return M(ct(this.rgba), 2);\n }, t.prototype.isDark = function() {\n return ct(this.rgba) < 0.5;\n }, t.prototype.isLight = function() {\n return ct(this.rgba) >= 0.5;\n }, t.prototype.toHex = function() {\n return e = st(this.rgba), n = e.r, o = e.g, i = e.b, a = (r = e.a) < 1 ? J(M(255 * r)) : \"\", \"#\" + J(n) + J(o) + J(i) + a;\n var e, n, o, i, r, a;\n }, t.prototype.toRgb = function() {\n return st(this.rgba);\n }, t.prototype.toRgbString = function() {\n return e = st(this.rgba), n = e.r, o = e.g, i = e.b, (r = e.a) < 1 ? \"rgba(\" + n + \", \" + o + \", \" + i + \", \" + r + \")\" : \"rgb(\" + n + \", \" + o + \", \" + i + \")\";\n var e, n, o, i, r;\n }, t.prototype.toHsl = function() {\n return At(Q(this.rgba));\n }, t.prototype.toHslString = function() {\n return e = At(Q(this.rgba)), n = e.h, o = e.s, i = e.l, (r = e.a) < 1 ? \"hsla(\" + n + \", \" + o + \"%, \" + i + \"%, \" + r + \")\" : \"hsl(\" + n + \", \" + o + \"%, \" + i + \"%)\";\n var e, n, o, i, r;\n }, t.prototype.toHsv = function() {\n return e = Dt(this.rgba), { h: M(e.h), s: M(e.s), v: M(e.v), a: M(e.a, 3) };\n var e;\n }, t.prototype.invert = function() {\n return D({ r: 255 - (e = this.rgba).r, g: 255 - e.g, b: 255 - e.b, a: e.a });\n var e;\n }, t.prototype.saturate = function(e) {\n return e === void 0 && (e = 0.1), D(at(this.rgba, e));\n }, t.prototype.desaturate = function(e) {\n return e === void 0 && (e = 0.1), D(at(this.rgba, -e));\n }, t.prototype.grayscale = function() {\n return D(at(this.rgba, -1));\n }, t.prototype.lighten = function(e) {\n return e === void 0 && (e = 0.1), D(Tt(this.rgba, e));\n }, t.prototype.darken = function(e) {\n return e === void 0 && (e = 0.1), D(Tt(this.rgba, -e));\n }, t.prototype.rotate = function(e) {\n return e === void 0 && (e = 15), this.hue(this.hue() + e);\n }, t.prototype.alpha = function(e) {\n return typeof e == \"number\" ? D({ r: (n = this.rgba).r, g: n.g, b: n.b, a: e }) : M(this.rgba.a, 3);\n var n;\n }, t.prototype.hue = function(e) {\n var n = Q(this.rgba);\n return typeof e == \"number\" ? D({ h: e, s: n.s, l: n.l, a: n.a }) : M(n.h);\n }, t.prototype.isEqual = function(e) {\n return this.toHex() === D(e).toHex();\n }, t;\n}(), D = function(t) {\n return t instanceof Nt ? t : new Nt(t);\n};\nconst ye = (t) => [\n `background-color:${D((t == null ? void 0 : t.fill) || P.fill).alpha((t == null ? void 0 : t.fillOpacity) === void 0 ? P.fillOpacity : t.fillOpacity).toHex()}`,\n t != null && t.underlineThickness ? \"text-decoration:underline\" : void 0,\n t != null && t.underlineColor ? `text-decoration-color:${t.underlineColor}` : void 0,\n t != null && t.underlineOffset ? `text-underline-offset:${t.underlineOffset}px` : void 0,\n t != null && t.underlineThickness ? `text-decoration-thickness:${t.underlineThickness}px` : void 0\n].filter(Boolean).join(\";\"), we = () => {\n const t = document.createElement(\"style\");\n document.getElementsByTagName(\"head\")[0].appendChild(t);\n let e = /* @__PURE__ */ new Set();\n return {\n destroy: () => {\n CSS.highlights.clear(), t.remove();\n },\n setVisible: (r) => {\n console.log(\"setVisible not implemented on CSS Custom Highlights renderer\");\n },\n redraw: (r, a, s, u) => {\n u && u.clear();\n const f = new Set(r.map((c) => c.annotation.id));\n Array.from(e).filter((c) => !f.has(c));\n const m = r.map((c) => {\n var x;\n const p = s ? typeof s == \"function\" ? s(c.annotation, c.state) : s : (x = c.state) != null && x.selected ? ot : P, g = u && u.paint(c, a) || p;\n return `::highlight(_${c.annotation.id}) { ${ye(g)} }`;\n });\n t.innerHTML = m.join(`\n`), CSS.highlights.clear(), r.forEach(({ annotation: c }) => {\n const p = c.target.selector.map((x) => x.range), g = new Highlight(...p);\n CSS.highlights.set(`_${c.id}`, g);\n }), e = f;\n }\n };\n}, xe = (t, e, n) => mt(t, e, n, we());\nvar Rt = Object.prototype.hasOwnProperty;\nfunction gt(t, e) {\n var n, o;\n if (t === e)\n return !0;\n if (t && e && (n = t.constructor) === e.constructor) {\n if (n === Date)\n return t.getTime() === e.getTime();\n if (n === RegExp)\n return t.toString() === e.toString();\n if (n === Array) {\n if ((o = t.length) === e.length)\n for (; o-- && gt(t[o], e[o]); )\n ;\n return o === -1;\n }\n if (!n || typeof t == \"object\") {\n o = 0;\n for (n in t)\n if (Rt.call(t, n) && ++o && !Rt.call(e, n) || !(n in e) || !gt(t[n], e[n]))\n return !1;\n return Object.keys(e).length === o;\n }\n }\n return t !== t && e !== e;\n}\nconst Ae = (t, e) => {\n const n = (o, i) => o.x <= i.x + i.width && o.x + o.width >= i.x && o.y <= i.y + i.height && o.y + o.height >= i.y;\n return e.filter((o) => t !== o && n(t, o) && o.width > t.width).length;\n}, Ee = (t) => {\n t.classList.add(\"r6o-annotatable\");\n const e = document.createElement(\"div\");\n e.className = \"r6o-span-highlight-layer\", t.insertBefore(e, t.firstChild);\n let n = [];\n return {\n destroy: () => {\n e.remove();\n },\n redraw: (a, s, u, f, m) => {\n const p = !(gt(n, a) && m);\n if (!f && !p)\n return;\n p && (e.innerHTML = \"\");\n const g = a.reduce((x, { rects: v }) => [...x, ...v], []);\n a.forEach((x) => {\n x.rects.map((v) => {\n const h = Ae(v, g), d = qt(x, s, u, f, h);\n if (p) {\n const l = document.createElement(\"span\");\n l.className = \"r6o-annotation\", l.dataset.annotation = x.annotation.id, l.style.left = `${v.x}px`, l.style.top = `${v.y}px`, l.style.width = `${v.width}px`, l.style.height = `${v.height}px`;\n const y = D((d == null ? void 0 : d.fill) || P.fill).alpha((d == null ? void 0 : d.fillOpacity) === void 0 ? P.fillOpacity : d.fillOpacity).toHex();\n l.style.backgroundColor = y, d.underlineStyle && (l.style.borderStyle = d.underlineStyle), d.underlineColor && (l.style.borderColor = d.underlineColor), d.underlineThickness && (l.style.borderBottomWidth = `${d.underlineThickness}px`), d.underlineOffset && (l.style.paddingBottom = `${d.underlineOffset}px`), e.appendChild(l);\n }\n });\n }), n = a;\n },\n setVisible: (a) => {\n a ? e.classList.remove(\"hidden\") : e.classList.add(\"hidden\");\n }\n };\n}, Se = (t, e, n) => mt(t, e, n, Ee(t));\nlet Z;\nconst Ce = new Uint8Array(16);\nfunction Te() {\n if (!Z && (Z = typeof crypto < \"u\" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !Z))\n throw new Error(\"crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported\");\n return Z(Ce);\n}\nconst V = [];\nfor (let t = 0; t < 256; ++t)\n V.push((t + 256).toString(16).slice(1));\nfunction Ne(t, e = 0) {\n return V[t[e + 0]] + V[t[e + 1]] + V[t[e + 2]] + V[t[e + 3]] + \"-\" + V[t[e + 4]] + V[t[e + 5]] + \"-\" + V[t[e + 6]] + V[t[e + 7]] + \"-\" + V[t[e + 8]] + V[t[e + 9]] + \"-\" + V[t[e + 10]] + V[t[e + 11]] + V[t[e + 12]] + V[t[e + 13]] + V[t[e + 14]] + V[t[e + 15]];\n}\nconst Re = typeof crypto < \"u\" && crypto.randomUUID && crypto.randomUUID.bind(crypto), Lt = {\n randomUUID: Re\n};\nfunction kt(t, e, n) {\n if (Lt.randomUUID && !e && !t)\n return Lt.randomUUID();\n t = t || {};\n const o = t.random || (t.rng || Te)();\n return o[6] = o[6] & 15 | 64, o[8] = o[8] & 63 | 128, Ne(o);\n}\nvar Bt = Object.prototype.hasOwnProperty;\nfunction q(t, e) {\n var n, o;\n if (t === e)\n return !0;\n if (t && e && (n = t.constructor) === e.constructor) {\n if (n === Date)\n return t.getTime() === e.getTime();\n if (n === RegExp)\n return t.toString() === e.toString();\n if (n === Array) {\n if ((o = t.length) === e.length)\n for (; o-- && q(t[o], e[o]); )\n ;\n return o === -1;\n }\n if (!n || typeof t == \"object\") {\n o = 0;\n for (n in t)\n if (Bt.call(t, n) && ++o && !Bt.call(e, n) || !(n in e) || !q(t[n], e[n]))\n return !1;\n return Object.keys(e).length === o;\n }\n }\n return t !== t && e !== e;\n}\nfunction lt() {\n}\nfunction Le(t, e) {\n return t != t ? e == e : t !== e || t && typeof t == \"object\" || typeof t == \"function\";\n}\nconst z = [];\nfunction bt(t, e = lt) {\n let n;\n const o = /* @__PURE__ */ new Set();\n function i(s) {\n if (Le(t, s) && (t = s, n)) {\n const u = !z.length;\n for (const f of o)\n f[1](), z.push(f, t);\n if (u) {\n for (let f = 0; f < z.length; f += 2)\n z[f][0](z[f + 1]);\n z.length = 0;\n }\n }\n }\n function r(s) {\n i(s(t));\n }\n function a(s, u = lt) {\n const f = [s, u];\n return o.add(f), o.size === 1 && (n = e(i, r) || lt), s(t), () => {\n o.delete(f), o.size === 0 && n && (n(), n = null);\n };\n }\n return { set: i, update: r, subscribe: a };\n}\nconst Be = (t) => {\n const { subscribe: e, set: n } = bt();\n let o;\n return e((i) => o = i), t.observe(({ changes: i }) => {\n if (o) {\n (i.deleted || []).some((a) => a.id === o) && n(void 0);\n const r = (i.updated || []).find(({ oldValue: a }) => a.id === o);\n r && n(r.newValue.id);\n }\n }), {\n get current() {\n return o;\n },\n subscribe: e,\n set: n\n };\n};\nvar Oe = /* @__PURE__ */ ((t) => (t.EDIT = \"EDIT\", t.SELECT = \"SELECT\", t.NONE = \"NONE\", t))(Oe || {});\nconst dt = { selected: [] }, Ie = (t, e = \"EDIT\") => {\n const { subscribe: n, set: o } = bt(dt);\n let i = dt;\n n((c) => i = c);\n const r = () => o(dt), a = () => {\n var c;\n return ((c = i.selected) == null ? void 0 : c.length) === 0;\n }, s = (c) => {\n if (i.selected.length === 0)\n return !1;\n const p = typeof c == \"string\" ? c : c.id;\n return i.selected.some((g) => g.id === p);\n }, u = (c, p) => {\n const g = t.getAnnotation(c);\n if (g) {\n const x = Me(g, e);\n o(x === \"EDIT\" ? { selected: [{ id: c, editable: !0 }], pointerEvent: p } : x === \"SELECT\" ? { selected: [{ id: c }], pointerEvent: p } : { selected: [], pointerEvent: p });\n } else\n console.warn(\"Invalid selection: \" + c);\n }, f = (c, p = !0) => {\n const g = Array.isArray(c) ? c : [c], x = g.map((v) => t.getAnnotation(v)).filter(Boolean);\n o({ selected: x.map(({ id: v }) => ({ id: v, editable: p })) }), x.length !== g.length && console.warn(\"Invalid selection\", c);\n }, m = (c) => {\n if (i.selected.length === 0)\n return !1;\n const { selected: p } = i;\n p.filter(({ id: g }) => c.includes(g)).length > 0 && o({ selected: p.filter(({ id: g }) => !c.includes(g)) });\n };\n return t.observe(({ changes: c }) => m((c.deleted || []).map((p) => p.id))), {\n clear: r,\n clickSelect: u,\n get selected() {\n return i ? [...i.selected] : null;\n },\n get pointerEvent() {\n return i ? i.pointerEvent : null;\n },\n isEmpty: a,\n isSelected: s,\n setSelected: f,\n subscribe: n\n };\n}, Me = (t, e) => typeof e == \"function\" ? e(t) || \"EDIT\" : e || \"EDIT\";\nlet tt;\nconst Ve = new Uint8Array(16);\nfunction _e() {\n if (!tt && (tt = typeof crypto < \"u\" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !tt))\n throw new Error(\"crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported\");\n return tt(Ve);\n}\nconst _ = [];\nfor (let t = 0; t < 256; ++t)\n _.push((t + 256).toString(16).slice(1));\nfunction Ue(t, e = 0) {\n return _[t[e + 0]] + _[t[e + 1]] + _[t[e + 2]] + _[t[e + 3]] + \"-\" + _[t[e + 4]] + _[t[e + 5]] + \"-\" + _[t[e + 6]] + _[t[e + 7]] + \"-\" + _[t[e + 8]] + _[t[e + 9]] + \"-\" + _[t[e + 10]] + _[t[e + 11]] + _[t[e + 12]] + _[t[e + 13]] + _[t[e + 14]] + _[t[e + 15]];\n}\nconst De = typeof crypto < \"u\" && crypto.randomUUID && crypto.randomUUID.bind(crypto), Ot = {\n randomUUID: De\n};\nfunction Xe(t, e, n) {\n if (Ot.randomUUID && !e && !t)\n return Ot.randomUUID();\n t = t || {};\n const o = t.random || (t.rng || _e)();\n return o[6] = o[6] & 15 | 64, o[8] = o[8] & 63 | 128, Ue(o);\n}\nconst On = (t, e, n, o) => ({\n id: Xe(),\n annotation: t.id,\n created: n || /* @__PURE__ */ new Date(),\n creator: o,\n ...e\n}), ke = (t, e) => {\n const n = new Set(t.bodies.map((o) => o.id));\n return e.bodies.filter((o) => !n.has(o.id));\n}, Ye = (t, e) => {\n const n = new Set(e.bodies.map((o) => o.id));\n return t.bodies.filter((o) => !n.has(o.id));\n}, He = (t, e) => e.bodies.map((n) => {\n const o = t.bodies.find((i) => i.id === n.id);\n return { newBody: n, oldBody: o && !q(o, n) ? o : void 0 };\n}).filter(({ oldBody: n }) => n).map(({ oldBody: n, newBody: o }) => ({ oldBody: n, newBody: o })), $e = (t, e) => !q(t.target, e.target), Yt = (t, e) => {\n const n = ke(t, e), o = Ye(t, e), i = He(t, e);\n return {\n oldValue: t,\n newValue: e,\n bodiesCreated: n.length > 0 ? n : void 0,\n bodiesDeleted: o.length > 0 ? o : void 0,\n bodiesUpdated: i.length > 0 ? i : void 0,\n targetUpdated: $e(t, e) ? { oldTarget: t.target, newTarget: e.target } : void 0\n };\n};\nvar B = /* @__PURE__ */ ((t) => (t.LOCAL = \"LOCAL\", t.REMOTE = \"REMOTE\", t))(B || {});\nconst Pe = (t, e) => {\n var n, o;\n const { changes: i, origin: r } = e;\n if (!(!t.options.origin || t.options.origin === r))\n return !1;\n if (t.options.ignore) {\n const { ignore: a } = t.options, s = (u) => u && u.length > 0;\n if (!(s(i.created) || s(i.deleted))) {\n const u = (n = i.updated) == null ? void 0 : n.some((m) => s(m.bodiesCreated) || s(m.bodiesDeleted) || s(m.bodiesUpdated)), f = (o = i.updated) == null ? void 0 : o.some((m) => m.targetUpdated);\n if (a === \"BODY_ONLY\" && u && !f || a === \"TARGET_ONLY\" && f && !u)\n return !1;\n }\n }\n if (t.options.annotations) {\n const a = /* @__PURE__ */ new Set([\n ...(i.created || []).map((s) => s.id),\n ...(i.deleted || []).map((s) => s.id),\n ...(i.updated || []).map(({ oldValue: s }) => s.id)\n ]);\n return !!(Array.isArray(t.options.annotations) ? t.options.annotations : [t.options.annotations]).find((s) => a.has(s));\n } else\n return !0;\n}, ze = (t, e) => {\n const n = new Set((t.created || []).map((c) => c.id)), o = new Set((t.updated || []).map(({ newValue: c }) => c.id)), i = new Set((e.created || []).map((c) => c.id)), r = new Set((e.deleted || []).map((c) => c.id)), a = new Set((e.updated || []).map(({ oldValue: c }) => c.id)), s = new Set((e.updated || []).filter(({ oldValue: c }) => n.has(c.id) || o.has(c.id)).map(({ oldValue: c }) => c.id)), u = [\n ...(t.created || []).filter((c) => !r.has(c.id)).map((c) => a.has(c.id) ? e.updated.find(({ oldValue: p }) => p.id === c.id).newValue : c),\n ...e.created || []\n ], f = [\n ...(t.deleted || []).filter((c) => !i.has(c.id)),\n ...(e.deleted || []).filter((c) => !n.has(c.id))\n ], m = [\n ...(t.updated || []).filter(({ newValue: c }) => !r.has(c.id)).map((c) => {\n const { oldValue: p, newValue: g } = c;\n if (a.has(g.id)) {\n const x = e.updated.find((v) => v.oldValue.id === g.id).newValue;\n return Yt(p, x);\n } else\n return c;\n }),\n ...(e.updated || []).filter(({ oldValue: c }) => !s.has(c.id))\n ];\n return { created: u, deleted: f, updated: m };\n}, Fe = (t) => t.id !== void 0, We = () => {\n const t = /* @__PURE__ */ new Map(), e = /* @__PURE__ */ new Map(), n = [], o = (b, w = {}) => n.push({ onChange: b, options: w }), i = (b) => {\n const w = n.findIndex((A) => A.onChange == b);\n w > -1 && n.splice(w, 1);\n }, r = (b, w) => {\n const A = {\n origin: b,\n changes: {\n created: w.created || [],\n updated: w.updated || [],\n deleted: w.deleted || []\n },\n state: [...t.values()]\n };\n n.forEach((S) => {\n Pe(S, A) && S.onChange(A);\n });\n }, a = (b, w = B.LOCAL) => {\n if (t.get(b.id))\n throw Error(`Cannot add annotation ${b.id} - exists already`);\n t.set(b.id, b), b.bodies.forEach((A) => e.set(A.id, b.id)), r(w, { created: [b] });\n }, s = (b, w) => {\n const A = typeof b == \"string\" ? w : b, S = typeof b == \"string\" ? b : b.id, L = t.get(S);\n if (L) {\n const I = Yt(L, A);\n return S === A.id ? t.set(S, A) : (t.delete(S), t.set(A.id, A)), L.bodies.forEach((H) => e.delete(H.id)), A.bodies.forEach((H) => e.set(H.id, A.id)), I;\n } else\n console.warn(`Cannot update annotation ${S} - does not exist`);\n }, u = (b, w = B.LOCAL, A = B.LOCAL) => {\n const S = Fe(w) ? A : w, L = s(b, w);\n L && r(S, { updated: [L] });\n }, f = (b, w = B.LOCAL) => {\n const A = b.reduce((S, L) => {\n const I = s(L);\n return I ? [...S, I] : S;\n }, []);\n A.length > 0 && r(w, { updated: A });\n }, m = (b, w = B.LOCAL) => {\n const A = t.get(b.annotation);\n if (A) {\n const S = {\n ...A,\n bodies: [...A.bodies, b]\n };\n t.set(A.id, S), e.set(b.id, S.id), r(w, { updated: [{\n oldValue: A,\n newValue: S,\n bodiesCreated: [b]\n }] });\n } else\n console.warn(`Attempt to add body to missing annotation: ${b.annotation}`);\n }, c = () => [...t.values()], p = (b = B.LOCAL) => {\n const w = [...t.values()];\n t.clear(), e.clear(), r(b, { deleted: w });\n }, g = (b, w = !0, A = B.LOCAL) => {\n if (w) {\n const S = [...t.values()];\n t.clear(), e.clear(), b.forEach((L) => {\n t.set(L.id, L), L.bodies.forEach((I) => e.set(I.id, L.id));\n }), r(A, { created: b, deleted: S });\n } else {\n const S = b.reduce((L, I) => {\n const H = t.get(I.id);\n return H ? [...L, H] : L;\n }, []);\n if (S.length > 0)\n throw Error(`Bulk insert would overwrite the following annotations: ${S.map((L) => L.id).join(\", \")}`);\n b.forEach((L) => {\n t.set(L.id, L), L.bodies.forEach((I) => e.set(I.id, L.id));\n }), r(A, { created: b });\n }\n }, x = (b) => {\n const w = typeof b == \"string\" ? b : b.id, A = t.get(w);\n if (A)\n return t.delete(w), A.bodies.forEach((S) => e.delete(S.id)), A;\n console.warn(`Attempt to delete missing annotation: ${w}`);\n }, v = (b, w = B.LOCAL) => {\n const A = x(b);\n A && r(w, { deleted: [A] });\n }, h = (b, w = B.LOCAL) => {\n const A = b.reduce((S, L) => {\n const I = x(L);\n return I ? [...S, I] : S;\n }, []);\n A.length > 0 && r(w, { deleted: A });\n }, d = (b) => {\n const w = t.get(b.annotation);\n if (w) {\n const A = w.bodies.find((S) => S.id === b.id);\n if (A) {\n e.delete(A.id);\n const S = {\n ...w,\n bodies: w.bodies.filter((L) => L.id !== b.id)\n };\n return t.set(w.id, S), {\n oldValue: w,\n newValue: S,\n bodiesDeleted: [A]\n };\n } else\n console.warn(`Attempt to delete missing body ${b.id} from annotation ${b.annotation}`);\n } else\n console.warn(`Attempt to delete body from missing annotation ${b.annotation}`);\n }, l = (b, w = B.LOCAL) => {\n const A = d(b);\n A && r(w, { updated: [A] });\n }, y = (b, w = B.LOCAL) => {\n const A = b.map((S) => d(S)).filter(Boolean);\n A.length > 0 && r(w, { updated: A });\n }, T = (b) => {\n const w = t.get(b);\n return w ? { ...w } : void 0;\n }, C = (b) => {\n const w = e.get(b);\n if (w) {\n const A = T(w).bodies.find((S) => S.id === b);\n if (A)\n return A;\n console.error(`Store integrity error: body ${b} in index, but not in annotation`);\n } else\n console.warn(`Attempt to retrieve missing body: ${b}`);\n }, E = (b, w) => {\n if (b.annotation !== w.annotation)\n throw \"Annotation integrity violation: annotation ID must be the same when updating bodies\";\n const A = t.get(b.annotation);\n if (A) {\n const S = A.bodies.find((I) => I.id === b.id), L = {\n ...A,\n bodies: A.bodies.map((I) => I.id === S.id ? w : I)\n };\n return t.set(A.id, L), S.id !== w.id && (e.delete(S.id), e.set(w.id, L.id)), {\n oldValue: A,\n newValue: L,\n bodiesUpdated: [{ oldBody: S, newBody: w }]\n };\n } else\n console.warn(`Attempt to add body to missing annotation ${b.annotation}`);\n }, N = (b, w, A = B.LOCAL) => {\n const S = E(b, w);\n S && r(A, { updated: [S] });\n }, R = (b, w = B.LOCAL) => {\n const A = b.map((S) => E({ id: S.id, annotation: S.annotation }, S)).filter(Boolean);\n r(w, { updated: A });\n }, O = (b) => {\n const w = t.get(b.annotation);\n if (w) {\n const A = {\n ...w,\n target: {\n ...w.target,\n ...b\n }\n };\n return t.set(w.id, A), {\n oldValue: w,\n newValue: A,\n targetUpdated: {\n oldTarget: w.target,\n newTarget: b\n }\n };\n } else\n console.warn(`Attempt to update target on missing annotation: ${b.annotation}`);\n };\n return {\n addAnnotation: a,\n addBody: m,\n all: c,\n bulkAddAnnotation: g,\n bulkDeleteAnnotation: h,\n bulkDeleteBodies: y,\n bulkUpdateAnnotation: f,\n bulkUpdateBodies: R,\n bulkUpdateTargets: (b, w = B.LOCAL) => {\n const A = b.map((S) => O(S)).filter(Boolean);\n A.length > 0 && r(w, { updated: A });\n },\n clear: p,\n deleteAnnotation: v,\n deleteBody: l,\n getAnnotation: T,\n getBody: C,\n observe: o,\n unobserve: i,\n updateAnnotation: u,\n updateBody: N,\n updateTarget: (b, w = B.LOCAL) => {\n const A = O(b);\n A && r(w, { updated: [A] });\n }\n };\n};\nlet qe = () => ({\n emit(t, ...e) {\n for (let n = 0, o = this.events[t] || [], i = o.length; n < i; n++)\n o[n](...e);\n },\n events: {},\n on(t, e) {\n var n;\n return ((n = this.events)[t] || (n[t] = [])).push(e), () => {\n var o;\n this.events[t] = (o = this.events[t]) == null ? void 0 : o.filter((i) => e !== i);\n };\n }\n});\nconst je = 250, Ge = (t) => {\n const e = qe(), n = [];\n let o = -1, i = !1, r = 0;\n const a = (g) => {\n if (!i) {\n const { changes: x } = g, v = performance.now();\n if (v - r > je)\n n.splice(o + 1), n.push(x), o = n.length - 1;\n else {\n const h = n.length - 1;\n n[h] = ze(n[h], x);\n }\n r = v;\n }\n i = !1;\n };\n t.observe(a, { origin: B.LOCAL });\n const s = (g) => g && g.length > 0 && t.bulkDeleteAnnotation(g), u = (g) => g && g.length > 0 && t.bulkAddAnnotation(g, !1), f = (g) => g && g.length > 0 && t.bulkUpdateAnnotation(g.map(({ oldValue: x }) => x)), m = (g) => g && g.length > 0 && t.bulkUpdateAnnotation(g.map(({ newValue: x }) => x)), c = (g) => g && g.length > 0 && t.bulkAddAnnotation(g, !1), p = (g) => g && g.length > 0 && t.bulkDeleteAnnotation(g);\n return {\n canRedo: () => n.length - 1 > o,\n canUndo: () => o > -1,\n destroy: () => t.unobserve(a),\n on: (g, x) => e.on(g, x),\n redo: () => {\n if (n.length - 1 > o) {\n i = !0;\n const { created: g, updated: x, deleted: v } = n[o + 1];\n u(g), m(x), p(v), e.emit(\"redo\", n[o + 1]), o += 1;\n }\n },\n undo: () => {\n if (o > -1) {\n i = !0;\n const { created: g, updated: x, deleted: v } = n[o];\n s(g), f(x), c(v), e.emit(\"undo\", n[o]), o -= 1;\n }\n }\n };\n}, Ke = () => {\n const { subscribe: t, set: e } = bt([]);\n return {\n subscribe: t,\n set: e\n };\n}, Qe = (t, e, n, o) => {\n const { store: i, selection: r, hover: a, viewport: s } = t, u = /* @__PURE__ */ new Map();\n let f = [], m;\n const c = (v, h) => {\n u.has(v) ? u.get(v).push(h) : u.set(v, [h]);\n }, p = (v, h) => {\n const d = u.get(v);\n d && d.indexOf(h) > 0 && d.splice(d.indexOf(h), 1);\n }, g = (v, h, d) => {\n u.has(v) && setTimeout(() => {\n u.get(v).forEach((l) => {\n if (n) {\n const y = Array.isArray(h) ? h.map((C) => n.serialize(C)) : n.serialize(h), T = d ? d instanceof PointerEvent ? d : n.serialize(d) : void 0;\n l(y, T);\n } else\n l(h, d);\n });\n }, 1);\n };\n r.subscribe(({ selected: v }) => {\n if (!(f.length === 0 && v.length === 0)) {\n if (f.length === 0 && v.length > 0)\n f = v.map(({ id: h }) => i.getAnnotation(h));\n else if (f.length > 0 && v.length === 0)\n f.forEach((h) => {\n const d = i.getAnnotation(h.id);\n d && !q(d, h) && g(\"updateAnnotation\", d, h);\n }), f = [];\n else {\n const h = new Set(f.map((l) => l.id)), d = new Set(v.map(({ id: l }) => l));\n f.filter((l) => !d.has(l.id)).forEach((l) => {\n const y = i.getAnnotation(l.id);\n y && !q(y, l) && g(\"updateAnnotation\", y, l);\n }), f = [\n // Remove annotations that were deselected\n ...f.filter((l) => d.has(l.id)),\n // Add editable annotations that were selected\n ...v.filter(({ id: l }) => !h.has(l)).map(({ id: l }) => i.getAnnotation(l))\n ];\n }\n g(\"selectionChanged\", f);\n }\n }), a.subscribe((v) => {\n !m && v ? g(\"mouseEnterAnnotation\", i.getAnnotation(v)) : m && !v ? g(\"mouseLeaveAnnotation\", i.getAnnotation(m)) : m && v && (g(\"mouseLeaveAnnotation\", i.getAnnotation(m)), g(\"mouseEnterAnnotation\", i.getAnnotation(v))), m = v;\n }), s == null || s.subscribe((v) => g(\"viewportIntersect\", v.map((h) => i.getAnnotation(h)))), i.observe((v) => {\n const { created: h, deleted: d } = v.changes;\n (h || []).forEach((l) => g(\"createAnnotation\", l)), (d || []).forEach((l) => g(\"deleteAnnotation\", l)), (v.changes.updated || []).filter((l) => [\n ...l.bodiesCreated || [],\n ...l.bodiesDeleted || [],\n ...l.bodiesUpdated || []\n ].length > 0).forEach(({ oldValue: l, newValue: y }) => {\n const T = f.find((C) => C.id === l.id) || l;\n f = f.map((C) => C.id === l.id ? y : C), g(\"updateAnnotation\", y, T);\n });\n }, { origin: B.LOCAL }), i.observe((v) => {\n if (f) {\n const h = new Set(f.map((l) => l.id)), d = (v.changes.updated || []).filter(({ newValue: l }) => h.has(l.id)).map(({ newValue: l }) => l);\n d.length > 0 && (f = f.map((l) => d.find((T) => T.id === l.id) || l));\n }\n }, { origin: B.REMOTE });\n const x = (v) => (h) => {\n const { updated: d } = h;\n v ? (d || []).forEach((l) => g(\"updateAnnotation\", l.oldValue, l.newValue)) : (d || []).forEach((l) => g(\"updateAnnotation\", l.newValue, l.oldValue));\n };\n return e.on(\"undo\", x(!0)), e.on(\"redo\", x(!1)), { on: c, off: p, emit: g };\n}, Je = (t) => (e) => e.reduce((n, o) => {\n const { parsed: i, error: r } = t.parse(o);\n return r ? {\n parsed: n.parsed,\n failed: [...n.failed, o]\n } : i ? {\n parsed: [...n.parsed, i],\n failed: n.failed\n } : {\n ...n\n };\n}, { parsed: [], failed: [] }), Ze = (t, e, n) => {\n const { store: o, selection: i } = t, r = (h) => {\n if (n) {\n const { parsed: d, error: l } = n.parse(h);\n d ? o.addAnnotation(d, B.REMOTE) : console.error(l);\n } else\n o.addAnnotation(h, B.REMOTE);\n }, a = () => i.clear(), s = () => o.clear(), u = (h) => {\n const d = o.getAnnotation(h);\n return n && d ? n.serialize(d) : d;\n }, f = () => n ? o.all().map(n.serialize) : o.all(), m = () => {\n var h;\n const d = (((h = i.selected) == null ? void 0 : h.map((l) => l.id)) || []).map((l) => o.getAnnotation(l)).filter(Boolean);\n return n ? d.map(n.serialize) : d;\n }, c = (h, d = !0) => fetch(h).then((l) => l.json()).then((l) => (g(l, d), l)), p = (h) => {\n if (typeof h == \"string\") {\n const d = o.getAnnotation(h);\n if (o.deleteAnnotation(h), d)\n return n ? n.serialize(d) : d;\n } else {\n const d = n ? n.parse(h).parsed : h;\n if (d)\n return o.deleteAnnotation(d), h;\n }\n }, g = (h, d = !0) => {\n if (n) {\n const { parsed: l, failed: y } = Je(n)(h);\n y.length > 0 && console.warn(`Discarded ${y.length} invalid annotations`, y), o.bulkAddAnnotation(l, d, B.REMOTE);\n } else\n o.bulkAddAnnotation(h, d, B.REMOTE);\n }, x = (h) => {\n h ? i.setSelected(h) : i.clear();\n }, v = (h) => {\n if (n) {\n const d = n.parse(h).parsed, l = n.serialize(o.getAnnotation(d.id));\n return o.updateAnnotation(d), l;\n } else {\n const d = o.getAnnotation(h.id);\n return o.updateAnnotation(h), d;\n }\n };\n return {\n addAnnotation: r,\n cancelSelected: a,\n canRedo: e.canRedo,\n canUndo: e.canUndo,\n clearAnnotations: s,\n getAnnotationById: u,\n getAnnotations: f,\n getSelected: m,\n loadAnnotations: c,\n redo: e.redo,\n removeAnnotation: p,\n setAnnotations: g,\n setSelected: x,\n undo: e.undo,\n updateAnnotation: v\n };\n}, tn = \"useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict\";\nlet en = (t) => crypto.getRandomValues(new Uint8Array(t)), nn = (t, e, n) => {\n let o = (2 << Math.log(t.length - 1) / Math.LN2) - 1, i = -~(1.6 * o * e / t.length);\n return (r = e) => {\n let a = \"\";\n for (; ; ) {\n let s = n(i), u = i;\n for (; u--; )\n if (a += t[s[u] & o] || \"\", a.length === r)\n return a;\n }\n };\n}, on = (t, e = 21) => nn(t, e, en), rn = (t = 21) => {\n let e = \"\", n = crypto.getRandomValues(new Uint8Array(t));\n for (; t--; )\n e += tn[n[t] & 63];\n return e;\n};\nconst sn = () => ({ isGuest: !0, id: on(\"1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_\", 20)() }), an = (t) => {\n const e = JSON.stringify(t);\n let n = 0;\n for (let o = 0, i = e.length; o < i; o++) {\n let r = e.charCodeAt(o);\n n = (n << 5) - n + r, n |= 0;\n }\n return `${n}`;\n}, Ht = (t) => t ? typeof t == \"object\" ? { ...t } : t : void 0, cn = (t, e) => (Array.isArray(t) ? t : [t]).map((n) => {\n const { id: o, type: i, purpose: r, value: a, created: s, modified: u, creator: f, ...m } = n;\n return {\n id: o || `temp-${an(n)}`,\n annotation: e,\n type: i,\n purpose: r,\n value: a,\n creator: Ht(f),\n created: s ? new Date(s) : void 0,\n updated: u ? new Date(u) : void 0,\n ...m\n };\n}), ln = (t) => t.map((e) => {\n var n;\n const { annotation: o, created: i, updated: r, ...a } = e, s = {\n ...a,\n created: i == null ? void 0 : i.toISOString(),\n modified: r == null ? void 0 : r.toISOString()\n };\n return (n = s.id) != null && n.startsWith(\"temp-\") && delete s.id, s;\n});\nrn();\nconst In = (t, e) => ({\n parse: (n) => hn(n),\n serialize: (n) => fn(n, t, e)\n}), dn = (t) => t.quote !== void 0 && t.start !== void 0 && t.end !== void 0, un = (t) => {\n const {\n id: e,\n creator: n,\n created: o,\n modified: i,\n target: r\n } = t, a = Array.isArray(r) ? r : [r], s = {\n creator: Ht(n),\n created: o ? new Date(o) : void 0,\n updated: i ? new Date(i) : void 0,\n annotation: e,\n selector: []\n };\n for (const u of a) {\n const m = (Array.isArray(u.selector) ? u.selector : [u.selector]).reduce((c, p) => {\n switch (p.type) {\n case \"TextQuoteSelector\":\n c.quote = p.exact;\n break;\n case \"TextPositionSelector\":\n c.start = p.start, c.end = p.end;\n break;\n }\n return c;\n }, {});\n if (dn(m))\n s.selector.push({ id: u.id, ...m });\n else {\n const c = [\n m.start ? void 0 : \"TextPositionSelector\",\n m.quote ? void 0 : \"TextQuoteSelector\"\n ].filter(Boolean);\n return { error: Error(`Missing selector types: ${c.join(\" and \")} for annotation: ${t.id}`) };\n }\n }\n return { parsed: s };\n}, hn = (t) => {\n const e = t.id || kt(), {\n creator: n,\n created: o,\n modified: i,\n body: r,\n ...a\n } = t, s = cn(r, e), u = un(t);\n return \"error\" in u ? { error: u.error } : {\n parsed: {\n ...a,\n id: e,\n bodies: s,\n target: u.parsed\n }\n };\n}, fn = (t, e, n) => {\n const { bodies: o, target: i, ...r } = t, {\n selector: a,\n creator: s,\n created: u,\n updated: f,\n ...m\n } = i, c = a.map((p) => {\n const { quote: g, start: x, end: v, range: h } = p, { prefix: d, suffix: l } = te(h, n), y = [{\n type: \"TextQuoteSelector\",\n exact: g,\n prefix: d,\n suffix: l\n }, {\n type: \"TextPositionSelector\",\n start: x,\n end: v\n }];\n return {\n ...m,\n id: p.id,\n source: e,\n selector: y\n };\n });\n return {\n ...r,\n \"@context\": \"http://www.w3.org/ns/anno.jsonld\",\n id: t.id,\n type: \"Annotation\",\n body: ln(t.bodies),\n creator: s,\n created: u == null ? void 0 : u.toISOString(),\n modified: f == null ? void 0 : f.toISOString(),\n target: c\n };\n};\nfunction gn(t, e, n, o, i) {\n $t(t, e, n || 0, o || t.length - 1, i || pn);\n}\nfunction $t(t, e, n, o, i) {\n for (; o > n; ) {\n if (o - n > 600) {\n var r = o - n + 1, a = e - n + 1, s = Math.log(r), u = 0.5 * Math.exp(2 * s / 3), f = 0.5 * Math.sqrt(s * u * (r - u) / r) * (a - r / 2 < 0 ? -1 : 1), m = Math.max(n, Math.floor(e - a * u / r + f)), c = Math.min(o, Math.floor(e + (r - a) * u / r + f));\n $t(t, e, m, c, i);\n }\n var p = t[e], g = n, x = o;\n for (j(t, n, e), i(t[o], p) > 0 && j(t, n, o); g < x; ) {\n for (j(t, g, x), g++, x--; i(t[g], p) < 0; )\n g++;\n for (; i(t[x], p) > 0; )\n x--;\n }\n i(t[n], p) === 0 ? j(t, n, x) : (x++, j(t, x, o)), x <= e && (n = x + 1), e <= x && (o = x - 1);\n }\n}\nfunction j(t, e, n) {\n var o = t[e];\n t[e] = t[n], t[n] = o;\n}\nfunction pn(t, e) {\n return t < e ? -1 : t > e ? 1 : 0;\n}\nclass mn {\n constructor(e = 9) {\n this._maxEntries = Math.max(4, e), this._minEntries = Math.max(2, Math.ceil(this._maxEntries * 0.4)), this.clear();\n }\n all() {\n return this._all(this.data, []);\n }\n search(e) {\n let n = this.data;\n const o = [];\n if (!nt(e, n))\n return o;\n const i = this.toBBox, r = [];\n for (; n; ) {\n for (let a = 0; a < n.children.length; a++) {\n const s = n.children[a], u = n.leaf ? i(s) : s;\n nt(e, u) && (n.leaf ? o.push(s) : ht(e, u) ? this._all(s, o) : r.push(s));\n }\n n = r.pop();\n }\n return o;\n }\n collides(e) {\n let n = this.data;\n if (!nt(e, n))\n return !1;\n const o = [];\n for (; n; ) {\n for (let i = 0; i < n.children.length; i++) {\n const r = n.children[i], a = n.leaf ? this.toBBox(r) : r;\n if (nt(e, a)) {\n if (n.leaf || ht(e, a))\n return !0;\n o.push(r);\n }\n }\n n = o.pop();\n }\n return !1;\n }\n load(e) {\n if (!(e && e.length))\n return this;\n if (e.length < this._minEntries) {\n for (let o = 0; o < e.length; o++)\n this.insert(e[o]);\n return this;\n }\n let n = this._build(e.slice(), 0, e.length - 1, 0);\n if (!this.data.children.length)\n this.data = n;\n else if (this.data.height === n.height)\n this._splitRoot(this.data, n);\n else {\n if (this.data.height < n.height) {\n const o = this.data;\n this.data = n, n = o;\n }\n this._insert(n, this.data.height - n.height - 1, !0);\n }\n return this;\n }\n insert(e) {\n return e && this._insert(e, this.data.height - 1), this;\n }\n clear() {\n return this.data = W([]), this;\n }\n remove(e, n) {\n if (!e)\n return this;\n let o = this.data;\n const i = this.toBBox(e), r = [], a = [];\n let s, u, f;\n for (; o || r.length; ) {\n if (o || (o = r.pop(), u = r[r.length - 1], s = a.pop(), f = !0), o.leaf) {\n const m = bn(e, o.children, n);\n if (m !== -1)\n return o.children.splice(m, 1), r.push(o), this._condense(r), this;\n }\n !f && !o.leaf && ht(o, i) ? (r.push(o), a.push(s), s = 0, u = o, o = o.children[0]) : u ? (s++, o = u.children[s], f = !1) : o = null;\n }\n return this;\n }\n toBBox(e) {\n return e;\n }\n compareMinX(e, n) {\n return e.minX - n.minX;\n }\n compareMinY(e, n) {\n return e.minY - n.minY;\n }\n toJSON() {\n return this.data;\n }\n fromJSON(e) {\n return this.data = e, this;\n }\n _all(e, n) {\n const o = [];\n for (; e; )\n e.leaf ? n.push(...e.children) : o.push(...e.children), e = o.pop();\n return n;\n }\n _build(e, n, o, i) {\n const r = o - n + 1;\n let a = this._maxEntries, s;\n if (r <= a)\n return s = W(e.slice(n, o + 1)), F(s, this.toBBox), s;\n i || (i = Math.ceil(Math.log(r) / Math.log(a)), a = Math.ceil(r / Math.pow(a, i - 1))), s = W([]), s.leaf = !1, s.height = i;\n const u = Math.ceil(r / a), f = u * Math.ceil(Math.sqrt(a));\n It(e, n, o, f, this.compareMinX);\n for (let m = n; m <= o; m += f) {\n const c = Math.min(m + f - 1, o);\n It(e, m, c, u, this.compareMinY);\n for (let p = m; p <= c; p += u) {\n const g = Math.min(p + u - 1, c);\n s.children.push(this._build(e, p, g, i - 1));\n }\n }\n return F(s, this.toBBox), s;\n }\n _chooseSubtree(e, n, o, i) {\n for (; i.push(n), !(n.leaf || i.length - 1 === o); ) {\n let r = 1 / 0, a = 1 / 0, s;\n for (let u = 0; u < n.children.length; u++) {\n const f = n.children[u], m = ut(f), c = wn(e, f) - m;\n c < a ? (a = c, r = m < r ? m : r, s = f) : c === a && m < r && (r = m, s = f);\n }\n n = s || n.children[0];\n }\n return n;\n }\n _insert(e, n, o) {\n const i = o ? e : this.toBBox(e), r = [], a = this._chooseSubtree(i, this.data, n, r);\n for (a.children.push(e), K(a, i); n >= 0 && r[n].children.length > this._maxEntries; )\n this._split(r, n), n--;\n this._adjustParentBBoxes(i, r, n);\n }\n // split overflowed node into two\n _split(e, n) {\n const o = e[n], i = o.children.length, r = this._minEntries;\n this._chooseSplitAxis(o, r, i);\n const a = this._chooseSplitIndex(o, r, i), s = W(o.children.splice(a, o.children.length - a));\n s.height = o.height, s.leaf = o.leaf, F(o, this.toBBox), F(s, this.toBBox), n ? e[n - 1].children.push(s) : this._splitRoot(o, s);\n }\n _splitRoot(e, n) {\n this.data = W([e, n]), this.data.height = e.height + 1, this.data.leaf = !1, F(this.data, this.toBBox);\n }\n _chooseSplitIndex(e, n, o) {\n let i, r = 1 / 0, a = 1 / 0;\n for (let s = n; s <= o - n; s++) {\n const u = G(e, 0, s, this.toBBox), f = G(e, s, o, this.toBBox), m = xn(u, f), c = ut(u) + ut(f);\n m < r ? (r = m, i = s, a = c < a ? c : a) : m === r && c < a && (a = c, i = s);\n }\n return i || o - n;\n }\n // sorts node children by the best axis for split\n _chooseSplitAxis(e, n, o) {\n const i = e.leaf ? this.compareMinX : vn, r = e.leaf ? this.compareMinY : yn, a = this._allDistMargin(e, n, o, i), s = this._allDistMargin(e, n, o, r);\n a < s && e.children.sort(i);\n }\n // total margin of all possible split distributions where each node is at least m full\n _allDistMargin(e, n, o, i) {\n e.children.sort(i);\n const r = this.toBBox, a = G(e, 0, n, r), s = G(e, o - n, o, r);\n let u = et(a) + et(s);\n for (let f = n; f < o - n; f++) {\n const m = e.children[f];\n K(a, e.leaf ? r(m) : m), u += et(a);\n }\n for (let f = o - n - 1; f >= n; f--) {\n const m = e.children[f];\n K(s, e.leaf ? r(m) : m), u += et(s);\n }\n return u;\n }\n _adjustParentBBoxes(e, n, o) {\n for (let i = o; i >= 0; i--)\n K(n[i], e);\n }\n _condense(e) {\n for (let n = e.length - 1, o; n >= 0; n--)\n e[n].children.length === 0 ? n > 0 ? (o = e[n - 1].children, o.splice(o.indexOf(e[n]), 1)) : this.clear() : F(e[n], this.toBBox);\n }\n}\nfunction bn(t, e, n) {\n if (!n)\n return e.indexOf(t);\n for (let o = 0; o < e.length; o++)\n if (n(t, e[o]))\n return o;\n return -1;\n}\nfunction F(t, e) {\n G(t, 0, t.children.length, e, t);\n}\nfunction G(t, e, n, o, i) {\n i || (i = W(null)), i.minX = 1 / 0, i.minY = 1 / 0, i.maxX = -1 / 0, i.maxY = -1 / 0;\n for (let r = e; r < n; r++) {\n const a = t.children[r];\n K(i, t.leaf ? o(a) : a);\n }\n return i;\n}\nfunction K(t, e) {\n return t.minX = Math.min(t.minX, e.minX), t.minY = Math.min(t.minY, e.minY), t.maxX = Math.max(t.maxX, e.maxX), t.maxY = Math.max(t.maxY, e.maxY), t;\n}\nfunction vn(t, e) {\n return t.minX - e.minX;\n}\nfunction yn(t, e) {\n return t.minY - e.minY;\n}\nfunction ut(t) {\n return (t.maxX - t.minX) * (t.maxY - t.minY);\n}\nfunction et(t) {\n return t.maxX - t.minX + (t.maxY - t.minY);\n}\nfunction wn(t, e) {\n return (Math.max(e.maxX, t.maxX) - Math.min(e.minX, t.minX)) * (Math.max(e.maxY, t.maxY) - Math.min(e.minY, t.minY));\n}\nfunction xn(t, e) {\n const n = Math.max(t.minX, e.minX), o = Math.max(t.minY, e.minY), i = Math.min(t.maxX, e.maxX), r = Math.min(t.maxY, e.maxY);\n return Math.max(0, i - n) * Math.max(0, r - o);\n}\nfunction ht(t, e) {\n return t.minX <= e.minX && t.minY <= e.minY && e.maxX <= t.maxX && e.maxY <= t.maxY;\n}\nfunction nt(t, e) {\n return e.minX <= t.maxX && e.minY <= t.maxY && e.maxX >= t.minX && e.maxY >= t.minY;\n}\nfunction W(t) {\n return {\n children: t,\n height: 1,\n leaf: !0,\n minX: 1 / 0,\n minY: 1 / 0,\n maxX: -1 / 0,\n maxY: -1 / 0\n };\n}\nfunction It(t, e, n, o, i) {\n const r = [e, n];\n for (; r.length; ) {\n if (n = r.pop(), e = r.pop(), n - e <= o)\n continue;\n const a = e + Math.ceil((n - e) / o / 2) * o;\n gn(t, a, e, n, i), r.push(e, a, a, n);\n }\n}\nconst An = (t, e) => {\n const n = new mn(), o = /* @__PURE__ */ new Map(), i = (d, l) => {\n const y = d.selector.flatMap((C) => {\n const N = C.range instanceof Range && !C.range.collapsed && C.range.startContainer.nodeType === Node.TEXT_NODE && C.range.endContainer.nodeType === Node.TEXT_NODE ? C.range : _t(C, e).range;\n return Array.from(N.getClientRects());\n }), T = oe(y).map(({ left: C, top: E, right: N, bottom: R }) => new DOMRect(C - l.left, E - l.top, N - C, R - E));\n return T.map((C) => {\n const { x: E, y: N, width: R, height: O } = C;\n return {\n minX: E,\n minY: N,\n maxX: E + R,\n maxY: N + O,\n annotation: {\n id: d.annotation,\n rects: T\n }\n };\n });\n }, r = () => [...o.values()], a = () => {\n n.clear(), o.clear();\n }, s = (d) => {\n const l = i(d, e.getBoundingClientRect());\n l.forEach((y) => n.insert(y)), o.set(d.annotation, l);\n }, u = (d) => {\n const l = o.get(d.annotation);\n l && (l.forEach((y) => n.remove(y)), o.delete(d.annotation));\n }, f = (d) => {\n u(d), s(d);\n }, m = (d, l = !0) => {\n l && a();\n const y = e.getBoundingClientRect(), T = d.map((E) => ({ target: E, rects: i(E, y) }));\n T.forEach(({ target: E, rects: N }) => o.set(E.annotation, N));\n const C = T.reduce((E, { rects: N }) => [...E, ...N], []);\n n.load(C);\n }, c = (d, l) => {\n const y = n.search({\n minX: d,\n minY: l,\n maxX: d,\n maxY: l\n }), T = (C) => C.annotation.rects.reduce((E, N) => E + N.width * N.height, 0);\n if (y.length > 0)\n return y.sort((C, E) => T(C) - T(E)), y[0].annotation.id;\n }, p = (d) => {\n const l = g(d);\n if (l.length === 0)\n return;\n let y = l[0].left, T = l[0].top, C = l[0].right, E = l[0].bottom;\n for (let N = 1; N < l.length; N++) {\n const R = l[N];\n y = Math.min(y, R.left), T = Math.min(T, R.top), C = Math.max(C, R.right), E = Math.max(E, R.bottom);\n }\n return new DOMRect(y, T, C - y, E - T);\n }, g = (d) => {\n const l = o.get(d);\n return l ? l[0].annotation.rects : [];\n };\n return {\n all: r,\n clear: a,\n getAt: c,\n getAnnotationBounds: p,\n getAnnotationRects: g,\n getIntersecting: (d, l, y, T) => {\n const C = n.search({ minX: d, minY: l, maxX: y, maxY: T }), E = new Set(C.reduce((N, R) => [...N, R.annotation.id], []));\n return Array.from(E).map((N) => ({\n annotation: t.getAnnotation(N),\n rects: g(N)\n })).filter((N) => !!N.annotation);\n },\n insert: s,\n recalculate: () => m(t.all().map((d) => d.target), !0),\n remove: u,\n set: m,\n size: () => n.all().length,\n update: f\n };\n}, En = (t, e) => {\n const n = We(), o = An(n, t), i = Ie(n, e), r = Be(n), a = Ke(), s = (v, h = B.LOCAL) => {\n const d = rt(v, t), l = $(d.target.selector);\n return l && n.addAnnotation(d, h), l;\n }, u = (v, h = !0, d = B.LOCAL) => {\n const l = v.map((T) => rt(T, t)), y = l.filter((T) => !$(T.target.selector));\n return y.length > 0 ? (console.warn(\"Could not revive all targets for these annotations:\", y), n.bulkAddAnnotation(l, h, d), y) : (n.bulkAddAnnotation(l, h, d), []);\n }, f = (v, h = B.LOCAL) => {\n const d = v.map((y) => rt(y, t)), l = d.filter((y) => !$(y.target.selector));\n return l.length > 0 && console.warn(\"Could not revive all targets for these annotations:\", l), d.forEach((y) => {\n n.getAnnotation(y.id) ? n.updateAnnotation(y, h) : n.addAnnotation(y, h);\n }), l;\n }, m = (v, h = B.LOCAL) => {\n const d = it(v, t);\n n.updateTarget(d, h);\n }, c = (v, h = B.LOCAL) => {\n const d = v.map((l) => it(l, t));\n n.bulkUpdateTargets(d, h);\n }, p = (v, h) => {\n const d = o.getAt(v, h);\n return d ? n.getAnnotation(d) : void 0;\n }, g = (v, h, d, l = 5) => {\n const y = o.getAnnotationRects(v);\n if (y.length !== 0) {\n if (h && d) {\n const T = y.find(({ top: C, right: E, bottom: N, left: R }) => h >= R - l && h <= E + l && d >= C - l && d <= N + l);\n if (T)\n return T;\n }\n return o.getAnnotationBounds(v);\n }\n }, x = () => o.recalculate();\n return n.observe(({ changes: v }) => {\n const h = (v.created || []).filter((y) => $(y.target.selector)), d = (v.deleted || []).filter((y) => $(y.target.selector)), l = (v.updated || []).filter((y) => $(y.newValue.target.selector));\n h.length > 0 && o.set(h.map((y) => y.target), !1), (d == null ? void 0 : d.length) > 0 && d.forEach((y) => o.remove(y.target)), (l == null ? void 0 : l.length) > 0 && l.forEach(({ newValue: y }) => o.update(y.target));\n }), {\n store: {\n ...n,\n addAnnotation: s,\n bulkAddAnnotation: u,\n bulkUpdateTargets: c,\n bulkUpsertAnnotations: f,\n getAnnotationBounds: g,\n getAt: p,\n getIntersecting: o.getIntersecting,\n recalculatePositions: x,\n updateTarget: m\n },\n selection: i,\n hover: r,\n viewport: a\n };\n}, Sn = () => {\n const t = document.createElement(\"canvas\");\n t.width = 2 * window.innerWidth, t.height = 2 * window.innerHeight, t.className = \"r6o-highlight-layer presence\";\n const e = t.getContext(\"2d\");\n return e.scale(2, 2), e.translate(0.5, 0.5), t;\n}, Cn = (t, e, n = {}) => {\n const o = Sn(), i = o.getContext(\"2d\");\n t.appendChild(o);\n const r = /* @__PURE__ */ new Map(), a = (c) => Array.from(r.entries()).filter(([p, g]) => g.presenceKey === c.presenceKey).map(([p, g]) => p);\n return e.on(\"selectionChange\", (c, p) => {\n a(c).forEach((x) => r.delete(x)), p && p.forEach((x) => r.set(x, c));\n }), {\n clear: () => {\n const { width: c, height: p } = o;\n i.clearRect(-0.5, -0.5, c + 1, p + 1);\n },\n destroy: () => {\n o.remove();\n },\n paint: (c, p, g) => {\n n.font && (i.font = n.font);\n const x = r.get(c.annotation.id);\n if (x) {\n const { height: v } = c.rects[0], h = c.rects[0].x + p.left, d = c.rects[0].y + p.top;\n i.fillStyle = x.appearance.color, i.fillRect(h - 2, d - 2.5, 2, v + 5);\n const l = i.measureText(x.appearance.label), y = l.width + 6, T = l.actualBoundingBoxAscent + l.actualBoundingBoxDescent + 8, C = l.fontBoundingBoxAscent ? 8 : 6.5;\n return i.fillRect(h - 2, d - 2.5 - T, y, T), i.fillStyle = \"#fff\", i.fillText(x.appearance.label, h + 1, d - C), {\n fill: x.appearance.color,\n fillOpacity: g ? 0.45 : 0.18\n };\n }\n },\n reset: () => {\n o.width = 2 * window.innerWidth, o.height = 2 * window.innerHeight;\n const c = o.getContext(\"2d\");\n c.scale(2, 2), c.translate(0.5, 0.5);\n }\n };\n}, Pt = (t) => {\n if (t === null)\n return document.scrollingElement;\n const { overflowY: e } = window.getComputedStyle(t);\n return e !== \"visible\" && e !== \"hidden\" && t.scrollHeight > t.clientHeight ? t : Pt(t.parentElement);\n}, Tn = (t, e) => (n) => {\n const o = (r) => {\n const a = i.getBoundingClientRect(), s = i.clientHeight, u = i.clientWidth, f = r.selector[0].range.getBoundingClientRect(), { width: m, height: c } = e.getAnnotationBounds(n.id), p = f.top - a.top, g = f.left - a.left, x = i.parentElement ? i.scrollTop : 0, v = i.parentElement ? i.scrollLeft : 0, h = p + x - (s - c) / 2, d = g + v - (u - m) / 2;\n i.scroll({ top: h, left: d, behavior: \"smooth\" });\n }, i = Pt(t);\n if (i) {\n const r = e.getAnnotation(n.id), { range: a } = r.target.selector[0];\n if (a && !a.collapsed)\n return o(r.target), !0;\n {\n const s = it(r.target, t), { range: u } = s.selector[0];\n if (u && !u.collapsed)\n return o(s), !0;\n }\n }\n return !1;\n}, Nn = (t, e) => ({\n ...t,\n annotationEnabled: t.annotationEnabled === void 0 ? e.annotationEnabled : t.annotationEnabled\n}), Rn = (t, e, n, o) => {\n const { store: i, selection: r } = e;\n let a, s;\n const u = (h) => a = h;\n let f = !1, m;\n const c = (h) => {\n var l;\n if (!f)\n return;\n !((l = h.target.parentElement) != null && l.closest(X)) ? s = {\n annotation: kt(),\n selector: [],\n creator: a,\n created: /* @__PURE__ */ new Date()\n } : s = void 0;\n };\n n && t.addEventListener(\"selectstart\", c);\n const p = pt((h) => {\n var N, R;\n const d = document.getSelection();\n if (!!((R = (N = d.anchorNode) == null ? void 0 : N.parentElement) != null && R.closest(X))) {\n s = void 0;\n return;\n }\n if (h.timeStamp - ((m == null ? void 0 : m.timeStamp) || h.timeStamp) < 1e3 && !s && c(m), d.isCollapsed || !f || !s)\n return;\n const y = d.getRangeAt(0), T = re(y.cloneRange()), C = Kt(T);\n (C.length !== s.selector.length || C.some((O, b) => {\n var w;\n return O.toString() !== ((w = s.selector[b]) == null ? void 0 : w.quote);\n })) && (s = {\n ...s,\n selector: C.map((O) => ie(O, t, o))\n }, i.getAnnotation(s.annotation) ? i.updateTarget(s, B.LOCAL) : (i.addAnnotation({\n id: s.annotation,\n bodies: [],\n target: s\n }), r.clickSelect(s.annotation, m)));\n });\n n && document.addEventListener(\"selectionchange\", p);\n const g = (h) => {\n const { target: d, timeStamp: l, offsetX: y, offsetY: T, type: C } = h;\n m = { ...h, target: d, timeStamp: l, offsetX: y, offsetY: T, type: C }, f = h.button === 0;\n };\n t.addEventListener(\"pointerdown\", g);\n const x = (h) => {\n var T;\n if (!!((T = h.target.parentElement) != null && T.closest(X)) || !f)\n return;\n const l = () => {\n const { x: C, y: E } = t.getBoundingClientRect(), N = i.getAt(h.clientX - C, h.clientY - E);\n if (N) {\n const { selected: R } = r;\n (R.length !== 1 || R[0].id !== N.id) && r.clickSelect(N.id, h);\n } else\n r.isEmpty() || r.clear();\n }, y = h.timeStamp - m.timeStamp;\n document.getSelection().isCollapsed && y < 300 ? (s = void 0, l()) : s && r.clickSelect(s.annotation, h);\n };\n return document.addEventListener(\"pointerup\", x), {\n destroy: () => {\n t.removeEventListener(\"selectstart\", c), document.removeEventListener(\"selectionchange\", p), t.removeEventListener(\"pointerdown\", g), document.removeEventListener(\"pointerup\", x);\n },\n setUser: u\n };\n}, Mt = \"SPANS\", Mn = (t, e = {}) => {\n Qt(t);\n const n = Nn(e, {\n annotationEnabled: !0\n }), o = En(t, n.pointerAction), { selection: i, viewport: r } = o, a = o.store, s = Ge(a), u = Qe(o, s, n.adapter);\n let f = sn();\n const m = n.renderer === \"CSS_HIGHLIGHTS\" ? CSS.highlights ? \"CSS_HIGHLIGHTS\" : Mt : n.renderer || Mt, c = m === \"SPANS\" ? Se(t, o, r) : m === \"CSS_HIGHLIGHTS\" ? xe(t, o, r) : m === \"CANVAS\" ? ue(t, o, r) : void 0;\n if (!c)\n throw `Unknown renderer implementation: ${m}`;\n console.debug(`Using ${m} renderer`), n.style && c.setStyle(n.style);\n const p = Rn(t, o, n.annotationEnabled, n.offsetReferenceSelector);\n return p.setUser(f), {\n ...Ze(o, s, n.adapter),\n destroy: () => {\n c.destroy(), p.destroy(), s.destroy();\n },\n element: t,\n getUser: () => f,\n setFilter: (E) => c.setFilter(E),\n setStyle: (E) => c.setStyle(E),\n setUser: (E) => {\n f = E, p.setUser(E);\n },\n setSelected: (E) => {\n E ? i.setSelected(E) : i.clear();\n },\n setPresenceProvider: (E) => {\n E && (c.setPainter(Cn(t, E, n.presence)), E.on(\"selectionChange\", () => c.redraw()));\n },\n setVisible: (E) => c.setVisible(E),\n on: u.on,\n off: u.off,\n scrollIntoView: Tn(t, a),\n state: o\n };\n};\nexport {\n ot as DEFAULT_SELECTED_STYLE,\n P as DEFAULT_STYLE,\n Vt as NOT_ANNOTATABLE_CLASS,\n X as NOT_ANNOTATABLE_SELECTOR,\n B as Origin,\n Oe as PointerSelectAction,\n In as W3CTextFormat,\n Qt as cancelSingleClickEvents,\n On as createBody,\n ue as createCanvasRenderer,\n xe as createHighlightsRenderer,\n we as createRenderer,\n Se as createSpansRenderer,\n Mn as createTextAnnotator,\n En as createTextAnnotatorState,\n pt as debounce,\n Nn as fillDefaults,\n Ln as getAnnotatableFragment,\n Bn as getClientRectsPonyfill,\n te as getQuoteContext,\n ft as getRangeAnnotatableContents,\n $ as isRevived,\n oe as mergeClientRects,\n qt as paint,\n hn as parseW3CTextAnnotation,\n ie as rangeToSelector,\n rt as reviveAnnotation,\n _t as reviveSelector,\n it as reviveTarget,\n fn as serializeW3CTextAnnotation,\n Kt as splitAnnotatableRanges,\n re as trimRange\n};\n//# sourceMappingURL=text-annotator.es.js.map\n"],"names":[],"mappings":"AAAK,MAUF,KA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MAAM;AAAA,IACjB,SAAS;AAAA,IACT,SAAS,KAAK,OAAO,SAAS,EAAE,YAAa;AAAA,IAC7C,UAAU,KAAK,OAAO,SAAS,EAAE,YAAa;AAAA,IAC9C,QAAQ;AAAA,EACZ;AACA;","x_google_ignoreList":[0]}
@@ -1,2 +1,13 @@
1
-
1
+ import { __module as jsxRuntime } from "./react-text-annotator.es13.js";
2
+ import { __require as requireReactJsxRuntime_production_min } from "./react-text-annotator.es14.js";
3
+ import { __require as requireReactJsxRuntime_development } from "./react-text-annotator.es15.js";
4
+ if (process.env.NODE_ENV === "production") {
5
+ jsxRuntime.exports = requireReactJsxRuntime_production_min();
6
+ } else {
7
+ jsxRuntime.exports = requireReactJsxRuntime_development();
8
+ }
9
+ var jsxRuntimeExports = jsxRuntime.exports;
10
+ export {
11
+ jsxRuntimeExports as j
12
+ };
2
13
  //# sourceMappingURL=react-text-annotator.es7.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"react-text-annotator.es7.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
1
+ {"version":3,"file":"react-text-annotator.es7.js","sources":["../../../node_modules/react/jsx-runtime.js"],"sourcesContent":["'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.production.min.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.development.js');\n}\n"],"names":["jsxRuntimeModule","require$$0","require$$1"],"mappings":";;;AAEA,IAAI,QAAQ,IAAI,aAAa,cAAc;AACzCA,aAAA,UAAiBC;AACnB,OAAO;AACLD,aAAA,UAAiBE;AACnB;;","x_google_ignoreList":[0]}