@tylertech/forge 3.0.0-next.22 → 3.0.0-next.23

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 (78) hide show
  1. package/dist/esm/autocomplete/index.js +1 -1
  2. package/dist/esm/bottom-sheet/index.js +1 -1
  3. package/dist/esm/checkbox/index.js +1 -1
  4. package/dist/esm/chip-field/index.js +1 -1
  5. package/dist/esm/chunks/{chunk.5ADUSMC7.js → chunk.2W23MOPP.js} +2 -2
  6. package/dist/esm/chunks/{chunk.XATVDHDW.js → chunk.32APLNN2.js} +2 -2
  7. package/dist/esm/chunks/{chunk.ISLJNJEE.js → chunk.3II7OT2I.js} +2 -2
  8. package/dist/esm/chunks/{chunk.ISLJNJEE.js.map → chunk.3II7OT2I.js.map} +1 -1
  9. package/dist/esm/chunks/{chunk.24SQJBSQ.js → chunk.5QIWLZG3.js} +2 -2
  10. package/dist/esm/chunks/{chunk.6E5WHIPF.js → chunk.7RLY2O3H.js} +2 -2
  11. package/dist/esm/chunks/{chunk.6E5WHIPF.js.map → chunk.7RLY2O3H.js.map} +2 -2
  12. package/dist/esm/chunks/{chunk.Q7TBWGKN.js → chunk.AIJK3CTV.js} +2 -2
  13. package/dist/esm/chunks/{chunk.3IUQ4C47.js → chunk.CLYGTLXN.js} +2 -2
  14. package/dist/esm/chunks/chunk.GRYO5XP2.js +7 -0
  15. package/dist/esm/chunks/{chunk.PFIIBXTS.js.map → chunk.GRYO5XP2.js.map} +2 -2
  16. package/dist/esm/chunks/{chunk.LSMHIVX2.js → chunk.HD2SLIL2.js} +2 -2
  17. package/dist/esm/chunks/{chunk.EUJBIOGT.js → chunk.KCCW4AMU.js} +2 -2
  18. package/dist/esm/chunks/{chunk.JE5LSPXG.js → chunk.LY2Z2Z7S.js} +2 -2
  19. package/dist/esm/chunks/{chunk.RFT3BAJ2.js → chunk.MFS7AVW6.js} +2 -2
  20. package/dist/esm/chunks/{chunk.5A665C5E.js → chunk.OJ7JO4O6.js} +2 -2
  21. package/dist/esm/chunks/{chunk.DZJ6HBAG.js → chunk.OQHDHS2C.js} +2 -2
  22. package/dist/esm/chunks/{chunk.E2BE52ME.js → chunk.OREDK5MJ.js} +2 -2
  23. package/dist/esm/chunks/{chunk.RONMNRSH.js → chunk.SZOZIJZI.js} +2 -2
  24. package/dist/esm/chunks/{chunk.KTPEFU7V.js → chunk.TSSZQPLE.js} +2 -2
  25. package/dist/esm/chunks/chunk.V6KUOCAR.js +7 -0
  26. package/dist/esm/chunks/chunk.V6KUOCAR.js.map +7 -0
  27. package/dist/esm/chunks/{chunk.XTJGWT5F.js → chunk.VJZ7VDG5.js} +2 -2
  28. package/dist/esm/chunks/{chunk.EHVCEEV2.js → chunk.VL5RWSAV.js} +2 -2
  29. package/dist/esm/chunks/{chunk.W6FT6MKN.js → chunk.X77NKT6Z.js} +2 -2
  30. package/dist/esm/chunks/{chunk.A2NB7CIK.js → chunk.XZ23XHFE.js} +2 -2
  31. package/dist/esm/date-picker/index.js +1 -1
  32. package/dist/esm/date-range-picker/index.js +1 -1
  33. package/dist/esm/field/index.js +1 -1
  34. package/dist/esm/index.js +1 -1
  35. package/dist/esm/label/index.js +1 -1
  36. package/dist/esm/paginator/index.js +1 -1
  37. package/dist/esm/quantity-field/index.js +1 -1
  38. package/dist/esm/radio/index.js +1 -1
  39. package/dist/esm/radio/radio/index.js +1 -1
  40. package/dist/esm/radio/radio-group/index.js +1 -1
  41. package/dist/esm/select/index.js +1 -1
  42. package/dist/esm/select/select/index.js +1 -1
  43. package/dist/esm/split-view/index.js +1 -1
  44. package/dist/esm/split-view/split-view/index.js +1 -1
  45. package/dist/esm/split-view/split-view-panel/index.js +1 -1
  46. package/dist/esm/switch/index.js +1 -1
  47. package/dist/esm/table/index.js +1 -1
  48. package/dist/esm/text-field/index.js +1 -1
  49. package/dist/esm/time-picker/index.js +1 -1
  50. package/esm/checkbox/checkbox.js +1 -1
  51. package/esm/radio/radio/radio.js +1 -1
  52. package/esm/split-view/split-view-panel/split-view-panel.js +1 -1
  53. package/esm/switch/switch.js +1 -1
  54. package/package.json +1 -1
  55. package/styles/core/styles/tokens/checkbox/_tokens.scss +1 -1
  56. package/styles/core/styles/tokens/radio/_tokens.scss +1 -1
  57. package/styles/core/styles/tokens/switch/_tokens.scss +1 -1
  58. package/dist/esm/chunks/chunk.LGSCBWNR.js +0 -7
  59. package/dist/esm/chunks/chunk.LGSCBWNR.js.map +0 -7
  60. package/dist/esm/chunks/chunk.PFIIBXTS.js +0 -7
  61. /package/dist/esm/chunks/{chunk.5ADUSMC7.js.map → chunk.2W23MOPP.js.map} +0 -0
  62. /package/dist/esm/chunks/{chunk.XATVDHDW.js.map → chunk.32APLNN2.js.map} +0 -0
  63. /package/dist/esm/chunks/{chunk.24SQJBSQ.js.map → chunk.5QIWLZG3.js.map} +0 -0
  64. /package/dist/esm/chunks/{chunk.Q7TBWGKN.js.map → chunk.AIJK3CTV.js.map} +0 -0
  65. /package/dist/esm/chunks/{chunk.3IUQ4C47.js.map → chunk.CLYGTLXN.js.map} +0 -0
  66. /package/dist/esm/chunks/{chunk.LSMHIVX2.js.map → chunk.HD2SLIL2.js.map} +0 -0
  67. /package/dist/esm/chunks/{chunk.EUJBIOGT.js.map → chunk.KCCW4AMU.js.map} +0 -0
  68. /package/dist/esm/chunks/{chunk.JE5LSPXG.js.map → chunk.LY2Z2Z7S.js.map} +0 -0
  69. /package/dist/esm/chunks/{chunk.RFT3BAJ2.js.map → chunk.MFS7AVW6.js.map} +0 -0
  70. /package/dist/esm/chunks/{chunk.5A665C5E.js.map → chunk.OJ7JO4O6.js.map} +0 -0
  71. /package/dist/esm/chunks/{chunk.DZJ6HBAG.js.map → chunk.OQHDHS2C.js.map} +0 -0
  72. /package/dist/esm/chunks/{chunk.E2BE52ME.js.map → chunk.OREDK5MJ.js.map} +0 -0
  73. /package/dist/esm/chunks/{chunk.RONMNRSH.js.map → chunk.SZOZIJZI.js.map} +0 -0
  74. /package/dist/esm/chunks/{chunk.KTPEFU7V.js.map → chunk.TSSZQPLE.js.map} +0 -0
  75. /package/dist/esm/chunks/{chunk.XTJGWT5F.js.map → chunk.VJZ7VDG5.js.map} +0 -0
  76. /package/dist/esm/chunks/{chunk.EHVCEEV2.js.map → chunk.VL5RWSAV.js.map} +0 -0
  77. /package/dist/esm/chunks/{chunk.W6FT6MKN.js.map → chunk.X77NKT6Z.js.map} +0 -0
  78. /package/dist/esm/chunks/{chunk.A2NB7CIK.js.map → chunk.XZ23XHFE.js.map} +0 -0
@@ -3,5 +3,5 @@
3
3
  * Copyright 2023 Tyler Technologies, Inc.
4
4
  * License: Apache-2.0
5
5
  */
