{"version":3,"file":"feeblo-sdk.umd.cjs","names":["computePosition","flip","offset","shift","getComputedStyle","EmbedErrorCtor","factory","global","exports","EmbedError","message","code","DEFAULT_MODULES","MODES","MODULES","PLACEMENTS","invalidConfig","isWidgetMode","value","isWidgetPlacement","parseMode","parsePlacement","normalizeWidgetConfig","mode","options","placement","modules","module","supportsBoardSelection","config","widgetConfigKey","VERSION","LABEL_STYLE","createLogger","args","enabled","category","banner","CONTAINER_ID","LAUNCHER_ID","FEEDBACK_ATTRIBUTE","NAMESPACE","CONTAINER_STYLES","EVENT_NAMES","isBrowser","compact","out","key","obj","emitWidgetEvent","logger","type","data","subscribe","target","event","listener","callback","name","unsubscribe","COMPANY_KEYS","normalizeCompany","result","company","normalizeUserIdentity","rest","user","id","base","companies","resolveBaseUrl","hostname","port","createIframe","iframe","baseUrl","params","hostOrigin","path","organizationId","query","initialRoute","titles","language","defaultTitle","iframeOrigin","min","max","round","floor","createCoords","v","oppositeSideMap","clamp","start","end","evaluate","param","getSide","getAlignment","getOppositeAxis","axis","getAxisLength","getSideAxis","firstChar","getAlignmentAxis","getAlignmentSides","rtl","alignment","alignmentAxis","length","mainAlignmentSide","rects","getOppositePlacement","getExpandedPlacements","oppositePlacement","getOppositeAlignmentPlacement","lrPlacement","rlPlacement","tbPlacement","btPlacement","getSideList","side","isStart","getOppositeAxisPlacements","list","direction","flipAlignment","expandPaddingObject","padding","getPaddingObject","rectToClientRect","rect","y","x","width","height","computeCoordsFromPlacement","_ref","sideAxis","alignLength","isVertical","commonX","reference","floating","commonY","commonAlign","coords","detectOverflow","state","paddingObject","element","elements","altBoundary","elementContext","clippingClientRect","platform","offsetParent","offsetScale","elementClientRect","MAX_RESET_COUNT","computePosition$1","platformWithDetectOverflow","statefulPlacement","resetCount","middlewareData","i","middleware","currentMiddleware","nextX","nextY","fn","reset","flip$1","_middlewareData$arrow","checkMainAxis","checkCrossAxis","specifiedFallbackPlacements","detectOverflowOptions","initialSideAxis","initialPlacement","isBasePlacement","fallbackPlacements","hasFallbackAxisSideDirection","fallbackAxisSideDirection","placements","overflow","overflows","overflowsData","sides","nextIndex","nextPlacement","d","resetPlacement","a","b","fallbackStrategy","currentSideAxis","acc","originSides","convertValueToCoords","mainAxisMulti","crossAxisMulti","rawValue","crossAxis","mainAxis","offset$1","diffCoords","shift$1","mainAxisCoord","crossAxisCoord","clampCoord","coord","limitedCoords","limiter","hasWindow","getNodeName","isNode","node","getWindow","_node$ownerDocument","getDocumentElement","isElement","isHTMLElement","isShadowRoot","isOverflowElement","getComputedStyle$1","overflowY","overflowX","display","isTableElement","isTopLayer","willChangeRe","containRe","isNotNone","isWebKitValue","isContainingBlock","css","elementOrCss","isWebKit","getContainingBlock","currentNode","getParentNode","isLastTraversableNode","getNodeScroll","getNearestOverflowAncestor","parentNode","getOverflowAncestors","traverseIframes","scrollableAncestor","isBody","win","frameElement","getFrameElement","getCssDimensions","hasOffset","offsetWidth","offsetHeight","shouldFallback","unwrapElement","getScale","domElement","$","noOffsets","getVisualOffsets","shouldAddVisualOffsets","isFixed","floatingOffsetParent","getBoundingClientRect","includeScale","isFixedStrategy","clientRect","scale","visualOffsets","offsetWin","currentWin","currentIFrame","iframeScale","iframeRect","left","top","getWindowScrollBarX","leftScroll","getHTMLOffset","htmlRect","documentElement","scroll","convertOffsetParentRelativeRectToViewportRelativeRect","strategy","topLayer","offsets","isOffsetParentAnElement","offsetRect","htmlOffset","getClientRects","getDocumentRect","html","body","SCROLLBAR_MAX","getViewportRect","rootBoundary","isLayoutViewport","visualViewport","layoutRelativeClientCoords","doc","bodyStyles","bodyMarginInline","reservedWidth","gutter","getInnerBoundingClientRect","getClientRectFromClippingAncestor","clippingAncestor","getClippingElementAncestors","cachedResult","cache","el","lastKeptComputedStyle","elementIsFixed","computedStyle","currentNodeIsContaining","lastPosition","ancestor","getClippingRect","clippingAncestors","boundary","firstRect","right","bottom","getDimensions","getRectRelativeToOffsetParent","isStaticPositioned","getTrueOffsetParent","polyfill","rawOffsetParent","getOffsetParent","svgOffsetParent","getElementRects","getOffsetParentFn","getDimensionsFn","floatingDimensions","isRTL","rectsAreEqual","observeMove","io","timeoutId","root","cleanup","_io","refresh","skip","threshold","elementRectForRootMargin","onMove","insetTop","insetRight","insetBottom","insetLeft","isFirstUpdate","handleObserve","ratio","entries","handleResize","ancestorResize","autoUpdate","referenceEl","ancestors","ancestorScroll","update","cleanupIo","layoutShift","reobserveFrame","resizeObserver","elementResize","firstEntry","_resizeObserver","animationFrame","frameId","prevRefRect","frameLoop","nextRefRect","_resizeObserver2","offset","shift","flip","computePosition","mergedOptions","platformWithCache","createFloatingInstance","Embed","existing","container","containerStyles","handleMessage","onError","onHeightChange","wasOpen","onClose","_token","publicIdentity","launcher","trigger","metadata","board","patch","LINK_ATTRIBUTE","LINK_EVENTS","ipv6BracketPattern","findFeebloLink","link","authenticateLink","url","hashEntries","entry","token","isLoopbackHost","normalized","isAutoLoginTargetAllowed","href","allowedOrigins","page","startLinkAuthentication","handleInteraction","eventName","METADATA_KEY_REGEX","FEEDBACK_DATASET_KEY","c","findTriggers","extractTriggerMetadata","match","bindTriggers","scanning","startTriggerScanning","stopTriggerScanning","boxedKind","isStringValue","isObjectValue","kind","resolveAutoLoginOrigins","origins","addOrigin","origin","instance","setupGlobalListeners","handleExternalMessage","msg","destroyInstance","embed","createWidgetProxy","widget","identity","noopWidget","self","init","resolvedOptions","orgIdOrConfig","normalizedConfig","nextConfigKey","getCurrentEmbed","getFeebloScript","currentScript","hasFeebloSource","script","src","getAutoConfig","globalConfig","scriptDataset","orgId","defaultBoard","locale","theme","modulesValue","debug","autoInit","autoConfig","Feeblo"],"sources":["../src/errors.ts","../src/config.ts","../src/version.ts","../src/debug.ts","../src/constants.ts","../src/utils.ts","../src/events.ts","../src/identity.ts","../src/iframe.ts","../../../node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs","../../../node_modules/@floating-ui/core/dist/floating-ui.core.mjs","../../../node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs","../../../node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs","../src/positioning.ts","../src/embed.ts","../src/links.ts","../src/triggers.ts","../src/instance.ts","../src/auto-init.ts","../src/types.ts","../src/index.ts"],"sourcesContent":["export interface EmbedErrorDetails {\n  code: string;\n  message: string;\n}\n\n/**\n * Error thrown or reported by the Feeblo SDK. Every error carries a stable\n * `code` so integrators can branch on known failure modes.\n */\nexport class EmbedError extends Error {\n  code: string;\n\n  constructor({ code, message }: EmbedErrorDetails) {\n    super(message);\n    this.code = code;\n    this.name = \"EmbedError\";\n  }\n}\n","import { EmbedError } from \"./errors\";\nimport type { WidgetMode, WidgetModule, WidgetPlacement } from \"./types\";\n\nconst DEFAULT_MODULES: WidgetModule[] = [\"feedback\", \"updates\"];\n\n// The lookup sets accept `PropertyKey` because `normalizeWidgetConfig`\n// validates values from plain-JavaScript callers: a Symbol must reach\n// `invalidConfig` as `INVALID_CONFIG` instead of throwing a coercion TypeError.\nconst MODES: ReadonlySet<PropertyKey> = new Set<WidgetMode>([\n  \"feedback\",\n  \"updates\",\n  \"help\",\n  \"hub\",\n]);\n\nconst MODULES = new Set<WidgetModule>([...DEFAULT_MODULES, \"help\"]);\n\nconst PLACEMENTS: ReadonlySet<PropertyKey> = new Set<WidgetPlacement>([\n  \"bottom-left\",\n  \"bottom-right\",\n]);\n\nexport interface NormalizedWidgetConfig {\n  mode: WidgetMode;\n  modules: WidgetModule[];\n  placement?: WidgetPlacement | undefined;\n}\n\nfunction invalidConfig(message: string): never {\n  throw new EmbedError({ code: \"INVALID_CONFIG\", message });\n}\n\nfunction isWidgetMode(value: PropertyKey): value is WidgetMode {\n  return MODES.has(value);\n}\n\nfunction isWidgetPlacement(value: PropertyKey): value is WidgetPlacement {\n  return PLACEMENTS.has(value);\n}\n\nfunction parseMode(value: PropertyKey): WidgetMode {\n  if (!isWidgetMode(value)) {\n    invalidConfig(`[feeblo-sdk] Invalid widget mode: ${String(value)}.`);\n  }\n\n  return value;\n}\n\nfunction parsePlacement(value: PropertyKey): WidgetPlacement {\n  if (!isWidgetPlacement(value)) {\n    invalidConfig(`[feeblo-sdk] Invalid widget placement: ${String(value)}.`);\n  }\n\n  return value;\n}\n\nexport function normalizeWidgetConfig(options: {\n  mode?: PropertyKey | undefined;\n  modules?: WidgetModule[] | undefined;\n  placement?: PropertyKey | undefined;\n}): NormalizedWidgetConfig {\n  const mode = parseMode(options.mode ?? \"feedback\");\n\n  const placement = options.placement\n    ? parsePlacement(options.placement)\n    : undefined;\n\n  if (mode !== \"hub\" && options.modules !== undefined) {\n    invalidConfig(\"[feeblo-sdk] `modules` can only be used with mode `hub`.\");\n  }\n\n  const modules =\n    mode === \"hub\" ? (options.modules ?? DEFAULT_MODULES) : [mode];\n\n  if (modules.length === 0) {\n    invalidConfig(\"[feeblo-sdk] Hub must enable at least one module.\");\n  }\n\n  if (modules.some((module) => !MODULES.has(module))) {\n    invalidConfig(\n      \"[feeblo-sdk] Hub modules must be `feedback`, `updates` or `help`.\"\n    );\n  }\n\n  if (new Set(modules).size !== modules.length) {\n    invalidConfig(\"[feeblo-sdk] Hub modules cannot contain duplicates.\");\n  }\n\n  return {\n    mode,\n    modules: [...modules],\n    ...(placement !== undefined && { placement }),\n  };\n}\n\n/**\n * Whether board selection is supported for this config. Board selection is\n * intentionally limited to configs whose landing module is `feedback`: the\n * landing module is `modules[0]` (the initially active module), and the widget\n * only applies board selection while the feedback module is active.\n */\nexport function supportsBoardSelection(\n  config: NormalizedWidgetConfig\n): boolean {\n  return config.modules[0] === \"feedback\";\n}\n\nexport function widgetConfigKey(config: NormalizedWidgetConfig): string {\n  return `${config.mode}:${config.modules.join(\",\")}:${config.placement ?? \"trigger\"}`;\n}\n","declare const __FEEBLO_VERSION__: string | undefined;\n\n/**\n * The installed SDK version. Automatically populated from `package.json` at\n * build time and safe to use in non-bundled (type-check) contexts.\n */\nexport const VERSION: string = __FEEBLO_VERSION__ ?? \"0.0.1\";\n","import { VERSION } from \"./version\";\n\nexport type LogCategory =\n  | \"lifecycle\"\n  | \"message\"\n  | \"positioning\"\n  | \"link\"\n  | \"trigger\"\n  | \"identity\"\n  | \"config\"\n  | \"event\";\n\nexport interface Logger {\n  readonly enabled: boolean;\n  (category: LogCategory, ...args: unknown[]): void;\n}\n\nconst LABEL_STYLE = \"color: #6b7280; font-weight: 600\";\n\n/**\n * Create a debug logger. When `enabled` is false (the default) every call is a\n * no-op, so diagnostics have zero cost in production.\n */\nexport function createLogger(enabled: boolean): Logger {\n  const log = (category: LogCategory, ...args: unknown[]): void => {\n    if (!enabled) {\n      return;\n    }\n\n    console.log(`%c[feeblo:${category}]`, LABEL_STYLE, ...args);\n  };\n\n  // SAFETY: The runtime invariant checked by the surrounding code guarantees this type.\n  return Object.assign(log, { enabled }) as Logger;\n}\n\n/**\n * Emits a one-time banner describing the running SDK. Useful when debugging an\n * embed that was auto-initialised from a script tag.\n */\nexport function banner(orgId: string, baseUrl: string): void {\n  console.info(\n    `%c[feeblo]%c SDK v${VERSION} ready`,\n    \"color: #4f46e5; font-weight: 700\",\n    \"color: inherit\",\n    { orgId, baseUrl }\n  );\n}\n","export const CONTAINER_ID = \"feeblo-embed-container\";\n\nexport const LAUNCHER_ID = \"feeblo-widget-launcher\";\n\nexport const FEEDBACK_ATTRIBUTE = \"data-feeblo-feedback\";\n\nexport const FADE_DURATION_MS = 150;\n\nexport const NAMESPACE = \"feeblo\";\n\nexport const CONTAINER_STYLES: Partial<CSSStyleDeclaration> = {\n  position: \"fixed\",\n  width: \"400px\",\n  height: \"400px\",\n  maxHeight: \"600px\",\n  margin: \"0\",\n  top: \"0\",\n  left: \"0\",\n  opacity: \"0\",\n  transition: `opacity ${FADE_DURATION_MS}ms ease-out`,\n  zIndex: \"999999\",\n  display: \"none\",\n  borderRadius: \"16px\",\n  overflow: \"hidden\",\n  boxShadow:\n    \"0 0 0 1px rgba(0, 0, 0, 0.05), 0 2px 4px rgba(0, 0, 0, 0.06), 0 12px 24px rgba(0, 0, 0, 0.08), 0 24px 48px rgba(0, 0, 0, 0.12)\",\n  border: \"none\",\n};\n\nexport const EVENT_NAMES = [\n  \"widgetReady\",\n  \"widgetOpened\",\n  \"widgetClosed\",\n  \"identityChanged\",\n  \"feedbackSubmitted\",\n] as const;\n","export function isBrowser(): boolean {\n  return \"window\" in globalThis && \"document\" in globalThis;\n}\n\n/** Non-undefined values preserved by {@link compact}; matches the identity payload space. */\nexport type CompactValue =\n  | string\n  | number\n  | boolean\n  | null\n  | readonly CompactValue[];\n\n// oxlint-disable-next-line typescript/no-unnecessary-type-parameters -- the type parameter is how this helper accepts any value without spelling `unknown`, which `anti-slop/no-unknown-parameters` bans (the established spelling is `packages/utils/src/runtime-kind.ts`); the parameter is used once by construction\nexport function compact<T extends object>(obj: T) {\n  const out: Record<string, CompactValue> = {};\n\n  for (const [key, value] of Object.entries(obj)) {\n    if (value !== undefined) {\n      out[key] = value;\n    }\n  }\n\n  return out;\n}\n","import { EVENT_NAMES, NAMESPACE } from \"./constants\";\nimport type { Logger } from \"./debug\";\nimport type {\n  FeebloEventDetail,\n  FeebloEventListener,\n  FeebloEventMap,\n  FeebloEventName,\n} from \"./types\";\nimport { isBrowser } from \"./utils\";\n\nexport function emitWidgetEvent<K extends FeebloEventName>(\n  type: K,\n  data: FeebloEventMap[K],\n  logger?: Logger\n): void {\n  if (logger?.enabled) {\n    logger(\"event\", type, data);\n  }\n\n  if (!isBrowser()) {\n    return;\n  }\n\n  window.dispatchEvent(\n    new CustomEvent<FeebloEventDetail<K>>(type, {\n      detail: { data, type, namespace: NAMESPACE },\n    })\n  );\n}\n\nexport function subscribe<E extends FeebloEventName | \"*\">(\n  event: E,\n  callback: E extends \"*\"\n    ? FeebloEventListener<FeebloEventName>\n    : FeebloEventListener<Extract<FeebloEventName, E>>\n): () => void {\n  if (!isBrowser()) {\n    return () => undefined;\n  }\n\n  // SAFETY: The upstream source guarantees one of these values; the cast bridges an untyped API.\n  const target = event as FeebloEventName | \"*\";\n  // SAFETY: The upstream contract guarantees this value here.\n  const listener = callback as EventListener;\n\n  if (target === \"*\") {\n    for (const name of EVENT_NAMES) {\n      window.addEventListener(name, listener);\n    }\n\n    return () => {\n      for (const name of EVENT_NAMES) {\n        window.removeEventListener(name, listener);\n      }\n    };\n  }\n\n  window.addEventListener(target, listener);\n\n  return () => window.removeEventListener(target, listener);\n}\n\nexport function unsubscribe<E extends FeebloEventName | \"*\">(\n  event: E,\n  callback: E extends \"*\"\n    ? FeebloEventListener<FeebloEventName>\n    : FeebloEventListener<Extract<FeebloEventName, E>>\n): void {\n  if (!isBrowser()) {\n    return;\n  }\n\n  // SAFETY: The upstream source guarantees one of these values; the cast bridges an untyped API.\n  // SAFETY: The upstream contract guarantees this value here.\n  const target = event as FeebloEventName | \"*\";\n  // SAFETY: The upstream contract guarantees this value here.\n  const listener = callback as EventListener;\n\n  if (target === \"*\") {\n    for (const name of EVENT_NAMES) {\n      window.removeEventListener(name, listener);\n    }\n\n    return;\n  }\n\n  window.removeEventListener(target, listener);\n}\n","import { EmbedError } from \"./errors\";\nimport type {\n  NormalizedUserIdentity,\n  UserIdentity,\n  WidgetCompany,\n  WidgetFieldValue,\n} from \"./types\";\n\nconst COMPANY_KEYS = [\"id\", \"name\", \"avatar\", \"customFields\"] as const;\n\nfunction normalizeCompany(\n  company: WidgetCompany\n): Pick<WidgetCompany, \"id\" | \"name\" | \"avatar\" | \"customFields\"> {\n  const result: Record<string, WidgetFieldValue> = {};\n\n  for (const key of COMPANY_KEYS) {\n    if (company[key] !== undefined) {\n      result[key] = company[key];\n    }\n  }\n\n  // SAFETY: The runtime invariant checked by the surrounding code guarantees this type.\n  return result as Pick<\n    WidgetCompany,\n    \"id\" | \"name\" | \"avatar\" | \"customFields\"\n  >;\n}\n\nexport function normalizeUserIdentity(\n  user: UserIdentity\n): NormalizedUserIdentity {\n  const { id, ...rest } = user;\n\n  if (!id) {\n    throw new EmbedError({\n      code: \"INVALID_IDENTITY\",\n      message: \"[feeblo-sdk] `id` is required to identify a widget user.\",\n    });\n  }\n\n  const base: Record<string, WidgetFieldValue> = {};\n\n  for (const key of [\n    \"email\",\n    \"name\",\n    \"avatar\",\n    \"token\",\n    \"customFields\",\n  ] as const) {\n    if (rest[key] !== undefined) {\n      base[key] = rest[key];\n    }\n  }\n\n  const companies = rest.companies?.map(normalizeCompany);\n\n  // SAFETY: The runtime invariant checked by the surrounding code guarantees this type.\n  return {\n    id,\n    ...base,\n    ...(companies && { companies }),\n  } as NormalizedUserIdentity;\n}\n","import { normalizeWidgetConfig, supportsBoardSelection } from \"./config\";\nimport type { Logger } from \"./debug\";\nimport type { EmbedOptions } from \"./types\";\n\nexport function resolveBaseUrl(options: EmbedOptions): string {\n  const hostname = window.location.hostname;\n  const port = window.location.port;\n\n  return (\n    options.baseUrl ??\n    (hostname === \"localhost\"\n      ? `http://localhost:${port || \"3001\"}`\n      : \"https://app.feeblo.com\")\n  );\n}\n\nexport function createIframe(\n  organizationId: string,\n  options: EmbedOptions,\n  logger?: Logger\n): HTMLIFrameElement {\n  const iframe = document.createElement(\"iframe\");\n  const baseUrl = resolveBaseUrl(options);\n  const params = new URLSearchParams();\n  const config = normalizeWidgetConfig(options);\n  params.set(\"mode\", config.mode);\n  params.set(\"modules\", config.modules.join(\",\"));\n\n  if (options.theme) {\n    params.set(\"theme\", options.theme);\n  }\n\n  if (options.locale) {\n    params.set(\"locale\", options.locale);\n  }\n\n  if (options.defaultBoard && supportsBoardSelection(config)) {\n    params.set(\"board\", options.defaultBoard);\n  }\n\n  // The widget targets its postMessages at the host origin. Passing it\n  // explicitly (rather than relying on document.referrer) keeps messaging\n  // working under Referrer-Policy: no-referrer hosts.\n  const hostOrigin = window.location.origin;\n\n  if (hostOrigin && hostOrigin !== \"null\") {\n    params.set(\"hostOrigin\", hostOrigin);\n  }\n\n  const path = `${baseUrl}/feedback-widget/${organizationId}`;\n  const query = params.toString();\n  const initialRoute = config.modules[0] === \"updates\" ? \"#/updates\" : \"#/\";\n  iframe.src = `${query ? `${path}?${query}` : path}${initialRoute}`;\n  iframe.style.width = \"100%\";\n  iframe.style.height = \"100%\";\n  iframe.style.border = \"none\";\n\n  interface TitleMap {\n    readonly [key: string]: Record<string, string>;\n  }\n\n  const titles: TitleMap = {\n    en: {\n      feedback: \"Feeblo feedback widget\",\n      updates: \"Feeblo updates widget\",\n      hub: \"Feeblo Hub\",\n    },\n  };\n\n  const language = options.locale?.split(\"-\")[0]?.toLowerCase() ?? \"en\";\n  let defaultTitle = \"Feeblo feedback widget\";\n\n  if (config.mode === \"hub\") {\n    defaultTitle = \"Feeblo Hub\";\n  } else if (config.mode === \"updates\") {\n    defaultTitle = \"Feeblo updates widget\";\n  }\n\n  iframe.title = titles[language]?.[config.mode] ?? defaultTitle;\n  iframe.setAttribute(\n    \"sandbox\",\n    \"allow-scripts allow-forms allow-same-origin allow-popups allow-downloads\"\n  );\n  iframe.setAttribute(\"allow\", \"clipboard-write\");\n\n  if (logger?.enabled) {\n    logger(\"config\", \"iframe\", { baseUrl, src: iframe.src });\n  }\n\n  return iframe;\n}\n\nexport function iframeOrigin(iframe: HTMLIFrameElement): string {\n  return new URL(iframe.src).origin;\n}\n","/**\n * Custom positioning reference element.\n * @see https://floating-ui.com/docs/virtual-elements\n */\n\nconst sides = ['top', 'right', 'bottom', 'left'];\nconst alignments = ['start', 'end'];\nconst placements = /*#__PURE__*/sides.reduce((acc, side) => acc.concat(side, side + \"-\" + alignments[0], side + \"-\" + alignments[1]), []);\nconst min = Math.min;\nconst max = Math.max;\nconst round = Math.round;\nconst floor = Math.floor;\nconst createCoords = v => ({\n  x: v,\n  y: v\n});\nconst oppositeSideMap = {\n  left: 'right',\n  right: 'left',\n  bottom: 'top',\n  top: 'bottom'\n};\nfunction clamp(start, value, end) {\n  return max(start, min(value, end));\n}\nfunction evaluate(value, param) {\n  return typeof value === 'function' ? value(param) : value;\n}\nfunction getSide(placement) {\n  return placement.split('-')[0];\n}\nfunction getAlignment(placement) {\n  return placement.split('-')[1];\n}\nfunction getOppositeAxis(axis) {\n  return axis === 'x' ? 'y' : 'x';\n}\nfunction getAxisLength(axis) {\n  return axis === 'y' ? 'height' : 'width';\n}\nfunction getSideAxis(placement) {\n  const firstChar = placement[0];\n  return firstChar === 't' || firstChar === 'b' ? 'y' : 'x';\n}\nfunction getAlignmentAxis(placement) {\n  return getOppositeAxis(getSideAxis(placement));\n}\nfunction getAlignmentSides(placement, rects, rtl) {\n  if (rtl === void 0) {\n    rtl = false;\n  }\n  const alignment = getAlignment(placement);\n  const alignmentAxis = getAlignmentAxis(placement);\n  const length = getAxisLength(alignmentAxis);\n  let mainAlignmentSide = alignmentAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top';\n  if (rects.reference[length] > rects.floating[length]) {\n    mainAlignmentSide = getOppositePlacement(mainAlignmentSide);\n  }\n  return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];\n}\nfunction getExpandedPlacements(placement) {\n  const oppositePlacement = getOppositePlacement(placement);\n  return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];\n}\nfunction getOppositeAlignmentPlacement(placement) {\n  return placement.includes('start') ? placement.replace('start', 'end') : placement.replace('end', 'start');\n}\nconst lrPlacement = ['left', 'right'];\nconst rlPlacement = ['right', 'left'];\nconst tbPlacement = ['top', 'bottom'];\nconst btPlacement = ['bottom', 'top'];\nfunction getSideList(side, isStart, rtl) {\n  switch (side) {\n    case 'top':\n    case 'bottom':\n      if (rtl) return isStart ? rlPlacement : lrPlacement;\n      return isStart ? lrPlacement : rlPlacement;\n    case 'left':\n    case 'right':\n      return isStart ? tbPlacement : btPlacement;\n    default:\n      return [];\n  }\n}\nfunction getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {\n  const alignment = getAlignment(placement);\n  let list = getSideList(getSide(placement), direction === 'start', rtl);\n  if (alignment) {\n    list = list.map(side => side + \"-\" + alignment);\n    if (flipAlignment) {\n      list = list.concat(list.map(getOppositeAlignmentPlacement));\n    }\n  }\n  return list;\n}\nfunction getOppositePlacement(placement) {\n  const side = getSide(placement);\n  return oppositeSideMap[side] + placement.slice(side.length);\n}\nfunction expandPaddingObject(padding) {\n  var _padding$top, _padding$right, _padding$bottom, _padding$left;\n  return {\n    top: (_padding$top = padding.top) != null ? _padding$top : 0,\n    right: (_padding$right = padding.right) != null ? _padding$right : 0,\n    bottom: (_padding$bottom = padding.bottom) != null ? _padding$bottom : 0,\n    left: (_padding$left = padding.left) != null ? _padding$left : 0\n  };\n}\nfunction getPaddingObject(padding) {\n  return typeof padding !== 'number' ? expandPaddingObject(padding) : {\n    top: padding,\n    right: padding,\n    bottom: padding,\n    left: padding\n  };\n}\nfunction rectToClientRect(rect) {\n  const {\n    x,\n    y,\n    width,\n    height\n  } = rect;\n  return {\n    width,\n    height,\n    top: y,\n    left: x,\n    right: x + width,\n    bottom: y + height,\n    x,\n    y\n  };\n}\n\nexport { alignments, clamp, createCoords, evaluate, expandPaddingObject, floor, getAlignment, getAlignmentAxis, getAlignmentSides, getAxisLength, getExpandedPlacements, getOppositeAlignmentPlacement, getOppositeAxis, getOppositeAxisPlacements, getOppositePlacement, getPaddingObject, getSide, getSideAxis, max, min, placements, rectToClientRect, round, sides };\n","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  const alignment = getAlignment(placement);\n  if (alignment) {\n    coords[alignmentAxis] += commonAlign * (alignment === 'end' ? 1 : -1) * (rtl && isVertical ? -1 : 1);\n  }\n  return coords;\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  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// Maximum number of resets that can occur before bailing to avoid infinite reset loops.\nconst MAX_RESET_COUNT = 50;\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 platformWithDetectOverflow = platform.detectOverflow ? platform : {\n    ...platform,\n    detectOverflow\n  };\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 resetCount = 0;\n  const middlewareData = {};\n  for (let i = 0; i < middleware.length; i++) {\n    const currentMiddleware = middleware[i];\n    if (!currentMiddleware) {\n      continue;\n    }\n    const {\n      name,\n      fn\n    } = currentMiddleware;\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: platformWithDetectOverflow,\n      elements: {\n        reference,\n        floating\n      }\n    });\n    x = nextX != null ? nextX : x;\n    y = nextY != null ? nextY : y;\n    middlewareData[name] = {\n      ...middlewareData[name],\n      ...data\n    };\n    if (reset && resetCount < MAX_RESET_COUNT) {\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 * 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 max = clientSize - arrowDimensions[length] - maxPadding;\n    const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;\n    const offset = clamp(minPadding, 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 < minPadding ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;\n    const alignmentOffset = shouldAddOffset ? center < minPadding ? center - minPadding : 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 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\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 overflow = await platform.detectOverflow(state, detectOverflowOptions);\n      const alignmentSides = getAlignmentSides(currentPlacement, rects, await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)));\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 initialSideAxis = getSideAxis(initialPlacement);\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      const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== 'none';\n      if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) {\n        fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));\n      }\n      const placements = [initialPlacement, ...fallbackPlacements];\n      const overflow = await platform.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          const ignoreCrossAxisOverflow = checkCrossAxis === 'alignment' ? initialSideAxis !== getSideAxis(nextPlacement) : false;\n          if (!ignoreCrossAxisOverflow ||\n          // We leave the current main axis only if every placement on that axis\n          // overflows the main axis.\n          overflowsData.every(d => getSideAxis(d.placement) === initialSideAxis ? d.overflows[0] > 0 : true)) {\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\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$filter2;\n                const placement = (_overflowsData$filter2 = overflowsData.filter(d => {\n                  if (hasFallbackAxisSideDirection) {\n                    const currentSideAxis = getSideAxis(d.placement);\n                    return currentSideAxis === initialSideAxis ||\n                    // Create a bias to the `y` side axis due to horizontal\n                    // reading directions favoring greater width.\n                    currentSideAxis === 'y';\n                  }\n                  return true;\n                }).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$filter2[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        platform\n      } = state;\n      const {\n        strategy = 'referenceHidden',\n        ...detectOverflowOptions\n      } = evaluate(options, state);\n      switch (strategy) {\n        case 'referenceHidden':\n          {\n            const overflow = await platform.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 platform.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\n      // No rects (e.g. a hidden or detached reference, or a collapsed range) —\n      // keep the existing reference rect rather than resetting to an invalid\n      // one with non-finite values.\n      if (!nativeClientRects.length) {\n        return {};\n      }\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 || clientRects[1].left > clientRects[0].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            return rectToClientRect({\n              x: left,\n              y: top,\n              width: right - left,\n              height: bottom - 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          return rectToClientRect({\n            x: minLeft,\n            y: top,\n            width: maxRight - minLeft,\n            height: bottom - 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\nconst originSides = /*#__PURE__*/new Set(['left', 'top']);\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 = originSides.has(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: rawValue.mainAxis || 0,\n    crossAxis: rawValue.crossAxis || 0,\n    alignmentAxis: rawValue.alignmentAxis\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        platform\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 platform.detectOverflow(state, detectOverflowOptions);\n      const crossAxis = getSideAxis(placement);\n      const mainAxis = getOppositeAxis(crossAxis);\n      let mainAxisCoord = coords[mainAxis];\n      let crossAxisCoord = coords[crossAxis];\n      const clampCoord = (axis, coord) => clamp(coord + overflow[axis === 'y' ? 'top' : 'left'], coord, coord - overflow[axis === 'y' ? 'bottom' : 'right']);\n      if (checkMainAxis) {\n        mainAxisCoord = clampCoord(mainAxis, mainAxisCoord);\n      }\n      if (checkCrossAxis) {\n        crossAxisCoord = clampCoord(crossAxis, crossAxisCoord);\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          enabled: {\n            [mainAxis]: checkMainAxis,\n            [crossAxis]: checkCrossAxis\n          }\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      var _rawOffset$mainAxis, _rawOffset$crossAxis;\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: (_rawOffset$mainAxis = rawOffset.mainAxis) != null ? _rawOffset$mainAxis : 0,\n        crossAxis: (_rawOffset$crossAxis = rawOffset.crossAxis) != null ? _rawOffset$crossAxis : 0\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 = originSides.has(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// Method syntax keeps callback parameters bivariant, but expressing the\n// explicit `| undefined` required by `exactOptionalPropertyTypes` needs\n// property syntax, which is contravariant under `strictFunctionTypes`.\n// Extracting the function from a method position restores that bivariance so\n// consumers can still assign callbacks with narrower parameter types.\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 platform.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 maximumClippingHeight = height - overflow.top - overflow.bottom;\n      const maximumClippingWidth = width - overflow.left - overflow.right;\n      const overflowAvailableHeight = min(height - overflow[heightSide], maximumClippingHeight);\n      const overflowAvailableWidth = min(width - overflow[widthSide], maximumClippingWidth);\n      const shiftData = state.middlewareData.shift;\n      const noShift = !shiftData;\n      let availableHeight = overflowAvailableHeight;\n      let availableWidth = overflowAvailableWidth;\n      if (shiftData != null && shiftData.enabled.x) {\n        availableWidth = maximumClippingWidth;\n      }\n      if (shiftData != null && shiftData.enabled.y) {\n        availableHeight = maximumClippingHeight;\n      }\n      if (noShift && !alignment) {\n        if (isYAxis) {\n          availableWidth = width - 2 * max(overflow.left, overflow.right);\n        } else {\n          availableHeight = height - 2 * 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","function hasWindow() {\n  return typeof window !== 'undefined';\n}\nfunction getNodeName(node) {\n  if (isNode(node)) {\n    return (node.nodeName || '').toLowerCase();\n  }\n  // Mocked nodes in testing environments may not be instances of Node. By\n  // returning `#document` an infinite loop won't occur.\n  // https://github.com/floating-ui/floating-ui/issues/2317\n  return '#document';\n}\nfunction getWindow(node) {\n  var _node$ownerDocument;\n  return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;\n}\nfunction getDocumentElement(node) {\n  var _ref;\n  return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;\n}\nfunction isNode(value) {\n  if (!hasWindow()) {\n    return false;\n  }\n  return value instanceof Node || value instanceof getWindow(value).Node;\n}\nfunction isElement(value) {\n  if (!hasWindow()) {\n    return false;\n  }\n  return value instanceof Element || value instanceof getWindow(value).Element;\n}\nfunction isHTMLElement(value) {\n  if (!hasWindow()) {\n    return false;\n  }\n  return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;\n}\nfunction isShadowRoot(value) {\n  if (!hasWindow() || typeof ShadowRoot === 'undefined') {\n    return false;\n  }\n  return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;\n}\nfunction isOverflowElement(element) {\n  const {\n    overflow,\n    overflowX,\n    overflowY,\n    display\n  } = getComputedStyle(element);\n  return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && display !== 'inline' && display !== 'contents';\n}\nfunction isTableElement(element) {\n  return /^(table|td|th)$/.test(getNodeName(element));\n}\nfunction isTopLayer(element) {\n  try {\n    if (element.matches(':popover-open')) {\n      return true;\n    }\n  } catch (_e) {\n    // no-op\n  }\n  try {\n    return element.matches(':modal');\n  } catch (_e) {\n    return false;\n  }\n}\nconst willChangeRe = /transform|translate|scale|rotate|perspective|filter/;\nconst containRe = /paint|layout|strict|content/;\nconst isNotNone = value => !!value && value !== 'none';\nlet isWebKitValue;\nfunction isContainingBlock(elementOrCss) {\n  const css = isElement(elementOrCss) ? getComputedStyle(elementOrCss) : elementOrCss;\n\n  // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n  // https://drafts.csswg.org/css-transforms-2/#individual-transforms\n  return isNotNone(css.transform) || isNotNone(css.translate) || isNotNone(css.scale) || isNotNone(css.rotate) || isNotNone(css.perspective) || !isWebKit() && (isNotNone(css.backdropFilter) || isNotNone(css.filter)) || willChangeRe.test(css.willChange || '') || containRe.test(css.contain || '');\n}\nfunction getContainingBlock(element) {\n  let currentNode = getParentNode(element);\n  while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {\n    if (isContainingBlock(currentNode)) {\n      return currentNode;\n    } else if (isTopLayer(currentNode)) {\n      return null;\n    }\n    currentNode = getParentNode(currentNode);\n  }\n  return null;\n}\nfunction isWebKit() {\n  if (isWebKitValue == null) {\n    isWebKitValue = typeof CSS !== 'undefined' && CSS.supports && CSS.supports('-webkit-backdrop-filter', 'none');\n  }\n  return isWebKitValue;\n}\nfunction isLastTraversableNode(node) {\n  return /^(html|body|#document)$/.test(getNodeName(node));\n}\nfunction getComputedStyle(element) {\n  return getWindow(element).getComputedStyle(element);\n}\nfunction getNodeScroll(element) {\n  if (isElement(element)) {\n    return {\n      scrollLeft: element.scrollLeft,\n      scrollTop: element.scrollTop\n    };\n  }\n  return {\n    scrollLeft: element.scrollX,\n    scrollTop: element.scrollY\n  };\n}\nfunction getParentNode(node) {\n  if (getNodeName(node) === 'html') {\n    return node;\n  }\n  const result =\n  // Step into the shadow DOM of the parent of a slotted node.\n  node.assignedSlot ||\n  // DOM Element detected.\n  node.parentNode ||\n  // ShadowRoot detected.\n  isShadowRoot(node) && node.host ||\n  // Fallback.\n  getDocumentElement(node);\n  return isShadowRoot(result) ? result.host : result;\n}\nfunction getNearestOverflowAncestor(node) {\n  const parentNode = getParentNode(node);\n  if (isLastTraversableNode(parentNode)) {\n    return (node.ownerDocument || node).body;\n  }\n  if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {\n    return parentNode;\n  }\n  return getNearestOverflowAncestor(parentNode);\n}\nfunction getOverflowAncestors(node, list, traverseIframes) {\n  var _node$ownerDocument2;\n  if (list === void 0) {\n    list = [];\n  }\n  if (traverseIframes === void 0) {\n    traverseIframes = true;\n  }\n  const scrollableAncestor = getNearestOverflowAncestor(node);\n  const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);\n  const win = getWindow(scrollableAncestor);\n  if (isBody) {\n    const frameElement = getFrameElement(win);\n    return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);\n  } else {\n    return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));\n  }\n}\nfunction getFrameElement(win) {\n  return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;\n}\n\nexport { getComputedStyle, getContainingBlock, getDocumentElement, getFrameElement, getNearestOverflowAncestor, getNodeName, getNodeScroll, getOverflowAncestors, getParentNode, getWindow, isContainingBlock, isElement, isHTMLElement, isLastTraversableNode, isNode, isOverflowElement, isShadowRoot, isTableElement, isTopLayer, isWebKit };\n","import { rectToClientRect, arrow as arrow$1, autoPlacement as autoPlacement$1, detectOverflow as detectOverflow$1, flip as flip$1, hide as hide$1, inline as inline$1, limitShift as limitShift$1, offset as offset$1, shift as shift$1, size as size$1, computePosition as computePosition$1 } from '@floating-ui/core';\nimport { round, createCoords, max, min, floor } from '@floating-ui/utils';\nimport { getComputedStyle as getComputedStyle$1, isHTMLElement, isElement, getWindow, isWebKit, getFrameElement, getNodeScroll, getDocumentElement, isTopLayer, getNodeName, isOverflowElement, getOverflowAncestors, getParentNode, isLastTraversableNode, isContainingBlock, isTableElement, getContainingBlock } from '@floating-ui/utils/dom';\nexport { getOverflowAncestors } from '@floating-ui/utils/dom';\n\nfunction getCssDimensions(element) {\n  const css = getComputedStyle$1(element);\n  // In testing environments, the `width` and `height` properties are empty\n  // strings for SVG elements, returning NaN. Fallback to `0` in this case.\n  let width = parseFloat(css.width) || 0;\n  let height = parseFloat(css.height) || 0;\n  const hasOffset = isHTMLElement(element);\n  const offsetWidth = hasOffset ? element.offsetWidth : width;\n  const offsetHeight = hasOffset ? element.offsetHeight : height;\n  const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;\n  if (shouldFallback) {\n    width = offsetWidth;\n    height = offsetHeight;\n  }\n  return {\n    width,\n    height,\n    $: shouldFallback\n  };\n}\n\nfunction unwrapElement(element) {\n  return !isElement(element) ? element.contextElement : element;\n}\n\nfunction getScale(element) {\n  const domElement = unwrapElement(element);\n  if (!isHTMLElement(domElement)) {\n    return createCoords(1);\n  }\n  const rect = domElement.getBoundingClientRect();\n  const {\n    width,\n    height,\n    $\n  } = getCssDimensions(domElement);\n  let x = ($ ? round(rect.width) : rect.width) / width;\n  let y = ($ ? round(rect.height) : rect.height) / height;\n\n  // 0, NaN, or Infinity should always fallback to 1.\n\n  if (!x || !Number.isFinite(x)) {\n    x = 1;\n  }\n  if (!y || !Number.isFinite(y)) {\n    y = 1;\n  }\n  return {\n    x,\n    y\n  };\n}\n\nconst noOffsets = /*#__PURE__*/createCoords(0);\nfunction getVisualOffsets(element) {\n  const win = getWindow(element);\n  if (!isWebKit() || !win.visualViewport) {\n    return noOffsets;\n  }\n  return {\n    x: win.visualViewport.offsetLeft,\n    y: win.visualViewport.offsetTop\n  };\n}\nfunction shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {\n  if (isFixed === void 0) {\n    isFixed = false;\n  }\n  return !!floatingOffsetParent && isFixed && floatingOffsetParent === getWindow(element);\n}\n\nfunction getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {\n  if (includeScale === void 0) {\n    includeScale = false;\n  }\n  if (isFixedStrategy === void 0) {\n    isFixedStrategy = false;\n  }\n  const clientRect = element.getBoundingClientRect();\n  const domElement = unwrapElement(element);\n  let scale = createCoords(1);\n  if (includeScale) {\n    if (offsetParent) {\n      if (isElement(offsetParent)) {\n        scale = getScale(offsetParent);\n      }\n    } else {\n      scale = getScale(element);\n    }\n  }\n  const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);\n  let x = (clientRect.left + visualOffsets.x) / scale.x;\n  let y = (clientRect.top + visualOffsets.y) / scale.y;\n  let width = clientRect.width / scale.x;\n  let height = clientRect.height / scale.y;\n  if (domElement && offsetParent) {\n    const win = getWindow(domElement);\n    const offsetWin = isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;\n    let currentWin = win;\n    let currentIFrame = getFrameElement(currentWin);\n    while (currentIFrame && offsetWin !== currentWin) {\n      const iframeScale = getScale(currentIFrame);\n      const iframeRect = currentIFrame.getBoundingClientRect();\n      const css = getComputedStyle$1(currentIFrame);\n      const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;\n      const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;\n      x *= iframeScale.x;\n      y *= iframeScale.y;\n      width *= iframeScale.x;\n      height *= iframeScale.y;\n      x += left;\n      y += top;\n      currentWin = getWindow(currentIFrame);\n      currentIFrame = getFrameElement(currentWin);\n    }\n  }\n  return rectToClientRect({\n    width,\n    height,\n    x,\n    y\n  });\n}\n\n// If <html> has a CSS width greater than the viewport, then this will be\n// incorrect for RTL.\nfunction getWindowScrollBarX(element, rect) {\n  const leftScroll = getNodeScroll(element).scrollLeft;\n  if (!rect) {\n    return getBoundingClientRect(getDocumentElement(element)).left + leftScroll;\n  }\n  return rect.left + leftScroll;\n}\n\nfunction getHTMLOffset(documentElement, scroll) {\n  const htmlRect = documentElement.getBoundingClientRect();\n  const x = htmlRect.left + scroll.scrollLeft - getWindowScrollBarX(documentElement, htmlRect);\n  const y = htmlRect.top + scroll.scrollTop;\n  return {\n    x,\n    y\n  };\n}\n\nfunction convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {\n  let {\n    elements,\n    rect,\n    offsetParent,\n    strategy\n  } = _ref;\n  const isFixed = strategy === 'fixed';\n  const documentElement = getDocumentElement(offsetParent);\n  const topLayer = elements ? isTopLayer(elements.floating) : false;\n  if (offsetParent === documentElement || topLayer && isFixed) {\n    return rect;\n  }\n  let scroll = {\n    scrollLeft: 0,\n    scrollTop: 0\n  };\n  let scale = createCoords(1);\n  const offsets = createCoords(0);\n  const isOffsetParentAnElement = isHTMLElement(offsetParent);\n  if (isOffsetParentAnElement || !isFixed) {\n    if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {\n      scroll = getNodeScroll(offsetParent);\n    }\n    if (isOffsetParentAnElement) {\n      const offsetRect = getBoundingClientRect(offsetParent);\n      scale = getScale(offsetParent);\n      offsets.x = offsetRect.x + offsetParent.clientLeft;\n      offsets.y = offsetRect.y + offsetParent.clientTop;\n    }\n  }\n  const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);\n  return {\n    width: rect.width * scale.x,\n    height: rect.height * scale.y,\n    x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x,\n    y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y\n  };\n}\n\nfunction getClientRects(element) {\n  return element.getClientRects ? Array.from(element.getClientRects()) : [];\n}\n\n// Gets the entire size of the scrollable document area, even extending outside\n// of the `<html>` and `<body>` rect bounds if horizontally scrollable.\nfunction getDocumentRect(html) {\n  const scroll = getNodeScroll(html);\n  const body = html.ownerDocument.body;\n  const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);\n  const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);\n  let x = -scroll.scrollLeft + getWindowScrollBarX(html);\n  const y = -scroll.scrollTop;\n  if (getComputedStyle$1(body).direction === 'rtl') {\n    x += max(html.clientWidth, body.clientWidth) - width;\n  }\n  return {\n    width,\n    height,\n    x,\n    y\n  };\n}\n\n// Safety check: ensure the scrollbar space is reasonable in case this\n// calculation is affected by unusual styles.\n// Most scrollbars leave 15-18px of space.\nconst SCROLLBAR_MAX = 25;\nfunction getViewportRect(element, strategy, rootBoundary) {\n  if (rootBoundary === void 0) {\n    rootBoundary = 'viewport';\n  }\n  const isLayoutViewport = rootBoundary === 'layoutViewport';\n  const win = getWindow(element);\n  const html = getDocumentElement(element);\n  const visualViewport = win.visualViewport;\n  let width = html.clientWidth;\n  let height = html.clientHeight;\n  let x = 0;\n  let y = 0;\n  if (visualViewport) {\n    // Client coordinates are relative to the layout viewport, except in\n    // WebKit with an `absolute` strategy, where they are relative to the\n    // visual viewport.\n    const layoutRelativeClientCoords = !isWebKit() || strategy === 'fixed';\n    if (isLayoutViewport) {\n      if (!layoutRelativeClientCoords) {\n        x = -visualViewport.offsetLeft;\n        y = -visualViewport.offsetTop;\n      }\n    } else {\n      width = visualViewport.width;\n      height = visualViewport.height;\n      if (layoutRelativeClientCoords) {\n        x = visualViewport.offsetLeft;\n        y = visualViewport.offsetTop;\n      }\n    }\n  }\n  const windowScrollbarX = getWindowScrollBarX(html);\n  // `scrollbar-gutter: stable` on the <html> reserves gutter space that shrinks\n  // the visual width but isn't reflected in `html.clientWidth`, so subtract it.\n  // Only the inline-end (right) gutter can hold the scrollbar; `both-edges` also\n  // reserves an empty inline-start gutter that clips nothing, so exclude just\n  // the one scrollbar-side gutter — halve the measured (two-gutter) total. A\n  // left-side scrollbar (`windowScrollbarX > 0`) is already handled by\n  // `getHTMLOffset`/`visualViewport.width`; skip it here.\n  if (windowScrollbarX <= 0) {\n    const doc = html.ownerDocument;\n    const body = doc.body;\n    const bodyStyles = getComputedStyle(body);\n    const bodyMarginInline = doc.compatMode === 'CSS1Compat' ? parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight) || 0 : 0;\n    const reservedWidth = Math.abs(html.clientWidth - body.clientWidth - bodyMarginInline);\n    const gutter = getComputedStyle(html).scrollbarGutter === 'stable both-edges' ? reservedWidth / 2 : reservedWidth;\n    if (gutter <= SCROLLBAR_MAX) {\n      width -= gutter;\n    }\n  }\n  return {\n    width,\n    height,\n    x,\n    y\n  };\n}\n\n// Returns the inner client rect, subtracting scrollbars if present.\nfunction getInnerBoundingClientRect(element, strategy) {\n  const clientRect = getBoundingClientRect(element, true, strategy === 'fixed');\n  const top = clientRect.top + element.clientTop;\n  const left = clientRect.left + element.clientLeft;\n  const scale = getScale(element);\n  const width = element.clientWidth * scale.x;\n  const height = element.clientHeight * scale.y;\n  const x = left * scale.x;\n  const y = top * scale.y;\n  return {\n    width,\n    height,\n    x,\n    y\n  };\n}\nfunction getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {\n  let rect;\n  if (clippingAncestor === 'viewport' || clippingAncestor === 'layoutViewport') {\n    rect = getViewportRect(element, strategy, clippingAncestor);\n  } else if (clippingAncestor === 'document') {\n    rect = getDocumentRect(getDocumentElement(element));\n  } else if (isElement(clippingAncestor)) {\n    rect = getInnerBoundingClientRect(clippingAncestor, strategy);\n  } else {\n    const visualOffsets = getVisualOffsets(element);\n    rect = {\n      x: clippingAncestor.x - visualOffsets.x,\n      y: clippingAncestor.y - visualOffsets.y,\n      width: clippingAncestor.width,\n      height: clippingAncestor.height\n    };\n  }\n  return rectToClientRect(rect);\n}\n\n// A \"clipping ancestor\" is an `overflow` element with the characteristic of\n// clipping (or hiding) child elements. This returns all clipping ancestors\n// of the given element up the tree.\nfunction getClippingElementAncestors(element, cache) {\n  const cachedResult = cache.get(element);\n  if (cachedResult) {\n    return cachedResult;\n  }\n  let result = getOverflowAncestors(element, [], false).filter(el => isElement(el) && getNodeName(el) !== 'body');\n  let lastKeptComputedStyle = null;\n  const elementIsFixed = getComputedStyle$1(element).position === 'fixed';\n  let currentNode = elementIsFixed ? getParentNode(element) : element;\n\n  // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n  while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {\n    const computedStyle = getComputedStyle$1(currentNode);\n    const currentNodeIsContaining = isContainingBlock(currentNode);\n    // Position of the containing block chain below the current node. A fixed\n    // element whose containing block hasn't been found yet is a fixed chain.\n    const lastPosition = lastKeptComputedStyle ? lastKeptComputedStyle.position : elementIsFixed ? 'fixed' : '';\n\n    // A non-containing ancestor does not clip the element when the chain\n    // below it escapes it: a fixed chain escapes all ancestors up to the\n    // next containing block, an absolute chain escapes static ancestors.\n    const shouldDropCurrentNode = !currentNodeIsContaining && (lastPosition === 'fixed' || lastPosition === 'absolute' && computedStyle.position === 'static');\n    if (shouldDropCurrentNode) {\n      // Drop non-containing blocks.\n      result = result.filter(ancestor => ancestor !== currentNode);\n    } else {\n      // The kept node carries the chain position for the next iteration.\n      lastKeptComputedStyle = computedStyle;\n    }\n    currentNode = getParentNode(currentNode);\n  }\n  cache.set(element, result);\n  return result;\n}\n\n// Gets the maximum area that the element is visible in due to any number of\n// clipping ancestors.\nfunction getClippingRect(_ref) {\n  let {\n    element,\n    boundary,\n    rootBoundary,\n    strategy\n  } = _ref;\n  const elementClippingAncestors = boundary === 'clippingAncestors' ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary);\n  const clippingAncestors = [...elementClippingAncestors, rootBoundary];\n  const firstRect = getClientRectFromClippingAncestor(element, clippingAncestors[0], strategy);\n  let top = firstRect.top;\n  let right = firstRect.right;\n  let bottom = firstRect.bottom;\n  let left = firstRect.left;\n  for (let i = 1; i < clippingAncestors.length; i++) {\n    const rect = getClientRectFromClippingAncestor(element, clippingAncestors[i], strategy);\n    top = max(rect.top, top);\n    right = min(rect.right, right);\n    bottom = min(rect.bottom, bottom);\n    left = max(rect.left, left);\n  }\n  return {\n    width: right - left,\n    height: bottom - top,\n    x: left,\n    y: top\n  };\n}\n\nfunction getDimensions(element) {\n  const {\n    width,\n    height\n  } = getCssDimensions(element);\n  return {\n    width,\n    height\n  };\n}\n\nfunction getRectRelativeToOffsetParent(element, offsetParent, strategy) {\n  const isOffsetParentAnElement = isHTMLElement(offsetParent);\n  const documentElement = getDocumentElement(offsetParent);\n  const isFixed = strategy === 'fixed';\n  const rect = getBoundingClientRect(element, true, isFixed, offsetParent);\n  let scroll = {\n    scrollLeft: 0,\n    scrollTop: 0\n  };\n  const offsets = createCoords(0);\n  if (isOffsetParentAnElement || !isFixed) {\n    if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {\n      scroll = getNodeScroll(offsetParent);\n    }\n    if (isOffsetParentAnElement) {\n      const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);\n      offsets.x = offsetRect.x + offsetParent.clientLeft;\n      offsets.y = offsetRect.y + offsetParent.clientTop;\n    }\n  }\n\n  // If the <body> scrollbar appears on the left (e.g. RTL systems). Use\n  // Firefox with layout.scrollbar.side = 3 in about:config to test this.\n  if (!isOffsetParentAnElement && documentElement) {\n    offsets.x = getWindowScrollBarX(documentElement);\n  }\n  const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);\n  const x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x;\n  const y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y;\n  return {\n    x,\n    y,\n    width: rect.width,\n    height: rect.height\n  };\n}\n\nfunction isStaticPositioned(element) {\n  return getComputedStyle$1(element).position === 'static';\n}\n\nfunction getTrueOffsetParent(element, polyfill) {\n  if (!isHTMLElement(element) || getComputedStyle$1(element).position === 'fixed') {\n    return null;\n  }\n  if (polyfill) {\n    return polyfill(element);\n  }\n  let rawOffsetParent = element.offsetParent;\n\n  // Firefox returns the <html> element as the offsetParent if it's non-static,\n  // while Chrome and Safari return the <body> element. The <body> element must\n  // be used to perform the correct calculations even if the <html> element is\n  // non-static.\n  if (getDocumentElement(element) === rawOffsetParent) {\n    rawOffsetParent = rawOffsetParent.ownerDocument.body;\n  }\n  return rawOffsetParent;\n}\n\n// Gets the closest ancestor positioned element. Handles some edge cases,\n// such as table ancestors and cross browser bugs.\nfunction getOffsetParent(element, polyfill) {\n  const win = getWindow(element);\n  if (isTopLayer(element)) {\n    return win;\n  }\n  if (!isHTMLElement(element)) {\n    let svgOffsetParent = getParentNode(element);\n    while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) {\n      if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) {\n        return svgOffsetParent;\n      }\n      svgOffsetParent = getParentNode(svgOffsetParent);\n    }\n    return win;\n  }\n  let offsetParent = getTrueOffsetParent(element, polyfill);\n  while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) {\n    offsetParent = getTrueOffsetParent(offsetParent, polyfill);\n  }\n  if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) {\n    return win;\n  }\n  return offsetParent || getContainingBlock(element) || win;\n}\n\nconst getElementRects = async function (data) {\n  const getOffsetParentFn = this.getOffsetParent || getOffsetParent;\n  const getDimensionsFn = this.getDimensions;\n  const floatingDimensions = await getDimensionsFn(data.floating);\n  return {\n    reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),\n    floating: {\n      x: 0,\n      y: 0,\n      width: floatingDimensions.width,\n      height: floatingDimensions.height\n    }\n  };\n};\n\nfunction isRTL(element) {\n  return getComputedStyle$1(element).direction === 'rtl';\n}\n\nconst platform = {\n  convertOffsetParentRelativeRectToViewportRelativeRect,\n  getDocumentElement,\n  getClippingRect,\n  getOffsetParent,\n  getElementRects,\n  getClientRects,\n  getDimensions,\n  getScale,\n  isElement,\n  isRTL\n};\n\nfunction rectsAreEqual(a, b) {\n  return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;\n}\n\n// https://samthor.au/2021/observing-dom/\nfunction observeMove(element, onMove, ancestorResize) {\n  let io = null;\n  let timeoutId;\n  const root = getDocumentElement(element);\n  function cleanup() {\n    var _io;\n    clearTimeout(timeoutId);\n    (_io = io) == null || _io.disconnect();\n    io = null;\n  }\n  function refresh(skip, threshold) {\n    if (skip === void 0) {\n      skip = false;\n    }\n    if (threshold === void 0) {\n      threshold = 1;\n    }\n    cleanup();\n    const elementRectForRootMargin = element.getBoundingClientRect();\n    const {\n      left,\n      top,\n      width,\n      height\n    } = elementRectForRootMargin;\n    if (!skip) {\n      onMove();\n    }\n    if (!width || !height) {\n      return;\n    }\n    const insetTop = floor(top);\n    const insetRight = floor(root.clientWidth - (left + width));\n    const insetBottom = floor(root.clientHeight - (top + height));\n    const insetLeft = floor(left);\n    const rootMargin = -insetTop + \"px \" + -insetRight + \"px \" + -insetBottom + \"px \" + -insetLeft + \"px\";\n    const options = {\n      rootMargin,\n      threshold: max(0, min(1, threshold)) || 1\n    };\n    let isFirstUpdate = true;\n    function handleObserve(entries) {\n      const ratio = entries[0].intersectionRatio;\n\n      // The entry is a snapshot, so the reference may have moved since the\n      // intersection was computed (under performance constraints, or between\n      // consecutive frames of a multi-frame layout shift). The reported ratio\n      // and the observed area are stale in that case and cannot be trusted to\n      // detect subsequent movement, so refresh regardless of the ratio.\n      if (!rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) {\n        return refresh();\n      }\n      if (ratio !== threshold) {\n        if (!isFirstUpdate) {\n          return refresh();\n        }\n        if (!ratio) {\n          // If the reference is clipped in place, the ratio is 0. Throttle\n          // the refresh to prevent an infinite loop of updates.\n          timeoutId = setTimeout(() => {\n            refresh(false, 1e-7);\n          }, 1000);\n        } else {\n          refresh(false, ratio);\n        }\n      }\n      isFirstUpdate = false;\n    }\n\n    // Older browsers don't support a `document` as the root and will throw an\n    // error.\n    try {\n      io = new IntersectionObserver(handleObserve, {\n        ...options,\n        // Handle <iframe>s\n        root: root.ownerDocument\n      });\n    } catch (_e) {\n      io = new IntersectionObserver(handleObserve, options);\n    }\n    io.observe(element);\n  }\n  const win = getWindow(element);\n  // The window is a resize ancestor, so when `ancestorResize` is enabled its\n  // listener already runs the update on resize. Here we only need to rebuild\n  // the `IntersectionObserver` for the new root size, skipping a redundant\n  // update. When `ancestorResize` is disabled, this becomes the sole update.\n  const handleResize = () => refresh(ancestorResize);\n  win.addEventListener('resize', handleResize);\n  refresh(true);\n  return () => {\n    win.removeEventListener('resize', handleResize);\n    cleanup();\n  };\n}\n\n/**\n * Automatically updates the position of the floating element when necessary.\n * Should only be called when the floating element is mounted on the DOM or\n * visible on the screen.\n * @returns cleanup function that should be invoked when the floating element is\n * removed from the DOM or hidden from the screen.\n * @see https://floating-ui.com/docs/autoUpdate\n */\nfunction autoUpdate(reference, floating, update, options) {\n  if (options === void 0) {\n    options = {};\n  }\n  const {\n    ancestorScroll = true,\n    ancestorResize = true,\n    elementResize = typeof ResizeObserver === 'function',\n    layoutShift = typeof IntersectionObserver === 'function',\n    animationFrame = false\n  } = options;\n  const referenceEl = unwrapElement(reference);\n  const ancestors = ancestorScroll || ancestorResize ? [...(referenceEl ? getOverflowAncestors(referenceEl) : []), ...(floating ? getOverflowAncestors(floating) : [])] : [];\n  ancestors.forEach(ancestor => {\n    ancestorScroll && ancestor.addEventListener('scroll', update);\n    ancestorResize && ancestor.addEventListener('resize', update);\n  });\n  const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update, ancestorResize) : null;\n  let reobserveFrame = -1;\n  let resizeObserver = null;\n  if (elementResize) {\n    resizeObserver = new ResizeObserver(_ref => {\n      let [firstEntry] = _ref;\n      if (firstEntry && firstEntry.target === referenceEl && resizeObserver && floating) {\n        // Prevent update loops when using the `size` middleware.\n        // https://github.com/floating-ui/floating-ui/issues/1740\n        resizeObserver.unobserve(floating);\n        cancelAnimationFrame(reobserveFrame);\n        reobserveFrame = requestAnimationFrame(() => {\n          var _resizeObserver;\n          (_resizeObserver = resizeObserver) == null || _resizeObserver.observe(floating);\n        });\n      }\n      update();\n    });\n    if (referenceEl && !animationFrame) {\n      resizeObserver.observe(referenceEl);\n    }\n    if (floating) {\n      resizeObserver.observe(floating);\n    }\n  }\n  let frameId;\n  let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;\n  if (animationFrame) {\n    frameLoop();\n  }\n  function frameLoop() {\n    const nextRefRect = getBoundingClientRect(reference);\n    if (prevRefRect && !rectsAreEqual(prevRefRect, nextRefRect)) {\n      update();\n    }\n    prevRefRect = nextRefRect;\n    frameId = requestAnimationFrame(frameLoop);\n  }\n  update();\n  return () => {\n    var _resizeObserver2;\n    ancestors.forEach(ancestor => {\n      ancestorScroll && ancestor.removeEventListener('scroll', update);\n      ancestorResize && ancestor.removeEventListener('resize', update);\n    });\n    cleanupIo == null || cleanupIo();\n    (_resizeObserver2 = resizeObserver) == null || _resizeObserver2.disconnect();\n    resizeObserver = null;\n    if (animationFrame) {\n      cancelAnimationFrame(frameId);\n    }\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 */\nconst detectOverflow = detectOverflow$1;\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 = offset$1;\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 = autoPlacement$1;\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 = shift$1;\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 = flip$1;\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 = size$1;\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 = hide$1;\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 = arrow$1;\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 = inline$1;\n\n/**\n * Built-in `limiter` that will stop `shift()` at a certain point.\n */\nconst limitShift = limitShift$1;\n\n/**\n * Computes the `x` and `y` coordinates that will place the floating element\n * next to a given reference element.\n */\nconst computePosition = (reference, floating, options) => {\n  // This caches the expensive `getClippingElementAncestors` function so that\n  // multiple lifecycle resets re-use the same result. It only lives for a\n  // single call. If other functions become expensive, we can add them as well.\n  const cache = new Map();\n  const mergedOptions = options != null ? options : {};\n  const platformWithCache = {\n    ...platform,\n    ...mergedOptions.platform,\n    _c: cache\n  };\n  return computePosition$1(reference, floating, {\n    ...mergedOptions,\n    platform: platformWithCache\n  });\n};\n\nexport { arrow, autoPlacement, autoUpdate, computePosition, detectOverflow, flip, hide, inline, limitShift, offset, platform, shift, size };\n","import {\n  autoUpdate,\n  computePosition,\n  flip,\n  offset,\n  shift,\n} from \"@floating-ui/dom\";\n\nimport type { Logger } from \"./debug\";\n\nexport function createFloatingInstance(\n  reference: HTMLElement,\n  floating: HTMLElement,\n  logger?: Logger\n): () => void {\n  return autoUpdate(reference, floating, () => {\n    void computePosition(reference, floating, {\n      placement: \"bottom\",\n      middleware: [offset(10), flip({ padding: 8 }), shift({ padding: 8 })],\n    }).then(({ x, y }) => {\n      if (logger?.enabled) {\n        logger(\"positioning\", { x, y });\n      }\n\n      Object.assign(floating.style, {\n        left: `${x}px`,\n        top: `${y}px`,\n      });\n    });\n  });\n}\n","import {\n  type NormalizedWidgetConfig,\n  supportsBoardSelection,\n  widgetConfigKey,\n} from \"./config\";\nimport {\n  CONTAINER_ID,\n  CONTAINER_STYLES,\n  FADE_DURATION_MS,\n  LAUNCHER_ID,\n} from \"./constants\";\nimport { createLogger, type Logger } from \"./debug\";\nimport { EmbedError as EmbedErrorCtor } from \"./errors\";\nimport { emitWidgetEvent } from \"./events\";\nimport { normalizeUserIdentity } from \"./identity\";\nimport { createIframe, iframeOrigin } from \"./iframe\";\nimport { createFloatingInstance } from \"./positioning\";\nimport type {\n  EmbedOptions,\n  IncomingMessage,\n  NormalizedUserIdentity,\n  OutgoingMessage,\n  UserIdentity,\n  WidgetModule,\n} from \"./types\";\nimport { compact } from \"./utils\";\n\ntype CleanupContainer = HTMLDivElement & { _feebloCleanup?: () => void };\n\nexport class Embed {\n  options: EmbedOptions;\n  container: HTMLDivElement;\n  organizationId: string;\n  private readonly iframe: HTMLIFrameElement;\n  private readonly launcher: HTMLButtonElement | null;\n  private readonly config: NormalizedWidgetConfig;\n  readonly logger: Logger;\n  private identity: NormalizedUserIdentity | null;\n  private isLoaded = false;\n  private isOpen = false;\n  private openAcknowledged = false;\n  private module: WidgetModule;\n  private board: string | null;\n  private context: Record<string, string> = {};\n  private cleanupPositioning: (() => void) | null = null;\n  private currentTrigger: HTMLElement | null = null;\n  private escHandler: ((e: KeyboardEvent) => void) | null = null;\n  private outsideClickHandler: ((e: MouseEvent) => void) | null = null;\n\n  constructor(\n    organizationId: string,\n    options: EmbedOptions,\n    config: NormalizedWidgetConfig\n  ) {\n    this.organizationId = organizationId;\n    this.options = options;\n    this.config = config;\n    this.logger = createLogger(options.debug === true);\n    this.identity = options.user ? normalizeUserIdentity(options.user) : null;\n    this.module = config.modules[0] ?? \"feedback\";\n    this.board = supportsBoardSelection(config)\n      ? (options.defaultBoard ?? null)\n      : null;\n    this.iframe = createIframe(organizationId, options, this.logger);\n    this.container = this.createContainer();\n    this.launcher = this.createLauncher();\n\n    if (this.logger.enabled) {\n      this.logger(\"lifecycle\", \"construct\", { organizationId });\n    }\n  }\n\n  private createContainer(): HTMLDivElement {\n    const { root, containerStyles, onError, onHeightChange, onClose } =\n      this.options;\n\n    // SAFETY: The runtime invariant checked by the surrounding code guarantees this type.\n    const existing = document.getElementById(\n      CONTAINER_ID\n    ) as CleanupContainer | null;\n\n    existing?._feebloCleanup?.();\n    existing?.remove();\n\n    const container = document.createElement(\"div\");\n    container.id = CONTAINER_ID;\n    Object.assign(container.style, CONTAINER_STYLES, containerStyles);\n\n    if (this.config.placement) {\n      container.style.top = \"auto\";\n      container.style.bottom = \"84px\";\n      container.style.maxWidth = \"calc(100vw - 32px)\";\n      container.style.maxHeight = \"min(600px, calc(100vh - 108px))\";\n      container.style[\n        this.config.placement === \"bottom-left\" ? \"left\" : \"right\"\n      ] = \"20px\";\n      container.style[\n        this.config.placement === \"bottom-left\" ? \"right\" : \"left\"\n      ] = \"auto\";\n    }\n\n    container.appendChild(this.iframe);\n\n    const handleMessage = (event: MessageEvent<unknown>) => {\n      if (event.origin !== iframeOrigin(this.iframe)) {\n        return;\n      }\n\n      // SAFETY: The runtime invariant checked by the surrounding code guarantees this type.\n      const message = event.data as IncomingMessage;\n\n      if (this.logger.enabled) {\n        this.logger(\n          \"message\",\n          \"in\",\n          // SAFETY: The endpoint/API contract guarantees this response shape.\n          message?.event,\n          // SAFETY: The endpoint/API contract guarantees this response shape.\n          (message as { data?: unknown } | undefined)?.data\n        );\n      }\n\n      switch (message?.event) {\n        case \"ERROR\":\n          onError?.(\n            new EmbedErrorCtor({\n              code: message.data?.code ?? \"\",\n              message: message.data?.message ?? \"\",\n            })\n          );\n          break;\n        case \"PAGE_HEIGHT\": {\n          const height = message.data?.height;\n\n          if (height !== undefined && height > 80) {\n            container.style.height = `${height}px`;\n            onHeightChange?.(height);\n          }\n\n          break;\n        }\n\n        case \"CLOSE\": {\n          const wasOpen = this.isOpen;\n          this.close();\n\n          if (wasOpen) {\n            onClose?.();\n          }\n\n          break;\n        }\n\n        case \"READY\":\n          this.markReady();\n\n          if (this.isOpen && !this.openAcknowledged) {\n            // A SHOW sent before the widget finished loading may have been\n            // lost; re-send it so the widget confirms WIDGET_OPENED and the\n            // host can emit widgetOpened.\n            this.post({ event: \"SHOW\" });\n          }\n\n          break;\n        case \"WIDGET_OPENED\":\n          if (!this.isOpen || this.openAcknowledged) {\n            break;\n          }\n\n          this.openAcknowledged = true;\n          emitWidgetEvent(\"widgetOpened\", message.data, this.logger);\n          break;\n        case \"IDENTITY_CHANGED\":\n          // SAFETY: The runtime invariant checked by the surrounding code guarantees this type.\n          if (message.data) {\n            // SAFETY: The upstream contract guarantees this value here.\n            const { token: _token, ...publicIdentity } =\n              message.data as UserIdentity;\n\n            emitWidgetEvent(\"identityChanged\", publicIdentity, this.logger);\n          }\n\n          break;\n        case \"FEEDBACK_SUBMITTED\":\n          emitWidgetEvent(\"feedbackSubmitted\", message.data?.post, this.logger);\n          break;\n        default:\n          break;\n      }\n    };\n\n    this.iframe.addEventListener(\n      \"load\",\n      () => {\n        if (!this.isLoaded) {\n          this.markReady();\n        }\n      },\n      { once: true }\n      // SAFETY: The runtime invariant checked by the surrounding code guarantees this type.\n    );\n\n    // SAFETY: The runtime invariant checked by the surrounding code guarantees this type.\n\n    window.addEventListener(\"message\", handleMessage);\n    // SAFETY: The upstream contract guarantees this value here.\n    (container as CleanupContainer)._feebloCleanup = () => {\n      window.removeEventListener(\"message\", handleMessage);\n    };\n\n    (root ?? document.body).appendChild(container);\n\n    return container;\n  }\n\n  private createLauncher(): HTMLButtonElement | null {\n    if (!this.config.placement) {\n      return null;\n    }\n\n    document.getElementById(LAUNCHER_ID)?.remove();\n    const launcher = document.createElement(\"button\");\n    launcher.id = LAUNCHER_ID;\n    launcher.type = \"button\";\n    launcher.setAttribute(\"aria-label\", \"Open Feeblo widget\");\n    launcher.setAttribute(\"aria-expanded\", \"false\");\n    Object.assign(launcher.style, {\n      alignItems: \"center\",\n      background: \"#171717\",\n      border: \"1px solid rgba(255,255,255,.12)\",\n      borderRadius: \"999px\",\n      bottom: \"20px\",\n      boxShadow: \"0 8px 28px rgba(0,0,0,.22)\",\n      color: \"white\",\n      cursor: \"pointer\",\n      display: \"flex\",\n      height: \"48px\",\n      justifyContent: \"center\",\n      padding: \"0\",\n      position: \"fixed\",\n      width: \"48px\",\n      zIndex: \"999999\",\n      [this.config.placement === \"bottom-left\" ? \"left\" : \"right\"]: \"20px\",\n    });\n    launcher.innerHTML =\n      '<svg aria-hidden=\"true\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M5 5.75h14v9.5H9.25L5 18.75v-13Z\" stroke=\"currentColor\" stroke-width=\"1.75\" stroke-linejoin=\"round\"/><path d=\"M8.5 9h7M8.5 12h4.5\" stroke=\"currentColor\" stroke-width=\"1.75\" stroke-linecap=\"round\"/></svg>';\n    launcher.addEventListener(\"click\", () => {\n      if (this.isOpen) {\n        this.close();\n      } else {\n        this.open();\n      }\n    });\n    (this.options.root ?? document.body).appendChild(launcher);\n\n    return launcher;\n  }\n\n  private markReady(): void {\n    if (this.isLoaded) {\n      // The widget (re)loaded; re-assert state in case the load-time flush\n      // raced with the widget's message subscription.\n      this.syncState();\n\n      return;\n    }\n\n    this.isLoaded = true;\n    this.syncState();\n    emitWidgetEvent(\"widgetReady\", undefined, this.logger);\n  }\n\n  private syncState(): void {\n    this.sendIdentify();\n    this.sendContext();\n    this.sendLocale();\n    this.syncNavigation();\n  }\n\n  private post(message: OutgoingMessage): void {\n    this.iframe.contentWindow?.postMessage(message, iframeOrigin(this.iframe));\n\n    if (this.logger.enabled) {\n      // SAFETY: The endpoint/API contract guarantees this response shape.\n      this.logger(\n        \"message\",\n        \"out\",\n        message.event,\n        (message as { data?: unknown }).data\n      );\n    }\n  }\n\n  open(trigger?: HTMLElement, metadata: Record<string, string> = {}): void {\n    if (trigger && this.config.modules.includes(\"feedback\")) {\n      this.module = \"feedback\";\n    }\n\n    this.context = { ...this.context, ...metadata };\n\n    if (metadata.board) {\n      this.board = metadata.board;\n    }\n\n    if (trigger || metadata.board) {\n      this.syncNavigation();\n    }\n\n    this.sendContext();\n\n    if (this.isOpen) {\n      return;\n    }\n\n    this.isOpen = true;\n    this.launcher?.setAttribute(\"aria-expanded\", \"true\");\n    this.launcher?.setAttribute(\"aria-label\", \"Close Feeblo widget\");\n    this.currentTrigger = trigger ?? null;\n    this.container.style.display = \"\";\n\n    if (trigger) {\n      this.cleanupPositioning = createFloatingInstance(\n        trigger,\n        this.container,\n        this.logger\n      );\n    }\n\n    this.addCloseListeners();\n    this.openAcknowledged = false;\n\n    requestAnimationFrame(() => {\n      this.container.style.opacity = \"1\";\n    });\n    this.post({ event: \"SHOW\" });\n  }\n\n  close(): void {\n    if (!this.isOpen) {\n      return;\n    }\n\n    this.removeCloseListeners();\n    this.cleanupPositioning?.();\n    this.cleanupPositioning = null;\n    this.currentTrigger = null;\n    this.container.style.opacity = \"0\";\n    this.isOpen = false;\n    this.launcher?.setAttribute(\"aria-expanded\", \"false\");\n    this.launcher?.setAttribute(\"aria-label\", \"Open Feeblo widget\");\n\n    setTimeout(() => {\n      if (!this.isOpen) {\n        this.container.style.display = \"none\";\n      }\n    }, FADE_DURATION_MS);\n    this.post({ event: \"HIDE\" });\n    emitWidgetEvent(\"widgetClosed\", undefined, this.logger);\n  }\n\n  setBoard(board: string): void {\n    if (!supportsBoardSelection(this.config)) {\n      return;\n    }\n\n    this.board = board;\n    this.syncNavigation();\n  }\n\n  openModule(module: WidgetModule): void {\n    if (!this.config.modules.includes(module)) {\n      return;\n    }\n\n    this.module = module;\n    this.syncNavigation();\n    this.open();\n  }\n\n  private syncNavigation(): void {\n    if (!this.isLoaded) {\n      return;\n    }\n\n    this.post({ event: \"SET_MODULE\", data: { module: this.module } });\n\n    if (this.module === \"feedback\" && this.board) {\n      this.post({ event: \"SET_BOARD\", data: { board: this.board } });\n    }\n  }\n\n  getConfigKey(): string {\n    return widgetConfigKey(this.config);\n  }\n\n  metadata(patch: Record<string, string | null>): void {\n    for (const [key, value] of Object.entries(patch)) {\n      if (value === null) {\n        delete this.context[key];\n      } else {\n        this.context[key] = value;\n      }\n    }\n\n    this.sendContext();\n  }\n\n  private sendContext(): void {\n    if (this.isLoaded) {\n      this.post({ event: \"SET_CONTEXT\", data: this.context });\n    }\n  }\n\n  private sendLocale(): void {\n    if (this.isLoaded && this.options.locale) {\n      this.post({ event: \"SET_LOCALE\", data: { locale: this.options.locale } });\n    }\n  }\n\n  identify(user: UserIdentity): void {\n    this.identity = normalizeUserIdentity(user);\n\n    if (this.logger.enabled) {\n      this.logger(\"identity\", this.identity.id);\n    }\n\n    if (this.isLoaded) {\n      this.sendIdentify();\n    }\n  }\n\n  isOpenState(): boolean {\n    return this.isOpen;\n  }\n\n  getAutoLoginToken(): string | undefined {\n    return this.identity?.token;\n  }\n\n  private sendIdentify(): void {\n    if (!this.identity) {\n      return;\n    }\n\n    this.post({\n      event: \"IDENTIFY\",\n      data: compact(this.identity),\n    });\n  }\n\n  private addCloseListeners(): void {\n    this.escHandler = (e: KeyboardEvent) => {\n      // SAFETY: The event target is the expected DOM element type for this handler.\n      if (e.key === \"Escape\") {\n        this.close();\n        // SAFETY: The runtime invariant checked by the surrounding code guarantees this type.\n      }\n    };\n\n    // SAFETY: The event target is the expected DOM element type for this handler.\n    this.outsideClickHandler = (e: MouseEvent) => {\n      // SAFETY: The event target is the expected DOM element type for this handler.\n      const target = e.target as HTMLElement;\n\n      if (\n        (this.currentTrigger || this.launcher) &&\n        !this.container.contains(target) &&\n        !this.currentTrigger?.contains(target) &&\n        !this.launcher?.contains(target)\n      ) {\n        this.close();\n      }\n    };\n\n    document.addEventListener(\"keydown\", this.escHandler);\n    document.addEventListener(\"click\", this.outsideClickHandler, {\n      capture: true,\n    });\n  }\n\n  private removeCloseListeners(): void {\n    if (this.escHandler) {\n      document.removeEventListener(\"keydown\", this.escHandler);\n      this.escHandler = null;\n    }\n\n    if (this.outsideClickHandler) {\n      document.removeEventListener(\"click\", this.outsideClickHandler, {\n        capture: true,\n      });\n      this.outsideClickHandler = null;\n    }\n  }\n\n  // SAFETY: The runtime invariant checked by the surrounding code guarantees this type.\n\n  destroy(): void {\n    // SAFETY: The runtime invariant checked by the surrounding code guarantees this type.\n    this.removeCloseListeners();\n    this.cleanupPositioning?.();\n    // SAFETY: The runtime invariant checked by the surrounding code guarantees this type.\n    this.cleanupPositioning = null;\n\n    // SAFETY: The runtime invariant checked by the surrounding code guarantees this type.\n\n    const container = document.getElementById(\n      CONTAINER_ID\n    ) as CleanupContainer | null;\n\n    container?._feebloCleanup?.();\n    container?.remove();\n    this.launcher?.remove();\n\n    if (this.logger.enabled) {\n      this.logger(\"lifecycle\", \"destroy\");\n    }\n  }\n}\n","import type { Logger } from \"./debug\";\n\nexport const LINK_ATTRIBUTE = \"data-feeblo-link\";\n\ntype LinkTarget = {\n  getAutoLoginToken: () => string | undefined;\n};\n\nconst LINK_EVENTS = [\"mousedown\", \"click\", \"contextmenu\", \"focusin\"] as const;\n\n/** The brackets an IPv6 literal keeps when a `URL` renders it as a host. */\nconst ipv6BracketPattern = /^\\[|\\]$/g;\n\nfunction findFeebloLink(target: EventTarget | null): HTMLAnchorElement | null {\n  if (!(target instanceof Element)) {\n    return null;\n  }\n\n  const link = target.closest<HTMLAnchorElement>(`a[${LINK_ATTRIBUTE}]`);\n\n  return link?.isConnected ? link : null;\n}\n\nexport function authenticateLink(link: HTMLAnchorElement, token: string): void {\n  const url = new URL(link.href, window.location.href);\n\n  if (url.protocol !== \"http:\" && url.protocol !== \"https:\") {\n    return;\n  }\n\n  // Put the SSO token in the URL fragment instead of the query string: the\n  // fragment is never sent to the server and never appears in the Referer\n  // header, so it cannot leak through access logs, proxies, or analytics. The\n  // public board reads and strips it before rendering. Any fragment already\n  // present on the link (e.g. a deep-link anchor) is preserved alongside the\n  // token.\n  url.searchParams.delete(\"ssoToken\");\n\n  const hashEntries = url.hash\n    .slice(1)\n    .split(\"&\")\n    .filter((entry) => entry && !new URLSearchParams(entry).has(\"ssoToken\"));\n\n  hashEntries.push(`ssoToken=${encodeURIComponent(token)}`);\n  url.hash = hashEntries.join(\"&\");\n  link.href = url.toString();\n}\n\n/**\n * Hosts where plain HTTP may carry the token: local development only. HTTPS\n * is required everywhere else because the fragment token is a bearer\n * credential that a network observer could otherwise replay.\n */\nconst isLoopbackHost = (hostname: string): boolean => {\n  const normalized = hostname.toLowerCase().replace(ipv6BracketPattern, \"\");\n\n  return (\n    normalized === \"localhost\" ||\n    normalized.endsWith(\".localhost\") ||\n    normalized === \"127.0.0.1\" ||\n    normalized === \"::1\"\n  );\n};\n\n/**\n * Limits which link hosts may receive the SSO token. The SSO token is a\n * bearer credential, so an injected `<a data-feeblo-link href=\"https://evil\">`\n * must not be able to exfiltrate it. Allowed targets are the page origin, the\n * configured widget base URL origin, explicitly listed `autoLoginOrigins`,\n * and subdomains of the embedding page (the common\n * `yourdomain.com` -> `feedback.yourdomain.com` board layout).\n *\n * Plain HTTP is only accepted for loopback hosts; every other target must be\n * HTTPS, including origins supplied through `baseUrl` or `autoLoginOrigins`.\n */\nexport function isAutoLoginTargetAllowed(\n  href: string,\n  allowedOrigins: readonly string[]\n): boolean {\n  try {\n    const url = new URL(href, window.location.href);\n\n    if (url.protocol !== \"http:\" && url.protocol !== \"https:\") {\n      return false;\n    }\n\n    if (url.protocol === \"http:\" && !isLoopbackHost(url.hostname)) {\n      return false;\n    }\n\n    if (allowedOrigins.includes(url.origin)) {\n      return true;\n    }\n\n    const page = new URL(window.location.href);\n\n    return (\n      url.hostname !== \"\" &&\n      url.protocol === page.protocol &&\n      url.port === page.port &&\n      (url.hostname === page.hostname ||\n        url.hostname.endsWith(`.${page.hostname}`))\n    );\n  } catch {\n    return false;\n  }\n}\n\nexport function startLinkAuthentication(\n  target: LinkTarget,\n  logger?: Logger,\n  options?: { readonly allowedOrigins?: readonly string[] | undefined }\n): () => void {\n  const allowedOrigins = options?.allowedOrigins ?? [window.location.origin];\n\n  const handleInteraction = (event: Event) => {\n    const link = findFeebloLink(event.target);\n    const token = target.getAutoLoginToken();\n\n    if (!(link && token)) {\n      return;\n    }\n\n    if (!isAutoLoginTargetAllowed(link.href, allowedOrigins)) {\n      if (logger?.enabled) {\n        logger(\"link\", \"blocked\", { origin: link.origin });\n      }\n\n      return;\n    }\n\n    authenticateLink(link, token);\n\n    if (logger?.enabled) {\n      logger(\"link\", \"authenticated\", { href: link.href });\n    }\n  };\n\n  for (const eventName of LINK_EVENTS) {\n    document.addEventListener(eventName, handleInteraction, true);\n  }\n\n  return () => {\n    for (const eventName of LINK_EVENTS) {\n      document.removeEventListener(eventName, handleInteraction, true);\n    }\n  };\n}\n","import { FEEDBACK_ATTRIBUTE } from \"./constants\";\nimport type { Logger } from \"./debug\";\n\nconst METADATA_KEY_REGEX = /^feeblo([A-Z]\\w*)$/;\n\nconst FEEDBACK_DATASET_KEY = FEEDBACK_ATTRIBUTE.replace(/^data-/, \"\").replace(\n  /-([a-z])/g,\n  (_, c) => c.toUpperCase()\n);\n\n/**\n * The subset of an embed the trigger scanner needs. Mirrors the void-returning\n * methods on {@link Embed} so the scanner stays decoupled from the widget proxy.\n */\nexport interface TriggerTarget {\n  open: (trigger?: HTMLElement, metadata?: Record<string, string>) => void;\n  setBoard: (board: string) => void;\n}\n\nfunction findTriggers(): HTMLElement[] {\n  return Array.from(\n    document.querySelectorAll<HTMLElement>(`[${FEEDBACK_ATTRIBUTE}]`)\n  );\n}\n\nexport function extractTriggerMetadata(element: HTMLElement) {\n  const metadata: Record<string, string> = {};\n\n  for (const key of Object.keys(element.dataset)) {\n    if (key === FEEDBACK_DATASET_KEY) {\n      continue;\n    }\n\n    const match = key.match(METADATA_KEY_REGEX);\n\n    if (match?.[1]) {\n      const name = match[1].charAt(0).toLowerCase() + match[1].slice(1);\n      const value = element.dataset[key];\n\n      if (value !== undefined) {\n        metadata[name] = value;\n      }\n    }\n  }\n\n  return metadata;\n}\n\nexport function bindTriggers(target: TriggerTarget, logger?: Logger): void {\n  for (const trigger of findTriggers()) {\n    if (trigger.dataset.feebloBound === \"true\") {\n      continue;\n    }\n\n    trigger.dataset.feebloBound = \"true\";\n\n    if (logger?.enabled) {\n      logger(\"trigger\", \"bound\", trigger);\n    }\n\n    const handleClick = (event: MouseEvent) => {\n      event.preventDefault();\n      event.stopPropagation();\n      const metadata = extractTriggerMetadata(trigger);\n\n      if (logger?.enabled) {\n        logger(\"trigger\", \"click\", metadata);\n      }\n\n      if (metadata.board) {\n        target.setBoard(metadata.board);\n      }\n\n      target.open(trigger, metadata);\n    };\n\n    trigger.addEventListener(\"click\", handleClick, { passive: false });\n  }\n}\n\n/** The scan timer while one is running; only the two functions below touch it. */\ntype TriggerScanSession = { interval: ReturnType<typeof setInterval> | null };\n\nconst scanning: TriggerScanSession = {\n  interval: null,\n};\n\nexport function startTriggerScanning(\n  target: TriggerTarget,\n  logger?: Logger\n): void {\n  if (scanning.interval !== null) {\n    return;\n  }\n\n  scanning.interval = setInterval(() => bindTriggers(target, logger), 1000);\n  bindTriggers(target, logger);\n}\n\nexport function stopTriggerScanning(): void {\n  if (scanning.interval !== null) {\n    clearInterval(scanning.interval);\n    scanning.interval = null;\n  }\n}\n","import { normalizeWidgetConfig, widgetConfigKey } from \"./config\";\nimport { banner } from \"./debug\";\nimport { Embed } from \"./embed\";\nimport { EmbedError } from \"./errors\";\nimport { resolveBaseUrl } from \"./iframe\";\nimport { startLinkAuthentication } from \"./links\";\nimport { startTriggerScanning, stopTriggerScanning } from \"./triggers\";\nimport type {\n  EmbedOptions,\n  ExternalMessageData,\n  FeebloWidget,\n  InitConfig,\n  OrganizationId,\n} from \"./types\";\nimport { isBrowser } from \"./utils\";\n\n/** Boxed-prototype classification for untrusted runtime values (no `typeof`). */\n// oxlint-disable-next-line typescript/no-unnecessary-type-parameters -- the type parameter is how this helper accepts any value without spelling `unknown`, which `anti-slop/no-unknown-parameters` bans (the established spelling is `packages/utils/src/runtime-kind.ts`); the parameter is used once by construction\nconst boxedKind = <T>(value: T): string | null => {\n  if (value === null || value === undefined) return null;\n\n  // SAFETY: Object.getPrototypeOf always returns an object or null; every\n  // prototype carries a constructor whose name identifies the built-in.\n  const prototype = Object.getPrototypeOf(Object(value)) as {\n    constructor?: { name?: string };\n  } | null;\n\n  return prototype?.constructor?.name ?? null;\n};\n\nconst isStringValue = <T>(value: T): value is T & string =>\n  boxedKind(value) === \"String\";\n\n// oxlint-disable-next-line typescript/no-unnecessary-type-parameters -- the type parameter is how this helper accepts any value without spelling `unknown`, which `anti-slop/no-unknown-parameters` bans (the established spelling is `packages/utils/src/runtime-kind.ts`); the parameter is used once by construction\nconst isObjectValue = <T>(value: T): boolean => {\n  const kind = boxedKind(value);\n\n  return (\n    kind !== null &&\n    kind !== \"String\" &&\n    kind !== \"Number\" &&\n    kind !== \"Boolean\" &&\n    kind !== \"Symbol\" &&\n    kind !== \"BigInt\" &&\n    kind !== \"Function\"\n  );\n};\n\n/**\n * Origins whose `data-feeblo-link` anchors may receive the SSO token: the\n * embedding page origin, the configured widget host, and any explicitly\n * configured `autoLoginOrigins` (for customer feedback domains). Anything\n * else is refused so injected links cannot exfiltrate the token.\n */\nfunction resolveAutoLoginOrigins(options: EmbedOptions): string[] {\n  const origins = new Set<string>();\n\n  const addOrigin = (value: string) => {\n    try {\n      const origin = new URL(value, window.location.href).origin;\n\n      if (origin !== \"null\") {\n        origins.add(origin);\n      }\n    } catch {\n      // Ignore malformed configuration values.\n    }\n  };\n\n  addOrigin(window.location.origin);\n  addOrigin(resolveBaseUrl(options));\n\n  for (const origin of options.autoLoginOrigins ?? []) {\n    addOrigin(origin);\n  }\n\n  return [...origins];\n}\n\n/**\n * The widget this module owns and the cleanups its listeners installed. One\n * record, written only by the functions below: an embed, the origin it was\n * initialized for, and the two teardown hooks that must run with it.\n */\ntype WidgetInstance = {\n  embed: Embed | null;\n  globalCleanup: (() => void) | null;\n  linkCleanup: (() => void) | null;\n  orgId: string | null;\n};\n\nconst instance: WidgetInstance = {\n  embed: null,\n  globalCleanup: null,\n  linkCleanup: null,\n  orgId: null,\n};\n\nfunction setupGlobalListeners(): void {\n  if (instance.globalCleanup) {\n    return;\n  }\n\n  const handleExternalMessage = (e: MessageEvent<unknown>) => {\n    // SAFETY: the message contract is established by the guards below (object\n    // value, FeebloWidget target, non-empty data) before any field is read.\n    const msg = e.data as ExternalMessageData;\n\n    if (\n      !msg ||\n      !isObjectValue(msg) ||\n      msg.target !== \"FeebloWidget\" ||\n      !msg.data\n    ) {\n      return;\n    }\n\n    if (msg.data.action === \"openFeedbackWidget\" && instance.embed) {\n      if (msg.data.setBoard) {\n        instance.embed.setBoard(msg.data.setBoard);\n      }\n\n      instance.embed.openModule(\"feedback\");\n\n      if (!instance.embed.isOpenState()) {\n        instance.embed.open();\n      }\n    }\n  };\n\n  window.addEventListener(\"message\", handleExternalMessage);\n\n  instance.globalCleanup = () => {\n    window.removeEventListener(\"message\", handleExternalMessage);\n    instance.globalCleanup = null;\n  };\n}\n\n/**\n * Tear down an embed and, when it is the active singleton, release the shared\n * trigger scanner and global message listener.\n */\nexport function destroyInstance(embed: Embed | null): void {\n  if (!embed) {\n    return;\n  }\n\n  embed.destroy();\n\n  if (instance.embed === embed) {\n    stopTriggerScanning();\n    instance.linkCleanup?.();\n    instance.linkCleanup = null;\n    instance.globalCleanup?.();\n    instance.embed = null;\n    instance.orgId = null;\n  }\n}\n\nfunction createWidgetProxy(embed: Embed): FeebloWidget {\n  const widget: FeebloWidget = {\n    identify: (identity) => {\n      embed.identify(identity);\n\n      return widget;\n    },\n    setBoard: (board) => {\n      embed.setBoard(board);\n\n      return widget;\n    },\n    metadata: (patch) => {\n      embed.metadata(patch);\n\n      return widget;\n    },\n    isOpen: () => embed.isOpenState(),\n    open: (trigger, metadata) => {\n      embed.open(trigger, metadata);\n\n      return widget;\n    },\n    openModule: (module) => {\n      embed.openModule(module);\n\n      return widget;\n    },\n    close: () => {\n      embed.close();\n\n      return widget;\n    },\n    destroy: () => {\n      destroyInstance(embed);\n    },\n  };\n\n  return widget;\n}\n\nfunction noopWidget(): FeebloWidget {\n  const self: FeebloWidget = {\n    identify: () => self,\n    setBoard: () => self,\n    metadata: () => self,\n    open: () => self,\n    openModule: () => self,\n    close: () => self,\n    destroy: () => undefined,\n    isOpen: () => false,\n  };\n\n  return self;\n}\n\n/**\n * Initialise the Feeblo feedback widget for an organization.\n *\n * @example\n * feeblo.init(\"org_123\", { user: { id: \"u_1\" } });\n * @example\n * feeblo.init({ organizationId: \"org_123\", theme: \"dark\", debug: true });\n */\nexport function init(\n  organizationId: string | OrganizationId,\n  options?: EmbedOptions\n): FeebloWidget;\nexport function init(config: InitConfig): FeebloWidget;\n// oxlint-disable-next-line anti-slop-martinfowler/mysterious-name -- `feeblo.init(...)` is the published entry point (embed snippet, README, host script tags), so its name is the package's public shape, not a description of this function.\nexport function init(\n  orgIdOrConfig: (string | OrganizationId) | InitConfig,\n  options: EmbedOptions = {}\n): FeebloWidget {\n  let organizationId: string;\n  let resolvedOptions: EmbedOptions = options;\n\n  if (isStringValue(orgIdOrConfig)) {\n    organizationId = orgIdOrConfig;\n  } else {\n    const { organizationId: id, ...rest } = orgIdOrConfig;\n    // SAFETY: the union branch above established that orgIdOrConfig is the\n    // InitConfig shape, whose organizationId is a string.\n    organizationId = id as string;\n    resolvedOptions = rest;\n  }\n\n  if (!isStringValue(organizationId) || organizationId.length === 0) {\n    throw new EmbedError({\n      code: \"INVALID_ORG\",\n      message:\n        \"[feeblo-sdk] `organizationId` is required. Pass the id shown under Settings → Widget → Installation.\",\n    });\n  }\n\n  if (!isBrowser()) {\n    return noopWidget();\n  }\n\n  const normalizedConfig = normalizeWidgetConfig(resolvedOptions);\n  const nextConfigKey = widgetConfigKey(normalizedConfig);\n\n  if (\n    instance.embed &&\n    instance.orgId === organizationId &&\n    instance.embed.getConfigKey() === nextConfigKey\n  ) {\n    if (resolvedOptions.user) {\n      instance.embed.identify(resolvedOptions.user);\n    }\n\n    return createWidgetProxy(instance.embed);\n  }\n\n  if (instance.embed) {\n    destroyInstance(instance.embed);\n  }\n\n  const embed = new Embed(organizationId, resolvedOptions, normalizedConfig);\n  instance.embed = embed;\n  instance.orgId = organizationId;\n\n  setupGlobalListeners();\n  startTriggerScanning(embed, embed.logger);\n  instance.linkCleanup = startLinkAuthentication(embed, embed.logger, {\n    allowedOrigins: resolveAutoLoginOrigins(resolvedOptions),\n  });\n\n  if (embed.logger.enabled) {\n    banner(organizationId, resolveBaseUrl(resolvedOptions));\n  }\n\n  return createWidgetProxy(embed);\n}\n\nexport function getCurrentEmbed(): Embed | null {\n  return instance.embed;\n}\n","import { init } from \"./instance\";\nimport type { EmbedOptions } from \"./types\";\nimport { isBrowser } from \"./utils\";\n\ninterface GlobalAutoConfig {\n  baseUrl?: string | undefined;\n  debug?: boolean | undefined;\n  defaultBoard?: string | undefined;\n  locale?: string | undefined;\n  mode?: EmbedOptions[\"mode\"];\n  modules?: EmbedOptions[\"modules\"];\n  organizationId?: string | undefined;\n  orgId?: string | undefined;\n  placement?: EmbedOptions[\"placement\"];\n  theme?: string | undefined;\n}\n\nfunction getFeebloScript(): HTMLScriptElement | null {\n  // SAFETY: currentScript is a script element whenever the SDK runs as a script.\n  const currentScript = document.currentScript as HTMLScriptElement | null;\n\n  if (currentScript && hasFeebloSource(currentScript.src)) {\n    return currentScript;\n  }\n\n  for (const script of document.getElementsByTagName(\"script\")) {\n    if (hasFeebloSource(script.src)) {\n      return script;\n    }\n  }\n\n  return null;\n}\n\nfunction hasFeebloSource(src: string): boolean {\n  return src.includes(\"feeblo-sdk\") || src.includes(\"feeblo\");\n}\n\nfunction getAutoConfig(): { orgId: string; options: EmbedOptions } | null {\n  // SAFETY: auto-init probes for a global config the host page opted into by\n  // embedding the bootstrap snippet; the intersection only narrows the known\n  // Window shape.\n  const globalConfig = (window as Window & { feebloConfig?: GlobalAutoConfig })\n    .feebloConfig;\n\n  const script = getFeebloScript();\n  const scriptDataset = script?.dataset ?? {};\n\n  const orgId =\n    globalConfig?.orgId ??\n    globalConfig?.organizationId ??\n    scriptDataset.feebloOrg ??\n    scriptDataset.feebloOrganizationId;\n\n  if (!orgId) {\n    return null;\n  }\n\n  const baseUrl = globalConfig?.baseUrl ?? scriptDataset.feebloBaseUrl;\n\n  const defaultBoard =\n    globalConfig?.defaultBoard ?? scriptDataset.feebloDefaultBoard;\n\n  const locale = globalConfig?.locale ?? scriptDataset.feebloLocale;\n  const theme = globalConfig?.theme ?? scriptDataset.feebloTheme;\n  const mode = globalConfig?.mode ?? scriptDataset.feebloMode;\n  const placement = globalConfig?.placement ?? scriptDataset.feebloPlacement;\n  const modulesValue = scriptDataset.feebloModules;\n\n  // SAFETY: the parsed module list is one of the supported EmbedOptions modules.\n  const modules =\n    globalConfig?.modules ??\n    (modulesValue\n      ? (modulesValue\n          .split(\",\")\n          .map((value) => value.trim())\n          .filter((value) => value.length > 0) as EmbedOptions[\"modules\"])\n      : undefined);\n\n  const debug = globalConfig?.debug ?? scriptDataset.feebloDebug === \"true\";\n\n  const options: EmbedOptions = {};\n\n  if (baseUrl) {\n    options.baseUrl = baseUrl;\n  }\n\n  if (theme) {\n    options.theme = theme;\n  }\n\n  if (defaultBoard) {\n    options.defaultBoard = defaultBoard;\n  }\n\n  if (locale) {\n    options.locale = locale;\n  }\n\n  // SAFETY: The runtime invariant checked by the surrounding code guarantees this type.\n  if (mode) {\n    // SAFETY: The upstream contract guarantees this value here.\n    options.mode = mode as EmbedOptions[\"mode\"];\n  }\n\n  if (modules) {\n    options.modules = modules;\n    // SAFETY: The runtime invariant checked by the surrounding code guarantees this type.\n  }\n\n  if (placement) {\n    // SAFETY: The upstream contract guarantees this value here.\n    options.placement = placement as EmbedOptions[\"placement\"];\n  }\n\n  if (debug) {\n    options.debug = true;\n  }\n\n  return { orgId, options };\n}\n\n/**\n * Auto-initialise the widget from `window.feebloConfig` or the SDK script tag's\n * `data-feeblo-*` attributes. Runs once on load.\n */\nexport function autoInit(): void {\n  if (!isBrowser()) {\n    return;\n  }\n\n  const autoConfig = getAutoConfig();\n\n  if (autoConfig) {\n    init(autoConfig.orgId, autoConfig.options);\n  }\n}\n\nautoInit();\n","// ---------------------------------------------------------------------------\n// Public types\n// ---------------------------------------------------------------------------\n\nimport type { EmbedError } from \"./errors\";\n\n/**\n * Branded identifier for a Feeblo organization. Use {@link organizationId} to\n * create one from a raw string. Plain strings remain accepted everywhere for\n * ergonomics; the brand exists for integrators who want to distinguish widget\n * IDs from arbitrary strings at type-check time.\n */\nexport type OrganizationId = string & {\n  readonly __feebloOrganizationId: unique symbol;\n};\n\n/** JSON-like value space of widget identity custom fields. */\nexport type WidgetFieldValue =\n  | string\n  | number\n  | boolean\n  | null\n  | readonly WidgetFieldValue[]\n  | { readonly [key: string]: WidgetFieldValue };\n\nexport interface WidgetCompany {\n  avatar?: string | undefined;\n  customFields?: Record<string, WidgetFieldValue> | undefined;\n  id: string;\n  name: string;\n}\n\nexport interface UserIdentity {\n  avatar?: string | undefined;\n  companies?: WidgetCompany[] | undefined;\n  customFields?: Record<string, WidgetFieldValue> | undefined;\n  email?: string | undefined;\n  id: string;\n  name?: string | undefined;\n  token?: string | undefined;\n}\n\nexport type PublicUserIdentity = Omit<UserIdentity, \"token\">;\n\nexport interface NormalizedUserIdentity {\n  avatar?: string | undefined;\n  companies?: WidgetCompany[] | undefined;\n  customFields?: Record<string, WidgetFieldValue> | undefined;\n  email?: string | undefined;\n  id: string;\n  name?: string | undefined;\n  token?: string | undefined;\n}\n\nexport interface SubmittedFeedback {\n  boardId: string;\n  boardName: string;\n  metadata?: Record<string, string> | undefined;\n  title: string;\n}\n\n/**\n * The widget surfaces, plus `hub` for a launcher that shows several of them.\n *\n * `help` renders the workspace's published help center. A workspace whose help\n * center is not published answers `enabled: false`, and the widget hides the tab\n * rather than showing an empty surface.\n */\nexport type WidgetMode = \"feedback\" | \"updates\" | \"help\" | \"hub\";\n\nexport type WidgetModule = Exclude<WidgetMode, \"hub\">;\n\nexport type WidgetPlacement = \"bottom-left\" | \"bottom-right\";\n\nexport interface EmbedOptions {\n  /**\n   * Extra origins whose `data-feeblo-link` anchors may receive the SSO token.\n   * The widget host origin and the embedding page origin are always allowed;\n   * list a custom feedback domain here so tokens are never attached to links\n   * pointing at an attacker-controlled host.\n   */\n  autoLoginOrigins?: readonly string[] | undefined;\n  baseUrl?: string | undefined;\n  containerStyles?: Partial<CSSStyleDeclaration> | undefined;\n  debug?: boolean | undefined;\n  defaultBoard?: string | undefined;\n  locale?: string | undefined;\n  mode?: WidgetMode | undefined;\n  modules?: WidgetModule[] | undefined;\n  onClose?: (() => void) | undefined;\n  onError?: ((error: EmbedError) => void) | undefined;\n  onHeightChange?: ((height: number) => void) | undefined;\n  placement?: WidgetPlacement | undefined;\n  root?: HTMLElement | undefined;\n  theme?: string | undefined;\n  user?: UserIdentity | undefined;\n}\n\n/**\n * Config-object form accepted by {@link init}. Equivalent to\n * `init(organizationId, options)` but easier to read when many options are set.\n */\nexport interface InitConfig extends EmbedOptions {\n  organizationId: string | OrganizationId;\n}\n\n// ---------------------------------------------------------------------------\n// Widget API\n// ---------------------------------------------------------------------------\n\n/**\n * Handle returned by {@link init}. Every mutating method returns the widget so\n * calls can be chained: `feeblo.identify(user).setBoard(\"roadmap\").open()`.\n */\nexport interface FeebloWidget {\n  close: () => FeebloWidget;\n  destroy: () => void;\n  identify: (user: UserIdentity) => FeebloWidget;\n  isOpen: () => boolean;\n  metadata: (patch: Record<string, string | null>) => FeebloWidget;\n  open: (\n    trigger?: HTMLElement,\n    metadata?: Record<string, string>\n  ) => FeebloWidget;\n  openModule: (module: WidgetModule) => FeebloWidget;\n  setBoard: (board: string) => FeebloWidget;\n}\n\n// ---------------------------------------------------------------------------\n// Events\n// ---------------------------------------------------------------------------\n\nexport type FeebloEventName =\n  | \"widgetReady\"\n  | \"widgetOpened\"\n  | \"widgetClosed\"\n  | \"identityChanged\"\n  | \"feedbackSubmitted\";\n\nexport interface FeebloEventMap {\n  feedbackSubmitted: SubmittedFeedback | undefined;\n  identityChanged: PublicUserIdentity;\n  widgetClosed: undefined;\n  widgetOpened: { module: WidgetModule } | undefined;\n  widgetReady: undefined;\n}\n\nexport interface FeebloEventDetail<\n  K extends FeebloEventName = FeebloEventName,\n> {\n  data: FeebloEventMap[K];\n  namespace: \"feeblo\";\n  type: K;\n}\n\nexport type FeebloEventListener<K extends FeebloEventName> = (\n  event: CustomEvent<FeebloEventDetail<K>>\n) => void;\n\nexport type FeebloOn = {\n  <K extends FeebloEventName>(\n    event: K,\n    callback: FeebloEventListener<K>\n  ): () => void;\n  (event: \"*\", callback: FeebloEventListener<FeebloEventName>): () => void;\n};\n\nexport type FeebloOff = {\n  <K extends FeebloEventName>(event: K, callback: FeebloEventListener<K>): void;\n  (event: \"*\", callback: FeebloEventListener<FeebloEventName>): void;\n};\n\n// ---------------------------------------------------------------------------\n// Internal message contract (postMessage with the iframe)\n// ---------------------------------------------------------------------------\n\nexport type IncomingMessage =\n  | {\n      event: \"ERROR\";\n      data?:\n        | { code?: string | undefined; message?: string | undefined }\n        | undefined;\n    }\n  | { event: \"PAGE_HEIGHT\"; data?: { height?: number | undefined } | undefined }\n  | { event: \"CLOSE\" }\n  | { event: \"IDENTITY_CHANGED\"; data?: PublicUserIdentity | undefined }\n  | { event: \"READY\" }\n  | { event: \"WIDGET_OPENED\"; data?: { module: WidgetModule } | undefined }\n  | {\n      event: \"FEEDBACK_SUBMITTED\";\n      data?: { post?: SubmittedFeedback | undefined } | undefined;\n    };\n\nexport type OutgoingMessage =\n  | { event: \"SHOW\" }\n  | { event: \"HIDE\" }\n  | { event: \"IDENTIFY\"; data: Record<string, WidgetFieldValue> }\n  | { event: \"SET_CONTEXT\"; data: Record<string, string> }\n  | { event: \"SET_MODULE\"; data: { module: WidgetModule } }\n  | { event: \"SET_BOARD\"; data: { board: string } }\n  | { event: \"SET_LOCALE\"; data: { locale: string } };\n\nexport type ExternalMessageData = {\n  target: string;\n  data: { action: string; setBoard?: string | undefined };\n};\n\n// ---------------------------------------------------------------------------\n// Brand helpers\n// ---------------------------------------------------------------------------\n\n/**\n * Tag a raw string as an {@link OrganizationId} for stricter typing at call\n * sites. The value is unchanged at runtime.\n */\nexport function organizationId(id: string): OrganizationId {\n  // SAFETY: the caller promises the id was minted as an organization id; the\n  // brand is type-only and never changes the runtime value.\n  return id as OrganizationId;\n}\n","import \"./auto-init\";\nimport { subscribe, unsubscribe } from \"./events\";\nimport { destroyInstance, getCurrentEmbed, init } from \"./instance\";\nimport type { UserIdentity, WidgetModule } from \"./types\";\nimport { organizationId } from \"./types\";\nimport { VERSION } from \"./version\";\n\n// ---------------------------------------------------------------------------\n// Public exports\n// ---------------------------------------------------------------------------\n\nexport type { EmbedErrorDetails } from \"./errors\";\n\nexport { EmbedError } from \"./errors\";\n\nexport { init } from \"./instance\";\n\nexport type {\n  EmbedOptions,\n  FeebloEventDetail,\n  FeebloEventListener,\n  FeebloEventMap,\n  FeebloEventName,\n  FeebloOff,\n  FeebloOn,\n  FeebloWidget,\n  InitConfig,\n  OrganizationId,\n  PublicUserIdentity,\n  SubmittedFeedback,\n  UserIdentity,\n  WidgetCompany,\n  WidgetMode,\n  WidgetModule,\n  WidgetPlacement,\n} from \"./types\";\n\nexport { organizationId } from \"./types\";\n\nexport { VERSION } from \"./version\";\n\n// ---------------------------------------------------------------------------\n// Static Feeblo namespace\n// ---------------------------------------------------------------------------\n\nexport interface Feeblo {\n  close(): Feeblo;\n  destroy(): void;\n  identify(user: UserIdentity): Feeblo;\n  init: typeof init;\n  isOpen(): boolean;\n  metadata(patch: Record<string, string | null>): Feeblo;\n  off: typeof unsubscribe;\n  on: typeof subscribe;\n  open(): Feeblo;\n  openModule(module: WidgetModule): Feeblo;\n  organizationId: typeof organizationId;\n  setBoard(board: string): Feeblo;\n  readonly version: string;\n}\n\nexport const Feeblo = {\n  version: VERSION,\n  init,\n  organizationId,\n  identify(user: UserIdentity): Feeblo {\n    getCurrentEmbed()?.identify(user);\n\n    return Feeblo;\n  },\n  open(): Feeblo {\n    getCurrentEmbed()?.open();\n\n    return Feeblo;\n  },\n  openModule(module: WidgetModule): Feeblo {\n    getCurrentEmbed()?.openModule(module);\n\n    return Feeblo;\n  },\n  close(): Feeblo {\n    getCurrentEmbed()?.close();\n\n    return Feeblo;\n  },\n  metadata(patch: Record<string, string | null>): Feeblo {\n    getCurrentEmbed()?.metadata(patch);\n\n    return Feeblo;\n  },\n  isOpen(): boolean {\n    return getCurrentEmbed()?.isOpenState() ?? false;\n  },\n  setBoard(board: string): Feeblo {\n    getCurrentEmbed()?.setBoard(board);\n\n    return Feeblo;\n  },\n  destroy(): void {\n    destroyInstance(getCurrentEmbed());\n  },\n  on: subscribe,\n  off: unsubscribe,\n};\n"],"ignoreList":[9,10,11,12],"mappings":"C,6QASA,IAAaS,EAAb,cAAgC,KAAM,CACpC,KAEA,YAAY,CAAE,OAAM,WAA8B,CAChD,MAAMC,CAAO,EACb,KAAK,KAAOC,EACZ,KAAK,KAAO,YACd,CACF,ECdMC,EAAkC,CAAC,WAAY,SAAS,EAKxDC,EAAkC,IAAI,IAAgB,CAC1D,WACA,UACA,OACA,KACF,CAAC,EAEKC,EAAU,IAAI,IAAkB,CAAC,GAAGF,EAAiB,MAAM,CAAC,EAE5DG,EAAuC,IAAI,IAAqB,CACpE,cACA,cACF,CAAC,EAQD,SAASC,EAAc,EAAwB,CAC7C,MAAM,IA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