var __defProp = Object.defineProperty; var __defProps = Object.defineProperties; var __getOwnPropDescs = Object.getOwnPropertyDescriptors; var __getOwnPropSymbols = Object.getOwnPropertySymbols; var __hasOwnProp = Object.prototype.hasOwnProperty; var __propIsEnum = Object.prototype.propertyIsEnumerable; var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; var __spreadValues = (a, b) => { for (var prop in b || (b = {})) if (__hasOwnProp.call(b, prop)) __defNormalProp(a, prop, b[prop]); if (__getOwnPropSymbols) for (var prop of __getOwnPropSymbols(b)) { if (__propIsEnum.call(b, prop)) __defNormalProp(a, prop, b[prop]); } return a; }; var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b)); var __objRest = (source, exclude) => { var target = {}; for (var prop in source) if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0) target[prop] = source[prop]; if (source != null && __getOwnPropSymbols) for (var prop of __getOwnPropSymbols(source)) { if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop)) target[prop] = source[prop]; } return target; }; var __publicField = (obj, key, value) => { __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); return value; }; var __async = (__this, __arguments, generator) => { return new Promise((resolve, reject) => { var fulfilled = (value) => { try { step(generator.next(value)); } catch (e) { reject(e); } }; var rejected = (value) => { try { step(generator.throw(value)); } catch (e) { reject(e); } }; var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected); step((generator = generator.apply(__this, __arguments)).next()); }); }; import { ref, onMounted, defineComponent, computed, openBlock, createElementBlock, normalizeClass, toDisplayString, createCommentVNode, Comment, warn, watch, withKeys, withModifiers, renderSlot, resolveComponent, createElementVNode, createBlock, resolveDynamicComponent, withCtx, createVNode, Fragment, renderList, createTextVNode, Transition, normalizeStyle, inject, unref, toRef, mergeProps, getCurrentInstance, withDirectives, vModelCheckbox, createSlots, nextTick, vModelDynamic, onUnmounted, vShow, shallowRef, getCurrentScope, onScopeDispose, shallowReadonly, Teleport, toRefs, provide, vModelRadio, vModelText } from "vue"; const g = '', q = '', n1 = '', d1 = '', g1 = '', k1 = '', F1 = '', t0 = '', p = '', e0 = '', V2 = '', b2 = '', J2 = '', h5 = '', M5 = '', G5 = '', M3 = g, S3 = q, Y3 = n1, X3 = d1, l4 = g1, i4 = k1, m4 = F1, P4 = t0, Y4 = { langCodeMap: { ar: p }, default: e0 }, j6 = { ltr: V2, shouldFlip: true }, d7 = { ltr: b2, shouldFlip: true }, A7 = J2, T7 = h5, O7 = M5, x8 = G5; function N8(c, s, h) { if (typeof c == "string" || "path" in c) return c; if ("shouldFlip" in c) return c.ltr; if ("rtl" in c) return h === "rtl" ? c.rtl : c.ltr; const n = s in c.langCodeMap ? c.langCodeMap[s] : c.default; return typeof n == "string" || "path" in n ? n : n.ltr; } function O8(c, s) { if (typeof c == "string") return false; if ("langCodeMap" in c) { const h = s in c.langCodeMap ? c.langCodeMap[s] : c.default; if (typeof h == "string") return false; c = h; } if ("shouldFlipExceptions" in c && Array.isArray(c.shouldFlipExceptions)) { const h = c.shouldFlipExceptions.indexOf(s); return h === void 0 || h === -1; } return "shouldFlip" in c ? c.shouldFlip : false; } function useComputedDirection(root) { const computedDir = ref(null); onMounted(() => { const dir = window.getComputedStyle(root.value).direction; computedDir.value = dir === "ltr" || dir === "rtl" ? dir : null; }); return computedDir; } function useComputedLanguage(root) { const computedLang = ref(""); onMounted(() => { let ancestor = root.value; while (ancestor && ancestor.lang === "") { ancestor = ancestor.parentElement; } computedLang.value = ancestor ? ancestor.lang : null; }); return computedLang; } function makeStringTypeValidator(allowedValues) { return (s) => typeof s === "string" && allowedValues.indexOf(s) !== -1; } const LibraryPrefix = "cdx"; const ButtonActions = [ "default", "progressive", "destructive" ]; const ButtonWeights = [ "normal", "primary", "quiet" ]; const ButtonSizes = [ "medium", "large" ]; const IconSizes = [ "x-small", "small", "medium" ]; const StatusTypes = [ "notice", "warning", "error", "success" ]; const statusTypeValidator = makeStringTypeValidator(StatusTypes); const TextInputTypes = [ "text", "search", "number", "email", "month", "password", "tel", "url", "week", "date", "datetime-local", "time" ]; const ValidationStatusTypes = [ "default", "warning", "error", "success" ]; const TableTextAlignments = [ "start", "center", "end", // Numbers should be aligned to the right in all reading directionalities. "number" ]; const DebounceInterval = 120; const PendingDelay = 500; const MenuFooterValue = "cdx-menu-footer-item"; const TabsKey = Symbol("CdxTabs"); const ActiveTabKey = Symbol("CdxActiveTab"); const FieldInputIdKey = Symbol("CdxFieldInputId"); const FieldDescriptionIdKey = Symbol("CdxFieldDescriptionId"); const FieldStatusKey = Symbol("CdxFieldStatus"); const DisabledKey = Symbol("CdxDisabled"); const NoInvertClass = "".concat(LibraryPrefix, "-no-invert"); const TableRowIdentifier = Symbol("CdxTableRowIdentifier"); const iconSizeValidator = makeStringTypeValidator(IconSizes); const _sfc_main$w = defineComponent({ name: "CdxIcon", props: { /** The SVG path or an object containing that path plus other data. */ icon: { type: [String, Object], required: true }, /** * Accessible label for the icon. If not included, the icon will be hidden from screen * readers via `aria-hidden="true"`. Browsers also display this label as a tooltip when the * user hovers over the icon. Note that this label is not rendered as visible text next * to the icon. */ iconLabel: { type: String, default: "" }, /** * Explicitly set the language code to use for the icon. See * https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/lang. * Defaults to the lang attribute of the nearest ancestor at mount time. */ lang: { type: String, default: null }, /** * Explicitly set the direction to use for the icon. See * https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/dir. * Defaults to the computed direction at mount time. */ dir: { type: String, default: null }, /** * Specify icon size by choosing one of several pre-defined size * options. See the type documentation for supported size options. * The `medium` size is used by default if no size prop is provided. */ size: { type: String, default: "medium", validator: iconSizeValidator } }, setup(props) { const rootElement = ref(); const computedDir = useComputedDirection(rootElement); const computedLang = useComputedLanguage(rootElement); const overriddenDir = computed(() => { var _a; return (_a = props.dir) != null ? _a : computedDir.value; }); const overriddenLang = computed(() => { var _a; return (_a = props.lang) != null ? _a : computedLang.value; }); const rootClasses = computed(() => { return { "cdx-icon--flipped": overriddenDir.value === "rtl" && overriddenLang.value !== null && O8(props.icon, overriddenLang.value), ["cdx-icon--".concat(props.size)]: true }; }); const resolvedIcon = computed( () => { var _a, _b; return N8(props.icon, (_a = overriddenLang.value) != null ? _a : "", (_b = overriddenDir.value) != null ? _b : "ltr"); } ); const iconSvg = computed(() => typeof resolvedIcon.value === "string" ? resolvedIcon.value : ""); const iconPath = computed(() => typeof resolvedIcon.value !== "string" ? resolvedIcon.value.path : ""); return { rootElement, rootClasses, iconSvg, iconPath }; } }); const _export_sfc = (sfc, props) => { const target = sfc.__vccOpts || sfc; for (const [key, val] of props) { target[key] = val; } return target; }; const _hoisted_1$u = ["aria-hidden"]; const _hoisted_2$l = { key: 0 }; const _hoisted_3$b = ["innerHTML"]; const _hoisted_4$8 = ["d"]; function _sfc_render$w(_ctx, _cache, $props, $setup, $data, $options) { return openBlock(), createElementBlock( "span", { ref: "rootElement", class: normalizeClass(["cdx-icon", _ctx.rootClasses]) }, [ (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", "xmlns:xlink": "http://www.w3.org/1999/xlink", width: "20", height: "20", viewBox: "0 0 20 20", "aria-hidden": _ctx.iconLabel ? void 0 : true }, [ _ctx.iconLabel ? (openBlock(), createElementBlock( "title", _hoisted_2$l, toDisplayString(_ctx.iconLabel), 1 /* TEXT */ )) : createCommentVNode("v-if", true), _ctx.iconSvg ? (openBlock(), createElementBlock("g", { key: 1, innerHTML: _ctx.iconSvg }, null, 8, _hoisted_3$b)) : (openBlock(), createElementBlock("path", { key: 2, d: _ctx.iconPath }, null, 8, _hoisted_4$8)) ], 8, _hoisted_1$u)) ], 2 /* CLASS */ ); } const CdxIcon = /* @__PURE__ */ _export_sfc(_sfc_main$w, [["render", _sfc_render$w]]); function flattenSlotContents(slotContents) { const flattened = []; for (const node of slotContents) { if ( // HTML tag typeof node.type === "string" || // Component typeof node.type === "object" ) { flattened.push(node); } else if (node.type !== Comment) { if (typeof node.children === "string" && node.children.trim() !== "") { flattened.push(node.children); } else if (Array.isArray(node.children)) { flattened.push(...flattenSlotContents(node.children)); } } } return flattened; } function isComponentVNode(node, componentName) { if (typeof node.type === "object" && "name" in node.type) { if (componentName !== void 0) { return node.type.name === componentName; } return true; } return false; } function isTagVNode(node, tagName) { if (typeof node.type === "string") { { return node.type === tagName.toLowerCase(); } } return false; } function useSlotContents(slot) { const slotContents = typeof slot === "function" ? slot() : slot; return slotContents ? flattenSlotContents(slotContents) : []; } function useWarnOnce(shouldWarn, message) { if (shouldWarn()) { warn(message); return; } const stop = watch(shouldWarn, (newValue) => { if (newValue) { warn(message); stop(); } }); } function useIconOnlyButton(slot, attrs, componentName) { const isIconOnly = computed(() => { const slotContents = useSlotContents(slot); if (slotContents.length !== 1) { return false; } const soleNode = slotContents[0]; if (typeof soleNode === "object" && (isComponentVNode(soleNode, "CdxIcon") || isTagVNode(soleNode, "svg"))) { return true; } return false; }); useWarnOnce( () => isIconOnly.value && !attrs["aria-label"] && !attrs["aria-hidden"], "".concat(componentName, ": Icon-only buttons require one of the following attributes: aria-label or aria-hidden. See documentation at https://doc.wikimedia.org/codex/latest/components/demos/button.html#icon-only-button") ); return isIconOnly; } const buttonActionValidator = makeStringTypeValidator(ButtonActions); const buttonWeightValidator = makeStringTypeValidator(ButtonWeights); const buttonSizeValidator = makeStringTypeValidator(ButtonSizes); const _sfc_main$v = defineComponent({ name: "CdxButton", props: { /** * The kind of action that will be taken on click. * * @values 'default', 'progressive', 'destructive' */ action: { type: String, default: "default", validator: buttonActionValidator }, /** * Visual prominence of the button. * * @values 'normal', 'primary', 'quiet' */ weight: { type: String, default: "normal", validator: buttonWeightValidator }, /** * Button size. * * Most buttons should use the default medium size. In rare cases the large size should * be used, for example to make icon-only buttons larger on touchscreens. * * @values 'medium', 'large' */ size: { type: String, default: "medium", validator: buttonSizeValidator } }, emits: ["click"], setup(props, { emit, slots, attrs }) { const isIconOnly = useIconOnlyButton(slots.default, attrs, "CdxButton"); const isActive = ref(false); const rootClasses = computed(() => ({ ["cdx-button--action-".concat(props.action)]: true, ["cdx-button--weight-".concat(props.weight)]: true, ["cdx-button--size-".concat(props.size)]: true, "cdx-button--framed": props.weight !== "quiet", "cdx-button--icon-only": isIconOnly.value, "cdx-button--is-active": isActive.value })); const onClick = (event) => { emit("click", event); }; const setActive = (active) => { isActive.value = active; }; function onKeyDown() { setActive(true); } function onKeyUp(event) { setActive(false); emit("click", event); } return { rootClasses, onClick, onKeyDown, onKeyUp }; } }); function _sfc_render$v(_ctx, _cache, $props, $setup, $data, $options) { return openBlock(), createElementBlock( "button", { class: normalizeClass(["cdx-button", _ctx.rootClasses]), onKeydown: _cache[0] || (_cache[0] = withKeys(withModifiers((...args) => _ctx.onKeyDown && _ctx.onKeyDown(...args), ["prevent"]), ["space", "enter"])), onKeyup: _cache[1] || (_cache[1] = withKeys((...args) => _ctx.onKeyUp && _ctx.onKeyUp(...args), ["space", "enter"])), onClick: _cache[2] || (_cache[2] = (...args) => _ctx.onClick && _ctx.onClick(...args)) }, [ renderSlot(_ctx.$slots, "default") ], 34 /* CLASS, NEED_HYDRATION */ ); } const CdxButton = /* @__PURE__ */ _export_sfc(_sfc_main$v, [["render", _sfc_render$v]]); const _sfc_main$u = defineComponent({ name: "CdxAccordion", components: { CdxButton, CdxIcon }, props: { /** * Forces the accordion to show the action icon. * * @values 'true', 'false' */ actionAlwaysVisible: { type: Boolean, default: false }, /** * The icon that will be displayed on the right side of the accordion header when expanded. * */ actionIcon: { type: [String, Object], default: null }, /** * Label for the action button. If an action icon is being used, then a label for that icon * should be provided for ARIA support. */ actionButtonLabel: { type: String, default: "" }, /** * The heading level of the accordion title. * * @values 'h1', 'h2', 'h3', 'h4', 'h5', 'h6' */ headingLevel: { type: String, default: "h3" } }, emits: [ /** * When the action button is clicked. * */ "action-button-click" ], setup(props, { attrs, emit }) { const isExpanded = ref("open" in attrs); const emitActionButtonClick = () => { emit("action-button-click"); }; const onToggle = (e) => { isExpanded.value = e.newState === "open"; }; const shouldShowActionButton = computed(() => { return props.actionIcon && (isExpanded.value || props.actionAlwaysVisible); }); const rootClasses = computed(() => ({ "cdx-accordion--has-icon": shouldShowActionButton.value })); return { emitActionButtonClick, rootClasses, shouldShowActionButton, onToggle }; } }); const _hoisted_1$t = { class: "cdx-accordion__header__title" }; const _hoisted_2$k = { class: "cdx-accordion__header__description" }; function _sfc_render$u(_ctx, _cache, $props, $setup, $data, $options) { const _component_cdx_icon = resolveComponent("cdx-icon"); const _component_cdx_button = resolveComponent("cdx-button"); return openBlock(), createElementBlock( "details", { class: normalizeClass(["cdx-accordion", _ctx.rootClasses]), onToggle: _cache[1] || (_cache[1] = (...args) => _ctx.onToggle && _ctx.onToggle(...args)) }, [ createElementVNode("summary", null, [ (openBlock(), createBlock(resolveDynamicComponent(_ctx.headingLevel), { class: "cdx-accordion__header" }, { default: withCtx(() => [ createElementVNode("span", _hoisted_1$t, [ renderSlot(_ctx.$slots, "title") ]), createElementVNode("span", _hoisted_2$k, [ renderSlot(_ctx.$slots, "description") ]) ]), _: 3 /* FORWARDED */ })), _ctx.shouldShowActionButton ? (openBlock(), createBlock(_component_cdx_button, { key: 0, class: "cdx-accordion__action", "aria-label": _ctx.actionButtonLabel, type: "button", weight: "quiet", onClick: withModifiers(_ctx.emitActionButtonClick, ["stop"]) }, { default: withCtx(() => [ createVNode(_component_cdx_icon, { icon: _ctx.actionIcon, "icon-label": _ctx.actionButtonLabel, size: "medium" }, null, 8, ["icon", "icon-label"]) ]), _: 1 /* STABLE */ }, 8, ["aria-label", "onClick"])) : createCommentVNode("v-if", true) ]), createElementVNode("div", { class: "cdx-accordion__content", onClick: _cache[0] || (_cache[0] = withModifiers(() => { }, ["stop"])) }, [ renderSlot(_ctx.$slots, "default") ]) ], 34 /* CLASS, NEED_HYDRATION */ ); } const Accordion = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["render", _sfc_render$u]]); function getButtonLabel(button) { if (button.label === void 0) { return button.value; } if (button.label === null) { return ""; } return button.label; } const _sfc_main$t = defineComponent({ name: "CdxButtonGroup", components: { CdxButton, CdxIcon }, props: { /** * Objects describing the buttons in the group. See the ButtonGroupItem type. */ buttons: { type: Array, required: true, validator: (value) => Array.isArray(value) && value.length >= 1 }, /** * Whether the entire group is disabled. * * If this is set to true, all buttons in the group are disabled. Buttons can also be * disabled individually by setting their `disabled` property to true. */ disabled: { type: Boolean, default: false } }, emits: [ /** * Emitted when a button is clicked * * @property {string | number} value The `value` property of the button that was clicked */ "click" ], setup() { return { getButtonLabel }; } }); const _hoisted_1$s = { class: "cdx-button-group" }; function _sfc_render$t(_ctx, _cache, $props, $setup, $data, $options) { const _component_cdx_icon = resolveComponent("cdx-icon"); const _component_cdx_button = resolveComponent("cdx-button"); return openBlock(), createElementBlock("div", _hoisted_1$s, [ (openBlock(true), createElementBlock( Fragment, null, renderList(_ctx.buttons, (button) => { return openBlock(), createBlock(_component_cdx_button, { key: button.value, disabled: button.disabled || _ctx.disabled, "aria-label": button.ariaLabel, onClick: ($event) => _ctx.$emit("click", button.value) }, { default: withCtx(() => [ renderSlot(_ctx.$slots, "default", { button }, () => [ button.icon ? (openBlock(), createBlock(_component_cdx_icon, { key: 0, icon: button.icon }, null, 8, ["icon"])) : createCommentVNode("v-if", true), createTextVNode( " " + toDisplayString(_ctx.getButtonLabel(button)), 1 /* TEXT */ ) ]) ]), _: 2 /* DYNAMIC */ }, 1032, ["disabled", "aria-label", "onClick"]); }), 128 /* KEYED_FRAGMENT */ )) ]); } const ButtonGroup = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["render", _sfc_render$t]]); const _sfc_main$s = defineComponent({ name: "CdxThumbnail", components: { CdxIcon }, props: { /** * Thumbnail data. */ thumbnail: { type: [Object, null], default: null }, /** * Thumbnail placeholder icon. */ placeholderIcon: { type: [String, Object], default: P4 } }, setup: (props) => { const thumbnailLoaded = ref(false); const thumbnailStyle = ref({}); const preloadThumbnail = (url) => { const escapedUrl = url.replace(/([\\"\n])/g, "\\$1"); const image = new Image(); image.onload = () => { thumbnailStyle.value = { backgroundImage: 'url("'.concat(escapedUrl, '")') }; thumbnailLoaded.value = true; }; image.onerror = () => { thumbnailLoaded.value = false; }; image.src = escapedUrl; }; onMounted(() => { var _a; if ((_a = props.thumbnail) == null ? void 0 : _a.url) { preloadThumbnail(props.thumbnail.url); } }); return { thumbnailStyle, thumbnailLoaded, NoInvertClass }; } }); const _hoisted_1$r = { class: "cdx-thumbnail" }; const _hoisted_2$j = { key: 0, class: "cdx-thumbnail__placeholder" }; function _sfc_render$s(_ctx, _cache, $props, $setup, $data, $options) { const _component_cdx_icon = resolveComponent("cdx-icon"); return openBlock(), createElementBlock("span", _hoisted_1$r, [ !_ctx.thumbnailLoaded ? (openBlock(), createElementBlock("span", _hoisted_2$j, [ createVNode(_component_cdx_icon, { icon: _ctx.placeholderIcon, class: "cdx-thumbnail__placeholder__icon--vue" }, null, 8, ["icon"]) ])) : createCommentVNode("v-if", true), createVNode(Transition, { name: "cdx-thumbnail__image" }, { default: withCtx(() => [ _ctx.thumbnailLoaded ? (openBlock(), createElementBlock( "span", { key: 0, style: normalizeStyle(_ctx.thumbnailStyle), class: normalizeClass([_ctx.NoInvertClass, "cdx-thumbnail__image"]) }, null, 6 /* CLASS, STYLE */ )) : createCommentVNode("v-if", true) ]), _: 1 /* STABLE */ }) ]); } const CdxThumbnail = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["render", _sfc_render$s]]); const _sfc_main$r = defineComponent({ name: "CdxCard", components: { CdxIcon, CdxThumbnail }, props: { /** * If provided, the Card will be a link to this URL. */ url: { type: String, default: "" }, /** * Icon displayed at the start of the Card. */ icon: { type: [String, Object], default: "" }, /** * Thumbnail image data for the Card. */ thumbnail: { type: [Object, null], default: null }, /** * Option to force a thumbnail layout. * * When set to `true`, the Card will display a Thumbnail. If a `thumbnail` prop was also * provided, the thumbnail image will display. Otherwise, a placeholder icon will display. * * This is useful when displaying groups of Cards when some of the cards have thumbnail * images but some do not. `forceThumbnail` will provide a consistent layout for that group. * * Note that this prop is not needed to display a thumbnail image: if the `thumbnail` prop * is provided, it will display. This prop is only needed to enable the display of the * thumbnail placeholder icon when the `thumbnail` prop is not provided. */ forceThumbnail: { type: Boolean, default: false }, /** * Optional custom icon for the placeholder shown when `forceThumbnail` is true but no * thumbnail is provided. * * Defaults to the default placeholder icon set in the Thumbnail component. */ customPlaceholderIcon: { type: [String, Object], default: void 0 } }, setup(props) { const isLink = computed(() => !!props.url); const contentTag = computed(() => isLink.value ? "a" : "span"); const cardLink = computed(() => isLink.value ? props.url : void 0); return { isLink, contentTag, cardLink }; } }); const _hoisted_1$q = { class: "cdx-card__text" }; const _hoisted_2$i = { class: "cdx-card__text__title" }; const _hoisted_3$a = { key: 0, class: "cdx-card__text__description" }; const _hoisted_4$7 = { key: 1, class: "cdx-card__text__supporting-text" }; function _sfc_render$r(_ctx, _cache, $props, $setup, $data, $options) { const _component_cdx_thumbnail = resolveComponent("cdx-thumbnail"); const _component_cdx_icon = resolveComponent("cdx-icon"); return openBlock(), createBlock(resolveDynamicComponent(_ctx.contentTag), { href: _ctx.cardLink, class: normalizeClass(["cdx-card", { "cdx-card--is-link": _ctx.isLink, // Include dynamic classes in the template so that $slots is reactive. "cdx-card--title-only": !_ctx.$slots.description && !_ctx.$slots["supporting-text"] }]) }, { default: withCtx(() => [ _ctx.thumbnail || _ctx.forceThumbnail ? (openBlock(), createBlock(_component_cdx_thumbnail, { key: 0, thumbnail: _ctx.thumbnail, "placeholder-icon": _ctx.customPlaceholderIcon, class: "cdx-card__thumbnail" }, null, 8, ["thumbnail", "placeholder-icon"])) : _ctx.icon ? (openBlock(), createBlock(_component_cdx_icon, { key: 1, icon: _ctx.icon, class: "cdx-card__icon" }, null, 8, ["icon"])) : createCommentVNode("v-if", true), createElementVNode("span", _hoisted_1$q, [ createElementVNode("span", _hoisted_2$i, [ renderSlot(_ctx.$slots, "title") ]), _ctx.$slots.description ? (openBlock(), createElementBlock("span", _hoisted_3$a, [ renderSlot(_ctx.$slots, "description") ])) : createCommentVNode("v-if", true), _ctx.$slots["supporting-text"] ? (openBlock(), createElementBlock("span", _hoisted_4$7, [ renderSlot(_ctx.$slots, "supporting-text") ])) : createCommentVNode("v-if", true) ]) ]), _: 3 /* FORWARDED */ }, 8, ["href", "class"]); } const Card = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["render", _sfc_render$r]]); function useComputedDisabled(disabledProp) { const providedDisabled = inject(DisabledKey, ref(false)); return computed(() => providedDisabled.value || disabledProp.value); } function useFieldData(disabledProp, statusProp, idAttr) { const computedDisabled = useComputedDisabled(disabledProp); const providedStatus = inject(FieldStatusKey, ref("default")); const computedStatus = computed(() => { if ((statusProp == null ? void 0 : statusProp.value) && statusProp.value !== "default") { return statusProp.value; } return providedStatus.value; }); const providedId = inject(FieldInputIdKey, void 0); const computedInputId = computed(() => { var _a; return (_a = providedId == null ? void 0 : providedId.value) != null ? _a : idAttr; }); return { computedDisabled, computedStatus, computedInputId }; } function useSplitAttributes(attrs, internalClasses = computed(() => ({}))) { const rootClasses = computed(() => { const classRecord = __objRest(internalClasses.value, []); if (attrs.class) { const providedClasses = attrs.class.split(" "); providedClasses.forEach((className) => { classRecord[className] = true; }); } return classRecord; }); const rootStyle = computed(() => { if ("style" in attrs) { return attrs.style; } return void 0; }); const otherAttrs = computed(() => { const _a = attrs, { class: _ignoredClass, style: _ignoredStyle } = _a, attrsCopy = __objRest(_a, ["class", "style"]); return attrsCopy; }); return { rootClasses, rootStyle, otherAttrs }; } function useI18n(messageKey, defaultValue, params = []) { const providedI18nFunc = inject("CdxI18nFunction", void 0); return computed(() => { const unwrappedParams = params.map(unref); const fromProvidedFunc = providedI18nFunc == null ? void 0 : providedI18nFunc(messageKey, ...unwrappedParams); if (fromProvidedFunc !== void 0 && fromProvidedFunc !== null) { return fromProvidedFunc; } return typeof defaultValue === "function" ? defaultValue(...unwrappedParams) : defaultValue; }); } function useI18nWithOverride(override, messageKey, defaultValue, params = []) { const translatedMessage = useI18n(messageKey, defaultValue, params); return computed(() => override.value || translatedMessage.value); } const _sfc_main$q = defineComponent({ name: "CdxLabel", components: { CdxIcon }, /** * We want the label or legend to inherit attributes, not the root element. */ inheritAttrs: false, props: { /** * Icon before the label text. * * Do not use this if including a start icon within the input component. */ icon: { type: [String, Object], default: null }, /** * Whether the field is optional. * * This will add a flag next to the label indicating that the field is optional. */ optional: { type: Boolean, default: false }, // DEPRECATED: set default to '(optional)' (T368444). /** * Text to indicate that the field is optional. * * Omit this prop to use the default value, "(optional)". */ optionalFlag: { type: String, default: "" }, /** * Whether the label should be visually hidden. */ visuallyHidden: { type: Boolean, default: false }, /** * Whether this component should output a `` element. * * Always set this to true when this component is used inside a `