6
- import{a as C}from"./chunk.A2NB7CIK.js";import{b as ne}from"./chunk.QUXMLWBJ.js";import{a as J}from"./chunk.AGLI4WR4.js";import{h as ie,i as oe}from"./chunk.7AAICE77.js";import{c as Q}from"./chunk.2GUWHBUU.js";import{f as j}from"./chunk.O5WAQQNR.js";import{b as ee}from"./chunk.GG7IQL46.js";import{c as Z}from"./chunk.USTVZ6MZ.js";import{a as L}from"./chunk.WXVVOFNK.js";import{b as te}from"./chunk.5MB6CTBA.js";import{c as re}from"./chunk.DZJ6HBAG.js";import{a as se,b as le}from"./chunk.RONMNRSH.js";import{c as V,g as W,h as K}from"./chunk.RLQB7224.js";import{a as X}from"./chunk.37B332ZK.js";import{d as $,l as Y}from"./chunk.T7NWP7DB.js";import{a as q}from"./chunk.SQ3AZAHF.js";import{a as z}from"./chunk.SB2LOK2R.js";import{a}from"./chunk.NVUMRW44.js";import{a as H}from"./chunk.OLFOVKQG.js";import{a as U,b as R,c as G}from"./chunk.VRSPT7WX.js";import{a as k,e as N}from"./chunk.LNTTU2GL.js";import{k as P,o as B,p as M,r as A}from"./chunk.L4QSPQDE.js";import{a as D}from"./chunk.DJSHVUEM.js";import{a as F,b as h,c as y,j as T,k as f,l as x,n as w,o as S}from"./chunk.J2M2MXP2.js";import{a as E,d as p}from"./chunk.M3QDAYD2.js";var g=`${R}autocomplete`,he={MODE:"mode",MULTIPLE:"multiple",DEBOUNCE:"debounce",FILTER_ON_FOCUS:"filter-on-focus",FILTER_FOCUS_FIRST:"filter-focus-first",ALLOW_UNMATCHED:"allow-unmatched",POPUP_TARGET:"popup-target",POPUP_CLASSES:"popup-classes",OPTION_LIMIT:"option-limit",OBSERVE_SCROLL:"observe-scroll",OBSERVE_SCROLL_THRESHOLD:"observe-scroll-threshold",SYNC_POPUP_WIDTH:"sync-popup-width",OPEN:"open",MATCH_KEY:"match-key",FILTER_TEXT:"filter-text",DROPDOWN_ICON_OPEN:"data-forge-dropdown-icon-open"},_e={INPUT:"input",DROPDOWN_ICON:"[data-forge-dropdown-icon],[data-forge-dropdown-icon],[forge-dropdown-icon],.forge-dropdown-icon",CLEAR_BUTTON:"[data-forge-autocomplete-clear],[forge-autocomplete-clear]"},me={DEFAULT_DEBOUNCE_TIME:G,NUM_SKELETON_ITEMS:3},fe={CHANGE:`${g}-change`,SELECT:`${g}-select`,SCROLLED_BOTTOM:`${g}-scrolled-bottom`},o={elementName:g,attributes:he,selectors:_e,numbers:me,events:fe},pe=(e=>(e.Default="default",e.Stateless="stateless",e))(pe||{});var O=class extends H{constructor(e){super(e);this.setInputElement()}setInputElement(){let e=B(this._component,o.selectors.INPUT,!1);return e.length&&(this._inputElement=e[0]),this._inputElement}setInputAttribute(e,t){this._inputElement.setAttribute(e,t)}addInputListener(e,t){this._inputElement.addEventListener(e,t)}removeInputListener(e,t){this._inputElement.removeEventListener(e,t)}initializeInputAccessibility(e){this._inputElement.setAttribute("autocomplete","off"),this._inputElement.setAttribute("role","combobox"),this._inputElement.setAttribute("aria-live","polite"),this._inputElement.setAttribute("aria-atomic","true"),this._inputElement.setAttribute("aria-haspopup","true"),this._inputElement.setAttribute("aria-expanded","false"),this._inputElement.setAttribute("aria-autocomplete","list")}isWrappingChipField(){return!!this._component.querySelector(C.elementName)}show(e,t){this._targetElement=this._getTargetElement(t),this._targetElement&&(this._listDropdown=new ie(this._targetElement,e),this._listDropdown.open(),this._inputElement.setAttribute("aria-expanded","true"),this._inputElement.setAttribute("aria-controls",`list-dropdown-popup-${e.id}`),this._tryToggleDropdownIconRotation(!0))}async hide(e,{destroy:t=!1}={}){var n,s,u;if(this.setBusyVisibility(!1),this._tryToggleDropdownIconRotation(!1),(n=this._inputElement)==null||n.removeAttribute("aria-activedescendant"),(s=this._inputElement)==null||s.removeAttribute("aria-controls"),(u=this._inputElement)==null||u.setAttribute("aria-expanded","false"),!this._listDropdown)return;let{anchorElement:i}=this._listDropdown.dropdownElement;i&&i instanceof HTMLElement&&(i==null||i.removeEventListener(L.events.TOGGLE,e)),t?this._listDropdown.destroy():await this._listDropdown.close(),this._listDropdown=void 0}setBusyVisibility(e){var t;(t=this._listDropdown)==null||t.setBusyVisibility(e)}setDismissListener(e){if(!this._listDropdown||!this._listDropdown.dropdownElement)return;let t=this._listDropdown.dropdownElement;t.anchorElement&&t.anchorElement instanceof HTMLElement&&t.anchorElement.addEventListener(L.events.TOGGLE,e)}focus(){window.requestAnimationFrame(()=>this._inputElement.focus())}setOptions(e){var t;(t=this._listDropdown)==null||t.setOptions(e)}appendOptions(e){var t;(t=this._listDropdown)==null||t.appendOptions(e)}setSelectedText(e){this._inputElement.value=e}getInputValue(){return this._inputElement.value}setInputValue(e){this._inputElement.value=e}selectInputValue(){window.requestAnimationFrame(()=>this._inputElement.select())}isFocusWithinPopup(e){return!this._listDropdown||!this._listDropdown.dropdownElement?!1:this._listDropdown.dropdownElement.contains(e)}hasFocus(){let e=M(this._component.ownerDocument);return e===this._inputElement||this.isFocusWithinPopup(e)}hasInputElement(){return!!this._inputElement}setDropdownIconListener(e,t){window.requestAnimationFrame(()=>{let i=this._component.querySelector(o.selectors.DROPDOWN_ICON);i&&i.addEventListener(e,t)})}removeDropdownIconListener(e,t){let i=this._component.querySelector(o.selectors.DROPDOWN_ICON);i&&i.removeEventListener(e,t)}setClearButtonListener(e,t){window.requestAnimationFrame(()=>{let i=this._component.querySelector(o.selectors.CLEAR_BUTTON);i&&i.addEventListener(e,t)})}removeClearButtonListener(e,t){let i=this._component.querySelector(o.selectors.CLEAR_BUTTON);i&&i.removeEventListener(e,t)}propagateKey(e){var t;(t=this._listDropdown)==null||t.handleKey(e)}updateActiveDescendant(e){this._targetElement&&A(this._inputElement,!!e,"aria-activedescendant",e)}getTargetElementWidth(e){return this._targetElement||(this._targetElement=this._getTargetElement(e)),this._targetElement.getBoundingClientRect().width}getPopupElement(){var e,t;return(t=(e=this._listDropdown)==null?void 0:e.dropdownElement)!=null?t:null}activateFirstOption(){var e;(e=this._listDropdown)==null||e.activateFirstOption()}activateSelectedOption(){var e;(e=this._listDropdown)==null||e.activateSelectedOption()}activateOptionByIndex(e){var t;(t=this._listDropdown)==null||t.activateOption(e)}getActiveOptionIndex(){var e,t;return(t=(e=this._listDropdown)==null?void 0:e.getActiveOptionIndex())!=null?t:null}clearActiveOption(){var e;(e=this._listDropdown)==null||e.clearActiveOption()}setSelectedOptions(e){if(this._listDropdown){let t=e.map(i=>i.value);this._listDropdown.setSelectedValues(t)}}queueDropdownPositionUpdate(){this.getPopupElement()&&window.requestAnimationFrame(()=>{let e=this.getPopupElement();e==null||e.position()})}_getTargetElement(e){return e?this._component.querySelector(e)||this._getDefaultTargetElement():this._getDefaultTargetElement()}_getDefaultTargetElement(){let e=[se.elementName,C.elementName],t=this._component.querySelector(`:is(${e.join(",")})`);return t!=null&&t.popoverTargetElement?t.popoverTargetElement:this._component.querySelector("input")||this._component}_tryToggleDropdownIconRotation(e){let t=this._component.querySelector(o.selectors.DROPDOWN_ICON);t&&A(t,e,o.attributes.DROPDOWN_ICON_OPEN)}};var ae=(e=>(e[e.Option=0]="Option",e[e.Group=1]="Group",e))(ae||{});function v(d,c){let e=d.some(i=>h(i)&&T(i)&&i.hasOwnProperty("options")&&(i.hasOwnProperty("text")||i.hasOwnProperty("builder"))),t=d.some(i=>h(i)&&T(i)&&i.hasOwnProperty("label")&&i.hasOwnProperty("value"));return e&&c===1||t&&c===0}function ue(d,c){return d.find(e=>e.value===c)}function b(d,c,e=null){return e?!(e in d.value)||!(e in c)?!1:w(d.value[e],c[e]):w(d.value,c)}var I=class extends oe{constructor(e){super();this._adapter=e;this._isInitialized=!1;this._isDropdownOpen=!1;this._mode="default";this._multiple=!1;this._debounce=o.numbers.DEFAULT_DEBOUNCE_TIME;this._allowUnmatched=!1;this._filterOnFocus=!0;this._filterFocusFirst=!0;this._options=[];this._filterText="";this._selectedOptions=[];this._values=[];this._pendingFilterPromises=[];this._matchKey=null;this._clickListener=t=>this._onClick(t),this._focusListener=()=>this._onFocus(),this._blurListener=t=>this._onBlur(t),this._keydownListener=t=>this._onKeydown(t),this._dropdownIconClickListener=t=>this._onDropdownIconClick(t),this._dropdownScrollEndListener=()=>this._onDropdownScrollEnd(),this._dropdownIconMouseDownListener=t=>this._onDropdownIconMouseDown(t),this._clearButtonListener=t=>this._onClear(t),this._dismissListener=()=>this._onDismiss(),this._activeChangeListener=t=>this._adapter.updateActiveDescendant(t),this._targetWidthCallback=()=>this._adapter.getTargetElementWidth(this._popupTarget),this._identifier=F()}async initialize(){if(!this._adapter.hasInputElement()&&!this._adapter.setInputElement())throw new Error("An input element is required as a child of the autocomplete component.");if(this._setInputListener(),this._setFilterCallback(),this._attachListeners(),this._initializeAccessibility(),this._values.length){if(!this._selectedOptions.length){try{await this._executeFilter()}catch(e){console.error(e)}this._updateSelectedOptions(this._values)}this._adapter.setSelectedText(this._getSelectedText())}this._isInitialized=!0}disconnect(){this._isInitialized&&(this._detachListeners(),this._isInitialized=!1),this._closeDropdown({destroy:!0})}async forceFilter({preserveValue:e}){this._options=[],await this._executeFilter(!0,!0),e&&this._options.push(...this._selectedOptions),this._applyValue(this._values)}_attachListeners(){this._adapter.addInputListener("click",this._clickListener),this._adapter.addInputListener("focus",this._focusListener),this._adapter.addInputListener("blur",this._blurListener),this._adapter.addInputListener("input",this._inputListener),this._adapter.addInputListener("keydown",this._keydownListener),this._adapter.setDropdownIconListener("click",this._dropdownIconClickListener),this._adapter.setDropdownIconListener("mousedown",this._dropdownIconMouseDownListener),this._adapter.setClearButtonListener("click",this._clearButtonListener)}_detachListeners(){this._adapter.removeInputListener("click",this._clickListener),this._adapter.removeInputListener("focus",this._focusListener),this._adapter.removeInputListener("blur",this._blurListener),this._adapter.removeInputListener("input",this._inputListener),this._adapter.removeInputListener("keydown",this._keydownListener),this._adapter.removeDropdownIconListener("click",this._dropdownIconClickListener),this._adapter.removeDropdownIconListener("mousedown",this._dropdownIconMouseDownListener),this._adapter.removeClearButtonListener("click",this._clearButtonListener)}_setInputListener(){this._inputListener=e=>this._onInput(e)}_setFilterCallback(){this._filterFn=h(this._debounce)&&this._debounce>0?S(this._debounceFilter,this._debounce,!1):this._debounceFilter}_initializeAccessibility(){this._adapter.initializeInputAccessibility(this._identifier)}get _flatOptions(){return v(this._options,1)?this._options.reduce((e,t)=>e.concat(t.options),[]):this._options}_onClick(e){!this._isDropdownOpen&&this._filterOnFocus&&this._showDropdown()}_onDropdownIconMouseDown(e){e.preventDefault()}_onDropdownIconClick(e){this._isDropdownOpen?this._closeDropdown():(this._adapter.focus(),window.requestAnimationFrame(()=>this._showDropdown()))}_onClear(e){this._filterText="",this._clearValue(),this._adapter.setSelectedText(this._getSelectedText())}_onDropdownScrollEnd(){this._adapter.emitHostEvent(o.events.SCROLLED_BOTTOM)}_onFocus(){!this._isDropdownOpen&&this._adapter.getInputValue()&&!D.isMobile&&this._adapter.selectInputValue()}_onBlur(e){this._adapter.isFocusWithinPopup(e.relatedTarget)||this._applyBlur()}_applyBlur(){this._isDropdownOpen&&this._closeDropdown(),this._mode!=="stateless"&&(this._selectedOptions.length?this._adapter.setSelectedText(this._getSelectedText()):this._allowUnmatched||(this._filterText="",this._adapter.setSelectedText("")))}_onInput(e){this._selectedOptions.length&&!this._multiple&&(!this._adapter.getInputValue()||this._allowUnmatched)&&!this._adapter.isWrappingChipField()&&(this._selectedOptions=[],this._values=[],this._emitChangeEvent()),this._filterText=this._adapter.getInputValue(),this._filterFn()}async _debounceFilter({checkFocus:e=!0}={}){if(!e&&!this._adapter.hasFocus()){this._pendingFilterPromises=[],this._isDropdownOpen&&this._closeDropdown();return}let t=this._filterText,i=this._executeFilter();this._pendingFilterPromises.push(i),this._isDropdownOpen?this._adapter.setBusyVisibility(!0):this._showDropdown({filter:!1});try{await i}catch(n){this._pendingFilterPromises=[],this._isDropdownOpen&&this._closeDropdown();return}if(t===this._filterText)this._pendingFilterPromises=[],this._onFilterComplete();else{let n=this._pendingFilterPromises.indexOf(i);n!==-1&&this._pendingFilterPromises.splice(n,1)}}_onKeydown(e){switch(e.key){case"Tab":this._isDropdownOpen&&!this._multiple&&this._selectActiveOption(!1);break;case"Esc":case"Escape":this._isDropdownOpen&&(e.preventDefault(),e.stopPropagation(),this._closeDropdown());break;case"Down":case"ArrowDown":e.preventDefault(),this._isDropdownOpen?this._adapter.propagateKey(e.key):this._showDropdown({activateFirst:!0,activateSelected:!0});break;case"Up":case"ArrowUp":e.preventDefault(),this._isDropdownOpen&&this._adapter.propagateKey(e.key);break;case"Enter":case"Home":case"End":this._isDropdownOpen&&(e.key==="Enter"&&e.stopPropagation(),e.preventDefault(),this._adapter.propagateKey(e.key));break;case"Backspace":case"Delete":let t=e.target,i=this._adapter.getInputValue(),n=t.value.substring(t.selectionStart,t.selectionEnd)===t.value,s=i.length===1&&t.selectionEnd===1,u=i.length===1&&t.selectionEnd===0,_=!i||n||s||u;!this._adapter.isWrappingChipField()&&_&&!this._multiple&&this._values.length&&this._clearValue();break}}_executeFilter(e=!0,t=!1){if(!this._filter||typeof this._filter!="function")throw new Error('A filter callback must be provided. Did you set the "filter" property?');let i=this._filter,n=e?this._filterText:"",s=t?this._getValue():null;return new Promise((u,_)=>Promise.resolve(i(n,s)).then(l=>{this._options=l,u(this._options)}).catch(l=>_(`An unexpected error occurred while filtering: ${l}`)))}_onFilterComplete(){if(!this._adapter.hasFocus()){this._isDropdownOpen&&this._closeDropdown();return}if(this._options.length){let e=this._allowUnmatched&&!this._selectedOptions.length;this._dropdownReady({userTriggered:e}),this._filterFocusFirst&&this._filterText&&this._adapter.activateFirstOption()}else this._closeDropdown()}_clearValue(){this._selectedOptions=[],this._values=[],this._isDropdownOpen&&(this._adapter.setSelectedOptions([]),this._adapter.clearActiveOption()),this._emitChangeEvent()}async _showDropdown({filter:e=!0,userTriggered:t=!0,activateFirst:i=!1,activateSelected:n=!1}={}){let s=this._allowUnmatched&&!this._selectedOptions.length;this._isDropdownOpen=!0;let u;if(this._optionBuilder){let l=this._optionBuilder;u=(m,ce)=>l(m,this._filterText,ce)}let _={options:this._options,multiple:this._multiple,selectedValues:[...this._values],id:`forge-autocomplete-${this._identifier}`,asyncStyle:"skeleton",optionLimit:this._optionLimit,popupClasses:this._popupClasses,headerBuilder:this._popupHeaderBuilder,footerBuilder:this._popupFooterBuilder,transform:l=>{if(this._filterText){let m=z(l,this._filterText);if(m)return m}return l},allowBusy:!0,optionBuilder:u,syncWidth:this._syncPopupWidth,observeScroll:this._observeScroll,observeScrollThreshold:this._observeScrollThreshold,scrollEndListener:this._dropdownScrollEndListener,activeChangeCallback:this._activeChangeListener,targetWidthCallback:this._targetWidthCallback,selectCallback:l=>this._onSelect(l),closeCallback:()=>this._closeDropdown()};if(this._adapter.show(_,this._popupTarget),this._adapter.toggleHostAttribute(o.attributes.OPEN,this._isDropdownOpen),e){this._options.length&&this._adapter.setBusyVisibility(!0);try{await this._executeFilter(s)}catch(l){console.error(l)}this._updateSelectedOptions(this._values)}this._pendingFilterPromises.length||this._dropdownReady({userTriggered:t,activateFirst:i,activateSelected:n})}_dropdownReady({userTriggered:e=!0,activateFirst:t=!1,activateSelected:i=!1}={}){if(!this._isDropdownOpen||!this._options.length||e&&!this._adapter.hasFocus()){this._closeDropdown();return}this._sortSelectedOptions(),this._adapter.setBusyVisibility(!1),this._adapter.setOptions(this._options),this._adapter.setSelectedOptions(this._selectedOptions),this._adapter.setDismissListener(this._dismissListener),i&&this._selectedOptions.length?this._adapter.activateSelectedOption():t&&this._adapter.activateFirstOption()}_closeDropdown({destroy:e=!1}={}){this._multiple&&(this._filterText=""),this._isDropdownOpen=!1,this._adapter.hide(this._dismissListener,{destroy:e}),this._sortSelectedOptions(),this._adapter.toggleHostAttribute(o.attributes.OPEN,this._isDropdownOpen)}_sortSelectedOptions(){if(this._multiple&&this._selectedOptions.length&&v(this._options,0)){let e=[],t=[];this._options.forEach(i=>{this._selectedOptions.find(n=>b(n,i.value,this._matchKey))?e.push(i):t.push(i)}),this._options=[...e,...t]}}async _onSelect(e,t=!0){if(this._valueChanging)return;if(this._mode==="stateless"){let n={value:e};this._adapter.emitHostEvent(o.events.SELECT,n,!0,!0)&&(this._filterText="",this._multiple||this._closeDropdown());return}let i=()=>{let s=this._flatOptions.find(l=>b(l,e,this._matchKey)),u=s?s.value:"",_=s?s.label:"";if(this._multiple){let l=ue(this._selectedOptions,u);if(l){let m=this._selectedOptions.indexOf(l);this._selectedOptions.splice(m,1)}else this._selectedOptions.push(s)}else h(u)?(this._selectedOptions[0]=s,this._filterText=_):(this._selectedOptions=[],this._filterText="");this._isDropdownOpen&&this._adapter.setSelectedOptions(this._selectedOptions),this._values=this._selectedOptions.map(l=>l.value),this._adapter.setSelectedText(this._getSelectedText()),!D.isMobile&&t&&this._adapter.selectInputValue(),this._emitChangeEvent(),this._tryUpdateDropdownPosition()};this._isDropdownOpen&&!this._multiple&&this._closeDropdown(),typeof this._beforeValueChange=="function"?(this._valueChanging=Promise.resolve(this._beforeValueChange.call(null,e,this._matchKey)),await this._valueChanging?i():this._tryUpdateDropdownPosition(),this._valueChanging=void 0):i()}_selectActiveOption(e=!0){let t=this._adapter.getActiveOptionIndex();if(typeof t=="number"&&t>=0){let i=this._flatOptions[t];i&&this._onSelect(i.value,e)}}_emitChangeEvent(){this._adapter.emitHostEvent(o.events.CHANGE,this._getValue(),!0)}_tryUpdateDropdownPosition(){this._isDropdownOpen&&this._adapter.queueDropdownPositionUpdate()}_getValue(){return this._values?this._values.length?this._multiple?[...this._values]:this._values[0]:this._multiple?[]:null:null}_getSelectedText(){var e,t;return this._adapter.isWrappingChipField()?"":this._selectedTextBuilder?this._selectedTextBuilder(this._selectedOptions):this._multiple?this._values.length?this._values.length===1?(t=(e=this._selectedOptions[0])==null?void 0:e.label)!=null?t:"":`${this._values.length} options selected`:"":this._selectedOptions.filter(i=>i&&i.label).map(i=>i.label).join(" ").trim()}_onDismiss(){this._closeDropdown()}async _applyValue(e){let t=[];this._selectedOptions=[],Array.isArray(e)?t=e:t=h(e)?[e]:[],!this._multiple&&t.length>1&&(t=[t[0]]),v(t,0)?(this._values=t.map(n=>n.value),this._selectedOptions=t):this._values=t;let i=this._flatOptions;if(t.length&&i.length&&this._updateSelectedOptions(t),this._values.length&&!this._selectedOptions.length&&this._filter&&this._isInitialized){try{await this._executeFilter(!1,!0)}catch(n){console.error(n)}this._updateSelectedOptions(this._values)}this._multiple?this._filterText="":this._filterText=this._selectedOptions.length?this._selectedOptions[0].label:"",this._isInitialized&&this._adapter.setSelectedText(this._getSelectedText()),this._isDropdownOpen&&this._adapter.setSelectedOptions(this._selectedOptions)}_updateSelectedOptions(e){let t=[...this._flatOptions,...this._selectedOptions];if(this._selectedOptions.length&&(this._selectedOptions=[]),v(e,0))for(let i of e){let n=t.find(s=>b(s,i.value,this._matchKey));n?this._selectedOptions.push(n):this._selectedOptions.push(i)}else for(let i of e){let n=t.find(s=>b(s,i,this._matchKey));n?this._selectedOptions.push(n):this._allowUnmatched&&this._selectedOptions.push({label:i,value:i})}}get mode(){return this._mode}set mode(e){this._mode!==e&&(this._mode=e,this._mode==="stateless"&&(this._selectedOptions=[],this._isDropdownOpen&&this._closeDropdown()),this._adapter.setHostAttribute(o.attributes.MODE,this._mode))}get multiple(){return this._multiple}set multiple(e){this._multiple!==e&&(this._multiple=e,this._adapter.setHostAttribute(o.attributes.MULTIPLE,h(this._multiple)?this._multiple.toString():""))}get value(){return this._getValue()}set value(e){let t=[];e==null?t=[]:Array.isArray(e)?t=structuredClone(e):y(e)?t=[e]:t=[structuredClone(e)],(t.length!==this._values.length||t.some(n=>!this._values.includes(n)))&&this._applyValue(e)}get filterOnFocus(){return this._filterOnFocus}set filterOnFocus(e){this._filterOnFocus!==e&&(this._filterOnFocus=e,this._adapter.setHostAttribute(o.attributes.FILTER_ON_FOCUS,h(this._filterOnFocus)?this._filterOnFocus.toString():""))}get filterFocusFirst(){return this._filterFocusFirst}set filterFocusFirst(e){this._filterFocusFirst!==e&&(this._filterFocusFirst=e,this._adapter.toggleHostAttribute(o.attributes.FILTER_FOCUS_FIRST,this._filterFocusFirst))}get allowUnmatched(){return this._allowUnmatched}set allowUnmatched(e){this._allowUnmatched!==e&&(this._allowUnmatched=e,h(this._allowUnmatched)&&this._adapter.setHostAttribute(o.attributes.ALLOW_UNMATCHED,this._allowUnmatched.toString()))}get matchKey(){return this._matchKey}set matchKey(e){this._matchKey!==e&&(this._matchKey=e)}get popupTarget(){return this._popupTarget}set popupTarget(e){this._popupTarget!==e&&(this._popupTarget=e)}get filterText(){return this._filterText}set filterText(e){this._filterText!==e&&(this._filterText=this._allowUnmatched?e:"",this._isInitialized&&this._allowUnmatched&&(this._adapter.setInputValue(this._filterText),this._isDropdownOpen&&this._debounceFilter({checkFocus:!1})))}get popupClasses(){return Array.isArray(this._popupClasses)?[...this._popupClasses]:[this._popupClasses]}set popupClasses(e){this._popupClasses!==e&&(this._popupClasses=Array.isArray(e)?[...e]:[e])}set popupHeaderBuilder(e){this._popupHeaderBuilder=e}set popupFooterBuilder(e){this._popupFooterBuilder=e}get syncPopupWidth(){return this._syncPopupWidth}set syncPopupWidth(e){this._syncPopupWidth!==e&&(this._syncPopupWidth=e)}get optionLimit(){return this._optionLimit}set optionLimit(e){this._optionLimit!==e&&(this._optionLimit=e)}get debounce(){return this._debounce}set debounce(e){this._debounce!==e&&(this._debounce=e,this._isInitialized&&this._setFilterCallback(),this._adapter.setHostAttribute(o.attributes.DEBOUNCE,h(this._debounce)?this._debounce.toString():""))}get optionBuilder(){return this._optionBuilder}set optionBuilder(e){this._optionBuilder=e}get filter(){return this._filter}set filter(e){this._filter!==e&&(this._filter=e,this._isInitialized&&this._values.length&&!this._flatOptions.length&&this._filter&&this._executeFilter().then(()=>{this._updateSelectedOptions(this._values),this._adapter.setSelectedText(this._getSelectedText())}))}get selectedTextBuilder(){return this._selectedTextBuilder}set selectedTextBuilder(e){this._selectedTextBuilder=e,this._selectedOptions.length&&this._adapter.setSelectedText(this._getSelectedText())}get observeScroll(){return this._observeScroll}set observeScroll(e){this._observeScroll=e}get observeScrollThreshold(){return this._observeScrollThreshold}set observeScrollThreshold(e){this._observeScrollThreshold=e}appendOptions(e){this._isDropdownOpen&&(this._options=[...this._options,...e],this._adapter.appendOptions(e))}get isInitialized(){return this._isInitialized}get open(){return this._isDropdownOpen}set open(e){this._isDropdownOpen!==e&&(e?this._showDropdown({userTriggered:!1}):this._closeDropdown())}get beforeValueChange(){return this._beforeValueChange}set beforeValueChange(e){e!==this._beforeValueChange&&(this._beforeValueChange=e)}get popupElement(){return this._adapter.getPopupElement()}};var ve="<template><slot></slot></template>",be=":host{display:block}:host([hidden]){display:none}",r=class extends J{constructor(){super();$.define([V,K,W]),N(this,ve,be),this._foundation=new I(new O(this))}static get observedAttributes(){return[o.attributes.MODE,o.attributes.MULTIPLE,o.attributes.DEBOUNCE,o.attributes.FILTER_ON_FOCUS,o.attributes.FILTER_FOCUS_FIRST,o.attributes.ALLOW_UNMATCHED,o.attributes.POPUP_TARGET,o.attributes.POPUP_CLASSES,o.attributes.OBSERVE_SCROLL,o.attributes.OBSERVE_SCROLL_THRESHOLD,o.attributes.OPTION_LIMIT,o.attributes.SYNC_POPUP_WIDTH,o.attributes.OPEN,o.attributes.MATCH_KEY,o.attributes.FILTER_TEXT]}connectedCallback(){this.querySelector(o.selectors.INPUT)?this._foundation.initialize():P(this,o.selectors.INPUT).then(()=>this._foundation.initialize())}disconnectedCallback(){this._foundation.disconnect()}attributeChangedCallback(e,t,i){switch(super.attributeChangedCallback(e,t,i),e){case o.attributes.MODE:this.mode=i;break;case o.attributes.MULTIPLE:this.multiple=f(i);break;case o.attributes.DEBOUNCE:this.debounce=x(i);break;case o.attributes.FILTER_ON_FOCUS:this.filterOnFocus=f(i);break;case o.attributes.FILTER_FOCUS_FIRST:this.filterFocusFirst=f(i);break;case o.attributes.ALLOW_UNMATCHED:this.allowUnmatched=f(i);break;case o.attributes.POPUP_TARGET:this.popupTarget=i;break;case o.attributes.OPEN:this.open=f(i);break;case o.attributes.MATCH_KEY:this.matchKey=i;break;case o.attributes.FILTER_TEXT:this.filterText=i;break}}appendOptions(e){this._foundation.appendOptions(e)}openDropdown(){this.open=!0}closeDropdown(){this.open=!1}forceFilter(e={preserveValue:!1}){this._foundation.forceFilter(e)}};p([a()],r.prototype,"mode",2),p([a()],r.prototype,"multiple",2),p([a()],r.prototype,"value",2),p([a()],r.prototype,"debounce",2),p([a()],r.prototype,"filterOnFocus",2),p([a()],r.prototype,"filterFocusFirst",2),p([a()],r.prototype,"allowUnmatched",2),p([a()],r.prototype,"popupTarget",2),p([a()],r.prototype,"filterText",2),p([a()],r.prototype,"optionBuilder",2),p([a()],r.prototype,"filter",2),p([a()],r.prototype,"selectedTextBuilder",2),p([a()],r.prototype,"open",2),p([a()],r.prototype,"matchKey",2),p([a({set:!1})],r.prototype,"isInitialized",2),p([a({set:!1})],r.prototype,"popupElement",2),p([a()],r.prototype,"beforeValueChange",2),r=p([U({name:o.elementName,dependencies:[re,Z,Q,j,ne,te,ee,Y]})],r);var de=class extends q{constructor(e){super(e)}_build(){let e=document.createElement(o.elementName);return this._attachTextField(e),e}get textFieldDelegate(){return this._textFieldDelegate}get value(){return this._element.value}set value(e){this._element.value=e}get disabled(){return this._textFieldDelegate.inputElement.disabled}set disabled(e){this._textFieldDelegate.inputElement.disabled=e}get invalid(){return this._textFieldDelegate.invalid||!1}set invalid(e){this._textFieldDelegate.invalid=e}onChange(e){this._element.addEventListener(o.events.CHANGE,t=>e(t.detail))}onFocus(e){this._textFieldDelegate.inputElement.addEventListener("focus",t=>e(t))}onBlur(e){this._textFieldDelegate.inputElement.addEventListener("blur",t=>e(t))}_attachTextField(e){var i,n,s,u,_,l;let t={props:E({},(n=(i=this._config.options)==null?void 0:i.textFieldDelegateConfig)==null?void 0:n.props),options:E({},(u=(s=this._config.options)==null?void 0:s.textFieldDelegateConfig)==null?void 0:u.options)};t.options||(t.options={}),((_=this._config.options)==null?void 0:_.useDropdownIcon)!==!1&&!((l=t.options)!=null&&l.trailingElement)&&(t.options.trailingElement=this._createDropdownIconElement()),this._textFieldDelegate=new le(t),e.appendChild(this._textFieldDelegate.element)}_createDropdownIconElement(){let e={props:{slot:"trailing",name:"arrow_drop_down"},options:{attributes:{"forge-dropdown-icon":""}}};return new X(e).element}};function Rt(){k(r)}export{o as a,pe as b,O as c,ae as d,v as e,ue as f,b as g,I as h,r as i,de as j,Rt as k};
7
- //# sourceMappingURL=chunk.5A665C5E.js.map
6
+ import{a as C}from"./chunk.XZ23XHFE.js";import{b as ne}from"./chunk.QUXMLWBJ.js";import{a as J}from"./chunk.AGLI4WR4.js";import{h as ie,i as oe}from"./chunk.7AAICE77.js";import{c as Q}from"./chunk.2GUWHBUU.js";import{f as j}from"./chunk.O5WAQQNR.js";import{b as ee}from"./chunk.GG7IQL46.js";import{c as Z}from"./chunk.USTVZ6MZ.js";import{a as L}from"./chunk.WXVVOFNK.js";import{b as te}from"./chunk.5MB6CTBA.js";import{c as re}from"./chunk.OQHDHS2C.js";import{a as se,b as le}from"./chunk.SZOZIJZI.js";import{c as V,g as W,h as K}from"./chunk.RLQB7224.js";import{a as X}from"./chunk.37B332ZK.js";import{d as $,l as Y}from"./chunk.T7NWP7DB.js";import{a as q}from"./chunk.SQ3AZAHF.js";import{a as z}from"./chunk.SB2LOK2R.js";import{a}from"./chunk.NVUMRW44.js";import{a as H}from"./chunk.OLFOVKQG.js";import{a as U,b as R,c as G}from"./chunk.VRSPT7WX.js";import{a as k,e as N}from"./chunk.LNTTU2GL.js";import{k as P,o as B,p as M,r as A}from"./chunk.L4QSPQDE.js";import{a as D}from"./chunk.DJSHVUEM.js";import{a as F,b as h,c as y,j as T,k as f,l as x,n as w,o as S}from"./chunk.J2M2MXP2.js";import{a as E,d as p}from"./chunk.M3QDAYD2.js";var g=`${R}autocomplete`,he={MODE:"mode",MULTIPLE:"multiple",DEBOUNCE:"debounce",FILTER_ON_FOCUS:"filter-on-focus",FILTER_FOCUS_FIRST:"filter-focus-first",ALLOW_UNMATCHED:"allow-unmatched",POPUP_TARGET:"popup-target",POPUP_CLASSES:"popup-classes",OPTION_LIMIT:"option-limit",OBSERVE_SCROLL:"observe-scroll",OBSERVE_SCROLL_THRESHOLD:"observe-scroll-threshold",SYNC_POPUP_WIDTH:"sync-popup-width",OPEN:"open",MATCH_KEY:"match-key",FILTER_TEXT:"filter-text",DROPDOWN_ICON_OPEN:"data-forge-dropdown-icon-open"},_e={INPUT:"input",DROPDOWN_ICON:"[data-forge-dropdown-icon],[data-forge-dropdown-icon],[forge-dropdown-icon],.forge-dropdown-icon",CLEAR_BUTTON:"[data-forge-autocomplete-clear],[forge-autocomplete-clear]"},me={DEFAULT_DEBOUNCE_TIME:G,NUM_SKELETON_ITEMS:3},fe={CHANGE:`${g}-change`,SELECT:`${g}-select`,SCROLLED_BOTTOM:`${g}-scrolled-bottom`},o={elementName:g,attributes:he,selectors:_e,numbers:me,events:fe},pe=(e=>(e.Default="default",e.Stateless="stateless",e))(pe||{});var O=class extends H{constructor(e){super(e);this.setInputElement()}setInputElement(){let e=B(this._component,o.selectors.INPUT,!1);return e.length&&(this._inputElement=e[0]),this._inputElement}setInputAttribute(e,t){this._inputElement.setAttribute(e,t)}addInputListener(e,t){this._inputElement.addEventListener(e,t)}removeInputListener(e,t){this._inputElement.removeEventListener(e,t)}initializeInputAccessibility(e){this._inputElement.setAttribute("autocomplete","off"),this._inputElement.setAttribute("role","combobox"),this._inputElement.setAttribute("aria-live","polite"),this._inputElement.setAttribute("aria-atomic","true"),this._inputElement.setAttribute("aria-haspopup","true"),this._inputElement.setAttribute("aria-expanded","false"),this._inputElement.setAttribute("aria-autocomplete","list")}isWrappingChipField(){return!!this._component.querySelector(C.elementName)}show(e,t){this._targetElement=this._getTargetElement(t),this._targetElement&&(this._listDropdown=new ie(this._targetElement,e),this._listDropdown.open(),this._inputElement.setAttribute("aria-expanded","true"),this._inputElement.setAttribute("aria-controls",`list-dropdown-popup-${e.id}`),this._tryToggleDropdownIconRotation(!0))}async hide(e,{destroy:t=!1}={}){var n,s,u;if(this.setBusyVisibility(!1),this._tryToggleDropdownIconRotation(!1),(n=this._inputElement)==null||n.removeAttribute("aria-activedescendant"),(s=this._inputElement)==null||s.removeAttribute("aria-controls"),(u=this._inputElement)==null||u.setAttribute("aria-expanded","false"),!this._listDropdown)return;let{anchorElement:i}=this._listDropdown.dropdownElement;i&&i instanceof HTMLElement&&(i==null||i.removeEventListener(L.events.TOGGLE,e)),t?this._listDropdown.destroy():await this._listDropdown.close(),this._listDropdown=void 0}setBusyVisibility(e){var t;(t=this._listDropdown)==null||t.setBusyVisibility(e)}setDismissListener(e){if(!this._listDropdown||!this._listDropdown.dropdownElement)return;let t=this._listDropdown.dropdownElement;t.anchorElement&&t.anchorElement instanceof HTMLElement&&t.anchorElement.addEventListener(L.events.TOGGLE,e)}focus(){window.requestAnimationFrame(()=>this._inputElement.focus())}setOptions(e){var t;(t=this._listDropdown)==null||t.setOptions(e)}appendOptions(e){var t;(t=this._listDropdown)==null||t.appendOptions(e)}setSelectedText(e){this._inputElement.value=e}getInputValue(){return this._inputElement.value}setInputValue(e){this._inputElement.value=e}selectInputValue(){window.requestAnimationFrame(()=>this._inputElement.select())}isFocusWithinPopup(e){return!this._listDropdown||!this._listDropdown.dropdownElement?!1:this._listDropdown.dropdownElement.contains(e)}hasFocus(){let e=M(this._component.ownerDocument);return e===this._inputElement||this.isFocusWithinPopup(e)}hasInputElement(){return!!this._inputElement}setDropdownIconListener(e,t){window.requestAnimationFrame(()=>{let i=this._component.querySelector(o.selectors.DROPDOWN_ICON);i&&i.addEventListener(e,t)})}removeDropdownIconListener(e,t){let i=this._component.querySelector(o.selectors.DROPDOWN_ICON);i&&i.removeEventListener(e,t)}setClearButtonListener(e,t){window.requestAnimationFrame(()=>{let i=this._component.querySelector(o.selectors.CLEAR_BUTTON);i&&i.addEventListener(e,t)})}removeClearButtonListener(e,t){let i=this._component.querySelector(o.selectors.CLEAR_BUTTON);i&&i.removeEventListener(e,t)}propagateKey(e){var t;(t=this._listDropdown)==null||t.handleKey(e)}updateActiveDescendant(e){this._targetElement&&A(this._inputElement,!!e,"aria-activedescendant",e)}getTargetElementWidth(e){return this._targetElement||(this._targetElement=this._getTargetElement(e)),this._targetElement.getBoundingClientRect().width}getPopupElement(){var e,t;return(t=(e=this._listDropdown)==null?void 0:e.dropdownElement)!=null?t:null}activateFirstOption(){var e;(e=this._listDropdown)==null||e.activateFirstOption()}activateSelectedOption(){var e;(e=this._listDropdown)==null||e.activateSelectedOption()}activateOptionByIndex(e){var t;(t=this._listDropdown)==null||t.activateOption(e)}getActiveOptionIndex(){var e,t;return(t=(e=this._listDropdown)==null?void 0:e.getActiveOptionIndex())!=null?t:null}clearActiveOption(){var e;(e=this._listDropdown)==null||e.clearActiveOption()}setSelectedOptions(e){if(this._listDropdown){let t=e.map(i=>i.value);this._listDropdown.setSelectedValues(t)}}queueDropdownPositionUpdate(){this.getPopupElement()&&window.requestAnimationFrame(()=>{let e=this.getPopupElement();e==null||e.position()})}_getTargetElement(e){return e?this._component.querySelector(e)||this._getDefaultTargetElement():this._getDefaultTargetElement()}_getDefaultTargetElement(){let e=[se.elementName,C.elementName],t=this._component.querySelector(`:is(${e.join(",")})`);return t!=null&&t.popoverTargetElement?t.popoverTargetElement:this._component.querySelector("input")||this._component}_tryToggleDropdownIconRotation(e){let t=this._component.querySelector(o.selectors.DROPDOWN_ICON);t&&A(t,e,o.attributes.DROPDOWN_ICON_OPEN)}};var ae=(e=>(e[e.Option=0]="Option",e[e.Group=1]="Group",e))(ae||{});function v(d,c){let e=d.some(i=>h(i)&&T(i)&&i.hasOwnProperty("options")&&(i.hasOwnProperty("text")||i.hasOwnProperty("builder"))),t=d.some(i=>h(i)&&T(i)&&i.hasOwnProperty("label")&&i.hasOwnProperty("value"));return e&&c===1||t&&c===0}function ue(d,c){return d.find(e=>e.value===c)}function b(d,c,e=null){return e?!(e in d.value)||!(e in c)?!1:w(d.value[e],c[e]):w(d.value,c)}var I=class extends oe{constructor(e){super();this._adapter=e;this._isInitialized=!1;this._isDropdownOpen=!1;this._mode="default";this._multiple=!1;this._debounce=o.numbers.DEFAULT_DEBOUNCE_TIME;this._allowUnmatched=!1;this._filterOnFocus=!0;this._filterFocusFirst=!0;this._options=[];this._filterText="";this._selectedOptions=[];this._values=[];this._pendingFilterPromises=[];this._matchKey=null;this._clickListener=t=>this._onClick(t),this._focusListener=()=>this._onFocus(),this._blurListener=t=>this._onBlur(t),this._keydownListener=t=>this._onKeydown(t),this._dropdownIconClickListener=t=>this._onDropdownIconClick(t),this._dropdownScrollEndListener=()=>this._onDropdownScrollEnd(),this._dropdownIconMouseDownListener=t=>this._onDropdownIconMouseDown(t),this._clearButtonListener=t=>this._onClear(t),this._dismissListener=()=>this._onDismiss(),this._activeChangeListener=t=>this._adapter.updateActiveDescendant(t),this._targetWidthCallback=()=>this._adapter.getTargetElementWidth(this._popupTarget),this._identifier=F()}async initialize(){if(!this._adapter.hasInputElement()&&!this._adapter.setInputElement())throw new Error("An input element is required as a child of the autocomplete component.");if(this._setInputListener(),this._setFilterCallback(),this._attachListeners(),this._initializeAccessibility(),this._values.length){if(!this._selectedOptions.length){try{await this._executeFilter()}catch(e){console.error(e)}this._updateSelectedOptions(this._values)}this._adapter.setSelectedText(this._getSelectedText())}this._isInitialized=!0}disconnect(){this._isInitialized&&(this._detachListeners(),this._isInitialized=!1),this._closeDropdown({destroy:!0})}async forceFilter({preserveValue:e}){this._options=[],await this._executeFilter(!0,!0),e&&this._options.push(...this._selectedOptions),this._applyValue(this._values)}_attachListeners(){this._adapter.addInputListener("click",this._clickListener),this._adapter.addInputListener("focus",this._focusListener),this._adapter.addInputListener("blur",this._blurListener),this._adapter.addInputListener("input",this._inputListener),this._adapter.addInputListener("keydown",this._keydownListener),this._adapter.setDropdownIconListener("click",this._dropdownIconClickListener),this._adapter.setDropdownIconListener("mousedown",this._dropdownIconMouseDownListener),this._adapter.setClearButtonListener("click",this._clearButtonListener)}_detachListeners(){this._adapter.removeInputListener("click",this._clickListener),this._adapter.removeInputListener("focus",this._focusListener),this._adapter.removeInputListener("blur",this._blurListener),this._adapter.removeInputListener("input",this._inputListener),this._adapter.removeInputListener("keydown",this._keydownListener),this._adapter.removeDropdownIconListener("click",this._dropdownIconClickListener),this._adapter.removeDropdownIconListener("mousedown",this._dropdownIconMouseDownListener),this._adapter.removeClearButtonListener("click",this._clearButtonListener)}_setInputListener(){this._inputListener=e=>this._onInput(e)}_setFilterCallback(){this._filterFn=h(this._debounce)&&this._debounce>0?S(this._debounceFilter,this._debounce,!1):this._debounceFilter}_initializeAccessibility(){this._adapter.initializeInputAccessibility(this._identifier)}get _flatOptions(){return v(this._options,1)?this._options.reduce((e,t)=>e.concat(t.options),[]):this._options}_onClick(e){!this._isDropdownOpen&&this._filterOnFocus&&this._showDropdown()}_onDropdownIconMouseDown(e){e.preventDefault()}_onDropdownIconClick(e){this._isDropdownOpen?this._closeDropdown():(this._adapter.focus(),window.requestAnimationFrame(()=>this._showDropdown()))}_onClear(e){this._filterText="",this._clearValue(),this._adapter.setSelectedText(this._getSelectedText())}_onDropdownScrollEnd(){this._adapter.emitHostEvent(o.events.SCROLLED_BOTTOM)}_onFocus(){!this._isDropdownOpen&&this._adapter.getInputValue()&&!D.isMobile&&this._adapter.selectInputValue()}_onBlur(e){this._adapter.isFocusWithinPopup(e.relatedTarget)||this._applyBlur()}_applyBlur(){this._isDropdownOpen&&this._closeDropdown(),this._mode!=="stateless"&&(this._selectedOptions.length?this._adapter.setSelectedText(this._getSelectedText()):this._allowUnmatched||(this._filterText="",this._adapter.setSelectedText("")))}_onInput(e){this._selectedOptions.length&&!this._multiple&&(!this._adapter.getInputValue()||this._allowUnmatched)&&!this._adapter.isWrappingChipField()&&(this._selectedOptions=[],this._values=[],this._emitChangeEvent()),this._filterText=this._adapter.getInputValue(),this._filterFn()}async _debounceFilter({checkFocus:e=!0}={}){if(!e&&!this._adapter.hasFocus()){this._pendingFilterPromises=[],this._isDropdownOpen&&this._closeDropdown();return}let t=this._filterText,i=this._executeFilter();this._pendingFilterPromises.push(i),this._isDropdownOpen?this._adapter.setBusyVisibility(!0):this._showDropdown({filter:!1});try{await i}catch(n){this._pendingFilterPromises=[],this._isDropdownOpen&&this._closeDropdown();return}if(t===this._filterText)this._pendingFilterPromises=[],this._onFilterComplete();else{let n=this._pendingFilterPromises.indexOf(i);n!==-1&&this._pendingFilterPromises.splice(n,1)}}_onKeydown(e){switch(e.key){case"Tab":this._isDropdownOpen&&!this._multiple&&this._selectActiveOption(!1);break;case"Esc":case"Escape":this._isDropdownOpen&&(e.preventDefault(),e.stopPropagation(),this._closeDropdown());break;case"Down":case"ArrowDown":e.preventDefault(),this._isDropdownOpen?this._adapter.propagateKey(e.key):this._showDropdown({activateFirst:!0,activateSelected:!0});break;case"Up":case"ArrowUp":e.preventDefault(),this._isDropdownOpen&&this._adapter.propagateKey(e.key);break;case"Enter":case"Home":case"End":this._isDropdownOpen&&(e.key==="Enter"&&e.stopPropagation(),e.preventDefault(),this._adapter.propagateKey(e.key));break;case"Backspace":case"Delete":let t=e.target,i=this._adapter.getInputValue(),n=t.value.substring(t.selectionStart,t.selectionEnd)===t.value,s=i.length===1&&t.selectionEnd===1,u=i.length===1&&t.selectionEnd===0,_=!i||n||s||u;!this._adapter.isWrappingChipField()&&_&&!this._multiple&&this._values.length&&this._clearValue();break}}_executeFilter(e=!0,t=!1){if(!this._filter||typeof this._filter!="function")throw new Error('A filter callback must be provided. Did you set the "filter" property?');let i=this._filter,n=e?this._filterText:"",s=t?this._getValue():null;return new Promise((u,_)=>Promise.resolve(i(n,s)).then(l=>{this._options=l,u(this._options)}).catch(l=>_(`An unexpected error occurred while filtering: ${l}`)))}_onFilterComplete(){if(!this._adapter.hasFocus()){this._isDropdownOpen&&this._closeDropdown();return}if(this._options.length){let e=this._allowUnmatched&&!this._selectedOptions.length;this._dropdownReady({userTriggered:e}),this._filterFocusFirst&&this._filterText&&this._adapter.activateFirstOption()}else this._closeDropdown()}_clearValue(){this._selectedOptions=[],this._values=[],this._isDropdownOpen&&(this._adapter.setSelectedOptions([]),this._adapter.clearActiveOption()),this._emitChangeEvent()}async _showDropdown({filter:e=!0,userTriggered:t=!0,activateFirst:i=!1,activateSelected:n=!1}={}){let s=this._allowUnmatched&&!this._selectedOptions.length;this._isDropdownOpen=!0;let u;if(this._optionBuilder){let l=this._optionBuilder;u=(m,ce)=>l(m,this._filterText,ce)}let _={options:this._options,multiple:this._multiple,selectedValues:[...this._values],id:`forge-autocomplete-${this._identifier}`,asyncStyle:"skeleton",optionLimit:this._optionLimit,popupClasses:this._popupClasses,headerBuilder:this._popupHeaderBuilder,footerBuilder:this._popupFooterBuilder,transform:l=>{if(this._filterText){let m=z(l,this._filterText);if(m)return m}return l},allowBusy:!0,optionBuilder:u,syncWidth:this._syncPopupWidth,observeScroll:this._observeScroll,observeScrollThreshold:this._observeScrollThreshold,scrollEndListener:this._dropdownScrollEndListener,activeChangeCallback:this._activeChangeListener,targetWidthCallback:this._targetWidthCallback,selectCallback:l=>this._onSelect(l),closeCallback:()=>this._closeDropdown()};if(this._adapter.show(_,this._popupTarget),this._adapter.toggleHostAttribute(o.attributes.OPEN,this._isDropdownOpen),e){this._options.length&&this._adapter.setBusyVisibility(!0);try{await this._executeFilter(s)}catch(l){console.error(l)}this._updateSelectedOptions(this._values)}this._pendingFilterPromises.length||this._dropdownReady({userTriggered:t,activateFirst:i,activateSelected:n})}_dropdownReady({userTriggered:e=!0,activateFirst:t=!1,activateSelected:i=!1}={}){if(!this._isDropdownOpen||!this._options.length||e&&!this._adapter.hasFocus()){this._closeDropdown();return}this._sortSelectedOptions(),this._adapter.setBusyVisibility(!1),this._adapter.setOptions(this._options),this._adapter.setSelectedOptions(this._selectedOptions),this._adapter.setDismissListener(this._dismissListener),i&&this._selectedOptions.length?this._adapter.activateSelectedOption():t&&this._adapter.activateFirstOption()}_closeDropdown({destroy:e=!1}={}){this._multiple&&(this._filterText=""),this._isDropdownOpen=!1,this._adapter.hide(this._dismissListener,{destroy:e}),this._sortSelectedOptions(),this._adapter.toggleHostAttribute(o.attributes.OPEN,this._isDropdownOpen)}_sortSelectedOptions(){if(this._multiple&&this._selectedOptions.length&&v(this._options,0)){let e=[],t=[];this._options.forEach(i=>{this._selectedOptions.find(n=>b(n,i.value,this._matchKey))?e.push(i):t.push(i)}),this._options=[...e,...t]}}async _onSelect(e,t=!0){if(this._valueChanging)return;if(this._mode==="stateless"){let n={value:e};this._adapter.emitHostEvent(o.events.SELECT,n,!0,!0)&&(this._filterText="",this._multiple||this._closeDropdown());return}let i=()=>{let s=this._flatOptions.find(l=>b(l,e,this._matchKey)),u=s?s.value:"",_=s?s.label:"";if(this._multiple){let l=ue(this._selectedOptions,u);if(l){let m=this._selectedOptions.indexOf(l);this._selectedOptions.splice(m,1)}else this._selectedOptions.push(s)}else h(u)?(this._selectedOptions[0]=s,this._filterText=_):(this._selectedOptions=[],this._filterText="");this._isDropdownOpen&&this._adapter.setSelectedOptions(this._selectedOptions),this._values=this._selectedOptions.map(l=>l.value),this._adapter.setSelectedText(this._getSelectedText()),!D.isMobile&&t&&this._adapter.selectInputValue(),this._emitChangeEvent(),this._tryUpdateDropdownPosition()};this._isDropdownOpen&&!this._multiple&&this._closeDropdown(),typeof this._beforeValueChange=="function"?(this._valueChanging=Promise.resolve(this._beforeValueChange.call(null,e,this._matchKey)),await this._valueChanging?i():this._tryUpdateDropdownPosition(),this._valueChanging=void 0):i()}_selectActiveOption(e=!0){let t=this._adapter.getActiveOptionIndex();if(typeof t=="number"&&t>=0){let i=this._flatOptions[t];i&&this._onSelect(i.value,e)}}_emitChangeEvent(){this._adapter.emitHostEvent(o.events.CHANGE,this._getValue(),!0)}_tryUpdateDropdownPosition(){this._isDropdownOpen&&this._adapter.queueDropdownPositionUpdate()}_getValue(){return this._values?this._values.length?this._multiple?[...this._values]:this._values[0]:this._multiple?[]:null:null}_getSelectedText(){var e,t;return this._adapter.isWrappingChipField()?"":this._selectedTextBuilder?this._selectedTextBuilder(this._selectedOptions):this._multiple?this._values.length?this._values.length===1?(t=(e=this._selectedOptions[0])==null?void 0:e.label)!=null?t:"":`${this._values.length} options selected`:"":this._selectedOptions.filter(i=>i&&i.label).map(i=>i.label).join(" ").trim()}_onDismiss(){this._closeDropdown()}async _applyValue(e){let t=[];this._selectedOptions=[],Array.isArray(e)?t=e:t=h(e)?[e]:[],!this._multiple&&t.length>1&&(t=[t[0]]),v(t,0)?(this._values=t.map(n=>n.value),this._selectedOptions=t):this._values=t;let i=this._flatOptions;if(t.length&&i.length&&this._updateSelectedOptions(t),this._values.length&&!this._selectedOptions.length&&this._filter&&this._isInitialized){try{await this._executeFilter(!1,!0)}catch(n){console.error(n)}this._updateSelectedOptions(this._values)}this._multiple?this._filterText="":this._filterText=this._selectedOptions.length?this._selectedOptions[0].label:"",this._isInitialized&&this._adapter.setSelectedText(this._getSelectedText()),this._isDropdownOpen&&this._adapter.setSelectedOptions(this._selectedOptions)}_updateSelectedOptions(e){let t=[...this._flatOptions,...this._selectedOptions];if(this._selectedOptions.length&&(this._selectedOptions=[]),v(e,0))for(let i of e){let n=t.find(s=>b(s,i.value,this._matchKey));n?this._selectedOptions.push(n):this._selectedOptions.push(i)}else for(let i of e){let n=t.find(s=>b(s,i,this._matchKey));n?this._selectedOptions.push(n):this._allowUnmatched&&this._selectedOptions.push({label:i,value:i})}}get mode(){return this._mode}set mode(e){this._mode!==e&&(this._mode=e,this._mode==="stateless"&&(this._selectedOptions=[],this._isDropdownOpen&&this._closeDropdown()),this._adapter.setHostAttribute(o.attributes.MODE,this._mode))}get multiple(){return this._multiple}set multiple(e){this._multiple!==e&&(this._multiple=e,this._adapter.setHostAttribute(o.attributes.MULTIPLE,h(this._multiple)?this._multiple.toString():""))}get value(){return this._getValue()}set value(e){let t=[];e==null?t=[]:Array.isArray(e)?t=structuredClone(e):y(e)?t=[e]:t=[structuredClone(e)],(t.length!==this._values.length||t.some(n=>!this._values.includes(n)))&&this._applyValue(e)}get filterOnFocus(){return this._filterOnFocus}set filterOnFocus(e){this._filterOnFocus!==e&&(this._filterOnFocus=e,this._adapter.setHostAttribute(o.attributes.FILTER_ON_FOCUS,h(this._filterOnFocus)?this._filterOnFocus.toString():""))}get filterFocusFirst(){return this._filterFocusFirst}set filterFocusFirst(e){this._filterFocusFirst!==e&&(this._filterFocusFirst=e,this._adapter.toggleHostAttribute(o.attributes.FILTER_FOCUS_FIRST,this._filterFocusFirst))}get allowUnmatched(){return this._allowUnmatched}set allowUnmatched(e){this._allowUnmatched!==e&&(this._allowUnmatched=e,h(this._allowUnmatched)&&this._adapter.setHostAttribute(o.attributes.ALLOW_UNMATCHED,this._allowUnmatched.toString()))}get matchKey(){return this._matchKey}set matchKey(e){this._matchKey!==e&&(this._matchKey=e)}get popupTarget(){return this._popupTarget}set popupTarget(e){this._popupTarget!==e&&(this._popupTarget=e)}get filterText(){return this._filterText}set filterText(e){this._filterText!==e&&(this._filterText=this._allowUnmatched?e:"",this._isInitialized&&this._allowUnmatched&&(this._adapter.setInputValue(this._filterText),this._isDropdownOpen&&this._debounceFilter({checkFocus:!1})))}get popupClasses(){return Array.isArray(this._popupClasses)?[...this._popupClasses]:[this._popupClasses]}set popupClasses(e){this._popupClasses!==e&&(this._popupClasses=Array.isArray(e)?[...e]:[e])}set popupHeaderBuilder(e){this._popupHeaderBuilder=e}set popupFooterBuilder(e){this._popupFooterBuilder=e}get syncPopupWidth(){return this._syncPopupWidth}set syncPopupWidth(e){this._syncPopupWidth!==e&&(this._syncPopupWidth=e)}get optionLimit(){return this._optionLimit}set optionLimit(e){this._optionLimit!==e&&(this._optionLimit=e)}get debounce(){return this._debounce}set debounce(e){this._debounce!==e&&(this._debounce=e,this._isInitialized&&this._setFilterCallback(),this._adapter.setHostAttribute(o.attributes.DEBOUNCE,h(this._debounce)?this._debounce.toString():""))}get optionBuilder(){return this._optionBuilder}set optionBuilder(e){this._optionBuilder=e}get filter(){return this._filter}set filter(e){this._filter!==e&&(this._filter=e,this._isInitialized&&this._values.length&&!this._flatOptions.length&&this._filter&&this._executeFilter().then(()=>{this._updateSelectedOptions(this._values),this._adapter.setSelectedText(this._getSelectedText())}))}get selectedTextBuilder(){return this._selectedTextBuilder}set selectedTextBuilder(e){this._selectedTextBuilder=e,this._selectedOptions.length&&this._adapter.setSelectedText(this._getSelectedText())}get observeScroll(){return this._observeScroll}set observeScroll(e){this._observeScroll=e}get observeScrollThreshold(){return this._observeScrollThreshold}set observeScrollThreshold(e){this._observeScrollThreshold=e}appendOptions(e){this._isDropdownOpen&&(this._options=[...this._options,...e],this._adapter.appendOptions(e))}get isInitialized(){return this._isInitialized}get open(){return this._isDropdownOpen}set open(e){this._isDropdownOpen!==e&&(e?this._showDropdown({userTriggered:!1}):this._closeDropdown())}get beforeValueChange(){return this._beforeValueChange}set beforeValueChange(e){e!==this._beforeValueChange&&(this._beforeValueChange=e)}get popupElement(){return this._adapter.getPopupElement()}};var ve="<template><slot></slot></template>",be=":host{display:block}:host([hidden]){display:none}",r=class extends J{constructor(){super();$.define([V,K,W]),N(this,ve,be),this._foundation=new I(new O(this))}static get observedAttributes(){return[o.attributes.MODE,o.attributes.MULTIPLE,o.attributes.DEBOUNCE,o.attributes.FILTER_ON_FOCUS,o.attributes.FILTER_FOCUS_FIRST,o.attributes.ALLOW_UNMATCHED,o.attributes.POPUP_TARGET,o.attributes.POPUP_CLASSES,o.attributes.OBSERVE_SCROLL,o.attributes.OBSERVE_SCROLL_THRESHOLD,o.attributes.OPTION_LIMIT,o.attributes.SYNC_POPUP_WIDTH,o.attributes.OPEN,o.attributes.MATCH_KEY,o.attributes.FILTER_TEXT]}connectedCallback(){this.querySelector(o.selectors.INPUT)?this._foundation.initialize():P(this,o.selectors.INPUT).then(()=>this._foundation.initialize())}disconnectedCallback(){this._foundation.disconnect()}attributeChangedCallback(e,t,i){switch(super.attributeChangedCallback(e,t,i),e){case o.attributes.MODE:this.mode=i;break;case o.attributes.MULTIPLE:this.multiple=f(i);break;case o.attributes.DEBOUNCE:this.debounce=x(i);break;case o.attributes.FILTER_ON_FOCUS:this.filterOnFocus=f(i);break;case o.attributes.FILTER_FOCUS_FIRST:this.filterFocusFirst=f(i);break;case o.attributes.ALLOW_UNMATCHED:this.allowUnmatched=f(i);break;case o.attributes.POPUP_TARGET:this.popupTarget=i;break;case o.attributes.OPEN:this.open=f(i);break;case o.attributes.MATCH_KEY:this.matchKey=i;break;case o.attributes.FILTER_TEXT:this.filterText=i;break}}appendOptions(e){this._foundation.appendOptions(e)}openDropdown(){this.open=!0}closeDropdown(){this.open=!1}forceFilter(e={preserveValue:!1}){this._foundation.forceFilter(e)}};p([a()],r.prototype,"mode",2),p([a()],r.prototype,"multiple",2),p([a()],r.prototype,"value",2),p([a()],r.prototype,"debounce",2),p([a()],r.prototype,"filterOnFocus",2),p([a()],r.prototype,"filterFocusFirst",2),p([a()],r.prototype,"allowUnmatched",2),p([a()],r.prototype,"popupTarget",2),p([a()],r.prototype,"filterText",2),p([a()],r.prototype,"optionBuilder",2),p([a()],r.prototype,"filter",2),p([a()],r.prototype,"selectedTextBuilder",2),p([a()],r.prototype,"open",2),p([a()],r.prototype,"matchKey",2),p([a({set:!1})],r.prototype,"isInitialized",2),p([a({set:!1})],r.prototype,"popupElement",2),p([a()],r.prototype,"beforeValueChange",2),r=p([U({name:o.elementName,dependencies:[re,Z,Q,j,ne,te,ee,Y]})],r);var de=class extends q{constructor(e){super(e)}_build(){let e=document.createElement(o.elementName);return this._attachTextField(e),e}get textFieldDelegate(){return this._textFieldDelegate}get value(){return this._element.value}set value(e){this._element.value=e}get disabled(){return this._textFieldDelegate.inputElement.disabled}set disabled(e){this._textFieldDelegate.inputElement.disabled=e}get invalid(){return this._textFieldDelegate.invalid||!1}set invalid(e){this._textFieldDelegate.invalid=e}onChange(e){this._element.addEventListener(o.events.CHANGE,t=>e(t.detail))}onFocus(e){this._textFieldDelegate.inputElement.addEventListener("focus",t=>e(t))}onBlur(e){this._textFieldDelegate.inputElement.addEventListener("blur",t=>e(t))}_attachTextField(e){var i,n,s,u,_,l;let t={props:E({},(n=(i=this._config.options)==null?void 0:i.textFieldDelegateConfig)==null?void 0:n.props),options:E({},(u=(s=this._config.options)==null?void 0:s.textFieldDelegateConfig)==null?void 0:u.options)};t.options||(t.options={}),((_=this._config.options)==null?void 0:_.useDropdownIcon)!==!1&&!((l=t.options)!=null&&l.trailingElement)&&(t.options.trailingElement=this._createDropdownIconElement()),this._textFieldDelegate=new le(t),e.appendChild(this._textFieldDelegate.element)}_createDropdownIconElement(){let e={props:{slot:"trailing",name:"arrow_drop_down"},options:{attributes:{"forge-dropdown-icon":""}}};return new X(e).element}};function Rt(){k(r)}export{o as a,pe as b,O as c,ae as d,v as e,ue as f,b as g,I as h,r as i,de as j,Rt as k};
7
+ //# sourceMappingURL=chunk.OJ7JO4O6.js.map
@@ -3,5 +3,5 @@
3
3
  * Copyright 2023 Tyler Technologies, Inc.
