@tonyclaw/llm-inspector 1.6.0
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.
- package/.output/nitro.json +17 -0
- package/.output/public/assets/alibaba-TTwafVwX.svg +1 -0
- package/.output/public/assets/index-B3RwBPLW.css +1 -0
- package/.output/public/assets/index-s4lwsWvq.js +97 -0
- package/.output/public/assets/main-Cp8AM0Pa.js +17 -0
- package/.output/public/assets/minimax-BPMzvuL-.jpeg +0 -0
- package/.output/public/assets/qwen-CONDcHqt.png +0 -0
- package/.output/public/assets/zhipuai-BPNAnxo-.svg +219 -0
- package/.output/server/_chunks/ssr-renderer.mjs +17 -0
- package/.output/server/_libs/@radix-ui/react-accessible-icon+[...].mjs +1 -0
- package/.output/server/_libs/@radix-ui/react-dismissable-layer+[...].mjs +210 -0
- package/.output/server/_libs/@radix-ui/react-navigation-menu+[...].mjs +1 -0
- package/.output/server/_libs/@radix-ui/react-one-time-password-field+[...].mjs +1 -0
- package/.output/server/_libs/@radix-ui/react-password-toggle-field+[...].mjs +1 -0
- package/.output/server/_libs/@radix-ui/react-use-callback-ref+[...].mjs +11 -0
- package/.output/server/_libs/@radix-ui/react-use-controllable-state+[...].mjs +69 -0
- package/.output/server/_libs/@radix-ui/react-use-effect-event+[...].mjs +1 -0
- package/.output/server/_libs/@radix-ui/react-use-escape-keydown+[...].mjs +17 -0
- package/.output/server/_libs/@radix-ui/react-use-is-hydrated+[...].mjs +1 -0
- package/.output/server/_libs/@radix-ui/react-use-layout-effect+[...].mjs +6 -0
- package/.output/server/_libs/@radix-ui/react-visually-hidden+[...].mjs +34 -0
- package/.output/server/_libs/ajv-formats.mjs +330 -0
- package/.output/server/_libs/ajv.mjs +11444 -0
- package/.output/server/_libs/aria-hidden.mjs +122 -0
- package/.output/server/_libs/atomically.mjs +152 -0
- package/.output/server/_libs/bail.mjs +8 -0
- package/.output/server/_libs/character-entities.mjs +2130 -0
- package/.output/server/_libs/class-variance-authority.mjs +44 -0
- package/.output/server/_libs/clsx.mjs +16 -0
- package/.output/server/_libs/comma-separated-tokens.mjs +10 -0
- package/.output/server/_libs/conf.mjs +635 -0
- package/.output/server/_libs/cookie-es.mjs +58 -0
- package/.output/server/_libs/core-util-is.mjs +75 -0
- package/.output/server/_libs/croner.mjs +1 -0
- package/.output/server/_libs/crossws.mjs +1 -0
- package/.output/server/_libs/debounce-fn.mjs +69 -0
- package/.output/server/_libs/decode-named-character-reference+[...].mjs +8 -0
- package/.output/server/_libs/detect-node-es.mjs +1 -0
- package/.output/server/_libs/devlop.mjs +8 -0
- package/.output/server/_libs/dot-prop.mjs +265 -0
- package/.output/server/_libs/env-paths.mjs +57 -0
- package/.output/server/_libs/estree-util-is-identifier-name.mjs +11 -0
- package/.output/server/_libs/extend.mjs +97 -0
- package/.output/server/_libs/fast-deep-equal.mjs +38 -0
- package/.output/server/_libs/fast-uri.mjs +812 -0
- package/.output/server/_libs/floating-ui__core.mjs +725 -0
- package/.output/server/_libs/floating-ui__dom.mjs +622 -0
- package/.output/server/_libs/floating-ui__react-dom.mjs +292 -0
- package/.output/server/_libs/floating-ui__utils.mjs +320 -0
- package/.output/server/_libs/get-nonce.mjs +9 -0
- package/.output/server/_libs/h3-v2.mjs +276 -0
- package/.output/server/_libs/h3.mjs +400 -0
- package/.output/server/_libs/hast-util-to-jsx-runtime.mjs +388 -0
- package/.output/server/_libs/hast-util-whitespace.mjs +10 -0
- package/.output/server/_libs/hookable.mjs +1 -0
- package/.output/server/_libs/html-url-attributes.mjs +26 -0
- package/.output/server/_libs/immediate.mjs +74 -0
- package/.output/server/_libs/inherits.mjs +50 -0
- package/.output/server/_libs/inline-style-parser.mjs +142 -0
- package/.output/server/_libs/is-plain-obj.mjs +10 -0
- package/.output/server/_libs/isarray.mjs +14 -0
- package/.output/server/_libs/isbot.mjs +20 -0
- package/.output/server/_libs/json-schema-traverse.mjs +180 -0
- package/.output/server/_libs/jszip.mjs +3049 -0
- package/.output/server/_libs/lie.mjs +273 -0
- package/.output/server/_libs/lucide-react.mjs +368 -0
- package/.output/server/_libs/mdast-util-from-markdown.mjs +717 -0
- package/.output/server/_libs/mdast-util-to-hast.mjs +710 -0
- package/.output/server/_libs/mdast-util-to-string.mjs +38 -0
- package/.output/server/_libs/micromark-core-commonmark.mjs +2259 -0
- package/.output/server/_libs/micromark-factory-destination.mjs +94 -0
- package/.output/server/_libs/micromark-factory-label.mjs +63 -0
- package/.output/server/_libs/micromark-factory-space.mjs +24 -0
- package/.output/server/_libs/micromark-factory-title.mjs +65 -0
- package/.output/server/_libs/micromark-factory-whitespace.mjs +22 -0
- package/.output/server/_libs/micromark-util-character.mjs +44 -0
- package/.output/server/_libs/micromark-util-chunked.mjs +36 -0
- package/.output/server/_libs/micromark-util-classify-character+[...].mjs +12 -0
- package/.output/server/_libs/micromark-util-combine-extensions+[...].mjs +41 -0
- package/.output/server/_libs/micromark-util-decode-numeric-character-reference+[...].mjs +19 -0
- package/.output/server/_libs/micromark-util-decode-string.mjs +21 -0
- package/.output/server/_libs/micromark-util-encode.mjs +1 -0
- package/.output/server/_libs/micromark-util-html-tag-name.mjs +69 -0
- package/.output/server/_libs/micromark-util-normalize-identifier+[...].mjs +6 -0
- package/.output/server/_libs/micromark-util-resolve-all.mjs +15 -0
- package/.output/server/_libs/micromark-util-sanitize-uri.mjs +41 -0
- package/.output/server/_libs/micromark-util-subtokenize.mjs +346 -0
- package/.output/server/_libs/micromark.mjs +906 -0
- package/.output/server/_libs/mimic-function.mjs +47 -0
- package/.output/server/_libs/ohash.mjs +1 -0
- package/.output/server/_libs/pako.mjs +4223 -0
- package/.output/server/_libs/process-nextick-args.mjs +48 -0
- package/.output/server/_libs/property-information.mjs +1209 -0
- package/.output/server/_libs/radix-ui.mjs +1 -0
- package/.output/server/_libs/radix-ui__number.mjs +6 -0
- package/.output/server/_libs/radix-ui__primitive.mjs +11 -0
- package/.output/server/_libs/radix-ui__react-accordion.mjs +1 -0
- package/.output/server/_libs/radix-ui__react-alert-dialog.mjs +1 -0
- package/.output/server/_libs/radix-ui__react-arrow.mjs +23 -0
- package/.output/server/_libs/radix-ui__react-aspect-ratio.mjs +1 -0
- package/.output/server/_libs/radix-ui__react-avatar.mjs +1 -0
- package/.output/server/_libs/radix-ui__react-checkbox.mjs +1 -0
- package/.output/server/_libs/radix-ui__react-collapsible.mjs +144 -0
- package/.output/server/_libs/radix-ui__react-collection.mjs +69 -0
- package/.output/server/_libs/radix-ui__react-compose-refs.mjs +39 -0
- package/.output/server/_libs/radix-ui__react-context-menu.mjs +1 -0
- package/.output/server/_libs/radix-ui__react-context.mjs +78 -0
- package/.output/server/_libs/radix-ui__react-dialog.mjs +325 -0
- package/.output/server/_libs/radix-ui__react-direction.mjs +9 -0
- package/.output/server/_libs/radix-ui__react-dropdown-menu.mjs +1 -0
- package/.output/server/_libs/radix-ui__react-focus-guards.mjs +29 -0
- package/.output/server/_libs/radix-ui__react-focus-scope.mjs +206 -0
- package/.output/server/_libs/radix-ui__react-form.mjs +1 -0
- package/.output/server/_libs/radix-ui__react-hover-card.mjs +1 -0
- package/.output/server/_libs/radix-ui__react-id.mjs +14 -0
- package/.output/server/_libs/radix-ui__react-label.mjs +1 -0
- package/.output/server/_libs/radix-ui__react-menu.mjs +1 -0
- package/.output/server/_libs/radix-ui__react-menubar.mjs +1 -0
- package/.output/server/_libs/radix-ui__react-popover.mjs +1 -0
- package/.output/server/_libs/radix-ui__react-popper.mjs +286 -0
- package/.output/server/_libs/radix-ui__react-portal.mjs +16 -0
- package/.output/server/_libs/radix-ui__react-presence.mjs +128 -0
- package/.output/server/_libs/radix-ui__react-primitive.mjs +42 -0
- package/.output/server/_libs/radix-ui__react-progress.mjs +1 -0
- package/.output/server/_libs/radix-ui__react-radio-group.mjs +1 -0
- package/.output/server/_libs/radix-ui__react-roving-focus.mjs +224 -0
- package/.output/server/_libs/radix-ui__react-scroll-area.mjs +721 -0
- package/.output/server/_libs/radix-ui__react-select.mjs +1163 -0
- package/.output/server/_libs/radix-ui__react-separator.mjs +28 -0
- package/.output/server/_libs/radix-ui__react-slider.mjs +1 -0
- package/.output/server/_libs/radix-ui__react-slot.mjs +99 -0
- package/.output/server/_libs/radix-ui__react-switch.mjs +1 -0
- package/.output/server/_libs/radix-ui__react-tabs.mjs +189 -0
- package/.output/server/_libs/radix-ui__react-toast.mjs +1 -0
- package/.output/server/_libs/radix-ui__react-toggle-group.mjs +1 -0
- package/.output/server/_libs/radix-ui__react-toggle.mjs +1 -0
- package/.output/server/_libs/radix-ui__react-toolbar.mjs +1 -0
- package/.output/server/_libs/radix-ui__react-tooltip.mjs +495 -0
- package/.output/server/_libs/radix-ui__react-use-previous.mjs +14 -0
- package/.output/server/_libs/radix-ui__react-use-size.mjs +39 -0
- package/.output/server/_libs/react-dom.mjs +9935 -0
- package/.output/server/_libs/react-markdown.mjs +147 -0
- package/.output/server/_libs/react-remove-scroll-bar.mjs +82 -0
- package/.output/server/_libs/react-remove-scroll.mjs +328 -0
- package/.output/server/_libs/react-style-singleton.mjs +69 -0
- package/.output/server/_libs/react.mjs +515 -0
- package/.output/server/_libs/readable-stream.mjs +1518 -0
- package/.output/server/_libs/remark-parse.mjs +19 -0
- package/.output/server/_libs/remark-rehype.mjs +21 -0
- package/.output/server/_libs/rou3.mjs +8 -0
- package/.output/server/_libs/safe-buffer.mjs +64 -0
- package/.output/server/_libs/semver.mjs +1984 -0
- package/.output/server/_libs/seroval-plugins.mjs +58 -0
- package/.output/server/_libs/seroval.mjs +1765 -0
- package/.output/server/_libs/setimmediate.mjs +1 -0
- package/.output/server/_libs/space-separated-tokens.mjs +6 -0
- package/.output/server/_libs/srvx.mjs +334 -0
- package/.output/server/_libs/stubborn-fs.mjs +91 -0
- package/.output/server/_libs/stubborn-utils.mjs +66 -0
- package/.output/server/_libs/style-to-js.mjs +72 -0
- package/.output/server/_libs/style-to-object.mjs +38 -0
- package/.output/server/_libs/tailwind-merge.mjs +3010 -0
- package/.output/server/_libs/tanstack__history.mjs +217 -0
- package/.output/server/_libs/tanstack__react-router.mjs +1480 -0
- package/.output/server/_libs/tanstack__react-store.mjs +1 -0
- package/.output/server/_libs/tanstack__react-virtual.mjs +44 -0
- package/.output/server/_libs/tanstack__router-core.mjs +4827 -0
- package/.output/server/_libs/tanstack__store.mjs +1 -0
- package/.output/server/_libs/tanstack__virtual-core.mjs +1225 -0
- package/.output/server/_libs/tiny-invariant.mjs +12 -0
- package/.output/server/_libs/tiny-warning.mjs +5 -0
- package/.output/server/_libs/trim-lines.mjs +41 -0
- package/.output/server/_libs/trough.mjs +85 -0
- package/.output/server/_libs/tslib.mjs +576 -0
- package/.output/server/_libs/ufo.mjs +54 -0
- package/.output/server/_libs/uint8array-extras.mjs +69 -0
- package/.output/server/_libs/unctx.mjs +1 -0
- package/.output/server/_libs/ungap__structured-clone.mjs +212 -0
- package/.output/server/_libs/unified.mjs +661 -0
- package/.output/server/_libs/unist-util-is.mjs +100 -0
- package/.output/server/_libs/unist-util-position.mjs +27 -0
- package/.output/server/_libs/unist-util-stringify-position.mjs +27 -0
- package/.output/server/_libs/unist-util-visit-parents.mjs +82 -0
- package/.output/server/_libs/unist-util-visit.mjs +24 -0
- package/.output/server/_libs/unstorage.mjs +1 -0
- package/.output/server/_libs/use-callback-ref.mjs +66 -0
- package/.output/server/_libs/use-sidecar.mjs +106 -0
- package/.output/server/_libs/use-sync-external-store.mjs +1 -0
- package/.output/server/_libs/util-deprecate.mjs +12 -0
- package/.output/server/_libs/vfile-message.mjs +138 -0
- package/.output/server/_libs/vfile.mjs +467 -0
- package/.output/server/_libs/when-exit.mjs +53 -0
- package/.output/server/_libs/zod.mjs +4460 -0
- package/.output/server/_ssr/index-ByCLZu7J.mjs +3061 -0
- package/.output/server/_ssr/index.mjs +1176 -0
- package/.output/server/_ssr/router-Bq_mxeNz.mjs +2872 -0
- package/.output/server/_ssr/start-HYkvq4Ni.mjs +4 -0
- package/.output/server/_tanstack-start-manifest_v-C4E0e9my.mjs +4 -0
- package/.output/server/index.mjs +393 -0
- package/README.md +196 -0
- package/package.json +91 -0
- package/src/assets/logos/alibaba.svg +1 -0
- package/src/assets/logos/anthropic.svg +1 -0
- package/src/assets/logos/deepseek.svg +1 -0
- package/src/assets/logos/minimax.jpeg +0 -0
- package/src/assets/logos/openai.svg +1 -0
- package/src/assets/logos/qwen.png +0 -0
- package/src/assets/logos/zhipuai.svg +219 -0
- package/src/cli.ts +68 -0
- package/src/components/ProxyViewer.tsx +325 -0
- package/src/components/ProxyViewerContainer.tsx +211 -0
- package/src/components/providers/ProviderCard.tsx +186 -0
- package/src/components/providers/ProviderForm.tsx +259 -0
- package/src/components/providers/ProviderLogo.tsx +111 -0
- package/src/components/providers/ProvidersPanel.tsx +259 -0
- package/src/components/providers/SettingsDialog.tsx +39 -0
- package/src/components/proxy-viewer/ConversationGroup.tsx +68 -0
- package/src/components/proxy-viewer/ConversationHeader.tsx +141 -0
- package/src/components/proxy-viewer/LogEntry.tsx +225 -0
- package/src/components/proxy-viewer/LogEntryHeader.tsx +250 -0
- package/src/components/proxy-viewer/ReplayDialog.tsx +208 -0
- package/src/components/proxy-viewer/ResponseView.tsx +161 -0
- package/src/components/proxy-viewer/StreamingChunkSequence.tsx +171 -0
- package/src/components/proxy-viewer/formats/anthropic/ContentBlocks.tsx +139 -0
- package/src/components/proxy-viewer/formats/anthropic/ResponseView.tsx +64 -0
- package/src/components/proxy-viewer/formats/index.tsx +24 -0
- package/src/components/proxy-viewer/formats/openai/ResponseView.tsx +80 -0
- package/src/components/proxy-viewer/index.ts +8 -0
- package/src/components/ui/badge.tsx +47 -0
- package/src/components/ui/button.tsx +47 -0
- package/src/components/ui/collapsible.tsx +21 -0
- package/src/components/ui/dialog.tsx +129 -0
- package/src/components/ui/json-viewer.tsx +464 -0
- package/src/components/ui/scroll-area.tsx +54 -0
- package/src/components/ui/select.tsx +178 -0
- package/src/components/ui/separator.tsx +28 -0
- package/src/components/ui/tabs.tsx +88 -0
- package/src/components/ui/tooltip.tsx +51 -0
- package/src/index.css +11 -0
- package/src/lib/export-logs.ts +51 -0
- package/src/lib/utils.ts +22 -0
- package/src/proxy/chunkStorage.ts +118 -0
- package/src/proxy/constants.ts +36 -0
- package/src/proxy/formats/anthropic/anthropicProvider.ts +75 -0
- package/src/proxy/formats/anthropic/handler.ts +74 -0
- package/src/proxy/formats/anthropic/index.ts +14 -0
- package/src/proxy/formats/anthropic/register.ts +4 -0
- package/src/proxy/formats/anthropic/schemas.ts +217 -0
- package/src/proxy/formats/anthropic/stream.ts +167 -0
- package/src/proxy/formats/handler.ts +46 -0
- package/src/proxy/formats/index.ts +12 -0
- package/src/proxy/formats/jsonSchema.ts +24 -0
- package/src/proxy/formats/openai/alibabaProvider.ts +38 -0
- package/src/proxy/formats/openai/handler.ts +70 -0
- package/src/proxy/formats/openai/index.ts +25 -0
- package/src/proxy/formats/openai/provider.ts +50 -0
- package/src/proxy/formats/openai/register.ts +4 -0
- package/src/proxy/formats/openai/schemas.ts +150 -0
- package/src/proxy/formats/openai/stream.ts +153 -0
- package/src/proxy/formats/protocol.ts +50 -0
- package/src/proxy/formats/providerRegistry.ts +51 -0
- package/src/proxy/formats/providers/index.ts +3 -0
- package/src/proxy/formats/registry.ts +61 -0
- package/src/proxy/handler.ts +389 -0
- package/src/proxy/logIndex.ts +187 -0
- package/src/proxy/logger.ts +99 -0
- package/src/proxy/providers.ts +234 -0
- package/src/proxy/schemas.ts +160 -0
- package/src/proxy/socketTracker.ts +158 -0
- package/src/proxy/store.ts +386 -0
- package/src/router.tsx +16 -0
- package/src/routes/__root.tsx +38 -0
- package/src/routes/api/config.paths.ts +14 -0
- package/src/routes/api/health.ts +11 -0
- package/src/routes/api/logs.$id.chunks.ts +36 -0
- package/src/routes/api/logs.$id.replay.ts +262 -0
- package/src/routes/api/logs.$id.ts +22 -0
- package/src/routes/api/logs.stream.ts +64 -0
- package/src/routes/api/logs.ts +30 -0
- package/src/routes/api/models.ts +10 -0
- package/src/routes/api/providers.$providerId.ts +45 -0
- package/src/routes/api/providers.ts +37 -0
- package/src/routes/api/sessions.ts +10 -0
- package/src/routes/index.tsx +6 -0
- package/src/routes/proxy/$.ts +15 -0
- package/styles/globals.css +121 -0
|
@@ -0,0 +1,622 @@
|
|
|
1
|
+
import { c as computePosition$1, o as offset$1, s as shift$1, f as flip$1, a as size$1, h as hide$1, b as arrow$1, l as limitShift$1 } from "./floating-ui__core.mjs";
|
|
2
|
+
import { p as isElement, q as getDocumentElement, t as getOverflowAncestors, u as getComputedStyle$1, v as isHTMLElement, w as createCoords, x as round, y as getWindow, z as isTopLayer, A as getParentNode, B as isLastTraversableNode, C as isTableElement, D as isContainingBlock, E as getContainingBlock, l as max, m as min, F as getNodeName, G as isOverflowElement, H as getNodeScroll, I as getFrameElement, r as rectToClientRect, J as floor, K as isWebKit } from "./floating-ui__utils.mjs";
|
|
3
|
+
function getCssDimensions(element) {
|
|
4
|
+
const css = getComputedStyle$1(element);
|
|
5
|
+
let width = parseFloat(css.width) || 0;
|
|
6
|
+
let height = parseFloat(css.height) || 0;
|
|
7
|
+
const hasOffset = isHTMLElement(element);
|
|
8
|
+
const offsetWidth = hasOffset ? element.offsetWidth : width;
|
|
9
|
+
const offsetHeight = hasOffset ? element.offsetHeight : height;
|
|
10
|
+
const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;
|
|
11
|
+
if (shouldFallback) {
|
|
12
|
+
width = offsetWidth;
|
|
13
|
+
height = offsetHeight;
|
|
14
|
+
}
|
|
15
|
+
return {
|
|
16
|
+
width,
|
|
17
|
+
height,
|
|
18
|
+
$: shouldFallback
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
function unwrapElement(element) {
|
|
22
|
+
return !isElement(element) ? element.contextElement : element;
|
|
23
|
+
}
|
|
24
|
+
function getScale(element) {
|
|
25
|
+
const domElement = unwrapElement(element);
|
|
26
|
+
if (!isHTMLElement(domElement)) {
|
|
27
|
+
return createCoords(1);
|
|
28
|
+
}
|
|
29
|
+
const rect = domElement.getBoundingClientRect();
|
|
30
|
+
const {
|
|
31
|
+
width,
|
|
32
|
+
height,
|
|
33
|
+
$
|
|
34
|
+
} = getCssDimensions(domElement);
|
|
35
|
+
let x = ($ ? round(rect.width) : rect.width) / width;
|
|
36
|
+
let y = ($ ? round(rect.height) : rect.height) / height;
|
|
37
|
+
if (!x || !Number.isFinite(x)) {
|
|
38
|
+
x = 1;
|
|
39
|
+
}
|
|
40
|
+
if (!y || !Number.isFinite(y)) {
|
|
41
|
+
y = 1;
|
|
42
|
+
}
|
|
43
|
+
return {
|
|
44
|
+
x,
|
|
45
|
+
y
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
const noOffsets = /* @__PURE__ */ createCoords(0);
|
|
49
|
+
function getVisualOffsets(element) {
|
|
50
|
+
const win = getWindow(element);
|
|
51
|
+
if (!isWebKit() || !win.visualViewport) {
|
|
52
|
+
return noOffsets;
|
|
53
|
+
}
|
|
54
|
+
return {
|
|
55
|
+
x: win.visualViewport.offsetLeft,
|
|
56
|
+
y: win.visualViewport.offsetTop
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {
|
|
60
|
+
if (isFixed === void 0) {
|
|
61
|
+
isFixed = false;
|
|
62
|
+
}
|
|
63
|
+
if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) {
|
|
64
|
+
return false;
|
|
65
|
+
}
|
|
66
|
+
return isFixed;
|
|
67
|
+
}
|
|
68
|
+
function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {
|
|
69
|
+
if (includeScale === void 0) {
|
|
70
|
+
includeScale = false;
|
|
71
|
+
}
|
|
72
|
+
if (isFixedStrategy === void 0) {
|
|
73
|
+
isFixedStrategy = false;
|
|
74
|
+
}
|
|
75
|
+
const clientRect = element.getBoundingClientRect();
|
|
76
|
+
const domElement = unwrapElement(element);
|
|
77
|
+
let scale = createCoords(1);
|
|
78
|
+
if (includeScale) {
|
|
79
|
+
if (offsetParent) {
|
|
80
|
+
if (isElement(offsetParent)) {
|
|
81
|
+
scale = getScale(offsetParent);
|
|
82
|
+
}
|
|
83
|
+
} else {
|
|
84
|
+
scale = getScale(element);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);
|
|
88
|
+
let x = (clientRect.left + visualOffsets.x) / scale.x;
|
|
89
|
+
let y = (clientRect.top + visualOffsets.y) / scale.y;
|
|
90
|
+
let width = clientRect.width / scale.x;
|
|
91
|
+
let height = clientRect.height / scale.y;
|
|
92
|
+
if (domElement) {
|
|
93
|
+
const win = getWindow(domElement);
|
|
94
|
+
const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
|
|
95
|
+
let currentWin = win;
|
|
96
|
+
let currentIFrame = getFrameElement(currentWin);
|
|
97
|
+
while (currentIFrame && offsetParent && offsetWin !== currentWin) {
|
|
98
|
+
const iframeScale = getScale(currentIFrame);
|
|
99
|
+
const iframeRect = currentIFrame.getBoundingClientRect();
|
|
100
|
+
const css = getComputedStyle$1(currentIFrame);
|
|
101
|
+
const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
|
|
102
|
+
const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
|
|
103
|
+
x *= iframeScale.x;
|
|
104
|
+
y *= iframeScale.y;
|
|
105
|
+
width *= iframeScale.x;
|
|
106
|
+
height *= iframeScale.y;
|
|
107
|
+
x += left;
|
|
108
|
+
y += top;
|
|
109
|
+
currentWin = getWindow(currentIFrame);
|
|
110
|
+
currentIFrame = getFrameElement(currentWin);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
return rectToClientRect({
|
|
114
|
+
width,
|
|
115
|
+
height,
|
|
116
|
+
x,
|
|
117
|
+
y
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
function getWindowScrollBarX(element, rect) {
|
|
121
|
+
const leftScroll = getNodeScroll(element).scrollLeft;
|
|
122
|
+
if (!rect) {
|
|
123
|
+
return getBoundingClientRect(getDocumentElement(element)).left + leftScroll;
|
|
124
|
+
}
|
|
125
|
+
return rect.left + leftScroll;
|
|
126
|
+
}
|
|
127
|
+
function getHTMLOffset(documentElement, scroll) {
|
|
128
|
+
const htmlRect = documentElement.getBoundingClientRect();
|
|
129
|
+
const x = htmlRect.left + scroll.scrollLeft - getWindowScrollBarX(documentElement, htmlRect);
|
|
130
|
+
const y = htmlRect.top + scroll.scrollTop;
|
|
131
|
+
return {
|
|
132
|
+
x,
|
|
133
|
+
y
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
|
|
137
|
+
let {
|
|
138
|
+
elements,
|
|
139
|
+
rect,
|
|
140
|
+
offsetParent,
|
|
141
|
+
strategy
|
|
142
|
+
} = _ref;
|
|
143
|
+
const isFixed = strategy === "fixed";
|
|
144
|
+
const documentElement = getDocumentElement(offsetParent);
|
|
145
|
+
const topLayer = elements ? isTopLayer(elements.floating) : false;
|
|
146
|
+
if (offsetParent === documentElement || topLayer && isFixed) {
|
|
147
|
+
return rect;
|
|
148
|
+
}
|
|
149
|
+
let scroll = {
|
|
150
|
+
scrollLeft: 0,
|
|
151
|
+
scrollTop: 0
|
|
152
|
+
};
|
|
153
|
+
let scale = createCoords(1);
|
|
154
|
+
const offsets = createCoords(0);
|
|
155
|
+
const isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
156
|
+
if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
|
|
157
|
+
if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) {
|
|
158
|
+
scroll = getNodeScroll(offsetParent);
|
|
159
|
+
}
|
|
160
|
+
if (isHTMLElement(offsetParent)) {
|
|
161
|
+
const offsetRect = getBoundingClientRect(offsetParent);
|
|
162
|
+
scale = getScale(offsetParent);
|
|
163
|
+
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
|
164
|
+
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
|
|
168
|
+
return {
|
|
169
|
+
width: rect.width * scale.x,
|
|
170
|
+
height: rect.height * scale.y,
|
|
171
|
+
x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x,
|
|
172
|
+
y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
function getClientRects(element) {
|
|
176
|
+
return Array.from(element.getClientRects());
|
|
177
|
+
}
|
|
178
|
+
function getDocumentRect(element) {
|
|
179
|
+
const html = getDocumentElement(element);
|
|
180
|
+
const scroll = getNodeScroll(element);
|
|
181
|
+
const body = element.ownerDocument.body;
|
|
182
|
+
const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);
|
|
183
|
+
const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
|
|
184
|
+
let x = -scroll.scrollLeft + getWindowScrollBarX(element);
|
|
185
|
+
const y = -scroll.scrollTop;
|
|
186
|
+
if (getComputedStyle$1(body).direction === "rtl") {
|
|
187
|
+
x += max(html.clientWidth, body.clientWidth) - width;
|
|
188
|
+
}
|
|
189
|
+
return {
|
|
190
|
+
width,
|
|
191
|
+
height,
|
|
192
|
+
x,
|
|
193
|
+
y
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
const SCROLLBAR_MAX = 25;
|
|
197
|
+
function getViewportRect(element, strategy) {
|
|
198
|
+
const win = getWindow(element);
|
|
199
|
+
const html = getDocumentElement(element);
|
|
200
|
+
const visualViewport = win.visualViewport;
|
|
201
|
+
let width = html.clientWidth;
|
|
202
|
+
let height = html.clientHeight;
|
|
203
|
+
let x = 0;
|
|
204
|
+
let y = 0;
|
|
205
|
+
if (visualViewport) {
|
|
206
|
+
width = visualViewport.width;
|
|
207
|
+
height = visualViewport.height;
|
|
208
|
+
const visualViewportBased = isWebKit();
|
|
209
|
+
if (!visualViewportBased || visualViewportBased && strategy === "fixed") {
|
|
210
|
+
x = visualViewport.offsetLeft;
|
|
211
|
+
y = visualViewport.offsetTop;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
const windowScrollbarX = getWindowScrollBarX(html);
|
|
215
|
+
if (windowScrollbarX <= 0) {
|
|
216
|
+
const doc = html.ownerDocument;
|
|
217
|
+
const body = doc.body;
|
|
218
|
+
const bodyStyles = getComputedStyle(body);
|
|
219
|
+
const bodyMarginInline = doc.compatMode === "CSS1Compat" ? parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight) || 0 : 0;
|
|
220
|
+
const clippingStableScrollbarWidth = Math.abs(html.clientWidth - body.clientWidth - bodyMarginInline);
|
|
221
|
+
if (clippingStableScrollbarWidth <= SCROLLBAR_MAX) {
|
|
222
|
+
width -= clippingStableScrollbarWidth;
|
|
223
|
+
}
|
|
224
|
+
} else if (windowScrollbarX <= SCROLLBAR_MAX) {
|
|
225
|
+
width += windowScrollbarX;
|
|
226
|
+
}
|
|
227
|
+
return {
|
|
228
|
+
width,
|
|
229
|
+
height,
|
|
230
|
+
x,
|
|
231
|
+
y
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
const absoluteOrFixed = /* @__PURE__ */ new Set(["absolute", "fixed"]);
|
|
235
|
+
function getInnerBoundingClientRect(element, strategy) {
|
|
236
|
+
const clientRect = getBoundingClientRect(element, true, strategy === "fixed");
|
|
237
|
+
const top = clientRect.top + element.clientTop;
|
|
238
|
+
const left = clientRect.left + element.clientLeft;
|
|
239
|
+
const scale = isHTMLElement(element) ? getScale(element) : createCoords(1);
|
|
240
|
+
const width = element.clientWidth * scale.x;
|
|
241
|
+
const height = element.clientHeight * scale.y;
|
|
242
|
+
const x = left * scale.x;
|
|
243
|
+
const y = top * scale.y;
|
|
244
|
+
return {
|
|
245
|
+
width,
|
|
246
|
+
height,
|
|
247
|
+
x,
|
|
248
|
+
y
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+
function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {
|
|
252
|
+
let rect;
|
|
253
|
+
if (clippingAncestor === "viewport") {
|
|
254
|
+
rect = getViewportRect(element, strategy);
|
|
255
|
+
} else if (clippingAncestor === "document") {
|
|
256
|
+
rect = getDocumentRect(getDocumentElement(element));
|
|
257
|
+
} else if (isElement(clippingAncestor)) {
|
|
258
|
+
rect = getInnerBoundingClientRect(clippingAncestor, strategy);
|
|
259
|
+
} else {
|
|
260
|
+
const visualOffsets = getVisualOffsets(element);
|
|
261
|
+
rect = {
|
|
262
|
+
x: clippingAncestor.x - visualOffsets.x,
|
|
263
|
+
y: clippingAncestor.y - visualOffsets.y,
|
|
264
|
+
width: clippingAncestor.width,
|
|
265
|
+
height: clippingAncestor.height
|
|
266
|
+
};
|
|
267
|
+
}
|
|
268
|
+
return rectToClientRect(rect);
|
|
269
|
+
}
|
|
270
|
+
function hasFixedPositionAncestor(element, stopNode) {
|
|
271
|
+
const parentNode = getParentNode(element);
|
|
272
|
+
if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {
|
|
273
|
+
return false;
|
|
274
|
+
}
|
|
275
|
+
return getComputedStyle$1(parentNode).position === "fixed" || hasFixedPositionAncestor(parentNode, stopNode);
|
|
276
|
+
}
|
|
277
|
+
function getClippingElementAncestors(element, cache) {
|
|
278
|
+
const cachedResult = cache.get(element);
|
|
279
|
+
if (cachedResult) {
|
|
280
|
+
return cachedResult;
|
|
281
|
+
}
|
|
282
|
+
let result = getOverflowAncestors(element, [], false).filter((el) => isElement(el) && getNodeName(el) !== "body");
|
|
283
|
+
let currentContainingBlockComputedStyle = null;
|
|
284
|
+
const elementIsFixed = getComputedStyle$1(element).position === "fixed";
|
|
285
|
+
let currentNode = elementIsFixed ? getParentNode(element) : element;
|
|
286
|
+
while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
|
|
287
|
+
const computedStyle = getComputedStyle$1(currentNode);
|
|
288
|
+
const currentNodeIsContaining = isContainingBlock(currentNode);
|
|
289
|
+
if (!currentNodeIsContaining && computedStyle.position === "fixed") {
|
|
290
|
+
currentContainingBlockComputedStyle = null;
|
|
291
|
+
}
|
|
292
|
+
const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === "static" && !!currentContainingBlockComputedStyle && absoluteOrFixed.has(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
|
|
293
|
+
if (shouldDropCurrentNode) {
|
|
294
|
+
result = result.filter((ancestor) => ancestor !== currentNode);
|
|
295
|
+
} else {
|
|
296
|
+
currentContainingBlockComputedStyle = computedStyle;
|
|
297
|
+
}
|
|
298
|
+
currentNode = getParentNode(currentNode);
|
|
299
|
+
}
|
|
300
|
+
cache.set(element, result);
|
|
301
|
+
return result;
|
|
302
|
+
}
|
|
303
|
+
function getClippingRect(_ref) {
|
|
304
|
+
let {
|
|
305
|
+
element,
|
|
306
|
+
boundary,
|
|
307
|
+
rootBoundary,
|
|
308
|
+
strategy
|
|
309
|
+
} = _ref;
|
|
310
|
+
const elementClippingAncestors = boundary === "clippingAncestors" ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary);
|
|
311
|
+
const clippingAncestors = [...elementClippingAncestors, rootBoundary];
|
|
312
|
+
const firstClippingAncestor = clippingAncestors[0];
|
|
313
|
+
const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {
|
|
314
|
+
const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);
|
|
315
|
+
accRect.top = max(rect.top, accRect.top);
|
|
316
|
+
accRect.right = min(rect.right, accRect.right);
|
|
317
|
+
accRect.bottom = min(rect.bottom, accRect.bottom);
|
|
318
|
+
accRect.left = max(rect.left, accRect.left);
|
|
319
|
+
return accRect;
|
|
320
|
+
}, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));
|
|
321
|
+
return {
|
|
322
|
+
width: clippingRect.right - clippingRect.left,
|
|
323
|
+
height: clippingRect.bottom - clippingRect.top,
|
|
324
|
+
x: clippingRect.left,
|
|
325
|
+
y: clippingRect.top
|
|
326
|
+
};
|
|
327
|
+
}
|
|
328
|
+
function getDimensions(element) {
|
|
329
|
+
const {
|
|
330
|
+
width,
|
|
331
|
+
height
|
|
332
|
+
} = getCssDimensions(element);
|
|
333
|
+
return {
|
|
334
|
+
width,
|
|
335
|
+
height
|
|
336
|
+
};
|
|
337
|
+
}
|
|
338
|
+
function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
|
|
339
|
+
const isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
340
|
+
const documentElement = getDocumentElement(offsetParent);
|
|
341
|
+
const isFixed = strategy === "fixed";
|
|
342
|
+
const rect = getBoundingClientRect(element, true, isFixed, offsetParent);
|
|
343
|
+
let scroll = {
|
|
344
|
+
scrollLeft: 0,
|
|
345
|
+
scrollTop: 0
|
|
346
|
+
};
|
|
347
|
+
const offsets = createCoords(0);
|
|
348
|
+
function setLeftRTLScrollbarOffset() {
|
|
349
|
+
offsets.x = getWindowScrollBarX(documentElement);
|
|
350
|
+
}
|
|
351
|
+
if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
|
|
352
|
+
if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) {
|
|
353
|
+
scroll = getNodeScroll(offsetParent);
|
|
354
|
+
}
|
|
355
|
+
if (isOffsetParentAnElement) {
|
|
356
|
+
const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);
|
|
357
|
+
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
|
358
|
+
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
359
|
+
} else if (documentElement) {
|
|
360
|
+
setLeftRTLScrollbarOffset();
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
if (isFixed && !isOffsetParentAnElement && documentElement) {
|
|
364
|
+
setLeftRTLScrollbarOffset();
|
|
365
|
+
}
|
|
366
|
+
const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
|
|
367
|
+
const x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x;
|
|
368
|
+
const y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y;
|
|
369
|
+
return {
|
|
370
|
+
x,
|
|
371
|
+
y,
|
|
372
|
+
width: rect.width,
|
|
373
|
+
height: rect.height
|
|
374
|
+
};
|
|
375
|
+
}
|
|
376
|
+
function isStaticPositioned(element) {
|
|
377
|
+
return getComputedStyle$1(element).position === "static";
|
|
378
|
+
}
|
|
379
|
+
function getTrueOffsetParent(element, polyfill) {
|
|
380
|
+
if (!isHTMLElement(element) || getComputedStyle$1(element).position === "fixed") {
|
|
381
|
+
return null;
|
|
382
|
+
}
|
|
383
|
+
if (polyfill) {
|
|
384
|
+
return polyfill(element);
|
|
385
|
+
}
|
|
386
|
+
let rawOffsetParent = element.offsetParent;
|
|
387
|
+
if (getDocumentElement(element) === rawOffsetParent) {
|
|
388
|
+
rawOffsetParent = rawOffsetParent.ownerDocument.body;
|
|
389
|
+
}
|
|
390
|
+
return rawOffsetParent;
|
|
391
|
+
}
|
|
392
|
+
function getOffsetParent(element, polyfill) {
|
|
393
|
+
const win = getWindow(element);
|
|
394
|
+
if (isTopLayer(element)) {
|
|
395
|
+
return win;
|
|
396
|
+
}
|
|
397
|
+
if (!isHTMLElement(element)) {
|
|
398
|
+
let svgOffsetParent = getParentNode(element);
|
|
399
|
+
while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) {
|
|
400
|
+
if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) {
|
|
401
|
+
return svgOffsetParent;
|
|
402
|
+
}
|
|
403
|
+
svgOffsetParent = getParentNode(svgOffsetParent);
|
|
404
|
+
}
|
|
405
|
+
return win;
|
|
406
|
+
}
|
|
407
|
+
let offsetParent = getTrueOffsetParent(element, polyfill);
|
|
408
|
+
while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) {
|
|
409
|
+
offsetParent = getTrueOffsetParent(offsetParent, polyfill);
|
|
410
|
+
}
|
|
411
|
+
if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) {
|
|
412
|
+
return win;
|
|
413
|
+
}
|
|
414
|
+
return offsetParent || getContainingBlock(element) || win;
|
|
415
|
+
}
|
|
416
|
+
const getElementRects = async function(data) {
|
|
417
|
+
const getOffsetParentFn = this.getOffsetParent || getOffsetParent;
|
|
418
|
+
const getDimensionsFn = this.getDimensions;
|
|
419
|
+
const floatingDimensions = await getDimensionsFn(data.floating);
|
|
420
|
+
return {
|
|
421
|
+
reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),
|
|
422
|
+
floating: {
|
|
423
|
+
x: 0,
|
|
424
|
+
y: 0,
|
|
425
|
+
width: floatingDimensions.width,
|
|
426
|
+
height: floatingDimensions.height
|
|
427
|
+
}
|
|
428
|
+
};
|
|
429
|
+
};
|
|
430
|
+
function isRTL(element) {
|
|
431
|
+
return getComputedStyle$1(element).direction === "rtl";
|
|
432
|
+
}
|
|
433
|
+
const platform = {
|
|
434
|
+
convertOffsetParentRelativeRectToViewportRelativeRect,
|
|
435
|
+
getDocumentElement,
|
|
436
|
+
getClippingRect,
|
|
437
|
+
getOffsetParent,
|
|
438
|
+
getElementRects,
|
|
439
|
+
getClientRects,
|
|
440
|
+
getDimensions,
|
|
441
|
+
getScale,
|
|
442
|
+
isElement,
|
|
443
|
+
isRTL
|
|
444
|
+
};
|
|
445
|
+
function rectsAreEqual(a, b) {
|
|
446
|
+
return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;
|
|
447
|
+
}
|
|
448
|
+
function observeMove(element, onMove) {
|
|
449
|
+
let io = null;
|
|
450
|
+
let timeoutId;
|
|
451
|
+
const root = getDocumentElement(element);
|
|
452
|
+
function cleanup() {
|
|
453
|
+
var _io;
|
|
454
|
+
clearTimeout(timeoutId);
|
|
455
|
+
(_io = io) == null || _io.disconnect();
|
|
456
|
+
io = null;
|
|
457
|
+
}
|
|
458
|
+
function refresh(skip, threshold) {
|
|
459
|
+
if (skip === void 0) {
|
|
460
|
+
skip = false;
|
|
461
|
+
}
|
|
462
|
+
if (threshold === void 0) {
|
|
463
|
+
threshold = 1;
|
|
464
|
+
}
|
|
465
|
+
cleanup();
|
|
466
|
+
const elementRectForRootMargin = element.getBoundingClientRect();
|
|
467
|
+
const {
|
|
468
|
+
left,
|
|
469
|
+
top,
|
|
470
|
+
width,
|
|
471
|
+
height
|
|
472
|
+
} = elementRectForRootMargin;
|
|
473
|
+
if (!skip) {
|
|
474
|
+
onMove();
|
|
475
|
+
}
|
|
476
|
+
if (!width || !height) {
|
|
477
|
+
return;
|
|
478
|
+
}
|
|
479
|
+
const insetTop = floor(top);
|
|
480
|
+
const insetRight = floor(root.clientWidth - (left + width));
|
|
481
|
+
const insetBottom = floor(root.clientHeight - (top + height));
|
|
482
|
+
const insetLeft = floor(left);
|
|
483
|
+
const rootMargin = -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px";
|
|
484
|
+
const options = {
|
|
485
|
+
rootMargin,
|
|
486
|
+
threshold: max(0, min(1, threshold)) || 1
|
|
487
|
+
};
|
|
488
|
+
let isFirstUpdate = true;
|
|
489
|
+
function handleObserve(entries) {
|
|
490
|
+
const ratio = entries[0].intersectionRatio;
|
|
491
|
+
if (ratio !== threshold) {
|
|
492
|
+
if (!isFirstUpdate) {
|
|
493
|
+
return refresh();
|
|
494
|
+
}
|
|
495
|
+
if (!ratio) {
|
|
496
|
+
timeoutId = setTimeout(() => {
|
|
497
|
+
refresh(false, 1e-7);
|
|
498
|
+
}, 1e3);
|
|
499
|
+
} else {
|
|
500
|
+
refresh(false, ratio);
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
if (ratio === 1 && !rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) {
|
|
504
|
+
refresh();
|
|
505
|
+
}
|
|
506
|
+
isFirstUpdate = false;
|
|
507
|
+
}
|
|
508
|
+
try {
|
|
509
|
+
io = new IntersectionObserver(handleObserve, {
|
|
510
|
+
...options,
|
|
511
|
+
// Handle <iframe>s
|
|
512
|
+
root: root.ownerDocument
|
|
513
|
+
});
|
|
514
|
+
} catch (_e) {
|
|
515
|
+
io = new IntersectionObserver(handleObserve, options);
|
|
516
|
+
}
|
|
517
|
+
io.observe(element);
|
|
518
|
+
}
|
|
519
|
+
refresh(true);
|
|
520
|
+
return cleanup;
|
|
521
|
+
}
|
|
522
|
+
function autoUpdate(reference, floating, update, options) {
|
|
523
|
+
if (options === void 0) {
|
|
524
|
+
options = {};
|
|
525
|
+
}
|
|
526
|
+
const {
|
|
527
|
+
ancestorScroll = true,
|
|
528
|
+
ancestorResize = true,
|
|
529
|
+
elementResize = typeof ResizeObserver === "function",
|
|
530
|
+
layoutShift = typeof IntersectionObserver === "function",
|
|
531
|
+
animationFrame = false
|
|
532
|
+
} = options;
|
|
533
|
+
const referenceEl = unwrapElement(reference);
|
|
534
|
+
const ancestors = ancestorScroll || ancestorResize ? [...referenceEl ? getOverflowAncestors(referenceEl) : [], ...getOverflowAncestors(floating)] : [];
|
|
535
|
+
ancestors.forEach((ancestor) => {
|
|
536
|
+
ancestorScroll && ancestor.addEventListener("scroll", update, {
|
|
537
|
+
passive: true
|
|
538
|
+
});
|
|
539
|
+
ancestorResize && ancestor.addEventListener("resize", update);
|
|
540
|
+
});
|
|
541
|
+
const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update) : null;
|
|
542
|
+
let reobserveFrame = -1;
|
|
543
|
+
let resizeObserver = null;
|
|
544
|
+
if (elementResize) {
|
|
545
|
+
resizeObserver = new ResizeObserver((_ref) => {
|
|
546
|
+
let [firstEntry] = _ref;
|
|
547
|
+
if (firstEntry && firstEntry.target === referenceEl && resizeObserver) {
|
|
548
|
+
resizeObserver.unobserve(floating);
|
|
549
|
+
cancelAnimationFrame(reobserveFrame);
|
|
550
|
+
reobserveFrame = requestAnimationFrame(() => {
|
|
551
|
+
var _resizeObserver;
|
|
552
|
+
(_resizeObserver = resizeObserver) == null || _resizeObserver.observe(floating);
|
|
553
|
+
});
|
|
554
|
+
}
|
|
555
|
+
update();
|
|
556
|
+
});
|
|
557
|
+
if (referenceEl && !animationFrame) {
|
|
558
|
+
resizeObserver.observe(referenceEl);
|
|
559
|
+
}
|
|
560
|
+
resizeObserver.observe(floating);
|
|
561
|
+
}
|
|
562
|
+
let frameId;
|
|
563
|
+
let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;
|
|
564
|
+
if (animationFrame) {
|
|
565
|
+
frameLoop();
|
|
566
|
+
}
|
|
567
|
+
function frameLoop() {
|
|
568
|
+
const nextRefRect = getBoundingClientRect(reference);
|
|
569
|
+
if (prevRefRect && !rectsAreEqual(prevRefRect, nextRefRect)) {
|
|
570
|
+
update();
|
|
571
|
+
}
|
|
572
|
+
prevRefRect = nextRefRect;
|
|
573
|
+
frameId = requestAnimationFrame(frameLoop);
|
|
574
|
+
}
|
|
575
|
+
update();
|
|
576
|
+
return () => {
|
|
577
|
+
var _resizeObserver2;
|
|
578
|
+
ancestors.forEach((ancestor) => {
|
|
579
|
+
ancestorScroll && ancestor.removeEventListener("scroll", update);
|
|
580
|
+
ancestorResize && ancestor.removeEventListener("resize", update);
|
|
581
|
+
});
|
|
582
|
+
cleanupIo == null || cleanupIo();
|
|
583
|
+
(_resizeObserver2 = resizeObserver) == null || _resizeObserver2.disconnect();
|
|
584
|
+
resizeObserver = null;
|
|
585
|
+
if (animationFrame) {
|
|
586
|
+
cancelAnimationFrame(frameId);
|
|
587
|
+
}
|
|
588
|
+
};
|
|
589
|
+
}
|
|
590
|
+
const offset = offset$1;
|
|
591
|
+
const shift = shift$1;
|
|
592
|
+
const flip = flip$1;
|
|
593
|
+
const size = size$1;
|
|
594
|
+
const hide = hide$1;
|
|
595
|
+
const arrow = arrow$1;
|
|
596
|
+
const limitShift = limitShift$1;
|
|
597
|
+
const computePosition = (reference, floating, options) => {
|
|
598
|
+
const cache = /* @__PURE__ */ new Map();
|
|
599
|
+
const mergedOptions = {
|
|
600
|
+
platform,
|
|
601
|
+
...options
|
|
602
|
+
};
|
|
603
|
+
const platformWithCache = {
|
|
604
|
+
...mergedOptions.platform,
|
|
605
|
+
_c: cache
|
|
606
|
+
};
|
|
607
|
+
return computePosition$1(reference, floating, {
|
|
608
|
+
...mergedOptions,
|
|
609
|
+
platform: platformWithCache
|
|
610
|
+
});
|
|
611
|
+
};
|
|
612
|
+
export {
|
|
613
|
+
size as a,
|
|
614
|
+
arrow as b,
|
|
615
|
+
computePosition as c,
|
|
616
|
+
autoUpdate as d,
|
|
617
|
+
flip as f,
|
|
618
|
+
hide as h,
|
|
619
|
+
limitShift as l,
|
|
620
|
+
offset as o,
|
|
621
|
+
shift as s
|
|
622
|
+
};
|