@bynder/compact-view 5.2.1 → 5.2.2
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/AccessToken.js +5 -0
- package/AccessToken2.js +176 -0
- package/AccessToken3.js +4 -0
- package/ActiveFilter.js +6 -5
- package/ActiveFilters.js +24 -24
- package/AddMedia.js +1 -1
- package/AdditionalInfo.js +18 -0
- package/Advanced.js +3 -3
- package/App.js +46 -43
- package/Arrow.js +14 -0
- package/AssetCard.js +32 -29
- package/AssetCardMetaproperties.js +14 -13
- package/AssetFilter.js +36 -35
- package/AssetFilterContext.js +3 -3
- package/AssetItem.js +14 -13
- package/AssetList.js +7 -7
- package/AssetTypeItem.js +13 -12
- package/Autocomplete_new.js +41 -37
- package/Axios2.js +136 -0
- package/AxiosError.js +54 -0
- package/AxiosHeaders.js +181 -0
- package/AxiosURLSearchParams.js +33 -0
- package/Badge.js +44 -0
- package/Baloon.js +42 -0
- package/BaseStyles.js +10 -0
- package/Blob.js +4 -0
- package/Box.js +22 -0
- package/Button.js +39 -0
- package/Button.styles.js +40 -0
- package/ButtonAction.js +3 -3
- package/ButtonLegacy.js +48 -0
- package/ButtonLegacy.styles.js +28 -0
- package/CancelToken.js +77 -0
- package/CanceledError.js +11 -0
- package/Card.js +84 -0
- package/CardSkeleton.js +15 -14
- package/Checkbox.js +85 -0
- package/Checkbox.styles.js +2 -2
- package/Checkmark.js +7 -0
- package/Chip.js +70 -40
- package/Chip2.js +42 -0
- package/CollectionCard.js +9 -8
- package/CollectionItem.js +15 -14
- package/CollectionList.js +2 -2
- package/CollectionView.js +2 -2
- package/CollectionsView.js +6 -6
- package/ColorHexInput.js +31 -0
- package/ColorPicker.js +66 -0
- package/ColorPickerSolid.js +20 -0
- package/ColorPickerWithOpacity.js +37 -0
- package/Combobox.js +61 -0
- package/ConcealedAction.js +16 -0
- package/ConnectButton.js +1 -1
- package/Container.js +14 -13
- package/Container2.js +31 -0
- package/Content.js +16 -0
- package/ContextAction.js +18 -17
- package/ContextActionButton.js +29 -0
- package/ControlGroup.js +32 -0
- package/DOMFunctions.js +27 -0
- package/Dat.js +62 -50
- package/DatDropdownItem.js +20 -19
- package/DesignSystemContext.js +4 -4
- package/DesignSystemProvider.js +29 -0
- package/DirectionSelect.js +16 -15
- package/Divider.js +21 -0
- package/DomainInput.js +15 -14
- package/DragRange.js +25 -0
- package/DragSelect.js +11 -11
- package/Dropdown.js +12 -11
- package/Dropdown2.js +169 -0
- package/DropdownContent.js +2 -2
- package/DropdownListItem.js +3 -3
- package/Enum.js +12 -0
- package/ErrorMessage.js +20 -19
- package/FieldSelect.js +4 -4
- package/FilePlaceholder.js +19 -0
- package/FileSelector.js +11 -10
- package/Flex.js +21 -0
- package/FontPicker.js +104 -0
- package/Footer.js +16 -0
- package/Form.js +23 -0
- package/FormData.js +4 -0
- package/Frame.js +64 -0
- package/Group.js +17 -0
- package/Group2.js +26 -0
- package/Header2.js +43 -0
- package/Header22.js +15 -0
- package/HelperText.js +26 -0
- package/HorizontalScroll.js +4 -4
- package/HttpHandler.js +74 -0
- package/HttpResponse.js +85 -0
- package/HttpStatusCode.js +71 -0
- package/IconPlaceholder.js +18 -0
- package/Image.js +19 -0
- package/Images.js +30 -0
- package/Indicator.js +74 -0
- package/InfiniteScroll.js +8 -8
- package/InlineBanner.js +51 -0
- package/Input.js +109 -0
- package/Input.styles.js +71 -0
- package/InputContainer.js +9 -0
- package/InputField.js +74 -0
- package/InputRow.js +18 -0
- package/Inspector.js +34 -0
- package/InteractiveIcon.js +28 -0
- package/InterceptorManager.js +58 -0
- package/Item.js +107 -0
- package/Item2.js +14 -0
- package/Item4.js +190 -0
- package/Label.js +33 -0
- package/LeftArrow.js +3 -3
- package/List.js +25 -0
- package/ListItem.js +11 -0
- package/ListItem2.js +58 -0
- package/ListItem4.js +37 -0
- package/MetapropertyFilterContent.js +2 -2
- package/MetapropertyOption.js +2 -3
- package/Middleware.js +49 -0
- package/Middleware2.js +49 -0
- package/Modal.js +2 -2
- package/Modal2.js +31 -0
- package/ModalBase.js +117 -0
- package/ModalBase.styles.js +75 -0
- package/ModalConfirmation.js +8 -0
- package/NoResults.js +16 -15
- package/OffsetContext.js +9 -0
- package/Oops.js +1 -1
- package/OpacityInput.js +17 -0
- package/Option_new.js +19 -18
- package/Overlay.js +35 -0
- package/Parser.js +131 -0
- package/Prefixer.js +187 -0
- package/Radio.js +78 -0
- package/RadioGroup.js +25 -0
- package/RangeInput.js +41 -0
- package/RefreshingSpinner.js +3 -3
- package/ReportModal.js +16 -14
- package/RequestHandler.js +119 -0
- package/RightArrow.js +4 -4
- package/Row.js +16 -0
- package/SearchInput.js +15 -15
- package/SearchInput2.js +46 -0
- package/SectionTitle.js +17 -0
- package/Select.js +49 -0
- package/SelectButtonText.js +16 -0
- package/SelectedItemContainer.js +11 -10
- package/SelectedItems.js +2 -2
- package/SelectionFooter.js +8 -7
- package/Serializer.js +27 -0
- package/ShadowRootInternal.js +17 -17
- package/Sidebar.js +17 -0
- package/Skeleton.js +6 -6
- package/Slider.constants.js +6 -0
- package/Slider.js +128 -0
- package/SmartFilterContent.js +2 -2
- package/SmartFilterSelect_new.js +2 -2
- package/Smartfilters_new.js +53 -50
- package/Spinner.js +2 -2
- package/Spinner2.js +15 -0
- package/StatefulAssetList.js +15 -15
- package/Stats.js +16 -0
- package/StatsItem.js +23 -0
- package/Status.js +32 -0
- package/Switch.js +82 -0
- package/SwitchNLS.js +26 -23
- package/Tabs2.js +10 -0
- package/TagItem.js +8 -8
- package/Tags.js +9 -9
- package/Text2.js +11 -0
- package/Text22.js +18 -0
- package/Text4.js +18 -0
- package/Textarea.js +92 -0
- package/Theming.js +4 -4
- package/Thumb.js +28 -0
- package/Thumbnail.js +91 -0
- package/Tokenizer.js +147 -0
- package/Toolbar.js +13 -12
- package/Tooltip.js +2 -2
- package/Tooltip2.js +111 -0
- package/TruncatedText.js +34 -0
- package/URLSearchParams.js +5 -0
- package/Utility.js +56 -0
- package/ViewSwitch.js +8 -7
- package/_check_private_redeclaration.js +7 -0
- package/_class_apply_descriptor_get.js +6 -0
- package/_class_apply_descriptor_set.js +11 -0
- package/_class_extract_field_descriptor.js +7 -0
- package/_class_private_field_get.js +9 -0
- package/_class_private_field_init.js +7 -0
- package/_class_private_field_set.js +9 -0
- package/_commonjsHelpers.js +6 -0
- package/adapters.js +53 -0
- package/api.js +25 -0
- package/api2.js +40 -0
- package/api3.js +406 -0
- package/applyScopeDataToEvent.js +83 -0
- package/applyScopeDataToEvent2.js +55 -0
- package/asset.type.js +9 -9
- package/autocomplete.js +2 -2
- package/axios.js +46 -0
- package/base.js +57 -0
- package/baseclient.js +498 -0
- package/bind.js +8 -0
- package/browser.js +44 -0
- package/buildFullPath.js +9 -0
- package/buildURL.js +23 -0
- package/bundle.esm.js +81 -0
- package/calculateContainerMaxHeight.js +12 -0
- package/calculateNodeHeight.js +35 -0
- package/carrier.js +13 -0
- package/chain.js +8 -0
- package/checkGlobals.js +13 -0
- package/checks.js +178 -0
- package/chunk-6HYIRFX2.js +1 -0
- package/cleanUrl.js +11 -0
- package/client.js +76 -0
- package/clientreport.js +15 -0
- package/clsx.js +17 -0
- package/colorTransforms.js +12 -0
- package/combineMetaproperties.js +1 -1
- package/combineURLs.js +6 -0
- package/composeSignals.js +30 -0
- package/constants.js +2 -12
- package/constants2.js +82 -0
- package/constants3.js +14 -0
- package/constants4.js +8 -0
- package/constants5.js +4 -0
- package/constants6.js +4 -0
- package/context.js +12 -0
- package/context10.js +12 -0
- package/context2.js +9 -0
- package/context3.js +12 -0
- package/context6.js +5 -0
- package/cookieStore.js +116 -0
- package/cookies.js +32 -0
- package/core.js +42 -0
- package/currentScopes.js +9 -0
- package/data.js +4 -0
- package/de_DE.json.js +18 -0
- package/debug-build.js +4 -0
- package/debug-build2.js +4 -0
- package/debug-build3.js +4 -0
- package/debug-build4.js +4 -0
- package/debug-build5.js +4 -0
- package/debug-build6.js +4 -0
- package/decorators.js +37 -0
- package/defaultScopes.js +12 -0
- package/devUtils.js +20 -0
- package/dispatchRequest.js +31 -0
- package/doc.js +26 -0
- package/domHelpers.js +15 -0
- package/dsn.js +54 -0
- package/dynamicSamplingContext.js +34 -0
- package/dynamicSamplingContext2.js +34 -0
- package/emotion-unitless.esm.js +52 -0
- package/en_US.json.js +23 -0
- package/englishText-12403056.js +6 -0
- package/env.js +6 -0
- package/envelope.js +113 -0
- package/envelope2.js +23 -0
- package/envelope3.js +24 -0
- package/error.js +9 -0
- package/errors.js +33 -0
- package/errors2.js +55 -0
- package/es_ES.json.js +18 -0
- package/es_MX.json.js +18 -0
- package/eventProcessors.js +27 -0
- package/eventProcessors2.js +23 -0
- package/eventbuilder.js +128 -0
- package/exports.js +11 -0
- package/exports2.js +16 -0
- package/exports3.js +8 -0
- package/fetch.js +44 -0
- package/fetch2.js +141 -0
- package/filterAssets.js +1 -1
- package/fixFontSpaceInUrl.js +8 -0
- package/focusWithoutScrolling.js +45 -0
- package/forceHiddenStyles.js +19 -0
- package/formDataToJSON.js +31 -0
- package/fr_FR.json.js +18 -0
- package/getAbsoluteUrl.js +13 -0
- package/getAsset.js +1 -1
- package/getAssetCounts.js +1 -1
- package/getAssets.js +2 -2
- package/getCallFrame.js +12 -0
- package/getCollections.js +1 -1
- package/getFilterOptions.js +1 -1
- package/getFilters.js +1 -1
- package/getFilters_new.js +1 -1
- package/getRequestCookies.js +40 -0
- package/getRootSpan.js +6 -0
- package/getRootSpan2.js +6 -0
- package/getSimilarityAssets.js +1 -1
- package/getSizingData.js +45 -0
- package/getStatusCodeColor.js +6 -0
- package/getThumbPosition.js +6 -0
- package/getTimestamp.js +7 -0
- package/getUseLayerOptions.js +49 -0
- package/handlers.js +92 -6
- package/handlers2.js +6 -0
- package/helpers.js +3 -4
- package/helpers2.js +6 -0
- package/hexFromPercentage.js +7 -0
- package/http.js +17 -0
- package/hub.js +446 -0
- package/hub2.js +442 -0
- package/immer.js +472 -0
- package/import.js +7 -0
- package/index-esm.js +10781 -0
- package/index-esm2.js +138 -0
- package/index-esm3.js +131 -0
- package/index.browser.js +11 -0
- package/index.module.js +57 -0
- package/index.module2.js +72 -0
- package/index.module3.js +57 -0
- package/index10.js +20 -0
- package/index102.js +273 -0
- package/index11.js +18 -0
- package/index112.js +29 -0
- package/index12.js +38 -0
- package/index13.js +2432 -0
- package/index14.js +558 -0
- package/index15.js +58 -0
- package/index16.js +4 -0
- package/index17.js +89 -0
- package/index18.js +9 -0
- package/index19.js +62 -0
- package/index20.js +15 -0
- package/index21.js +11 -0
- package/index22.js +42 -0
- package/index23.js +9 -0
- package/index24.js +10 -0
- package/index25.js +7 -0
- package/index26.js +12 -0
- package/index27.js +11 -0
- package/index28.js +639 -0
- package/index29.js +76 -0
- package/index3.js +5 -53
- package/index30.js +7 -0
- package/index31.js +22 -0
- package/index32.js +2 -0
- package/index33.js +7 -0
- package/index34.js +20 -0
- package/index35.js +8 -0
- package/index36.js +4 -0
- package/index37.js +13 -0
- package/index38.js +13 -0
- package/index39.js +15 -0
- package/index4.js +1684 -17
- package/index40.js +13 -0
- package/index41.js +21 -0
- package/index42.js +66 -0
- package/index43.js +8 -0
- package/index44.js +57 -0
- package/index45.js +69 -0
- package/index46.js +33 -0
- package/index47.js +13 -0
- package/index48.js +123 -0
- package/index49.js +88 -0
- package/index5.js +27 -0
- package/index50.js +10 -0
- package/index51.js +13 -0
- package/index52.js +16 -0
- package/index53.js +16 -0
- package/index54.js +9 -0
- package/index55.js +9 -0
- package/index56.js +17 -0
- package/index57.js +31 -0
- package/index58.js +18 -0
- package/index6.js +315 -0
- package/index7.js +4 -0
- package/index72.js +228 -0
- package/index8.js +5051 -0
- package/index82.js +8 -0
- package/index9.js +55 -0
- package/index92.js +12 -0
- package/integration.js +38 -0
- package/is.js +77 -0
- package/is2.js +14 -0
- package/is3.js +14 -0
- package/isAbsoluteURL.js +6 -0
- package/isAbsoluteUrl2.js +6 -0
- package/isAxiosError.js +7 -0
- package/isCancel.js +6 -0
- package/isIterable.js +6 -0
- package/isStringEqual.js +6 -0
- package/isURLSameOrigin.js +8 -0
- package/isValidHexValue.js +6 -0
- package/isVirtualEvent.js +11 -0
- package/iso.js +38 -0
- package/it_IT.json.js +18 -0
- package/itemContext.js +5 -0
- package/ja_JP.json.js +18 -0
- package/ko_KR.json.js +18 -0
- package/localStorageHelper.js +32 -0
- package/localStorageHelper2.js +4 -0
- package/localization.js +46 -0
- package/logger2.js +56 -0
- package/logger3.js +56 -0
- package/logger4.js +56 -0
- package/makeHexWithOpacity.js +12 -0
- package/makeInternalTokens.js +22 -0
- package/matchRequestUrl.js +23 -0
- package/memo.js +25 -0
- package/merge.js +13 -0
- package/mergeConfig.js +70 -0
- package/mergeProps.js +22 -0
- package/mergeRefs.js +9 -0
- package/middleware.js +177 -0
- package/middleware2.js +177 -0
- package/misc.js +58 -0
- package/misc2.js +28 -0
- package/misc3.js +24 -0
- package/nl_NL.json.js +18 -0
- package/normalize.js +97 -0
- package/normalizePath.js +11 -0
- package/normalizeResponse.js +1 -1
- package/normalizeRows.js +10 -0
- package/notify.js +52 -0
- package/null.js +4 -0
- package/object.js +110 -0
- package/object2.js +39 -0
- package/object3.js +17 -0
- package/opacityPercentageFromHex.js +9 -0
- package/openLink.js +27 -0
- package/package.json +1 -1
- package/packageVersion.js +4 -0
- package/parse.js +9 -0
- package/parse2.js +44 -0
- package/parseHeaders.js +30 -0
- package/parseProtocol.js +7 -0
- package/pl_PL.json.js +18 -0
- package/platform.js +42 -0
- package/prepareEvent.js +141 -0
- package/prepareEvent2.js +5 -0
- package/prepareEvent3.js +5 -0
- package/progressEventReducer.js +35 -0
- package/promisebuffer.js +44 -0
- package/propagationContext.js +11 -0
- package/pt_BR.json.js +18 -0
- package/ratelimit.js +37 -0
- package/react.js +19 -0
- package/react2.js +19 -0
- package/regexes.js +51 -0
- package/registries.js +41 -0
- package/resolveConfig.js +33 -0
- package/ru_RU.json.js +18 -0
- package/runAfterTransition.js +35 -0
- package/schemas.js +368 -0
- package/schemas2.js +691 -0
- package/scope.js +412 -0
- package/scope2.js +407 -0
- package/scope3.js +348 -0
- package/sdk-DhxX43BH.js +4813 -0
- package/sdkMetadata.js +15 -0
- package/serializeRequest.js +12 -0
- package/serializeResponse.js +14 -0
- package/session.js +57 -0
- package/session2.js +57 -0
- package/session3.js +16 -0
- package/settle.js +14 -0
- package/shadowdom.js +13 -0
- package/shadowdom2.js +13 -0
- package/spanOnScope.js +12 -0
- package/spanUtils.js +31 -0
- package/spanUtils2.js +31 -0
- package/speedometer.js +19 -0
- package/spread.js +8 -0
- package/stack-parsers.js +48 -0
- package/stackStrategy.js +98 -0
- package/stacktrace.js +49 -0
- package/state.js +106 -0
- package/store/useDatStore.d.ts +11 -8
- package/string.js +6 -0
- package/styled-components.browser.esm.js +530 -0
- package/styles.js +55 -0
- package/styles2.js +17 -0
- package/supports.js +6 -0
- package/syncpromise.js +121 -0
- package/syncpromise2.js +109 -0
- package/textSelection.js +33 -0
- package/textStyles.js +20 -0
- package/theme.js +238 -0
- package/themeContainers.js +20 -0
- package/themes3.js +26 -0
- package/throttle.js +15 -0
- package/time.js +24 -0
- package/time2.js +24 -0
- package/time3.js +24 -0
- package/toFormData.js +85 -0
- package/toPublicUrl.js +9 -0
- package/toURLEncodedForm.js +13 -0
- package/token.js +236 -0
- package/tokenExpirationHelper.js +48 -0
- package/tokenExpirationHelper2.js +4 -0
- package/tokensAndThemes.js +92 -0
- package/tr_TR.json.js +18 -0
- package/trackStream.js +63 -0
- package/transformData.js +13 -0
- package/transitional.js +8 -0
- package/trimMetapropertyValue.js +1 -1
- package/tslib.es6.js +18 -0
- package/typeof.js +11 -0
- package/urlHelper.js +15 -0
- package/urlHelper2.js +4 -0
- package/useAutoHeight.js +25 -0
- package/useDatStore.js +31 -27
- package/useEffectEvent.js +18 -0
- package/useFocus.js +30 -0
- package/useFocusRing.js +34 -0
- package/useFocusVisible.js +92 -0
- package/useFocusWithin.js +57 -0
- package/useFonts.js +118 -0
- package/useGlobalListeners.js +34 -0
- package/useGroupContext.js +10 -0
- package/useHover.js +79 -0
- package/useId.js +8 -0
- package/useId2.js +17 -0
- package/useKeyDown.js +14 -0
- package/useLayoutEffect.js +6 -0
- package/useOrderingStore.js +6 -6
- package/usePress.js +359 -0
- package/useRouterStore.js +6 -6
- package/useScrollHighlightedIntoView.js +24 -0
- package/useSearchStore.js +5 -5
- package/useSimilaritySearchStore.js +6 -6
- package/useSyncRef.js +12 -0
- package/useTranslate.js +13 -0
- package/useZIndex.js +9 -0
- package/userfeedback.js +28 -0
- package/util.js +265 -0
- package/utils/fixFontSpaceInUrl.d.ts +1 -0
- package/utils.js +26 -44
- package/utils2.js +43 -45
- package/utils3.js +50 -0
- package/utils4.js +12 -0
- package/utils5.js +71 -0
- package/utils6.js +222 -0
- package/utils7.js +9 -0
- package/utils8.js +70 -0
- package/validator.js +54 -0
- package/vanilla.js +14 -0
- package/vanilla2.js +14 -0
- package/version.js +4 -0
- package/version2.js +4 -0
- package/version3.js +4 -0
- package/versionContext.js +9 -0
- package/versions.js +8 -0
- package/worldwide.js +19 -0
- package/worldwide2.js +15 -0
- package/worldwide3.js +10 -0
- package/xhr.js +71 -0
- package/zh_CN.json.js +18 -0
- package/zh_TW.json.js +18 -0
package/baseclient.js
ADDED
|
@@ -0,0 +1,498 @@
|
|
|
1
|
+
import { getEnvelopeEndpointWithUrlEncodedAuth as D } from "./api.js";
|
|
2
|
+
import { DEBUG_BUILD as l } from "./debug-build2.js";
|
|
3
|
+
import { createEventEnvelope as M, createSessionEnvelope as A } from "./envelope2.js";
|
|
4
|
+
import { getIsolationScope as O } from "./hub.js";
|
|
5
|
+
import { setupIntegration as $, afterSetupIntegrations as P, setupIntegrations as B } from "./integration.js";
|
|
6
|
+
import { createMetricEnvelope as T } from "./envelope3.js";
|
|
7
|
+
import { updateSession as y } from "./session.js";
|
|
8
|
+
import { getDynamicSamplingContextFromClient as N } from "./dynamicSamplingContext.js";
|
|
9
|
+
import { prepareEvent as F } from "./prepareEvent.js";
|
|
10
|
+
import { makeDsn as j } from "./dsn.js";
|
|
11
|
+
import { logger as d } from "./logger2.js";
|
|
12
|
+
import { checkOrSetAlreadyCaught as b } from "./misc.js";
|
|
13
|
+
import { isPrimitive as z, isParameterizedString as R, isThenable as U, isPlainObject as w } from "./is.js";
|
|
14
|
+
import { resolvedSyncPromise as L, SyncPromise as q, rejectedSyncPromise as G } from "./syncpromise.js";
|
|
15
|
+
import { addItemToEnvelope as V, createAttachmentEnvelopeItem as W } from "./envelope.js";
|
|
16
|
+
import { SentryError as u } from "./error.js";
|
|
17
|
+
const x = "Not capturing exception because it's already been captured.";
|
|
18
|
+
class lt {
|
|
19
|
+
/**
|
|
20
|
+
* A reference to a metrics aggregator
|
|
21
|
+
*
|
|
22
|
+
* @experimental Note this is alpha API. It may experience breaking changes in the future.
|
|
23
|
+
*/
|
|
24
|
+
/** Options passed to the SDK. */
|
|
25
|
+
/** The client Dsn, if specified in options. Without this Dsn, the SDK will be disabled. */
|
|
26
|
+
/** Array of set up integrations. */
|
|
27
|
+
/** Indicates whether this client's integrations have been set up. */
|
|
28
|
+
/** Number of calls being processed */
|
|
29
|
+
/** Holds flushable */
|
|
30
|
+
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
31
|
+
/**
|
|
32
|
+
* Initializes this client instance.
|
|
33
|
+
*
|
|
34
|
+
* @param options Options for the client.
|
|
35
|
+
*/
|
|
36
|
+
constructor(t) {
|
|
37
|
+
if (this._options = t, this._integrations = {}, this._integrationsInitialized = !1, this._numProcessing = 0, this._outcomes = {}, this._hooks = {}, this._eventProcessors = [], t.dsn ? this._dsn = j(t.dsn) : l && d.warn("No DSN provided, client will not send events."), this._dsn) {
|
|
38
|
+
const e = D(this._dsn, t);
|
|
39
|
+
this._transport = t.transport({
|
|
40
|
+
tunnel: this._options.tunnel,
|
|
41
|
+
recordDroppedEvent: this.recordDroppedEvent.bind(this),
|
|
42
|
+
...t.transportOptions,
|
|
43
|
+
url: e
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* @inheritDoc
|
|
49
|
+
*/
|
|
50
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
|
|
51
|
+
captureException(t, e, n) {
|
|
52
|
+
if (b(t)) {
|
|
53
|
+
l && d.log(x);
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
let s = e && e.event_id;
|
|
57
|
+
return this._process(
|
|
58
|
+
this.eventFromException(t, e).then((r) => this._captureEvent(r, e, n)).then((r) => {
|
|
59
|
+
s = r;
|
|
60
|
+
})
|
|
61
|
+
), s;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* @inheritDoc
|
|
65
|
+
*/
|
|
66
|
+
captureMessage(t, e, n, s) {
|
|
67
|
+
let r = n && n.event_id;
|
|
68
|
+
const a = R(t) ? t : String(t), i = z(t) ? this.eventFromMessage(a, e, n) : this.eventFromException(t, n);
|
|
69
|
+
return this._process(
|
|
70
|
+
i.then((p) => this._captureEvent(p, n, s)).then((p) => {
|
|
71
|
+
r = p;
|
|
72
|
+
})
|
|
73
|
+
), r;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* @inheritDoc
|
|
77
|
+
*/
|
|
78
|
+
captureEvent(t, e, n) {
|
|
79
|
+
if (e && e.originalException && b(e.originalException)) {
|
|
80
|
+
l && d.log(x);
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
let s = e && e.event_id;
|
|
84
|
+
const a = (t.sdkProcessingMetadata || {}).capturedSpanScope;
|
|
85
|
+
return this._process(
|
|
86
|
+
this._captureEvent(t, e, a || n).then((i) => {
|
|
87
|
+
s = i;
|
|
88
|
+
})
|
|
89
|
+
), s;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* @inheritDoc
|
|
93
|
+
*/
|
|
94
|
+
captureSession(t) {
|
|
95
|
+
typeof t.release != "string" ? l && d.warn("Discarded session because of missing or non-string release") : (this.sendSession(t), y(t, { init: !1 }));
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* @inheritDoc
|
|
99
|
+
*/
|
|
100
|
+
getDsn() {
|
|
101
|
+
return this._dsn;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* @inheritDoc
|
|
105
|
+
*/
|
|
106
|
+
getOptions() {
|
|
107
|
+
return this._options;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* @see SdkMetadata in @sentry/types
|
|
111
|
+
*
|
|
112
|
+
* @return The metadata of the SDK
|
|
113
|
+
*/
|
|
114
|
+
getSdkMetadata() {
|
|
115
|
+
return this._options._metadata;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* @inheritDoc
|
|
119
|
+
*/
|
|
120
|
+
getTransport() {
|
|
121
|
+
return this._transport;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* @inheritDoc
|
|
125
|
+
*/
|
|
126
|
+
flush(t) {
|
|
127
|
+
const e = this._transport;
|
|
128
|
+
return e ? (this.metricsAggregator && this.metricsAggregator.flush(), this._isClientDoneProcessing(t).then((n) => e.flush(t).then((s) => n && s))) : L(!0);
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* @inheritDoc
|
|
132
|
+
*/
|
|
133
|
+
close(t) {
|
|
134
|
+
return this.flush(t).then((e) => (this.getOptions().enabled = !1, this.metricsAggregator && this.metricsAggregator.close(), e));
|
|
135
|
+
}
|
|
136
|
+
/** Get all installed event processors. */
|
|
137
|
+
getEventProcessors() {
|
|
138
|
+
return this._eventProcessors;
|
|
139
|
+
}
|
|
140
|
+
/** @inheritDoc */
|
|
141
|
+
addEventProcessor(t) {
|
|
142
|
+
this._eventProcessors.push(t);
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* This is an internal function to setup all integrations that should run on the client.
|
|
146
|
+
* @deprecated Use `client.init()` instead.
|
|
147
|
+
*/
|
|
148
|
+
setupIntegrations(t) {
|
|
149
|
+
(t && !this._integrationsInitialized || this._isEnabled() && !this._integrationsInitialized) && this._setupIntegrations();
|
|
150
|
+
}
|
|
151
|
+
/** @inheritdoc */
|
|
152
|
+
init() {
|
|
153
|
+
this._isEnabled() && this._setupIntegrations();
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Gets an installed integration by its `id`.
|
|
157
|
+
*
|
|
158
|
+
* @returns The installed integration or `undefined` if no integration with that `id` was installed.
|
|
159
|
+
* @deprecated Use `getIntegrationByName()` instead.
|
|
160
|
+
*/
|
|
161
|
+
getIntegrationById(t) {
|
|
162
|
+
return this.getIntegrationByName(t);
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Gets an installed integration by its name.
|
|
166
|
+
*
|
|
167
|
+
* @returns The installed integration or `undefined` if no integration with that `name` was installed.
|
|
168
|
+
*/
|
|
169
|
+
getIntegrationByName(t) {
|
|
170
|
+
return this._integrations[t];
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Returns the client's instance of the given integration class, it any.
|
|
174
|
+
* @deprecated Use `getIntegrationByName()` instead.
|
|
175
|
+
*/
|
|
176
|
+
getIntegration(t) {
|
|
177
|
+
try {
|
|
178
|
+
return this._integrations[t.id] || null;
|
|
179
|
+
} catch {
|
|
180
|
+
return l && d.warn(`Cannot retrieve integration ${t.id} from the current Client`), null;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* @inheritDoc
|
|
185
|
+
*/
|
|
186
|
+
addIntegration(t) {
|
|
187
|
+
const e = this._integrations[t.name];
|
|
188
|
+
$(this, t, this._integrations), e || P(this, [t]);
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* @inheritDoc
|
|
192
|
+
*/
|
|
193
|
+
sendEvent(t, e = {}) {
|
|
194
|
+
this.emit("beforeSendEvent", t, e);
|
|
195
|
+
let n = M(t, this._dsn, this._options._metadata, this._options.tunnel);
|
|
196
|
+
for (const r of e.attachments || [])
|
|
197
|
+
n = V(
|
|
198
|
+
n,
|
|
199
|
+
W(
|
|
200
|
+
r,
|
|
201
|
+
this._options.transportOptions && this._options.transportOptions.textEncoder
|
|
202
|
+
)
|
|
203
|
+
);
|
|
204
|
+
const s = this._sendEnvelope(n);
|
|
205
|
+
s && s.then((r) => this.emit("afterSendEvent", t, r), null);
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* @inheritDoc
|
|
209
|
+
*/
|
|
210
|
+
sendSession(t) {
|
|
211
|
+
const e = A(t, this._dsn, this._options._metadata, this._options.tunnel);
|
|
212
|
+
this._sendEnvelope(e);
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* @inheritDoc
|
|
216
|
+
*/
|
|
217
|
+
recordDroppedEvent(t, e, n) {
|
|
218
|
+
if (this._options.sendClientReports) {
|
|
219
|
+
const s = typeof n == "number" ? n : 1, r = `${t}:${e}`;
|
|
220
|
+
l && d.log(`Recording outcome: "${r}"${s > 1 ? ` (${s} times)` : ""}`), this._outcomes[r] = (this._outcomes[r] || 0) + s;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* @inheritDoc
|
|
225
|
+
*/
|
|
226
|
+
captureAggregateMetrics(t) {
|
|
227
|
+
l && d.log(`Flushing aggregated metrics, number of metrics: ${t.length}`);
|
|
228
|
+
const e = T(
|
|
229
|
+
t,
|
|
230
|
+
this._dsn,
|
|
231
|
+
this._options._metadata,
|
|
232
|
+
this._options.tunnel
|
|
233
|
+
);
|
|
234
|
+
this._sendEnvelope(e);
|
|
235
|
+
}
|
|
236
|
+
// Keep on() & emit() signatures in sync with types' client.ts interface
|
|
237
|
+
/* eslint-disable @typescript-eslint/unified-signatures */
|
|
238
|
+
/** @inheritdoc */
|
|
239
|
+
/** @inheritdoc */
|
|
240
|
+
on(t, e) {
|
|
241
|
+
this._hooks[t] || (this._hooks[t] = []), this._hooks[t].push(e);
|
|
242
|
+
}
|
|
243
|
+
/** @inheritdoc */
|
|
244
|
+
/** @inheritdoc */
|
|
245
|
+
emit(t, ...e) {
|
|
246
|
+
this._hooks[t] && this._hooks[t].forEach((n) => n(...e));
|
|
247
|
+
}
|
|
248
|
+
/* eslint-enable @typescript-eslint/unified-signatures */
|
|
249
|
+
/** Setup integrations for this client. */
|
|
250
|
+
_setupIntegrations() {
|
|
251
|
+
const { integrations: t } = this._options;
|
|
252
|
+
this._integrations = B(this, t), P(this, t), this._integrationsInitialized = !0;
|
|
253
|
+
}
|
|
254
|
+
/** Updates existing session based on the provided event */
|
|
255
|
+
_updateSessionFromEvent(t, e) {
|
|
256
|
+
let n = !1, s = !1;
|
|
257
|
+
const r = e.exception && e.exception.values;
|
|
258
|
+
if (r) {
|
|
259
|
+
s = !0;
|
|
260
|
+
for (const p of r) {
|
|
261
|
+
const h = p.mechanism;
|
|
262
|
+
if (h && h.handled === !1) {
|
|
263
|
+
n = !0;
|
|
264
|
+
break;
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
const a = t.status === "ok";
|
|
269
|
+
(a && t.errors === 0 || a && n) && (y(t, {
|
|
270
|
+
...n && { status: "crashed" },
|
|
271
|
+
errors: t.errors || Number(s || n)
|
|
272
|
+
}), this.captureSession(t));
|
|
273
|
+
}
|
|
274
|
+
/**
|
|
275
|
+
* Determine if the client is finished processing. Returns a promise because it will wait `timeout` ms before saying
|
|
276
|
+
* "no" (resolving to `false`) in order to give the client a chance to potentially finish first.
|
|
277
|
+
*
|
|
278
|
+
* @param timeout The time, in ms, after which to resolve to `false` if the client is still busy. Passing `0` (or not
|
|
279
|
+
* passing anything) will make the promise wait as long as it takes for processing to finish before resolving to
|
|
280
|
+
* `true`.
|
|
281
|
+
* @returns A promise which will resolve to `true` if processing is already done or finishes before the timeout, and
|
|
282
|
+
* `false` otherwise
|
|
283
|
+
*/
|
|
284
|
+
_isClientDoneProcessing(t) {
|
|
285
|
+
return new q((e) => {
|
|
286
|
+
let n = 0;
|
|
287
|
+
const s = 1, r = setInterval(() => {
|
|
288
|
+
this._numProcessing == 0 ? (clearInterval(r), e(!0)) : (n += s, t && n >= t && (clearInterval(r), e(!1)));
|
|
289
|
+
}, s);
|
|
290
|
+
});
|
|
291
|
+
}
|
|
292
|
+
/** Determines whether this SDK is enabled and a transport is present. */
|
|
293
|
+
_isEnabled() {
|
|
294
|
+
return this.getOptions().enabled !== !1 && this._transport !== void 0;
|
|
295
|
+
}
|
|
296
|
+
/**
|
|
297
|
+
* Adds common information to events.
|
|
298
|
+
*
|
|
299
|
+
* The information includes release and environment from `options`,
|
|
300
|
+
* breadcrumbs and context (extra, tags and user) from the scope.
|
|
301
|
+
*
|
|
302
|
+
* Information that is already present in the event is never overwritten. For
|
|
303
|
+
* nested objects, such as the context, keys are merged.
|
|
304
|
+
*
|
|
305
|
+
* @param event The original event.
|
|
306
|
+
* @param hint May contain additional information about the original exception.
|
|
307
|
+
* @param scope A scope containing event metadata.
|
|
308
|
+
* @returns A new event with more information.
|
|
309
|
+
*/
|
|
310
|
+
_prepareEvent(t, e, n, s = O()) {
|
|
311
|
+
const r = this.getOptions(), a = Object.keys(this._integrations);
|
|
312
|
+
return !e.integrations && a.length > 0 && (e.integrations = a), this.emit("preprocessEvent", t, e), F(r, t, e, n, this, s).then((i) => {
|
|
313
|
+
if (i === null)
|
|
314
|
+
return i;
|
|
315
|
+
const p = {
|
|
316
|
+
...s.getPropagationContext(),
|
|
317
|
+
...n ? n.getPropagationContext() : void 0
|
|
318
|
+
};
|
|
319
|
+
if (!(i.contexts && i.contexts.trace) && p) {
|
|
320
|
+
const { traceId: g, spanId: S, parentSpanId: E, dsc: o } = p;
|
|
321
|
+
i.contexts = {
|
|
322
|
+
trace: {
|
|
323
|
+
trace_id: g,
|
|
324
|
+
span_id: S,
|
|
325
|
+
parent_span_id: E
|
|
326
|
+
},
|
|
327
|
+
...i.contexts
|
|
328
|
+
};
|
|
329
|
+
const _ = o || N(g, this, n);
|
|
330
|
+
i.sdkProcessingMetadata = {
|
|
331
|
+
dynamicSamplingContext: _,
|
|
332
|
+
...i.sdkProcessingMetadata
|
|
333
|
+
};
|
|
334
|
+
}
|
|
335
|
+
return i;
|
|
336
|
+
});
|
|
337
|
+
}
|
|
338
|
+
/**
|
|
339
|
+
* Processes the event and logs an error in case of rejection
|
|
340
|
+
* @param event
|
|
341
|
+
* @param hint
|
|
342
|
+
* @param scope
|
|
343
|
+
*/
|
|
344
|
+
_captureEvent(t, e = {}, n) {
|
|
345
|
+
return this._processEvent(t, e, n).then(
|
|
346
|
+
(s) => s.event_id,
|
|
347
|
+
(s) => {
|
|
348
|
+
if (l) {
|
|
349
|
+
const r = s;
|
|
350
|
+
r.logLevel === "log" ? d.log(r.message) : d.warn(r);
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
);
|
|
354
|
+
}
|
|
355
|
+
/**
|
|
356
|
+
* Processes an event (either error or message) and sends it to Sentry.
|
|
357
|
+
*
|
|
358
|
+
* This also adds breadcrumbs and context information to the event. However,
|
|
359
|
+
* platform specific meta data (such as the User's IP address) must be added
|
|
360
|
+
* by the SDK implementor.
|
|
361
|
+
*
|
|
362
|
+
*
|
|
363
|
+
* @param event The event to send to Sentry.
|
|
364
|
+
* @param hint May contain additional information about the original exception.
|
|
365
|
+
* @param scope A scope containing event metadata.
|
|
366
|
+
* @returns A SyncPromise that resolves with the event or rejects in case event was/will not be send.
|
|
367
|
+
*/
|
|
368
|
+
_processEvent(t, e, n) {
|
|
369
|
+
const s = this.getOptions(), { sampleRate: r } = s, a = C(t), i = k(t), p = t.type || "error", h = `before send for type \`${p}\``;
|
|
370
|
+
if (i && typeof r == "number" && Math.random() > r)
|
|
371
|
+
return this.recordDroppedEvent("sample_rate", "error", t), G(
|
|
372
|
+
new u(
|
|
373
|
+
`Discarding event because it's not included in the random sample (sampling rate = ${r})`,
|
|
374
|
+
"log"
|
|
375
|
+
)
|
|
376
|
+
);
|
|
377
|
+
const g = p === "replay_event" ? "replay" : p, E = (t.sdkProcessingMetadata || {}).capturedSpanIsolationScope;
|
|
378
|
+
return this._prepareEvent(t, e, n, E).then((o) => {
|
|
379
|
+
if (o === null)
|
|
380
|
+
throw this.recordDroppedEvent("event_processor", g, t), new u("An event processor returned `null`, will not send event.", "log");
|
|
381
|
+
if (e.data && e.data.__sentry__ === !0)
|
|
382
|
+
return o;
|
|
383
|
+
const f = H(s, o, e);
|
|
384
|
+
return Y(f, h);
|
|
385
|
+
}).then((o) => {
|
|
386
|
+
if (o === null) {
|
|
387
|
+
if (this.recordDroppedEvent("before_send", g, t), a) {
|
|
388
|
+
const v = 1 + (t.spans || []).length;
|
|
389
|
+
this.recordDroppedEvent("before_send", "span", v);
|
|
390
|
+
}
|
|
391
|
+
throw new u(`${h} returned \`null\`, will not send event.`, "log");
|
|
392
|
+
}
|
|
393
|
+
const _ = n && n.getSession();
|
|
394
|
+
if (!a && _ && this._updateSessionFromEvent(_, o), a) {
|
|
395
|
+
const m = o.sdkProcessingMetadata && o.sdkProcessingMetadata.spanCountBeforeProcessing || 0, v = o.spans ? o.spans.length : 0, I = m - v;
|
|
396
|
+
I > 0 && this.recordDroppedEvent("before_send", "span", I);
|
|
397
|
+
}
|
|
398
|
+
const f = o.transaction_info;
|
|
399
|
+
if (a && f && o.transaction !== t.transaction) {
|
|
400
|
+
const m = "custom";
|
|
401
|
+
o.transaction_info = {
|
|
402
|
+
...f,
|
|
403
|
+
source: m
|
|
404
|
+
};
|
|
405
|
+
}
|
|
406
|
+
return this.sendEvent(o, e), o;
|
|
407
|
+
}).then(null, (o) => {
|
|
408
|
+
throw o instanceof u ? o : (this.captureException(o, {
|
|
409
|
+
data: {
|
|
410
|
+
__sentry__: !0
|
|
411
|
+
},
|
|
412
|
+
originalException: o
|
|
413
|
+
}), new u(
|
|
414
|
+
`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
|
|
415
|
+
Reason: ${o}`
|
|
416
|
+
));
|
|
417
|
+
});
|
|
418
|
+
}
|
|
419
|
+
/**
|
|
420
|
+
* Occupies the client with processing and event
|
|
421
|
+
*/
|
|
422
|
+
_process(t) {
|
|
423
|
+
this._numProcessing++, t.then(
|
|
424
|
+
(e) => (this._numProcessing--, e),
|
|
425
|
+
(e) => (this._numProcessing--, e)
|
|
426
|
+
);
|
|
427
|
+
}
|
|
428
|
+
/**
|
|
429
|
+
* @inheritdoc
|
|
430
|
+
*/
|
|
431
|
+
_sendEnvelope(t) {
|
|
432
|
+
if (this.emit("beforeEnvelope", t), this._isEnabled() && this._transport)
|
|
433
|
+
return this._transport.send(t).then(null, (e) => {
|
|
434
|
+
l && d.error("Error while sending event:", e);
|
|
435
|
+
});
|
|
436
|
+
l && d.error("Transport disabled");
|
|
437
|
+
}
|
|
438
|
+
/**
|
|
439
|
+
* Clears outcomes on this client and returns them.
|
|
440
|
+
*/
|
|
441
|
+
_clearOutcomes() {
|
|
442
|
+
const t = this._outcomes;
|
|
443
|
+
return this._outcomes = {}, Object.keys(t).map((e) => {
|
|
444
|
+
const [n, s] = e.split(":");
|
|
445
|
+
return {
|
|
446
|
+
reason: n,
|
|
447
|
+
category: s,
|
|
448
|
+
quantity: t[e]
|
|
449
|
+
};
|
|
450
|
+
});
|
|
451
|
+
}
|
|
452
|
+
/**
|
|
453
|
+
* @inheritDoc
|
|
454
|
+
*/
|
|
455
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
|
|
456
|
+
}
|
|
457
|
+
function Y(c, t) {
|
|
458
|
+
const e = `${t} must return \`null\` or a valid event.`;
|
|
459
|
+
if (U(c))
|
|
460
|
+
return c.then(
|
|
461
|
+
(n) => {
|
|
462
|
+
if (!w(n) && n !== null)
|
|
463
|
+
throw new u(e);
|
|
464
|
+
return n;
|
|
465
|
+
},
|
|
466
|
+
(n) => {
|
|
467
|
+
throw new u(`${t} rejected with ${n}`);
|
|
468
|
+
}
|
|
469
|
+
);
|
|
470
|
+
if (!w(c) && c !== null)
|
|
471
|
+
throw new u(e);
|
|
472
|
+
return c;
|
|
473
|
+
}
|
|
474
|
+
function H(c, t, e) {
|
|
475
|
+
const { beforeSend: n, beforeSendTransaction: s } = c;
|
|
476
|
+
if (k(t) && n)
|
|
477
|
+
return n(t, e);
|
|
478
|
+
if (C(t) && s) {
|
|
479
|
+
if (t.spans) {
|
|
480
|
+
const r = t.spans.length;
|
|
481
|
+
t.sdkProcessingMetadata = {
|
|
482
|
+
...t.sdkProcessingMetadata,
|
|
483
|
+
spanCountBeforeProcessing: r
|
|
484
|
+
};
|
|
485
|
+
}
|
|
486
|
+
return s(t, e);
|
|
487
|
+
}
|
|
488
|
+
return t;
|
|
489
|
+
}
|
|
490
|
+
function k(c) {
|
|
491
|
+
return c.type === void 0;
|
|
492
|
+
}
|
|
493
|
+
function C(c) {
|
|
494
|
+
return c.type === "transaction";
|
|
495
|
+
}
|
|
496
|
+
export {
|
|
497
|
+
lt as BaseClient
|
|
498
|
+
};
|
package/bind.js
ADDED
package/browser.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { isString as u } from "./is.js";
|
|
2
|
+
import { getGlobalObject as m } from "./worldwide.js";
|
|
3
|
+
const f = m(), p = 80;
|
|
4
|
+
function L(c, n = {}) {
|
|
5
|
+
if (!c)
|
|
6
|
+
return "<unknown>";
|
|
7
|
+
try {
|
|
8
|
+
let t = c;
|
|
9
|
+
const s = 5, a = [];
|
|
10
|
+
let i = 0, o = 0;
|
|
11
|
+
const h = " > ", e = h.length;
|
|
12
|
+
let r;
|
|
13
|
+
const g = Array.isArray(n) ? n : n.keyAttrs, l = !Array.isArray(n) && n.maxStringLength || p;
|
|
14
|
+
for (; t && i++ < s && (r = A(t, g), !(r === "html" || i > 1 && o + a.length * e + r.length >= l)); )
|
|
15
|
+
a.push(r), o += r.length, t = t.parentNode;
|
|
16
|
+
return a.reverse().join(h);
|
|
17
|
+
} catch {
|
|
18
|
+
return "<unknown>";
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
function A(c, n) {
|
|
22
|
+
const t = c, s = [];
|
|
23
|
+
let a, i, o, h, e;
|
|
24
|
+
if (!t || !t.tagName)
|
|
25
|
+
return "";
|
|
26
|
+
if (f.HTMLElement && t instanceof HTMLElement && t.dataset && t.dataset.sentryComponent)
|
|
27
|
+
return t.dataset.sentryComponent;
|
|
28
|
+
s.push(t.tagName.toLowerCase());
|
|
29
|
+
const r = n && n.length ? n.filter((l) => t.getAttribute(l)).map((l) => [l, t.getAttribute(l)]) : null;
|
|
30
|
+
if (r && r.length)
|
|
31
|
+
r.forEach((l) => {
|
|
32
|
+
s.push(`[${l[0]}="${l[1]}"]`);
|
|
33
|
+
});
|
|
34
|
+
else if (t.id && s.push(`#${t.id}`), a = t.className, a && u(a))
|
|
35
|
+
for (i = a.split(/\s+/), e = 0; e < i.length; e++)
|
|
36
|
+
s.push(`.${i[e]}`);
|
|
37
|
+
const g = ["aria-label", "type", "name", "title", "alt"];
|
|
38
|
+
for (e = 0; e < g.length; e++)
|
|
39
|
+
o = g[e], h = t.getAttribute(o), h && s.push(`[${o}="${h}"]`);
|
|
40
|
+
return s.join("");
|
|
41
|
+
}
|
|
42
|
+
export {
|
|
43
|
+
L as htmlTreeAsString
|
|
44
|
+
};
|
package/buildFullPath.js
ADDED
package/buildURL.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import f from "./utils6.js";
|
|
2
|
+
import d from "./AxiosURLSearchParams.js";
|
|
3
|
+
function l(e) {
|
|
4
|
+
return encodeURIComponent(e).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
|
|
5
|
+
}
|
|
6
|
+
function m(e, c, i) {
|
|
7
|
+
if (!c)
|
|
8
|
+
return e;
|
|
9
|
+
const t = i && i.encode || l;
|
|
10
|
+
f.isFunction(i) && (i = {
|
|
11
|
+
serialize: i
|
|
12
|
+
});
|
|
13
|
+
const n = i && i.serialize;
|
|
14
|
+
let r;
|
|
15
|
+
if (n ? r = n(c, i) : r = f.isURLSearchParams(c) ? c.toString() : new d(c, i).toString(t), r) {
|
|
16
|
+
const a = e.indexOf("#");
|
|
17
|
+
a !== -1 && (e = e.slice(0, a)), e += (e.indexOf("?") === -1 ? "?" : "&") + r;
|
|
18
|
+
}
|
|
19
|
+
return e;
|
|
20
|
+
}
|
|
21
|
+
export {
|
|
22
|
+
m as default
|
|
23
|
+
};
|
package/bundle.esm.js
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { useRef as f, useState as O, useEffect as h, useCallback as b, useMemo as B } from "react";
|
|
2
|
+
function k(e, t) {
|
|
3
|
+
var n = f(null), i = f(null);
|
|
4
|
+
i.current = t;
|
|
5
|
+
var r = f(null);
|
|
6
|
+
h(function() {
|
|
7
|
+
a();
|
|
8
|
+
});
|
|
9
|
+
var a = b(function() {
|
|
10
|
+
var u = r.current, d = i.current, c = u || (d ? d instanceof Element ? d : d.current : null);
|
|
11
|
+
n.current && n.current.element === c && n.current.subscriber === e || (n.current && n.current.cleanup && n.current.cleanup(), n.current = {
|
|
12
|
+
element: c,
|
|
13
|
+
subscriber: e,
|
|
14
|
+
// Only calling the subscriber, if there's an actual element to report.
|
|
15
|
+
// Setting cleanup to undefined unless a subscriber returns one, as an existing cleanup function would've been just called.
|
|
16
|
+
cleanup: c ? e(c) : void 0
|
|
17
|
+
});
|
|
18
|
+
}, [e]);
|
|
19
|
+
return h(function() {
|
|
20
|
+
return function() {
|
|
21
|
+
n.current && n.current.cleanup && (n.current.cleanup(), n.current = null);
|
|
22
|
+
};
|
|
23
|
+
}, []), b(function(u) {
|
|
24
|
+
r.current = u, a();
|
|
25
|
+
}, [a]);
|
|
26
|
+
}
|
|
27
|
+
function S(e, t, n) {
|
|
28
|
+
return e[t] ? e[t][0] ? e[t][0][n] : (
|
|
29
|
+
// TS complains about this, because the RO entry type follows the spec and does not reflect Firefox's current
|
|
30
|
+
// behaviour of returning objects instead of arrays for `borderBoxSize` and `contentBoxSize`.
|
|
31
|
+
// @ts-ignore
|
|
32
|
+
e[t][n]
|
|
33
|
+
) : t === "contentBoxSize" ? e.contentRect[n === "inlineSize" ? "width" : "height"] : void 0;
|
|
34
|
+
}
|
|
35
|
+
function H(e) {
|
|
36
|
+
e === void 0 && (e = {});
|
|
37
|
+
var t = e.onResize, n = f(void 0);
|
|
38
|
+
n.current = t;
|
|
39
|
+
var i = e.round || Math.round, r = f(), a = O({
|
|
40
|
+
width: void 0,
|
|
41
|
+
height: void 0
|
|
42
|
+
}), u = a[0], d = a[1], c = f(!1);
|
|
43
|
+
h(function() {
|
|
44
|
+
return c.current = !1, function() {
|
|
45
|
+
c.current = !0;
|
|
46
|
+
};
|
|
47
|
+
}, []);
|
|
48
|
+
var o = f({
|
|
49
|
+
width: void 0,
|
|
50
|
+
height: void 0
|
|
51
|
+
}), s = k(b(function(x) {
|
|
52
|
+
return (!r.current || r.current.box !== e.box || r.current.round !== i) && (r.current = {
|
|
53
|
+
box: e.box,
|
|
54
|
+
round: i,
|
|
55
|
+
instance: new ResizeObserver(function(E) {
|
|
56
|
+
var R = E[0], z = e.box === "border-box" ? "borderBoxSize" : e.box === "device-pixel-content-box" ? "devicePixelContentBoxSize" : "contentBoxSize", m = S(R, z, "inlineSize"), g = S(R, z, "blockSize"), l = m ? i(m) : void 0, v = g ? i(g) : void 0;
|
|
57
|
+
if (o.current.width !== l || o.current.height !== v) {
|
|
58
|
+
var w = {
|
|
59
|
+
width: l,
|
|
60
|
+
height: v
|
|
61
|
+
};
|
|
62
|
+
o.current.width = l, o.current.height = v, n.current ? n.current(w) : c.current || d(w);
|
|
63
|
+
}
|
|
64
|
+
})
|
|
65
|
+
}), r.current.instance.observe(x, {
|
|
66
|
+
box: e.box
|
|
67
|
+
}), function() {
|
|
68
|
+
r.current && r.current.instance.unobserve(x);
|
|
69
|
+
};
|
|
70
|
+
}, [e.box, i]), e.ref);
|
|
71
|
+
return B(function() {
|
|
72
|
+
return {
|
|
73
|
+
ref: s,
|
|
74
|
+
width: u.width,
|
|
75
|
+
height: u.height
|
|
76
|
+
};
|
|
77
|
+
}, [s, u.width, u.height]);
|
|
78
|
+
}
|
|
79
|
+
export {
|
|
80
|
+
H as default
|
|
81
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
function f(n, t, i = {}) {
|
|
2
|
+
if (!n || !t)
|
|
3
|
+
return;
|
|
4
|
+
const {
|
|
5
|
+
triggerOffset: o = 0,
|
|
6
|
+
containerOffset: e = 0
|
|
7
|
+
} = i, c = window.innerHeight - t.bottom - o - e, a = t.top - o - e;
|
|
8
|
+
return Math.max(a, c);
|
|
9
|
+
}
|
|
10
|
+
export {
|
|
11
|
+
f as calculateContainerMaxHeight
|
|
12
|
+
};
|