4
4
  * License: Apache-2.0
5
5
  */
6
- import{a as d,d as B}from"./chunk.RFT3BAJ2.js";import{a as S,b as M,c as O,d as N}from"./chunk.72BKSMAZ.js";import{a as i}from"./chunk.RONMNRSH.js";import{e as L}from"./chunk.UV3WIHCM.js";import{c as x}from"./chunk.GBAVJILM.js";import{d as y}from"./chunk.GIENHEMN.js";import{j as A}from"./chunk.RLQB7224.js";import{d as I}from"./chunk.T7NWP7DB.js";import{a as F}from"./chunk.NVUMRW44.js";import{a as C}from"./chunk.VRSPT7WX.js";import{a as f,e as T,f as u}from"./chunk.LNTTU2GL.js";import{r as g}from"./chunk.L4QSPQDE.js";import{a as _,k as v}from"./chunk.J2M2MXP2.js";import{d as h}from"./chunk.M3QDAYD2.js";var m=class extends O{constructor(e){super(e);this._inputElements=[];this._destroyValueChangerListeners=[];this._fieldElement=u(e,i.selectors.FIELD),this._clearButtonSlotElement=u(e,i.selectors.CLEAR_BUTTON_SLOT),this._fieldElement.setAttribute("exportparts",Object.values(d.parts).join(", ")),this._clearButtonSlotElement.remove()}get hasValue(){return this._inputElements.some(e=>!!e.value)}get hasPlaceholder(){return this._inputElements.some(e=>!!e.placeholder)}get popoverTargetElement(){return this._popoverTargetElement||(this._popoverTargetElement=u(this._fieldElement,d.selectors.POPOVER_TARGET)),this._popoverTargetElement}addRootListener(e,t){this._fieldElement.addEventListener(e,t)}removeRootListener(e,t){this._fieldElement.removeEventListener(e,t)}disableInput(e){this._inputElements.forEach(t=>t.disabled=e)}inputIsDisabled(){return this._inputElements.some(e=>e.disabled)}click(){var e;(e=this._inputElements[0])==null||e.focus()}applyLabel(e){this._inputElements.forEach(t=>{g(t,!!e,"aria-label",e!=null?e:"")})}handleDefaultSlotChange(e,t){var a;(a=this._inputMutationObserver)==null||a.disconnect();let n=e.assignedElements();n.length&&(this._inputElements=n.filter(o=>o.matches(i.selectors.INPUT)),this._fieldElement.multiline=this._inputElements.some(o=>o.tagName===i.tagNames.TEXTAREA),this._inputMutationObserver=new MutationObserver(o=>{o.forEach(l=>{if(l.attributeName){let r=l.target.getAttribute(l.attributeName),H=l.attributeName;t(H,r)}})}),this._inputElements.forEach(o=>{var l;(l=this._inputMutationObserver)==null||l.observe(o,{attributes:!0,attributeFilter:i.observedInputAttributes}),this._component.disabled&&(o.disabled=!0),Object.values(i.observedInputAttributes).forEach(p=>{let r=p;t(r,o.getAttribute(r))})}))}tryAddValueChangeListener(e,t){this._destroyValueChangerListeners.forEach(n=>n()),this._destroyValueChangerListeners=this._inputElements.map(n=>L(e,n,"value",t))}removeValueChangeListener(){this._destroyValueChangerListeners.forEach(e=>e())}tryFloatLabel(e){if(e!==void 0){this._fieldElement.floatLabel=e;return}this._fieldElement.floatLabel=this.hasValue||this.hasPlaceholder}tryConnectSlottedLabel(e){var p;if(this._inputElements.length!==1||(p=this._inputElements[0].labels)!=null&&p.length)return;let t=this._inputElements[0],n=e.assignedElements({flatten:!0}),a=n.find(r=>r.matches(i.selectors.FORGE_LABEL));if(a){a.forElement=this._component,a.clickTarget=t;return}let o=n.find(r=>r.tagName===i.tagNames.LABEL);if(!o||o.control)return;let l=t.id||`forge-input-${_()}`;t.id=l,o.htmlFor=l}connectClearButton(e){this._clearButtonSlotElement.addEventListener("click",e)}disconnectClearButton(e){this._clearButtonSlotElement.removeEventListener("click",e)}toggleClearButtonVisibility(e){e?this._fieldElement.append(this._clearButtonSlotElement):this._clearButtonSlotElement.remove()}clearInput(){this._inputElements.length&&(this._inputElements.forEach(e=>e.value=""),this._inputElements[0].focus())}};var b=class extends N{constructor(e){super(e);this._adapter=e;this._showClear=!1;this._slotChangeListener=this._onSlotChange.bind(this);this._inputAttributeListener=this._onInputAttributeChange.bind(this);this._valueChangeListener=this._onValueChange.bind(this);this._inputListener=this._onValueChange.bind(this);this._clearButtonClickListener=e=>this._onClearButtonClick(e)}initialize(){this._adapter.addRootListener("slotchange",this._slotChangeListener),this._adapter.addRootListener("input",this._inputListener)}disconnect(){this._adapter.removeRootListener("slotchange",this._slotChangeListener),this._adapter.removeRootListener("input",this._inputListener),this._adapter.removeValueChangeListener()}get popoverTargetElement(){return this._adapter.popoverTargetElement}_onSlotChange(e){let t=e.target;switch(t.name){case"label":this._adapter.tryConnectSlottedLabel(t);break;case"":this._adapter.handleDefaultSlotChange(t,this._inputAttributeListener),this._adapter.tryAddValueChangeListener(this,this._valueChangeListener),this._tryFloatLabel();break}}_onInputAttributeChange(e,t){switch(e){case"disabled":this.disabled=t!==null;break;case"placeholder":this._tryFloatLabel();break}}_onClearButtonClick(e){let t=new CustomEvent(i.events.CLEAR,{bubbles:!0,cancelable:!0,composed:!0});this._adapter.dispatchHostEvent(t),t.defaultPrevented||this._adapter.clearInput()}_onValueChange(){this._tryFloatLabel(),this._toggleClearButtonVisibility()}_toggleClearButtonVisibility(){this._adapter.toggleClearButtonVisibility(this._showClear&&this._hasValue&&!this.disabled)}get showClear(){return this._showClear}set showClear(e){this._showClear!==e&&(this._showClear=e,this._adapter.toggleHostAttribute(i.attributes.SHOW_CLEAR,e),e?this._adapter.connectClearButton(this._clearButtonClickListener):this._adapter.disconnectClearButton(this._clearButtonClickListener),this._toggleClearButtonVisibility())}get disabled(){return super.disabled}set disabled(e){this._disabled!==e&&(this._disabled=e,this._adapter.toggleHostAttribute(d.attributes.DISABLED,e),this._adapter.setFieldProperty("disabled",e),this._adapter.disableInput(e),this._toggleClearButtonVisibility())}get labelPosition(){return super.labelPosition}set labelPosition(e){this._labelPosition!==e&&(this._labelPosition=e,this._adapter.toggleHostAttribute(d.attributes.LABEL_POSITION,!0,e),this._adapter.setFieldProperty("labelPosition",e),this._tryFloatLabel())}};var V='<template><forge-field id="field"><slot slot="label" name="label"></slot><slot slot="start" name="start"></slot><slot></slot><slot slot="end" name="end"></slot><slot slot="end" name="clear-button"><forge-icon-button tabindex="-1" dense><forge-icon name="clear"></forge-icon></forge-icon-button><forge-tooltip type="label"><slot name="clear-button-tooltip">Clear</slot></forge-tooltip></slot><slot slot="accessory" name="accessory"></slot><slot slot="support-text-start" name="support-text-start"></slot><slot slot="support-text-end" name="support-text-end"></slot><slot slot="start" name="leading"></slot><slot slot="end" name="trailing"></slot><slot slot="accessory" name="addon-end"></slot><slot slot="support-text-start" name="helper-text"></slot></forge-field></template>',k=":host{display:block}:host([hidden]){display:none}forge-field{display:contents}",s=class extends M{constructor(){super();T(this,V,k),this._foundation=new b(new m(this)),I.define(A)}static get observedAttributes(){return[...Object.values(S.observedAttributes),...Object.values(i.observedAttributes)]}connectedCallback(){this._foundation.initialize()}attributeChangedCallback(e,t,n){switch(super.attributeChangedCallback(e,t,n),e){case i.attributes.SHOW_CLEAR:this.showClear=v(n);break}}get popoverTargetElement(){return this._foundation.popoverTargetElement}};h([F()],s.prototype,"showClear",2),s=h([C({name:i.elementName,dependencies:[B,y,x]})],s);function Ee(){f(s)}export{m as a,b,s as c,Ee as d};
7
- //# sourceMappingURL=chunk.DZJ6HBAG.js.map
6
+ import{a as d,d as B}from"./chunk.MFS7AVW6.js";import{a as S,b as M,c as O,d as N}from"./chunk.72BKSMAZ.js";import{a as i}from"./chunk.SZOZIJZI.js";import{e as L}from"./chunk.UV3WIHCM.js";import{c as x}from"./chunk.GBAVJILM.js";import{d as y}from"./chunk.GIENHEMN.js";import{j as A}from"./chunk.RLQB7224.js";import{d as I}from"./chunk.T7NWP7DB.js";import{a as F}from"./chunk.NVUMRW44.js";import{a as C}from"./chunk.VRSPT7WX.js";import{a as f,e as T,f as u}from"./chunk.LNTTU2GL.js";import{r as g}from"./chunk.L4QSPQDE.js";import{a as _,k as v}from"./chunk.J2M2MXP2.js";import{d as h}from"./chunk.M3QDAYD2.js";var m=class extends O{constructor(e){super(e);this._inputElements=[];this._destroyValueChangerListeners=[];this._fieldElement=u(e,i.selectors.FIELD),this._clearButtonSlotElement=u(e,i.selectors.CLEAR_BUTTON_SLOT),this._fieldElement.setAttribute("exportparts",Object.values(d.parts).join(", ")),this._clearButtonSlotElement.remove()}get hasValue(){return this._inputElements.some(e=>!!e.value)}get hasPlaceholder(){return this._inputElements.some(e=>!!e.placeholder)}get popoverTargetElement(){return this._popoverTargetElement||(this._popoverTargetElement=u(this._fieldElement,d.selectors.POPOVER_TARGET)),this._popoverTargetElement}addRootListener(e,t){this._fieldElement.addEventListener(e,t)}removeRootListener(e,t){this._fieldElement.removeEventListener(e,t)}disableInput(e){this._inputElements.forEach(t=>t.disabled=e)}inputIsDisabled(){return this._inputElements.some(e=>e.disabled)}click(){var e;(e=this._inputElements[0])==null||e.focus()}applyLabel(e){this._inputElements.forEach(t=>{g(t,!!e,"aria-label",e!=null?e:"")})}handleDefaultSlotChange(e,t){var a;(a=this._inputMutationObserver)==null||a.disconnect();let n=e.assignedElements();n.length&&(this._inputElements=n.filter(o=>o.matches(i.selectors.INPUT)),this._fieldElement.multiline=this._inputElements.some(o=>o.tagName===i.tagNames.TEXTAREA),this._inputMutationObserver=new MutationObserver(o=>{o.forEach(l=>{if(l.attributeName){let r=l.target.getAttribute(l.attributeName),H=l.attributeName;t(H,r)}})}),this._inputElements.forEach(o=>{var l;(l=this._inputMutationObserver)==null||l.observe(o,{attributes:!0,attributeFilter:i.observedInputAttributes}),this._component.disabled&&(o.disabled=!0),Object.values(i.observedInputAttributes).forEach(p=>{let r=p;t(r,o.getAttribute(r))})}))}tryAddValueChangeListener(e,t){this._destroyValueChangerListeners.forEach(n=>n()),this._destroyValueChangerListeners=this._inputElements.map(n=>L(e,n,"value",t))}removeValueChangeListener(){this._destroyValueChangerListeners.forEach(e=>e())}tryFloatLabel(e){if(e!==void 0){this._fieldElement.floatLabel=e;return}this._fieldElement.floatLabel=this.hasValue||this.hasPlaceholder}tryConnectSlottedLabel(e){var p;if(this._inputElements.length!==1||(p=this._inputElements[0].labels)!=null&&p.length)return;let t=this._inputElements[0],n=e.assignedElements({flatten:!0}),a=n.find(r=>r.matches(i.selectors.FORGE_LABEL));if(a){a.forElement=this._component,a.clickTarget=t;return}let o=n.find(r=>r.tagName===i.tagNames.LABEL);if(!o||o.control)return;let l=t.id||`forge-input-${_()}`;t.id=l,o.htmlFor=l}connectClearButton(e){this._clearButtonSlotElement.addEventListener("click",e)}disconnectClearButton(e){this._clearButtonSlotElement.removeEventListener("click",e)}toggleClearButtonVisibility(e){e?this._fieldElement.append(this._clearButtonSlotElement):this._clearButtonSlotElement.remove()}clearInput(){this._inputElements.length&&(this._inputElements.forEach(e=>e.value=""),this._inputElements[0].focus())}};var b=class extends N{constructor(e){super(e);this._adapter=e;this._showClear=!1;this._slotChangeListener=this._onSlotChange.bind(this);this._inputAttributeListener=this._onInputAttributeChange.bind(this);this._valueChangeListener=this._onValueChange.bind(this);this._inputListener=this._onValueChange.bind(this);this._clearButtonClickListener=e=>this._onClearButtonClick(e)}initialize(){this._adapter.addRootListener("slotchange",this._slotChangeListener),this._adapter.addRootListener("input",this._inputListener)}disconnect(){this._adapter.removeRootListener("slotchange",this._slotChangeListener),this._adapter.removeRootListener("input",this._inputListener),this._adapter.removeValueChangeListener()}get popoverTargetElement(){return this._adapter.popoverTargetElement}_onSlotChange(e){let t=e.target;switch(t.name){case"label":this._adapter.tryConnectSlottedLabel(t);break;case"":this._adapter.handleDefaultSlotChange(t,this._inputAttributeListener),this._adapter.tryAddValueChangeListener(this,this._valueChangeListener),this._tryFloatLabel();break}}_onInputAttributeChange(e,t){switch(e){case"disabled":this.disabled=t!==null;break;case"placeholder":this._tryFloatLabel();break}}_onClearButtonClick(e){let t=new CustomEvent(i.events.CLEAR,{bubbles:!0,cancelable:!0,composed:!0});this._adapter.dispatchHostEvent(t),t.defaultPrevented||this._adapter.clearInput()}_onValueChange(){this._tryFloatLabel(),this._toggleClearButtonVisibility()}_toggleClearButtonVisibility(){this._adapter.toggleClearButtonVisibility(this._showClear&&this._hasValue&&!this.disabled)}get showClear(){return this._showClear}set showClear(e){this._showClear!==e&&(this._showClear=e,this._adapter.toggleHostAttribute(i.attributes.SHOW_CLEAR,e),e?this._adapter.connectClearButton(this._clearButtonClickListener):this._adapter.disconnectClearButton(this._clearButtonClickListener),this._toggleClearButtonVisibility())}get disabled(){return super.disabled}set disabled(e){this._disabled!==e&&(this._disabled=e,this._adapter.toggleHostAttribute(d.attributes.DISABLED,e),this._adapter.setFieldProperty("disabled",e),this._adapter.disableInput(e),this._toggleClearButtonVisibility())}get labelPosition(){return super.labelPosition}set labelPosition(e){this._labelPosition!==e&&(this._labelPosition=e,this._adapter.toggleHostAttribute(d.attributes.LABEL_POSITION,!0,e),this._adapter.setFieldProperty("labelPosition",e),this._tryFloatLabel())}};var V='<template><forge-field id="field"><slot slot="label" name="label"></slot><slot slot="start" name="start"></slot><slot></slot><slot slot="end" name="end"></slot><slot slot="end" name="clear-button"><forge-icon-button tabindex="-1" dense><forge-icon name="clear"></forge-icon></forge-icon-button><forge-tooltip type="label"><slot name="clear-button-tooltip">Clear</slot></forge-tooltip></slot><slot slot="accessory" name="accessory"></slot><slot slot="support-text-start" name="support-text-start"></slot><slot slot="support-text-end" name="support-text-end"></slot><slot slot="start" name="leading"></slot><slot slot="end" name="trailing"></slot><slot slot="accessory" name="addon-end"></slot><slot slot="support-text-start" name="helper-text"></slot></forge-field></template>',k=":host{display:block}:host([hidden]){display:none}forge-field{display:contents}",s=class extends M{constructor(){super();T(this,V,k),this._foundation=new b(new m(this)),I.define(A)}static get observedAttributes(){return[...Object.values(S.observedAttributes),...Object.values(i.observedAttributes)]}connectedCallback(){this._foundation.initialize()}attributeChangedCallback(e,t,n){switch(super.attributeChangedCallback(e,t,n),e){case i.attributes.SHOW_CLEAR:this.showClear=v(n);break}}get popoverTargetElement(){return this._foundation.popoverTargetElement}};h([F()],s.prototype,"showClear",2),s=h([C({name:i.elementName,dependencies:[B,y,x]})],s);function Ee(){f(s)}export{m as a,b,s as c,Ee as d};
7
+ //# sourceMappingURL=chunk.OQHDHS2C.js.map
@@ -3,5 +3,5 @@
3
3
  * Copyright 2023 Tyler Technologies, Inc.
4
4
  * License: Apache-2.0
5
5
  */
