Path: blob/main/src/resources/formats/html/bslib/components/dist/web-components.js
12924 views
/*! bslib 0.5.1.9000 | (c) 2012-2023 RStudio, PBC. | License: MIT + file LICENSE */1"use strict";2(() => {3var __defProp = Object.defineProperty;4var __defProps = Object.defineProperties;5var __getOwnPropDesc = Object.getOwnPropertyDescriptor;6var __getOwnPropDescs = Object.getOwnPropertyDescriptors;7var __getOwnPropSymbols = Object.getOwnPropertySymbols;8var __hasOwnProp = Object.prototype.hasOwnProperty;9var __propIsEnum = Object.prototype.propertyIsEnumerable;10var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;11var __spreadValues = (a3, b2) => {12for (var prop in b2 || (b2 = {}))13if (__hasOwnProp.call(b2, prop))14__defNormalProp(a3, prop, b2[prop]);15if (__getOwnPropSymbols)16for (var prop of __getOwnPropSymbols(b2)) {17if (__propIsEnum.call(b2, prop))18__defNormalProp(a3, prop, b2[prop]);19}20return a3;21};22var __spreadProps = (a3, b2) => __defProps(a3, __getOwnPropDescs(b2));23var __decorateClass = (decorators, target, key, kind) => {24var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;25for (var i4 = decorators.length - 1, decorator; i4 >= 0; i4--)26if (decorator = decorators[i4])27result = (kind ? decorator(target, key, result) : decorator(result)) || result;28if (kind && result)29__defProp(target, key, result);30return result;31};32var __async = (__this, __arguments, generator) => {33return new Promise((resolve, reject) => {34var fulfilled = (value) => {35try {36step(generator.next(value));37} catch (e6) {38reject(e6);39}40};41var rejected = (value) => {42try {43step(generator.throw(value));44} catch (e6) {45reject(e6);46}47};48var step = (x2) => x2.done ? resolve(x2.value) : Promise.resolve(x2.value).then(fulfilled, rejected);49step((generator = generator.apply(__this, __arguments)).next());50});51};5253// node_modules/@lit/reactive-element/decorators/property.js54var i = (i4, e6) => "method" === e6.kind && e6.descriptor && !("value" in e6.descriptor) ? __spreadProps(__spreadValues({}, e6), { finisher(n7) {55n7.createProperty(e6.key, i4);56} }) : { kind: "field", key: Symbol(), placement: "own", descriptor: {}, originalKey: e6.key, initializer() {57"function" == typeof e6.initializer && (this[e6.key] = e6.initializer.call(this));58}, finisher(n7) {59n7.createProperty(e6.key, i4);60} };61var e = (i4, e6, n7) => {62e6.constructor.createProperty(n7, i4);63};64function n(n7) {65return (t3, o6) => void 0 !== o6 ? e(n7, t3, o6) : i(n7, t3);66}6768// node_modules/@lit/reactive-element/decorators/query-assigned-elements.js69var n2;70var e2 = null != (null === (n2 = window.HTMLSlotElement) || void 0 === n2 ? void 0 : n2.prototype.assignedElements) ? (o6, n7) => o6.assignedElements(n7) : (o6, n7) => o6.assignedNodes(n7).filter((o7) => o7.nodeType === Node.ELEMENT_NODE);7172// node_modules/@lit/reactive-element/css-tag.js73var t = window;74var e3 = t.ShadowRoot && (void 0 === t.ShadyCSS || t.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype;75var s = Symbol();76var n3 = /* @__PURE__ */ new WeakMap();77var o2 = class {78constructor(t3, e6, n7) {79if (this._$cssResult$ = true, n7 !== s)80throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");81this.cssText = t3, this.t = e6;82}83get styleSheet() {84let t3 = this.o;85const s5 = this.t;86if (e3 && void 0 === t3) {87const e6 = void 0 !== s5 && 1 === s5.length;88e6 && (t3 = n3.get(s5)), void 0 === t3 && ((this.o = t3 = new CSSStyleSheet()).replaceSync(this.cssText), e6 && n3.set(s5, t3));89}90return t3;91}92toString() {93return this.cssText;94}95};96var r = (t3) => new o2("string" == typeof t3 ? t3 : t3 + "", void 0, s);97var i2 = (t3, ...e6) => {98const n7 = 1 === t3.length ? t3[0] : e6.reduce((e7, s5, n8) => e7 + ((t4) => {99if (true === t4._$cssResult$)100return t4.cssText;101if ("number" == typeof t4)102return t4;103throw Error("Value passed to 'css' function must be a 'css' function result: " + t4 + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");104})(s5) + t3[n8 + 1], t3[0]);105return new o2(n7, t3, s);106};107var S = (s5, n7) => {108e3 ? s5.adoptedStyleSheets = n7.map((t3) => t3 instanceof CSSStyleSheet ? t3 : t3.styleSheet) : n7.forEach((e6) => {109const n8 = document.createElement("style"), o6 = t.litNonce;110void 0 !== o6 && n8.setAttribute("nonce", o6), n8.textContent = e6.cssText, s5.appendChild(n8);111});112};113var c = e3 ? (t3) => t3 : (t3) => t3 instanceof CSSStyleSheet ? ((t4) => {114let e6 = "";115for (const s5 of t4.cssRules)116e6 += s5.cssText;117return r(e6);118})(t3) : t3;119120// node_modules/@lit/reactive-element/reactive-element.js121var s2;122var e4 = window;123var r2 = e4.trustedTypes;124var h = r2 ? r2.emptyScript : "";125var o3 = e4.reactiveElementPolyfillSupport;126var n4 = { toAttribute(t3, i4) {127switch (i4) {128case Boolean:129t3 = t3 ? h : null;130break;131case Object:132case Array:133t3 = null == t3 ? t3 : JSON.stringify(t3);134}135return t3;136}, fromAttribute(t3, i4) {137let s5 = t3;138switch (i4) {139case Boolean:140s5 = null !== t3;141break;142case Number:143s5 = null === t3 ? null : Number(t3);144break;145case Object:146case Array:147try {148s5 = JSON.parse(t3);149} catch (t4) {150s5 = null;151}152}153return s5;154} };155var a = (t3, i4) => i4 !== t3 && (i4 == i4 || t3 == t3);156var l2 = { attribute: true, type: String, converter: n4, reflect: false, hasChanged: a };157var d = "finalized";158var u = class extends HTMLElement {159constructor() {160super(), this._$Ei = /* @__PURE__ */ new Map(), this.isUpdatePending = false, this.hasUpdated = false, this._$El = null, this.u();161}162static addInitializer(t3) {163var i4;164this.finalize(), (null !== (i4 = this.h) && void 0 !== i4 ? i4 : this.h = []).push(t3);165}166static get observedAttributes() {167this.finalize();168const t3 = [];169return this.elementProperties.forEach((i4, s5) => {170const e6 = this._$Ep(s5, i4);171void 0 !== e6 && (this._$Ev.set(e6, s5), t3.push(e6));172}), t3;173}174static createProperty(t3, i4 = l2) {175if (i4.state && (i4.attribute = false), this.finalize(), this.elementProperties.set(t3, i4), !i4.noAccessor && !this.prototype.hasOwnProperty(t3)) {176const s5 = "symbol" == typeof t3 ? Symbol() : "__" + t3, e6 = this.getPropertyDescriptor(t3, s5, i4);177void 0 !== e6 && Object.defineProperty(this.prototype, t3, e6);178}179}180static getPropertyDescriptor(t3, i4, s5) {181return { get() {182return this[i4];183}, set(e6) {184const r4 = this[t3];185this[i4] = e6, this.requestUpdate(t3, r4, s5);186}, configurable: true, enumerable: true };187}188static getPropertyOptions(t3) {189return this.elementProperties.get(t3) || l2;190}191static finalize() {192if (this.hasOwnProperty(d))193return false;194this[d] = true;195const t3 = Object.getPrototypeOf(this);196if (t3.finalize(), void 0 !== t3.h && (this.h = [...t3.h]), this.elementProperties = new Map(t3.elementProperties), this._$Ev = /* @__PURE__ */ new Map(), this.hasOwnProperty("properties")) {197const t4 = this.properties, i4 = [...Object.getOwnPropertyNames(t4), ...Object.getOwnPropertySymbols(t4)];198for (const s5 of i4)199this.createProperty(s5, t4[s5]);200}201return this.elementStyles = this.finalizeStyles(this.styles), true;202}203static finalizeStyles(i4) {204const s5 = [];205if (Array.isArray(i4)) {206const e6 = new Set(i4.flat(1 / 0).reverse());207for (const i5 of e6)208s5.unshift(c(i5));209} else210void 0 !== i4 && s5.push(c(i4));211return s5;212}213static _$Ep(t3, i4) {214const s5 = i4.attribute;215return false === s5 ? void 0 : "string" == typeof s5 ? s5 : "string" == typeof t3 ? t3.toLowerCase() : void 0;216}217u() {218var t3;219this._$E_ = new Promise((t4) => this.enableUpdating = t4), this._$AL = /* @__PURE__ */ new Map(), this._$Eg(), this.requestUpdate(), null === (t3 = this.constructor.h) || void 0 === t3 || t3.forEach((t4) => t4(this));220}221addController(t3) {222var i4, s5;223(null !== (i4 = this._$ES) && void 0 !== i4 ? i4 : this._$ES = []).push(t3), void 0 !== this.renderRoot && this.isConnected && (null === (s5 = t3.hostConnected) || void 0 === s5 || s5.call(t3));224}225removeController(t3) {226var i4;227null === (i4 = this._$ES) || void 0 === i4 || i4.splice(this._$ES.indexOf(t3) >>> 0, 1);228}229_$Eg() {230this.constructor.elementProperties.forEach((t3, i4) => {231this.hasOwnProperty(i4) && (this._$Ei.set(i4, this[i4]), delete this[i4]);232});233}234createRenderRoot() {235var t3;236const s5 = null !== (t3 = this.shadowRoot) && void 0 !== t3 ? t3 : this.attachShadow(this.constructor.shadowRootOptions);237return S(s5, this.constructor.elementStyles), s5;238}239connectedCallback() {240var t3;241void 0 === this.renderRoot && (this.renderRoot = this.createRenderRoot()), this.enableUpdating(true), null === (t3 = this._$ES) || void 0 === t3 || t3.forEach((t4) => {242var i4;243return null === (i4 = t4.hostConnected) || void 0 === i4 ? void 0 : i4.call(t4);244});245}246enableUpdating(t3) {247}248disconnectedCallback() {249var t3;250null === (t3 = this._$ES) || void 0 === t3 || t3.forEach((t4) => {251var i4;252return null === (i4 = t4.hostDisconnected) || void 0 === i4 ? void 0 : i4.call(t4);253});254}255attributeChangedCallback(t3, i4, s5) {256this._$AK(t3, s5);257}258_$EO(t3, i4, s5 = l2) {259var e6;260const r4 = this.constructor._$Ep(t3, s5);261if (void 0 !== r4 && true === s5.reflect) {262const h3 = (void 0 !== (null === (e6 = s5.converter) || void 0 === e6 ? void 0 : e6.toAttribute) ? s5.converter : n4).toAttribute(i4, s5.type);263this._$El = t3, null == h3 ? this.removeAttribute(r4) : this.setAttribute(r4, h3), this._$El = null;264}265}266_$AK(t3, i4) {267var s5;268const e6 = this.constructor, r4 = e6._$Ev.get(t3);269if (void 0 !== r4 && this._$El !== r4) {270const t4 = e6.getPropertyOptions(r4), h3 = "function" == typeof t4.converter ? { fromAttribute: t4.converter } : void 0 !== (null === (s5 = t4.converter) || void 0 === s5 ? void 0 : s5.fromAttribute) ? t4.converter : n4;271this._$El = r4, this[r4] = h3.fromAttribute(i4, t4.type), this._$El = null;272}273}274requestUpdate(t3, i4, s5) {275let e6 = true;276void 0 !== t3 && (((s5 = s5 || this.constructor.getPropertyOptions(t3)).hasChanged || a)(this[t3], i4) ? (this._$AL.has(t3) || this._$AL.set(t3, i4), true === s5.reflect && this._$El !== t3 && (void 0 === this._$EC && (this._$EC = /* @__PURE__ */ new Map()), this._$EC.set(t3, s5))) : e6 = false), !this.isUpdatePending && e6 && (this._$E_ = this._$Ej());277}278_$Ej() {279return __async(this, null, function* () {280this.isUpdatePending = true;281try {282yield this._$E_;283} catch (t4) {284Promise.reject(t4);285}286const t3 = this.scheduleUpdate();287return null != t3 && (yield t3), !this.isUpdatePending;288});289}290scheduleUpdate() {291return this.performUpdate();292}293performUpdate() {294var t3;295if (!this.isUpdatePending)296return;297this.hasUpdated, this._$Ei && (this._$Ei.forEach((t4, i5) => this[i5] = t4), this._$Ei = void 0);298let i4 = false;299const s5 = this._$AL;300try {301i4 = this.shouldUpdate(s5), i4 ? (this.willUpdate(s5), null === (t3 = this._$ES) || void 0 === t3 || t3.forEach((t4) => {302var i5;303return null === (i5 = t4.hostUpdate) || void 0 === i5 ? void 0 : i5.call(t4);304}), this.update(s5)) : this._$Ek();305} catch (t4) {306throw i4 = false, this._$Ek(), t4;307}308i4 && this._$AE(s5);309}310willUpdate(t3) {311}312_$AE(t3) {313var i4;314null === (i4 = this._$ES) || void 0 === i4 || i4.forEach((t4) => {315var i5;316return null === (i5 = t4.hostUpdated) || void 0 === i5 ? void 0 : i5.call(t4);317}), this.hasUpdated || (this.hasUpdated = true, this.firstUpdated(t3)), this.updated(t3);318}319_$Ek() {320this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = false;321}322get updateComplete() {323return this.getUpdateComplete();324}325getUpdateComplete() {326return this._$E_;327}328shouldUpdate(t3) {329return true;330}331update(t3) {332void 0 !== this._$EC && (this._$EC.forEach((t4, i4) => this._$EO(i4, this[i4], t4)), this._$EC = void 0), this._$Ek();333}334updated(t3) {335}336firstUpdated(t3) {337}338};339u[d] = true, u.elementProperties = /* @__PURE__ */ new Map(), u.elementStyles = [], u.shadowRootOptions = { mode: "open" }, null == o3 || o3({ ReactiveElement: u }), (null !== (s2 = e4.reactiveElementVersions) && void 0 !== s2 ? s2 : e4.reactiveElementVersions = []).push("1.6.2");340341// node_modules/lit-html/lit-html.js342var t2;343var i3 = window;344var s3 = i3.trustedTypes;345var e5 = s3 ? s3.createPolicy("lit-html", { createHTML: (t3) => t3 }) : void 0;346var o4 = "$lit$";347var n5 = `lit$${(Math.random() + "").slice(9)}$`;348var l3 = "?" + n5;349var h2 = `<${l3}>`;350var r3 = document;351var u2 = () => r3.createComment("");352var d2 = (t3) => null === t3 || "object" != typeof t3 && "function" != typeof t3;353var c2 = Array.isArray;354var v = (t3) => c2(t3) || "function" == typeof (null == t3 ? void 0 : t3[Symbol.iterator]);355var a2 = "[ \n\f\r]";356var f = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g;357var _ = /-->/g;358var m = />/g;359var p = RegExp(`>|${a2}(?:([^\\s"'>=/]+)(${a2}*=${a2}*(?:[^360\f\r"'\`<>=]|("|')|))|$)`, "g");361var g = /'/g;362var $2 = /"/g;363var y = /^(?:script|style|textarea|title)$/i;364var w = (t3) => (i4, ...s5) => ({ _$litType$: t3, strings: i4, values: s5 });365var x = w(1);366var b = w(2);367var T = Symbol.for("lit-noChange");368var A = Symbol.for("lit-nothing");369var E = /* @__PURE__ */ new WeakMap();370var C = r3.createTreeWalker(r3, 129, null, false);371function P(t3, i4) {372if (!Array.isArray(t3) || !t3.hasOwnProperty("raw"))373throw Error("invalid template strings array");374return void 0 !== e5 ? e5.createHTML(i4) : i4;375}376var V = (t3, i4) => {377const s5 = t3.length - 1, e6 = [];378let l5, r4 = 2 === i4 ? "<svg>" : "", u3 = f;379for (let i5 = 0; i5 < s5; i5++) {380const s6 = t3[i5];381let d3, c3, v2 = -1, a3 = 0;382for (; a3 < s6.length && (u3.lastIndex = a3, c3 = u3.exec(s6), null !== c3); )383a3 = u3.lastIndex, u3 === f ? "!--" === c3[1] ? u3 = _ : void 0 !== c3[1] ? u3 = m : void 0 !== c3[2] ? (y.test(c3[2]) && (l5 = RegExp("</" + c3[2], "g")), u3 = p) : void 0 !== c3[3] && (u3 = p) : u3 === p ? ">" === c3[0] ? (u3 = null != l5 ? l5 : f, v2 = -1) : void 0 === c3[1] ? v2 = -2 : (v2 = u3.lastIndex - c3[2].length, d3 = c3[1], u3 = void 0 === c3[3] ? p : '"' === c3[3] ? $2 : g) : u3 === $2 || u3 === g ? u3 = p : u3 === _ || u3 === m ? u3 = f : (u3 = p, l5 = void 0);384const w2 = u3 === p && t3[i5 + 1].startsWith("/>") ? " " : "";385r4 += u3 === f ? s6 + h2 : v2 >= 0 ? (e6.push(d3), s6.slice(0, v2) + o4 + s6.slice(v2) + n5 + w2) : s6 + n5 + (-2 === v2 ? (e6.push(void 0), i5) : w2);386}387return [P(t3, r4 + (t3[s5] || "<?>") + (2 === i4 ? "</svg>" : "")), e6];388};389var N = class {390constructor({ strings: t3, _$litType$: i4 }, e6) {391let h3;392this.parts = [];393let r4 = 0, d3 = 0;394const c3 = t3.length - 1, v2 = this.parts, [a3, f2] = V(t3, i4);395if (this.el = N.createElement(a3, e6), C.currentNode = this.el.content, 2 === i4) {396const t4 = this.el.content, i5 = t4.firstChild;397i5.remove(), t4.append(...i5.childNodes);398}399for (; null !== (h3 = C.nextNode()) && v2.length < c3; ) {400if (1 === h3.nodeType) {401if (h3.hasAttributes()) {402const t4 = [];403for (const i5 of h3.getAttributeNames())404if (i5.endsWith(o4) || i5.startsWith(n5)) {405const s5 = f2[d3++];406if (t4.push(i5), void 0 !== s5) {407const t5 = h3.getAttribute(s5.toLowerCase() + o4).split(n5), i6 = /([.?@])?(.*)/.exec(s5);408v2.push({ type: 1, index: r4, name: i6[2], strings: t5, ctor: "." === i6[1] ? H : "?" === i6[1] ? L : "@" === i6[1] ? z : k });409} else410v2.push({ type: 6, index: r4 });411}412for (const i5 of t4)413h3.removeAttribute(i5);414}415if (y.test(h3.tagName)) {416const t4 = h3.textContent.split(n5), i5 = t4.length - 1;417if (i5 > 0) {418h3.textContent = s3 ? s3.emptyScript : "";419for (let s5 = 0; s5 < i5; s5++)420h3.append(t4[s5], u2()), C.nextNode(), v2.push({ type: 2, index: ++r4 });421h3.append(t4[i5], u2());422}423}424} else if (8 === h3.nodeType)425if (h3.data === l3)426v2.push({ type: 2, index: r4 });427else {428let t4 = -1;429for (; -1 !== (t4 = h3.data.indexOf(n5, t4 + 1)); )430v2.push({ type: 7, index: r4 }), t4 += n5.length - 1;431}432r4++;433}434}435static createElement(t3, i4) {436const s5 = r3.createElement("template");437return s5.innerHTML = t3, s5;438}439};440function S2(t3, i4, s5 = t3, e6) {441var o6, n7, l5, h3;442if (i4 === T)443return i4;444let r4 = void 0 !== e6 ? null === (o6 = s5._$Co) || void 0 === o6 ? void 0 : o6[e6] : s5._$Cl;445const u3 = d2(i4) ? void 0 : i4._$litDirective$;446return (null == r4 ? void 0 : r4.constructor) !== u3 && (null === (n7 = null == r4 ? void 0 : r4._$AO) || void 0 === n7 || n7.call(r4, false), void 0 === u3 ? r4 = void 0 : (r4 = new u3(t3), r4._$AT(t3, s5, e6)), void 0 !== e6 ? (null !== (l5 = (h3 = s5)._$Co) && void 0 !== l5 ? l5 : h3._$Co = [])[e6] = r4 : s5._$Cl = r4), void 0 !== r4 && (i4 = S2(t3, r4._$AS(t3, i4.values), r4, e6)), i4;447}448var M = class {449constructor(t3, i4) {450this._$AV = [], this._$AN = void 0, this._$AD = t3, this._$AM = i4;451}452get parentNode() {453return this._$AM.parentNode;454}455get _$AU() {456return this._$AM._$AU;457}458u(t3) {459var i4;460const { el: { content: s5 }, parts: e6 } = this._$AD, o6 = (null !== (i4 = null == t3 ? void 0 : t3.creationScope) && void 0 !== i4 ? i4 : r3).importNode(s5, true);461C.currentNode = o6;462let n7 = C.nextNode(), l5 = 0, h3 = 0, u3 = e6[0];463for (; void 0 !== u3; ) {464if (l5 === u3.index) {465let i5;4662 === u3.type ? i5 = new R(n7, n7.nextSibling, this, t3) : 1 === u3.type ? i5 = new u3.ctor(n7, u3.name, u3.strings, this, t3) : 6 === u3.type && (i5 = new Z(n7, this, t3)), this._$AV.push(i5), u3 = e6[++h3];467}468l5 !== (null == u3 ? void 0 : u3.index) && (n7 = C.nextNode(), l5++);469}470return C.currentNode = r3, o6;471}472v(t3) {473let i4 = 0;474for (const s5 of this._$AV)475void 0 !== s5 && (void 0 !== s5.strings ? (s5._$AI(t3, s5, i4), i4 += s5.strings.length - 2) : s5._$AI(t3[i4])), i4++;476}477};478var R = class {479constructor(t3, i4, s5, e6) {480var o6;481this.type = 2, this._$AH = A, this._$AN = void 0, this._$AA = t3, this._$AB = i4, this._$AM = s5, this.options = e6, this._$Cp = null === (o6 = null == e6 ? void 0 : e6.isConnected) || void 0 === o6 || o6;482}483get _$AU() {484var t3, i4;485return null !== (i4 = null === (t3 = this._$AM) || void 0 === t3 ? void 0 : t3._$AU) && void 0 !== i4 ? i4 : this._$Cp;486}487get parentNode() {488let t3 = this._$AA.parentNode;489const i4 = this._$AM;490return void 0 !== i4 && 11 === (null == t3 ? void 0 : t3.nodeType) && (t3 = i4.parentNode), t3;491}492get startNode() {493return this._$AA;494}495get endNode() {496return this._$AB;497}498_$AI(t3, i4 = this) {499t3 = S2(this, t3, i4), d2(t3) ? t3 === A || null == t3 || "" === t3 ? (this._$AH !== A && this._$AR(), this._$AH = A) : t3 !== this._$AH && t3 !== T && this._(t3) : void 0 !== t3._$litType$ ? this.g(t3) : void 0 !== t3.nodeType ? this.$(t3) : v(t3) ? this.T(t3) : this._(t3);500}501k(t3) {502return this._$AA.parentNode.insertBefore(t3, this._$AB);503}504$(t3) {505this._$AH !== t3 && (this._$AR(), this._$AH = this.k(t3));506}507_(t3) {508this._$AH !== A && d2(this._$AH) ? this._$AA.nextSibling.data = t3 : this.$(r3.createTextNode(t3)), this._$AH = t3;509}510g(t3) {511var i4;512const { values: s5, _$litType$: e6 } = t3, o6 = "number" == typeof e6 ? this._$AC(t3) : (void 0 === e6.el && (e6.el = N.createElement(P(e6.h, e6.h[0]), this.options)), e6);513if ((null === (i4 = this._$AH) || void 0 === i4 ? void 0 : i4._$AD) === o6)514this._$AH.v(s5);515else {516const t4 = new M(o6, this), i5 = t4.u(this.options);517t4.v(s5), this.$(i5), this._$AH = t4;518}519}520_$AC(t3) {521let i4 = E.get(t3.strings);522return void 0 === i4 && E.set(t3.strings, i4 = new N(t3)), i4;523}524T(t3) {525c2(this._$AH) || (this._$AH = [], this._$AR());526const i4 = this._$AH;527let s5, e6 = 0;528for (const o6 of t3)529e6 === i4.length ? i4.push(s5 = new R(this.k(u2()), this.k(u2()), this, this.options)) : s5 = i4[e6], s5._$AI(o6), e6++;530e6 < i4.length && (this._$AR(s5 && s5._$AB.nextSibling, e6), i4.length = e6);531}532_$AR(t3 = this._$AA.nextSibling, i4) {533var s5;534for (null === (s5 = this._$AP) || void 0 === s5 || s5.call(this, false, true, i4); t3 && t3 !== this._$AB; ) {535const i5 = t3.nextSibling;536t3.remove(), t3 = i5;537}538}539setConnected(t3) {540var i4;541void 0 === this._$AM && (this._$Cp = t3, null === (i4 = this._$AP) || void 0 === i4 || i4.call(this, t3));542}543};544var k = class {545constructor(t3, i4, s5, e6, o6) {546this.type = 1, this._$AH = A, this._$AN = void 0, this.element = t3, this.name = i4, this._$AM = e6, this.options = o6, s5.length > 2 || "" !== s5[0] || "" !== s5[1] ? (this._$AH = Array(s5.length - 1).fill(new String()), this.strings = s5) : this._$AH = A;547}548get tagName() {549return this.element.tagName;550}551get _$AU() {552return this._$AM._$AU;553}554_$AI(t3, i4 = this, s5, e6) {555const o6 = this.strings;556let n7 = false;557if (void 0 === o6)558t3 = S2(this, t3, i4, 0), n7 = !d2(t3) || t3 !== this._$AH && t3 !== T, n7 && (this._$AH = t3);559else {560const e7 = t3;561let l5, h3;562for (t3 = o6[0], l5 = 0; l5 < o6.length - 1; l5++)563h3 = S2(this, e7[s5 + l5], i4, l5), h3 === T && (h3 = this._$AH[l5]), n7 || (n7 = !d2(h3) || h3 !== this._$AH[l5]), h3 === A ? t3 = A : t3 !== A && (t3 += (null != h3 ? h3 : "") + o6[l5 + 1]), this._$AH[l5] = h3;564}565n7 && !e6 && this.j(t3);566}567j(t3) {568t3 === A ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, null != t3 ? t3 : "");569}570};571var H = class extends k {572constructor() {573super(...arguments), this.type = 3;574}575j(t3) {576this.element[this.name] = t3 === A ? void 0 : t3;577}578};579var I = s3 ? s3.emptyScript : "";580var L = class extends k {581constructor() {582super(...arguments), this.type = 4;583}584j(t3) {585t3 && t3 !== A ? this.element.setAttribute(this.name, I) : this.element.removeAttribute(this.name);586}587};588var z = class extends k {589constructor(t3, i4, s5, e6, o6) {590super(t3, i4, s5, e6, o6), this.type = 5;591}592_$AI(t3, i4 = this) {593var s5;594if ((t3 = null !== (s5 = S2(this, t3, i4, 0)) && void 0 !== s5 ? s5 : A) === T)595return;596const e6 = this._$AH, o6 = t3 === A && e6 !== A || t3.capture !== e6.capture || t3.once !== e6.once || t3.passive !== e6.passive, n7 = t3 !== A && (e6 === A || o6);597o6 && this.element.removeEventListener(this.name, this, e6), n7 && this.element.addEventListener(this.name, this, t3), this._$AH = t3;598}599handleEvent(t3) {600var i4, s5;601"function" == typeof this._$AH ? this._$AH.call(null !== (s5 = null === (i4 = this.options) || void 0 === i4 ? void 0 : i4.host) && void 0 !== s5 ? s5 : this.element, t3) : this._$AH.handleEvent(t3);602}603};604var Z = class {605constructor(t3, i4, s5) {606this.element = t3, this.type = 6, this._$AN = void 0, this._$AM = i4, this.options = s5;607}608get _$AU() {609return this._$AM._$AU;610}611_$AI(t3) {612S2(this, t3);613}614};615var B = i3.litHtmlPolyfillSupport;616null == B || B(N, R), (null !== (t2 = i3.litHtmlVersions) && void 0 !== t2 ? t2 : i3.litHtmlVersions = []).push("2.7.5");617var D = (t3, i4, s5) => {618var e6, o6;619const n7 = null !== (e6 = null == s5 ? void 0 : s5.renderBefore) && void 0 !== e6 ? e6 : i4;620let l5 = n7._$litPart$;621if (void 0 === l5) {622const t4 = null !== (o6 = null == s5 ? void 0 : s5.renderBefore) && void 0 !== o6 ? o6 : null;623n7._$litPart$ = l5 = new R(i4.insertBefore(u2(), t4), t4, void 0, null != s5 ? s5 : {});624}625return l5._$AI(t3), l5;626};627628// node_modules/lit-element/lit-element.js629var l4;630var o5;631var s4 = class extends u {632constructor() {633super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;634}635createRenderRoot() {636var t3, e6;637const i4 = super.createRenderRoot();638return null !== (t3 = (e6 = this.renderOptions).renderBefore) && void 0 !== t3 || (e6.renderBefore = i4.firstChild), i4;639}640update(t3) {641const i4 = this.render();642this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t3), this._$Do = D(i4, this.renderRoot, this.renderOptions);643}644connectedCallback() {645var t3;646super.connectedCallback(), null === (t3 = this._$Do) || void 0 === t3 || t3.setConnected(true);647}648disconnectedCallback() {649var t3;650super.disconnectedCallback(), null === (t3 = this._$Do) || void 0 === t3 || t3.setConnected(false);651}652render() {653return T;654}655};656s4.finalized = true, s4._$litElement$ = true, null === (l4 = globalThis.litElementHydrateSupport) || void 0 === l4 || l4.call(globalThis, { LitElement: s4 });657var n6 = globalThis.litElementPolyfillSupport;658null == n6 || n6({ LitElement: s4 });659(null !== (o5 = globalThis.litElementVersions) && void 0 !== o5 ? o5 : globalThis.litElementVersions = []).push("3.3.2");660661// srcts/src/components/webcomponents/_bslibElement.ts662var BslibElement = class extends s4 {663connectedCallback() {664this.maybeCarryFill();665super.connectedCallback();666}667render() {668return x`<slot></slot>`;669}670maybeCarryFill() {671if (this.isFillCarrier) {672this.classList.add("html-fill-container");673this.classList.add("html-fill-item");674} else {675this.classList.remove("html-fill-container");676this.classList.remove("html-fill-item");677}678}679get isFillCarrier() {680if (!this.parentElement) {681return false;682}683const inContainer = this.parentElement.classList.contains(684"html-fill-container"685);686const hasFillItem = Array.from(this.children).some(687(x2) => x2.classList.contains("html-fill-item")688);689return inContainer && hasFillItem;690}691};692BslibElement.isShinyInput = false;693BslibElement.styles = i2`694:host {695display: contents;696}697`;698699// srcts/src/components/_utilsTooltip.ts700function getOrCreateTriggerEl(el) {701const tip = el.querySelector(":scope > [data-bs-toggle='tooltip']");702if (tip)703return tip;704const pop = el.querySelector(":scope > [data-bs-toggle='popover']");705if (pop)706return pop;707if (el.children.length > 1) {708const ref = el.children[el.children.length - 1];709return ref;710}711if (el.childNodes.length > 1) {712const ref = document.createElement("span");713ref.append(el.childNodes[el.childNodes.length - 1]);714el.appendChild(ref);715return ref;716}717return el;718}719function setContentCarefully(x2) {720var _a;721const { instance, trigger, content, type } = x2;722const { tip } = instance;723const tipIsVisible = tip && tip.offsetParent !== null;724if (!tipIsVisible) {725instance.setContent(content);726return;727}728for (const [selector, html] of Object.entries(content)) {729let target = tip.querySelector(selector);730if (!target && selector === ".popover-header") {731const header = document.createElement("div");732header.classList.add("popover-header");733(_a = tip.querySelector(".popover-body")) == null ? void 0 : _a.before(header);734target = header;735}736if (!target) {737console.warn(`Could not find ${selector} in ${type} content`);738continue;739}740if (target instanceof HTMLElement) {741target.replaceChildren(html);742} else {743target.innerHTML = html;744}745}746instance.update();747trigger.addEventListener(748`hidden.bs.${type}`,749() => instance.setContent(content),750{ once: true }751);752}753function createWrapperElement(html, display) {754const wrapper = document.createElement("div");755wrapper.style.display = display;756if (html instanceof DocumentFragment) {757wrapper.append(html);758} else {759wrapper.innerHTML = html;760}761return wrapper;762}763764// srcts/src/components/_shinyResizeObserver.ts765var ShinyResizeObserver = class {766/**767* Watch containers for size changes and ensure that Shiny outputs and768* htmlwidgets within resize appropriately.769*770* @details771* The ShinyResizeObserver is used to watch the containers, such as Sidebars772* and Cards for size changes, in particular when the sidebar state is toggled773* or the card body is expanded full screen. It performs two primary tasks:774*775* 1. Dispatches a `resize` event on the window object. This is necessary to776* ensure that Shiny outputs resize appropriately. In general, the window777* resizing is throttled and the output update occurs when the transition778* is complete.779* 2. If an output with a resize method on the output binding is detected, we780* directly call the `.onResize()` method of the binding. This ensures that781* htmlwidgets transition smoothly. In static mode, htmlwidgets does this782* already.783*784* @note785* This resize observer also handles race conditions in some complex786* fill-based layouts with multiple outputs (e.g., plotly), where shiny787* initializes with the correct sizing, but in-between the 1st and last788* renderValue(), the size of the output containers can change, meaning every789* output but the 1st gets initialized with the wrong size during their790* renderValue(). Then, after the render phase, shiny won't know to trigger a791* resize since all the widgets will return to their original size (and thus,792* Shiny thinks there isn't any resizing to do). The resize observer works793* around this by ensuring that the output is resized whenever its container794* size changes.795* @constructor796*/797constructor() {798this.resizeObserverEntries = [];799this.resizeObserver = new ResizeObserver((entries) => {800const resizeEvent = new Event("resize");801window.dispatchEvent(resizeEvent);802if (!window.Shiny)803return;804const resized = [];805for (const entry of entries) {806if (!(entry.target instanceof HTMLElement))807continue;808if (!entry.target.querySelector(".shiny-bound-output"))809continue;810entry.target.querySelectorAll(".shiny-bound-output").forEach((el) => {811if (resized.includes(el))812return;813const { binding, onResize } = $(el).data("shinyOutputBinding");814if (!binding || !binding.resize)815return;816const owner = el.shinyResizeObserver;817if (owner && owner !== this)818return;819if (!owner)820el.shinyResizeObserver = this;821onResize(el);822resized.push(el);823if (!el.classList.contains("shiny-plot-output"))824return;825const img = el.querySelector(826'img:not([width="100%"])'827);828if (img)829img.setAttribute("width", "100%");830});831}832});833}834/**835* Observe an element for size changes.836* @param {HTMLElement} el - The element to observe.837*/838observe(el) {839this.resizeObserver.observe(el);840this.resizeObserverEntries.push(el);841}842/**843* Stop observing an element for size changes.844* @param {HTMLElement} el - The element to stop observing.845*/846unobserve(el) {847const idxEl = this.resizeObserverEntries.indexOf(el);848if (idxEl < 0)849return;850this.resizeObserver.unobserve(el);851this.resizeObserverEntries.splice(idxEl, 1);852}853/**854* This method checks that we're not continuing to watch elements that no855* longer exist in the DOM. If any are found, we stop observing them and856* remove them from our array of observed elements.857*858* @private859* @static860*/861flush() {862this.resizeObserverEntries.forEach((el) => {863if (!document.body.contains(el))864this.unobserve(el);865});866}867};868869// srcts/src/components/webcomponents/tooltip.ts870var bsTooltip = window.bootstrap ? window.bootstrap.Tooltip : class {871};872var _BslibTooltip = class extends BslibElement {873///////////////////////////////////////////////////////////////874// Methods875///////////////////////////////////////////////////////////////876constructor() {877super();878this.placement = "auto";879this.bsOptions = "{}";880// Visibility state management881this.visible = false;882// This is a placeholder function that will be overwritten by the Shiny input883// binding. When the input value changes, it invokes this function to notify884// Shiny that it has changed.885// eslint-disable-next-line @typescript-eslint/no-empty-function, @typescript-eslint/no-unused-vars886this.onChangeCallback = (x2) => {887};888this._onShown = this._onShown.bind(this);889this._onInsert = this._onInsert.bind(this);890this._onHidden = this._onHidden.bind(this);891}892get options() {893const opts = JSON.parse(this.bsOptions);894return __spreadValues({895title: this.content,896placement: this.placement,897// Bootstrap defaults to false, but we have our own HTML escaping898html: true,899sanitize: false900}, opts);901}902get content() {903return this.children[0];904}905// The element that triggers the tooltip to be shown906get triggerElement() {907return getOrCreateTriggerEl(this);908}909// Is the trigger element visible?910get visibleTrigger() {911const el = this.triggerElement;912return el && el.offsetParent !== null;913}914connectedCallback() {915super.connectedCallback();916const template = this.querySelector("template");917this.prepend(createWrapperElement(template.content, "none"));918template.remove();919const trigger = this.triggerElement;920trigger.setAttribute("data-bs-toggle", "tooltip");921trigger.setAttribute("tabindex", "0");922this.bsTooltip = new bsTooltip(trigger, this.options);923trigger.addEventListener("shown.bs.tooltip", this._onShown);924trigger.addEventListener("hidden.bs.tooltip", this._onHidden);925trigger.addEventListener("inserted.bs.tooltip", this._onInsert);926this.visibilityObserver = this._createVisibilityObserver();927}928disconnectedCallback() {929const trigger = this.triggerElement;930trigger.removeEventListener("shown.bs.tooltip", this._onShown);931trigger.removeEventListener("hidden.bs.tooltip", this._onHidden);932trigger.removeEventListener("inserted.bs.tooltip", this._onInsert);933this.visibilityObserver.disconnect();934this.bsTooltip.dispose();935super.disconnectedCallback();936}937getValue() {938return this.visible;939}940_onShown() {941this.visible = true;942this.onChangeCallback(true);943this.visibilityObserver.observe(this.triggerElement);944}945_onHidden() {946this.visible = false;947this.onChangeCallback(true);948this._restoreContent();949this.visibilityObserver.unobserve(this.triggerElement);950_BslibTooltip.shinyResizeObserver.flush();951}952_onInsert() {953var _a;954const { tip } = this.bsTooltip;955if (!tip) {956throw new Error(957"Failed to find the tooltip's DOM element. Please report this bug."958);959}960_BslibTooltip.shinyResizeObserver.observe(tip);961const content = (_a = tip.querySelector(".tooltip-inner")) == null ? void 0 : _a.firstChild;962if (content instanceof HTMLElement) {963content.style.display = "contents";964}965this.bsTooltipEl = tip;966}967// Since this.content is an HTMLElement, when it's shown bootstrap.Popover()968// will move the DOM element from this web container to the tooltip's969// container (which, by default, is the body, but can also be customized). So,970// when the popover is hidden, we're responsible for moving it back to this971// element.972_restoreContent() {973var _a;974const el = this.bsTooltipEl;975if (!el)976return;977const content = (_a = el.querySelector(".tooltip-inner")) == null ? void 0 : _a.firstChild;978if (content instanceof HTMLElement) {979content.style.display = "none";980this.prepend(content);981}982this.bsTooltipEl = void 0;983}984receiveMessage(el, data) {985const method = data.method;986if (method === "toggle") {987this._toggle(data.value);988} else if (method === "update") {989this._updateTitle(data.title);990} else {991throw new Error(`Unknown method ${method}`);992}993}994_toggle(x2) {995if (x2 === "toggle" || x2 === void 0) {996x2 = this.visible ? "hide" : "show";997}998if (x2 === "hide") {999this.bsTooltip.hide();1000}1001if (x2 === "show") {1002this._show();1003}1004}1005// No-op if the tooltip is already visible or if the trigger element is not visible1006// (in either case the tooltip likely won't be positioned correctly)1007_show() {1008if (!this.visible && this.visibleTrigger) {1009this.bsTooltip.show();1010}1011}1012_updateTitle(title) {1013if (!title)1014return;1015Shiny.renderDependencies(title.deps);1016setContentCarefully({1017instance: this.bsTooltip,1018trigger: this.triggerElement,1019// eslint-disable-next-line @typescript-eslint/naming-convention1020content: { ".tooltip-inner": title.html },1021type: "tooltip"1022});1023}1024// While the tooltip is shown, watches for changes in the _trigger_1025// visibility. If the trigger element becomes no longer visible, then we hide1026// the tooltip (Bootstrap doesn't do this automatically when showing1027// programmatically)1028_createVisibilityObserver() {1029const handler = (entries) => {1030if (!this.visible)1031return;1032entries.forEach((entry) => {1033if (!entry.isIntersecting)1034this.bsTooltip.hide();1035});1036};1037return new IntersectionObserver(handler);1038}1039};1040var BslibTooltip = _BslibTooltip;1041BslibTooltip.tagName = "bslib-tooltip";1042BslibTooltip.shinyResizeObserver = new ShinyResizeObserver();1043// Shiny-specific stuff1044BslibTooltip.isShinyInput = true;1045__decorateClass([1046n({ type: String })1047], BslibTooltip.prototype, "placement", 2);1048__decorateClass([1049n({ type: String })1050], BslibTooltip.prototype, "bsOptions", 2);10511052// srcts/src/components/webcomponents/popover.ts1053var bsPopover = window.bootstrap ? window.bootstrap.Popover : class {1054};1055var _BslibPopover = class extends BslibElement {1056///////////////////////////////////////////////////////////////1057// Methods1058///////////////////////////////////////////////////////////////1059constructor() {1060super();1061this.placement = "auto";1062this.bsOptions = "{}";1063///////////////////////////////////////////////////////////////1064// Visibility state management1065///////////////////////////////////////////////////////////////1066this.visible = false;1067// This is a placeholder function that will be overwritten by the Shiny input1068// binding. When the input value changes, it invokes this function to notify1069// Shiny that it has changed.1070// eslint-disable-next-line @typescript-eslint/no-empty-function, @typescript-eslint/no-unused-vars1071this.onChangeCallback = (x2) => {1072};1073this._onShown = this._onShown.bind(this);1074this._onInsert = this._onInsert.bind(this);1075this._onHidden = this._onHidden.bind(this);1076this._handleTabKey = this._handleTabKey.bind(this);1077this._handleEscapeKey = this._handleEscapeKey.bind(this);1078this._closeButton = this._closeButton.bind(this);1079}1080get options() {1081const opts = JSON.parse(this.bsOptions);1082return __spreadValues({1083content: this.content,1084title: hasHeader(this.header) ? this.header : "",1085placement: this.placement,1086// Bootstrap defaults to false, but we have our own HTML escaping1087html: true,1088sanitize: false,1089trigger: this.isHyperLink ? "focus hover" : "click"1090}, opts);1091}1092get content() {1093return this.contentContainer.children[0];1094}1095get header() {1096return this.contentContainer.children[1];1097}1098get contentContainer() {1099return this.children[0];1100}1101// The element that triggers the popover to be shown1102get triggerElement() {1103return getOrCreateTriggerEl(this);1104}1105// Is the trigger element visible?1106get visibleTrigger() {1107const el = this.triggerElement;1108return el && el.offsetParent !== null;1109}1110// By default (when trigger is "click"), treat the trigger element like a1111// button (even if it's not a <button> element). Meaning mostly that we'll1112// manage aria-pressed and Enter/Space keydown events.1113// https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/button_role1114get isButtonLike() {1115return this.options.trigger === "click" && this.triggerElement.tagName !== "BUTTON";1116}1117// If the visibility of the popover is _not_ triggered via focus (i.e., it's1118// triggered by clicking a button), then we make the popover focusable (so that1119// the user can tab to it).1120get focusablePopover() {1121return !this.options.trigger.includes("focus");1122}1123get isHyperLink() {1124const trigger = this.triggerElement;1125return trigger.tagName === "A" && trigger.hasAttribute("href") && trigger.getAttribute("href") !== "#" && trigger.getAttribute("href") !== "" && trigger.getAttribute("href") !== "javascript:void(0)";1126}1127connectedCallback() {1128super.connectedCallback();1129const template = this.querySelector("template");1130this.prepend(createWrapperElement(template.content, "none"));1131template.remove();1132if (this.content) {1133D(this._closeButton(this.header), this.content);1134}1135const trigger = this.triggerElement;1136trigger.setAttribute("data-bs-toggle", "popover");1137if (this.isButtonLike) {1138trigger.setAttribute("role", "button");1139trigger.setAttribute("tabindex", "0");1140trigger.setAttribute("aria-pressed", "false");1141if (this.triggerElement.tagName !== "A") {1142trigger.onkeydown = (e6) => {1143if (e6.key === "Enter" || e6.key === " ") {1144this._toggle();1145}1146};1147}1148trigger.style.cursor = "pointer";1149}1150this.bsPopover = new bsPopover(trigger, this.options);1151trigger.addEventListener("shown.bs.popover", this._onShown);1152trigger.addEventListener("hidden.bs.popover", this._onHidden);1153trigger.addEventListener("inserted.bs.popover", this._onInsert);1154this.visibilityObserver = this._createVisibilityObserver();1155}1156disconnectedCallback() {1157const trigger = this.triggerElement;1158trigger.removeEventListener("shown.bs.popover", this._onShown);1159trigger.removeEventListener("hidden.bs.popover", this._onHidden);1160trigger.removeEventListener("inserted.bs.popover", this._onInsert);1161this.visibilityObserver.disconnect();1162this.bsPopover.dispose();1163super.disconnectedCallback();1164}1165getValue() {1166return this.visible;1167}1168_onShown() {1169this.visible = true;1170this.onChangeCallback(true);1171this.visibilityObserver.observe(this.triggerElement);1172if (this.focusablePopover) {1173document.addEventListener("keydown", this._handleTabKey);1174document.addEventListener("keydown", this._handleEscapeKey);1175}1176if (this.isButtonLike) {1177this.triggerElement.setAttribute("aria-pressed", "true");1178}1179}1180_onHidden() {1181this.visible = false;1182this.onChangeCallback(true);1183this._restoreContent();1184this.visibilityObserver.unobserve(this.triggerElement);1185_BslibPopover.shinyResizeObserver.flush();1186if (this.focusablePopover) {1187document.removeEventListener("keydown", this._handleTabKey);1188document.removeEventListener("keydown", this._handleEscapeKey);1189}1190if (this.isButtonLike) {1191this.triggerElement.setAttribute("aria-pressed", "false");1192}1193}1194_onInsert() {1195const { tip } = this.bsPopover;1196if (!tip) {1197throw new Error(1198"Failed to find the popover's DOM element. Please report this bug."1199);1200}1201_BslibPopover.shinyResizeObserver.observe(tip);1202if (this.focusablePopover) {1203tip.setAttribute("tabindex", "0");1204}1205this.bsPopoverEl = tip;1206}1207// 1. Tab on an active trigger focuses the popover.1208// 2. Shift+Tab on active popover focuses the trigger.1209_handleTabKey(e6) {1210if (e6.key !== "Tab")1211return;1212const { tip } = this.bsPopover;1213if (!tip)1214return;1215const stopEvent = () => {1216e6.preventDefault();1217e6.stopImmediatePropagation();1218};1219const active = document.activeElement;1220if (active === this.triggerElement && !e6.shiftKey) {1221stopEvent();1222tip.focus();1223}1224if (active === tip && e6.shiftKey) {1225stopEvent();1226this.triggerElement.focus();1227}1228}1229// Allow ESC to close the popover when:1230// - the trigger is the active element1231// - the activeElement is inside the popover1232_handleEscapeKey(e6) {1233if (e6.key !== "Escape")1234return;1235const { tip } = this.bsPopover;1236if (!tip)1237return;1238const active = document.activeElement;1239if (active === this.triggerElement || tip.contains(active)) {1240e6.preventDefault();1241e6.stopImmediatePropagation();1242this._hide();1243this.triggerElement.focus();1244}1245}1246// Since this.content is an HTMLElement, when it's shown bootstrap.Popover()1247// will move the DOM element from this web container to the popover's1248// container (which, by default, is the body, but can also be customized). So,1249// when the popover is hidden, we're responsible for moving it back to this1250// element.1251_restoreContent() {1252const el = this.bsPopoverEl;1253if (!el)1254return;1255const body = el.querySelector(".popover-body");1256if (body)1257this.contentContainer.append(body == null ? void 0 : body.firstChild);1258const header = el.querySelector(".popover-header");1259if (header)1260this.contentContainer.append(header == null ? void 0 : header.firstChild);1261this.bsPopoverEl = void 0;1262}1263receiveMessage(el, data) {1264const method = data.method;1265if (method === "toggle") {1266this._toggle(data.value);1267} else if (method === "update") {1268this._updatePopover(data);1269} else {1270throw new Error(`Unknown method ${method}`);1271}1272}1273_toggle(x2) {1274if (x2 === "toggle" || x2 === void 0) {1275x2 = this.visible ? "hide" : "show";1276}1277if (x2 === "hide") {1278this._hide();1279}1280if (x2 === "show") {1281this._show();1282}1283}1284_hide() {1285this.bsPopover.hide();1286}1287// No-op if the popover is already visible or if the trigger element is not visible1288// (in either case the tooltip likely won't be positioned correctly)1289_show() {1290if (!this.visible && this.visibleTrigger) {1291this.bsPopover.show();1292}1293}1294_updatePopover(data) {1295const { content, header } = data;1296const deps = [];1297if (content)1298deps.push(...content.deps);1299if (header)1300deps.push(...header.deps);1301Shiny.renderDependencies(deps);1302const getOrCreateElement = (x2, fallback, selector) => {1303var _a;1304if (x2)1305return createWrapperElement(x2.html, "contents");1306if (fallback)1307return fallback;1308return (_a = this.bsPopover.tip) == null ? void 0 : _a.querySelector(selector);1309};1310const newHeader = getOrCreateElement(1311header,1312this.header,1313".popover-header"1314);1315const newContent = getOrCreateElement(1316content,1317this.content,1318".popover-body"1319);1320D(this._closeButton(newHeader), newContent);1321setContentCarefully({1322instance: this.bsPopover,1323trigger: this.triggerElement,1324content: {1325// eslint-disable-next-line @typescript-eslint/naming-convention1326".popover-header": hasHeader(newHeader) ? newHeader : "",1327// eslint-disable-next-line @typescript-eslint/naming-convention1328".popover-body": newContent1329},1330type: "popover"1331});1332}1333_closeButton(header) {1334if (!this.focusablePopover) {1335return A;1336}1337const onclick = () => {1338this._hide();1339if (this.focusablePopover)1340this.triggerElement.focus();1341};1342const top = hasHeader(header) ? "0.6rem" : "0.25rem";1343return x`<button1344type="button"1345aria-label="Close"1346class="btn-close"1347@click=${onclick}1348style="position:absolute; top:${top}; right:0.25rem; width:0.55rem; height:0.55rem; background-size:0.55rem;"1349></button>`;1350}1351// While the popover is shown, watches for changes in the _trigger_1352// visibility. If the trigger element becomes no longer visible, then we hide1353// the popover (Bootstrap doesn't do this automatically when showing1354// programmatically)1355_createVisibilityObserver() {1356const handler = (entries) => {1357if (!this.visible)1358return;1359entries.forEach((entry) => {1360if (!entry.isIntersecting)1361this._hide();1362});1363};1364return new IntersectionObserver(handler);1365}1366};1367var BslibPopover = _BslibPopover;1368BslibPopover.tagName = "bslib-popover";1369BslibPopover.shinyResizeObserver = new ShinyResizeObserver();1370///////////////////////////////////////////////////////////////1371// Shiny-specific stuff1372///////////////////////////////////////////////////////////////1373BslibPopover.isShinyInput = true;1374__decorateClass([1375n({ type: String })1376], BslibPopover.prototype, "placement", 2);1377__decorateClass([1378n({ type: String })1379], BslibPopover.prototype, "bsOptions", 2);1380function hasHeader(header) {1381return !!header && header.childNodes.length > 0;1382}13831384// srcts/src/components/webcomponents/inputDarkMode.ts1385var BslibInputDarkMode = class extends s4 {1386constructor() {1387super(...arguments);1388this.attribute = "data-shinytheme";1389// eslint-disable-next-line @typescript-eslint/no-empty-function, @typescript-eslint/no-unused-vars1390this.onChangeCallback = (x2) => {1391};1392}1393// onValueChange = makeValueChangeEmitter(this, this.id);1394connectedCallback() {1395super.connectedCallback();1396this.attribute = this.getAttribute("attribute") || this.attribute;1397if (typeof this.mode === "undefined") {1398this.mode = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";1399}1400this.reflectPreference();1401window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change", ({ matches: isDark }) => {1402this.mode = isDark ? "dark" : "light";1403this.reflectPreference();1404});1405this._observeDocumentThemeAttribute();1406}1407disconnectedCallback() {1408this.observer.disconnect();1409super.disconnectedCallback();1410}1411_observeDocumentThemeAttribute() {1412this.observer = new MutationObserver((mutations) => {1413mutations.forEach((mutation) => {1414if (mutation.target !== document.documentElement)1415return;1416if (mutation.attributeName !== this.attribute)1417return;1418const newValue = document.documentElement.getAttribute(this.attribute);1419if (!newValue || newValue === this.mode)1420return;1421this.mode = newValue;1422});1423});1424const config = {1425attributes: true,1426childList: false,1427subtree: false1428};1429this.observer.observe(document.documentElement, config);1430}1431getValue() {1432return this.mode;1433}1434render() {1435const other = this.mode === "light" ? "dark" : "light";1436const label = `Switch from ${this.mode} to ${other} mode`;1437return x`1438<button1439title="${label}"1440aria-label="${label}"1441aria-live="polite"1442data-theme="${this.mode}"1443@click="${this.onClick}"1444>1445<svg class="sun-and-moon" aria-hidden="true" viewBox="0 0 24 24">1446<mask class="moon" id="moon-mask">1447<rect x="0" y="0" width="100%" height="100%" fill="white" />1448<circle cx="25" cy="10" r="6" fill="black" />1449</mask>1450<circle1451class="sun"1452cx="12"1453cy="12"1454r="6"1455mask="url(#moon-mask)"1456fill="currentColor"1457/>1458<g class="sun-beams" stroke="currentColor">1459<line x1="12" y1="1" x2="12" y2="3" />1460<line x1="12" y1="21" x2="12" y2="23" />1461<line x1="4.22" y1="4.22" x2="5.64" y2="5.64" />1462<line x1="18.36" y1="18.36" x2="19.78" y2="19.78" />1463<line x1="1" y1="12" x2="3" y2="12" />1464<line x1="21" y1="12" x2="23" y2="12" />1465<line x1="4.22" y1="19.78" x2="5.64" y2="18.36" />1466<line x1="18.36" y1="5.64" x2="19.78" y2="4.22" />1467</g>1468</svg>1469</button>1470`;1471}1472onClick(e6) {1473e6.stopPropagation();1474this.mode = this.mode === "light" ? "dark" : "light";1475}1476updated(changedProperties) {1477if (changedProperties.has("mode")) {1478this.reflectPreference();1479this.onChangeCallback(true);1480}1481}1482reflectPreference() {1483document.documentElement.setAttribute(this.attribute, this.mode);1484window.dispatchEvent(new Event("resize"));1485}1486};1487BslibInputDarkMode.isShinyInput = true;1488BslibInputDarkMode.tagName = "bslib-input-dark-mode";1489BslibInputDarkMode.shinyCustomMessageHandlers = {1490// eslint-disable-next-line @typescript-eslint/naming-convention1491"bslib.toggle-dark-mode": ({1492method,1493value1494}) => {1495if (method !== "toggle")1496return;1497if (typeof value === "undefined" || value === null) {1498const current = document.documentElement.dataset.bsTheme || "light";1499value = current === "light" ? "dark" : "light";1500}1501document.documentElement.dataset.bsTheme = value;1502}1503};1504BslibInputDarkMode.styles = [1505// CSS Variables1506i2`1507:host {1508/* open-props.style via shinycomponent */1509--text-1: var(--text-1-light, var(--gray-8, #343a40));1510--text-2: var(--text-2-light, var(--gray-7, #495057));1511--size-xxs: var(--size-1, 0.25rem);1512--ease-in-out-1: cubic-bezier(0.1, 0, 0.9, 1);1513--ease-in-out-2: cubic-bezier(0.3, 0, 0.7, 1);1514--ease-out-1: cubic-bezier(0, 0, 0.75, 1);1515--ease-out-3: cubic-bezier(0, 0, 0.3, 1);1516--ease-out-4: cubic-bezier(0, 0, 0.1, 1);15171518/* shinycomponent */1519--speed-fast: 0.15s;1520--speed-normal: 0.3s;15211522/* Size of the icon, uses em units so it scales to font-size */1523--size: 1.3em;15241525/* Because we are (most likely) bigger than one em we will need to move1526the button up or down to keep it looking right inline */1527--vertical-correction: calc((var(--size) - 1em) / 2);1528}1529`,1530i2`1531.sun-and-moon > :is(.moon, .sun, .sun-beams) {1532transform-origin: center center;1533}15341535.sun-and-moon > .sun {1536fill: none;1537stroke: var(--text-1);1538stroke-width: var(--stroke-w);1539}15401541button:is(:hover, :focus-visible)1542> :is(.sun-and-moon > :is(.moon, .sun)) {1543fill: var(--text-2);1544}15451546.sun-and-moon > .sun-beams {1547stroke: var(--text-1);1548stroke-width: var(--stroke-w);1549}15501551button:is(:hover, :focus-visible) :is(.sun-and-moon > .sun-beams) {1552background-color: var(--text-2);1553}15541555[data-theme="dark"] .sun-and-moon > .sun {1556fill: var(--text-1);1557stroke: none;1558stroke-width: 0;1559transform: scale(1.6);1560}15611562[data-theme="dark"] .sun-and-moon > .sun-beams {1563opacity: 0;1564}15651566[data-theme="dark"] .sun-and-moon > .moon > circle {1567transform: translateX(-10px);1568}15691570@supports (cx: 1) {1571[data-theme="dark"] .sun-and-moon > .moon > circle {1572transform: translateX(0);1573cx: 15;1574}1575}1576`,1577// Transitions1578i2`1579.sun-and-moon > .sun {1580transition: transform var(--speed-fast) var(--ease-in-out-2)1581var(--speed-fast),1582fill var(--speed-fast) var(--ease-in-out-2) var(--speed-fast),1583stroke-width var(--speed-normal) var(--ease-in-out-2);1584}15851586.sun-and-moon > .sun-beams {1587transition: transform var(--speed-fast) var(--ease-out-3),1588opacity var(--speed-fast) var(--ease-out-4);1589transition-delay: var(--speed-normal);1590}15911592.sun-and-moon .moon > circle {1593transition: transform var(--speed-fast) var(--ease-in-out-2),1594fill var(--speed-fast) var(--ease-in-out-2);1595transition-delay: 0s;1596}15971598@supports (cx: 1) {1599.sun-and-moon .moon > circle {1600transition: cx var(--speed-normal) var(--ease-in-out-2);1601}16021603[data-theme="dark"] .sun-and-moon .moon > circle {1604transition: cx var(--speed-fast) var(--ease-in-out-2);1605transition-delay: var(--speed-fast);1606}1607}16081609[data-theme="dark"] .sun-and-moon > .sun {1610transition-delay: 0s;1611transition-duration: var(--speed-normal);1612transition-timing-function: var(--ease-in-out-2);1613}16141615[data-theme="dark"] .sun-and-moon > .sun-beams {1616transform: scale(0.3);1617transition: transform var(--speed-normal) var(--ease-in-out-2),1618opacity var(--speed-fast) var(--ease-out-1);1619transition-delay: 0s;1620}1621`,1622i2`1623:host {1624display: inline-block;16251626/* We control the stroke size manually here. We don't want it getting so1627small its not visible but also not so big it looks cartoonish */1628--stroke-w: clamp(1px, 0.1em, 6px);1629}16301631button {1632/* This is needed to let the svg use the em sizes */1633font-size: inherit;16341635/* Make sure the button is fully centered */1636display: grid;1637place-content: center;16381639/* A little bit of padding to make it easier to press */1640padding: var(--size-xxs);1641background: none;1642border: none;1643aspect-ratio: 1;1644border-radius: 50%;1645cursor: pointer;1646touch-action: manipulation;1647-webkit-tap-highlight-color: transparent;1648outline-offset: var(--size-xxs);16491650/* Move down to adjust for being larger than 1em */1651transform: translateY(var(--vertical-correction));1652margin-block-end: var(--vertical-correction);1653}16541655/*1656button:is(:hover, :focus-visible) {1657background: var(--surface-4);1658}1659*/16601661button > svg {1662height: var(--size);1663width: var(--size);1664stroke-linecap: round;1665overflow: visible;1666}16671668svg line,1669svg circle {1670vector-effect: non-scaling-stroke;1671}1672`1673];1674__decorateClass([1675n({ type: String, reflect: true })1676], BslibInputDarkMode.prototype, "mode", 2);16771678// srcts/src/components/webcomponents/_makeInputBinding.ts1679function makeInputBinding(tagName, { type = null } = {}) {1680if (!window.Shiny) {1681return;1682}1683class NewCustomBinding extends Shiny["InputBinding"] {1684constructor() {1685super();1686}1687find(scope) {1688return $(scope).find(tagName);1689}1690getValue(el) {1691if ("getValue" in el) {1692return el.getValue();1693} else {1694return el.value;1695}1696}1697// eslint-disable-next-line @typescript-eslint/no-unused-vars1698getType(el) {1699return type;1700}1701subscribe(el, callback) {1702el.onChangeCallback = callback;1703}1704unsubscribe(el) {1705el.onChangeCallback = (x2) => {1706};1707}1708receiveMessage(el, data) {1709el.receiveMessage(el, data);1710}1711}1712Shiny.inputBindings.register(new NewCustomBinding(), `${tagName}-Binding`);1713}17141715// srcts/src/components/_shinyAddCustomMessageHandlers.ts1716function shinyAddCustomMessageHandlers(handlers) {1717if (!window.Shiny) {1718return;1719}1720for (const [name, handler] of Object.entries(handlers)) {1721Shiny.addCustomMessageHandler(name, handler);1722}1723}17241725// srcts/src/components/webcomponents/index.ts1726[BslibTooltip, BslibPopover, BslibInputDarkMode].forEach((cls) => {1727customElements.define(cls.tagName, cls);1728if (window.Shiny) {1729if (cls.isShinyInput)1730makeInputBinding(cls.tagName);1731if ("shinyCustomMessageHandlers" in cls) {1732shinyAddCustomMessageHandlers(cls["shinyCustomMessageHandlers"]);1733}1734}1735});1736})();1737/*! Bundled license information:17381739@lit/reactive-element/decorators/custom-element.js:1740(**1741* @license1742* Copyright 2017 Google LLC1743* SPDX-License-Identifier: BSD-3-Clause1744*)17451746@lit/reactive-element/decorators/property.js:1747(**1748* @license1749* Copyright 2017 Google LLC1750* SPDX-License-Identifier: BSD-3-Clause1751*)17521753@lit/reactive-element/decorators/state.js:1754(**1755* @license1756* Copyright 2017 Google LLC1757* SPDX-License-Identifier: BSD-3-Clause1758*)17591760@lit/reactive-element/decorators/base.js:1761(**1762* @license1763* Copyright 2017 Google LLC1764* SPDX-License-Identifier: BSD-3-Clause1765*)17661767@lit/reactive-element/decorators/event-options.js:1768(**1769* @license1770* Copyright 2017 Google LLC1771* SPDX-License-Identifier: BSD-3-Clause1772*)17731774@lit/reactive-element/decorators/query.js:1775(**1776* @license1777* Copyright 2017 Google LLC1778* SPDX-License-Identifier: BSD-3-Clause1779*)17801781@lit/reactive-element/decorators/query-all.js:1782(**1783* @license1784* Copyright 2017 Google LLC1785* SPDX-License-Identifier: BSD-3-Clause1786*)17871788@lit/reactive-element/decorators/query-async.js:1789(**1790* @license1791* Copyright 2017 Google LLC1792* SPDX-License-Identifier: BSD-3-Clause1793*)17941795@lit/reactive-element/decorators/query-assigned-elements.js:1796(**1797* @license1798* Copyright 2021 Google LLC1799* SPDX-License-Identifier: BSD-3-Clause1800*)18011802@lit/reactive-element/decorators/query-assigned-nodes.js:1803(**1804* @license1805* Copyright 2017 Google LLC1806* SPDX-License-Identifier: BSD-3-Clause1807*)18081809@lit/reactive-element/css-tag.js:1810(**1811* @license1812* Copyright 2019 Google LLC1813* SPDX-License-Identifier: BSD-3-Clause1814*)18151816@lit/reactive-element/reactive-element.js:1817(**1818* @license1819* Copyright 2017 Google LLC1820* SPDX-License-Identifier: BSD-3-Clause1821*)18221823lit-html/lit-html.js:1824(**1825* @license1826* Copyright 2017 Google LLC1827* SPDX-License-Identifier: BSD-3-Clause1828*)18291830lit-element/lit-element.js:1831(**1832* @license1833* Copyright 2017 Google LLC1834* SPDX-License-Identifier: BSD-3-Clause1835*)18361837lit-html/is-server.js:1838(**1839* @license1840* Copyright 2022 Google LLC1841* SPDX-License-Identifier: BSD-3-Clause1842*)1843*/1844184518461847