monobill-mintui 0.6.651 → 0.6.652

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. package/bin/component-dependencies.json +9 -0
  2. package/dist/components/chunks/date-picker-BQsCoKaK.js +1282 -0
  3. package/dist/components/chunks/date-picker-tm5Oc92c.js +1 -0
  4. package/dist/components/chunks/{input-CdsHKiuL.js → input-DcglGwsR.js} +1 -1
  5. package/dist/components/chunks/{input-BhptfvVH.js → input-awdYlp-G.js} +1 -1
  6. package/dist/components/chunks/{popover-BRi53qYL.js → popover-FdMS4yAD.js} +1 -1
  7. package/dist/components/chunks/{popover-PNIdAt8C.js → popover-wGdggZ-a.js} +1 -1
  8. package/dist/components/chunks/{table-ty0Sgdpv.js → table-B9e-cnAC.js} +1 -1
  9. package/dist/components/chunks/{table-odOvGji2.js → table-vjF3q3J5.js} +1 -1
  10. package/dist/components/chunks/time-picker-Cq3qzkDb.js +1 -0
  11. package/dist/components/chunks/time-picker-S0bc0BPU.js +360 -0
  12. package/dist/components/date-picker/DatePicker.d.ts +5 -0
  13. package/dist/components/date-picker/DatePicker.d.ts.map +1 -1
  14. package/dist/components/date-picker/browser.js +2 -1270
  15. package/dist/components/date-picker/index.cjs +1 -1
  16. package/dist/components/date-picker/index.js +2 -1270
  17. package/dist/components/datetime-picker/DateTimePicker.d.ts +44 -0
  18. package/dist/components/datetime-picker/DateTimePicker.d.ts.map +1 -0
  19. package/dist/components/datetime-picker/browser.js +255 -0
  20. package/dist/components/datetime-picker/index.cjs +1 -0
  21. package/dist/components/datetime-picker/index.d.ts +4 -0
  22. package/dist/components/datetime-picker/index.d.ts.map +1 -0
  23. package/dist/components/datetime-picker/index.js +243 -0
  24. package/dist/components/form/Form.d.ts.map +1 -1
  25. package/dist/components/form/browser.js +9 -8
  26. package/dist/components/form/index.cjs +1 -1
  27. package/dist/components/form/index.js +9 -8
  28. package/dist/components/input/browser.js +1 -1
  29. package/dist/components/input/index.cjs +1 -1
  30. package/dist/components/input/index.js +1 -1
  31. package/dist/components/link/browser.js +1 -1
  32. package/dist/components/link/index.cjs +1 -1
  33. package/dist/components/link/index.js +1 -1
  34. package/dist/components/navigation/browser.js +2 -2
  35. package/dist/components/navigation/index.cjs +1 -1
  36. package/dist/components/navigation/index.js +2 -2
  37. package/dist/components/popover/browser.js +1 -1
  38. package/dist/components/popover/index.cjs +1 -1
  39. package/dist/components/popover/index.js +1 -1
  40. package/dist/components/resource-table/browser.js +6 -6
  41. package/dist/components/resource-table/index.cjs +1 -1
  42. package/dist/components/resource-table/index.js +6 -6
  43. package/dist/components/scroll-fade/browser.js +1 -1
  44. package/dist/components/scroll-fade/index.cjs +1 -1
  45. package/dist/components/scroll-fade/index.js +1 -1
  46. package/dist/components/search/Search.d.ts.map +1 -1
  47. package/dist/components/search/browser.js +3 -3
  48. package/dist/components/search/index.cjs +1 -1
  49. package/dist/components/search/index.js +3 -3
  50. package/dist/components/select/browser.js +1 -1
  51. package/dist/components/select/index.cjs +1 -1
  52. package/dist/components/select/index.js +1 -1
  53. package/dist/components/side-navigation/browser.js +4 -4
  54. package/dist/components/side-navigation/index.cjs +1 -1
  55. package/dist/components/side-navigation/index.js +4 -4
  56. package/dist/components/sortable/browser.js +1 -1
  57. package/dist/components/sortable/index.cjs +1 -1
  58. package/dist/components/sortable/index.js +1 -1
  59. package/dist/components/table/browser.js +1 -1
  60. package/dist/components/table/index.cjs +1 -1
  61. package/dist/components/table/index.js +1 -1
  62. package/dist/components/tags/browser.js +1 -1
  63. package/dist/components/tags/index.cjs +1 -1
  64. package/dist/components/tags/index.js +1 -1
  65. package/dist/components/time-picker/TimePicker.d.ts +1 -0
  66. package/dist/components/time-picker/TimePicker.d.ts.map +1 -1
  67. package/dist/components/time-picker/browser.js +2 -347
  68. package/dist/components/time-picker/index.cjs +1 -1
  69. package/dist/components/time-picker/index.js +2 -347
  70. package/dist/components/tree/browser.js +2 -2
  71. package/dist/components/tree/index.cjs +1 -1
  72. package/dist/components/tree/index.js +2 -2
  73. package/dist/datetime-picker.css +3 -0
  74. package/dist/index.cjs +3 -3
  75. package/dist/index.css +10 -1
  76. package/dist/index.d.ts +1 -0
  77. package/dist/index.js +951 -697
  78. package/dist/navigation-search.json +7 -0
  79. package/dist/theme.css +5 -0
  80. package/dist/time-picker.css +1 -1
  81. package/package.json +10 -1
  82. /package/dist/components/chunks/{ScrollFade-DIKawLYD.js → ScrollFade-D1FPF6ZS.js} +0 -0
  83. /package/dist/components/chunks/{ScrollFade-Br6QSd_-.js → ScrollFade-DT2Br2g7.js} +0 -0
  84. /package/dist/components/chunks/{caret-down-DRrCYUv0.js → caret-down-DGeJj0xv.js} +0 -0
  85. /package/dist/components/chunks/{caret-down-BU-Ee_JS.js → caret-down-DJvCrCjc.js} +0 -0
  86. /package/dist/components/chunks/{caret-right-BzeJ0Fw3.js → caret-right-BcZ9bOhS.js} +0 -0
  87. /package/dist/components/chunks/{caret-right-Bh7uMg-Y.js → caret-right-CgIVfus7.js} +0 -0
  88. /package/dist/components/chunks/{link-BsC3zT_I.js → link-BjbBJpI6.js} +0 -0
  89. /package/dist/components/chunks/{link-dTjSvr4E.js → link-CU-gTgir.js} +0 -0
  90. /package/dist/components/chunks/{search-v06eZL4m.js → search--bcFMYMP.js} +0 -0
  91. /package/dist/components/chunks/{search-CTAGy5ab.js → search-Cixhf7hA.js} +0 -0
  92. /package/dist/components/chunks/{sortable-B1nMJBah.js → sortable-CNlF0_gv.js} +0 -0
  93. /package/dist/components/chunks/{sortable-CXM-7eyL.js → sortable-CVK48xj1.js} +0 -0