6
- import{b as S}from"./chunk.RONMNRSH.js";import{d as N,e as F}from"./chunk.GIENHEMN.js";import{A as m,l as d}from"./chunk.RLQB7224.js";import{d as h}from"./chunk.T7NWP7DB.js";import{a as A}from"./chunk.SQ3AZAHF.js";import{a as E}from"./chunk.NVUMRW44.js";import{a as C}from"./chunk.OLFOVKQG.js";import{a as B,b as L}from"./chunk.VRSPT7WX.js";import{a as I,e as T,f as c,k as D}from"./chunk.LNTTU2GL.js";import{k as f}from"./chunk.J2M2MXP2.js";import{a as _,b as x,d as p}from"./chunk.M3QDAYD2.js";var R=`${L}quantity-field`,q={INVALID:"invalid",REQUIRED:"required",DISABLED:"disabled"},O={ROOT:"forge-quantity-field",INVALID:"forge-quantity-field--invalid",REQUIRED:"forge-quantity-field--required"},a={INCREMENT_BUTTON:"increment-button",DECREMENT_BUTTON:"decrement-button",LABEL:"label",HELPER_TEXT:"helper-text"},w={ROOT:`.${O.ROOT}`,INCREMENT_BUTTON_SLOT:`slot[name=${a.INCREMENT_BUTTON}]`,DECREMENT_BUTTON_SLOT:`slot[name=${a.DECREMENT_BUTTON}]`,INCREMENT_BUTTON:`[slot=${a.INCREMENT_BUTTON}], button[slot=${a.INCREMENT_BUTTON}]`,DECREMENT_BUTTON:`[slot=${a.DECREMENT_BUTTON}], button[slot=${a.DECREMENT_BUTTON}]`,TEXT_FIELD:"forge-text-field",INPUT:"input[type=number]",LABEL:`[slot=${a.LABEL}]`,HELPER_TEXT:`[slot=${a.HELPER_TEXT}]`},i={elementName:R,classes:O,slots:a,selectors:w,attributes:q};var v=class extends C{constructor(t){super(t);this._rootElement=c(t,i.selectors.ROOT),this._incrementButtonSlot=c(this._component,i.selectors.INCREMENT_BUTTON_SLOT),this._decrementButtonSlot=c(this._component,i.selectors.DECREMENT_BUTTON_SLOT)}initializeButtons(){this._incrementButton&&!this._incrementButton.hasAttribute("tabindex")&&(this._incrementButton.tabIndex=-1),this._decrementButton&&!this._decrementButton.hasAttribute("tabindex")&&(this._decrementButton.tabIndex=-1)}addRootClass(t){this._rootElement.classList.add(t)}removeRootClass(t){this._rootElement.classList.remove(t)}inputHasAttribute(t){return this.inputElement?this.inputElement.hasAttribute(t):!1}addIncrementButtonSlotListener(t){this._incrementButtonSlot.addEventListener("slotchange",t)}removeIncrementButtonSlotListener(t){this._incrementButtonSlot&&this._incrementButtonSlot.removeEventListener("slotchange",t)}addDecrementButtonSlotListener(t){this._decrementButtonSlot.addEventListener("slotchange",t)}removeDecrementButtonSlotListener(t){this._decrementButtonSlot&&this._decrementButtonSlot.removeEventListener("slotchange",t)}addTextFieldAttribute(t,e=""){this._textFieldComponent&&this._textFieldComponent.setAttribute(t,e)}removeTextFieldAttribute(t){this._textFieldComponent&&this._textFieldComponent.removeAttribute(t)}addIncrementEventListener(t,e){this._incrementButtonElement.addEventListener(t,e)}removeIncrementEventListener(t,e){this._incrementButtonElement&&this._incrementButtonElement.removeEventListener(t,e)}addDecrementEventListener(t,e){this._decrementButtonElement.addEventListener(t,e)}removeDecrementEventListener(t,e){this._decrementButtonElement&&this._decrementButtonElement.removeEventListener(t,e)}addIncrementButtonAttribute(t,e=""){this._incrementButtonElement.setAttribute(t,e)}removeIncrementButtonAttribute(t){this._incrementButtonElement.removeAttribute(t)}addDecrementButtonAttribute(t,e=""){this._decrementButtonElement.setAttribute(t,e)}removeDecrementButtonAttribute(t){this._decrementButtonElement.removeAttribute(t)}increment(){let t=this.inputElement;if(!t)return;let e=+t.value,n=this._calcPrecision(this._inputStep),o=parseFloat((e+this._inputStep).toFixed(n));this._inputMax&&this._inputMax<o&&(o=this._inputMax),this._setInputValue(o)}decrement(){let t=this.inputElement;if(!t)return;let e=+t.value,n=this._calcPrecision(this._inputStep),o=parseFloat((e-this._inputStep).toFixed(n));this._inputMin&&this._inputMin>o&&(o=this._inputMin),this._setInputValue(o)}addInputDisabledAttributeChangeListener(t){this._setupInputDisabledAttributeMutationObserver(t)}removeInputDisabledAttributeChangeListener(){this._cleanupInputDisabledAttributeMutationObserver()}_setInputValue(t){this.inputElement&&(this.inputElement.value=`${t}`,this.inputElement.dispatchEvent(new Event("input")),this.inputElement.dispatchEvent(new Event("change")))}_isNullOrUndefinedOrEmpty(t){return t==null||t===""}_setupInputDisabledAttributeMutationObserver(t){if(!this.inputElement)return;this._cleanupInputDisabledAttributeMutationObserver();let e=o=>this._inputDisabledAttributeMutationCallback(o,t);this._inputAttributeMutationObserver=new MutationObserver(e);let n={attributes:!0,attributeOldValue:!0,attributeFilter:[i.attributes.DISABLED]};this._inputAttributeMutationObserver.observe(this.inputElement,n)}_cleanupInputDisabledAttributeMutationObserver(){this._inputAttributeMutationObserver&&(this._inputAttributeMutationObserver.disconnect(),delete this._inputAttributeMutationObserver)}_inputDisabledAttributeMutationCallback(t,e){for(let n of t)n.type!=="attributes"||!n.attributeName||n.attributeName!==i.attributes.DISABLED||n.target[n.attributeName]===n.oldValue||e()}get _incrementButtonElement(){return this._incrementButton||(this._incrementButton=this._component.querySelector(i.selectors.INCREMENT_BUTTON)),this._incrementButton}get _decrementButtonElement(){return this._decrementButton||(this._decrementButton=this._component.querySelector(i.selectors.DECREMENT_BUTTON)),this._decrementButton}get _textFieldComponent(){return this._textField||(this._textField=this._component.querySelector(i.selectors.TEXT_FIELD)),this._textField}get inputElement(){return this._inputElement||(this._inputElement=this._component.querySelector(i.selectors.INPUT)),this._inputElement}get _inputStep(){let t=this.inputElement;return!t||this._isNullOrUndefinedOrEmpty(t.step)?1:+t.step}get _inputMax(){let t=this.inputElement;return!t||this._isNullOrUndefinedOrEmpty(t.max)?null:+t.max}get _inputMin(){let t=this.inputElement;return!t||this._isNullOrUndefinedOrEmpty(t.min)?null:+t.min}_calcPrecision(t){let e=String(t);return e.includes(".")?e.split(".")[1].length:0}};var b=class{constructor(r){this._adapter=r;this._incrementValue=()=>this._adapter.increment(),this._decrementValue=()=>this._adapter.decrement(),this._incrementButtonSlotChanged=()=>this._onIncrementButtonSlotChanged(),this._decrementButtonSlotChanged=()=>this._onDecrementButtonSlotChanged(),this._adapter.addIncrementButtonSlotListener(this._incrementButtonSlotChanged),this._adapter.addDecrementButtonSlotListener(this._decrementButtonSlotChanged)}connect(){this._adapter.addInputDisabledAttributeChangeListener(()=>this._syncDisabledStateOfButtons()),this._syncDisabledStateOfButtons(),this._adapter.initializeButtons()}disconnect(){this._removeIncrementEventListener(),this._removeDecrementEventListener(),this._removeIncrementButtonSlotListener(),this._removeDecrementButtonSlotListener(),this._adapter.removeInputDisabledAttributeChangeListener()}_onIncrementButtonSlotChanged(){this._addIncrementEventListener()}_onDecrementButtonSlotChanged(){this._addDecrementEventListener()}_addIncrementEventListener(){this._adapter.addIncrementEventListener("click",this._incrementValue)}_addDecrementEventListener(){this._adapter.addDecrementEventListener("click",this._decrementValue)}_removeIncrementEventListener(){this._adapter.removeIncrementEventListener("click",this._incrementValue)}_removeDecrementEventListener(){this._adapter.removeDecrementEventListener("click",this._decrementValue)}_removeIncrementButtonSlotListener(){this._adapter.removeIncrementButtonSlotListener(this._incrementButtonSlotChanged)}_removeDecrementButtonSlotListener(){this._adapter.removeDecrementButtonSlotListener(this._decrementButtonSlotChanged)}_syncDisabledStateOfButtons(){this._adapter.inputHasAttribute(i.attributes.DISABLED)?(this._adapter.addDecrementButtonAttribute(i.attributes.DISABLED),this._adapter.addIncrementButtonAttribute(i.attributes.DISABLED)):(this._adapter.removeIncrementButtonAttribute(i.attributes.DISABLED),this._adapter.removeDecrementButtonAttribute(i.attributes.DISABLED))}get required(){return this._required}set required(r){this._required!==r&&(this._required=r,this._required?(this._adapter.setHostAttribute(i.attributes.REQUIRED),this._adapter.addRootClass(i.classes.REQUIRED)):(this._adapter.removeHostAttribute(i.attributes.REQUIRED),this._adapter.removeRootClass(i.classes.REQUIRED)))}get invalid(){return this._invalid}set invalid(r){this._invalid!==r&&(this._invalid=r,this._invalid?(this._adapter.setHostAttribute(i.attributes.INVALID),this._adapter.addRootClass(i.classes.INVALID),this._adapter.addTextFieldAttribute(i.attributes.INVALID)):(this._adapter.removeHostAttribute(i.attributes.INVALID),this._adapter.removeRootClass(i.classes.INVALID),this._adapter.removeTextFieldAttribute(i.attributes.INVALID)))}};var U='<template><div class="forge-quantity-field" part="root"><slot name="label"></slot><div class="forge-quantity-field__row" part="row"><slot name="decrement-button"></slot><slot></slot><slot name="increment-button"></slot></div><slot name="helper-text"></slot></div></template>',k='.forge-quantity-field ::slotted([slot=label]){-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-caption-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:.75rem;font-size:var(--mdc-typography-caption-font-size, .75rem);line-height:1.25rem;line-height:var(--mdc-typography-caption-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-caption-font-weight,400);letter-spacing:.0333333333em;letter-spacing:var(--mdc-typography-caption-letter-spacing, .0333333333em);text-decoration:inherit;-webkit-text-decoration:var(--mdc-typography-caption-text-decoration,inherit);text-decoration:var(--mdc-typography-caption-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-caption-text-transform,inherit);color:rgba(0,0,0,.54);color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54))}.forge-quantity-field ::slotted([slot=helper-text]){-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-caption-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:.75rem;font-size:var(--mdc-typography-caption-font-size, .75rem);line-height:1.25rem;line-height:var(--mdc-typography-caption-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-caption-font-weight,400);letter-spacing:.0333333333em;letter-spacing:var(--mdc-typography-caption-letter-spacing, .0333333333em);text-decoration:inherit;-webkit-text-decoration:var(--mdc-typography-caption-text-decoration,inherit);text-decoration:var(--mdc-typography-caption-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-caption-text-transform,inherit);height:1rem;color:rgba(0,0,0,.54);color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54))}.forge-quantity-field ::slotted([slot=helper-text])::before{display:inline-block;width:0;height:16px;content:"";vertical-align:0}.forge-quantity-field__row{display:-webkit-box;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row;-webkit-box-align:center;align-items:center}.forge-quantity-field ::slotted(forge-icon-button:first-of-type){color:var(--mdc-theme-text-secondary-on-light);margin-right:4px}.forge-quantity-field ::slotted(forge-icon-button:last-of-type){color:var(--mdc-theme-text-secondary-on-light);margin-left:4px}.forge-quantity-field ::slotted(forge-text-field){--forge-text-field-margin-top:0;--forge-text-field-margin-bottom:0}.forge-quantity-field--required ::slotted([slot=label])::before{color:#b00020;color:var(--mdc-theme-error,#b00020);content:"*";margin-right:4px}.forge-quantity-field--invalid ::slotted([slot=label]){-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-caption-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:.75rem;font-size:var(--mdc-typography-caption-font-size, .75rem);line-height:1.25rem;line-height:var(--mdc-typography-caption-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-caption-font-weight,400);letter-spacing:.0333333333em;letter-spacing:var(--mdc-typography-caption-letter-spacing, .0333333333em);text-decoration:inherit;-webkit-text-decoration:var(--mdc-typography-caption-text-decoration,inherit);text-decoration:var(--mdc-typography-caption-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-caption-text-transform,inherit);color:#b00020;color:var(--mdc-theme-error,#b00020)}.forge-quantity-field--invalid ::slotted([slot=helper-text]){-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-caption-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:.75rem;font-size:var(--mdc-typography-caption-font-size, .75rem);line-height:1.25rem;line-height:var(--mdc-typography-caption-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-caption-font-weight,400);letter-spacing:.0333333333em;letter-spacing:var(--mdc-typography-caption-letter-spacing, .0333333333em);text-decoration:inherit;-webkit-text-decoration:var(--mdc-typography-caption-text-decoration,inherit);text-decoration:var(--mdc-typography-caption-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-caption-text-transform,inherit);height:1rem;color:#b00020;color:var(--mdc-theme-error,#b00020)}.forge-quantity-field--invalid ::slotted([slot=helper-text])::before{display:inline-block;width:0;height:16px;content:"";vertical-align:0}:host{display:inline-block}:host([hidden]){display:none}',s=class extends D{constructor(){super();T(this,U,k),this._foundation=new b(new v(this)),h.define([m,d])}static get observedAttributes(){return[i.attributes.INVALID,i.attributes.REQUIRED]}connectedCallback(){this._requiredElementsPresent()?this._foundation.connect():this._ensureElementsPresent().then(()=>{this._foundation.connect()})}disconnectedCallback(){this._foundation.disconnect()}attributeChangedCallback(t,e,n){switch(t){case i.attributes.INVALID:this.invalid=f(n);break;case i.attributes.REQUIRED:this.required=f(n);break}}_ensureElementsPresent(){return new Promise(t=>{if(this._requiredElementsPresent()){t();return}let e=new MutationObserver(n=>{n.reduce((l,u)=>l+u.addedNodes.length,0)>0&&this._requiredElementsPresent()&&(e.disconnect(),t())});e.observe(this,{childList:!0,subtree:!0})})}_requiredElementsPresent(){let t=this.querySelector(i.selectors.INPUT),e=this.querySelector(i.selectors.DECREMENT_BUTTON),n=this.querySelector(i.selectors.INCREMENT_BUTTON);return!!t&&!!e&&!!n}};p([E()],s.prototype,"invalid",2),p([E()],s.prototype,"required",2),s=p([B({name:i.elementName,dependencies:[N]})],s);var M=class extends A{constructor(t){super(t);h.define([m,d])}_build(){let t=document.createElement(i.elementName);return this._attachButton(t,m.name,"decrement-button"),this._attachTextField(t),this._attachButton(t,d.name,"increment-button"),t}_configure(){var t,e,n,o,l;this.inputElement.value=(e=(t=this._config.options)==null?void 0:t.value)!=null?e:"0",this.inputElement.style.textAlign="center",this.inputElement.style.width="64px",(n=this._config.options)!=null&&n.helperText&&this.setHelperText(this._config.options.helperText),typeof((o=this._config.options)==null?void 0:o.label)=="string"&&this._createLabel(this._config.options.label),((l=this._config.options)==null?void 0:l.step)!==void 0&&(this.inputElement.step=this._config.options.step)}get value(){return this._textFieldDelegate.inputElement.value}set value(t){this._textFieldDelegate.inputElement.value=t}get disabled(){return this._textFieldDelegate.inputElement.disabled}set disabled(t){this._textFieldDelegate.inputElement.disabled=t}get invalid(){return this._element.invalid||!1}set invalid(t){this._element.invalid=t}get inputElement(){return this._textFieldDelegate.inputElement}get labelElement(){return this._labelElement}onChange(t){this._textFieldDelegate.inputElement.addEventListener("input",e=>t(e.target.value))}onFocus(t){this._textFieldDelegate.inputElement.addEventListener("focus",e=>t(e))}onBlur(t){this._textFieldDelegate.inputElement.addEventListener("blur",e=>t(e))}_attachTextField(t){var n,o,l,u,y;let e={props:_({},(o=(n=this._config.options)==null?void 0:n.textFieldDelegateConfig)==null?void 0:o.props),options:x(_({},(u=(l=this._config.options)==null?void 0:l.textFieldDelegateConfig)==null?void 0:u.options),{id:(y=this._config.options)==null?void 0:y.id,type:"number"})};this._textFieldDelegate=new S(e),t.appendChild(this._textFieldDelegate.element)}setLabel(t){t?this._labelElement?this._labelElement.textContent=t:this._createLabel(t):this._labelElement&&(this._element.removeChild(this._labelElement),this._labelElement=void 0)}setHelperText(t){t?(this._helperTextElement||(this._helperTextElement=document.createElement("span"),this._helperTextElement.slot="helper-text",this._element.appendChild(this._helperTextElement)),this._helperTextElement.textContent=t):this._helperTextElement&&(this._element.removeChild(this._helperTextElement),this._helperTextElement=void 0)}_createLabel(t){var e;this._labelElement=document.createElement("label"),this._labelElement.textContent=t,this._labelElement.slot="label",(e=this._config.options)!=null&&e.id&&this._labelElement.setAttribute("for",this._config.options.id),this._element.appendChild(this._labelElement)}_attachButton(t,e,n){return new F({options:{iconName:e,parent:t,attributes:{slot:n}}})}};function ft(){I(s)}export{i as a,v as b,b as c,s as d,M as e,ft as f};
7
- //# sourceMappingURL=chunk.E2BE52ME.js.map
6
+ import{b as S}from"./chunk.SZOZIJZI.js";import{d as N,e as F}from"./chunk.GIENHEMN.js";import{A as m,l as d}from"./chunk.RLQB7224.js";import{d as h}from"./chunk.T7NWP7DB.js";import{a as A}from"./chunk.SQ3AZAHF.js";import{a as E}from"./chunk.NVUMRW44.js";import{a as C}from"./chunk.OLFOVKQG.js";import{a as B,b as L}from"./chunk.VRSPT7WX.js";import{a as I,e as T,f as c,k as D}from"./chunk.LNTTU2GL.js";import{k as f}from"./chunk.J2M2MXP2.js";import{a as _,b as x,d as p}from"./chunk.M3QDAYD2.js";var R=`${L}quantity-field`,q={INVALID:"invalid",REQUIRED:"required",DISABLED:"disabled"},O={ROOT:"forge-quantity-field",INVALID:"forge-quantity-field--invalid",REQUIRED:"forge-quantity-field--required"},a={INCREMENT_BUTTON:"increment-button",DECREMENT_BUTTON:"decrement-button",LABEL:"label",HELPER_TEXT:"helper-text"},w={ROOT:`.${O.ROOT}`,INCREMENT_BUTTON_SLOT:`slot[name=${a.INCREMENT_BUTTON}]`,DECREMENT_BUTTON_SLOT:`slot[name=${a.DECREMENT_BUTTON}]`,INCREMENT_BUTTON:`[slot=${a.INCREMENT_BUTTON}], button[slot=${a.INCREMENT_BUTTON}]`,DECREMENT_BUTTON:`[slot=${a.DECREMENT_BUTTON}], button[slot=${a.DECREMENT_BUTTON}]`,TEXT_FIELD:"forge-text-field",INPUT:"input[type=number]",LABEL:`[slot=${a.LABEL}]`,HELPER_TEXT:`[slot=${a.HELPER_TEXT}]`},i={elementName:R,classes:O,slots:a,selectors:w,attributes:q};var v=class extends C{constructor(t){super(t);this._rootElement=c(t,i.selectors.ROOT),this._incrementButtonSlot=c(this._component,i.selectors.INCREMENT_BUTTON_SLOT),this._decrementButtonSlot=c(this._component,i.selectors.DECREMENT_BUTTON_SLOT)}initializeButtons(){this._incrementButton&&!this._incrementButton.hasAttribute("tabindex")&&(this._incrementButton.tabIndex=-1),this._decrementButton&&!this._decrementButton.hasAttribute("tabindex")&&(this._decrementButton.tabIndex=-1)}addRootClass(t){this._rootElement.classList.add(t)}removeRootClass(t){this._rootElement.classList.remove(t)}inputHasAttribute(t){return this.inputElement?this.inputElement.hasAttribute(t):!1}addIncrementButtonSlotListener(t){this._incrementButtonSlot.addEventListener("slotchange",t)}removeIncrementButtonSlotListener(t){this._incrementButtonSlot&&this._incrementButtonSlot.removeEventListener("slotchange",t)}addDecrementButtonSlotListener(t){this._decrementButtonSlot.addEventListener("slotchange",t)}removeDecrementButtonSlotListener(t){this._decrementButtonSlot&&this._decrementButtonSlot.removeEventListener("slotchange",t)}addTextFieldAttribute(t,e=""){this._textFieldComponent&&this._textFieldComponent.setAttribute(t,e)}removeTextFieldAttribute(t){this._textFieldComponent&&this._textFieldComponent.removeAttribute(t)}addIncrementEventListener(t,e){this._incrementButtonElement.addEventListener(t,e)}removeIncrementEventListener(t,e){this._incrementButtonElement&&this._incrementButtonElement.removeEventListener(t,e)}addDecrementEventListener(t,e){this._decrementButtonElement.addEventListener(t,e)}removeDecrementEventListener(t,e){this._decrementButtonElement&&this._decrementButtonElement.removeEventListener(t,e)}addIncrementButtonAttribute(t,e=""){this._incrementButtonElement.setAttribute(t,e)}removeIncrementButtonAttribute(t){this._incrementButtonElement.removeAttribute(t)}addDecrementButtonAttribute(t,e=""){this._decrementButtonElement.setAttribute(t,e)}removeDecrementButtonAttribute(t){this._decrementButtonElement.removeAttribute(t)}increment(){let t=this.inputElement;if(!t)return;let e=+t.value,n=this._calcPrecision(this._inputStep),o=parseFloat((e+this._inputStep).toFixed(n));this._inputMax&&this._inputMax<o&&(o=this._inputMax),this._setInputValue(o)}decrement(){let t=this.inputElement;if(!t)return;let e=+t.value,n=this._calcPrecision(this._inputStep),o=parseFloat((e-this._inputStep).toFixed(n));this._inputMin&&this._inputMin>o&&(o=this._inputMin),this._setInputValue(o)}addInputDisabledAttributeChangeListener(t){this._setupInputDisabledAttributeMutationObserver(t)}removeInputDisabledAttributeChangeListener(){this._cleanupInputDisabledAttributeMutationObserver()}_setInputValue(t){this.inputElement&&(this.inputElement.value=`${t}`,this.inputElement.dispatchEvent(new Event("input")),this.inputElement.dispatchEvent(new Event("change")))}_isNullOrUndefinedOrEmpty(t){return t==null||t===""}_setupInputDisabledAttributeMutationObserver(t){if(!this.inputElement)return;this._cleanupInputDisabledAttributeMutationObserver();let e=o=>this._inputDisabledAttributeMutationCallback(o,t);this._inputAttributeMutationObserver=new MutationObserver(e);let n={attributes:!0,attributeOldValue:!0,attributeFilter:[i.attributes.DISABLED]};this._inputAttributeMutationObserver.observe(this.inputElement,n)}_cleanupInputDisabledAttributeMutationObserver(){this._inputAttributeMutationObserver&&(this._inputAttributeMutationObserver.disconnect(),delete this._inputAttributeMutationObserver)}_inputDisabledAttributeMutationCallback(t,e){for(let n of t)n.type!=="attributes"||!n.attributeName||n.attributeName!==i.attributes.DISABLED||n.target[n.attributeName]===n.oldValue||e()}get _incrementButtonElement(){return this._incrementButton||(this._incrementButton=this._component.querySelector(i.selectors.INCREMENT_BUTTON)),this._incrementButton}get _decrementButtonElement(){return this._decrementButton||(this._decrementButton=this._component.querySelector(i.selectors.DECREMENT_BUTTON)),this._decrementButton}get _textFieldComponent(){return this._textField||(this._textField=this._component.querySelector(i.selectors.TEXT_FIELD)),this._textField}get inputElement(){return this._inputElement||(this._inputElement=this._component.querySelector(i.selectors.INPUT)),this._inputElement}get _inputStep(){let t=this.inputElement;return!t||this._isNullOrUndefinedOrEmpty(t.step)?1:+t.step}get _inputMax(){let t=this.inputElement;return!t||this._isNullOrUndefinedOrEmpty(t.max)?null:+t.max}get _inputMin(){let t=this.inputElement;return!t||this._isNullOrUndefinedOrEmpty(t.min)?null:+t.min}_calcPrecision(t){let e=String(t);return e.includes(".")?e.split(".")[1].length:0}};var b=class{constructor(r){this._adapter=r;this._incrementValue=()=>this._adapter.increment(),this._decrementValue=()=>this._adapter.decrement(),this._incrementButtonSlotChanged=()=>this._onIncrementButtonSlotChanged(),this._decrementButtonSlotChanged=()=>this._onDecrementButtonSlotChanged(),this._adapter.addIncrementButtonSlotListener(this._incrementButtonSlotChanged),this._adapter.addDecrementButtonSlotListener(this._decrementButtonSlotChanged)}connect(){this._adapter.addInputDisabledAttributeChangeListener(()=>this._syncDisabledStateOfButtons()),this._syncDisabledStateOfButtons(),this._adapter.initializeButtons()}disconnect(){this._removeIncrementEventListener(),this._removeDecrementEventListener(),this._removeIncrementButtonSlotListener(),this._removeDecrementButtonSlotListener(),this._adapter.removeInputDisabledAttributeChangeListener()}_onIncrementButtonSlotChanged(){this._addIncrementEventListener()}_onDecrementButtonSlotChanged(){this._addDecrementEventListener()}_addIncrementEventListener(){this._adapter.addIncrementEventListener("click",this._incrementValue)}_addDecrementEventListener(){this._adapter.addDecrementEventListener("click",this._decrementValue)}_removeIncrementEventListener(){this._adapter.removeIncrementEventListener("click",this._incrementValue)}_removeDecrementEventListener(){this._adapter.removeDecrementEventListener("click",this._decrementValue)}_removeIncrementButtonSlotListener(){this._adapter.removeIncrementButtonSlotListener(this._incrementButtonSlotChanged)}_removeDecrementButtonSlotListener(){this._adapter.removeDecrementButtonSlotListener(this._decrementButtonSlotChanged)}_syncDisabledStateOfButtons(){this._adapter.inputHasAttribute(i.attributes.DISABLED)?(this._adapter.addDecrementButtonAttribute(i.attributes.DISABLED),this._adapter.addIncrementButtonAttribute(i.attributes.DISABLED)):(this._adapter.removeIncrementButtonAttribute(i.attributes.DISABLED),this._adapter.removeDecrementButtonAttribute(i.attributes.DISABLED))}get required(){return this._required}set required(r){this._required!==r&&(this._required=r,this._required?(this._adapter.setHostAttribute(i.attributes.REQUIRED),this._adapter.addRootClass(i.classes.REQUIRED)):(this._adapter.removeHostAttribute(i.attributes.REQUIRED),this._adapter.removeRootClass(i.classes.REQUIRED)))}get invalid(){return this._invalid}set invalid(r){this._invalid!==r&&(this._invalid=r,this._invalid?(this._adapter.setHostAttribute(i.attributes.INVALID),this._adapter.addRootClass(i.classes.INVALID),this._adapter.addTextFieldAttribute(i.attributes.INVALID)):(this._adapter.removeHostAttribute(i.attributes.INVALID),this._adapter.removeRootClass(i.classes.INVALID),this._adapter.removeTextFieldAttribute(i.attributes.INVALID)))}};var U='<template><div class="forge-quantity-field" part="root"><slot name="label"></slot><div class="forge-quantity-field__row" part="row"><slot name="decrement-button"></slot><slot></slot><slot name="increment-button"></slot></div><slot name="helper-text"></slot></div></template>',k='.forge-quantity-field ::slotted([slot=label]){-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-caption-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:.75rem;font-size:var(--mdc-typography-caption-font-size, .75rem);line-height:1.25rem;line-height:var(--mdc-typography-caption-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-caption-font-weight,400);letter-spacing:.0333333333em;letter-spacing:var(--mdc-typography-caption-letter-spacing, .0333333333em);text-decoration:inherit;-webkit-text-decoration:var(--mdc-typography-caption-text-decoration,inherit);text-decoration:var(--mdc-typography-caption-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-caption-text-transform,inherit);color:rgba(0,0,0,.54);color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54))}.forge-quantity-field ::slotted([slot=helper-text]){-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-caption-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:.75rem;font-size:var(--mdc-typography-caption-font-size, .75rem);line-height:1.25rem;line-height:var(--mdc-typography-caption-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-caption-font-weight,400);letter-spacing:.0333333333em;letter-spacing:var(--mdc-typography-caption-letter-spacing, .0333333333em);text-decoration:inherit;-webkit-text-decoration:var(--mdc-typography-caption-text-decoration,inherit);text-decoration:var(--mdc-typography-caption-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-caption-text-transform,inherit);height:1rem;color:rgba(0,0,0,.54);color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54))}.forge-quantity-field ::slotted([slot=helper-text])::before{display:inline-block;width:0;height:16px;content:"";vertical-align:0}.forge-quantity-field__row{display:-webkit-box;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row;-webkit-box-align:center;align-items:center}.forge-quantity-field ::slotted(forge-icon-button:first-of-type){color:var(--mdc-theme-text-secondary-on-light);margin-right:4px}.forge-quantity-field ::slotted(forge-icon-button:last-of-type){color:var(--mdc-theme-text-secondary-on-light);margin-left:4px}.forge-quantity-field ::slotted(forge-text-field){--forge-text-field-margin-top:0;--forge-text-field-margin-bottom:0}.forge-quantity-field--required ::slotted([slot=label])::before{color:#b00020;color:var(--mdc-theme-error,#b00020);content:"*";margin-right:4px}.forge-quantity-field--invalid ::slotted([slot=label]){-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-caption-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:.75rem;font-size:var(--mdc-typography-caption-font-size, .75rem);line-height:1.25rem;line-height:var(--mdc-typography-caption-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-caption-font-weight,400);letter-spacing:.0333333333em;letter-spacing:var(--mdc-typography-caption-letter-spacing, .0333333333em);text-decoration:inherit;-webkit-text-decoration:var(--mdc-typography-caption-text-decoration,inherit);text-decoration:var(--mdc-typography-caption-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-caption-text-transform,inherit);color:#b00020;color:var(--mdc-theme-error,#b00020)}.forge-quantity-field--invalid ::slotted([slot=helper-text]){-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-caption-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:.75rem;font-size:var(--mdc-typography-caption-font-size, .75rem);line-height:1.25rem;line-height:var(--mdc-typography-caption-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-caption-font-weight,400);letter-spacing:.0333333333em;letter-spacing:var(--mdc-typography-caption-letter-spacing, .0333333333em);text-decoration:inherit;-webkit-text-decoration:var(--mdc-typography-caption-text-decoration,inherit);text-decoration:var(--mdc-typography-caption-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-caption-text-transform,inherit);height:1rem;color:#b00020;color:var(--mdc-theme-error,#b00020)}.forge-quantity-field--invalid ::slotted([slot=helper-text])::before{display:inline-block;width:0;height:16px;content:"";vertical-align:0}:host{display:inline-block}:host([hidden]){display:none}',s=class extends D{constructor(){super();T(this,U,k),this._foundation=new b(new v(this)),h.define([m,d])}static get observedAttributes(){return[i.attributes.INVALID,i.attributes.REQUIRED]}connectedCallback(){this._requiredElementsPresent()?this._foundation.connect():this._ensureElementsPresent().then(()=>{this._foundation.connect()})}disconnectedCallback(){this._foundation.disconnect()}attributeChangedCallback(t,e,n){switch(t){case i.attributes.INVALID:this.invalid=f(n);break;case i.attributes.REQUIRED:this.required=f(n);break}}_ensureElementsPresent(){return new Promise(t=>{if(this._requiredElementsPresent()){t();return}let e=new MutationObserver(n=>{n.reduce((l,u)=>l+u.addedNodes.length,0)>0&&this._requiredElementsPresent()&&(e.disconnect(),t())});e.observe(this,{childList:!0,subtree:!0})})}_requiredElementsPresent(){let t=this.querySelector(i.selectors.INPUT),e=this.querySelector(i.selectors.DECREMENT_BUTTON),n=this.querySelector(i.selectors.INCREMENT_BUTTON);return!!t&&!!e&&!!n}};p([E()],s.prototype,"invalid",2),p([E()],s.prototype,"required",2),s=p([B({name:i.elementName,dependencies:[N]})],s);var M=class extends A{constructor(t){super(t);h.define([m,d])}_build(){let t=document.createElement(i.elementName);return this._attachButton(t,m.name,"decrement-button"),this._attachTextField(t),this._attachButton(t,d.name,"increment-button"),t}_configure(){var t,e,n,o,l;this.inputElement.value=(e=(t=this._config.options)==null?void 0:t.value)!=null?e:"0",this.inputElement.style.textAlign="center",this.inputElement.style.width="64px",(n=this._config.options)!=null&&n.helperText&&this.setHelperText(this._config.options.helperText),typeof((o=this._config.options)==null?void 0:o.label)=="string"&&this._createLabel(this._config.options.label),((l=this._config.options)==null?void 0:l.step)!==void 0&&(this.inputElement.step=this._config.options.step)}get value(){return this._textFieldDelegate.inputElement.value}set value(t){this._textFieldDelegate.inputElement.value=t}get disabled(){return this._textFieldDelegate.inputElement.disabled}set disabled(t){this._textFieldDelegate.inputElement.disabled=t}get invalid(){return this._element.invalid||!1}set invalid(t){this._element.invalid=t}get inputElement(){return this._textFieldDelegate.inputElement}get labelElement(){return this._labelElement}onChange(t){this._textFieldDelegate.inputElement.addEventListener("input",e=>t(e.target.value))}onFocus(t){this._textFieldDelegate.inputElement.addEventListener("focus",e=>t(e))}onBlur(t){this._textFieldDelegate.inputElement.addEventListener("blur",e=>t(e))}_attachTextField(t){var n,o,l,u,y;let e={props:_({},(o=(n=this._config.options)==null?void 0:n.textFieldDelegateConfig)==null?void 0:o.props),options:x(_({},(u=(l=this._config.options)==null?void 0:l.textFieldDelegateConfig)==null?void 0:u.options),{id:(y=this._config.options)==null?void 0:y.id,type:"number"})};this._textFieldDelegate=new S(e),t.appendChild(this._textFieldDelegate.element)}setLabel(t){t?this._labelElement?this._labelElement.textContent=t:this._createLabel(t):this._labelElement&&(this._element.removeChild(this._labelElement),this._labelElement=void 0)}setHelperText(t){t?(this._helperTextElement||(this._helperTextElement=document.createElement("span"),this._helperTextElement.slot="helper-text",this._element.appendChild(this._helperTextElement)),this._helperTextElement.textContent=t):this._helperTextElement&&(this._element.removeChild(this._helperTextElement),this._helperTextElement=void 0)}_createLabel(t){var e;this._labelElement=document.createElement("label"),this._labelElement.textContent=t,this._labelElement.slot="label",(e=this._config.options)!=null&&e.id&&this._labelElement.setAttribute("for",this._config.options.id),this._element.appendChild(this._labelElement)}_attachButton(t,e,n){return new F({options:{iconName:e,parent:t,attributes:{slot:n}}})}};function ft(){I(s)}export{i as a,v as b,b as c,s as d,M as e,ft as f};
7
+ //# sourceMappingURL=chunk.OREDK5MJ.js.map
@@ -3,5 +3,5 @@
3
3
  * Copyright 2023 Tyler Technologies, Inc.
4
4
  * License: Apache-2.0
5
5
  */
6
- import{g as m}from"./chunk.3IUQ4C47.js";import{a}from"./chunk.SQ3AZAHF.js";import{b as r}from"./chunk.VRSPT7WX.js";import{a as p}from"./chunk.M3QDAYD2.js";var d=`${r}text-field`,u={SHOW_CLEAR:"show-clear"},_=p({},u),h={FIELD:"#field",CLEAR_BUTTON_SLOT:"slot[name=clear-button]",FORGE_LABEL:m.elementName,INPUT:":where(input:not([type=button], [type=checkbox], [type=color], [type=hidden], [type=image], [type=radio], [type=range], [type=reset], [type=submit]), textarea)"},g=["disabled","placeholder"],f={TEXTAREA:"TEXTAREA",LABEL:"LABEL"},T={CLEAR:`${d}-clear`},E={elementName:d,observedAttributes:u,attributes:_,selectors:h,observedInputAttributes:g,tagNames:f,events:T};var c=class extends a{constructor(e){super(e)}_build(){let e=document.createElement(E.elementName);return this._inputElement=this._buildInputElement(e),e.append(this._inputElement),e}_configure(){var e,t,n,i,l,o,s;(e=this._config.options)!=null&&e.id&&(this._element.id=this._config.options.id),(t=this._config.options)!=null&&t.label&&this._createLabel(this._config.options.label),(n=this._config.options)!=null&&n.startElement&&(this._config.options.startElement.slot="start",this._element.append(this._config.options.startElement)),(i=this._config.options)!=null&&i.leadingElement&&(this._config.options.leadingElement.slot="start",this._element.append(this._config.options.leadingElement)),(l=this._config.options)!=null&&l.endElement&&(this._config.options.endElement.slot="end",this._element.append(this._config.options.endElement)),(o=this._config.options)!=null&&o.trailingElement&&(this._config.options.trailingElement.slot="end",this._element.append(this._config.options.trailingElement)),(s=this._config.options)!=null&&s.accessoryElement&&(this._config.options.accessoryElement.slot="accessory",this._element.append(this._config.options.accessoryElement))}get value(){return this._inputElement.value}set value(e){this._inputElement.value=e}get disabled(){return this._inputElement.disabled}set disabled(e){this._inputElement.disabled=e}get invalid(){return this._element.invalid}set invalid(e){this._element.invalid=e}get inputElement(){return this._inputElement}get labelElement(){return this._labelElement}onChange(e){this._inputElement.addEventListener("input",t=>e(t.target.value))}onFocus(e){this._inputElement.addEventListener("focus",t=>e(t))}onBlur(e){this._inputElement.addEventListener("blur",t=>e(t))}setLabel(e){var t;if(e){this._labelElement?this._labelElement.textContent=e:this._createLabel(e);return}(t=this._labelElement)==null||t.remove(),this._labelElement=void 0}setSupportTextStart(e){var t;if(e){this._supportTextStartElement||(this._supportTextStartElement=document.createElement("span"),this._supportTextStartElement.slot="support-text-start",this._element.append(this._supportTextStartElement)),this._supportTextStartElement.textContent=e;return}(t=this._supportTextStartElement)==null||t.remove(),this._supportTextStartElement=void 0}setHelperText(e){this.setSupportTextStart(e)}setSupportTextEnd(e){var t;if(e){this._supportTextEndElement||(this._supportTextEndElement=document.createElement("span"),this._supportTextEndElement.slot="support-text-end",this._element.append(this._supportTextEndElement)),this._supportTextEndElement.textContent=e;return}(t=this._supportTextEndElement)==null||t.remove(),this._supportTextEndElement=void 0}floatLabel(e){this._element.floatLabel=e}_createLabel(e){var t;this._labelElement=document.createElement("label"),this._labelElement.textContent=e,this._labelElement.slot="label",(t=this._config.options)!=null&&t.id&&(this._labelElement.htmlFor=this._config.options.id),this._element.append(this._labelElement)}_buildInputElement(e){var n,i,l,o,s;let t=document.createElement("input");return t.type=(i=(n=this._config.options)==null?void 0:n.type)!=null?i:"text",((l=this._config.options)==null?void 0:l.value)!==void 0&&(t.value=this._config.options.value),(o=this._config.options)!=null&&o.id&&(t.id=this._config.options.id),((s=this._config.options)==null?void 0:s.placeholder)!==void 0&&(t.placeholder=this._config.options.placeholder),e.append(t),t}};export{E as a,c as b};
7
- //# sourceMappingURL=chunk.RONMNRSH.js.map
6
+ import{g as m}from"./chunk.CLYGTLXN.js";import{a}from"./chunk.SQ3AZAHF.js";import{b as r}from"./chunk.VRSPT7WX.js";import{a as p}from"./chunk.M3QDAYD2.js";var d=`${r}text-field`,u={SHOW_CLEAR:"show-clear"},_=p({},u),h={FIELD:"#field",CLEAR_BUTTON_SLOT:"slot[name=clear-button]",FORGE_LABEL:m.elementName,INPUT:":where(input:not([type=button], [type=checkbox], [type=color], [type=hidden], [type=image], [type=radio], [type=range], [type=reset], [type=submit]), textarea)"},g=["disabled","placeholder"],f={TEXTAREA:"TEXTAREA",LABEL:"LABEL"},T={CLEAR:`${d}-clear`},E={elementName:d,observedAttributes:u,attributes:_,selectors:h,observedInputAttributes:g,tagNames:f,events:T};var c=class extends a{constructor(e){super(e)}_build(){let e=document.createElement(E.elementName);return this._inputElement=this._buildInputElement(e),e.append(this._inputElement),e}_configure(){var e,t,n,i,l,o,s;(e=this._config.options)!=null&&e.id&&(this._element.id=this._config.options.id),(t=this._config.options)!=null&&t.label&&this._createLabel(this._config.options.label),(n=this._config.options)!=null&&n.startElement&&(this._config.options.startElement.slot="start",this._element.append(this._config.options.startElement)),(i=this._config.options)!=null&&i.leadingElement&&(this._config.options.leadingElement.slot="start",this._element.append(this._config.options.leadingElement)),(l=this._config.options)!=null&&l.endElement&&(this._config.options.endElement.slot="end",this._element.append(this._config.options.endElement)),(o=this._config.options)!=null&&o.trailingElement&&(this._config.options.trailingElement.slot="end",this._element.append(this._config.options.trailingElement)),(s=this._config.options)!=null&&s.accessoryElement&&(this._config.options.accessoryElement.slot="accessory",this._element.append(this._config.options.accessoryElement))}get value(){return this._inputElement.value}set value(e){this._inputElement.value=e}get disabled(){return this._inputElement.disabled}set disabled(e){this._inputElement.disabled=e}get invalid(){return this._element.invalid}set invalid(e){this._element.invalid=e}get inputElement(){return this._inputElement}get labelElement(){return this._labelElement}onChange(e){this._inputElement.addEventListener("input",t=>e(t.target.value))}onFocus(e){this._inputElement.addEventListener("focus",t=>e(t))}onBlur(e){this._inputElement.addEventListener("blur",t=>e(t))}setLabel(e){var t;if(e){this._labelElement?this._labelElement.textContent=e:this._createLabel(e);return}(t=this._labelElement)==null||t.remove(),this._labelElement=void 0}setSupportTextStart(e){var t;if(e){this._supportTextStartElement||(this._supportTextStartElement=document.createElement("span"),this._supportTextStartElement.slot="support-text-start",this._element.append(this._supportTextStartElement)),this._supportTextStartElement.textContent=e;return}(t=this._supportTextStartElement)==null||t.remove(),this._supportTextStartElement=void 0}setHelperText(e){this.setSupportTextStart(e)}setSupportTextEnd(e){var t;if(e){this._supportTextEndElement||(this._supportTextEndElement=document.createElement("span"),this._supportTextEndElement.slot="support-text-end",this._element.append(this._supportTextEndElement)),this._supportTextEndElement.textContent=e;return}(t=this._supportTextEndElement)==null||t.remove(),this._supportTextEndElement=void 0}floatLabel(e){this._element.floatLabel=e}_createLabel(e){var t;this._labelElement=document.createElement("label"),this._labelElement.textContent=e,this._labelElement.slot="label",(t=this._config.options)!=null&&t.id&&(this._labelElement.htmlFor=this._config.options.id),this._element.append(this._labelElement)}_buildInputElement(e){var n,i,l,o,s;let t=document.createElement("input");return t.type=(i=(n=this._config.options)==null?void 0:n.type)!=null?i:"text",((l=this._config.options)==null?void 0:l.value)!==void 0&&(t.value=this._config.options.value),(o=this._config.options)!=null&&o.id&&(t.id=this._config.options.id),((s=this._config.options)==null?void 0:s.placeholder)!==void 0&&(t.placeholder=this._config.options.placeholder),e.append(t),t}};export{E as a,c as b};
7
+ //# sourceMappingURL=chunk.SZOZIJZI.js.map
@@ -3,5 +3,5 @@
3
3
  * Copyright 2023 Tyler Technologies, Inc.
4
4
  * License: Apache-2.0
5
5
  */