package/dist/index.js CHANGED
@@ -6003,6 +6003,18 @@ var In = class extends HTMLElement {
6003
6003
  getValue() {
6004
6004
  return this.getAttribute("value") || "";
6005
6005
  }
6006
+ getPopoverElement() {
6007
+ return this._popover;
6008
+ }
6009
+ getPopoverContentElement() {
6010
+ return this._popover?.querySelector(".popover-content") || null;
6011
+ }
6012
+ getDisplayElement() {
6013
+ return this._displayEl;
6014
+ }
6015
+ refreshCalendar() {
6016
+ this._buildCalendar();
6017
+ }
6006
6018
  setValue(e) {
6007
6019
  e ? (this.setAttribute("value", e), this._textInput && (this._textInput.value = e), this._parseValue(e)) : (this.removeAttribute("value"), this._textInput && (this._textInput.value = ""), this._selectedStartDate = null, this._selectedEndDate = null), this._buildCalendar(), this._updateDisplayText();
6008
6020
  }
@@ -7084,7 +7096,7 @@ var In = class extends HTMLElement {
7084
7096
  else {
7085
7097
  this._selectedStartDate = r, this._selectedEndDate = null;
7086
7098
  let e = this._formatDate(r, t);
7087
- this.setValue(e), this._textInput && (this._textInput.value = e), this._popover && typeof this._popover.close == "function" && this._popover.close();
7099
+ this.setValue(e), this._textInput && (this._textInput.value = e), !this.hasAttribute("keep-open-on-select") && this._popover && typeof this._popover.close == "function" && this._popover.close();
7088
7100
  }
7089
7101
  this._buildCalendar(), this._updateDisplayText(), this._exitInputMode();
7090
7102
  let a = new Event("input", {
@@ -7187,224 +7199,806 @@ var In = class extends HTMLElement {
7187
7199
  this._focusTrapHandler &&= (document.removeEventListener("keydown", this._focusTrapHandler, !0), null), this._escapeHandler &&= (document.removeEventListener("keydown", this._escapeHandler, !0), null);
7188
7200
  }
7189
7201
  };
7190
- customElements.get("mint-date-picker") || a("mint-date-picker", In), s({
7191
- name: "upload",
7192
- viewBox: "0 0 24 24",
7193
- path: "M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12",
7194
- strokeLinecap: "round",
7195
- strokeLinejoin: "round"
7196
- }), s({
7197
- name: "attach",
7198
- viewBox: "0 0 24 24",
7199
- path: "M15.172 7l-6.586 6.586a2 2 0 102.828 2.828l6.414-6.586a4 4 0 00-5.656-5.656l-6.415 6.585a6 6 0 108.486 8.486L20.5 13",
7200
- strokeLinecap: "round",
7201
- strokeLinejoin: "round"
7202
- });
7202
+ customElements.get("mint-date-picker") || a("mint-date-picker", In);
7203
7203
  //#endregion
7204
- //#region src/components/dropzone/Dropzone.ts
7204
+ //#region src/components/time-picker/TimePicker.ts
7205
7205
  var Ln = class extends HTMLElement {
7206
+ constructor(...e) {
7207
+ super(...e), this._triggerId = `mint-time-picker-trigger-${Math.random().toString(36).slice(2, 10)}`, this._popover = null, this._popoverObserver = null, this._triggerClickObserver = null, this._inputEl = null, this._hiddenInput = null, this._single = {
7208
+ hour: 9,
7209
+ minute: 0,
7210
+ second: 0,
7211
+ meridiem: "AM"
7212
+ }, this._rangeStart = {
7213
+ hour: 9,
7214
+ minute: 0,
7215
+ second: 0,
7216
+ meridiem: "AM"
7217
+ }, this._rangeEnd = {
7218
+ hour: 5,
7219
+ minute: 0,
7220
+ second: 0,
7221
+ meridiem: "PM"
7222
+ }, this._invalidFromInput = !1;
7223
+ }
7206
7224
  static get observedAttributes() {
7207
7225
  return [
7226
+ "value",
7227
+ "inline",
7208
7228
  "label",
7209
- "accept",
7210
- "multiple",
7211
- "width",
7212
- "height",
7229
+ "info",
7213
7230
  "disabled",
7231
+ "id",
7214
7232
  "name",
7233
+ "required",
7234
+ "readonly",
7235
+ "range",
7236
+ "hours",
7237
+ "minutes",
7238
+ "seconds",
7215
7239
  "error",
7216
- "error-message",
7217
- "loading",
7218
- "aria-label",
7219
- "aria-describedby"
7240
+ "error-message"
7220
7241
  ];
7221
7242
  }
7222
- constructor() {
7223
- super(), this._dropzone = null, this._fileInput = null, this._previewContainer = null, this._isDragging = !1, this._wasDragging = !1, this._isUpdatingFiles = !1, this._listenersInitialized = !1, this._selectedFiles = [], this._previewUrls = [], this._resetHandler = null, this._a11yId = `mint-dropzone-${Math.random().toString(36).slice(2, 10)}`;
7224
- }
7225
7243
  connectedCallback() {
7226
- this.classList.add("mint-dropzone"), this.render(), this._attachFormResetListener();
7244
+ this.classList.add("mint-time-picker-host"), this._parseAndApplyValue(this.getAttribute("value") || ""), this.render();
7227
7245
  }
7228
7246
  disconnectedCallback() {
7229
- if (this.removeEventListeners(), this._cleanupPreviewUrls(), this._resetHandler) {
7230
- let e = this.closest("form");
7231
- e && e.removeEventListener("reset", this._resetHandler), this._resetHandler = null;
7232
- }
7247
+ this._popoverObserver &&= (this._popoverObserver.disconnect(), null), this._triggerClickObserver &&= (document.removeEventListener("click", this._triggerClickObserver, !0), null);
7233
7248
  }
7234
7249
  attributeChangedCallback(e, t, n) {
7235
7250
  if (t !== n) {
7236
- if (e === "error" || e === "error-message") {
7237
- this._updateDragStateClass(), this._renderErrorState(this.hasError(), this.getErrorMessage());
7238
- return;
7239
- }
7240
- if (e === "loading") {
7241
- this.render();
7251
+ if (e === "value") {
7252
+ this._parseAndApplyValue(n || ""), this._syncHiddenInput(), this._syncInputValue();
7253
+ {
7254
+ let e = (this._popover || this).querySelector("[data-mint-time-picker-body=\"true\"]");
7255
+ e && this._buildPopoverContent(e);
7256
+ }
7242
7257
  return;
7243
7258
  }
7244
- this.render();
7259
+ e !== "error" && e !== "error-message" && (this._invalidFromInput = !1), this.render();
7245
7260
  }
7246
7261
  }
7247
- getLabel() {
7248
- return this.getAttribute("label") || "";
7249
- }
7250
- getAccept() {
7251
- return this.getAttribute("accept") || "";
7262
+ get value() {
7263
+ return this.getValue();
7252
7264
  }
7253
- isMultiple() {
7254
- return this.getAttribute("multiple") === "true";
7265
+ set value(e) {
7266
+ this.setValue(e || "");
7255
7267
  }
7256
- getWidth() {
7257
- return this.getAttribute("width") || "200px";
7268
+ getValue() {
7269
+ return this.getAttribute("value") || "";
7258
7270
  }
7259
- getHeight() {
7260
- return this.getAttribute("height") || "200px";
7271
+ setValue(e) {
7272
+ e ? this.setAttribute("value", e) : this.removeAttribute("value"), this._parseAndApplyValue(e || ""), this._syncHiddenInput(), this._syncInputValue();
7261
7273
  }
7262
- _renderSkeleton(e) {
7263
- let t = this.querySelector(".mint-dropzone-skeleton-container"), n = this._dropzone;
7264
- if (e) {
7265
- this.classList.add("is-loading"), t || (t = document.createElement("div"), t.className = "mint-dropzone-skeleton-container", n ? (n.classList.add("is-positioned"), n.appendChild(t)) : this.appendChild(t));
7266
- let e = t.querySelector(".mint-dropzone-skeleton");
7267
- e || (e = document.createElement("div"), e.className = "mint-dropzone-skeleton", t.appendChild(e)), t.classList.add("is-visible"), n?.classList.add("is-loading");
7268
- } else this.classList.remove("is-loading"), t && t.classList.remove("is-visible"), n?.classList.remove("is-loading");
7274
+ isRange() {
7275
+ return this.getAttribute("range") === "true";
7269
7276
  }
7270
- getName() {
7271
- return this.getAttribute("name") || "";
7277
+ isHoursEnabled() {
7278
+ let e = this.getAttribute("hours");
7279
+ return e === null ? !0 : e !== "false";
7272
7280
  }
7273
- hasError() {
7274
- return this.getAttribute("error") === "true";
7281
+ isMinutesEnabled() {
7282
+ let e = this.getAttribute("minutes");
7283
+ return e === null ? !0 : e !== "false";
7275
7284
  }
7276
- getErrorMessage() {
7277
- return this.getAttribute("error-message") || "";
7285
+ isSecondsEnabled() {
7286
+ let e = this.getAttribute("seconds");
7287
+ return e === null ? !1 : e !== "false";
7278
7288
  }
7279
7289
  isDisabled() {
7280
7290
  return this.getAttribute("disabled") === "true";
7281
7291
  }
7282
- isLoading() {
7283
- return this.getAttribute("loading") === "true";
7292
+ isReadonly() {
7293
+ return this.getAttribute("readonly") === "true";
7284
7294
  }
7285
- render() {
7286
- let e = this.isLoading(), t = this.getLabel(), n = this.getAccept(), r = this.isMultiple(), i = this.isDisabled(), a = this.getWidth(), o = this.getHeight(), s = this.getName(), c = this.hasError(), l = this.getErrorMessage();
7287
- if (this._dropzone || (this._dropzone = document.createElement("div"), this.appendChild(this._dropzone)), this._updateDragStateClass(), this._dropzone.setAttribute("aria-invalid", c ? "true" : "false"), i) this._dropzone.setAttribute("tabindex", "-1"), this._dropzone.removeAttribute("role");
7288
- else {
7289
- this._dropzone.setAttribute("tabindex", "0"), this._dropzone.setAttribute("role", "button"), this._dropzone.setAttribute("aria-label", this.getAttribute("aria-label") || t || "File upload dropzone");
7290
- let e = (this.getAttribute("aria-describedby") || "").split(/\s+/).filter(Boolean), n = this.querySelector(".mint-dropzone-error");
7291
- n && (n.id = `${this.id || this._a11yId}-error`, e.push(n.id)), e.length ? this._dropzone.setAttribute("aria-describedby", Array.from(new Set(e)).join(" ")) : this._dropzone.removeAttribute("aria-describedby");
7292
- }
7293
- this._dropzone.style.width = a, this._dropzone.style.height = o, this._dropzone.style.minWidth = a, this._dropzone.style.minHeight = o, this._fileInput || (this._fileInput = document.createElement("input"), this._fileInput.type = "file", this._fileInput.className = "mint-dropzone-file-input", this._fileInput.setAttribute("tabindex", "-1"), this._fileInput.setAttribute("aria-hidden", "true"), this._dropzone.appendChild(this._fileInput)), this._fileInput.accept = n, this._fileInput.multiple = r, this._fileInput.disabled = i, s ? this._fileInput.name = s : this._fileInput.removeAttribute("name"), this._fileInput.setAttribute("aria-invalid", c ? "true" : "false");
7294
- let u = this._dropzone.querySelector(".mint-dropzone-icon"), d = this._dropzone.querySelector(".mint-dropzone-label");
7295
- u && u.remove(), d && d.remove();
7296
- let f = document.createElement("div");
7297
- f.className = "mint-dropzone-icon";
7298
- let p = document.createElement("mint-icon");
7299
- if (p.setAttribute("name", "upload"), p.className = "mint-dropzone-upload-icon", f.appendChild(p), this._dropzone.appendChild(f), t) {
7300
- let e = document.createElement("div");
7301
- e.className = "mint-dropzone-label", e.textContent = t, this._dropzone.appendChild(e);
7302
- }
7303
- this.setupEventListeners(), this._renderErrorState(c, l), this._renderPreviews(), this._renderSkeleton(e);
7295
+ isRequired() {
7296
+ return this.getAttribute("required") === "true";
7304
7297
  }
7305
- _updateDragState() {
7306
- this._dropzone && this._updateDragStateClass();
7298
+ hasExternalError() {
7299
+ return this.getAttribute("error") === "true";
7307
7300
  }
7308
- _renderErrorState(e, t) {
7309
- let n = this.querySelector(".mint-dropzone-error");
7310
- if (e && t ? (n || (n = document.createElement("div"), n.className = "mint-dropzone-error", this.appendChild(n)), n.textContent = t) : n && n.remove(), this._dropzone) {
7311
- this._dropzone.setAttribute("aria-invalid", String(e)), n && (n.id = `${this.id || this._a11yId}-error`);
7312
- let t = (this.getAttribute("aria-describedby") || "").split(/\s+/).filter(Boolean);
7313
- n && t.push(n.id), t.length ? this._dropzone.setAttribute("aria-describedby", Array.from(new Set(t)).join(" ")) : this._dropzone.removeAttribute("aria-describedby");
7314
- }
7301
+ getExternalErrorMessage() {
7302
+ return this.getAttribute("error-message") || "";
7315
7303
  }
7316
- _updateDragStateClass() {
7317
- if (!this._dropzone) return;
7318
- let e = this.isDisabled(), t = this.hasError();
7319
- this._dropzone.className = "mint-dropzone-target", this._dropzone.classList.toggle("has-files", this._selectedFiles.length > 0), this._dropzone.classList.toggle("is-dragging", this._isDragging), this._dropzone.classList.toggle("has-error", t), this._dropzone.classList.toggle("is-disabled", e);
7304
+ getLabel() {
7305
+ return this.getAttribute("label") || "";
7320
7306
  }
7321
- setupEventListeners() {
7322
- this._listenersInitialized || (this._listenersInitialized = !0, this.removeEventListeners(), !(!this._dropzone || !this._fileInput || this.isDisabled()) && (this._onDropzoneClick ||= (e) => {
7323
- if (!(this.isDisabled() || !this._fileInput) && e.target !== this._fileInput && (e.stopPropagation(), e.preventDefault(), e.isTrusted)) try {
7324
- this._fileInput.click();
7325
- } catch (e) {
7326
- console.debug("File chooser blocked:", e);
7327
- }
7328
- }, this._onDragOver ||= (e) => {
7329
- e.preventDefault(), e.stopPropagation(), this.isDisabled() || this._isDragging || (this._isDragging = !0, this._wasDragging = !0, this._updateDragState());
7330
- }, this._onDragLeave ||= (e) => {
7331
- e.preventDefault(), e.stopPropagation();
7332
- let t = this._dropzone?.getBoundingClientRect();
7333
- t && (e.clientX < t.left || e.clientX > t.right || e.clientY < t.top || e.clientY > t.bottom) && this._isDragging && (this._isDragging = !1, this._wasDragging = !1, this._updateDragState());
7334
- }, this._onDrop ||= (e) => {
7335
- if (e.preventDefault(), e.stopPropagation(), this._isDragging && (this._isDragging = !1, this._wasDragging = !1, this._updateDragState()), this.isDisabled()) return;
7336
- let t = e.dataTransfer?.files;
7337
- t && t.length > 0 && this._handleFiles(t);
7338
- }, this._onFileInputInput ||= (e) => {
7339
- e.stopImmediatePropagation(), e.stopPropagation();
7340
- }, this._onKeyDown ||= (e) => {
7341
- if (!(this.isDisabled() || !this._fileInput) && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), e.isTrusted)) try {
7342
- this._fileInput.click();
7343
- } catch (e) {
7344
- console.debug("File chooser blocked:", e);
7345
- }
7346
- }, this._onFocus ||= (e) => {
7347
- this._dropzone && !this.isDisabled() && this._dropzone.classList.add("is-focused");
7348
- }, this._onBlur ||= (e) => {
7349
- this._dropzone;
7350
- }, this._onFileInputChange ||= (e) => {
7351
- if (e.stopImmediatePropagation(), e.stopPropagation(), this._isUpdatingFiles) return;
7352
- let t = e.target.files;
7353
- if (t && t.length > 0) {
7354
- let e = this.getAccept(), n = this.isMultiple(), r = [], i = [];
7355
- for (let n = 0; n < t.length; n++) {
7356
- let a = t[n];
7357
- this._isFileAccepted(a, e) ? r.push(a) : i.push(a);
7358
- }
7359
- if (!n && r.length > 1 && (i.push(...r.slice(1)), r.splice(1)), i.length > 0) {
7360
- let e = new CustomEvent("dropRejected", {
7361
- detail: {
7362
- files: i,
7363
- reason: "File type not accepted or multiple files not allowed"
7364
- },
7365
- bubbles: !0,
7366
- cancelable: !0
7367
- });
7368
- this.dispatchEvent(e);
7369
- }
7370
- r.length > 0 && this._applyValidFiles(r);
7371
- }
7372
- }, this._dropzone.addEventListener("click", this._onDropzoneClick), this._dropzone.addEventListener("dragover", this._onDragOver), this._dropzone.addEventListener("dragleave", this._onDragLeave), this._dropzone.addEventListener("drop", this._onDrop), this._dropzone.addEventListener("keydown", this._onKeyDown), this._dropzone.addEventListener("focus", this._onFocus), this._dropzone.addEventListener("blur", this._onBlur), this._fileInput.addEventListener("change", this._onFileInputChange), this._fileInput.addEventListener("input", this._onFileInputInput, !0)));
7307
+ getInfo() {
7308
+ return this.getAttribute("info") || "";
7373
7309
  }
7374
- removeEventListeners() {
7375
- this._dropzone && (this._onDropzoneClick && this._dropzone.removeEventListener("click", this._onDropzoneClick), this._onDragOver && this._dropzone.removeEventListener("dragover", this._onDragOver), this._onDragLeave && this._dropzone.removeEventListener("dragleave", this._onDragLeave), this._onDrop && this._dropzone.removeEventListener("drop", this._onDrop), this._onKeyDown && this._dropzone.removeEventListener("keydown", this._onKeyDown), this._onFocus && this._dropzone.removeEventListener("focus", this._onFocus), this._onBlur && this._dropzone.removeEventListener("blur", this._onBlur)), this._fileInput && (this._onFileInputChange && this._fileInput.removeEventListener("change", this._onFileInputChange), this._onFileInputInput && this._fileInput.removeEventListener("input", this._onFileInputInput, !0)), this._isDragging = !1, this._listenersInitialized = !1;
7310
+ getName() {
7311
+ return this.getAttribute("name") || "";
7376
7312
  }
7377
- _handleFiles(e) {
7378
- let t = this.getAccept(), n = this.isMultiple(), r = [], i = [];
7379
- for (let n = 0; n < e.length; n++) {
7380
- let a = e[n];
7381
- this._isFileAccepted(a, t) ? r.push(a) : i.push(a);
7382
- }
7383
- if (!n && r.length > 1 && (i.push(...r.slice(1)), r.splice(1)), i.length > 0) {
7384
- let e = new CustomEvent("dropRejected", {
7385
- detail: {
7386
- files: i,
7387
- reason: "File type not accepted or multiple files not allowed"
7388
- },
7389
- bubbles: !0,
7390
- cancelable: !0
7391
- });
7392
- this.dispatchEvent(e);
7393
- }
7394
- r.length > 0 && this._applyValidFiles(r);
7313
+ _getEffectiveError() {
7314
+ return {
7315
+ hasError: this.hasExternalError(),
7316
+ message: this.getExternalErrorMessage()
7317
+ };
7395
7318
  }
7396
- _isFileAccepted(e, t) {
7397
- if (!t) return !0;
7398
- let n = t.split(",").map((e) => e.trim().toLowerCase());
7399
- for (let t of n) if (t.startsWith(".")) {
7400
- if ("." + e.name.split(".").pop()?.toLowerCase() === t) return !0;
7401
- } else if (t.includes("/*")) {
7402
- if (t.split("/")[0] === e.type.split("/")[0]) return !0;
7403
- } else if (e.type === t) return !0;
7404
- return !1;
7319
+ _formatParts(e) {
7320
+ let t = this.isHoursEnabled(), n = this.isMinutesEnabled(), r = this.isSecondsEnabled(), i = [];
7321
+ return t && i.push(e.hour.toString()), n && i.push(e.minute.toString().padStart(2, "0")), r && i.push(e.second.toString().padStart(2, "0")), t ? `${i.join(":")} ${e.meridiem.toLowerCase()}` : i.join(":");
7405
7322
  }
7406
- _dispatchEvent(e, t) {
7407
- let n = t.target, r = new CustomEvent(e, {
7323
+ _to24Hour(e) {
7324
+ let t = e.hour % 12;
7325
+ return e.meridiem === "PM" && (t += 12), {
7326
+ hour: t,
7327
+ minute: e.minute,
7328
+ second: e.second
7329
+ };
7330
+ }
7331
+ _formatParts24(e) {
7332
+ let t = this.isHoursEnabled(), n = this.isMinutesEnabled(), r = this.isSecondsEnabled(), i = this._to24Hour(e), a = [];
7333
+ return t && a.push(i.hour.toString().padStart(2, "0")), n && a.push(i.minute.toString().padStart(2, "0")), r && a.push(i.second.toString().padStart(2, "0")), a.join(":");
7334
+ }
7335
+ _getDisplayValue() {
7336
+ return this.isRange() ? `${this._formatParts(this._rangeStart)} - ${this._formatParts(this._rangeEnd)}` : this._formatParts(this._single);
7337
+ }
7338
+ _getOutputValue() {
7339
+ return this.isRange() ? `${this._formatParts24(this._rangeStart)} - ${this._formatParts24(this._rangeEnd)}` : this._formatParts24(this._single);
7340
+ }
7341
+ _getExpectedFormat() {
7342
+ let e = this.isHoursEnabled(), t = this.isMinutesEnabled(), n = this.isSecondsEnabled(), r = [];
7343
+ e && r.push("h"), t && r.push("mm"), n && r.push("ss");
7344
+ let i = e ? `${r.join(":")} am/pm` : r.join(":");
7345
+ return this.isRange() ? `${i} - ${i}` : i;
7346
+ }
7347
+ _syncHiddenInput() {
7348
+ this._hiddenInput && (this._hiddenInput.value = this.getValue() || this._getOutputValue());
7349
+ }
7350
+ _syncInputValue() {
7351
+ this._inputEl && (this._inputEl.value = this._getDisplayValue(), typeof this._inputEl.render == "function" && this._inputEl.render());
7352
+ }
7353
+ _emitChangeFromPicker() {
7354
+ let e = this._getOutputValue();
7355
+ this._invalidFromInput = !1, this.setAttribute("value", e), this._syncHiddenInput(), this._syncInputValue(), this.dispatchEvent(new Event("input", {
7356
+ bubbles: !0,
7357
+ composed: !0
7358
+ })), this.dispatchEvent(new Event("change", { bubbles: !0 }));
7359
+ }
7360
+ _parseSingle(e) {
7361
+ let t = this.isHoursEnabled(), n = this.isMinutesEnabled(), r = this.isSecondsEnabled(), i = e.trim();
7362
+ if (t) {
7363
+ let e = i.match(/^(\d{1,2})(?::(\d{2}))?(?::(\d{2}))?\s*(am|pm)$/i);
7364
+ if (!e) return null;
7365
+ let t = Number(e[1]), a = Number(e[2] ?? 0), o = Number(e[3] ?? 0), s = e[4].toUpperCase();
7366
+ return t < 1 || t > 12 || n && (a < 0 || a > 59) || r && (o < 0 || o > 59) ? null : {
7367
+ hour: t,
7368
+ minute: a,
7369
+ second: o,
7370
+ meridiem: s
7371
+ };
7372
+ }
7373
+ let a = i.match(/^(\d{2})(?::(\d{2}))?$/);
7374
+ if (!a) return null;
7375
+ let o = Number(a[1]), s = Number(a[2] ?? 0);
7376
+ return n && (o < 0 || o > 59) || r && (s < 0 || s > 59) ? null : {
7377
+ hour: 12,
7378
+ minute: o,
7379
+ second: s,
7380
+ meridiem: "AM"
7381
+ };
7382
+ }
7383
+ _parseSingleOutput24(e) {
7384
+ let t = this.isHoursEnabled(), n = this.isMinutesEnabled(), r = this.isSecondsEnabled(), i = e.trim();
7385
+ if (t) {
7386
+ let e = i.match(/^(\d{2})(?::(\d{2}))?(?::(\d{2}))?$/);
7387
+ if (!e) return null;
7388
+ let t = Number(e[1]), a = Number(e[2] ?? 0), o = Number(e[3] ?? 0);
7389
+ if (t < 0 || t > 23 || n && (a < 0 || a > 59) || r && (o < 0 || o > 59)) return null;
7390
+ let s = t >= 12 ? "PM" : "AM";
7391
+ return {
7392
+ hour: t % 12 == 0 ? 12 : t % 12,
7393
+ minute: a,
7394
+ second: o,
7395
+ meridiem: s
7396
+ };
7397
+ }
7398
+ let a = i.match(/^(\d{2})(?::(\d{2}))?$/);
7399
+ if (!a) return null;
7400
+ let o = Number(a[1]), s = Number(a[2] ?? 0);
7401
+ return n && (o < 0 || o > 59) || r && (s < 0 || s > 59) ? null : {
7402
+ hour: 12,
7403
+ minute: o,
7404
+ second: s,
7405
+ meridiem: "AM"
7406
+ };
7407
+ }
7408
+ _parseAndApplyValue(e) {
7409
+ if (!e) return !1;
7410
+ if (this.isRange()) {
7411
+ let [t, n] = e.split("-").map((e) => e.trim()), r = this._parseSingleOutput24(t || ""), i = this._parseSingleOutput24(n || "");
7412
+ return !r || !i ? !1 : (this._rangeStart = r, this._rangeEnd = i, !0);
7413
+ }
7414
+ let t = this._parseSingleOutput24(e);
7415
+ return t ? (this._single = t, !0) : !1;
7416
+ }
7417
+ _parseAndApplyDisplayValue(e) {
7418
+ if (!e) return !1;
7419
+ if (this.isRange()) {
7420
+ let [t, n] = e.split("-").map((e) => e.trim()), r = this._parseSingle(t || ""), i = this._parseSingle(n || "");
7421
+ return !r || !i ? !1 : (this._rangeStart = r, this._rangeEnd = i, !0);
7422
+ }
7423
+ let t = this._parseSingle(e);
7424
+ return t ? (this._single = t, !0) : !1;
7425
+ }
7426
+ _handleTypedValue(e) {
7427
+ let t = e.trim();
7428
+ if (!t) {
7429
+ this._invalidFromInput = !1, this.removeAttribute("value"), this._syncHiddenInput(), this._syncInputValue();
7430
+ return;
7431
+ }
7432
+ if (!this._parseAndApplyDisplayValue(t)) {
7433
+ this._invalidFromInput = !0, this.removeAttribute("value"), this._inputEl && (this._inputEl.value = ""), this._syncHiddenInput(), this.render(), this.dispatchEvent(new Event("input", {
7434
+ bubbles: !0,
7435
+ composed: !0
7436
+ })), this.dispatchEvent(new Event("change", { bubbles: !0 }));
7437
+ return;
7438
+ }
7439
+ this._invalidFromInput = !1;
7440
+ let n = this._getOutputValue();
7441
+ this.setAttribute("value", n), this._syncHiddenInput(), this._syncInputValue(), this.dispatchEvent(new Event("input", {
7442
+ bubbles: !0,
7443
+ composed: !0
7444
+ })), this.dispatchEvent(new Event("change", { bubbles: !0 }));
7445
+ }
7446
+ _buildColumn(e, t, n, r = !0, i = "standard", a = "Time") {
7447
+ let o = document.createElement("div");
7448
+ return o.className = `mint-time-picker-column mint-time-picker-column-${i}${r ? " mint-time-picker-column-divider" : ""}`, o.setAttribute("role", "group"), o.setAttribute("aria-label", a), e.forEach((e) => {
7449
+ let r = document.createElement("button");
7450
+ r.type = "button";
7451
+ let i = e === t;
7452
+ r.className = `mint-time-picker-option${i ? " is-selected" : ""}`, r.dataset.selected = i ? "true" : "false", r.setAttribute("aria-pressed", String(i)), r.setAttribute("aria-label", `${a}: ${e}`), r.textContent = e, r.addEventListener("click", () => n(e)), o.appendChild(r);
7453
+ }), o;
7454
+ }
7455
+ _centerSelectedInColumn(e) {
7456
+ let t = e.querySelector("button[data-selected=\"true\"]");
7457
+ if (!t) return;
7458
+ let n = t.offsetTop - e.offsetTop - (e.clientHeight / 2 - t.offsetHeight / 2), r = Math.max(0, Math.min(e.scrollHeight - e.clientHeight, n));
7459
+ e.scrollTo({
7460
+ top: r,
7461
+ behavior: "instant"
7462
+ });
7463
+ }
7464
+ _centerAllColumnsInPopoverBody() {
7465
+ let e = (this._popover || this).querySelector("[data-mint-time-picker-body=\"true\"]");
7466
+ e && Array.from(e.querySelectorAll(".mint-time-picker-column")).forEach((e) => this._centerSelectedInColumn(e));
7467
+ }
7468
+ _setupPopoverOpenObserver() {
7469
+ this._popover && (this._popoverObserver &&= (this._popoverObserver.disconnect(), null), this._popoverObserver = new MutationObserver(() => {
7470
+ this._popover?.getAttribute("open") === "true" && requestAnimationFrame(() => {
7471
+ requestAnimationFrame(() => {
7472
+ this._centerAllColumnsInPopoverBody();
7473
+ });
7474
+ });
7475
+ }), this._popoverObserver.observe(this._popover, {
7476
+ attributes: !0,
7477
+ attributeFilter: ["open"]
7478
+ }));
7479
+ }
7480
+ _buildPickerSet(e, t, n) {
7481
+ let r = this.isHoursEnabled(), i = this.isMinutesEnabled(), a = this.isSecondsEnabled(), o = document.createElement("div"), s = (r ? 1 : 0) + (i ? 1 : 0) + (a ? 1 : 0) + (r ? 1 : 0);
7482
+ o.className = "mint-time-picker-wheel", o.style.gridTemplateColumns = `repeat(${Math.max(s, 1)}, minmax(0, 1fr))`;
7483
+ let c = Array.from({ length: 12 }, (e, t) => (t + 1).toString().padStart(2, "0")), l = Array.from({ length: 60 }, (e, t) => t.toString().padStart(2, "0")), u = Array.from({ length: 60 }, (e, t) => t.toString().padStart(2, "0")), d = ["AM", "PM"], f = [];
7484
+ r && f.push(this._buildColumn(c, t.hour.toString().padStart(2, "0"), (e) => {
7485
+ n({
7486
+ ...t,
7487
+ hour: Number(e)
7488
+ });
7489
+ }, !0, "tall", "Hour")), i && f.push(this._buildColumn(l, t.minute.toString().padStart(2, "0"), (e) => {
7490
+ n({
7491
+ ...t,
7492
+ minute: Number(e)
7493
+ });
7494
+ }, !0, "tall", "Minute")), a && f.push(this._buildColumn(u, t.second.toString().padStart(2, "0"), (e) => {
7495
+ n({
7496
+ ...t,
7497
+ second: Number(e)
7498
+ });
7499
+ }, !0, "tall", "Second")), r && f.push(this._buildColumn(d, t.meridiem, (e) => {
7500
+ n({
7501
+ ...t,
7502
+ meridiem: e
7503
+ });
7504
+ }, !0, "tall", "Meridiem")), f.forEach((e, t) => {
7505
+ t === f.length - 1 && e.classList.remove("mint-time-picker-column-divider"), o.appendChild(e);
7506
+ }), e.appendChild(o);
7507
+ }
7508
+ _buildPopoverContent(e) {
7509
+ if (e.innerHTML = "", !this.isRange()) {
7510
+ this._buildPickerSet(e, this._single, (t) => {
7511
+ this._single = t, this._emitChangeFromPicker(), this._buildPopoverContent(e);
7512
+ }), requestAnimationFrame(() => this._centerAllColumnsInPopoverBody());
7513
+ return;
7514
+ }
7515
+ let t = document.createElement("div");
7516
+ t.className = "mint-time-picker-range";
7517
+ let n = document.createElement("div"), r = document.createElement("mint-text");
7518
+ r.setAttribute("variant", "muted"), r.className = "mint-time-picker-range-label", r.textContent = "Start", n.appendChild(r), this._buildPickerSet(n, this._rangeStart, (t) => {
7519
+ this._rangeStart = t, this._emitChangeFromPicker(), this._buildPopoverContent(e);
7520
+ });
7521
+ let i = document.createElement("div"), a = document.createElement("mint-text");
7522
+ a.setAttribute("variant", "muted"), a.className = "mint-time-picker-range-label", a.textContent = "End", i.appendChild(a), this._buildPickerSet(i, this._rangeEnd, (t) => {
7523
+ this._rangeEnd = t, this._emitChangeFromPicker(), this._buildPopoverContent(e);
7524
+ }), t.appendChild(n), t.appendChild(i), e.appendChild(t), requestAnimationFrame(() => {
7525
+ this._centerAllColumnsInPopoverBody();
7526
+ });
7527
+ }
7528
+ render() {
7529
+ let e = this.isDisabled(), t = this.isReadonly(), n = this._getEffectiveError();
7530
+ this._triggerClickObserver &&= (document.removeEventListener("click", this._triggerClickObserver, !0), null), this.innerHTML = "";
7531
+ let r = document.createElement("div");
7532
+ r.className = "mint-time-picker-control";
7533
+ let i = this.getAttribute("inline") === "true";
7534
+ i || (this._inputEl = document.createElement("mint-input"), this._inputEl.id = this._triggerId, this._inputEl.classList.add("mint-time-picker-trigger"), this._inputEl.setAttribute("type", "text"), this._inputEl.setAttribute("icon", "clock"), this._inputEl.setAttribute("placeholder", this._getExpectedFormat()), this._inputEl.setAttribute("label", this.getLabel()), this._inputEl.setAttribute("info", this.getInfo()), this._inputEl.setAttribute("value", this._getDisplayValue()), this._inputEl.setAttribute("error", n.hasError ? "true" : "false"), this._inputEl.setAttribute("error-message", n.message || ""), e && this._inputEl.setAttribute("disabled", "true"), t && this._inputEl.setAttribute("readonly", "true"), this._inputEl.addEventListener("change", (n) => {
7535
+ if (e || t) return;
7536
+ let r = n.target;
7537
+ this._handleTypedValue((r?.value || "").toString());
7538
+ }), this._inputEl.addEventListener("blur", (n) => {
7539
+ if (e || t) return;
7540
+ let r = n.target;
7541
+ this._handleTypedValue((r?.value || "").toString());
7542
+ }, !0), r.appendChild(this._inputEl)), this._hiddenInput = document.createElement("input"), this._hiddenInput.type = "hidden", this._hiddenInput.name = this.getName(), this._hiddenInput.required = this.isRequired(), r.appendChild(this._hiddenInput), this._syncHiddenInput();
7543
+ let a = document.createElement("div");
7544
+ if (a.setAttribute("data-mint-time-picker-body", "true"), a.className = "mint-time-picker-popover", this._buildPopoverContent(a), i ? (this._popover = null, r.appendChild(a), requestAnimationFrame(() => this._centerAllColumnsInPopoverBody())) : (this._popover = document.createElement("mint-popover"), this._popover.setAttribute("trigger-id", this._triggerId), this._popover.setAttribute("direction", "down"), this._popover.setAttribute("padding", "0"), this._popover.setAttribute("distance", "6px"), (e || t) && this._popover.setAttribute("open", "false"), this._popover.appendChild(a), r.appendChild(this._popover), this._setupPopoverOpenObserver()), this.appendChild(r), !i && this._inputEl) {
7545
+ let e = this._inputEl;
7546
+ this._triggerClickObserver = (t) => {
7547
+ t.composedPath().includes(e) && requestAnimationFrame(() => {
7548
+ requestAnimationFrame(() => {
7549
+ this._popover?.getAttribute("open") === "true" && this._centerAllColumnsInPopoverBody();
7550
+ });
7551
+ });
7552
+ }, document.addEventListener("click", this._triggerClickObserver, !0);
7553
+ }
7554
+ }
7555
+ };
7556
+ customElements.get("mint-time-picker") || a("mint-time-picker", Ln);
7557
+ //#endregion
7558
+ //#region src/components/datetime-picker/DateTimePicker.ts
7559
+ var Rn = class extends HTMLElement {
7560
+ constructor(...e) {
7561
+ super(...e), this._datePicker = null, this._timePicker = null, this._content = null, this._popoverContent = null, this._popoverObserver = null, this._hiddenInput = null, this._dateValue = "", this._timeValue = "", this._dateStageComplete = !1, this._ready = !1, this._writingValue = !1, this._displayControlBound = !1;
7562
+ }
7563
+ static get observedAttributes() {
7564
+ return [
7565
+ "value",
7566
+ "label",
7567
+ "info",
7568
+ "name",
7569
+ "required",
7570
+ "disabled",
7571
+ "readonly",
7572
+ "format",
7573
+ "display-format",
7574
+ "min",
7575
+ "max",
7576
+ "shortcuts",
7577
+ "hours",
7578
+ "minutes",
7579
+ "seconds",
7580
+ "error",
7581
+ "error-message"
7582
+ ];
7583
+ }
7584
+ connectedCallback() {
7585
+ this.classList.add("mint-datetime-picker"), this._readValue(this.getAttribute("value") || ""), this.render(), this._ready = !0;
7586
+ }
7587
+ attributeChangedCallback(e, t, n) {
7588
+ if (!(t === n || !this._ready || e === "value" && this._writingValue)) {
7589
+ if (e === "value") {
7590
+ this._readValue(n || ""), this.render();
7591
+ return;
7592
+ }
7593
+ if (e === "error" || e === "error-message") {
7594
+ this._syncState();
7595
+ return;
7596
+ }
7597
+ this.render();
7598
+ }
7599
+ }
7600
+ get value() {
7601
+ return this.getAttribute("value") || "";
7602
+ }
7603
+ set value(e) {
7604
+ this.setValue(e || "");
7605
+ }
7606
+ getValue() {
7607
+ return this.getAttribute("value") || "";
7608
+ }
7609
+ setValue(e) {
7610
+ this._readValue(e), this._writingValue = !0, e ? this.setAttribute("value", e) : this.removeAttribute("value"), this._writingValue = !1, this.render(), this._syncState();
7611
+ }
7612
+ _parseDate(e, t) {
7613
+ let n = e.match(/^(\d{4})-(\d{2})-(\d{2})/);
7614
+ if (n) return new Date(Number(n[1]), Number(n[2]) - 1, Number(n[3]));
7615
+ let r = {
7616
+ yyyy: "(\\d{4})",
7617
+ yy: "(\\d{2})",
7618
+ Y: "(\\d{4})",
7619
+ y: "(\\d{2})",
7620
+ mm: "(\\d{1,2})",
7621
+ m: "(\\d{1,2})",
7622
+ n: "(\\d{1,2})",
7623
+ dd: "(\\d{1,2})",
7624
+ d: "(\\d{1,2})",
7625
+ j: "(\\d{1,2})",
7626
+ M: "([A-Za-z]+)",
7627
+ F: "([A-Za-z]+)"
7628
+ }, i = Object.keys(r).sort((e, t) => t.length - e.length), a = [], o = "^";
7629
+ for (let e = 0; e < t.length;) {
7630
+ let n = i.find((n) => t.startsWith(n, e));
7631
+ n ? (o += r[n], a.push(n), e += n.length) : (o += t[e].replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), e++);
7632
+ }
7633
+ let s = e.match(RegExp(`${o}$`, "i"));
7634
+ if (!s) return null;
7635
+ let c = 2e3, l = 1, u = 1;
7636
+ a.forEach((e, t) => {
7637
+ let n = s[t + 1];
7638
+ if (e === "Y" || e === "yyyy") c = Number(n);
7639
+ else if (e === "y" || e === "yy") c = Number(n) + 2e3;
7640
+ else if (e === "m" || e === "mm" || e === "n") l = Number(n);
7641
+ else if (e === "d" || e === "dd" || e === "j") u = Number(n);
7642
+ else if (e === "M" || e === "F") {
7643
+ let e = (/* @__PURE__ */ new Date(`${n} 1, 2000`)).getMonth();
7644
+ Number.isNaN(e) || (l = e + 1);
7645
+ }
7646
+ });
7647
+ let d = new Date(c, l - 1, u);
7648
+ return d.getFullYear() === c && d.getMonth() === l - 1 && d.getDate() === u ? d : null;
7649
+ }
7650
+ _formatDate(e, t) {
7651
+ let n = (e) => String(e).padStart(2, "0"), r = {
7652
+ Y: String(e.getFullYear()),
7653
+ yyyy: String(e.getFullYear()),
7654
+ yy: String(e.getFullYear()).slice(-2),
7655
+ y: String(e.getFullYear()).slice(-2),
7656
+ mm: n(e.getMonth() + 1),
7657
+ m: n(e.getMonth() + 1),
7658
+ n: String(e.getMonth() + 1),
7659
+ dd: n(e.getDate()),
7660
+ d: n(e.getDate()),
7661
+ j: String(e.getDate()),
7662
+ M: e.toLocaleString(void 0, { month: "short" }),
7663
+ F: e.toLocaleString(void 0, { month: "long" })
7664
+ };
7665
+ return t.replace(/yyyy|yy|mm|dd|Y|y|m|n|d|j|M|F/g, (e) => r[e]);
7666
+ }
7667
+ _readValue(e) {
7668
+ let [t = "", n = ""] = e.split(/[T ]/), r = this._parseDate(t, this.getAttribute("format") || "mm/dd/yyyy");
7669
+ this._dateValue = r ? this._formatDate(r, this.getAttribute("format") || "mm/dd/yyyy") : "", this._timeValue = n || "", this._dateStageComplete = !!r;
7670
+ }
7671
+ _toISODate() {
7672
+ let e = this._parseDate(this._dateValue, this.getAttribute("format") || "mm/dd/yyyy");
7673
+ return e ? `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}` : "";
7674
+ }
7675
+ _syncValue(e = !1) {
7676
+ let t = this._toISODate(), n = this._timeValue, r = t && n ? `${t}T${n}` : "";
7677
+ this._writingValue = !0, r ? this.setAttribute("value", r) : this.removeAttribute("value"), this._writingValue = !1, this._hiddenInput && (this._hiddenInput.value = r), e && r && (this.dispatchEvent(new Event("input", {
7678
+ bubbles: !0,
7679
+ composed: !0
7680
+ })), this.dispatchEvent(new CustomEvent("change", {
7681
+ detail: { value: r },
7682
+ bubbles: !0,
7683
+ composed: !0
7684
+ })));
7685
+ }
7686
+ _syncState() {
7687
+ this._datePicker && (this._datePicker.setAttribute("value", this._dateValue), this._datePicker.setAttribute("error", this.getAttribute("error") || "false"), this._datePicker.setAttribute("error-message", this.getAttribute("error-message") || ""), this._timePicker?.setAttribute("error", this.getAttribute("error") || "false"), this._timePicker?.setAttribute("error-message", this.getAttribute("error-message") || ""), this._hiddenInput && (this._hiddenInput.value = this.getValue()), this._syncCombinedDisplay());
7688
+ }
7689
+ render() {
7690
+ let e = this.getAttribute("label") || "", t = this.getAttribute("info") || "", n = this.getAttribute("format") || "mm/dd/yyyy", r = this.getAttribute("disabled") === "true", i = this.getAttribute("readonly") === "true";
7691
+ this._displayControlBound = !1;
7692
+ let a = document.createElement("mint-date-picker");
7693
+ a.setAttribute("class", "mint-datetime-picker-date"), a.setAttribute("keep-open-on-select", "true"), a.setAttribute("format", n), a.setAttribute("value", this._dateValue), a.setAttribute("label", e), a.setAttribute("info", t), a.setAttribute("display-format", this.getAttribute("display-format") || "F j, Y");
7694
+ for (let e of [
7695
+ "min",
7696
+ "max",
7697
+ "shortcuts"
7698
+ ]) this.hasAttribute(e) && a.setAttribute(e, this.getAttribute(e) || "");
7699
+ r && a.setAttribute("disabled", "true"), i && a.setAttribute("readonly", "true"), this.hasAttribute("required") && a.setAttribute("required", this.getAttribute("required") || "true"), this.hasAttribute("error") && a.setAttribute("error", this.getAttribute("error") || "false"), this.hasAttribute("error-message") && a.setAttribute("error-message", this.getAttribute("error-message") || ""), a.addEventListener("change", (e) => {
7700
+ e.stopPropagation();
7701
+ let t = e.detail?.value || a.value || "";
7702
+ this._parseDate(t, n) && (this._dateValue = t, this._dateStageComplete = !0, this._syncValue(!1), this._syncCombinedDisplay(), this._openTimeStage());
7703
+ }), this._datePicker = a, this._bindCombinedDisplayControl();
7704
+ let o = document.createElement("div");
7705
+ o.className = "mint-datetime-picker-content", this._content = o, this.innerHTML = "", this.appendChild(o), o.appendChild(a), this._hiddenInput = document.createElement("input"), this._hiddenInput.type = "hidden", this._hiddenInput.name = this.getAttribute("name") || "", this._hiddenInput.value = this.getValue(), this.appendChild(this._hiddenInput), this._waitForPopover();
7706
+ }
7707
+ _getPopover() {
7708
+ let e = this._datePicker, t = e?.getPopoverElement?.() || e?._popover;
7709
+ if (t) return t;
7710
+ let n = e?.querySelector?.(".mint-date-picker-icon-button")?.id;
7711
+ return n ? document.querySelector(`mint-popover[trigger-id="${CSS.escape(n)}"]`) : null;
7712
+ }
7713
+ _getPopoverContent(e) {
7714
+ return e.querySelector(".popover-content") || e;
7715
+ }
7716
+ _waitForPopover(e = 0) {
7717
+ let t = this._getPopover();
7718
+ if (!t) {
7719
+ e < 120 && requestAnimationFrame(() => this._waitForPopover(e + 1));
7720
+ return;
7721
+ }
7722
+ this._popoverContent = this._datePicker?.getPopoverContentElement?.() || this._getPopoverContent(t), this._bindCombinedDisplayControl(), this._popoverObserver?.disconnect(), this._popoverObserver = new MutationObserver(() => {
7723
+ t.getAttribute("open") === "true" && this._dateStageComplete && requestAnimationFrame(() => requestAnimationFrame(() => this._renderTimeStage()));
7724
+ }), this._popoverObserver.observe(t, {
7725
+ attributes: !0,
7726
+ attributeFilter: ["open"]
7727
+ }), t.getAttribute("open") === "true" && this._dateStageComplete && this._renderTimeStage();
7728
+ }
7729
+ _bindCombinedDisplayControl() {
7730
+ if (this._displayControlBound || !this._datePicker) return;
7731
+ this._displayControlBound = !0;
7732
+ let e = (e) => {
7733
+ if (!e.target?.closest(".mint-date-picker-field") || this.getAttribute("disabled") === "true" || this.getAttribute("readonly") === "true" || e instanceof KeyboardEvent && e.key !== "Enter" && e.key !== " ") return;
7734
+ e.preventDefault(), e.stopImmediatePropagation();
7735
+ let t = this._getPopover();
7736
+ t?.open ? t.open() : t?.setAttribute("open", "true");
7737
+ };
7738
+ this._datePicker.addEventListener("click", e, !0), this._datePicker.addEventListener("keydown", e, !0);
7739
+ }
7740
+ _openTimeStage() {
7741
+ queueMicrotask(() => this._renderTimeStage());
7742
+ }
7743
+ _renderTimeStage() {
7744
+ if (!this._popoverContent || !this._dateStageComplete) return;
7745
+ let e = document.createElement("div");
7746
+ e.className = "mint-datetime-picker-panel";
7747
+ let t = document.createElement("button");
7748
+ t.type = "button", t.className = "mint-datetime-picker-time-heading", t.setAttribute("aria-label", `Change date, ${this._dateValue}`), t.textContent = this._getFormattedDate(), t.addEventListener("click", () => {
7749
+ let e = this._datePicker;
7750
+ typeof e?.refreshCalendar == "function" ? e.refreshCalendar() : e?._buildCalendar?.();
7751
+ });
7752
+ let n = document.createElement("mint-time-picker"), r = this.getAttribute("disabled") === "true", i = this.getAttribute("readonly") === "true";
7753
+ n.setAttribute("inline", "true"), n.setAttribute("value", this._timeValue || "09:00"), n.setAttribute("label", "");
7754
+ for (let e of [
7755
+ "hours",
7756
+ "minutes",
7757
+ "seconds"
7758
+ ]) this.hasAttribute(e) && n.setAttribute(e, this.getAttribute(e) || "");
7759
+ r && n.setAttribute("disabled", "true"), i && n.setAttribute("readonly", "true"), n.addEventListener("change", () => {
7760
+ this._timeValue = n.getValue?.() || n.getAttribute("value") || "", this._syncValue(!0), this._syncCombinedDisplay();
7761
+ }), n.addEventListener("change", (e) => e.stopPropagation()), n.addEventListener("input", (e) => e.stopPropagation()), this._timePicker = n, e.appendChild(t), e.appendChild(n), this._popoverContent.replaceChildren(e);
7762
+ }
7763
+ _syncCombinedDisplay() {
7764
+ let e = this._datePicker?.getDisplayElement?.() || this._datePicker?.querySelector(".mint-date-picker-display");
7765
+ if (!e || !this._dateValue) return;
7766
+ let t = this._getFormattedDate();
7767
+ e.textContent = this._timeValue ? `${t} · ${this._formatTime(this._timeValue)}` : t, e.setAttribute("aria-label", `${this.getAttribute("label") || "Date and time"}: ${e.textContent}`);
7768
+ }
7769
+ _getFormattedDate() {
7770
+ let e = this._parseDate(this._dateValue, this.getAttribute("format") || "mm/dd/yyyy");
7771
+ return e ? this._formatDate(e, this.getAttribute("display-format") || "F j, Y") : this._dateValue;
7772
+ }
7773
+ _formatTime(e) {
7774
+ let [t = "00", n = "00", r] = e.split(":"), i = Number(t), a = this.getAttribute("hours") !== "false", o = this.getAttribute("minutes") !== "false", s = this.getAttribute("seconds") === "true";
7775
+ if (!a) return [o ? n : "", s ? r || "00" : ""].filter(Boolean).join(":");
7776
+ let c = i % 12 || 12;
7777
+ return `${[
7778
+ String(c),
7779
+ o ? n : "",
7780
+ s ? r || "00" : ""
7781
+ ].filter(Boolean).join(":")} ${i >= 12 ? "pm" : "am"}`;
7782
+ }
7783
+ };
7784
+ customElements.get("mint-datetime-picker") || a("mint-datetime-picker", Rn), s({
7785
+ name: "upload",
7786
+ viewBox: "0 0 24 24",
7787
+ path: "M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12",
7788
+ strokeLinecap: "round",
7789
+ strokeLinejoin: "round"
7790
+ }), s({
7791
+ name: "attach",
7792
+ viewBox: "0 0 24 24",
7793
+ path: "M15.172 7l-6.586 6.586a2 2 0 102.828 2.828l6.414-6.586a4 4 0 00-5.656-5.656l-6.415 6.585a6 6 0 108.486 8.486L20.5 13",
7794
+ strokeLinecap: "round",
7795
+ strokeLinejoin: "round"
7796
+ });
7797
+ //#endregion
7798
+ //#region src/components/dropzone/Dropzone.ts
7799
+ var zn = class extends HTMLElement {
7800
+ static get observedAttributes() {
7801
+ return [
7802
+ "label",
7803
+ "accept",
7804
+ "multiple",
7805
+ "width",
7806
+ "height",
7807
+ "disabled",
7808
+ "name",
7809
+ "error",
7810
+ "error-message",
7811
+ "loading",
7812
+ "aria-label",
7813
+ "aria-describedby"
7814
+ ];
7815
+ }
7816
+ constructor() {
7817
+ super(), this._dropzone = null, this._fileInput = null, this._previewContainer = null, this._isDragging = !1, this._wasDragging = !1, this._isUpdatingFiles = !1, this._listenersInitialized = !1, this._selectedFiles = [], this._previewUrls = [], this._resetHandler = null, this._a11yId = `mint-dropzone-${Math.random().toString(36).slice(2, 10)}`;
7818
+ }
7819
+ connectedCallback() {
7820
+ this.classList.add("mint-dropzone"), this.render(), this._attachFormResetListener();
7821
+ }
7822
+ disconnectedCallback() {
7823
+ if (this.removeEventListeners(), this._cleanupPreviewUrls(), this._resetHandler) {
7824
+ let e = this.closest("form");
7825
+ e && e.removeEventListener("reset", this._resetHandler), this._resetHandler = null;
7826
+ }
7827
+ }
7828
+ attributeChangedCallback(e, t, n) {
7829
+ if (t !== n) {
7830
+ if (e === "error" || e === "error-message") {
7831
+ this._updateDragStateClass(), this._renderErrorState(this.hasError(), this.getErrorMessage());
7832
+ return;
7833
+ }
7834
+ if (e === "loading") {
7835
+ this.render();
7836
+ return;
7837
+ }
7838
+ this.render();
7839
+ }
7840
+ }
7841
+ getLabel() {
7842
+ return this.getAttribute("label") || "";
7843
+ }
7844
+ getAccept() {
7845
+ return this.getAttribute("accept") || "";
7846
+ }
7847
+ isMultiple() {
7848
+ return this.getAttribute("multiple") === "true";
7849
+ }
7850
+ getWidth() {
7851
+ return this.getAttribute("width") || "200px";
7852
+ }
7853
+ getHeight() {
7854
+ return this.getAttribute("height") || "200px";
7855
+ }
7856
+ _renderSkeleton(e) {
7857
+ let t = this.querySelector(".mint-dropzone-skeleton-container"), n = this._dropzone;
7858
+ if (e) {
7859
+ this.classList.add("is-loading"), t || (t = document.createElement("div"), t.className = "mint-dropzone-skeleton-container", n ? (n.classList.add("is-positioned"), n.appendChild(t)) : this.appendChild(t));
7860
+ let e = t.querySelector(".mint-dropzone-skeleton");
7861
+ e || (e = document.createElement("div"), e.className = "mint-dropzone-skeleton", t.appendChild(e)), t.classList.add("is-visible"), n?.classList.add("is-loading");
7862
+ } else this.classList.remove("is-loading"), t && t.classList.remove("is-visible"), n?.classList.remove("is-loading");
7863
+ }
7864
+ getName() {
7865
+ return this.getAttribute("name") || "";
7866
+ }
7867
+ hasError() {
7868
+ return this.getAttribute("error") === "true";
7869
+ }
7870
+ getErrorMessage() {
7871
+ return this.getAttribute("error-message") || "";
7872
+ }
7873
+ isDisabled() {
7874
+ return this.getAttribute("disabled") === "true";
7875
+ }
7876
+ isLoading() {
7877
+ return this.getAttribute("loading") === "true";
7878
+ }
7879
+ render() {
7880
+ let e = this.isLoading(), t = this.getLabel(), n = this.getAccept(), r = this.isMultiple(), i = this.isDisabled(), a = this.getWidth(), o = this.getHeight(), s = this.getName(), c = this.hasError(), l = this.getErrorMessage();
7881
+ if (this._dropzone || (this._dropzone = document.createElement("div"), this.appendChild(this._dropzone)), this._updateDragStateClass(), this._dropzone.setAttribute("aria-invalid", c ? "true" : "false"), i) this._dropzone.setAttribute("tabindex", "-1"), this._dropzone.removeAttribute("role");
7882
+ else {
7883
+ this._dropzone.setAttribute("tabindex", "0"), this._dropzone.setAttribute("role", "button"), this._dropzone.setAttribute("aria-label", this.getAttribute("aria-label") || t || "File upload dropzone");
7884
+ let e = (this.getAttribute("aria-describedby") || "").split(/\s+/).filter(Boolean), n = this.querySelector(".mint-dropzone-error");
7885
+ n && (n.id = `${this.id || this._a11yId}-error`, e.push(n.id)), e.length ? this._dropzone.setAttribute("aria-describedby", Array.from(new Set(e)).join(" ")) : this._dropzone.removeAttribute("aria-describedby");
7886
+ }
7887
+ this._dropzone.style.width = a, this._dropzone.style.height = o, this._dropzone.style.minWidth = a, this._dropzone.style.minHeight = o, this._fileInput || (this._fileInput = document.createElement("input"), this._fileInput.type = "file", this._fileInput.className = "mint-dropzone-file-input", this._fileInput.setAttribute("tabindex", "-1"), this._fileInput.setAttribute("aria-hidden", "true"), this._dropzone.appendChild(this._fileInput)), this._fileInput.accept = n, this._fileInput.multiple = r, this._fileInput.disabled = i, s ? this._fileInput.name = s : this._fileInput.removeAttribute("name"), this._fileInput.setAttribute("aria-invalid", c ? "true" : "false");
7888
+ let u = this._dropzone.querySelector(".mint-dropzone-icon"), d = this._dropzone.querySelector(".mint-dropzone-label");
7889
+ u && u.remove(), d && d.remove();
7890
+ let f = document.createElement("div");
7891
+ f.className = "mint-dropzone-icon";
7892
+ let p = document.createElement("mint-icon");
7893
+ if (p.setAttribute("name", "upload"), p.className = "mint-dropzone-upload-icon", f.appendChild(p), this._dropzone.appendChild(f), t) {
7894
+ let e = document.createElement("div");
7895
+ e.className = "mint-dropzone-label", e.textContent = t, this._dropzone.appendChild(e);
7896
+ }
7897
+ this.setupEventListeners(), this._renderErrorState(c, l), this._renderPreviews(), this._renderSkeleton(e);
7898
+ }
7899
+ _updateDragState() {
7900
+ this._dropzone && this._updateDragStateClass();
7901
+ }
7902
+ _renderErrorState(e, t) {
7903
+ let n = this.querySelector(".mint-dropzone-error");
7904
+ if (e && t ? (n || (n = document.createElement("div"), n.className = "mint-dropzone-error", this.appendChild(n)), n.textContent = t) : n && n.remove(), this._dropzone) {
7905
+ this._dropzone.setAttribute("aria-invalid", String(e)), n && (n.id = `${this.id || this._a11yId}-error`);
7906
+ let t = (this.getAttribute("aria-describedby") || "").split(/\s+/).filter(Boolean);
7907
+ n && t.push(n.id), t.length ? this._dropzone.setAttribute("aria-describedby", Array.from(new Set(t)).join(" ")) : this._dropzone.removeAttribute("aria-describedby");
7908
+ }
7909
+ }
7910
+ _updateDragStateClass() {
7911
+ if (!this._dropzone) return;
7912
+ let e = this.isDisabled(), t = this.hasError();
7913
+ this._dropzone.className = "mint-dropzone-target", this._dropzone.classList.toggle("has-files", this._selectedFiles.length > 0), this._dropzone.classList.toggle("is-dragging", this._isDragging), this._dropzone.classList.toggle("has-error", t), this._dropzone.classList.toggle("is-disabled", e);
7914
+ }
7915
+ setupEventListeners() {
7916
+ this._listenersInitialized || (this._listenersInitialized = !0, this.removeEventListeners(), !(!this._dropzone || !this._fileInput || this.isDisabled()) && (this._onDropzoneClick ||= (e) => {
7917
+ if (!(this.isDisabled() || !this._fileInput) && e.target !== this._fileInput && (e.stopPropagation(), e.preventDefault(), e.isTrusted)) try {
7918
+ this._fileInput.click();
7919
+ } catch (e) {
7920
+ console.debug("File chooser blocked:", e);
7921
+ }
7922
+ }, this._onDragOver ||= (e) => {
7923
+ e.preventDefault(), e.stopPropagation(), this.isDisabled() || this._isDragging || (this._isDragging = !0, this._wasDragging = !0, this._updateDragState());
7924
+ }, this._onDragLeave ||= (e) => {
7925
+ e.preventDefault(), e.stopPropagation();
7926
+ let t = this._dropzone?.getBoundingClientRect();
7927
+ t && (e.clientX < t.left || e.clientX > t.right || e.clientY < t.top || e.clientY > t.bottom) && this._isDragging && (this._isDragging = !1, this._wasDragging = !1, this._updateDragState());
7928
+ }, this._onDrop ||= (e) => {
7929
+ if (e.preventDefault(), e.stopPropagation(), this._isDragging && (this._isDragging = !1, this._wasDragging = !1, this._updateDragState()), this.isDisabled()) return;
7930
+ let t = e.dataTransfer?.files;
7931
+ t && t.length > 0 && this._handleFiles(t);
7932
+ }, this._onFileInputInput ||= (e) => {
7933
+ e.stopImmediatePropagation(), e.stopPropagation();
7934
+ }, this._onKeyDown ||= (e) => {
7935
+ if (!(this.isDisabled() || !this._fileInput) && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), e.isTrusted)) try {
7936
+ this._fileInput.click();
7937
+ } catch (e) {
7938
+ console.debug("File chooser blocked:", e);
7939
+ }
7940
+ }, this._onFocus ||= (e) => {
7941
+ this._dropzone && !this.isDisabled() && this._dropzone.classList.add("is-focused");
7942
+ }, this._onBlur ||= (e) => {
7943
+ this._dropzone;
7944
+ }, this._onFileInputChange ||= (e) => {
7945
+ if (e.stopImmediatePropagation(), e.stopPropagation(), this._isUpdatingFiles) return;
7946
+ let t = e.target.files;
7947
+ if (t && t.length > 0) {
7948
+ let e = this.getAccept(), n = this.isMultiple(), r = [], i = [];
7949
+ for (let n = 0; n < t.length; n++) {
7950
+ let a = t[n];
7951
+ this._isFileAccepted(a, e) ? r.push(a) : i.push(a);
7952
+ }
7953
+ if (!n && r.length > 1 && (i.push(...r.slice(1)), r.splice(1)), i.length > 0) {
7954
+ let e = new CustomEvent("dropRejected", {
7955
+ detail: {
7956
+ files: i,
7957
+ reason: "File type not accepted or multiple files not allowed"
7958
+ },
7959
+ bubbles: !0,
7960
+ cancelable: !0
7961
+ });
7962
+ this.dispatchEvent(e);
7963
+ }
7964
+ r.length > 0 && this._applyValidFiles(r);
7965
+ }
7966
+ }, this._dropzone.addEventListener("click", this._onDropzoneClick), this._dropzone.addEventListener("dragover", this._onDragOver), this._dropzone.addEventListener("dragleave", this._onDragLeave), this._dropzone.addEventListener("drop", this._onDrop), this._dropzone.addEventListener("keydown", this._onKeyDown), this._dropzone.addEventListener("focus", this._onFocus), this._dropzone.addEventListener("blur", this._onBlur), this._fileInput.addEventListener("change", this._onFileInputChange), this._fileInput.addEventListener("input", this._onFileInputInput, !0)));
7967
+ }
7968
+ removeEventListeners() {
7969
+ this._dropzone && (this._onDropzoneClick && this._dropzone.removeEventListener("click", this._onDropzoneClick), this._onDragOver && this._dropzone.removeEventListener("dragover", this._onDragOver), this._onDragLeave && this._dropzone.removeEventListener("dragleave", this._onDragLeave), this._onDrop && this._dropzone.removeEventListener("drop", this._onDrop), this._onKeyDown && this._dropzone.removeEventListener("keydown", this._onKeyDown), this._onFocus && this._dropzone.removeEventListener("focus", this._onFocus), this._onBlur && this._dropzone.removeEventListener("blur", this._onBlur)), this._fileInput && (this._onFileInputChange && this._fileInput.removeEventListener("change", this._onFileInputChange), this._onFileInputInput && this._fileInput.removeEventListener("input", this._onFileInputInput, !0)), this._isDragging = !1, this._listenersInitialized = !1;
7970
+ }
7971
+ _handleFiles(e) {
7972
+ let t = this.getAccept(), n = this.isMultiple(), r = [], i = [];
7973
+ for (let n = 0; n < e.length; n++) {
7974
+ let a = e[n];
7975
+ this._isFileAccepted(a, t) ? r.push(a) : i.push(a);
7976
+ }
7977
+ if (!n && r.length > 1 && (i.push(...r.slice(1)), r.splice(1)), i.length > 0) {
7978
+ let e = new CustomEvent("dropRejected", {
7979
+ detail: {
7980
+ files: i,
7981
+ reason: "File type not accepted or multiple files not allowed"
7982
+ },
7983
+ bubbles: !0,
7984
+ cancelable: !0
7985
+ });
7986
+ this.dispatchEvent(e);
7987
+ }
7988
+ r.length > 0 && this._applyValidFiles(r);
7989
+ }
7990
+ _isFileAccepted(e, t) {
7991
+ if (!t) return !0;
7992
+ let n = t.split(",").map((e) => e.trim().toLowerCase());
7993
+ for (let t of n) if (t.startsWith(".")) {
7994
+ if ("." + e.name.split(".").pop()?.toLowerCase() === t) return !0;
7995
+ } else if (t.includes("/*")) {
7996
+ if (t.split("/")[0] === e.type.split("/")[0]) return !0;
7997
+ } else if (e.type === t) return !0;
7998
+ return !1;
7999
+ }
8000
+ _dispatchEvent(e, t) {
8001
+ let n = t.target, r = new CustomEvent(e, {
7408
8002
  detail: {
7409
8003
  files: n.files ? Array.from(n.files) : [],
7410
8004
  value: n.value || ""
@@ -7520,10 +8114,10 @@ var Ln = class extends HTMLElement {
7520
8114
  return this._selectedFiles.some((t) => t.name === e.name && t.size === e.size && t.lastModified === e.lastModified);
7521
8115
  }
7522
8116
  };
7523
- customElements.get("mint-dropzone") || a("mint-dropzone", Ln);
8117
+ customElements.get("mint-dropzone") || a("mint-dropzone", zn);
7524
8118
  //#endregion
7525
8119
  //#region src/components/form/Form.ts
7526
- var Rn = class extends HTMLElement {
8120
+ var Bn = class extends HTMLElement {
7527
8121
  static get observedAttributes() {
7528
8122
  return [
7529
8123
  "action",
@@ -7878,6 +8472,7 @@ var Rn = class extends HTMLElement {
7878
8472
  "mint-input[name]",
7879
8473
  "mint-select[name]",
7880
8474
  "mint-date-picker[name]",
8475
+ "mint-datetime-picker[name]",
7881
8476
  "mint-time-picker[name]",
7882
8477
  "mint-dropzone[name]",
7883
8478
  "mint-checkbox[name]",
@@ -8204,7 +8799,7 @@ var Rn = class extends HTMLElement {
8204
8799
  });
8205
8800
  }
8206
8801
  _resetCustomFields() {
8207
- this.querySelectorAll("mint-input, mint-date-picker, mint-select, mint-dropzone, mint-checkbox, mint-choice, mint-switch, mint-tags").forEach((e) => {
8802
+ this.querySelectorAll("mint-input, mint-date-picker, mint-datetime-picker, mint-time-picker, mint-select, mint-dropzone, mint-checkbox, mint-choice, mint-switch, mint-tags").forEach((e) => {
8208
8803
  e.removeAttribute("error"), e.removeAttribute("error-message");
8209
8804
  let t = e.tagName;
8210
8805
  if (t === "MINT-INPUT") try {
@@ -8242,7 +8837,7 @@ var Rn = class extends HTMLElement {
8242
8837
  let t = e.closest("mint-choice");
8243
8838
  if (t) return t;
8244
8839
  }
8245
- return e.closest("mint-input, mint-date-picker, mint-select, mint-dropzone, mint-checkbox, mint-choice, mint-switch, mint-tags") || e;
8840
+ return e.closest("mint-input, mint-date-picker, mint-datetime-picker, mint-select, mint-dropzone, mint-checkbox, mint-choice, mint-switch, mint-tags") || e;
8246
8841
  }
8247
8842
  _setupBlurValidation() {
8248
8843
  if (!this._form) return;
@@ -8253,7 +8848,7 @@ var Rn = class extends HTMLElement {
8253
8848
  if (!n) return;
8254
8849
  let r = this._getFieldName(n);
8255
8850
  if (!r || !this._collectValidationRules()[r]) return;
8256
- let i = this._extractFieldValue([n]), a = i != null && (typeof i == "string" ? i.trim() !== "" : i instanceof FileList || Array.isArray(i) ? i.length > 0 : !0), o = n.hasAttribute("data-mint-form-error") || t instanceof HTMLElement && (t.hasAttribute("aria-invalid") || t.closest("[data-mint-form-error]")), s = !!n.closest("mint-tags"), c = n.tagName === "MINT-CHECKBOX" || n.tagName === "MINT-SWITCH" || n.tagName === "MINT-CHOICE" || t instanceof HTMLElement && (t.closest("mint-checkbox, mint-switch, mint-choice") || t.closest("mint-choice-option")), l = n.tagName === "MINT-DATE-PICKER" || t instanceof HTMLElement && t.closest("mint-date-picker");
8851
+ let i = this._extractFieldValue([n]), a = i != null && (typeof i == "string" ? i.trim() !== "" : i instanceof FileList || Array.isArray(i) ? i.length > 0 : !0), o = n.hasAttribute("data-mint-form-error") || t instanceof HTMLElement && (t.hasAttribute("aria-invalid") || t.closest("[data-mint-form-error]")), s = !!n.closest("mint-tags"), c = n.tagName === "MINT-CHECKBOX" || n.tagName === "MINT-SWITCH" || n.tagName === "MINT-CHOICE" || t instanceof HTMLElement && (t.closest("mint-checkbox, mint-switch, mint-choice") || t.closest("mint-choice-option")), l = n.tagName === "MINT-DATE-PICKER" || t instanceof HTMLElement && t.closest("mint-date-picker, mint-datetime-picker");
8257
8852
  (a || o || s || c || l) && setTimeout(() => {
8258
8853
  this._validateField(r);
8259
8854
  }, 0);
@@ -8312,7 +8907,7 @@ var Rn = class extends HTMLElement {
8312
8907
  this._form.addEventListener("change", t, !0), this._form.addEventListener("input", t, !0), this._form.addEventListener("tags-change", t, !0), this._form.addEventListener("choice-change", t, !0), this._fieldChangeHandlers.set(this._form, t);
8313
8908
  }
8314
8909
  _findFieldElement(e) {
8315
- let t = e.closest("mint-input, mint-date-picker, mint-select, mint-dropzone, mint-checkbox, mint-choice, mint-switch, mint-tags");
8910
+ let t = e.closest("mint-input, mint-date-picker, mint-datetime-picker, mint-select, mint-dropzone, mint-checkbox, mint-choice, mint-switch, mint-tags");
8316
8911
  if (t && t.hasAttribute("name")) return t;
8317
8912
  if (e.hasAttribute("name") && (e.tagName.startsWith("MINT-") || e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement || e instanceof HTMLSelectElement) || (e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement || e instanceof HTMLSelectElement) && e.hasAttribute("name")) return e;
8318
8913
  let n = e;
@@ -8364,11 +8959,11 @@ var Rn = class extends HTMLElement {
8364
8959
  this._restoreSubmittingAttributeState();
8365
8960
  return;
8366
8961
  }
8367
- this._attrSubmittingMintFields.size > 0 || this._attrSubmittingNativeFields.size > 0 || this._attrSubmittingMintButtons.size > 0 || this._attrSubmittingNativeButtons.size > 0 || (this._form.querySelectorAll("mint-input, mint-select, mint-date-picker, mint-dropzone, mint-checkbox, mint-choice, mint-switch, mint-tags").forEach((e) => {
8962
+ this._attrSubmittingMintFields.size > 0 || this._attrSubmittingNativeFields.size > 0 || this._attrSubmittingMintButtons.size > 0 || this._attrSubmittingNativeButtons.size > 0 || (this._form.querySelectorAll("mint-input, mint-select, mint-date-picker, mint-datetime-picker, mint-dropzone, mint-checkbox, mint-choice, mint-switch, mint-tags").forEach((e) => {
8368
8963
  let t = e.getAttribute("disabled") === "true";
8369
8964
  this._attrSubmittingMintFields.set(e, t), t || e.setAttribute("disabled", "true"), typeof e.render == "function" && e.render();
8370
8965
  }), this._form.querySelectorAll("input, textarea, select").forEach((e) => {
8371
- if (e.closest("mint-input, mint-select, mint-date-picker, mint-dropzone, mint-checkbox, mint-choice, mint-switch, mint-tags, mint-button") || e instanceof HTMLInputElement && e.type === "hidden") return;
8966
+ if (e.closest("mint-input, mint-select, mint-date-picker, mint-datetime-picker, mint-dropzone, mint-checkbox, mint-choice, mint-switch, mint-tags, mint-button") || e instanceof HTMLInputElement && e.type === "hidden") return;
8372
8967
  let t = e.disabled;
8373
8968
  this._attrSubmittingNativeFields.set(e, t), t || (e.disabled = !0);
8374
8969
  }), Array.from(this.querySelectorAll("mint-button")).forEach((e) => {
@@ -8380,7 +8975,7 @@ var Rn = class extends HTMLElement {
8380
8975
  let r = (e.getAttribute("type") || e.getAttribute("button-type") || "default") === "submit";
8381
8976
  t || e.setAttribute("disabled", "true"), r && !n && e.setAttribute("loading", "true"), typeof e.render == "function" && e.render();
8382
8977
  }), Array.from(this.querySelectorAll("button")).forEach((e) => {
8383
- if (e.closest("mint-button, mint-input, mint-select, mint-date-picker, mint-dropzone, mint-checkbox, mint-choice, mint-switch, mint-tags")) return;
8978
+ if (e.closest("mint-button, mint-input, mint-select, mint-date-picker, mint-datetime-picker, mint-dropzone, mint-checkbox, mint-choice, mint-switch, mint-tags")) return;
8384
8979
  let t = e.disabled;
8385
8980
  this._attrSubmittingNativeButtons.set(e, t), t || (e.disabled = !0);
8386
8981
  }));
@@ -8400,7 +8995,7 @@ var Rn = class extends HTMLElement {
8400
8995
  _propagateLoadingState() {
8401
8996
  if (!this._form) return;
8402
8997
  let e = this.getAttribute("loading"), t = e !== null && e !== "false";
8403
- Array.from(this._form.querySelectorAll("mint-input, mint-select, mint-date-picker, mint-dropzone, mint-checkbox, mint-choice, mint-switch, mint-tags")).forEach((e) => {
8998
+ Array.from(this._form.querySelectorAll("mint-input, mint-select, mint-date-picker, mint-datetime-picker, mint-dropzone, mint-checkbox, mint-choice, mint-switch, mint-tags")).forEach((e) => {
8404
8999
  t ? e.setAttribute("loading", "true") : e.removeAttribute("loading"), typeof e.render == "function" && e.render();
8405
9000
  });
8406
9001
  }
@@ -8498,7 +9093,7 @@ var Rn = class extends HTMLElement {
8498
9093
  this._reactiveDataObserver !== null && (cancelAnimationFrame(this._reactiveDataObserver), this._reactiveDataObserver = null), this._reactiveDataProxy = null, this._lastDataSnapshot = null, this._lastAppliedDataSnapshot = null;
8499
9094
  }
8500
9095
  };
8501
- customElements.get("mint-form") || a("mint-form", Rn), typeof window < "u" && (window.mintForm = window.mintForm || {
9096
+ customElements.get("mint-form") || a("mint-form", Bn), typeof window < "u" && (window.mintForm = window.mintForm || {
8502
9097
  defaults: { headers: { common: {} } },
8503
9098
  interceptors: { response: { handlers: [] } }
8504
9099
  }, window.mintForm.interceptors.response.use || (window.mintForm.interceptors.response.use = function(e, t) {
@@ -8509,7 +9104,7 @@ customElements.get("mint-form") || a("mint-form", Rn), typeof window < "u" && (w
8509
9104
  }));
8510
9105
  //#endregion
8511
9106
  //#region src/components/off-canvas/OffCanvas.ts
8512
- var zn = class extends HTMLElement {
9107
+ var Vn = class extends HTMLElement {
8513
9108
  static get observedAttributes() {
8514
9109
  return [
8515
9110
  "id",
@@ -8673,7 +9268,7 @@ var zn = class extends HTMLElement {
8673
9268
  }, 300);
8674
9269
  }
8675
9270
  };
8676
- customElements.get("mint-off-canvas") || a("mint-off-canvas", zn), s({
9271
+ customElements.get("mint-off-canvas") || a("mint-off-canvas", Vn), s({
8677
9272
  name: "search",
8678
9273
  viewBox: "0 0 24 24",
8679
9274
  path: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z",
@@ -8682,7 +9277,7 @@ customElements.get("mint-off-canvas") || a("mint-off-canvas", zn), s({
8682
9277
  });
8683
9278
  //#endregion
8684
9279
  //#region src/components/resource-table/utility-aliases.js
8685
- var Bn = {
9280
+ var Hn = {
8686
9281
  "-mr-1": "rtu-8956a4275",
8687
9282
  "-translate-y-1/2": "rtu-36b381be4",
8688
9283
  "[&>*]:m-0": "rtu-7b41b3d11",
@@ -8844,7 +9439,7 @@ var Bn = {
8844
9439
  "z-10": "rtu-236812d64",
8845
9440
  "z-20": "rtu-145745bf5",
8846
9441
  "z-30": "rtu-0f2fff0ae"
8847
- }, Vn = class extends HTMLElement {
9442
+ }, Un = class extends HTMLElement {
8848
9443
  constructor(...e) {
8849
9444
  super(...e), this._observer = null, this._disposeScrollFade = null;
8850
9445
  }
@@ -8904,10 +9499,10 @@ var Bn = {
8904
9499
  e.dataset.mtProcessed = "", e.innerHTML = n, Object.entries(t).forEach(([t, n]) => e.setAttribute(t, n));
8905
9500
  }
8906
9501
  };
8907
- customElements.get("mint-table") || a("mint-table", Vn);
9502
+ customElements.get("mint-table") || a("mint-table", Un);
8908
9503
  //#endregion
8909
9504
  //#region src/components/resource-table/ResourceTable.ts
8910
- var Hn = class extends HTMLElement {
9505
+ var Wn = class extends HTMLElement {
8911
9506
  static get observedAttributes() {
8912
9507
  return [
8913
9508
  "configuration",
@@ -9817,7 +10412,7 @@ var Hn = class extends HTMLElement {
9817
10412
  return e.class && n.push(e.class.trim()), e.align === "center" ? n.push("text-center") : e.align === "right" && n.push("text-right"), e.sortable && !t && n.push("cursor-pointer"), e.stickLeft && n.push("sticky-left"), e.stickRight && n.push("sticky-right"), n.join(" ");
9818
10413
  }
9819
10414
  _replaceUtilityClasses() {
9820
- let e = Bn, t = [this, ...Array.from(this.querySelectorAll("[class]"))];
10415
+ let e = Hn, t = [this, ...Array.from(this.querySelectorAll("[class]"))];
9821
10416
  for (let n of t) for (let t of Array.from(n.classList)) {
9822
10417
  let r = e[t];
9823
10418
  r && n.classList.replace(t, r);
@@ -10017,10 +10612,10 @@ var Hn = class extends HTMLElement {
10017
10612
  e !== null && (this._currentPage = e, this._offset = (this._currentPage - 1) * this._perPage);
10018
10613
  }
10019
10614
  };
10020
- customElements.get("mint-resource-table") || a("mint-resource-table", Hn);
10615
+ customElements.get("mint-resource-table") || a("mint-resource-table", Wn);
10021
10616
  //#endregion
10022
10617
  //#region src/components/resource-table/ResourceTableContextMenu.ts
10023
- var Un = 550, Wn = 12, Gn = { passive: !0 }, Kn = class extends HTMLElement {
10618
+ var Gn = 550, Kn = 12, qn = { passive: !0 }, Jn = class extends HTMLElement {
10024
10619
  constructor(...e) {
10025
10620
  super(...e), this._table = null, this._anchor = null, this._popover = null, this._menuRoot = null, this._baseId = "", this._touchTimer = null, this._touchStart = null, this._slotObserver = null, this._scrollCloseTargets = [], this._onScrollClose = () => {
10026
10621
  this._closePopover();
@@ -10047,7 +10642,7 @@ var Un = 550, Wn = 12, Gn = { passive: !0 }, Kn = class extends HTMLElement {
10047
10642
  let t = e.touches[0];
10048
10643
  if (!t) return;
10049
10644
  let n = t.clientX - this._touchStart.x, r = t.clientY - this._touchStart.y;
10050
- n * n + r * r > Wn * Wn && (this._clearTouchTimer(), this._touchStart = null);
10645
+ n * n + r * r > Kn * Kn && (this._clearTouchTimer(), this._touchStart = null);
10051
10646
  }, this._onTouchEnd = () => {
10052
10647
  this._clearTouchTimer(), this._touchStart = null;
10053
10648
  };
@@ -10070,7 +10665,7 @@ var Un = 550, Wn = 12, Gn = { passive: !0 }, Kn = class extends HTMLElement {
10070
10665
  }
10071
10666
  _longPressMs() {
10072
10667
  let e = parseInt(this.getAttribute("long-press-ms") || "", 10);
10073
- return !Number.isNaN(e) && e > 100 ? e : Un;
10668
+ return !Number.isNaN(e) && e > 100 ? e : Gn;
10074
10669
  }
10075
10670
  _resolveTable() {
10076
10671
  let e = this.getAttribute("for")?.trim();
@@ -10124,12 +10719,12 @@ var Un = 550, Wn = 12, Gn = { passive: !0 }, Kn = class extends HTMLElement {
10124
10719
  return this._elementIsScrollContainer(e) && r(e), t;
10125
10720
  }
10126
10721
  _detachScrollCloseListeners() {
10127
- for (let e of this._scrollCloseTargets) e.removeEventListener("scroll", this._onScrollClose, Gn);
10722
+ for (let e of this._scrollCloseTargets) e.removeEventListener("scroll", this._onScrollClose, qn);
10128
10723
  this._scrollCloseTargets = [];
10129
10724
  }
10130
10725
  _attachScrollCloseListeners(e) {
10131
10726
  this._detachScrollCloseListeners(), this._scrollCloseTargets = this._collectScrollCloseTargets(e);
10132
- for (let e of this._scrollCloseTargets) e.addEventListener("scroll", this._onScrollClose, Gn);
10727
+ for (let e of this._scrollCloseTargets) e.addEventListener("scroll", this._onScrollClose, qn);
10133
10728
  }
10134
10729
  _closePopover() {
10135
10730
  if (this._detachScrollCloseListeners(), !this._popover?.hasAttribute("open")) return;
@@ -10170,10 +10765,10 @@ var Un = 550, Wn = 12, Gn = { passive: !0 }, Kn = class extends HTMLElement {
10170
10765
  l && this._attachScrollCloseListeners(l);
10171
10766
  }
10172
10767
  };
10173
- customElements.get("mint-resource-table-context-menu") || a("mint-resource-table-context-menu", Kn);
10768
+ customElements.get("mint-resource-table-context-menu") || a("mint-resource-table-context-menu", Jn);
10174
10769
  //#endregion
10175
10770
  //#region src/components/search/Search.ts
10176
- var qn = class e extends HTMLElement {
10771
+ var Yn = class e extends HTMLElement {
10177
10772
  constructor(...e) {
10178
10773
  super(...e), this._shell = null, this._desktopInput = null, this._panel = null, this._panelInner = null, this._resultsId = "", this._panelInput = null, this._panelFiltersWrap = null, this._panelFiltersMainRow = null, this._panelFiltersChips = null, this._panelFiltersShowAllWrap = null, this._panelFiltersShowAllBtn = null, this._panelFiltersMorePanel = null, this._filtersMoreOpen = !1, this._filterOverflowObserver = null, this._filterOverflowZeroWidthRetries = 0, this._desktopFilterWrap = null, this._mobileFilterWrap = null, this._resultsWrap = null, this._stateWrap = null, this._customResultsWrap = null, this._query = "", this._searchOpen = !1, this._selectedFilters = [], this._selectedFilterBackspaceArmed = !1, this._debounceId = null, this._abortController = null, this._docPointerDownHandler = null, this._globalKeydownHandler = null, this._focusOutHandler = null, this._resizeHandler = null, this._scrollHandler = null, this._desktopShortcutHint = null, this._panelSearchBar = null, this._contentObserver = null, this._renderFrame = null;
10179
10774
  }
@@ -10745,7 +11340,7 @@ var qn = class e extends HTMLElement {
10745
11340
  let e = document.createElement("div");
10746
11341
  e.className = "mint-search-panel-inner", this._panelInner = e;
10747
11342
  let t = document.createElement("div");
10748
- this._panelSearchBar = t, t.className = "mint-search-panel-searchbar is-hidden", this._mobileFilterWrap = document.createElement("div"), this._mobileFilterWrap.className = "mint-search-filter-slot", this._mobileFilterWrap.setAttribute("slot", "prepend"), this._panelInput = document.createElement("mint-input"), this._panelInput.setAttribute("type", "search"), this._panelInput.setAttribute("aria-label", this.getAttribute("placeholder") || "Search"), this._panelInput.className = "mint-search-input", this._bindInputHandlers(this._panelInput), this._panelInput.appendChild(this._mobileFilterWrap), t.appendChild(this._panelInput), this._customResultsWrap = document.createElement("div"), this._customResultsWrap.className = "mint-search-custom-results is-hidden", this._stateWrap = document.createElement("div"), this._stateWrap.className = "mint-search-state", this._stateWrap.textContent = "Start typing to search", this._stateWrap.setAttribute("role", "status"), this._stateWrap.setAttribute("aria-live", "polite"), this._resultsWrap = document.createElement("div"), this._resultsWrap.className = "mint-search-results", this._resultsId = `mint-search-results-${Math.random().toString(36).slice(2, 10)}`, this._resultsWrap.id = this._resultsId, this._resultsWrap.setAttribute("role", "listbox"), this._resultsWrap.setAttribute("aria-label", "Search results"), this._customResultsWrap.setAttribute("role", "region"), this._customResultsWrap.setAttribute("aria-label", "Search results"), e.appendChild(t), this._panelFiltersWrap = document.createElement("div"), e.appendChild(this._panelFiltersWrap), this._ensurePanelFiltersShell(), e.appendChild(this._customResultsWrap), e.appendChild(this._stateWrap), e.appendChild(this._resultsWrap), this._panel.appendChild(e);
11343
+ this._panelSearchBar = t, t.className = "mint-search-panel-searchbar is-hidden", this._mobileFilterWrap = document.createElement("div"), this._mobileFilterWrap.className = "mint-search-filter-slot", this._mobileFilterWrap.setAttribute("slot", "prepend"), this._panelInput = document.createElement("mint-input"), this._panelInput.setAttribute("type", "search"), this._panelInput.setAttribute("icon", "search"), this._panelInput.setAttribute("aria-label", this.getAttribute("placeholder") || "Search"), this._panelInput.className = "mint-search-input", this._bindInputHandlers(this._panelInput), this._panelInput.appendChild(this._mobileFilterWrap), t.appendChild(this._panelInput), this._customResultsWrap = document.createElement("div"), this._customResultsWrap.className = "mint-search-custom-results is-hidden", this._stateWrap = document.createElement("div"), this._stateWrap.className = "mint-search-state", this._stateWrap.textContent = "Start typing to search", this._stateWrap.setAttribute("role", "status"), this._stateWrap.setAttribute("aria-live", "polite"), this._resultsWrap = document.createElement("div"), this._resultsWrap.className = "mint-search-results", this._resultsId = `mint-search-results-${Math.random().toString(36).slice(2, 10)}`, this._resultsWrap.id = this._resultsId, this._resultsWrap.setAttribute("role", "listbox"), this._resultsWrap.setAttribute("aria-label", "Search results"), this._customResultsWrap.setAttribute("role", "region"), this._customResultsWrap.setAttribute("aria-label", "Search results"), e.appendChild(t), this._panelFiltersWrap = document.createElement("div"), e.appendChild(this._panelFiltersWrap), this._ensurePanelFiltersShell(), e.appendChild(this._customResultsWrap), e.appendChild(this._stateWrap), e.appendChild(this._resultsWrap), this._panel.appendChild(e);
10749
11344
  }
10750
11345
  this._panel.parentElement !== document.body && document.body.appendChild(this._panel);
10751
11346
  let t = this._hasSelectedFilters() ? "" : this._getPlaceholder();
@@ -10823,10 +11418,10 @@ var qn = class e extends HTMLElement {
10823
11418
  this._shell && this._shell.classList.toggle("is-collapsed", e), this._panelSearchBar && (this._panelSearchBar.classList.toggle("is-hidden", !e), this._panelSearchBar.classList.toggle("is-collapsed", e));
10824
11419
  }
10825
11420
  };
10826
- customElements.get("mint-search") || a("mint-search", qn);
11421
+ customElements.get("mint-search") || a("mint-search", Yn);
10827
11422
  //#endregion
10828
11423
  //#region src/components/select/NativeSelect.ts
10829
- var B = "data-mint-native-select-part", Jn = class extends HTMLElement {
11424
+ var B = "data-mint-native-select-part", Xn = class extends HTMLElement {
10830
11425
  static get observedAttributes() {
10831
11426
  return [
10832
11427
  "name",
@@ -11087,10 +11682,10 @@ var B = "data-mint-native-select-part", Jn = class extends HTMLElement {
11087
11682
  n && (n.id = `${e}-info`, t.push(n.id)), r && (r.id = `${e}-error`, t.push(r.id)), t.length ? this._select.setAttribute("aria-describedby", Array.from(new Set(t)).join(" ")) : this._select.removeAttribute("aria-describedby");
11088
11683
  }
11089
11684
  };
11090
- customElements.get("mint-native-select") || a("mint-native-select", Jn);
11685
+ customElements.get("mint-native-select") || a("mint-native-select", Xn);
11091
11686
  //#endregion
11092
11687
  //#region src/components/select/Select.ts
11093
- var V = "data-mint-select-part", Yn = class extends HTMLElement {
11688
+ var V = "data-mint-select-part", Zn = class extends HTMLElement {
11094
11689
  constructor(...e) {
11095
11690
  super(...e), this._native = null, this._trigger = null, this._popover = null, this._list = null, this._observer = null, this._syncing = !1, this._typeahead = "", this._typeaheadTimer = null, this._id = `mint-select-${Math.random().toString(36).slice(2, 10)}`;
11096
11691
  }
@@ -11380,10 +11975,10 @@ var V = "data-mint-select-part", Yn = class extends HTMLElement {
11380
11975
  t && (this._popover?.hasAttribute("open") || this._popover?.open(), t.focus());
11381
11976
  }
11382
11977
  };
11383
- customElements.get("mint-select") || a("mint-select", Yn);
11978
+ customElements.get("mint-select") || a("mint-select", Zn);
11384
11979
  //#endregion
11385
11980
  //#region src/components/side-navigation/SideNavigationLink.ts
11386
- var Xn = class extends HTMLElement {
11981
+ var Qn = class extends HTMLElement {
11387
11982
  constructor(...e) {
11388
11983
  super(...e), this._trigger = null, this._submenuContainer = null, this._contentObserver = null, this._renderFrame = null;
11389
11984
  }
@@ -11517,10 +12112,10 @@ var Xn = class extends HTMLElement {
11517
12112
  this._hasSubmenu() && !this._isSubmenuItem() ? this._buildDropdownLink() : this._buildSimpleLink();
11518
12113
  }
11519
12114
  };
11520
- customElements.get("mint-sidenav-link") || a("mint-sidenav-link", Xn);
12115
+ customElements.get("mint-sidenav-link") || a("mint-sidenav-link", Qn);
11521
12116
  //#endregion
11522
12117
  //#region src/components/side-navigation/SideNavigationLinks.ts
11523
- var Zn = class extends HTMLElement {
12118
+ var $n = class extends HTMLElement {
11524
12119
  constructor(...e) {
11525
12120
  super(...e), this._container = null, this._title = null, this._titleLabel = null, this._titleCaret = null, this._titleIsInteractive = null, this._list = null, this._titleClickHandler = null, this._listenerCounts = /* @__PURE__ */ new Map();
11526
12121
  }
@@ -11583,10 +12178,10 @@ var Zn = class extends HTMLElement {
11583
12178
  });
11584
12179
  }
11585
12180
  };
11586
- customElements.get("mint-sidenav-links") || a("mint-sidenav-links", Zn);
12181
+ customElements.get("mint-sidenav-links") || a("mint-sidenav-links", $n);
11587
12182
  //#endregion
11588
12183
  //#region src/components/side-navigation/SideNavigationActionLinks.ts
11589
- var Qn = class extends HTMLElement {
12184
+ var er = class extends HTMLElement {
11590
12185
  static get observedAttributes() {
11591
12186
  return ["separated"];
11592
12187
  }
@@ -11603,10 +12198,10 @@ var Qn = class extends HTMLElement {
11603
12198
  this.className = this._isSeparated() ? "mint-sidenav-action-links is-separated" : "mint-sidenav-action-links";
11604
12199
  }
11605
12200
  };
11606
- customElements.get("mint-sidenav-action-links") || a("mint-sidenav-action-links", Qn);
12201
+ customElements.get("mint-sidenav-action-links") || a("mint-sidenav-action-links", er);
11607
12202
  //#endregion
11608
12203
  //#region src/components/side-navigation/SideNavigationActionMenu.ts
11609
- var $n = class extends HTMLElement {
12204
+ var tr = class extends HTMLElement {
11610
12205
  constructor(...e) {
11611
12206
  super(...e), this._wrapper = null, this._trigger = null, this._popover = null, this._triggerId = "", this._contentObserver = null, this._renderFrame = null;
11612
12207
  }
@@ -11673,11 +12268,11 @@ var $n = class extends HTMLElement {
11673
12268
  }) : a.appendChild(this._createDefaultGroup()), this._popover.appendChild(a), this._wrapper.appendChild(this._trigger), this._wrapper.appendChild(this._popover);
11674
12269
  }
11675
12270
  };
11676
- customElements.get("mint-sidenav-action-menu") || a("mint-sidenav-action-menu", $n);
12271
+ customElements.get("mint-sidenav-action-menu") || a("mint-sidenav-action-menu", tr);
11677
12272
  //#endregion
11678
12273
  //#region src/components/side-navigation/SideNavigation.ts
11679
12274
  var H = "mint:url-change";
11680
- function er() {
12275
+ function nr() {
11681
12276
  if (window.__mintUrlChangePatched) return;
11682
12277
  window.__mintUrlChangePatched = !0;
11683
12278
  let e = () => {
@@ -11691,7 +12286,7 @@ function er() {
11691
12286
  };
11692
12287
  t("pushState"), t("replaceState");
11693
12288
  }
11694
- var tr = class extends HTMLElement {
12289
+ var rr = class extends HTMLElement {
11695
12290
  constructor(...e) {
11696
12291
  super(...e), this._backdrop = null, this._container = null, this._header = null, this._content = null, this._disposeContentFade = null, this._footer = null, this._escapeHandler = null, this._mediaQuery = null, this._mediaListener = null, this._accordionHandler = null, this._urlChangeHandler = null, this._contentObserver = null, this._renderFrame = null, this._onMobileNavNavigateClick = (e) => {
11697
12292
  if (this._mediaQuery?.matches) return;
@@ -11754,7 +12349,7 @@ var tr = class extends HTMLElement {
11754
12349
  this._accordionHandler &&= (this.removeEventListener("mint-sidenav-accordion", this._accordionHandler), null);
11755
12350
  }
11756
12351
  _attachUrlChangeListener() {
11757
- this._urlChangeHandler || (er(), this._urlChangeHandler = () => {
12352
+ this._urlChangeHandler || (nr(), this._urlChangeHandler = () => {
11758
12353
  this._mediaQuery?.matches || this._isOpen() && this.removeAttribute("open");
11759
12354
  }, window.addEventListener("popstate", this._urlChangeHandler), window.addEventListener("hashchange", this._urlChangeHandler), window.addEventListener(H, this._urlChangeHandler));
11760
12355
  }
@@ -11817,10 +12412,10 @@ var tr = class extends HTMLElement {
11817
12412
  this._ensureBackdrop(), this._ensureContainer(), this._syncShell(), this._buildUserHeader(), this._buildContent(), this._buildFooter();
11818
12413
  }
11819
12414
  };
11820
- customElements.get("mint-side-navigation") || a("mint-side-navigation", tr);
12415
+ customElements.get("mint-side-navigation") || a("mint-side-navigation", rr);
11821
12416
  //#endregion
11822
12417
  //#region src/components/side-navigation/index.ts
11823
- var nr = tr, U = "mint-sortable-placeholder", W = "mint-sortable-dragging", rr = class e extends HTMLElement {
12418
+ var ir = rr, U = "mint-sortable-placeholder", W = "mint-sortable-dragging", ar = class e extends HTMLElement {
11824
12419
  static get observedAttributes() {
11825
12420
  return [
11826
12421
  "direction",
@@ -12237,10 +12832,10 @@ var nr = tr, U = "mint-sortable-placeholder", W = "mint-sortable-dragging", rr =
12237
12832
  this._placeholder?.remove(), this._placeholder = null, this._dragEl = null, this._pointerId = null, this._restoreAfter = null, this._originListRoot = null, this._originNextSibling = null, this._dropList = null, this._dropRejected = !1;
12238
12833
  }
12239
12834
  };
12240
- customElements.get("mint-sortable") || a("mint-sortable", rr);
12835
+ customElements.get("mint-sortable") || a("mint-sortable", ar);
12241
12836
  //#endregion
12242
12837
  //#region src/components/tabs/Tab.ts
12243
- var ir = class extends HTMLElement {
12838
+ var or = class extends HTMLElement {
12244
12839
  static get observedAttributes() {
12245
12840
  return [
12246
12841
  "active",
@@ -12299,10 +12894,10 @@ var ir = class extends HTMLElement {
12299
12894
  })));
12300
12895
  }
12301
12896
  };
12302
- customElements.get("mint-tab") || a("mint-tab", ir);
12897
+ customElements.get("mint-tab") || a("mint-tab", or);
12303
12898
  //#endregion
12304
12899
  //#region src/components/tabs/TabList.ts
12305
- var ar = class extends HTMLElement {
12900
+ var sr = class extends HTMLElement {
12306
12901
  static get observedAttributes() {
12307
12902
  return ["position"];
12308
12903
  }
@@ -12322,10 +12917,10 @@ var ar = class extends HTMLElement {
12322
12917
  this.setAttribute("role", "tablist"), !this.hasAttribute("aria-label") && !this.hasAttribute("aria-labelledby") && this.setAttribute("aria-label", "Tabs"), this.setAttribute("aria-orientation", this.getPosition() === "top" ? "horizontal" : "vertical");
12323
12918
  }
12324
12919
  };
12325
- customElements.get("mint-tab-list") || a("mint-tab-list", ar);
12920
+ customElements.get("mint-tab-list") || a("mint-tab-list", sr);
12326
12921
  //#endregion
12327
12922
  //#region src/components/tabs/TabContent.ts
12328
- var or = class extends HTMLElement {
12923
+ var cr = class extends HTMLElement {
12329
12924
  static get observedAttributes() {
12330
12925
  return ["id"];
12331
12926
  }
@@ -12363,10 +12958,10 @@ var or = class extends HTMLElement {
12363
12958
  this.setAttribute("role", "tabpanel"), this.hasAttribute("tabindex") || this.setAttribute("tabindex", "0");
12364
12959
  }
12365
12960
  };
12366
- customElements.get("mint-tab-content") || a("mint-tab-content", or);
12961
+ customElements.get("mint-tab-content") || a("mint-tab-content", cr);
12367
12962
  //#endregion
12368
12963
  //#region src/components/tabs/Tabs.ts
12369
- var sr = class e extends HTMLElement {
12964
+ var lr = class e extends HTMLElement {
12370
12965
  static {
12371
12966
  this._id = 0;
12372
12967
  }
@@ -12472,10 +13067,10 @@ var sr = class e extends HTMLElement {
12472
13067
  });
12473
13068
  }
12474
13069
  };
12475
- customElements.get("mint-tabs") || a("mint-tabs", sr);
13070
+ customElements.get("mint-tabs") || a("mint-tabs", lr);
12476
13071
  //#endregion
12477
13072
  //#region src/components/tags/Tags.ts
12478
- var cr = class extends HTMLElement {
13073
+ var ur = class extends HTMLElement {
12479
13074
  constructor(...e) {
12480
13075
  super(...e), this._container = null, this._chipsWrap = null, this._input = null, this._tags = [], this._predefinedTags = [], this._placeholder = "Add tag", this._predefinedPopoverOpenListenersAttached = !1, this._predefinedBlurCloseTimer = null, this._suppressNextPredefinedBlurClose = !1, this._dragIndex = null, this._dragChip = null, this._isPointerDragging = !1, this._pointerMoveHandler = null, this._pointerUpHandler = null, this._containerFocusRingListeners = !1, this._predefinedFieldResizeObserver = null, this._predefinedPopoverBodyEl = null;
12481
13076
  }
@@ -12782,457 +13377,116 @@ var cr = class extends HTMLElement {
12782
13377
  }
12783
13378
  _focusLastChip() {
12784
13379
  let e = this._chipsWrap?.querySelectorAll("mint-chip");
12785
- e && e.length > 0 && e[e.length - 1].focus({ preventScroll: !0 });
12786
- }
12787
- _focusInput() {
12788
- setTimeout(() => {
12789
- this._input?.focus({ preventScroll: !0 });
12790
- }, 10);
12791
- }
12792
- _wireInputBackspace() {
12793
- this._input && this._input.addEventListener("keydown", (e) => {
12794
- e.key === "Backspace" && this._input?.value === "" && (e.preventDefault(), this._focusLastChip());
12795
- });
12796
- }
12797
- _setupChipEvents(e, t) {
12798
- e.tabIndex = 0, e.addEventListener("keydown", (e) => {
12799
- (e.key === "Backspace" || e.key === "Delete") && t.dismissable && (e.preventDefault(), this._removeTag(t.value), this._focusInput());
12800
- });
12801
- }
12802
- _onContainerPointerDown(e) {
12803
- if (!this._input || !this._input.isConnected || this._input.parentElement !== this._chipsWrap || e.button !== 0 || e.defaultPrevented) return;
12804
- let t = e.composedPath();
12805
- if (!t.some((e) => e === this._input) && !t.some((e) => e instanceof Element && e.closest("mint-chip") != null)) {
12806
- this._predefinedBlurCloseTimer !== null && (window.clearTimeout(this._predefinedBlurCloseTimer), this._predefinedBlurCloseTimer = null), this._suppressNextPredefinedBlurClose = !0, e.preventDefault();
12807
- try {
12808
- this._input.focus({ preventScroll: !0 });
12809
- } catch {}
12810
- this._predefinedTags.length > 0 && this._getPredefinedPopoverEl()?.setAttribute("open", "true");
12811
- }
12812
- }
12813
- _onDragStart(e, t) {
12814
- this.hasAttribute("sortable") && (this._dragChip = t, this._dragIndex = Number(t.dataset.index), e.dataTransfer?.setData("text/plain", t.dataset.index || ""), e.dataTransfer && (e.dataTransfer.effectAllowed = "move", e.dataTransfer.dropEffect = "move"), t.classList.add("mint-tags-chip-dragging"));
12815
- }
12816
- _reorderTags(e, t) {
12817
- if (e < 0 || t < 0 || e >= this._tags.length || t >= this._tags.length) return;
12818
- let n = [...this._tags], [r] = n.splice(e, 1);
12819
- n.splice(t, 0, r), this._tags = n, this._syncAttr(), this._renderChips(), this._emitChange();
12820
- }
12821
- _onDragOverInput(e) {
12822
- this.hasAttribute("sortable") && (e.preventDefault(), e.dataTransfer && (e.dataTransfer.dropEffect = "move"), this._dragChip && this._chipsWrap && this._input && this._chipsWrap.insertBefore(this._dragChip, this._input));
12823
- }
12824
- _onDragOverChip(e, t) {
12825
- if (!this.hasAttribute("sortable") || (e.preventDefault(), e.dataTransfer && (e.dataTransfer.dropEffect = "move"), !this._dragChip || !this._chipsWrap) || t === this._dragChip) return;
12826
- let n = t.getBoundingClientRect();
12827
- if (e.clientX < n.left + n.width * .5) {
12828
- if (this._dragChip.nextSibling === t) return;
12829
- this._chipsWrap.insertBefore(this._dragChip, t);
12830
- } else {
12831
- if (t.nextSibling === this._dragChip) return;
12832
- let e = t.nextSibling;
12833
- e ? this._chipsWrap.insertBefore(this._dragChip, e) : this._chipsWrap.appendChild(this._dragChip);
12834
- }
12835
- }
12836
- _onDrop(e) {
12837
- this.hasAttribute("sortable") && e.preventDefault();
12838
- }
12839
- _onDragEnd() {
12840
- this._dragChip && this._dragChip.classList.remove("mint-tags-chip-dragging"), this._syncOrderFromDom(), this._dragChip = null, this._dragIndex = null;
12841
- }
12842
- _syncOrderFromDom() {
12843
- if (!this._chipsWrap) return;
12844
- let e = Array.from(this._chipsWrap.querySelectorAll("mint-chip"));
12845
- if (e.length === 0) return;
12846
- let t = [];
12847
- e.forEach((e) => {
12848
- let n = e.dataset.value;
12849
- if (!n) return;
12850
- let r = this._tags.find((e) => e.value === n);
12851
- r && t.push(r);
12852
- }), t.length === this._tags.length && (this._tags = t, this._syncAttr(), this._renderChips(), this._emitChange());
12853
- }
12854
- _onPointerDown(e, t) {
12855
- if (this.hasAttribute("sortable") && e.pointerType !== "mouse") {
12856
- this._isPointerDragging = !0, this._dragChip = t, this._dragIndex = Number(t.dataset.index);
12857
- try {
12858
- t.setPointerCapture(e.pointerId);
12859
- } catch {}
12860
- t.classList.add("mint-tags-chip-dragging", "mint-tags-chip-no-select"), e.preventDefault();
12861
- }
12862
- }
12863
- _onPointerMove(e) {
12864
- if (!this._isPointerDragging || !this._dragChip || !this._chipsWrap || e.pointerType === "mouse") return;
12865
- let t = document.elementFromPoint(e.clientX, e.clientY);
12866
- if (!t) return;
12867
- let n = t.closest("mint-chip");
12868
- if (n && n !== this._dragChip) {
12869
- let t = n.getBoundingClientRect();
12870
- if (e.clientX < t.left + t.width * .5) this._dragChip.nextSibling !== n && this._chipsWrap.insertBefore(this._dragChip, n);
12871
- else if (n.nextSibling !== this._dragChip) {
12872
- let e = n.nextSibling;
12873
- e ? this._chipsWrap.insertBefore(this._dragChip, e) : this._chipsWrap.appendChild(this._dragChip);
12874
- }
12875
- return;
12876
- }
12877
- this._input && t.closest("input") === this._input && this._chipsWrap.insertBefore(this._dragChip, this._input);
12878
- }
12879
- _onPointerUp(e) {
12880
- if (this._isPointerDragging) {
12881
- if (this._isPointerDragging = !1, this._dragChip) {
12882
- try {
12883
- this._dragChip.releasePointerCapture(e.pointerId);
12884
- } catch {}
12885
- this._dragChip.classList.remove("mint-tags-chip-dragging", "mint-tags-chip-no-select");
12886
- }
12887
- this._syncOrderFromDom(), this._dragChip = null, this._dragIndex = null;
12888
- }
12889
- }
12890
- };
12891
- customElements.get("mint-tags") || a("mint-tags", cr);
12892
- //#endregion
12893
- //#region src/components/time-picker/TimePicker.ts
12894
- var lr = class extends HTMLElement {
12895
- constructor(...e) {
12896
- super(...e), this._triggerId = `mint-time-picker-trigger-${Math.random().toString(36).slice(2, 10)}`, this._popover = null, this._popoverObserver = null, this._inputEl = null, this._hiddenInput = null, this._single = {
12897
- hour: 9,
12898
- minute: 0,
12899
- second: 0,
12900
- meridiem: "AM"
12901
- }, this._rangeStart = {
12902
- hour: 9,
12903
- minute: 0,
12904
- second: 0,
12905
- meridiem: "AM"
12906
- }, this._rangeEnd = {
12907
- hour: 5,
12908
- minute: 0,
12909
- second: 0,
12910
- meridiem: "PM"
12911
- }, this._invalidFromInput = !1;
12912
- }
12913
- static get observedAttributes() {
12914
- return [
12915
- "value",
12916
- "label",
12917
- "info",
12918
- "disabled",
12919
- "id",
12920
- "name",
12921
- "required",
12922
- "readonly",
12923
- "range",
12924
- "hours",
12925
- "minutes",
12926
- "seconds",
12927
- "error",
12928
- "error-message"
12929
- ];
12930
- }
12931
- connectedCallback() {
12932
- this.classList.add("mint-time-picker-host"), this._parseAndApplyValue(this.getAttribute("value") || ""), this.render();
12933
- }
12934
- disconnectedCallback() {
12935
- this._popoverObserver &&= (this._popoverObserver.disconnect(), null);
12936
- }
12937
- attributeChangedCallback(e, t, n) {
12938
- if (t !== n) {
12939
- if (e === "value") {
12940
- if (this._parseAndApplyValue(n || ""), this._syncHiddenInput(), this._syncInputValue(), this._popover) {
12941
- let e = this._popover.querySelector("[data-mint-time-picker-body=\"true\"]");
12942
- e && this._buildPopoverContent(e);
12943
- }
12944
- return;
12945
- }
12946
- e !== "error" && e !== "error-message" && (this._invalidFromInput = !1), this.render();
12947
- }
12948
- }
12949
- get value() {
12950
- return this.getValue();
12951
- }
12952
- set value(e) {
12953
- this.setValue(e || "");
12954
- }
12955
- getValue() {
12956
- return this.getAttribute("value") || "";
12957
- }
12958
- setValue(e) {
12959
- e ? this.setAttribute("value", e) : this.removeAttribute("value"), this._parseAndApplyValue(e || ""), this._syncHiddenInput(), this._syncInputValue();
12960
- }
12961
- isRange() {
12962
- return this.getAttribute("range") === "true";
12963
- }
12964
- isHoursEnabled() {
12965
- let e = this.getAttribute("hours");
12966
- return e === null ? !0 : e !== "false";
12967
- }
12968
- isMinutesEnabled() {
12969
- let e = this.getAttribute("minutes");
12970
- return e === null ? !0 : e !== "false";
12971
- }
12972
- isSecondsEnabled() {
12973
- let e = this.getAttribute("seconds");
12974
- return e === null ? !1 : e !== "false";
12975
- }
12976
- isDisabled() {
12977
- return this.getAttribute("disabled") === "true";
12978
- }
12979
- isReadonly() {
12980
- return this.getAttribute("readonly") === "true";
12981
- }
12982
- isRequired() {
12983
- return this.getAttribute("required") === "true";
12984
- }
12985
- hasExternalError() {
12986
- return this.getAttribute("error") === "true";
12987
- }
12988
- getExternalErrorMessage() {
12989
- return this.getAttribute("error-message") || "";
12990
- }
12991
- getLabel() {
12992
- return this.getAttribute("label") || "";
12993
- }
12994
- getInfo() {
12995
- return this.getAttribute("info") || "";
12996
- }
12997
- getName() {
12998
- return this.getAttribute("name") || "";
12999
- }
13000
- _getEffectiveError() {
13001
- return {
13002
- hasError: this.hasExternalError(),
13003
- message: this.getExternalErrorMessage()
13004
- };
13005
- }
13006
- _formatParts(e) {
13007
- let t = this.isHoursEnabled(), n = this.isMinutesEnabled(), r = this.isSecondsEnabled(), i = [];
13008
- return t && i.push(e.hour.toString()), n && i.push(e.minute.toString().padStart(2, "0")), r && i.push(e.second.toString().padStart(2, "0")), t ? `${i.join(":")} ${e.meridiem.toLowerCase()}` : i.join(":");
13009
- }
13010
- _to24Hour(e) {
13011
- let t = e.hour % 12;
13012
- return e.meridiem === "PM" && (t += 12), {
13013
- hour: t,
13014
- minute: e.minute,
13015
- second: e.second
13016
- };
13017
- }
13018
- _formatParts24(e) {
13019
- let t = this.isHoursEnabled(), n = this.isMinutesEnabled(), r = this.isSecondsEnabled(), i = this._to24Hour(e), a = [];
13020
- return t && a.push(i.hour.toString().padStart(2, "0")), n && a.push(i.minute.toString().padStart(2, "0")), r && a.push(i.second.toString().padStart(2, "0")), a.join(":");
13021
- }
13022
- _getDisplayValue() {
13023
- return this.isRange() ? `${this._formatParts(this._rangeStart)} - ${this._formatParts(this._rangeEnd)}` : this._formatParts(this._single);
13024
- }
13025
- _getOutputValue() {
13026
- return this.isRange() ? `${this._formatParts24(this._rangeStart)} - ${this._formatParts24(this._rangeEnd)}` : this._formatParts24(this._single);
13027
- }
13028
- _getExpectedFormat() {
13029
- let e = this.isHoursEnabled(), t = this.isMinutesEnabled(), n = this.isSecondsEnabled(), r = [];
13030
- e && r.push("h"), t && r.push("mm"), n && r.push("ss");
13031
- let i = e ? `${r.join(":")} am/pm` : r.join(":");
13032
- return this.isRange() ? `${i} - ${i}` : i;
13380
+ e && e.length > 0 && e[e.length - 1].focus({ preventScroll: !0 });
13033
13381
  }
13034
- _syncHiddenInput() {
13035
- this._hiddenInput && (this._hiddenInput.value = this.getValue() || this._getOutputValue());
13382
+ _focusInput() {
13383
+ setTimeout(() => {
13384
+ this._input?.focus({ preventScroll: !0 });
13385
+ }, 10);
13036
13386
  }
13037
- _syncInputValue() {
13038
- this._inputEl && (this._inputEl.value = this._getDisplayValue(), typeof this._inputEl.render == "function" && this._inputEl.render());
13387
+ _wireInputBackspace() {
13388
+ this._input && this._input.addEventListener("keydown", (e) => {
13389
+ e.key === "Backspace" && this._input?.value === "" && (e.preventDefault(), this._focusLastChip());
13390
+ });
13039
13391
  }
13040
- _emitChangeFromPicker() {
13041
- let e = this._getOutputValue();
13042
- this._invalidFromInput = !1, this.setAttribute("value", e), this._syncHiddenInput(), this._syncInputValue(), this.dispatchEvent(new Event("input", {
13043
- bubbles: !0,
13044
- composed: !0
13045
- })), this.dispatchEvent(new Event("change", { bubbles: !0 }));
13392
+ _setupChipEvents(e, t) {
13393
+ e.tabIndex = 0, e.addEventListener("keydown", (e) => {
13394
+ (e.key === "Backspace" || e.key === "Delete") && t.dismissable && (e.preventDefault(), this._removeTag(t.value), this._focusInput());
13395
+ });
13046
13396
  }
13047
- _parseSingle(e) {
13048
- let t = this.isHoursEnabled(), n = this.isMinutesEnabled(), r = this.isSecondsEnabled(), i = e.trim();
13049
- if (t) {
13050
- let e = i.match(/^(\d{1,2})(?::(\d{2}))?(?::(\d{2}))?\s*(am|pm)$/i);
13051
- if (!e) return null;
13052
- let t = Number(e[1]), a = Number(e[2] ?? 0), o = Number(e[3] ?? 0), s = e[4].toUpperCase();
13053
- return t < 1 || t > 12 || n && (a < 0 || a > 59) || r && (o < 0 || o > 59) ? null : {
13054
- hour: t,
13055
- minute: a,
13056
- second: o,
13057
- meridiem: s
13058
- };
13397
+ _onContainerPointerDown(e) {
13398
+ if (!this._input || !this._input.isConnected || this._input.parentElement !== this._chipsWrap || e.button !== 0 || e.defaultPrevented) return;
13399
+ let t = e.composedPath();
13400
+ if (!t.some((e) => e === this._input) && !t.some((e) => e instanceof Element && e.closest("mint-chip") != null)) {
13401
+ this._predefinedBlurCloseTimer !== null && (window.clearTimeout(this._predefinedBlurCloseTimer), this._predefinedBlurCloseTimer = null), this._suppressNextPredefinedBlurClose = !0, e.preventDefault();
13402
+ try {
13403
+ this._input.focus({ preventScroll: !0 });
13404
+ } catch {}
13405
+ this._predefinedTags.length > 0 && this._getPredefinedPopoverEl()?.setAttribute("open", "true");
13059
13406
  }
13060
- let a = i.match(/^(\d{2})(?::(\d{2}))?$/);
13061
- if (!a) return null;
13062
- let o = Number(a[1]), s = Number(a[2] ?? 0);
13063
- return n && (o < 0 || o > 59) || r && (s < 0 || s > 59) ? null : {
13064
- hour: 12,
13065
- minute: o,
13066
- second: s,
13067
- meridiem: "AM"
13068
- };
13069
13407
  }
13070
- _parseSingleOutput24(e) {
13071
- let t = this.isHoursEnabled(), n = this.isMinutesEnabled(), r = this.isSecondsEnabled(), i = e.trim();
13072
- if (t) {
13073
- let e = i.match(/^(\d{2})(?::(\d{2}))?(?::(\d{2}))?$/);
13074
- if (!e) return null;
13075
- let t = Number(e[1]), a = Number(e[2] ?? 0), o = Number(e[3] ?? 0);
13076
- if (t < 0 || t > 23 || n && (a < 0 || a > 59) || r && (o < 0 || o > 59)) return null;
13077
- let s = t >= 12 ? "PM" : "AM";
13078
- return {
13079
- hour: t % 12 == 0 ? 12 : t % 12,
13080
- minute: a,
13081
- second: o,
13082
- meridiem: s
13083
- };
13084
- }
13085
- let a = i.match(/^(\d{2})(?::(\d{2}))?$/);
13086
- if (!a) return null;
13087
- let o = Number(a[1]), s = Number(a[2] ?? 0);
13088
- return n && (o < 0 || o > 59) || r && (s < 0 || s > 59) ? null : {
13089
- hour: 12,
13090
- minute: o,
13091
- second: s,
13092
- meridiem: "AM"
13093
- };
13408
+ _onDragStart(e, t) {
13409
+ this.hasAttribute("sortable") && (this._dragChip = t, this._dragIndex = Number(t.dataset.index), e.dataTransfer?.setData("text/plain", t.dataset.index || ""), e.dataTransfer && (e.dataTransfer.effectAllowed = "move", e.dataTransfer.dropEffect = "move"), t.classList.add("mint-tags-chip-dragging"));
13094
13410
  }
13095
- _parseAndApplyValue(e) {
13096
- if (!e) return !1;
13097
- if (this.isRange()) {
13098
- let [t, n] = e.split("-").map((e) => e.trim()), r = this._parseSingleOutput24(t || ""), i = this._parseSingleOutput24(n || "");
13099
- return !r || !i ? !1 : (this._rangeStart = r, this._rangeEnd = i, !0);
13100
- }
13101
- let t = this._parseSingleOutput24(e);
13102
- return t ? (this._single = t, !0) : !1;
13411
+ _reorderTags(e, t) {
13412
+ if (e < 0 || t < 0 || e >= this._tags.length || t >= this._tags.length) return;
13413
+ let n = [...this._tags], [r] = n.splice(e, 1);
13414
+ n.splice(t, 0, r), this._tags = n, this._syncAttr(), this._renderChips(), this._emitChange();
13103
13415
  }
13104
- _parseAndApplyDisplayValue(e) {
13105
- if (!e) return !1;
13106
- if (this.isRange()) {
13107
- let [t, n] = e.split("-").map((e) => e.trim()), r = this._parseSingle(t || ""), i = this._parseSingle(n || "");
13108
- return !r || !i ? !1 : (this._rangeStart = r, this._rangeEnd = i, !0);
13109
- }
13110
- let t = this._parseSingle(e);
13111
- return t ? (this._single = t, !0) : !1;
13416
+ _onDragOverInput(e) {
13417
+ this.hasAttribute("sortable") && (e.preventDefault(), e.dataTransfer && (e.dataTransfer.dropEffect = "move"), this._dragChip && this._chipsWrap && this._input && this._chipsWrap.insertBefore(this._dragChip, this._input));
13112
13418
  }
13113
- _handleTypedValue(e) {
13114
- let t = e.trim();
13115
- if (!t) {
13116
- this._invalidFromInput = !1, this.removeAttribute("value"), this._syncHiddenInput(), this._syncInputValue();
13117
- return;
13118
- }
13119
- if (!this._parseAndApplyDisplayValue(t)) {
13120
- this._invalidFromInput = !0, this.removeAttribute("value"), this._inputEl && (this._inputEl.value = ""), this._syncHiddenInput(), this.render(), this.dispatchEvent(new Event("input", {
13121
- bubbles: !0,
13122
- composed: !0
13123
- })), this.dispatchEvent(new Event("change", { bubbles: !0 }));
13124
- return;
13419
+ _onDragOverChip(e, t) {
13420
+ if (!this.hasAttribute("sortable") || (e.preventDefault(), e.dataTransfer && (e.dataTransfer.dropEffect = "move"), !this._dragChip || !this._chipsWrap) || t === this._dragChip) return;
13421
+ let n = t.getBoundingClientRect();
13422
+ if (e.clientX < n.left + n.width * .5) {
13423
+ if (this._dragChip.nextSibling === t) return;
13424
+ this._chipsWrap.insertBefore(this._dragChip, t);
13425
+ } else {
13426
+ if (t.nextSibling === this._dragChip) return;
13427
+ let e = t.nextSibling;
13428
+ e ? this._chipsWrap.insertBefore(this._dragChip, e) : this._chipsWrap.appendChild(this._dragChip);
13125
13429
  }
13126
- this._invalidFromInput = !1;
13127
- let n = this._getOutputValue();
13128
- this.setAttribute("value", n), this._syncHiddenInput(), this._syncInputValue(), this.dispatchEvent(new Event("input", {
13129
- bubbles: !0,
13130
- composed: !0
13131
- })), this.dispatchEvent(new Event("change", { bubbles: !0 }));
13132
- }
13133
- _buildColumn(e, t, n, r = !0, i = "standard", a = "Time") {
13134
- let o = document.createElement("div");
13135
- return o.className = `mint-time-picker-column mint-time-picker-column-${i}${r ? " mint-time-picker-column-divider" : ""}`, o.setAttribute("role", "group"), o.setAttribute("aria-label", a), e.forEach((e) => {
13136
- let r = document.createElement("button");
13137
- r.type = "button";
13138
- let i = e === t;
13139
- r.className = `mint-time-picker-option${i ? " is-selected" : ""}`, r.dataset.selected = i ? "true" : "false", r.setAttribute("aria-pressed", String(i)), r.setAttribute("aria-label", `${a}: ${e}`), r.textContent = e, r.addEventListener("click", () => n(e)), o.appendChild(r);
13140
- }), o;
13141
13430
  }
13142
- _centerSelectedInColumn(e, t = 0) {
13143
- let n = e.querySelector("button[data-selected=\"true\"]");
13144
- if (!n) return;
13145
- let r = n.offsetTop - (e.clientHeight / 2 - n.clientHeight / 2) - t;
13146
- e.scrollTop = Math.max(0, r);
13431
+ _onDrop(e) {
13432
+ this.hasAttribute("sortable") && e.preventDefault();
13147
13433
  }
13148
- _centerAllColumnsInPopoverBody() {
13149
- if (!this._popover) return;
13150
- let e = this._popover.querySelector("[data-mint-time-picker-body=\"true\"]");
13151
- if (!e) return;
13152
- let t = Array.from(e.querySelectorAll(".mint-time-picker-column")), n = this.isRange() ? 20 : 0;
13153
- t.forEach((e) => this._centerSelectedInColumn(e, n));
13434
+ _onDragEnd() {
13435
+ this._dragChip && this._dragChip.classList.remove("mint-tags-chip-dragging"), this._syncOrderFromDom(), this._dragChip = null, this._dragIndex = null;
13154
13436
  }
13155
- _setupPopoverOpenObserver() {
13156
- this._popover && (this._popoverObserver &&= (this._popoverObserver.disconnect(), null), this._popoverObserver = new MutationObserver(() => {
13157
- this._popover?.getAttribute("open") === "true" && requestAnimationFrame(() => {
13158
- requestAnimationFrame(() => {
13159
- this._centerAllColumnsInPopoverBody();
13160
- });
13161
- });
13162
- }), this._popoverObserver.observe(this._popover, {
13163
- attributes: !0,
13164
- attributeFilter: ["open"]
13165
- }));
13437
+ _syncOrderFromDom() {
13438
+ if (!this._chipsWrap) return;
13439
+ let e = Array.from(this._chipsWrap.querySelectorAll("mint-chip"));
13440
+ if (e.length === 0) return;
13441
+ let t = [];
13442
+ e.forEach((e) => {
13443
+ let n = e.dataset.value;
13444
+ if (!n) return;
13445
+ let r = this._tags.find((e) => e.value === n);
13446
+ r && t.push(r);
13447
+ }), t.length === this._tags.length && (this._tags = t, this._syncAttr(), this._renderChips(), this._emitChange());
13166
13448
  }
13167
- _buildPickerSet(e, t, n) {
13168
- let r = this.isHoursEnabled(), i = this.isMinutesEnabled(), a = this.isSecondsEnabled(), o = document.createElement("div"), s = (r ? 1 : 0) + (i ? 1 : 0) + (a ? 1 : 0) + (r ? 1 : 0);
13169
- o.className = "mint-time-picker-wheel", o.style.gridTemplateColumns = `repeat(${Math.max(s, 1)}, minmax(0, 1fr))`;
13170
- let c = Array.from({ length: 12 }, (e, t) => (t + 1).toString().padStart(2, "0")), l = Array.from({ length: 60 }, (e, t) => t.toString().padStart(2, "0")), u = Array.from({ length: 60 }, (e, t) => t.toString().padStart(2, "0")), d = ["AM", "PM"], f = [];
13171
- r && f.push(this._buildColumn(c, t.hour.toString().padStart(2, "0"), (e) => {
13172
- n({
13173
- ...t,
13174
- hour: Number(e)
13175
- });
13176
- }, !0, "tall", "Hour")), i && f.push(this._buildColumn(l, t.minute.toString().padStart(2, "0"), (e) => {
13177
- n({
13178
- ...t,
13179
- minute: Number(e)
13180
- });
13181
- }, !0, "tall", "Minute")), a && f.push(this._buildColumn(u, t.second.toString().padStart(2, "0"), (e) => {
13182
- n({
13183
- ...t,
13184
- second: Number(e)
13185
- });
13186
- }, !0, "tall", "Second")), r && f.push(this._buildColumn(d, t.meridiem, (e) => {
13187
- n({
13188
- ...t,
13189
- meridiem: e
13190
- });
13191
- }, !0, "compact", "Meridiem")), f.forEach((e, t) => {
13192
- t === f.length - 1 && e.classList.remove("mint-time-picker-column-divider"), o.appendChild(e);
13193
- }), e.appendChild(o);
13449
+ _onPointerDown(e, t) {
13450
+ if (this.hasAttribute("sortable") && e.pointerType !== "mouse") {
13451
+ this._isPointerDragging = !0, this._dragChip = t, this._dragIndex = Number(t.dataset.index);
13452
+ try {
13453
+ t.setPointerCapture(e.pointerId);
13454
+ } catch {}
13455
+ t.classList.add("mint-tags-chip-dragging", "mint-tags-chip-no-select"), e.preventDefault();
13456
+ }
13194
13457
  }
13195
- _buildPopoverContent(e) {
13196
- if (e.innerHTML = "", !this.isRange()) {
13197
- this._buildPickerSet(e, this._single, (t) => {
13198
- this._single = t, this._emitChangeFromPicker(), this._buildPopoverContent(e);
13199
- });
13458
+ _onPointerMove(e) {
13459
+ if (!this._isPointerDragging || !this._dragChip || !this._chipsWrap || e.pointerType === "mouse") return;
13460
+ let t = document.elementFromPoint(e.clientX, e.clientY);
13461
+ if (!t) return;
13462
+ let n = t.closest("mint-chip");
13463
+ if (n && n !== this._dragChip) {
13464
+ let t = n.getBoundingClientRect();
13465
+ if (e.clientX < t.left + t.width * .5) this._dragChip.nextSibling !== n && this._chipsWrap.insertBefore(this._dragChip, n);
13466
+ else if (n.nextSibling !== this._dragChip) {
13467
+ let e = n.nextSibling;
13468
+ e ? this._chipsWrap.insertBefore(this._dragChip, e) : this._chipsWrap.appendChild(this._dragChip);
13469
+ }
13200
13470
  return;
13201
13471
  }
13202
- let t = document.createElement("div");
13203
- t.className = "mint-time-picker-range";
13204
- let n = document.createElement("div"), r = document.createElement("mint-text");
13205
- r.setAttribute("variant", "muted"), r.className = "mint-time-picker-range-label", r.textContent = "Start", n.appendChild(r), this._buildPickerSet(n, this._rangeStart, (t) => {
13206
- this._rangeStart = t, this._emitChangeFromPicker(), this._buildPopoverContent(e);
13207
- });
13208
- let i = document.createElement("div"), a = document.createElement("mint-text");
13209
- a.setAttribute("variant", "muted"), a.className = "mint-time-picker-range-label", a.textContent = "End", i.appendChild(a), this._buildPickerSet(i, this._rangeEnd, (t) => {
13210
- this._rangeEnd = t, this._emitChangeFromPicker(), this._buildPopoverContent(e);
13211
- }), t.appendChild(n), t.appendChild(i), e.appendChild(t), requestAnimationFrame(() => {
13212
- this._centerAllColumnsInPopoverBody();
13213
- });
13472
+ this._input && t.closest("input") === this._input && this._chipsWrap.insertBefore(this._dragChip, this._input);
13214
13473
  }
13215
- render() {
13216
- let e = this.isDisabled(), t = this.isReadonly(), n = this._getEffectiveError();
13217
- this.innerHTML = "";
13218
- let r = document.createElement("div");
13219
- r.className = "mint-time-picker-control", this._inputEl = document.createElement("mint-input"), this._inputEl.id = this._triggerId, this._inputEl.classList.add("mint-time-picker-trigger"), this._inputEl.setAttribute("type", "text"), this._inputEl.setAttribute("icon", "clock"), this._inputEl.setAttribute("placeholder", this._getExpectedFormat()), this._inputEl.setAttribute("label", this.getLabel()), this._inputEl.setAttribute("info", this.getInfo()), this._inputEl.setAttribute("value", this._getDisplayValue()), this._inputEl.setAttribute("error", n.hasError ? "true" : "false"), this._inputEl.setAttribute("error-message", n.message || ""), e && this._inputEl.setAttribute("disabled", "true"), t && this._inputEl.setAttribute("readonly", "true"), this._inputEl.addEventListener("change", (n) => {
13220
- if (e || t) return;
13221
- let r = n.target;
13222
- this._handleTypedValue((r?.value || "").toString());
13223
- }), this._inputEl.addEventListener("blur", (n) => {
13224
- if (e || t) return;
13225
- let r = n.target;
13226
- this._handleTypedValue((r?.value || "").toString());
13227
- }, !0), r.appendChild(this._inputEl), this._hiddenInput = document.createElement("input"), this._hiddenInput.type = "hidden", this._hiddenInput.name = this.getName(), this._hiddenInput.required = this.isRequired(), r.appendChild(this._hiddenInput), this._syncHiddenInput(), this._popover = document.createElement("mint-popover"), this._popover.setAttribute("trigger-id", this._triggerId), this._popover.setAttribute("direction", "down"), this._popover.setAttribute("padding", "0"), this._popover.setAttribute("distance", "6px"), (e || t) && this._popover.setAttribute("open", "false");
13228
- let i = document.createElement("div");
13229
- i.setAttribute("data-mint-time-picker-body", "true"), i.className = "mint-time-picker-popover", this._buildPopoverContent(i), this._popover.appendChild(i), r.appendChild(this._popover), this._setupPopoverOpenObserver(), this.appendChild(r);
13474
+ _onPointerUp(e) {
13475
+ if (this._isPointerDragging) {
13476
+ if (this._isPointerDragging = !1, this._dragChip) {
13477
+ try {
13478
+ this._dragChip.releasePointerCapture(e.pointerId);
13479
+ } catch {}
13480
+ this._dragChip.classList.remove("mint-tags-chip-dragging", "mint-tags-chip-no-select");
13481
+ }
13482
+ this._syncOrderFromDom(), this._dragChip = null, this._dragIndex = null;
13483
+ }
13230
13484
  }
13231
13485
  };
13232
- customElements.get("mint-time-picker") || a("mint-time-picker", lr);
13486
+ customElements.get("mint-tags") || a("mint-tags", ur);
13233
13487
  //#endregion
13234
13488
  //#region src/components/toast/Toast.ts
13235
- var ur = class extends HTMLElement {
13489
+ var dr = class extends HTMLElement {
13236
13490
  constructor(...e) {
13237
13491
  super(...e), this._messageEl = null, this._hideTimer = null, this._hideResolve = null, this._bottomNavObserver = null, this._bodyObserver = null;
13238
13492
  }
@@ -13309,11 +13563,11 @@ var ur = class extends HTMLElement {
13309
13563
  this.classList.toggle("mint-toast-is-open", e), this._messageEl ||= (this.innerHTML = "<div class=\"mint-toast-surface\">\n <span data-mint-toast-message></span>\n </div>", this.querySelector("[data-mint-toast-message]")), this._messageEl && (this._messageEl.textContent = t);
13310
13564
  }
13311
13565
  };
13312
- customElements.get("mint-toast") || a("mint-toast", ur);
13566
+ customElements.get("mint-toast") || a("mint-toast", dr);
13313
13567
  //#endregion
13314
13568
  //#region src/components/toast/ToastApi.ts
13315
- var dr = 2200, fr = [], G = !1, K = null;
13316
- function pr() {
13569
+ var fr = 2200, pr = [], G = !1, K = null;
13570
+ function mr() {
13317
13571
  return typeof document > "u" || document.body ? Promise.resolve() : new Promise((e) => {
13318
13572
  if (typeof window > "u") {
13319
13573
  e();
@@ -13324,25 +13578,25 @@ function pr() {
13324
13578
  }, { once: !0 });
13325
13579
  });
13326
13580
  }
13327
- async function mr() {
13328
- if (await pr(), typeof document > "u") throw Error("mintui.toast is only available in browser environments.");
13581
+ async function hr() {
13582
+ if (await mr(), typeof document > "u") throw Error("mintui.toast is only available in browser environments.");
13329
13583
  let e = document.querySelector("mint-toast[data-mint-toast-root=\"true\"]");
13330
13584
  if (e) return e;
13331
13585
  let t = document.createElement("mint-toast");
13332
13586
  return t.setAttribute("data-mint-toast-root", "true"), document.body.appendChild(t), t;
13333
13587
  }
13334
- async function hr() {
13588
+ async function gr() {
13335
13589
  if (!G) {
13336
13590
  G = !0;
13337
13591
  try {
13338
- for (; fr.length > 0;) {
13339
- let e = fr.shift();
13592
+ for (; pr.length > 0;) {
13593
+ let e = pr.shift();
13340
13594
  if (!e) continue;
13341
13595
  let t = e.message.trim().slice(0, 120);
13342
13596
  if (!t) continue;
13343
- let n = await mr();
13597
+ let n = await hr();
13344
13598
  K = n;
13345
- let r = e.options?.duration ?? dr, i = e.options?.type ?? "neutral";
13599
+ let r = e.options?.duration ?? fr, i = e.options?.type ?? "neutral";
13346
13600
  await n.showToast(t, r, i);
13347
13601
  }
13348
13602
  } finally {
@@ -13350,21 +13604,21 @@ async function hr() {
13350
13604
  }
13351
13605
  }
13352
13606
  }
13353
- function gr(e, t) {
13354
- typeof window > "u" || (fr.push({
13607
+ function _r(e, t) {
13608
+ typeof window > "u" || (pr.push({
13355
13609
  message: e,
13356
13610
  options: t
13357
- }), G && K && K.hideToast(), hr());
13611
+ }), G && K && K.hideToast(), gr());
13358
13612
  }
13359
- var _r = { toast: gr };
13613
+ var vr = { toast: _r };
13360
13614
  if (typeof window < "u") {
13361
13615
  let e = window.mintui || {};
13362
- e.toast = gr, window.mintui = e;
13616
+ e.toast = _r, window.mintui = e;
13363
13617
  }
13364
13618
  //#endregion
13365
13619
  //#region src/components/tree/tree-utils.js
13366
13620
  function q(e = []) {
13367
- br(e);
13621
+ xr(e);
13368
13622
  let t = (e) => e.map((e) => ({
13369
13623
  ...e,
13370
13624
  children: Array.isArray(e.children) ? t(e.children) : []
@@ -13393,11 +13647,11 @@ function Y(e, t, n = null) {
13393
13647
  }
13394
13648
  return null;
13395
13649
  }
13396
- function vr(e, t, n = 0) {
13650
+ function yr(e, t, n = 0) {
13397
13651
  let r = String(t);
13398
13652
  for (let t of e) {
13399
13653
  if (String(t.id) === r) return n;
13400
- let e = vr(t.children || [], r, n + 1);
13654
+ let e = yr(t.children || [], r, n + 1);
13401
13655
  if (e >= 0) return e;
13402
13656
  }
13403
13657
  return -1;
@@ -13406,10 +13660,10 @@ function X(e) {
13406
13660
  let t = Array.isArray(e?.children) ? e.children : [];
13407
13661
  return t.length ? 1 + Math.max(...t.map(X)) : 1;
13408
13662
  }
13409
- function yr(e, t) {
13410
- return String(e.id) === String(t) ? !0 : (e.children || []).some((e) => yr(e, t));
13663
+ function br(e, t) {
13664
+ return String(e.id) === String(t) ? !0 : (e.children || []).some((e) => br(e, t));
13411
13665
  }
13412
- function br(e) {
13666
+ function xr(e) {
13413
13667
  let t = /* @__PURE__ */ new Set(), n = (e) => {
13414
13668
  for (let r of e) {
13415
13669
  if (r.id === null || r.id === void 0 || String(r.id) === "") throw Error("Every tree item must have a non-empty identifier.");
@@ -13420,13 +13674,13 @@ function br(e) {
13420
13674
  };
13421
13675
  n(e);
13422
13676
  }
13423
- function xr(e, t, n, r, i = {}) {
13677
+ function Sr(e, t, n, r, i = {}) {
13424
13678
  let a = q(e), o = Y(a, t);
13425
13679
  if (!o) throw Error(`Tree item ${t} was not found.`);
13426
13680
  if (o.item.disabled || o.item.draggable === !1) throw Error("Disabled tree items cannot be moved.");
13427
13681
  let s = n == null || n === "" ? null : J(a, n);
13428
13682
  if (n != null && n !== "" && !s) throw Error(`Target parent ${n} was not found.`);
13429
- if (s && yr(o.item, s.id)) throw Error("A tree item cannot be moved inside itself or one of its descendants.");
13683
+ if (s && br(o.item, s.id)) throw Error("A tree item cannot be moved inside itself or one of its descendants.");
13430
13684
  if (s?.disabled) throw Error("Disabled tree items cannot contain children.");
13431
13685
  if (i.allowNesting === !1 && s) throw Error("Nesting is disabled for this tree.");
13432
13686
  if (s?.canHaveChildren === !1) throw Error("The target item cannot contain children.");
@@ -13434,7 +13688,7 @@ function xr(e, t, n, r, i = {}) {
13434
13688
  let c = s ? s.children : a, l = o.siblings.findIndex((e) => String(e.id) === String(t)), [u] = o.siblings.splice(l, 1), d = Math.min(Math.max(0, Number.isFinite(r) ? Math.trunc(r) : c.length), c.length);
13435
13689
  c.splice(d, 0, u);
13436
13690
  let f = Number.isFinite(i.maxDepth) ? Math.max(1, Math.trunc(i.maxDepth)) : Infinity;
13437
- if ((s ? vr(a, s.id) + 1 : 0) + X(u) > f) throw Error(`Moving this branch would exceed the maximum tree depth of ${f}.`);
13691
+ if ((s ? yr(a, s.id) + 1 : 0) + X(u) > f) throw Error(`Moving this branch would exceed the maximum tree depth of ${f}.`);
13438
13692
  return {
13439
13693
  items: a,
13440
13694
  item: u,
@@ -13446,7 +13700,7 @@ function xr(e, t, n, r, i = {}) {
13446
13700
  }
13447
13701
  //#endregion
13448
13702
  //#region src/components/tree/Tree.ts
13449
- var Sr = 0;
13703
+ var Cr = 0;
13450
13704
  function Z(e, t, n) {
13451
13705
  e.dispatchEvent(new CustomEvent(t, {
13452
13706
  bubbles: !0,
@@ -13454,7 +13708,7 @@ function Z(e, t, n) {
13454
13708
  detail: n
13455
13709
  }));
13456
13710
  }
13457
- function Cr(e, t) {
13711
+ function wr(e, t) {
13458
13712
  let n = e.getAttribute(t);
13459
13713
  return n === "" || n === "true";
13460
13714
  }
@@ -13463,7 +13717,7 @@ function Q(e) {
13463
13717
  }
13464
13718
  var $ = class extends HTMLElement {
13465
13719
  constructor(...e) {
13466
- super(...e), this._items = [], this._undoStack = [], this._redoStack = [], this._selectedId = null, this._expandedIds = /* @__PURE__ */ new Set(), this._root = null, this._confirm = null, this._treeId = `mint-tree-${++Sr}`, this._liveRegion = null, this._dragExpansion = null, this._autoExpandedIds = /* @__PURE__ */ new Set(), this._dragHoverExpandedId = null, this._keyboardFocusRestore = null, this._suppressSelectionClick = !1, this._selectionClickSuppressionTimer = null, this._onClick = (e) => {
13720
+ super(...e), this._items = [], this._undoStack = [], this._redoStack = [], this._selectedId = null, this._expandedIds = /* @__PURE__ */ new Set(), this._root = null, this._confirm = null, this._treeId = `mint-tree-${++Cr}`, this._liveRegion = null, this._dragExpansion = null, this._autoExpandedIds = /* @__PURE__ */ new Set(), this._dragHoverExpandedId = null, this._keyboardFocusRestore = null, this._suppressSelectionClick = !1, this._selectionClickSuppressionTimer = null, this._onClick = (e) => {
13467
13721
  let t = e.target instanceof Element ? e.target.closest("[data-tree-command]") : null;
13468
13722
  if (!t || !this.contains(t)) return;
13469
13723
  let n = t.getAttribute("data-tree-command"), r = t.getAttribute("data-tree-id");
@@ -13767,13 +14021,13 @@ var $ = class extends HTMLElement {
13767
14021
  return Number.isFinite(e) && e > 0 ? e : Infinity;
13768
14022
  }
13769
14023
  _allowNesting() {
13770
- return !this.hasAttribute("allow-nesting") || Cr(this, "allow-nesting");
14024
+ return !this.hasAttribute("allow-nesting") || wr(this, "allow-nesting");
13771
14025
  }
13772
14026
  _disabled() {
13773
- return Cr(this, "disabled");
14027
+ return wr(this, "disabled");
13774
14028
  }
13775
14029
  _isLoading() {
13776
- return Cr(this, "loading");
14030
+ return wr(this, "loading");
13777
14031
  }
13778
14032
  _render() {
13779
14033
  let e = document.activeElement instanceof HTMLElement ? document.activeElement.closest("[data-mint-tree-row]") : null, t = e && this.contains(e) ? e.getAttribute("data-tree-id") : null;
@@ -13924,7 +14178,7 @@ var $ = class extends HTMLElement {
13924
14178
  i = e.parentId, a = e.siblings.findIndex((e) => String(e.id) === n.parentId) + 1;
13925
14179
  } else return;
13926
14180
  try {
13927
- let t = xr(this._items, e, i, a, {
14181
+ let t = Sr(this._items, e, i, a, {
13928
14182
  maxDepth: this._maxDepth(),
13929
14183
  allowNesting: this._allowNesting()
13930
14184
  });
@@ -14059,7 +14313,7 @@ var $ = class extends HTMLElement {
14059
14313
  if (!t || t.siblings.indexOf(t.item) <= 0) return;
14060
14314
  let n = t.siblings[t.siblings.indexOf(t.item) - 1];
14061
14315
  try {
14062
- let t = xr(this._items, e, n.id, (n.children || []).length, {
14316
+ let t = Sr(this._items, e, n.id, (n.children || []).length, {
14063
14317
  maxDepth: this._maxDepth(),
14064
14318
  allowNesting: this._allowNesting()
14065
14319
  });
@@ -14081,7 +14335,7 @@ var $ = class extends HTMLElement {
14081
14335
  if (!n) return;
14082
14336
  let r = n.siblings.findIndex((e) => String(e.id) === t.parentId) + 1;
14083
14337
  try {
14084
- let t = xr(this._items, e, n.parentId, r, {
14338
+ let t = Sr(this._items, e, n.parentId, r, {
14085
14339
  maxDepth: this._maxDepth(),
14086
14340
  allowNesting: this._allowNesting()
14087
14341
  });
@@ -14102,4 +14356,4 @@ var $ = class extends HTMLElement {
14102
14356
  };
14103
14357
  customElements.get("mint-tree") || a("mint-tree", $);
14104
14358
  //#endregion
14105
- export { Sn as Alert, cn as BackButton, wn as BottomNavigation, M as Button, M as default, an as Card, Tn as Chart, _n as Checkbox, En as Chip, vn as Choice, Dn as Clickable, On as Collapsible, kn as ConfirmAction, In as DatePicker, Ln as Dropzone, Rn as Form, un as Grid, l as Icon, Fn as Input, on as Link, Cn as MintBottomNavItem, L as MintBottomNavigation, Qn as MintSidenavActionLinks, $n as MintSidenavActionMenu, Xn as MintSidenavLink, Zn as MintSidenavLinks, $ as MintTree, $ as Tree, fn as Modal, Jn as NativeSelect, xn as Navigation, zn as OffCanvas, ln as Page, gn as Popover, Hn as ResourceTable, pn as ScrollFade, qn as Search, Yn as Select, nr as SideNavigation, rr as Sortable, en as Spinner, rn as Stack, tn as Switch, ir as Tab, or as TabContent, ar as TabList, Vn as Table, sr as Tabs, cr as Tags, nn as Text, lr as TimePicker, ur as Toast, Pn as confirm, _r as mintui, I as observeScrollFade, gr as toast };
14359
+ export { Sn as Alert, cn as BackButton, wn as BottomNavigation, M as Button, M as default, an as Card, Tn as Chart, _n as Checkbox, En as Chip, vn as Choice, Dn as Clickable, On as Collapsible, kn as ConfirmAction, In as DatePicker, Rn as DateTimePicker, zn as Dropzone, Bn as Form, un as Grid, l as Icon, Fn as Input, on as Link, Cn as MintBottomNavItem, L as MintBottomNavigation, er as MintSidenavActionLinks, tr as MintSidenavActionMenu, Qn as MintSidenavLink, $n as MintSidenavLinks, $ as MintTree, $ as Tree, fn as Modal, Xn as NativeSelect, xn as Navigation, Vn as OffCanvas, ln as Page, gn as Popover, Wn as ResourceTable, pn as ScrollFade, Yn as Search, Zn as Select, ir as SideNavigation, ar as Sortable, en as Spinner, rn as Stack, tn as Switch, or as Tab, cr as TabContent, sr as TabList, Un as Table, lr as Tabs, ur as Tags, nn as Text, Ln as TimePicker, dr as Toast, Pn as confirm, vr as mintui, I as observeScrollFade, _r as toast };