6
- import{a as v,v as i,x as P}from"./chunk.ISLJNJEE.js";import{a as h}from"./chunk.NVUMRW44.js";import{a as T}from"./chunk.OLFOVKQG.js";import{a as E}from"./chunk.VRSPT7WX.js";import{a as g,e as O,f as I,k as L}from"./chunk.LNTTU2GL.js";import{k as _,l as f,p as w}from"./chunk.J2M2MXP2.js";import{d as u}from"./chunk.M3QDAYD2.js";var d=class o{static observe(t,e,l){var s,r;o._targets.has(t)&&((s=o._observer)===null||s===void 0||s.unobserve(t)),o._targets.set(t,e),o._countTargets(),(r=o._observer)===null||r===void 0||r.observe(t,l)}static unobserve(t){var e;o._targets.delete(t),(e=o._observer)===null||e===void 0||e.unobserve(t),o._countTargets()}static _countTargets(){o._observer?o._targets.size<1&&(o._observer=void 0):o._targets.size&&(o._observer=new ResizeObserver(o._handleResize))}};d._targets=new Map;d._handleResize=o=>{o.forEach(t=>{var e;(e=d._targets.get(t.target))===null||e===void 0||e(t)})};var S=class extends T{constructor(e){super(e);this._root=I(e,i.selectors.ROOT)}registerSlotListener(e){this._root.addEventListener("slotchange",e)}registerDidOpenListener(e){this._root.addEventListener(v.events.DID_OPEN,e)}registerDidCloseListener(e){this._root.addEventListener(v.events.DID_CLOSE,e)}observeResize(e){d.observe(this._root,e)}unobserveResize(){d.unobserve(this._root)}getSlottedPanels(){let e=this._component.querySelectorAll(i.selectors.PANEL);return Array.from(e).filter(r=>r.parentElement===this._component)}refitSlottedPanels(e){let l=e==="horizontal"?this._root.clientWidth:this._root.clientHeight,s=this.getSlottedPanels(),r=s.map(p=>{var b;let n=(b=p.shadowRoot)==null?void 0:b.querySelector(v.selectors.ROOT),c=e==="horizontal"?n==null?void 0:n.clientWidth:n==null?void 0:n.clientHeight;return c!=null?c:0}).reduce((p,n)=>p+n,0);if(r<=l)return;let C=r-l;s.slice().reverse().forEach(p=>{if(C<=0)return;let n=p.getContentSize(),c=p.getCollapsibleSize(),b=Math.min(C,c),A=n-b;p.setContentSize(A),C-=b})}};var m=class{constructor(t){this._adapter=t;this._orientation="horizontal";this._disabled=!1;this._allowClose=!1;this._autoClose=!1;this._autoCloseThreshold=0;this._isInitialized=!1;this._slotListener=e=>this._onSlotChange(e),this._didOpenListener=()=>this._onDidOpen(),this._didCloseListener=()=>this._onDidClose(),this._resizeObserverCallback=w(e=>this._onResize(e),i.numbers.RESIZE_THROTTLE_THRESHOLD)}initialize(){this._adapter.registerSlotListener(this._slotListener),this._adapter.registerDidOpenListener(this._didOpenListener),this._adapter.registerDidCloseListener(this._didCloseListener),this._adapter.observeResize(this._resizeObserverCallback),this._applyOrientation(),this._isInitialized=!0}disconnect(){this._adapter.unobserveResize()}_onSlotChange(t){this._layoutSlottedPanels(),this.update({accessibility:!0,cursor:!0,orientation:this._orientation})}_onDidOpen(){this._adapter.refitSlottedPanels(this._orientation),this.update({accessibility:!0,cursor:!0,size:!0})}_onDidClose(){this._adapter.refitSlottedPanels(this._orientation),this.update({accessibility:!0,cursor:!0,size:!0})}_onResize(t){this.update({accessibility:!0,cursor:!0,size:!0})}_layoutSlottedPanels(){let t=this._adapter.getSlottedPanels();t.length<2||t.some(e=>e.resizable!=="off")||t.slice(1).forEach(e=>e.resizable="start")}get orientation(){return this._orientation}set orientation(t){this._orientation!==t&&(this._orientation=t,this._applyOrientation())}_applyOrientation(){this._adapter.setHostAttribute(i.attributes.ORIENTATION,this._orientation),this.update({orientation:this._orientation}),this._isInitialized&&this._adapter.refitSlottedPanels(this._orientation),this.update({accessibility:!0,cursor:!0})}get disabled(){return this._disabled}set disabled(t){this._disabled!==t&&(this._disabled=t,this._applyDisabled())}_applyDisabled(){this._adapter.toggleHostAttribute(i.attributes.DISABLED,this._disabled),this.update({properties:{disabled:this._disabled}})}get allowClose(){return this._allowClose}set allowClose(t){this._allowClose!==t&&(this._allowClose=t,this._applyAllowClose())}_applyAllowClose(){this._adapter.toggleHostAttribute(i.attributes.ALLOW_CLOSE,this._allowClose),this.update({properties:{allowClose:this._allowClose}})}get autoClose(){return this._autoClose}set autoClose(t){this._autoClose!==t&&(this._autoClose=t,this._applyAutoClose())}_applyAutoClose(){this._adapter.toggleHostAttribute(i.attributes.AUTO_CLOSE,this._autoClose),this.update({properties:{autoClose:this._autoClose}})}get autoCloseThreshold(){return this._autoCloseThreshold}set autoCloseThreshold(t){this._autoCloseThreshold!==t&&(this._autoCloseThreshold=t,this._applyAutoCloseThreshold())}_applyAutoCloseThreshold(){this._adapter.setHostAttribute(i.attributes.AUTO_CLOSE_THRESHOLD,this._autoCloseThreshold.toString()),this.update({properties:{autoCloseThreshold:this._autoCloseThreshold}})}layerSlottedPanels(t){let e=this._adapter.getSlottedPanels(),l=t.resizable==="start"?1:-1,s=t.resizable==="start"?1:3;e.forEach(r=>{(r===t||s===2)&&(s+=l),r.style.setProperty(i.customCssProperties.ANIMATING_LAYER,s.toString())})}unlayerSlottedPanels(){this._adapter.getSlottedPanels().forEach(e=>{e.style.removeProperty(i.customCssProperties.ANIMATING_LAYER)})}update(t){this._adapter.getSlottedPanels().forEach(l=>{l.update(t)})}refitSlottedPanels(){this._adapter.refitSlottedPanels(this._orientation)}};var y='<template><div class="forge-split-view" id="root" part="root"><slot></slot></div></template>',z=".forge-split-view{display:-webkit-box;display:flex;width:100%;height:100%}:host{--forge-split-view-handle-width:8px;display:block;height:100%;width:100%;overflow:hidden;contain:paint size}:host([hidden]){display:none}:host([orientation=horizontal]) .forge-split-view{-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row}:host([orientation=vertical]) .forge-split-view{-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column}",a=class extends L{constructor(){super();O(this,y,z),this._foundation=new m(new S(this))}static get observedAttributes(){return[i.attributes.ORIENTATION,i.attributes.DISABLED,i.attributes.ALLOW_CLOSE,i.attributes.AUTO_CLOSE,i.attributes.AUTO_CLOSE_THRESHOLD]}connectedCallback(){this._foundation.initialize()}disconnectedCallback(){this._foundation.disconnect()}attributeChangedCallback(e,l,s){switch(e){case i.attributes.ORIENTATION:this.orientation=s;break;case i.attributes.DISABLED:this.disabled=_(s);break;case i.attributes.ALLOW_CLOSE:this.allowClose=_(s);break;case i.attributes.AUTO_CLOSE:this.autoClose=_(s);break;case i.attributes.AUTO_CLOSE_THRESHOLD:this.autoCloseThreshold=f(s);break}}layerSlottedPanels(e){this._foundation.layerSlottedPanels(e)}unlayerSlottedPanels(){this._foundation.unlayerSlottedPanels()}update(e){this._foundation.update(e)}refit(){this._foundation.refitSlottedPanels()}};u([h()],a.prototype,"orientation",2),u([h()],a.prototype,"disabled",2),u([h()],a.prototype,"allowClose",2),u([h()],a.prototype,"autoClose",2),u([h()],a.prototype,"autoCloseThreshold",2),a=u([E({name:i.elementName,dependencies:[P]})],a);function ue(){g(a)}export{S as a,m as b,a as c,ue as d};
7
- //# sourceMappingURL=chunk.KTPEFU7V.js.map
6
+ import{a as v,v as i,x as P}from"./chunk.3II7OT2I.js";import{a as h}from"./chunk.NVUMRW44.js";import{a as T}from"./chunk.OLFOVKQG.js";import{a as E}from"./chunk.VRSPT7WX.js";import{a as g,e as O,f as I,k as L}from"./chunk.LNTTU2GL.js";import{k as _,l as f,p as w}from"./chunk.J2M2MXP2.js";import{d as u}from"./chunk.M3QDAYD2.js";var d=class o{static observe(t,e,l){var s,r;o._targets.has(t)&&((s=o._observer)===null||s===void 0||s.unobserve(t)),o._targets.set(t,e),o._countTargets(),(r=o._observer)===null||r===void 0||r.observe(t,l)}static unobserve(t){var e;o._targets.delete(t),(e=o._observer)===null||e===void 0||e.unobserve(t),o._countTargets()}static _countTargets(){o._observer?o._targets.size<1&&(o._observer=void 0):o._targets.size&&(o._observer=new ResizeObserver(o._handleResize))}};d._targets=new Map;d._handleResize=o=>{o.forEach(t=>{var e;(e=d._targets.get(t.target))===null||e===void 0||e(t)})};var S=class extends T{constructor(e){super(e);this._root=I(e,i.selectors.ROOT)}registerSlotListener(e){this._root.addEventListener("slotchange",e)}registerDidOpenListener(e){this._root.addEventListener(v.events.DID_OPEN,e)}registerDidCloseListener(e){this._root.addEventListener(v.events.DID_CLOSE,e)}observeResize(e){d.observe(this._root,e)}unobserveResize(){d.unobserve(this._root)}getSlottedPanels(){let e=this._component.querySelectorAll(i.selectors.PANEL);return Array.from(e).filter(r=>r.parentElement===this._component)}refitSlottedPanels(e){let l=e==="horizontal"?this._root.clientWidth:this._root.clientHeight,s=this.getSlottedPanels(),r=s.map(p=>{var b;let n=(b=p.shadowRoot)==null?void 0:b.querySelector(v.selectors.ROOT),c=e==="horizontal"?n==null?void 0:n.clientWidth:n==null?void 0:n.clientHeight;return c!=null?c:0}).reduce((p,n)=>p+n,0);if(r<=l)return;let C=r-l;s.slice().reverse().forEach(p=>{if(C<=0)return;let n=p.getContentSize(),c=p.getCollapsibleSize(),b=Math.min(C,c),A=n-b;p.setContentSize(A),C-=b})}};var m=class{constructor(t){this._adapter=t;this._orientation="horizontal";this._disabled=!1;this._allowClose=!1;this._autoClose=!1;this._autoCloseThreshold=0;this._isInitialized=!1;this._slotListener=e=>this._onSlotChange(e),this._didOpenListener=()=>this._onDidOpen(),this._didCloseListener=()=>this._onDidClose(),this._resizeObserverCallback=w(e=>this._onResize(e),i.numbers.RESIZE_THROTTLE_THRESHOLD)}initialize(){this._adapter.registerSlotListener(this._slotListener),this._adapter.registerDidOpenListener(this._didOpenListener),this._adapter.registerDidCloseListener(this._didCloseListener),this._adapter.observeResize(this._resizeObserverCallback),this._applyOrientation(),this._isInitialized=!0}disconnect(){this._adapter.unobserveResize()}_onSlotChange(t){this._layoutSlottedPanels(),this.update({accessibility:!0,cursor:!0,orientation:this._orientation})}_onDidOpen(){this._adapter.refitSlottedPanels(this._orientation),this.update({accessibility:!0,cursor:!0,size:!0})}_onDidClose(){this._adapter.refitSlottedPanels(this._orientation),this.update({accessibility:!0,cursor:!0,size:!0})}_onResize(t){this.update({accessibility:!0,cursor:!0,size:!0})}_layoutSlottedPanels(){let t=this._adapter.getSlottedPanels();t.length<2||t.some(e=>e.resizable!=="off")||t.slice(1).forEach(e=>e.resizable="start")}get orientation(){return this._orientation}set orientation(t){this._orientation!==t&&(this._orientation=t,this._applyOrientation())}_applyOrientation(){this._adapter.setHostAttribute(i.attributes.ORIENTATION,this._orientation),this.update({orientation:this._orientation}),this._isInitialized&&this._adapter.refitSlottedPanels(this._orientation),this.update({accessibility:!0,cursor:!0})}get disabled(){return this._disabled}set disabled(t){this._disabled!==t&&(this._disabled=t,this._applyDisabled())}_applyDisabled(){this._adapter.toggleHostAttribute(i.attributes.DISABLED,this._disabled),this.update({properties:{disabled:this._disabled}})}get allowClose(){return this._allowClose}set allowClose(t){this._allowClose!==t&&(this._allowClose=t,this._applyAllowClose())}_applyAllowClose(){this._adapter.toggleHostAttribute(i.attributes.ALLOW_CLOSE,this._allowClose),this.update({properties:{allowClose:this._allowClose}})}get autoClose(){return this._autoClose}set autoClose(t){this._autoClose!==t&&(this._autoClose=t,this._applyAutoClose())}_applyAutoClose(){this._adapter.toggleHostAttribute(i.attributes.AUTO_CLOSE,this._autoClose),this.update({properties:{autoClose:this._autoClose}})}get autoCloseThreshold(){return this._autoCloseThreshold}set autoCloseThreshold(t){this._autoCloseThreshold!==t&&(this._autoCloseThreshold=t,this._applyAutoCloseThreshold())}_applyAutoCloseThreshold(){this._adapter.setHostAttribute(i.attributes.AUTO_CLOSE_THRESHOLD,this._autoCloseThreshold.toString()),this.update({properties:{autoCloseThreshold:this._autoCloseThreshold}})}layerSlottedPanels(t){let e=this._adapter.getSlottedPanels(),l=t.resizable==="start"?1:-1,s=t.resizable==="start"?1:3;e.forEach(r=>{(r===t||s===2)&&(s+=l),r.style.setProperty(i.customCssProperties.ANIMATING_LAYER,s.toString())})}unlayerSlottedPanels(){this._adapter.getSlottedPanels().forEach(e=>{e.style.removeProperty(i.customCssProperties.ANIMATING_LAYER)})}update(t){this._adapter.getSlottedPanels().forEach(l=>{l.update(t)})}refitSlottedPanels(){this._adapter.refitSlottedPanels(this._orientation)}};var y='<template><div class="forge-split-view" id="root" part="root"><slot></slot></div></template>',z=".forge-split-view{display:-webkit-box;display:flex;width:100%;height:100%}:host{--forge-split-view-handle-width:8px;display:block;height:100%;width:100%;overflow:hidden;contain:paint size}:host([hidden]){display:none}:host([orientation=horizontal]) .forge-split-view{-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row}:host([orientation=vertical]) .forge-split-view{-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column}",a=class extends L{constructor(){super();O(this,y,z),this._foundation=new m(new S(this))}static get observedAttributes(){return[i.attributes.ORIENTATION,i.attributes.DISABLED,i.attributes.ALLOW_CLOSE,i.attributes.AUTO_CLOSE,i.attributes.AUTO_CLOSE_THRESHOLD]}connectedCallback(){this._foundation.initialize()}disconnectedCallback(){this._foundation.disconnect()}attributeChangedCallback(e,l,s){switch(e){case i.attributes.ORIENTATION:this.orientation=s;break;case i.attributes.DISABLED:this.disabled=_(s);break;case i.attributes.ALLOW_CLOSE:this.allowClose=_(s);break;case i.attributes.AUTO_CLOSE:this.autoClose=_(s);break;case i.attributes.AUTO_CLOSE_THRESHOLD:this.autoCloseThreshold=f(s);break}}layerSlottedPanels(e){this._foundation.layerSlottedPanels(e)}unlayerSlottedPanels(){this._foundation.unlayerSlottedPanels()}update(e){this._foundation.update(e)}refit(){this._foundation.refitSlottedPanels()}};u([h()],a.prototype,"orientation",2),u([h()],a.prototype,"disabled",2),u([h()],a.prototype,"allowClose",2),u([h()],a.prototype,"autoClose",2),u([h()],a.prototype,"autoCloseThreshold",2),a=u([E({name:i.elementName,dependencies:[P]})],a);function ue(){g(a)}export{S as a,m as b,a as c,ue as d};
7
+ //# sourceMappingURL=chunk.TSSZQPLE.js.map
@@ -0,0 +1,7 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2023 Tyler Technologies, Inc.
4
+ * License: Apache-2.0
5
+ */
6
+ import{a as H}from"./chunk.BEFAXPXJ.js";import{a as F}from"./chunk.MFQRXVKO.js";import{a as P}from"./chunk.INQZNXG6.js";import{d as D}from"./chunk.FLF5RTYO.js";import{p as N}from"./chunk.ASLHRT3N.js";import{a as T,b as V}from"./chunk.BQ52JYLA.js";import{a as z}from"./chunk.SQ3AZAHF.js";import{a as s}from"./chunk.NVUMRW44.js";import{a as x}from"./chunk.OLFOVKQG.js";import{a as k,b as I,g as L,h as S,i as d,j as O,k as u,l as A,m as C,n as c}from"./chunk.VRSPT7WX.js";import{a as m,e as y,f as h,k as E}from"./chunk.LNTTU2GL.js";import{q as _}from"./chunk.L4QSPQDE.js";import{b as g,c as w,k as l}from"./chunk.J2M2MXP2.js";import{a as p,d as n}from"./chunk.M3QDAYD2.js";var q=`${I}switch`,R={ON:"on",SELECTED:"selected",DEFAULT_ON:"default-on",VALUE:"value",DENSE:"dense",DISABLED:"disabled",REQUIRED:"required",READONLY:"readonly",ICON:"icon",LABEL_POSITION:"label-position",TABINDEX:"tabindex"},W=p({},R),M={HIDDEN:"hidden"},U={ROOT:".forge-switch",LABEL:"#label",ICON_ON:"#icon-on",ICON_OFF:"#icon-off",STATE_LAYER:"forge-state-layer"},j={CHANGE:`${q}-change`},K={ON:"on",OFF:"off"},i={attributes:W,observedAttributes:R,classes:M,selectors:U,elementName:q,events:j,state:K};var b=class extends x{constructor(e){super(e);this._rootElement=h(e,i.selectors.ROOT),this._labelElement=h(e,i.selectors.LABEL),this._iconOnElement=h(e,i.selectors.ICON_ON),this._iconOffElement=h(e,i.selectors.ICON_OFF),this._stateLayerElement=h(e,i.selectors.STATE_LAYER)}setOn(e){this._component[d](),this._component[c]({ariaChecked:e?"true":"false"})}setDisabled(e){this._component[C]=!e,this._component[c]({ariaDisabled:e?"true":"false"}),this._stateLayerElement.disabled=e}setRequired(e){this._component[d](),this._component[c]({ariaRequired:e?"true":"false"})}setReadonly(e){this._component[c]({ariaReadOnly:e?"true":"false"}),this._stateLayerElement.disabled=e}setIconVisibility(e){let a=e==="none"||e==="off",o=e==="none"||e==="on";_(this._iconOnElement,a,i.classes.HIDDEN),_(this._iconOffElement,o,i.classes.HIDDEN)}setLabelPosition(e){this._labelElement.remove(),e==="start"?this._rootElement.prepend(this._labelElement):this._rootElement.append(this._labelElement)}syncValue(e){let a=e?new FormData:null,o=e?i.state.ON:i.state.OFF;a&&e&&a.append(this._component.name,e),this._component.setFormValue(a,o)}};var f=class{constructor(t){this._adapter=t;this._on=!1;this._defaultOn=!1;this._value="on";this._dense=!1;this._disabled=!1;this._required=!1;this._readonly=!1;this._icon="on";this._labelPosition="end";this._clickListener=()=>this._handleChange();this._keydownListener=t=>this._handleKeydown(t);this._keyupListener=t=>this._handleKeyup(t)}get _submittedValue(){return this._on?this._value:null}initialize(){this._adapter.addHostListener("click",this._clickListener),this._adapter.addHostListener("keydown",this._keydownListener),this._adapter.addHostListener("keyup",this._keyupListener),this._adapter.setIconVisibility(this._icon),this._adapter.syncValue(this._submittedValue)}_handleKeydown(t){t.key===" "&&t.preventDefault()}_handleKeyup(t){t.key===" "&&this._handleChange()}_handleChange(){if(this._readonly)return;let t=this._on,e=!this._on;this.on=e;let a=new Event("change",{cancelable:!0}),o=new CustomEvent(i.events.CHANGE,{detail:e,bubbles:!0,cancelable:!0});if(this._adapter.dispatchHostEvent(a),this._adapter.dispatchHostEvent(o),a.defaultPrevented||o.defaultPrevented){this.on=t;return}}_setOnAttribute(){this._adapter.toggleHostAttribute(i.attributes.ON,this._on),this._adapter.toggleHostAttribute(i.attributes.SELECTED,this._on)}get on(){return this._on}set on(t){this._on!==t&&(this._on=t,this._adapter.setOn(this._on),this._adapter.syncValue(this._submittedValue),this._setOnAttribute())}get defaultOn(){return this._defaultOn}set defaultOn(t){this._defaultOn!==t&&(this._defaultOn=t,this._adapter.toggleHostAttribute(i.attributes.DEFAULT_ON,this._defaultOn))}get value(){return this._value}set value(t){this._value!==t&&(this._value=t,this._adapter.syncValue(this._submittedValue),this._adapter.toggleHostAttribute(i.attributes.VALUE,!0,this._value))}get dense(){return this._dense}set dense(t){this._dense!==t&&(this._dense=t,this._adapter.toggleHostAttribute(i.attributes.DENSE,this._dense))}get disabled(){return this._disabled}set disabled(t){this._disabled!==t&&(this._disabled=t,this._adapter.setDisabled(this._disabled),this._adapter.toggleHostAttribute(i.attributes.DISABLED,this._disabled))}get required(){return this._required}set required(t){this._required!==t&&(this._required=t,this._adapter.setRequired(this._required),this._adapter.toggleHostAttribute(i.attributes.REQUIRED,this._required))}get readonly(){return this._readonly}set readonly(t){this._readonly!==t&&(this._readonly=t,this._adapter.setReadonly(this._readonly),this._adapter.toggleHostAttribute(i.attributes.READONLY,this._readonly))}get icon(){return this._icon}set icon(t){this._icon!==t&&(this._icon=t,this._adapter.setIconVisibility(this._icon),this._adapter.setHostAttribute(i.attributes.ICON,this._icon))}get labelPosition(){return this._labelPosition}set labelPosition(t){this._labelPosition!==t&&(this._labelPosition=t,this._adapter.setLabelPosition(this._labelPosition),this._adapter.setHostAttribute(i.attributes.LABEL_POSITION,this._labelPosition))}};var Y='<template><div class="forge-switch" part="switch"><div id="container" class="container"><div class="track" part="track"></div><div class="handle" part="handle"><div id="icon-off" class="icon icon__off" part="icon-off"><slot name="icon-off"><svg aria-hidden="true" viewBox="0 0 24 24"><path d="M20 13H4v-2h16v2z"/></svg></slot></div><div id="icon-on" class="icon icon__on" part="icon-on"><slot name="icon-on"><svg aria-hidden="true" viewBox="0 0 24 24"><path d="M19.69,5.23L8.96,15.96l-4.23-4.23L2.96,13.5l6,6L21.46,7L19.69,5.23z"/></svg></slot></div><forge-state-layer target=":host" exportparts="surface:state-layer"></forge-state-layer></div><forge-focus-indicator target=":host" part="focus-indicator"></forge-focus-indicator></div><label id="label" class="label" part="label"><slot></slot></label></div></template>',G=':host{display:inline-block;outline:0;-webkit-tap-highlight-color:transparent}:host([hidden]){display:none}.forge-switch{--_switch-handle-size:var(--forge-switch-handle-size, 20px);--_switch-handle-scale:var(--forge-switch-handle-scale, 1);--_switch-handle-elevation:var(--forge-switch-handle-elevation, 0px 2px 1px -1px rgba(0, 0, 0, 0.2), 0px 1px 1px 0px rgba(0, 0, 0, 0.14), 0px 1px 3px 0px rgba(0, 0, 0, 0.12));--_switch-track-border-width:var(--forge-switch-track-border-width, 0);--_switch-track-border-color:var(--forge-switch-track-border-color, transparent);--_switch-icon-color:var(--forge-switch-icon-color, var(--forge-theme-on-tertiary, #ffffff));--_switch-icon-size:var(--forge-switch-icon-size, 16px);--_switch-icon-scale:var(--forge-switch-icon-scale, 1);--_switch-state-layer-size:var(--forge-switch-state-layer-size, 40px);--_switch-state-layer-dense-size:var(--forge-switch-state-layer-dense-size, 28px);--_switch-handle-on-color:var(--forge-switch-handle-on-color, var(--forge-theme-tertiary, #3d5afe));--_switch-handle-off-color:var(--forge-switch-handle-off-color, var(--forge-theme-surface-container-high, #9e9e9e));--_switch-handle-width:var(--forge-switch-handle-width, var(--_switch-handle-size));--_switch-handle-height:var(--forge-switch-handle-height, var(--_switch-handle-size));--_switch-handle-on-scale:var(--forge-switch-handle-on-scale, var(--_switch-handle-scale));--_switch-handle-off-scale:var(--forge-switch-handle-off-scale, var(--_switch-handle-scale));--_switch-handle-shape:var(--forge-switch-handle-shape, var(--forge-shape-round, 50%));--_switch-handle-on-elevation:var(--forge-switch-handle-on-elevation, var(--_switch-handle-elevation));--_switch-handle-off-elevation:var(--forge-switch-handle-off-elevation, var(--_switch-handle-elevation));--_switch-track-on-color:var(--forge-switch-track-on-color, var(--forge-theme-tertiary-container, #d0d7ff));--_switch-track-off-color:var(--forge-switch-track-off-color, var(--forge-theme-surface-container, #e0e0e0));--_switch-track-width:var(--forge-switch-track-width, 36px);--_switch-track-height:var(--forge-switch-track-height, 14px);--_switch-track-shape:var(--forge-switch-track-shape, var(--forge-shape-full, 9999px));--_switch-track-on-border-width:var(--forge-switch-track-on-border-width, var(--_switch-track-border-width));--_switch-track-off-border-width:var(--forge-switch-track-off-border-width, var(--_switch-track-border-width));--_switch-track-on-border-color:var(--forge-switch-track-on-border-color, var(--_switch-track-border-color));--_switch-track-off-border-color:var(--forge-switch-track-off-border-color, var(--_switch-track-border-color));--_switch-icon-on-color:var(--forge-switch-icon-on-color, var(--_switch-icon-color));--_switch-icon-off-color:var(--forge-switch-icon-off-color, var(--_switch-icon-color));--_switch-icon-on-size:var(--forge-switch-icon-on-size, var(--_switch-icon-size));--_switch-icon-off-size:var(--forge-switch-icon-off-size, var(--_switch-icon-size));--_switch-icon-on-scale:var(--forge-switch-icon-on-scale, var(--_switch-icon-scale));--_switch-icon-off-scale:var(--forge-switch-icon-off-scale, var(--_switch-icon-scale));--_switch-gap:var(--forge-switch-gap, 0);--_switch-justify:var(--forge-switch-justify, start);--_switch-direction:var(--forge-switch-direction, initial);--_switch-state-layer-width:var(--forge-switch-state-layer-width, var(--_switch-state-layer-size));--_switch-state-layer-height:var(--forge-switch-state-layer-height, var(--_switch-state-layer-size));--_switch-state-layer-on-color:var(--forge-switch-state-layer-on-color, var(--_switch-handle-on-color));--_switch-state-layer-off-color:var(--forge-switch-state-layer-off-color, var(--_switch-color));--_switch-state-layer-dense-width:var(--forge-switch-state-layer-dense-width, var(--_switch-state-layer-dense-size));--_switch-state-layer-dense-height:var(--forge-switch-state-layer-dense-height, var(--_switch-state-layer-dense-size));--_switch-disabled-opacity:var(--forge-switch-disabled-opacity, 0.38);--_switch-handle-active-on-color:var(--forge-switch-handle-active-on-color, var(--_switch-handle-on-color));--_switch-handle-active-off-color:var(--forge-switch-handle-active-off-color, var(--_switch-handle-off-color));--_switch-handle-active-scale:var(--forge-switch-handle-active-scale, 1.2);--_switch-handle-active-on-scale:var(--forge-switch-handle-active-on-scale, var(--_switch-handle-active-scale));--_switch-handle-active-off-scale:var(--forge-switch-handle-active-off-scale, var(--_switch-handle-active-scale));--_switch-handle-active-elevation:var(--forge-switch-handle-active-elevation, var(--_switch-handle-elevation));--_switch-handle-active-on-elevation:var(--forge-switch-handle-active-on-elevation, var(--_switch-handle-active-elevation));--_switch-handle-active-off-elevation:var(--forge-switch-handle-active-off-elevation, var(--_switch-handle-active-elevation));--_switch-track-active-on-color:var(--forge-switch-track-active-on-color, var(--_switch-track-on-color));--_switch-track-active-off-color:var(--forge-switch-track-active-off-color, var(--_switch-track-off-color));--_switch-track-active-on-border-width:var(--forge-switch-track-active-on-border-width, var(--_switch-track-on-border-width));--_switch-track-active-off-border-width:var(--forge-switch-track-active-off-border-width, var(--_switch-track-off-border-width));--_switch-track-active-on-border-color:var(--forge-switch-track-active-on-border-color, var(--_switch-track-on-border-color));--_switch-track-active-off-border-color:var(--forge-switch-track-active-off-border-color, var(--_switch-track-off-border-color));--_switch-icon-active-on-color:var(--forge-switch-icon-active-on-color, var(--_switch-icon-on-color));--_switch-icon-active-off-color:var(--forge-switch-icon-active-off-color, var(--_switch-icon-off-color));--_switch-icon-active-on-scale:var(--forge-switch-icon-active-on-scale, var(--_switch-icon-on-scale));--_switch-icon-active-off-scale:var(--forge-switch-icon-active-off-scale, var(--_switch-icon-off-scale));--_switch-animation-duration:var(--forge-switch-animation-duration, var(--forge-animation-duration-short2, 100ms));--_switch-animation-timing:var(--forge-switch-animation-timing, var(--forge-animation-easing-standard, cubic-bezier(0.2, 0, 0, 1)));--_switch-active-animation-timing:var(--forge-switch-active-animation-timing, var(--forge-animation-easing-linear, cubic-bezier(0, 0, 1, 1)))}.forge-switch{display:-webkit-box;display:flex;position:relative;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:var(--_switch-direction);flex-shrink:0;-webkit-box-align:center;align-items:center;-webkit-box-pack:var(--_switch-justify);justify-content:var(--_switch-justify);gap:var(--_switch-gap);--_switch-current-state-layer-width:var(--_switch-state-layer-width);--_switch-current-state-layer-height:var(--_switch-state-layer-height)}.forge-switch .container{position:relative;-webkit-box-align:center;align-items:center;display:-webkit-box;display:flex;block-size:max(var(--_switch-handle-height),var(--_switch-track-height),var(--_switch-current-state-layer-height));cursor:pointer}.forge-switch .input{position:absolute;z-index:1;-webkit-appearance:none;-moz-appearance:none;appearance:none;outline:0;margin:0;inline-size:100%;block-size:100%;cursor:unset}.forge-switch .track{-webkit-transition-property:background-color,border-color,border-width;transition-property:background-color,border-color,border-width;-webkit-transition-duration:var(--_switch-animation-duration);transition-duration:var(--_switch-animation-duration);-webkit-transition-timing-function:var(--_switch-animation-timing);transition-timing-function:var(--_switch-animation-timing);-webkit-box-sizing:border-box;box-sizing:border-box;margin-inline:calc(max(var(--_switch-handle-width),var(--_switch-current-state-layer-width))/ 2 - calc(var(--_switch-track-height)/ 2));border-width:var(--_switch-track-off-border-width);border-color:var(--_switch-track-off-border-color);border-style:solid;border-radius:var(--_switch-track-shape);inline-size:var(--_switch-track-width);block-size:var(--_switch-track-height);background-color:var(--_switch-track-off-color)}.forge-switch .handle{position:absolute;-webkit-box-pack:center;justify-content:center;-webkit-box-align:center;align-items:center;display:-webkit-box;display:flex;-webkit-transition-property:translate;transition-property:translate;-webkit-transition-duration:var(--_switch-animation-duration);transition-duration:var(--_switch-animation-duration);-webkit-transition-timing-function:var(--_switch-animation-timing);transition-timing-function:var(--_switch-animation-timing);border-radius:var(--_switch-handle-shape);inline-size:var(--_switch-current-state-layer-width);block-size:var(--_switch-current-state-layer-height)}.forge-switch .handle::before{content:"";position:relative;display:block;scale:var(--_switch-handle-off-scale);-webkit-transition:background-color var(--_switch-animation-duration) var(--_switch-animation-timing),scale var(--_switch-animation-duration) var(--_switch-active-animation-timing),-webkit-box-shadow var(--_switch-animation-duration) var(--_switch-animation-timing);transition:background-color var(--_switch-animation-duration) var(--_switch-animation-timing),scale var(--_switch-animation-duration) var(--_switch-active-animation-timing),-webkit-box-shadow var(--_switch-animation-duration) var(--_switch-animation-timing);transition:background-color var(--_switch-animation-duration) var(--_switch-animation-timing),box-shadow var(--_switch-animation-duration) var(--_switch-animation-timing),scale var(--_switch-animation-duration) var(--_switch-active-animation-timing);transition:background-color var(--_switch-animation-duration) var(--_switch-animation-timing),box-shadow var(--_switch-animation-duration) var(--_switch-animation-timing),scale var(--_switch-animation-duration) var(--_switch-active-animation-timing),-webkit-box-shadow var(--_switch-animation-duration) var(--_switch-animation-timing);-webkit-box-shadow:var(--_switch-handle-off-elevation);box-shadow:var(--_switch-handle-off-elevation);border-radius:var(--_switch-handle-shape);inline-size:var(--_switch-handle-width);block-size:var(--_switch-handle-height);background-color:var(--_switch-handle-off-color)}.forge-switch .icon{position:absolute;-webkit-box-align:center;align-items:center;-webkit-box-pack:center;justify-content:center;display:-webkit-box;display:flex;-webkit-transition-property:opacity,scale;transition-property:opacity,scale;-webkit-transition-duration:var(--_switch-animation-duration);transition-duration:var(--_switch-animation-duration);-webkit-transition-timing-function:var(--_switch-animation-timing);transition-timing-function:var(--_switch-animation-timing);inline-size:var(--_switch-icon-off-size);block-size:var(--_switch-icon-off-size);color:var(--_switch-icon-off-color);fill:var(--_switch-icon-off-color);font-size:var(--_switch-icon-off-size);--forge-icon-font-size:var(--_switch-icon-off-size)}.forge-switch .icon__on{--forge-icon-font-size:var(--_switch-icon-on-size);inline-size:var(--_switch-icon-on-size);block-size:var(--_switch-icon-on-size);color:var(--_switch-icon-on-color);fill:var(--_switch-icon-on-color);font-size:var(--_switch-icon-on-size);opacity:0;scale:0.4}.forge-switch .icon__off{opacity:1;scale:var(--_switch-icon-off-scale)}.forge-switch .label{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:var(--forge-typography-label1-font-family, var(--forge-typography-font-family, "Roboto", sans-serif));font-size:var(--forge-typography-label1-font-size, calc(var(--forge-typography-font-size, 1rem) * var(--forge-typography-label-font-size-scale, .75)));font-weight:var(--forge-typography-label1-font-weight,400);line-height:var(--forge-typography-label1-line-height, calc(var(--forge-typography-font-size, 1rem) * var(--forge-typography-label-line-height-scale, 1.25)));letter-spacing:var(--forge-typography-label1-letter-spacing, .0357142857em);text-transform:var(--forge-typography-label1-text-transform,inherit);-webkit-text-decoration:var(--forge-typography-label1-text-decoration,inherit);text-decoration:var(--forge-typography-label1-text-decoration,inherit)}.forge-switch .label:empty{display:none}.forge-switch .hidden{display:none}.forge-switch ::slotted([slot=input]){position:absolute;z-index:1;-webkit-appearance:none;-moz-appearance:none;appearance:none;outline:0;margin:0;inline-size:100%;block-size:100%;cursor:unset}:host([on]) .track{border-width:var(--_switch-track-on-border-width);border-color:var(--_switch-track-on-border-color);background-color:var(--_switch-track-on-color)}:host([on]) .handle{translate:calc(var(--_switch-track-width) - calc(var(--_switch-track-height)/ 2) * 2)}:host([on]) .handle::before{scale:var(--_switch-handle-on-scale);-webkit-box-shadow:var(--_switch-handle-on-elevation);box-shadow:var(--_switch-handle-on-elevation);background-color:var(--_switch-handle-on-color)}:host([on]) .handle .icon__on{opacity:1;scale:var(--_switch-icon-on-scale)}:host([on]) .handle .icon__off{opacity:0;scale:0.4}:host([on]) forge-state-layer{--forge-state-layer-color:var(--_switch-state-layer-on-color)}:host(:not([disabled]):not([readonly])) .forge-switch .container:active .track{border-width:var(--_switch-track-active-off-border-width);border-color:var(--_switch-track-active-off-border-color);background-color:var(--_switch-track-active-off-color)}:host(:not([disabled]):not([readonly])) .forge-switch .container:active .handle::before{scale:var(--_switch-handle-active-off-scale);-webkit-box-shadow:var(--_switch-handle-active-off-elevation);box-shadow:var(--_switch-handle-active-off-elevation);background-color:var(--_switch-handle-active-off-color)}:host(:not([disabled]):not([readonly])) .forge-switch .container:active .handle .icon{scale:var(--_switch-icon-active-off-scale);color:var(--_switch-icon-active-off-color);fill:var(--_switch-icon-active-off-color)}:host(:not([disabled]):not([readonly])[on]) .forge-switch .container:active .track{border-width:var(--_switch-track-active-on-border-width);border-color:var(--_switch-track-active-on-border-color);background-color:var(--_switch-track-active-on-color)}:host(:not([disabled]):not([readonly])[on]) .forge-switch .container:active .handle::before{scale:var(--_switch-handle-active-on-scale);-webkit-box-shadow:var(--_switch-handle-active-on-elevation);box-shadow:var(--_switch-handle-active-on-elevation);background-color:var(--_switch-handle-active-on-color)}:host(:not([disabled]):not([readonly])[on]) .forge-switch .container:active .handle .icon{scale:var(--_switch-icon-active-on-scale);color:var(--_switch-icon-active-on-color);fill:var(--_switch-icon-active-on-color)}:host([dense]) .forge-switch{--_switch-current-state-layer-width:var(--_switch-state-layer-dense-width);--_switch-current-state-layer-height:var(--_switch-state-layer-dense-height)}:host([disabled]) .forge-switch{opacity:var(--_switch-disabled-opacity)}:host([disabled]) .forge-switch .container{cursor:not-allowed}:host([disabled]) .forge-switch .handle::before{-webkit-box-shadow:none;box-shadow:none}:host([readonly]) .forge-switch .container{cursor:not-allowed}@media (prefers-reduced-motion){.switch{--_switch-animation-duration:var(--forge-switch-animation-duration, 0s)}}forge-state-layer{--forge-state-layer-color:var(--_switch-state-layer-off-color)}forge-focus-indicator{--forge-focus-indicator-shape:var(--_switch-track-shape);--forge-focus-indicator-outward-offset:0px}',Q=H(P(F(V(T(E))))),r=class extends Q{constructor(){super();y(this,Y,G),this[A]="checkbox",this._foundation=new f(new b(this))}static get observedAttributes(){return Object.values(i.observedAttributes)}connectedCallback(){super.connectedCallback(),this[c]({role:"switch",ariaChecked:this.on?"true":"false",ariaDisabled:this.disabled?"true":"false",ariaRequired:this.required?"true":"false"}),this._foundation.initialize()}attributeChangedCallback(e,a,o){switch(e){case i.observedAttributes.ON:case i.observedAttributes.SELECTED:this.on=l(o);break;case i.observedAttributes.DEFAULT_ON:this.defaultOn=l(o);break;case i.observedAttributes.VALUE:this.value=o;break;case i.observedAttributes.DENSE:this.dense=l(o);break;case i.observedAttributes.DISABLED:this.disabled=l(o);break;case i.observedAttributes.REQUIRED:this.required=l(o);break;case i.observedAttributes.READONLY:this.readonly=l(o);break;case i.observedAttributes.ICON:this.icon=o;break;case i.observedAttributes.LABEL_POSITION:this.labelPosition=o;break}super.attributeChangedCallback(e,a,o)}[L](){return this.on?this.value:null}[S](){return this.on?i.state.ON:i.state.OFF}[d](){this[u].setValidity({valueMissing:this.required&&!this.on},this[O]({checked:this.on,required:this.required}))}formResetCallback(){this.on=this.defaultOn}formStateRestoreCallback(e){this.on=e===i.state.ON}labelClickedCallback(){this.click(),this.focus()}labelChangedCallback(e){this[c]({ariaLabel:e})}setFormValue(e,a){if(this[u].setFormValue(e,a),a){let o=w(a)?a:a[this.name];this.on=o===i.state.ON;return}w(e)?this.on=!!e:e!=null&&e[this.name]?this.on=!!e[this.name]:this.on=!1}toggle(e){g(e)?this._foundation.on=e:this._foundation.on=!this._foundation.on}};n([s()],r.prototype,"on",2),n([s({name:"on"})],r.prototype,"selected",2),n([s()],r.prototype,"defaultOn",2),n([s()],r.prototype,"value",2),n([s()],r.prototype,"dense",2),n([s()],r.prototype,"disabled",2),n([s()],r.prototype,"required",2),n([s()],r.prototype,"readonly",2),n([s()],r.prototype,"icon",2),n([s()],r.prototype,"labelPosition",2),r=n([k({name:i.elementName,dependencies:[D,N]})],r);var B=class extends z{constructor(t){super(t)}get value(){return this._element.value}set value(t){this._element.value=t}get on(){return this._element.on}set on(t){this._element.on=t}get selected(){return this._element.selected}set selected(t){this._element.selected=t}get defaultOn(){return this._element.defaultOn}set defaultOn(t){this._element.defaultOn=t}get icon(){return this._element.icon}set icon(t){this._element.icon=t}get disabled(){return this._element.disabled}set disabled(t){this._element.disabled=t}get dense(){return this._element.dense}set dense(t){this._element.dense=t}get required(){return this._element.required}set required(t){this._element.required=t}get readonly(){return this._element.readonly}set readonly(t){this._element.readonly=t}get name(){return this._element.name}set name(t){this._element.name=t}get labelPosition(){return this._element.labelPosition}set labelPosition(t){this._element.labelPosition=t}onChange(t){this._element.addEventListener(i.events.CHANGE,({detail:e})=>t(e))}onFocus(t){this._element.addEventListener("focus",e=>t(e))}onBlur(t){this._element.addEventListener("blur",e=>t(e))}setLabel(t){this._element.innerText=t!=null?t:""}toggle(t){this._element.toggle(t)}_build(){return document.createElement(i.elementName)}_configure(){var t,e;(t=this._config.options)!=null&&t.id&&(this._element.id=this._config.options.id),(e=this._config.options)!=null&&e.label&&(this._element.innerText=this._config.options.label)}};function Mt(){m(r)}export{i as a,b,f as c,r as d,B as e,Mt as f};
7
+ //# sourceMappingURL=chunk.V6KUOCAR.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/switch/switch-constants.ts", "../../src/switch/switch-adapter.ts", "../../src/switch/switch-foundation.ts", "../../src/switch/switch.ts", "../../src/switch/switch-component-delegate.ts", "../../src/switch/index.ts"],
4
+ "sourcesContent": ["import { COMPONENT_NAME_PREFIX } from '../constants';\n\nconst elementName: keyof HTMLElementTagNameMap = `${COMPONENT_NAME_PREFIX}switch`;\n\nconst observedAttributes = {\n ON: 'on',\n SELECTED: 'selected',\n DEFAULT_ON: 'default-on',\n VALUE: 'value',\n DENSE: 'dense',\n DISABLED: 'disabled',\n REQUIRED: 'required',\n READONLY: 'readonly',\n ICON: 'icon',\n LABEL_POSITION: 'label-position',\n TABINDEX: 'tabindex'\n};\n\nconst attributes = {\n ...observedAttributes\n};\n\nconst classes = {\n HIDDEN: 'hidden'\n};\n\nconst selectors = {\n ROOT: '.forge-switch',\n LABEL: '#label',\n ICON_ON: '#icon-on',\n ICON_OFF: '#icon-off',\n STATE_LAYER: 'forge-state-layer'\n};\n\nconst events = {\n CHANGE: `${elementName}-change`\n};\n\nconst state = {\n ON: 'on',\n OFF: 'off'\n};\n\nexport const SWITCH_CONSTANTS = {\n attributes,\n observedAttributes,\n classes,\n selectors,\n elementName,\n events,\n state\n};\n\nexport type SwitchLabelPosition = 'start' | 'end';\nexport type SwitchIconVisibility = 'both' | 'none' | 'off' | 'on';\n", "import { getShadowElement, toggleClass } from '@tylertech/forge-core';\nimport { internals, isFocusable, setDefaultAria, setValidity } from '../constants';\nimport { BaseAdapter, IBaseAdapter } from '../core';\nimport { StateLayerComponent } from '../state-layer';\nimport { ISwitchComponent } from './switch';\nimport { SwitchIconVisibility, SwitchLabelPosition, SWITCH_CONSTANTS } from './switch-constants';\n\nexport interface ISwitchAdapter extends IBaseAdapter {\n setOn(value: boolean): void;\n setDisabled(value: boolean): void;\n setRequired(value: boolean): void;\n setReadonly(value: boolean): void;\n setIconVisibility(value: SwitchIconVisibility): void;\n setLabelPosition(value: SwitchLabelPosition): void;\n syncValue(value: string | null): void;\n}\n\nexport class SwitchAdapter extends BaseAdapter<ISwitchComponent> implements ISwitchAdapter {\n private readonly _rootElement: HTMLElement;\n private readonly _labelElement: HTMLElement;\n private readonly _iconOnElement: HTMLElement;\n private readonly _iconOffElement: HTMLElement;\n private readonly _stateLayerElement: StateLayerComponent;\n\n constructor(component: ISwitchComponent) {\n super(component);\n \n this._rootElement = getShadowElement(component, SWITCH_CONSTANTS.selectors.ROOT);\n this._labelElement = getShadowElement(component, SWITCH_CONSTANTS.selectors.LABEL);\n this._iconOnElement = getShadowElement(component, SWITCH_CONSTANTS.selectors.ICON_ON);\n this._iconOffElement = getShadowElement(component, SWITCH_CONSTANTS.selectors.ICON_OFF);\n this._stateLayerElement = getShadowElement(component, SWITCH_CONSTANTS.selectors.STATE_LAYER) as StateLayerComponent;\n }\n\n public setOn(value: boolean): void {\n this._component[setValidity]();\n this._component[setDefaultAria]({ ariaChecked: value ? 'true' : 'false' });\n }\n\n public setDisabled(value: boolean): void {\n this._component[isFocusable] = !value;\n this._component[setDefaultAria]({ ariaDisabled: value ? 'true' : 'false' });\n this._stateLayerElement.disabled = value;\n }\n\n public setRequired(value: boolean): void {\n this._component[setValidity]();\n this._component[setDefaultAria]({ ariaRequired: value ? 'true' : 'false' });\n }\n\n public setReadonly(value: boolean): void {\n this._component[setDefaultAria]({ ariaReadOnly: value ? 'true' : 'false' });\n this._stateLayerElement.disabled = value;\n }\n\n public setIconVisibility(value: SwitchIconVisibility): void {\n const hideOn = value === 'none' || value === 'off';\n const hideOff = value === 'none' || value === 'on';\n toggleClass(this._iconOnElement, hideOn, SWITCH_CONSTANTS.classes.HIDDEN);\n toggleClass(this._iconOffElement, hideOff, SWITCH_CONSTANTS.classes.HIDDEN);\n }\n\n public setLabelPosition(value: SwitchLabelPosition): void {\n this._labelElement.remove();\n\n if (value === 'start') {\n this._rootElement.prepend(this._labelElement);\n } else {\n this._rootElement.append(this._labelElement);\n }\n }\n\n public syncValue(value: string | null): void {\n const data = value ? new FormData() : null;\n const state = value ? SWITCH_CONSTANTS.state.ON : SWITCH_CONSTANTS.state.OFF;\n if (data && value) {\n data.append(this._component.name, value);\n }\n this._component.setFormValue(data, state);\n }\n}\n", "import { ICustomElementFoundation } from '@tylertech/forge-core';\n\nimport { ISwitchAdapter } from './switch-adapter';\nimport { SWITCH_CONSTANTS, SwitchIconVisibility, SwitchLabelPosition } from './switch-constants';\n\nexport interface ISwitchFoundation extends ICustomElementFoundation {\n on: boolean;\n defaultOn: boolean;\n value: string;\n dense: boolean;\n disabled: boolean;\n required: boolean;\n readonly: boolean;\n icon: SwitchIconVisibility;\n labelPosition: SwitchLabelPosition;\n}\n\nexport class SwitchFoundation implements ISwitchFoundation {\n // State\n private _on = false;\n private _defaultOn = false;\n private _value = 'on';\n private _dense = false;\n private _disabled = false;\n private _required = false;\n private _readonly = false;\n private _icon: SwitchIconVisibility = 'on';\n private _labelPosition: SwitchLabelPosition = 'end';\n\n private get _submittedValue(): string | null {\n return this._on ? this._value : null;\n }\n\n // Listeners\n private readonly _clickListener: EventListener = () => this._handleChange();\n private readonly _keydownListener: EventListener = (evt: KeyboardEvent) => this._handleKeydown(evt);\n private readonly _keyupListener: EventListener = (evt: KeyboardEvent) => this._handleKeyup(evt);\n\n constructor(private readonly _adapter: ISwitchAdapter) {}\n\n public initialize(): void {\n this._adapter.addHostListener('click', this._clickListener);\n this._adapter.addHostListener('keydown', this._keydownListener);\n this._adapter.addHostListener('keyup', this._keyupListener);\n this._adapter.setIconVisibility(this._icon);\n this._adapter.syncValue(this._submittedValue);\n }\n\n private _handleKeydown(evt: KeyboardEvent): void {\n if (evt.key === ' ') {\n evt.preventDefault();\n }\n }\n\n private _handleKeyup(evt: KeyboardEvent): void {\n if (evt.key === ' ') {\n this._handleChange();\n }\n }\n\n private _handleChange(): void {\n if (this._readonly) {\n return;\n }\n\n const oldValue = this._on;\n const newValue = !this._on;\n // Call the public setter to ensure all the update logic is run\n this.on = newValue;\n\n const event = new Event('change', { cancelable: true });\n const forgeEvent = new CustomEvent(SWITCH_CONSTANTS.events.CHANGE, { detail: newValue, bubbles: true, cancelable: true });\n this._adapter.dispatchHostEvent(event);\n this._adapter.dispatchHostEvent(forgeEvent);\n if (event.defaultPrevented || forgeEvent.defaultPrevented) {\n this.on = oldValue;\n return;\n }\n }\n\n private _setOnAttribute(): void {\n this._adapter.toggleHostAttribute(SWITCH_CONSTANTS.attributes.ON, this._on);\n // Also set selected for backwards compatibility\n this._adapter.toggleHostAttribute(SWITCH_CONSTANTS.attributes.SELECTED, this._on);\n }\n\n public get on(): boolean {\n return this._on;\n }\n public set on(value: boolean) {\n if (this._on !== value) {\n this._on = value;\n this._adapter.setOn(this._on);\n this._adapter.syncValue(this._submittedValue);\n this._setOnAttribute();\n }\n }\n\n public get defaultOn(): boolean {\n return this._defaultOn;\n }\n public set defaultOn(value: boolean) {\n if (this._defaultOn !== value) {\n this._defaultOn = value;\n this._adapter.toggleHostAttribute(SWITCH_CONSTANTS.attributes.DEFAULT_ON, this._defaultOn);\n }\n }\n\n public get value(): string {\n return this._value;\n }\n public set value(value: string) {\n if (this._value !== value) {\n this._value = value;\n this._adapter.syncValue(this._submittedValue);\n this._adapter.toggleHostAttribute(SWITCH_CONSTANTS.attributes.VALUE, true, this._value);\n }\n }\n\n public get dense(): boolean {\n return this._dense;\n }\n public set dense(value: boolean) {\n if (this._dense !== value) {\n this._dense = value;\n this._adapter.toggleHostAttribute(SWITCH_CONSTANTS.attributes.DENSE, this._dense);\n }\n }\n\n public get disabled(): boolean {\n return this._disabled;\n }\n public set disabled(value: boolean) {\n if (this._disabled !== value) {\n this._disabled = value;\n this._adapter.setDisabled(this._disabled);\n this._adapter.toggleHostAttribute(SWITCH_CONSTANTS.attributes.DISABLED, this._disabled);\n }\n }\n\n public get required(): boolean {\n return this._required;\n }\n public set required(value: boolean) {\n if (this._required !== value) {\n this._required = value;\n this._adapter.setRequired(this._required);\n this._adapter.toggleHostAttribute(SWITCH_CONSTANTS.attributes.REQUIRED, this._required);\n }\n }\n\n public get readonly(): boolean {\n return this._readonly;\n }\n public set readonly(value: boolean) {\n if (this._readonly !== value) {\n this._readonly = value;\n this._adapter.setReadonly(this._readonly);\n this._adapter.toggleHostAttribute(SWITCH_CONSTANTS.attributes.READONLY, this._readonly);\n }\n }\n\n public get icon(): SwitchIconVisibility {\n return this._icon;\n }\n public set icon(value: SwitchIconVisibility) {\n if (this._icon !== value) {\n this._icon = value;\n this._adapter.setIconVisibility(this._icon);\n this._adapter.setHostAttribute(SWITCH_CONSTANTS.attributes.ICON, this._icon);\n }\n }\n\n public get labelPosition(): SwitchLabelPosition {\n return this._labelPosition;\n }\n public set labelPosition(value: SwitchLabelPosition) {\n if (this._labelPosition !== value) {\n this._labelPosition = value;\n this._adapter.setLabelPosition(this._labelPosition);\n this._adapter.setHostAttribute(SWITCH_CONSTANTS.attributes.LABEL_POSITION, this._labelPosition);\n }\n }\n}\n", "import { attachShadowTemplate, coerceBoolean, CustomElement, FoundationProperty, isDefined, isString } from '@tylertech/forge-core';\nimport { getFormState, getFormValue, getValidationMessage, inputType, internals, setDefaultAria, setValidity } from '../constants';\nimport { BaseComponent, FormValue } from '../core';\nimport { IWithFocusable, WithFocusable } from '../core/mixins/focus/with-focusable';\nimport { IWithFormAssociation, WithFormAssociation } from '../core/mixins/form/with-form-associated';\nimport { IWithDefaultAria, WithDefaultAria } from '../core/mixins/internals/with-default-aria';\nimport { IWithElementInternals, WithElementInternals } from '../core/mixins/internals/with-element-internals';\nimport { IWithLabelAwareness, WithLabelAwareness } from '../core/mixins/label/with-label-aware';\nimport { FocusIndicatorComponent } from '../focus-indicator/focus-indicator';\nimport { StateLayerComponent } from '../state-layer/state-layer';\nimport { SwitchAdapter } from './switch-adapter';\nimport { SwitchIconVisibility, SwitchLabelPosition, SWITCH_CONSTANTS } from './switch-constants';\nimport { SwitchFoundation } from './switch-foundation';\n\nconst template = '<template><div class=\\\"forge-switch\\\" part=\\\"switch\\\"><div id=\\\"container\\\" class=\\\"container\\\"><div class=\\\"track\\\" part=\\\"track\\\"></div><div class=\\\"handle\\\" part=\\\"handle\\\"><div id=\\\"icon-off\\\" class=\\\"icon icon__off\\\" part=\\\"icon-off\\\"><slot name=\\\"icon-off\\\"><svg aria-hidden=\\\"true\\\" viewBox=\\\"0 0 24 24\\\"><path d=\\\"M20 13H4v-2h16v2z\\\"/></svg></slot></div><div id=\\\"icon-on\\\" class=\\\"icon icon__on\\\" part=\\\"icon-on\\\"><slot name=\\\"icon-on\\\"><svg aria-hidden=\\\"true\\\" viewBox=\\\"0 0 24 24\\\"><path d=\\\"M19.69,5.23L8.96,15.96l-4.23-4.23L2.96,13.5l6,6L21.46,7L19.69,5.23z\\\"/></svg></slot></div><forge-state-layer target=\\\":host\\\" exportparts=\\\"surface:state-layer\\\"></forge-state-layer></div><forge-focus-indicator target=\\\":host\\\" part=\\\"focus-indicator\\\"></forge-focus-indicator></div><label id=\\\"label\\\" class=\\\"label\\\" part=\\\"label\\\"><slot></slot></label></div></template>';\nconst styles = ':host{display:inline-block;outline:0;-webkit-tap-highlight-color:transparent}:host([hidden]){display:none}.forge-switch{--_switch-handle-size:var(--forge-switch-handle-size, 20px);--_switch-handle-scale:var(--forge-switch-handle-scale, 1);--_switch-handle-elevation:var(--forge-switch-handle-elevation, 0px 2px 1px -1px rgba(0, 0, 0, 0.2), 0px 1px 1px 0px rgba(0, 0, 0, 0.14), 0px 1px 3px 0px rgba(0, 0, 0, 0.12));--_switch-track-border-width:var(--forge-switch-track-border-width, 0);--_switch-track-border-color:var(--forge-switch-track-border-color, transparent);--_switch-icon-color:var(--forge-switch-icon-color, var(--forge-theme-on-tertiary, #ffffff));--_switch-icon-size:var(--forge-switch-icon-size, 16px);--_switch-icon-scale:var(--forge-switch-icon-scale, 1);--_switch-state-layer-size:var(--forge-switch-state-layer-size, 40px);--_switch-state-layer-dense-size:var(--forge-switch-state-layer-dense-size, 28px);--_switch-handle-on-color:var(--forge-switch-handle-on-color, var(--forge-theme-tertiary, #3d5afe));--_switch-handle-off-color:var(--forge-switch-handle-off-color, var(--forge-theme-surface-container-high, #9e9e9e));--_switch-handle-width:var(--forge-switch-handle-width, var(--_switch-handle-size));--_switch-handle-height:var(--forge-switch-handle-height, var(--_switch-handle-size));--_switch-handle-on-scale:var(--forge-switch-handle-on-scale, var(--_switch-handle-scale));--_switch-handle-off-scale:var(--forge-switch-handle-off-scale, var(--_switch-handle-scale));--_switch-handle-shape:var(--forge-switch-handle-shape, var(--forge-shape-round, 50%));--_switch-handle-on-elevation:var(--forge-switch-handle-on-elevation, var(--_switch-handle-elevation));--_switch-handle-off-elevation:var(--forge-switch-handle-off-elevation, var(--_switch-handle-elevation));--_switch-track-on-color:var(--forge-switch-track-on-color, var(--forge-theme-tertiary-container, #d0d7ff));--_switch-track-off-color:var(--forge-switch-track-off-color, var(--forge-theme-surface-container, #e0e0e0));--_switch-track-width:var(--forge-switch-track-width, 36px);--_switch-track-height:var(--forge-switch-track-height, 14px);--_switch-track-shape:var(--forge-switch-track-shape, var(--forge-shape-full, 9999px));--_switch-track-on-border-width:var(--forge-switch-track-on-border-width, var(--_switch-track-border-width));--_switch-track-off-border-width:var(--forge-switch-track-off-border-width, var(--_switch-track-border-width));--_switch-track-on-border-color:var(--forge-switch-track-on-border-color, var(--_switch-track-border-color));--_switch-track-off-border-color:var(--forge-switch-track-off-border-color, var(--_switch-track-border-color));--_switch-icon-on-color:var(--forge-switch-icon-on-color, var(--_switch-icon-color));--_switch-icon-off-color:var(--forge-switch-icon-off-color, var(--_switch-icon-color));--_switch-icon-on-size:var(--forge-switch-icon-on-size, var(--_switch-icon-size));--_switch-icon-off-size:var(--forge-switch-icon-off-size, var(--_switch-icon-size));--_switch-icon-on-scale:var(--forge-switch-icon-on-scale, var(--_switch-icon-scale));--_switch-icon-off-scale:var(--forge-switch-icon-off-scale, var(--_switch-icon-scale));--_switch-gap:var(--forge-switch-gap, 0);--_switch-justify:var(--forge-switch-justify, start);--_switch-direction:var(--forge-switch-direction, initial);--_switch-state-layer-width:var(--forge-switch-state-layer-width, var(--_switch-state-layer-size));--_switch-state-layer-height:var(--forge-switch-state-layer-height, var(--_switch-state-layer-size));--_switch-state-layer-on-color:var(--forge-switch-state-layer-on-color, var(--_switch-handle-on-color));--_switch-state-layer-off-color:var(--forge-switch-state-layer-off-color, var(--_switch-color));--_switch-state-layer-dense-width:var(--forge-switch-state-layer-dense-width, var(--_switch-state-layer-dense-size));--_switch-state-layer-dense-height:var(--forge-switch-state-layer-dense-height, var(--_switch-state-layer-dense-size));--_switch-disabled-opacity:var(--forge-switch-disabled-opacity, 0.38);--_switch-handle-active-on-color:var(--forge-switch-handle-active-on-color, var(--_switch-handle-on-color));--_switch-handle-active-off-color:var(--forge-switch-handle-active-off-color, var(--_switch-handle-off-color));--_switch-handle-active-scale:var(--forge-switch-handle-active-scale, 1.2);--_switch-handle-active-on-scale:var(--forge-switch-handle-active-on-scale, var(--_switch-handle-active-scale));--_switch-handle-active-off-scale:var(--forge-switch-handle-active-off-scale, var(--_switch-handle-active-scale));--_switch-handle-active-elevation:var(--forge-switch-handle-active-elevation, var(--_switch-handle-elevation));--_switch-handle-active-on-elevation:var(--forge-switch-handle-active-on-elevation, var(--_switch-handle-active-elevation));--_switch-handle-active-off-elevation:var(--forge-switch-handle-active-off-elevation, var(--_switch-handle-active-elevation));--_switch-track-active-on-color:var(--forge-switch-track-active-on-color, var(--_switch-track-on-color));--_switch-track-active-off-color:var(--forge-switch-track-active-off-color, var(--_switch-track-off-color));--_switch-track-active-on-border-width:var(--forge-switch-track-active-on-border-width, var(--_switch-track-on-border-width));--_switch-track-active-off-border-width:var(--forge-switch-track-active-off-border-width, var(--_switch-track-off-border-width));--_switch-track-active-on-border-color:var(--forge-switch-track-active-on-border-color, var(--_switch-track-on-border-color));--_switch-track-active-off-border-color:var(--forge-switch-track-active-off-border-color, var(--_switch-track-off-border-color));--_switch-icon-active-on-color:var(--forge-switch-icon-active-on-color, var(--_switch-icon-on-color));--_switch-icon-active-off-color:var(--forge-switch-icon-active-off-color, var(--_switch-icon-off-color));--_switch-icon-active-on-scale:var(--forge-switch-icon-active-on-scale, var(--_switch-icon-on-scale));--_switch-icon-active-off-scale:var(--forge-switch-icon-active-off-scale, var(--_switch-icon-off-scale));--_switch-animation-duration:var(--forge-switch-animation-duration, var(--forge-animation-duration-short2, 100ms));--_switch-animation-timing:var(--forge-switch-animation-timing, var(--forge-animation-easing-standard, cubic-bezier(0.2, 0, 0, 1)));--_switch-active-animation-timing:var(--forge-switch-active-animation-timing, var(--forge-animation-easing-linear, cubic-bezier(0, 0, 1, 1)))}.forge-switch{display:-webkit-box;display:flex;position:relative;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:var(--_switch-direction);flex-shrink:0;-webkit-box-align:center;align-items:center;-webkit-box-pack:var(--_switch-justify);justify-content:var(--_switch-justify);gap:var(--_switch-gap);--_switch-current-state-layer-width:var(--_switch-state-layer-width);--_switch-current-state-layer-height:var(--_switch-state-layer-height)}.forge-switch .container{position:relative;-webkit-box-align:center;align-items:center;display:-webkit-box;display:flex;block-size:max(var(--_switch-handle-height),var(--_switch-track-height),var(--_switch-current-state-layer-height));cursor:pointer}.forge-switch .input{position:absolute;z-index:1;-webkit-appearance:none;-moz-appearance:none;appearance:none;outline:0;margin:0;inline-size:100%;block-size:100%;cursor:unset}.forge-switch .track{-webkit-transition-property:background-color,border-color,border-width;transition-property:background-color,border-color,border-width;-webkit-transition-duration:var(--_switch-animation-duration);transition-duration:var(--_switch-animation-duration);-webkit-transition-timing-function:var(--_switch-animation-timing);transition-timing-function:var(--_switch-animation-timing);-webkit-box-sizing:border-box;box-sizing:border-box;margin-inline:calc(max(var(--_switch-handle-width),var(--_switch-current-state-layer-width))/ 2 - calc(var(--_switch-track-height)/ 2));border-width:var(--_switch-track-off-border-width);border-color:var(--_switch-track-off-border-color);border-style:solid;border-radius:var(--_switch-track-shape);inline-size:var(--_switch-track-width);block-size:var(--_switch-track-height);background-color:var(--_switch-track-off-color)}.forge-switch .handle{position:absolute;-webkit-box-pack:center;justify-content:center;-webkit-box-align:center;align-items:center;display:-webkit-box;display:flex;-webkit-transition-property:translate;transition-property:translate;-webkit-transition-duration:var(--_switch-animation-duration);transition-duration:var(--_switch-animation-duration);-webkit-transition-timing-function:var(--_switch-animation-timing);transition-timing-function:var(--_switch-animation-timing);border-radius:var(--_switch-handle-shape);inline-size:var(--_switch-current-state-layer-width);block-size:var(--_switch-current-state-layer-height)}.forge-switch .handle::before{content:\\\"\\\";position:relative;display:block;scale:var(--_switch-handle-off-scale);-webkit-transition:background-color var(--_switch-animation-duration) var(--_switch-animation-timing),scale var(--_switch-animation-duration) var(--_switch-active-animation-timing),-webkit-box-shadow var(--_switch-animation-duration) var(--_switch-animation-timing);transition:background-color var(--_switch-animation-duration) var(--_switch-animation-timing),scale var(--_switch-animation-duration) var(--_switch-active-animation-timing),-webkit-box-shadow var(--_switch-animation-duration) var(--_switch-animation-timing);transition:background-color var(--_switch-animation-duration) var(--_switch-animation-timing),box-shadow var(--_switch-animation-duration) var(--_switch-animation-timing),scale var(--_switch-animation-duration) var(--_switch-active-animation-timing);transition:background-color var(--_switch-animation-duration) var(--_switch-animation-timing),box-shadow var(--_switch-animation-duration) var(--_switch-animation-timing),scale var(--_switch-animation-duration) var(--_switch-active-animation-timing),-webkit-box-shadow var(--_switch-animation-duration) var(--_switch-animation-timing);-webkit-box-shadow:var(--_switch-handle-off-elevation);box-shadow:var(--_switch-handle-off-elevation);border-radius:var(--_switch-handle-shape);inline-size:var(--_switch-handle-width);block-size:var(--_switch-handle-height);background-color:var(--_switch-handle-off-color)}.forge-switch .icon{position:absolute;-webkit-box-align:center;align-items:center;-webkit-box-pack:center;justify-content:center;display:-webkit-box;display:flex;-webkit-transition-property:opacity,scale;transition-property:opacity,scale;-webkit-transition-duration:var(--_switch-animation-duration);transition-duration:var(--_switch-animation-duration);-webkit-transition-timing-function:var(--_switch-animation-timing);transition-timing-function:var(--_switch-animation-timing);inline-size:var(--_switch-icon-off-size);block-size:var(--_switch-icon-off-size);color:var(--_switch-icon-off-color);fill:var(--_switch-icon-off-color);font-size:var(--_switch-icon-off-size);--forge-icon-font-size:var(--_switch-icon-off-size)}.forge-switch .icon__on{--forge-icon-font-size:var(--_switch-icon-on-size);inline-size:var(--_switch-icon-on-size);block-size:var(--_switch-icon-on-size);color:var(--_switch-icon-on-color);fill:var(--_switch-icon-on-color);font-size:var(--_switch-icon-on-size);opacity:0;scale:0.4}.forge-switch .icon__off{opacity:1;scale:var(--_switch-icon-off-scale)}.forge-switch .label{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:var(--forge-typography-label1-font-family, var(--forge-typography-font-family, \\\"Roboto\\\", sans-serif));font-size:var(--forge-typography-label1-font-size, calc(var(--forge-typography-font-size, 1rem) * var(--forge-typography-label-font-size-scale, .75)));font-weight:var(--forge-typography-label1-font-weight,400);line-height:var(--forge-typography-label1-line-height, calc(var(--forge-typography-font-size, 1rem) * var(--forge-typography-label-line-height-scale, 1.25)));letter-spacing:var(--forge-typography-label1-letter-spacing, .0357142857em);text-transform:var(--forge-typography-label1-text-transform,inherit);-webkit-text-decoration:var(--forge-typography-label1-text-decoration,inherit);text-decoration:var(--forge-typography-label1-text-decoration,inherit)}.forge-switch .label:empty{display:none}.forge-switch .hidden{display:none}.forge-switch ::slotted([slot=input]){position:absolute;z-index:1;-webkit-appearance:none;-moz-appearance:none;appearance:none;outline:0;margin:0;inline-size:100%;block-size:100%;cursor:unset}:host([on]) .track{border-width:var(--_switch-track-on-border-width);border-color:var(--_switch-track-on-border-color);background-color:var(--_switch-track-on-color)}:host([on]) .handle{translate:calc(var(--_switch-track-width) - calc(var(--_switch-track-height)/ 2) * 2)}:host([on]) .handle::before{scale:var(--_switch-handle-on-scale);-webkit-box-shadow:var(--_switch-handle-on-elevation);box-shadow:var(--_switch-handle-on-elevation);background-color:var(--_switch-handle-on-color)}:host([on]) .handle .icon__on{opacity:1;scale:var(--_switch-icon-on-scale)}:host([on]) .handle .icon__off{opacity:0;scale:0.4}:host([on]) forge-state-layer{--forge-state-layer-color:var(--_switch-state-layer-on-color)}:host(:not([disabled]):not([readonly])) .forge-switch .container:active .track{border-width:var(--_switch-track-active-off-border-width);border-color:var(--_switch-track-active-off-border-color);background-color:var(--_switch-track-active-off-color)}:host(:not([disabled]):not([readonly])) .forge-switch .container:active .handle::before{scale:var(--_switch-handle-active-off-scale);-webkit-box-shadow:var(--_switch-handle-active-off-elevation);box-shadow:var(--_switch-handle-active-off-elevation);background-color:var(--_switch-handle-active-off-color)}:host(:not([disabled]):not([readonly])) .forge-switch .container:active .handle .icon{scale:var(--_switch-icon-active-off-scale);color:var(--_switch-icon-active-off-color);fill:var(--_switch-icon-active-off-color)}:host(:not([disabled]):not([readonly])[on]) .forge-switch .container:active .track{border-width:var(--_switch-track-active-on-border-width);border-color:var(--_switch-track-active-on-border-color);background-color:var(--_switch-track-active-on-color)}:host(:not([disabled]):not([readonly])[on]) .forge-switch .container:active .handle::before{scale:var(--_switch-handle-active-on-scale);-webkit-box-shadow:var(--_switch-handle-active-on-elevation);box-shadow:var(--_switch-handle-active-on-elevation);background-color:var(--_switch-handle-active-on-color)}:host(:not([disabled]):not([readonly])[on]) .forge-switch .container:active .handle .icon{scale:var(--_switch-icon-active-on-scale);color:var(--_switch-icon-active-on-color);fill:var(--_switch-icon-active-on-color)}:host([dense]) .forge-switch{--_switch-current-state-layer-width:var(--_switch-state-layer-dense-width);--_switch-current-state-layer-height:var(--_switch-state-layer-dense-height)}:host([disabled]) .forge-switch{opacity:var(--_switch-disabled-opacity)}:host([disabled]) .forge-switch .container{cursor:not-allowed}:host([disabled]) .forge-switch .handle::before{-webkit-box-shadow:none;box-shadow:none}:host([readonly]) .forge-switch .container{cursor:not-allowed}@media (prefers-reduced-motion){.switch{--_switch-animation-duration:var(--forge-switch-animation-duration, 0s)}}forge-state-layer{--forge-state-layer-color:var(--_switch-state-layer-off-color)}forge-focus-indicator{--forge-focus-indicator-shape:var(--_switch-track-shape);--forge-focus-indicator-outward-offset:0px}';\n\nexport interface ISwitchComponent extends IWithFormAssociation, IWithFocusable, IWithLabelAwareness, IWithElementInternals, IWithDefaultAria {\n value: string;\n on: boolean;\n /**\n * @deprecated use `on` instead\n */\n selected: boolean;\n defaultOn: boolean;\n required: boolean;\n dense: boolean;\n icon: SwitchIconVisibility;\n labelPosition: SwitchLabelPosition;\n toggle(force?: boolean): void;\n setFormValue(value: FormValue | null, state?: FormValue | null | undefined): void;\n [setValidity](): void;\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'forge-switch': ISwitchComponent;\n }\n\n interface HTMLElementEventMap {\n 'forge-switch-change': CustomEvent<boolean>;\n }\n}\n\nconst BaseSwitchClass = WithFormAssociation(WithLabelAwareness(WithFocusable(WithDefaultAria(WithElementInternals(BaseComponent)))));\n\n/**\n * @tag forge-switch\n * \n * @summary Switches toggle the state of a single setting on or off.\n * \n * @description\n * Use switches to:\n * - Toggle a single item on or off, on mobile and tablet\n * - Immediately activate or deactivate something\n * \n * @property {boolean} on - Whether the switch is on the on or off state.\n * @property {boolean} selected - Deprecated. Alias for `on`.\n * @property {boolean} defaultOn - Whether the switch is on or off by default.\n * @property {string} value - The value of the switch.\n * @property {boolean} dense - The density state.\n * @property {boolean} disabled - Controls if the switch is disabled.\n * @property {boolean} required = Controls if the switch is required.\n * @property {boolean} readonly - Controls if the switch is readonly.\n * @property {SwitchIconVisibility} icon - Controls the presence of the off and on icons.\n * @property {SwitchLabelPosition} labelPosition - Whether the label appears before or after the switch.\n * \n * @attribute {string} on - Controls whether the switch is in the on or off state.\n * @attribute {string} selected - Deprecated. Alias for `on`.\n * @attribute {string} default-on - Controls whether the switch is in the on or off state by default.\n * @attribute {string} value - The value of the switch.\n * @attribute {string} dense - Sets the density state.\n * @attribute {string} disabled - Controls if the switch is disabled.\n * @attribute {string} required - Controls if the switch is required.\n * @attribute {string} readonly - Controls if the switch is readonly.\n * @attribute {string} icon - Controls the presence of the off and on icons.\n * @attribute {string} label-position - Sets whether the label appears before or after the switch.\n * \n * @method {(force?: boolean) => void} toggle - Toggles whether the switch is selected or forces a selected state.\n * \n * @event {CustomEvent} forge-switch-change - Dispatches when the switch's value changes.\n * \n * @cssproperty --forge-theme-primary - The primary color of the switch.\n * @cssproperty --forge-theme-on-primary - The color of elements placed on top of the primary color (the handle icons for example).\n * @cssproperty --forge-switch-handle-on-color - The color of the handle in the switch's on state.\n * @cssproperty --forge-switch-handle-off-color - The color of the handle in the switch's off state.\n * @cssproperty --forge-switch-handle-active-on-color - The color of the handle when the switch is active (pressed) in its on state.\n * @cssproperty --forge-switch-handle-active-off-color - The color of the handle when the switch is active (pressed) in its off state.\n * @cssproperty --forge-switch-handle-size - The inline and block size of the handle.\n * @cssproperty --forge-switch-handle-width - The inline size of the handle.\n * @cssproperty --forge-switch-handle-height - The block size of the handle.\n * @cssproperty --forge-switch-handle-scale - The scale transformation applied to the handle.\n * @cssproperty --forge-switch-handle-on-scale - The scale transformation applied to the handle in the switch's on state.\n * @cssproperty --forge-switch-handle-off-scale - The scale transformation applied to the handle in the switch's off state.\n * @cssproperty --forge-switch-handle-active-scale - The scale transformation applied to the handle when the switch is active (pressed).\n * @cssproperty --forge-switch-handle-active-on-scale - The scale transformation applied to the handle when the switch is active (pressed) in its on state.\n * @cssproperty --forge-switch-handle-active-off-scale - The scale transformation applied to the handle when the switch is active (pressed) in its off state.\n * @cssproperty --forge-switch-handle-shape - The shape of the handle.\n * @cssproperty --forge-switch-handle-elevation - The handle's shadow.\n * @cssproperty --forge-switch-handle-on-elevation - The handle's shadow in the switch's on state.\n * @cssproperty --forge-switch-handle-off-elevation - The handle's shadow in the switch's off state.\n * @cssproperty --forge-switch-handle-active-elevation - The handle's shadow when the switch is active (pressed).\n * @cssproperty --forge-switch-handle-active-on-elevation - The handle's shadow when the switch is active (pressed) in its on state.\n * @cssproperty --forge-switch-handle-active-off-elevation - The handle's shadow when the switch is active (pressed) in its off state.\n * @cssproperty --forge-switch-track-on-color - The color of the track in the switch's on state.\n * @cssproperty --forge-switch-track-off-color - The color fo the track in the switch's off state.\n * @cssproperty --forge-switch-track-active-on-color - The color of the track when the switch is active (pressed) in its on state.\n * @cssproperty --forge-switch-track-active-off-color - The color fo the track when the switch is active (pressed) in its off state.\n * @cssproperty --forge-switch-track-width - The inline size of the track.\n * @cssproperty --forge-switch-track-height - The block size of the track.\n * @cssproperty --forge-switch-track-shape - The shape of the track.\n * @cssproperty --forge-switch-track-border-width - The width of the track border.\n * @cssproperty --forge-switch-track-on-border-width - The width of the track border in the switch's on state.\n * @cssproperty --forge-switch-track-off-border-width - The width of the track border in the switch's off state.\n * @cssproperty --forge-switch-track-active-on-border-width - The width of the track border when the switch is active (pressed) in its on state.\n * @cssproperty --forge-switch-track-active-off-border-width - The width of the track border when the switch is active (pressed) in its off state.\n * @cssproperty --forge-switch-track-border-color - The color of the track border.\n * @cssproperty --forge-switch-track-on-border-color - The color of the track border in the switch's on state.\n * @cssproperty --forge-switch-track-off-border-color - The color of the track border in the switch's off state.\n * @cssproperty --forge-switch-track-active-on-border-color - The color of the track border when the switch is active (pressed) in its on state.\n * @cssproperty --forge-switch-track-active-off-border-color - The color of the track border when the switch is active (pressed) in its off state.\n * @cssproperty --forge-switch-icon-color - The color of the handle icons.\n * @cssproperty --forge-switch-icon-on-color - The color of the handle icon in the switch's on state.\n * @cssproperty --forge-switch-icon-off-color - The color of the handle icon in the switch's off state.\n * @cssproperty --forge-switch-icon-active-on-color - The color of the handle icon when the switch is active (pressed) in its on state.\n * @cssproperty --forge-switch-icon-active-off-color - The color of the handle icon when the switch is active (pressed) in its off state.\n * @cssproperty --forge-switch-icon-size - The size of the handle icon.\n * @cssproperty --forge-switch-icon-on-size - The size of the handle icon in the switch's on state.\n * @cssproperty --forge-switch-icon-off-size - The size of the handle icon in the switch's off state.\n * @cssproperty --forge-switch-icon-scale - The scale transformation applied to the handle icons.\n * @cssproperty --forge-switch-icon-on-scale - The scale transformation applied to the handle icons in the switch's on state.\n * @cssproperty --forge-switch-icon-off-scale - The scale transformation applied to the handle icons in the switch's off state.\n * @cssproperty --forge-switch-icon-active-on-scale - The scale transformation applied to the handle icons when the switch is active (pressed) in its on state.\n * @cssproperty --forge-switch-icon-active-off-scale - The scale transformation applied to the handle icons when the switch is active (pressed) in its off state.\n * @cssproperty --forge-switch-gap - The space between the switch and label.\n * @cssproperty --forge-switch-justify - How the switch and label are distributed along their main axis.\n * @cssproperty --forge-switch-direction - Whether the switch and label are arranged along the inline or block axis.\n * @cssproperty --forge-switch-state-layer-size - The inline and block size of the handle's state layer.\n * @cssproperty --forge-switch-state-layer-width - The inline size of the handle's state layer.\n * @cssproperty --forge-switch-state-layer-height - The block size of the handle's state layer.\n * @cssproperty --forge-switch-state-layer-on-color - The color of the handle's state layer when the switch is in its on state.\n * @cssproperty --forge-switch-state-layer-off-color - The color of the handle's state layer when the switch is in its off state.\n * @cssproperty --forge-switch-state-layer-dense-size - The inline and block size of the handle's state layer when the dense switch is used.\n * @cssproperty --forge-switch-state-layer-dense-width - The inline size of the handle's state layer when the dense switch is used.\n * @cssproperty --forge-switch-state-layer-dense-height - The block size of the handle's state layer when the dense switch is used.\n * @cssproperty --forge-switch-disabled-opacity - The opacity of the switch when disabled.\n * @cssproperty --forge-switch-animation-duration - The duration of animations.\n * @cssproperty --forge-switch-animation-timing - The timing function used in most animations.\n * @cssproperty --forge-switch-active-animation-timing - The timing function used in active state animations.\n * \n * @csspart switch - Styles the switch container element.\n * @csspart track - Styles the track element.\n * @csspart handle - Styles the handle element.\n * @csspart icon-on - Styles the on icon element.\n * @csspart icon-off - Styles the off icon element.\n * @csspart label - Styles the label element.\n * @csspart state-layer - Styles the state layer root element.\n * @csspart focus-indicator - Styles the focus indicator root element.\n */\n@CustomElement({\n name: SWITCH_CONSTANTS.elementName,\n dependencies: [\n FocusIndicatorComponent,\n StateLayerComponent\n ]\n})\nexport class SwitchComponent extends BaseSwitchClass implements ISwitchComponent {\n public static get observedAttributes(): string[] {\n return Object.values(SWITCH_CONSTANTS.observedAttributes);\n }\n\n private readonly _foundation: SwitchFoundation;\n\n constructor() {\n super();\n attachShadowTemplate(this, template, styles);\n this[inputType] = 'checkbox';\n this._foundation = new SwitchFoundation(new SwitchAdapter(this));\n }\n\n public connectedCallback(): void {\n super.connectedCallback();\n this[setDefaultAria]({\n role: 'switch',\n ariaChecked: this.on ? 'true' : 'false',\n ariaDisabled: this.disabled ? 'true' : 'false',\n ariaRequired: this.required ? 'true' : 'false'\n });\n this._foundation.initialize();\n }\n\n public attributeChangedCallback(name: string, oldValue: string, newValue: string): void {\n switch (name) {\n case SWITCH_CONSTANTS.observedAttributes.ON:\n case SWITCH_CONSTANTS.observedAttributes.SELECTED:\n this.on = coerceBoolean(newValue);\n break;\n case SWITCH_CONSTANTS.observedAttributes.DEFAULT_ON:\n this.defaultOn = coerceBoolean(newValue);\n break;\n case SWITCH_CONSTANTS.observedAttributes.VALUE:\n this.value = newValue;\n break;\n case SWITCH_CONSTANTS.observedAttributes.DENSE:\n this.dense = coerceBoolean(newValue);\n break;\n case SWITCH_CONSTANTS.observedAttributes.DISABLED:\n this.disabled = coerceBoolean(newValue);\n break;\n case SWITCH_CONSTANTS.observedAttributes.REQUIRED:\n this.required = coerceBoolean(newValue);\n break;\n case SWITCH_CONSTANTS.observedAttributes.READONLY:\n this.readonly = coerceBoolean(newValue);\n break;\n case SWITCH_CONSTANTS.observedAttributes.ICON:\n this.icon = newValue as SwitchIconVisibility;\n break;\n case SWITCH_CONSTANTS.observedAttributes.LABEL_POSITION:\n this.labelPosition = newValue as SwitchLabelPosition;\n break;\n }\n super.attributeChangedCallback(name, oldValue, newValue);\n }\n\n public override [getFormValue](): FormValue | null {\n return this.on ? this.value : null;\n }\n\n public override [getFormState](): string {\n return this.on ? SWITCH_CONSTANTS.state.ON : SWITCH_CONSTANTS.state.OFF;\n }\n\n public [setValidity](): void {\n this[internals].setValidity({ valueMissing: this.required && !this.on }, this[getValidationMessage]({\n checked: this.on,\n required: this.required\n }));\n }\n\n public formResetCallback(): void {\n this.on = this.defaultOn;\n }\n\n public formStateRestoreCallback(state: string): void {\n this.on = state === SWITCH_CONSTANTS.state.ON;\n }\n\n public labelClickedCallback(): void {\n this.click();\n // TODO: use `{ focusVisible: false }` when supported.\n this.focus();\n }\n\n public labelChangedCallback(value: string | null): void {\n this[setDefaultAria]({ ariaLabel: value });\n }\n\n public setFormValue(value: FormValue | null, state?: FormValue | null | undefined): void {\n this[internals].setFormValue(value, state);\n\n if (state) {\n const stateValue = isString(state) ? state : state[this.name];\n this.on = stateValue === SWITCH_CONSTANTS.state.ON;\n return;\n }\n\n if (isString(value)) {\n this.on = !!value;\n } else if (value?.[this.name]) {\n this.on = !!value[this.name];\n } else {\n this.on = false;\n }\n }\n\n @FoundationProperty()\n public declare on: boolean;\n\n /**\n * @deprecated use `on` instead\n */\n @FoundationProperty({ name: 'on' })\n public declare selected: boolean;\n\n @FoundationProperty()\n public declare defaultOn: boolean;\n\n @FoundationProperty()\n public declare value: string;\n\n @FoundationProperty()\n public declare dense: boolean;\n\n @FoundationProperty()\n public declare disabled: boolean;\n\n @FoundationProperty()\n public declare required: boolean;\n\n @FoundationProperty()\n public declare readonly: boolean;\n\n @FoundationProperty()\n public declare icon: SwitchIconVisibility;\n\n @FoundationProperty()\n public declare labelPosition: SwitchLabelPosition;\n\n /**\n * Toggles the switch on or off.\n * @param force Whether to set the switch on or off.\n */\n public toggle(force?: boolean): void {\n if (isDefined(force)) {\n this._foundation.on = force as boolean;\n } else {\n this._foundation.on = !this._foundation.on;\n }\n }\n}\n", "import { FormFieldComponentDelegate, IFormFieldComponentDelegateOptions } from '../core';\nimport { IBaseComponentDelegateConfig } from '../core/delegates/base-component-delegate';\nimport { ISwitchComponent } from './switch';\nimport { SWITCH_CONSTANTS, SwitchIconVisibility, SwitchLabelPosition } from './switch-constants';\n\nexport type SwitchComponentDelegateProps = Partial<ISwitchComponent>;\nexport interface ISwitchComponentDelegateOptions extends IFormFieldComponentDelegateOptions {\n id?: string;\n label?: string;\n}\nexport interface ISwitchComponentDelegateConfig extends IBaseComponentDelegateConfig<ISwitchComponent, ISwitchComponentDelegateOptions> {}\n\nexport class SwitchComponentDelegate extends FormFieldComponentDelegate<ISwitchComponent, ISwitchComponentDelegateOptions> {\n constructor(config?: ISwitchComponentDelegateConfig) {\n super(config);\n }\n\n public get value(): string {\n return this._element.value;\n }\n public set value(value: string) {\n this._element.value = value;\n }\n\n public get on(): boolean {\n return this._element.on;\n }\n public set on(value: boolean) {\n this._element.on = value;\n }\n\n public get selected(): boolean {\n return this._element.selected;\n }\n public set selected(value: boolean) {\n this._element.selected = value;\n }\n\n public get defaultOn(): boolean {\n return this._element.defaultOn;\n }\n public set defaultOn(value: boolean) {\n this._element.defaultOn = value;\n }\n\n public get icon(): SwitchIconVisibility {\n return this._element.icon;\n }\n public set icon(value: SwitchIconVisibility) {\n this._element.icon = value;\n }\n\n public get disabled(): boolean {\n return this._element.disabled;\n }\n public set disabled(value: boolean) {\n this._element.disabled = value;\n }\n\n public get dense(): boolean {\n return this._element.dense;\n }\n public set dense(value: boolean) {\n this._element.dense = value;\n }\n\n public get required(): boolean {\n return this._element.required;\n }\n public set required(value: boolean) {\n this._element.required = value;\n }\n\n public get readonly(): boolean {\n return this._element.readonly;\n }\n public set readonly(value: boolean) {\n this._element.readonly = value;\n }\n\n public get name(): string {\n return this._element.name;\n }\n public set name(value: string) {\n this._element.name = value;\n }\n\n public get labelPosition(): SwitchLabelPosition {\n return this._element.labelPosition;\n }\n public set labelPosition(value: SwitchLabelPosition) {\n this._element.labelPosition = value;\n }\n\n public onChange(listener: (value: boolean) => void): void {\n this._element.addEventListener(SWITCH_CONSTANTS.events.CHANGE, ({ detail }: CustomEvent<boolean>) => listener(detail));\n }\n\n public onFocus(listener: (evt: Event) => void): void {\n this._element.addEventListener('focus', evt => listener(evt));\n }\n\n public onBlur(listener: (evt: Event) => void): void {\n this._element.addEventListener('blur', evt => listener(evt));\n }\n\n public setLabel(text: string | null): void {\n this._element.innerText = text ?? '';\n }\n\n public toggle(force?: boolean): void {\n this._element.toggle(force);\n }\n\n protected _build(): ISwitchComponent {\n return document.createElement(SWITCH_CONSTANTS.elementName);\n }\n\n protected override _configure(): void {\n if (this._config.options?.id) {\n this._element.id = this._config.options.id;\n }\n if (this._config.options?.label) {\n this._element.innerText = this._config.options.label;\n }\n }\n}\n", "import { defineCustomElement } from '@tylertech/forge-core';\n\nimport { SwitchComponent } from './switch';\n\nexport * from './switch-adapter';\nexport * from './switch-constants';\nexport * from './switch-foundation';\nexport * from './switch';\nexport * from './switch-component-delegate';\n\nexport function defineSwitchComponent(): void {\n defineCustomElement(SwitchComponent);\n}\n"],
5
+ "mappings": "gqBAEA,IAAMA,EAA2C,GAAGC,UAE9CC,EAAqB,CACzB,GAAI,KACJ,SAAU,WACV,WAAY,aACZ,MAAO,QACP,MAAO,QACP,SAAU,WACV,SAAU,WACV,SAAU,WACV,KAAM,OACN,eAAgB,iBAChB,SAAU,UACZ,EAEMC,EAAaC,EAAA,GACdF,GAGCG,EAAU,CACd,OAAQ,QACV,EAEMC,EAAY,CAChB,KAAM,gBACN,MAAO,SACP,QAAS,WACT,SAAU,YACV,YAAa,mBACf,EAEMC,EAAS,CACb,OAAQ,GAAGP,UACb,EAEMQ,EAAQ,CACZ,GAAI,KACJ,IAAK,KACP,EAEaC,EAAmB,CAC9B,WAAAN,EACA,mBAAAD,EACA,QAAAG,EACA,UAAAC,EACA,YAAAN,EACA,OAAAO,EACA,MAAAC,CACF,EClCO,IAAME,EAAN,cAA4BC,CAAwD,CAOzF,YAAYC,EAA6B,CACvC,MAAMA,CAAS,EAEf,KAAK,aAAeC,EAAiBD,EAAWE,EAAiB,UAAU,IAAI,EAC/E,KAAK,cAAgBD,EAAiBD,EAAWE,EAAiB,UAAU,KAAK,EACjF,KAAK,eAAiBD,EAAiBD,EAAWE,EAAiB,UAAU,OAAO,EACpF,KAAK,gBAAkBD,EAAiBD,EAAWE,EAAiB,UAAU,QAAQ,EACtF,KAAK,mBAAqBD,EAAiBD,EAAWE,EAAiB,UAAU,WAAW,CAC9F,CAEO,MAAMC,EAAsB,CACjC,KAAK,WAAWC,CAAW,EAAE,EAC7B,KAAK,WAAWC,CAAc,EAAE,CAAE,YAAaF,EAAQ,OAAS,OAAQ,CAAC,CAC3E,CAEO,YAAYA,EAAsB,CACvC,KAAK,WAAWG,CAAW,EAAI,CAACH,EAChC,KAAK,WAAWE,CAAc,EAAE,CAAE,aAAcF,EAAQ,OAAS,OAAQ,CAAC,EAC1E,KAAK,mBAAmB,SAAWA,CACrC,CAEO,YAAYA,EAAsB,CACvC,KAAK,WAAWC,CAAW,EAAE,EAC7B,KAAK,WAAWC,CAAc,EAAE,CAAE,aAAcF,EAAQ,OAAS,OAAQ,CAAC,CAC5E,CAEO,YAAYA,EAAsB,CACvC,KAAK,WAAWE,CAAc,EAAE,CAAE,aAAcF,EAAQ,OAAS,OAAQ,CAAC,EAC1E,KAAK,mBAAmB,SAAWA,CACrC,CAEO,kBAAkBA,EAAmC,CAC1D,IAAMI,EAASJ,IAAU,QAAUA,IAAU,MACvCK,EAAUL,IAAU,QAAUA,IAAU,KAC9CM,EAAY,KAAK,eAAgBF,EAAQL,EAAiB,QAAQ,MAAM,EACxEO,EAAY,KAAK,gBAAiBD,EAASN,EAAiB,QAAQ,MAAM,CAC5E,CAEO,iBAAiBC,EAAkC,CACxD,KAAK,cAAc,OAAO,EAEtBA,IAAU,QACZ,KAAK,aAAa,QAAQ,KAAK,aAAa,EAE5C,KAAK,aAAa,OAAO,KAAK,aAAa,CAE/C,CAEO,UAAUA,EAA4B,CAC3C,IAAMO,EAAOP,EAAQ,IAAI,SAAa,KAChCQ,EAAQR,EAAQD,EAAiB,MAAM,GAAKA,EAAiB,MAAM,IACrEQ,GAAQP,GACVO,EAAK,OAAO,KAAK,WAAW,KAAMP,CAAK,EAEzC,KAAK,WAAW,aAAaO,EAAMC,CAAK,CAC1C,CACF,EC/DO,IAAMC,EAAN,KAAoD,CAqBzD,YAA6BC,EAA0B,CAA1B,cAAAA,EAnB7B,KAAQ,IAAM,GACd,KAAQ,WAAa,GACrB,KAAQ,OAAS,KACjB,KAAQ,OAAS,GACjB,KAAQ,UAAY,GACpB,KAAQ,UAAY,GACpB,KAAQ,UAAY,GACpB,KAAQ,MAA8B,KACtC,KAAQ,eAAsC,MAO9C,KAAiB,eAAgC,IAAM,KAAK,cAAc,EAC1E,KAAiB,iBAAmCC,GAAuB,KAAK,eAAeA,CAAG,EAClG,KAAiB,eAAiCA,GAAuB,KAAK,aAAaA,CAAG,CAEtC,CATxD,IAAY,iBAAiC,CAC3C,OAAO,KAAK,IAAM,KAAK,OAAS,IAClC,CASO,YAAmB,CACxB,KAAK,SAAS,gBAAgB,QAAS,KAAK,cAAc,EAC1D,KAAK,SAAS,gBAAgB,UAAW,KAAK,gBAAgB,EAC9D,KAAK,SAAS,gBAAgB,QAAS,KAAK,cAAc,EAC1D,KAAK,SAAS,kBAAkB,KAAK,KAAK,EAC1C,KAAK,SAAS,UAAU,KAAK,eAAe,CAC9C,CAEQ,eAAeA,EAA0B,CAC3CA,EAAI,MAAQ,KACdA,EAAI,eAAe,CAEvB,CAEQ,aAAaA,EAA0B,CACzCA,EAAI,MAAQ,KACd,KAAK,cAAc,CAEvB,CAEQ,eAAsB,CAC5B,GAAI,KAAK,UACP,OAGF,IAAMC,EAAW,KAAK,IAChBC,EAAW,CAAC,KAAK,IAEvB,KAAK,GAAKA,EAEV,IAAMC,EAAQ,IAAI,MAAM,SAAU,CAAE,WAAY,EAAK,CAAC,EAChDC,EAAa,IAAI,YAAYC,EAAiB,OAAO,OAAQ,CAAE,OAAQH,EAAU,QAAS,GAAM,WAAY,EAAK,CAAC,EAGxH,GAFA,KAAK,SAAS,kBAAkBC,CAAK,EACrC,KAAK,SAAS,kBAAkBC,CAAU,EACtCD,EAAM,kBAAoBC,EAAW,iBAAkB,CACzD,KAAK,GAAKH,EACV,OAEJ,CAEQ,iBAAwB,CAC9B,KAAK,SAAS,oBAAoBI,EAAiB,WAAW,GAAI,KAAK,GAAG,EAE1E,KAAK,SAAS,oBAAoBA,EAAiB,WAAW,SAAU,KAAK,GAAG,CAClF,CAEA,IAAW,IAAc,CACvB,OAAO,KAAK,GACd,CACA,IAAW,GAAGC,EAAgB,CACxB,KAAK,MAAQA,IACf,KAAK,IAAMA,EACX,KAAK,SAAS,MAAM,KAAK,GAAG,EAC5B,KAAK,SAAS,UAAU,KAAK,eAAe,EAC5C,KAAK,gBAAgB,EAEzB,CAEA,IAAW,WAAqB,CAC9B,OAAO,KAAK,UACd,CACA,IAAW,UAAUA,EAAgB,CAC/B,KAAK,aAAeA,IACtB,KAAK,WAAaA,EAClB,KAAK,SAAS,oBAAoBD,EAAiB,WAAW,WAAY,KAAK,UAAU,EAE7F,CAEA,IAAW,OAAgB,CACzB,OAAO,KAAK,MACd,CACA,IAAW,MAAMC,EAAe,CAC1B,KAAK,SAAWA,IAClB,KAAK,OAASA,EACd,KAAK,SAAS,UAAU,KAAK,eAAe,EAC5C,KAAK,SAAS,oBAAoBD,EAAiB,WAAW,MAAO,GAAM,KAAK,MAAM,EAE1F,CAEA,IAAW,OAAiB,CAC1B,OAAO,KAAK,MACd,CACA,IAAW,MAAMC,EAAgB,CAC3B,KAAK,SAAWA,IAClB,KAAK,OAASA,EACd,KAAK,SAAS,oBAAoBD,EAAiB,WAAW,MAAO,KAAK,MAAM,EAEpF,CAEA,IAAW,UAAoB,CAC7B,OAAO,KAAK,SACd,CACA,IAAW,SAASC,EAAgB,CAC9B,KAAK,YAAcA,IACrB,KAAK,UAAYA,EACjB,KAAK,SAAS,YAAY,KAAK,SAAS,EACxC,KAAK,SAAS,oBAAoBD,EAAiB,WAAW,SAAU,KAAK,SAAS,EAE1F,CAEA,IAAW,UAAoB,CAC7B,OAAO,KAAK,SACd,CACA,IAAW,SAASC,EAAgB,CAC9B,KAAK,YAAcA,IACrB,KAAK,UAAYA,EACjB,KAAK,SAAS,YAAY,KAAK,SAAS,EACxC,KAAK,SAAS,oBAAoBD,EAAiB,WAAW,SAAU,KAAK,SAAS,EAE1F,CAEA,IAAW,UAAoB,CAC7B,OAAO,KAAK,SACd,CACA,IAAW,SAASC,EAAgB,CAC9B,KAAK,YAAcA,IACrB,KAAK,UAAYA,EACjB,KAAK,SAAS,YAAY,KAAK,SAAS,EACxC,KAAK,SAAS,oBAAoBD,EAAiB,WAAW,SAAU,KAAK,SAAS,EAE1F,CAEA,IAAW,MAA6B,CACtC,OAAO,KAAK,KACd,CACA,IAAW,KAAKC,EAA6B,CACvC,KAAK,QAAUA,IACjB,KAAK,MAAQA,EACb,KAAK,SAAS,kBAAkB,KAAK,KAAK,EAC1C,KAAK,SAAS,iBAAiBD,EAAiB,WAAW,KAAM,KAAK,KAAK,EAE/E,CAEA,IAAW,eAAqC,CAC9C,OAAO,KAAK,cACd,CACA,IAAW,cAAcC,EAA4B,CAC/C,KAAK,iBAAmBA,IAC1B,KAAK,eAAiBA,EACtB,KAAK,SAAS,iBAAiB,KAAK,cAAc,EAClD,KAAK,SAAS,iBAAiBD,EAAiB,WAAW,eAAgB,KAAK,cAAc,EAElG,CACF,ECzKA,IAAME,EAAW,qzBACXC,EAAS,oreA6BTC,EAAkBC,EAAoBC,EAAmBC,EAAcC,EAAgBC,EAAqBC,CAAa,CAAC,CAAC,CAAC,CAAC,EA0HtHC,EAAN,cAA8BP,CAA4C,CAO/E,aAAc,CACZ,MAAM,EACNQ,EAAqB,KAAMV,EAAUC,CAAM,EAC3C,KAAKU,CAAS,EAAI,WAClB,KAAK,YAAc,IAAIC,EAAiB,IAAIC,EAAc,IAAI,CAAC,CACjE,CAXA,WAAkB,oBAA+B,CAC/C,OAAO,OAAO,OAAOC,EAAiB,kBAAkB,CAC1D,CAWO,mBAA0B,CAC/B,MAAM,kBAAkB,EACxB,KAAKC,CAAc,EAAE,CACnB,KAAM,SACN,YAAa,KAAK,GAAK,OAAS,QAChC,aAAc,KAAK,SAAW,OAAS,QACvC,aAAc,KAAK,SAAW,OAAS,OACzC,CAAC,EACD,KAAK,YAAY,WAAW,CAC9B,CAEO,yBAAyBC,EAAcC,EAAkBC,EAAwB,CACtF,OAAQF,EAAM,CACZ,KAAKF,EAAiB,mBAAmB,GACzC,KAAKA,EAAiB,mBAAmB,SACvC,KAAK,GAAKK,EAAcD,CAAQ,EAChC,MACF,KAAKJ,EAAiB,mBAAmB,WACvC,KAAK,UAAYK,EAAcD,CAAQ,EACvC,MACF,KAAKJ,EAAiB,mBAAmB,MACvC,KAAK,MAAQI,EACb,MACF,KAAKJ,EAAiB,mBAAmB,MACvC,KAAK,MAAQK,EAAcD,CAAQ,EACnC,MACF,KAAKJ,EAAiB,mBAAmB,SACvC,KAAK,SAAWK,EAAcD,CAAQ,EACtC,MACF,KAAKJ,EAAiB,mBAAmB,SACvC,KAAK,SAAWK,EAAcD,CAAQ,EACtC,MACF,KAAKJ,EAAiB,mBAAmB,SACvC,KAAK,SAAWK,EAAcD,CAAQ,EACtC,MACF,KAAKJ,EAAiB,mBAAmB,KACvC,KAAK,KAAOI,EACZ,MACF,KAAKJ,EAAiB,mBAAmB,eACvC,KAAK,cAAgBI,EACrB,KACJ,CACA,MAAM,yBAAyBF,EAAMC,EAAUC,CAAQ,CACzD,CAEA,CAAiBE,CAAY,GAAsB,CACjD,OAAO,KAAK,GAAK,KAAK,MAAQ,IAChC,CAEA,CAAiBC,CAAY,GAAY,CACvC,OAAO,KAAK,GAAKP,EAAiB,MAAM,GAAKA,EAAiB,MAAM,GACtE,CAEA,CAAQQ,CAAW,GAAU,CAC3B,KAAKC,CAAS,EAAE,YAAY,CAAE,aAAc,KAAK,UAAY,CAAC,KAAK,EAAG,EAAG,KAAKC,CAAoB,EAAE,CAClG,QAAS,KAAK,GACd,SAAU,KAAK,QACjB,CAAC,CAAC,CACJ,CAEO,mBAA0B,CAC/B,KAAK,GAAK,KAAK,SACjB,CAEO,yBAAyBC,EAAqB,CACnD,KAAK,GAAKA,IAAUX,EAAiB,MAAM,EAC7C,CAEO,sBAA6B,CAClC,KAAK,MAAM,EAEX,KAAK,MAAM,CACb,CAEO,qBAAqBY,EAA4B,CACtD,KAAKX,CAAc,EAAE,CAAE,UAAWW,CAAM,CAAC,CAC3C,CAEO,aAAaA,EAAyBD,EAA4C,CAGvF,GAFA,KAAKF,CAAS,EAAE,aAAaG,EAAOD,CAAK,EAErCA,EAAO,CACT,IAAME,EAAaC,EAASH,CAAK,EAAIA,EAAQA,EAAM,KAAK,IAAI,EAC5D,KAAK,GAAKE,IAAeb,EAAiB,MAAM,GAChD,OAGEc,EAASF,CAAK,EAChB,KAAK,GAAK,CAAC,CAACA,EACHA,GAAA,MAAAA,EAAQ,KAAK,MACtB,KAAK,GAAK,CAAC,CAACA,EAAM,KAAK,IAAI,EAE3B,KAAK,GAAK,EAEd,CAuCO,OAAOG,EAAuB,CAC/BC,EAAUD,CAAK,EACjB,KAAK,YAAY,GAAKA,EAEtB,KAAK,YAAY,GAAK,CAAC,KAAK,YAAY,EAE5C,CACF,EA3CiBE,EAAA,CADdC,EAAmB,GA9GTvB,EA+GI,kBAMAsB,EAAA,CADdC,EAAmB,CAAE,KAAM,IAAK,CAAC,GApHvBvB,EAqHI,wBAGAsB,EAAA,CADdC,EAAmB,GAvHTvB,EAwHI,yBAGAsB,EAAA,CADdC,EAAmB,GA1HTvB,EA2HI,qBAGAsB,EAAA,CADdC,EAAmB,GA7HTvB,EA8HI,qBAGAsB,EAAA,CADdC,EAAmB,GAhITvB,EAiII,wBAGAsB,EAAA,CADdC,EAAmB,GAnITvB,EAoII,wBAGAsB,EAAA,CADdC,EAAmB,GAtITvB,EAuII,wBAGAsB,EAAA,CADdC,EAAmB,GAzITvB,EA0II,oBAGAsB,EAAA,CADdC,EAAmB,GA5ITvB,EA6II,6BA7IJA,EAANsB,EAAA,CAPNE,EAAc,CACb,KAAMnB,EAAiB,YACvB,aAAc,CACZoB,EACAC,CACF,CACF,CAAC,GACY1B,GC1JN,IAAM2B,EAAN,cAAsCC,CAA8E,CACzH,YAAYC,EAAyC,CACnD,MAAMA,CAAM,CACd,CAEA,IAAW,OAAgB,CACzB,OAAO,KAAK,SAAS,KACvB,CACA,IAAW,MAAMC,EAAe,CAC9B,KAAK,SAAS,MAAQA,CACxB,CAEA,IAAW,IAAc,CACvB,OAAO,KAAK,SAAS,EACvB,CACA,IAAW,GAAGA,EAAgB,CAC5B,KAAK,SAAS,GAAKA,CACrB,CAEA,IAAW,UAAoB,CAC7B,OAAO,KAAK,SAAS,QACvB,CACA,IAAW,SAASA,EAAgB,CAClC,KAAK,SAAS,SAAWA,CAC3B,CAEA,IAAW,WAAqB,CAC9B,OAAO,KAAK,SAAS,SACvB,CACA,IAAW,UAAUA,EAAgB,CACnC,KAAK,SAAS,UAAYA,CAC5B,CAEA,IAAW,MAA6B,CACtC,OAAO,KAAK,SAAS,IACvB,CACA,IAAW,KAAKA,EAA6B,CAC3C,KAAK,SAAS,KAAOA,CACvB,CAEA,IAAW,UAAoB,CAC7B,OAAO,KAAK,SAAS,QACvB,CACA,IAAW,SAASA,EAAgB,CAClC,KAAK,SAAS,SAAWA,CAC3B,CAEA,IAAW,OAAiB,CAC1B,OAAO,KAAK,SAAS,KACvB,CACA,IAAW,MAAMA,EAAgB,CAC/B,KAAK,SAAS,MAAQA,CACxB,CAEA,IAAW,UAAoB,CAC7B,OAAO,KAAK,SAAS,QACvB,CACA,IAAW,SAASA,EAAgB,CAClC,KAAK,SAAS,SAAWA,CAC3B,CAEA,IAAW,UAAoB,CAC7B,OAAO,KAAK,SAAS,QACvB,CACA,IAAW,SAASA,EAAgB,CAClC,KAAK,SAAS,SAAWA,CAC3B,CAEA,IAAW,MAAe,CACxB,OAAO,KAAK,SAAS,IACvB,CACA,IAAW,KAAKA,EAAe,CAC7B,KAAK,SAAS,KAAOA,CACvB,CAEA,IAAW,eAAqC,CAC9C,OAAO,KAAK,SAAS,aACvB,CACA,IAAW,cAAcA,EAA4B,CACnD,KAAK,SAAS,cAAgBA,CAChC,CAEO,SAASC,EAA0C,CACxD,KAAK,SAAS,iBAAiBC,EAAiB,OAAO,OAAQ,CAAC,CAAE,OAAAC,CAAO,IAA4BF,EAASE,CAAM,CAAC,CACvH,CAEO,QAAQF,EAAsC,CACnD,KAAK,SAAS,iBAAiB,QAASG,GAAOH,EAASG,CAAG,CAAC,CAC9D,CAEO,OAAOH,EAAsC,CAClD,KAAK,SAAS,iBAAiB,OAAQG,GAAOH,EAASG,CAAG,CAAC,CAC7D,CAEO,SAASC,EAA2B,CACzC,KAAK,SAAS,UAAYA,GAAA,KAAAA,EAAQ,EACpC,CAEO,OAAOC,EAAuB,CACnC,KAAK,SAAS,OAAOA,CAAK,CAC5B,CAEU,QAA2B,CACnC,OAAO,SAAS,cAAcJ,EAAiB,WAAW,CAC5D,CAEmB,YAAmB,CAtHxC,IAAAK,EAAAC,GAuHQD,EAAA,KAAK,QAAQ,UAAb,MAAAA,EAAsB,KACxB,KAAK,SAAS,GAAK,KAAK,QAAQ,QAAQ,KAEtCC,EAAA,KAAK,QAAQ,UAAb,MAAAA,EAAsB,QACxB,KAAK,SAAS,UAAY,KAAK,QAAQ,QAAQ,MAEnD,CACF,ECpHO,SAASC,IAA8B,CAC5CC,EAAoBC,CAAe,CACrC",
6
+ "names": ["elementName", "COMPONENT_NAME_PREFIX", "observedAttributes", "attributes", "__spreadValues", "classes", "selectors", "events", "state", "SWITCH_CONSTANTS", "SwitchAdapter", "BaseAdapter", "component", "getShadowElement", "SWITCH_CONSTANTS", "value", "setValidity", "setDefaultAria", "isFocusable", "hideOn", "hideOff", "toggleClass", "data", "state", "SwitchFoundation", "_adapter", "evt", "oldValue", "newValue", "event", "forgeEvent", "SWITCH_CONSTANTS", "value", "template", "styles", "BaseSwitchClass", "WithFormAssociation", "WithLabelAwareness", "WithFocusable", "WithDefaultAria", "WithElementInternals", "BaseComponent", "SwitchComponent", "attachShadowTemplate", "inputType", "SwitchFoundation", "SwitchAdapter", "SWITCH_CONSTANTS", "setDefaultAria", "name", "oldValue", "newValue", "coerceBoolean", "getFormValue", "getFormState", "setValidity", "internals", "getValidationMessage", "state", "value", "stateValue", "isString", "force", "isDefined", "__decorateClass", "FoundationProperty", "CustomElement", "FocusIndicatorComponent", "StateLayerComponent", "SwitchComponentDelegate", "FormFieldComponentDelegate", "config", "value", "listener", "SWITCH_CONSTANTS", "detail", "evt", "text", "force", "_a", "_b", "defineSwitchComponent", "defineCustomElement", "SwitchComponent"]
7
+ }