@tylertech/forge 3.0.0-next.4 → 3.0.0-next.5

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 (206) hide show
  1. package/custom-elements.json +673 -87
  2. package/dist/esm/app-bar/help-button/index.js +1 -1
  3. package/dist/esm/app-bar/index.js +1 -1
  4. package/dist/esm/app-bar/menu-button/index.js +1 -1
  5. package/dist/esm/app-bar/notification-button/index.js +1 -1
  6. package/dist/esm/app-bar/profile-button/index.js +1 -1
  7. package/dist/esm/autocomplete/index.js +1 -1
  8. package/dist/esm/banner/index.js +1 -1
  9. package/dist/esm/bottom-sheet/index.js +1 -1
  10. package/dist/esm/busy-indicator/index.js +1 -1
  11. package/dist/esm/button/index.js +1 -1
  12. package/dist/esm/button-toggle/button-toggle/index.js +1 -1
  13. package/dist/esm/button-toggle/button-toggle-group/index.js +1 -1
  14. package/dist/esm/button-toggle/index.js +1 -1
  15. package/dist/esm/calendar/index.js +1 -1
  16. package/dist/esm/checkbox/index.js +1 -1
  17. package/dist/esm/chip-field/index.js +1 -1
  18. package/dist/esm/chips/chip/index.js +1 -1
  19. package/dist/esm/chips/chip-set/index.js +1 -1
  20. package/dist/esm/chips/index.js +1 -1
  21. package/dist/esm/chunks/{chunk.T7KUZYQ3.js → chunk.2TVYAW7Q.js} +2 -2
  22. package/dist/esm/chunks/chunk.3SBF7CUU.js +201 -0
  23. package/dist/esm/chunks/{chunk.UHTQGET5.js.map → chunk.3SBF7CUU.js.map} +1 -1
  24. package/dist/esm/chunks/{chunk.N2XJHAD4.js → chunk.3W2ERIMT.js} +2 -2
  25. package/dist/esm/chunks/{chunk.H5MJBEK5.js → chunk.3XZRUXG7.js} +2 -2
  26. package/dist/esm/chunks/{chunk.HNSUYOCY.js → chunk.4NV7AHF2.js} +2 -2
  27. package/dist/esm/chunks/{chunk.3QD73Z4F.js → chunk.64F24XMH.js} +2 -2
  28. package/dist/esm/chunks/{chunk.56D6S5XJ.js → chunk.7BNQYL2F.js} +2 -2
  29. package/dist/esm/chunks/{chunk.3GZF7UI2.js → chunk.7JBR7GWZ.js} +2 -2
  30. package/dist/esm/chunks/{chunk.NRXPO3SY.js → chunk.7UN5EYUE.js} +2 -2
  31. package/dist/esm/chunks/{chunk.BBNRKEP4.js → chunk.7X7A74SI.js} +2 -2
  32. package/dist/esm/chunks/{chunk.BSKIHRND.js → chunk.A5D7XSBD.js} +2 -2
  33. package/dist/esm/chunks/{chunk.YM6VAIY2.js → chunk.ABN3DL7G.js} +2 -2
  34. package/dist/esm/chunks/chunk.AY46N5Y7.js +129 -0
  35. package/dist/esm/chunks/{chunk.ADXALX5F.js.map → chunk.AY46N5Y7.js.map} +1 -1
  36. package/dist/esm/chunks/{chunk.SCQVDO5I.js → chunk.BPEGGZOR.js} +2 -2
  37. package/dist/esm/chunks/{chunk.7IP3XTE3.js → chunk.C4YKXXKM.js} +2 -2
  38. package/dist/esm/chunks/{chunk.465MOF4A.js → chunk.DX32NTD3.js} +2 -2
  39. package/dist/esm/chunks/{chunk.PJOH4JKH.js → chunk.ELY4YCON.js} +2 -2
  40. package/dist/esm/chunks/{chunk.CY7UCG25.js → chunk.EUNKM7XR.js} +2 -2
  41. package/dist/esm/chunks/{chunk.FXUXL3D2.js → chunk.EWEX3PHR.js} +2 -2
  42. package/dist/esm/chunks/{chunk.FXUXL3D2.js.map → chunk.EWEX3PHR.js.map} +1 -1
  43. package/dist/esm/chunks/{chunk.A2BJ47Q6.js → chunk.FF5DED5D.js} +2 -2
  44. package/dist/esm/chunks/{chunk.A2BJ47Q6.js.map → chunk.FF5DED5D.js.map} +3 -3
  45. package/dist/esm/chunks/{chunk.6TTJYO62.js → chunk.FPMQAUL3.js} +2 -2
  46. package/dist/esm/chunks/{chunk.QWKDOAOE.js → chunk.FZ43DC2H.js} +2 -2
  47. package/dist/esm/chunks/{chunk.BSNL353K.js → chunk.GOZVC3ZT.js} +2 -2
  48. package/dist/esm/chunks/{chunk.LHFZFVHB.js → chunk.HSXUQFHK.js} +2 -2
  49. package/dist/esm/chunks/{chunk.G3ZS3UHM.js → chunk.IGOGRMRW.js} +1 -1
  50. package/dist/esm/chunks/chunk.IGOGRMRW.js.map +7 -0
  51. package/dist/esm/chunks/{chunk.TLRRYVSN.js → chunk.IMRPJU4M.js} +2 -2
  52. package/dist/esm/chunks/{chunk.ELENDYRJ.js → chunk.JKEIP657.js} +2 -2
  53. package/dist/esm/chunks/{chunk.423SNVSH.js → chunk.KI5FPZOX.js} +2 -2
  54. package/dist/esm/chunks/{chunk.6IWW463U.js → chunk.KTPSDP4C.js} +2 -2
  55. package/dist/esm/chunks/{chunk.QA3Z44IQ.js → chunk.P4TIMZKU.js} +2 -2
  56. package/dist/esm/chunks/{chunk.4B3BP62N.js → chunk.P64BBB3U.js} +2 -2
  57. package/dist/esm/chunks/{chunk.GZ2QNJ5E.js → chunk.P6ZUHPI6.js} +2 -2
  58. package/dist/esm/chunks/{chunk.QMYJCNVD.js → chunk.PNDQ3LAB.js} +2 -2
  59. package/dist/esm/chunks/{chunk.6BBI2QGA.js → chunk.RHPJRCIC.js} +2 -2
  60. package/dist/esm/chunks/chunk.RPKVFFQ6.js +12 -0
  61. package/dist/esm/chunks/chunk.RPKVFFQ6.js.map +7 -0
  62. package/dist/esm/chunks/{chunk.L3N7P4YQ.js → chunk.RVUMHJMM.js} +2 -2
  63. package/dist/esm/chunks/chunk.SKEI7ZSK.js +153 -0
  64. package/dist/esm/chunks/chunk.SKEI7ZSK.js.map +7 -0
  65. package/dist/esm/chunks/{chunk.YYXEUR4Y.js → chunk.SOMT6F6S.js} +2 -2
  66. package/dist/esm/chunks/{chunk.JUIFPTRV.js → chunk.SSJYPH4U.js} +2 -2
  67. package/dist/esm/chunks/{chunk.HHC5NEUF.js → chunk.TFMOLR6W.js} +2 -2
  68. package/dist/esm/chunks/{chunk.N64ASFPE.js → chunk.U4CFRHOW.js} +2 -2
  69. package/dist/esm/chunks/{chunk.4UHXQAOT.js → chunk.UEN7B7Q4.js} +2 -2
  70. package/dist/esm/chunks/chunk.UETV4PTS.js +12 -0
  71. package/dist/esm/chunks/{chunk.RHZ35R2V.js → chunk.VJ2SSV5X.js} +2 -2
  72. package/dist/esm/chunks/{chunk.KFERUCAD.js → chunk.VMQZA47V.js} +2 -2
  73. package/dist/esm/chunks/{chunk.SA7OL5US.js → chunk.VUGNSK4K.js} +2 -2
  74. package/dist/esm/chunks/{chunk.3VZGVF2G.js → chunk.WQL55O4A.js} +2 -2
  75. package/dist/esm/chunks/{chunk.6HMCSEKV.js → chunk.X63F5NVD.js} +2 -2
  76. package/dist/esm/chunks/{chunk.4DJEZHRT.js → chunk.XARGY3WT.js} +2 -2
  77. package/dist/esm/chunks/{chunk.Q6ELPSPD.js → chunk.XBW6KSW3.js} +2 -2
  78. package/dist/esm/chunks/{chunk.TG4ZRHKV.js → chunk.Y4OET6II.js} +2 -2
  79. package/dist/esm/chunks/{chunk.XCNL2LI6.js → chunk.YNE75HFH.js} +2 -2
  80. package/dist/esm/chunks/chunk.YSFUL5AD.js +177 -0
  81. package/dist/esm/chunks/chunk.YSFUL5AD.js.map +7 -0
  82. package/dist/esm/chunks/{chunk.4RNNHXMU.js → chunk.ZOV2BUZG.js} +2 -2
  83. package/dist/esm/chunks/{chunk.VXOI3G7C.js → chunk.ZXPAXZCF.js} +2 -2
  84. package/dist/esm/circular-progress/index.js +1 -1
  85. package/dist/esm/color-picker/index.js +1 -1
  86. package/dist/esm/date-picker/index.js +1 -1
  87. package/dist/esm/date-range-picker/index.js +1 -1
  88. package/dist/esm/file-picker/index.js +1 -1
  89. package/dist/esm/floating-action-button/index.js +1 -1
  90. package/dist/esm/icon-button/index.js +1 -1
  91. package/dist/esm/index.js +1 -1
  92. package/dist/esm/linear-progress/index.js +1 -1
  93. package/dist/esm/list/index.js +1 -1
  94. package/dist/esm/list/list/index.js +1 -1
  95. package/dist/esm/list/list-item/index.js +1 -1
  96. package/dist/esm/list-dropdown/index.js +1 -1
  97. package/dist/esm/menu/index.js +1 -1
  98. package/dist/esm/paginator/index.js +1 -1
  99. package/dist/esm/profile-card/index.js +1 -1
  100. package/dist/esm/quantity-field/index.js +1 -1
  101. package/dist/esm/radio/index.js +1 -1
  102. package/dist/esm/ripple/index.js +1 -1
  103. package/dist/esm/select/core/index.js +1 -1
  104. package/dist/esm/select/index.js +1 -1
  105. package/dist/esm/select/select/index.js +1 -1
  106. package/dist/esm/select/select-dropdown/index.js +1 -1
  107. package/dist/esm/slider/index.js +1 -1
  108. package/dist/esm/split-view/index.js +1 -1
  109. package/dist/esm/split-view/split-view/index.js +1 -1
  110. package/dist/esm/split-view/split-view-panel/index.js +1 -1
  111. package/dist/esm/stepper/index.js +1 -1
  112. package/dist/esm/stepper/step/index.js +1 -1
  113. package/dist/esm/stepper/stepper/index.js +1 -1
  114. package/dist/esm/switch/index.js +1 -1
  115. package/dist/esm/table/index.js +1 -1
  116. package/dist/esm/tabs/index.js +1 -1
  117. package/dist/esm/tabs/tab/index.js +1 -1
  118. package/dist/esm/tabs/tab-bar/index.js +1 -1
  119. package/dist/esm/time-picker/index.js +1 -1
  120. package/dist/esm/toast/index.js +1 -1
  121. package/dist/forge-dark.css +1 -1
  122. package/esm/circular-progress/circular-progress-adapter.d.ts +1 -1
  123. package/esm/linear-progress/linear-progress-adapter.d.ts +23 -0
  124. package/esm/linear-progress/linear-progress-adapter.js +34 -0
  125. package/esm/linear-progress/linear-progress-constants.d.ts +6 -2
  126. package/esm/linear-progress/linear-progress-constants.js +8 -3
  127. package/esm/linear-progress/linear-progress-foundation.d.ts +26 -0
  128. package/esm/linear-progress/linear-progress-foundation.js +53 -0
  129. package/esm/linear-progress/linear-progress.d.ts +27 -25
  130. package/esm/linear-progress/linear-progress.js +41 -104
  131. package/esm/list-dropdown/list-dropdown-adapter.js +3 -4
  132. package/esm/split-view/split-view-panel/split-view-panel.js +1 -1
  133. package/package.json +1 -2
  134. package/styles/circular-progress/_mixins.scss +13 -0
  135. package/styles/circular-progress/_variables.scss +12 -0
  136. package/styles/circular-progress/circular-progress.scss +1 -2
  137. package/styles/core/style-layer/circular-progress/_animations.scss +5 -0
  138. package/styles/core/style-layer/circular-progress/_core.scss +5 -0
  139. package/styles/core/style-layer/linear-progress/_animations.scss +131 -0
  140. package/styles/core/style-layer/linear-progress/_core.scss +125 -0
  141. package/styles/core/style-layer/linear-progress/_variables.scss +15 -0
  142. package/styles/core/style-layer/linear-progress/index.scss +145 -0
  143. package/styles/linear-progress/_mixins.scss +18 -1
  144. package/styles/linear-progress/_variables.scss +8 -7
  145. package/styles/linear-progress/linear-progress.scss +3 -27
  146. package/dist/esm/chunks/chunk.ADXALX5F.js +0 -129
  147. package/dist/esm/chunks/chunk.G3ZS3UHM.js.map +0 -7
  148. package/dist/esm/chunks/chunk.MLXGGGER.js +0 -129
  149. package/dist/esm/chunks/chunk.MLXGGGER.js.map +0 -7
  150. package/dist/esm/chunks/chunk.NVHTEFBA.js +0 -33
  151. package/dist/esm/chunks/chunk.NVHTEFBA.js.map +0 -7
  152. package/dist/esm/chunks/chunk.PTQTIY7L.js +0 -57
  153. package/dist/esm/chunks/chunk.PTQTIY7L.js.map +0 -7
  154. package/dist/esm/chunks/chunk.Q56WQPYG.js +0 -81
  155. package/dist/esm/chunks/chunk.Q56WQPYG.js.map +0 -7
  156. package/dist/esm/chunks/chunk.R2E6CGZE.js +0 -129
  157. package/dist/esm/chunks/chunk.R2E6CGZE.js.map +0 -7
  158. package/dist/esm/chunks/chunk.UHTQGET5.js +0 -201
  159. package/dist/esm/chunks/chunk.YHDUES7I.js +0 -12
  160. /package/dist/esm/chunks/{chunk.T7KUZYQ3.js.map → chunk.2TVYAW7Q.js.map} +0 -0
  161. /package/dist/esm/chunks/{chunk.N2XJHAD4.js.map → chunk.3W2ERIMT.js.map} +0 -0
  162. /package/dist/esm/chunks/{chunk.H5MJBEK5.js.map → chunk.3XZRUXG7.js.map} +0 -0
  163. /package/dist/esm/chunks/{chunk.HNSUYOCY.js.map → chunk.4NV7AHF2.js.map} +0 -0
  164. /package/dist/esm/chunks/{chunk.3QD73Z4F.js.map → chunk.64F24XMH.js.map} +0 -0
  165. /package/dist/esm/chunks/{chunk.56D6S5XJ.js.map → chunk.7BNQYL2F.js.map} +0 -0
  166. /package/dist/esm/chunks/{chunk.3GZF7UI2.js.map → chunk.7JBR7GWZ.js.map} +0 -0
  167. /package/dist/esm/chunks/{chunk.NRXPO3SY.js.map → chunk.7UN5EYUE.js.map} +0 -0
  168. /package/dist/esm/chunks/{chunk.BBNRKEP4.js.map → chunk.7X7A74SI.js.map} +0 -0
  169. /package/dist/esm/chunks/{chunk.BSKIHRND.js.map → chunk.A5D7XSBD.js.map} +0 -0
  170. /package/dist/esm/chunks/{chunk.YM6VAIY2.js.map → chunk.ABN3DL7G.js.map} +0 -0
  171. /package/dist/esm/chunks/{chunk.SCQVDO5I.js.map → chunk.BPEGGZOR.js.map} +0 -0
  172. /package/dist/esm/chunks/{chunk.7IP3XTE3.js.map → chunk.C4YKXXKM.js.map} +0 -0
  173. /package/dist/esm/chunks/{chunk.465MOF4A.js.map → chunk.DX32NTD3.js.map} +0 -0
  174. /package/dist/esm/chunks/{chunk.PJOH4JKH.js.map → chunk.ELY4YCON.js.map} +0 -0
  175. /package/dist/esm/chunks/{chunk.CY7UCG25.js.map → chunk.EUNKM7XR.js.map} +0 -0
  176. /package/dist/esm/chunks/{chunk.6TTJYO62.js.map → chunk.FPMQAUL3.js.map} +0 -0
  177. /package/dist/esm/chunks/{chunk.QWKDOAOE.js.map → chunk.FZ43DC2H.js.map} +0 -0
  178. /package/dist/esm/chunks/{chunk.BSNL353K.js.map → chunk.GOZVC3ZT.js.map} +0 -0
  179. /package/dist/esm/chunks/{chunk.LHFZFVHB.js.map → chunk.HSXUQFHK.js.map} +0 -0
  180. /package/dist/esm/chunks/{chunk.TLRRYVSN.js.map → chunk.IMRPJU4M.js.map} +0 -0
  181. /package/dist/esm/chunks/{chunk.ELENDYRJ.js.map → chunk.JKEIP657.js.map} +0 -0
  182. /package/dist/esm/chunks/{chunk.423SNVSH.js.map → chunk.KI5FPZOX.js.map} +0 -0
  183. /package/dist/esm/chunks/{chunk.6IWW463U.js.map → chunk.KTPSDP4C.js.map} +0 -0
  184. /package/dist/esm/chunks/{chunk.QA3Z44IQ.js.map → chunk.P4TIMZKU.js.map} +0 -0
  185. /package/dist/esm/chunks/{chunk.4B3BP62N.js.map → chunk.P64BBB3U.js.map} +0 -0
  186. /package/dist/esm/chunks/{chunk.GZ2QNJ5E.js.map → chunk.P6ZUHPI6.js.map} +0 -0
  187. /package/dist/esm/chunks/{chunk.QMYJCNVD.js.map → chunk.PNDQ3LAB.js.map} +0 -0
  188. /package/dist/esm/chunks/{chunk.6BBI2QGA.js.map → chunk.RHPJRCIC.js.map} +0 -0
  189. /package/dist/esm/chunks/{chunk.L3N7P4YQ.js.map → chunk.RVUMHJMM.js.map} +0 -0
  190. /package/dist/esm/chunks/{chunk.YYXEUR4Y.js.map → chunk.SOMT6F6S.js.map} +0 -0
  191. /package/dist/esm/chunks/{chunk.JUIFPTRV.js.map → chunk.SSJYPH4U.js.map} +0 -0
  192. /package/dist/esm/chunks/{chunk.HHC5NEUF.js.map → chunk.TFMOLR6W.js.map} +0 -0
  193. /package/dist/esm/chunks/{chunk.N64ASFPE.js.map → chunk.U4CFRHOW.js.map} +0 -0
  194. /package/dist/esm/chunks/{chunk.4UHXQAOT.js.map → chunk.UEN7B7Q4.js.map} +0 -0
  195. /package/dist/esm/chunks/{chunk.YHDUES7I.js.map → chunk.UETV4PTS.js.map} +0 -0
  196. /package/dist/esm/chunks/{chunk.RHZ35R2V.js.map → chunk.VJ2SSV5X.js.map} +0 -0
  197. /package/dist/esm/chunks/{chunk.KFERUCAD.js.map → chunk.VMQZA47V.js.map} +0 -0
  198. /package/dist/esm/chunks/{chunk.SA7OL5US.js.map → chunk.VUGNSK4K.js.map} +0 -0
  199. /package/dist/esm/chunks/{chunk.3VZGVF2G.js.map → chunk.WQL55O4A.js.map} +0 -0
  200. /package/dist/esm/chunks/{chunk.6HMCSEKV.js.map → chunk.X63F5NVD.js.map} +0 -0
  201. /package/dist/esm/chunks/{chunk.4DJEZHRT.js.map → chunk.XARGY3WT.js.map} +0 -0
  202. /package/dist/esm/chunks/{chunk.Q6ELPSPD.js.map → chunk.XBW6KSW3.js.map} +0 -0
  203. /package/dist/esm/chunks/{chunk.TG4ZRHKV.js.map → chunk.Y4OET6II.js.map} +0 -0
  204. /package/dist/esm/chunks/{chunk.XCNL2LI6.js.map → chunk.YNE75HFH.js.map} +0 -0
  205. /package/dist/esm/chunks/{chunk.4RNNHXMU.js.map → chunk.ZOV2BUZG.js.map} +0 -0
  206. /package/dist/esm/chunks/{chunk.VXOI3G7C.js.map → chunk.ZXPAXZCF.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 y}from"./chunk.6TTJYO62.js";import{b as Q}from"./chunk.5MPUISW3.js";import{a as ie}from"./chunk.T7KUZYQ3.js";import{h as ae,i as ue}from"./chunk.A2BJ47Q6.js";import{b as Z}from"./chunk.Q56WQPYG.js";import{a as F,e as oe}from"./chunk.FHW6LV4A.js";import{c as te}from"./chunk.LHFZFVHB.js";import{e as ee}from"./chunk.QWKDOAOE.js";import{b as ne}from"./chunk.7KEUUHXY.js";import{c as le}from"./chunk.A6RLV2QU.js";import{a as re,b as pe}from"./chunk.YTOYNJMD.js";import{a as se}from"./chunk.GO5A4GKZ.js";import{a as L}from"./chunk.MGLWXAZO.js";import{c as V,g as q,h as z}from"./chunk.MZLPUI6R.js";import{d as X,l as J,m as j}from"./chunk.T64UW37U.js";import{a as Y}from"./chunk.WDTA5G7R.js";import{a as $}from"./chunk.G4IN6Y46.js";import{a}from"./chunk.NVUMRW44.js";import{a as G}from"./chunk.TKDMM2ZZ.js";import{a as R,b as K,c as W}from"./chunk.55FCNVG5.js";import{a as U,e as H,g as C}from"./chunk.QH2GB3PD.js";import{m as M,r as N,s as k,u as A}from"./chunk.CFDK4RCW.js";import{a as x,b as h,c as S,j as w,k as g,l as P,n as D,o as B}from"./chunk.J2M2MXP2.js";import{a as T,d as p}from"./chunk.M3QDAYD2.js";var O=`${K}autocomplete`,fe={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"},ve={INPUT:se.selectors.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]"},ge={DEFAULT_DEBOUNCE_TIME:500,NUM_SKELETON_ITEMS:3},be={CHANGE:`${O}-change`,SELECT:`${O}-select`,SCROLLED_BOTTOM:`${O}-scrolled-bottom`},o={elementName:O,attributes:fe,selectors:ve,numbers:ge,events:be},de=(e=>(e.Default="default",e.Stateless="stateless",e))(de||{});var I=class extends G{constructor(e){super(e);this.setInputElement()}setInputElement(){let e=N(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(y.elementName)}show(e,t){this._targetElement=this._getTargetElement(t),this._targetElement&&(this._listDropdown=new ae(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))}hide(e){if(!this._listDropdown)return;let{targetElement:t}=this._listDropdown.dropdownElement;t.removeEventListener(F.events.BLUR,e),this.setBusyVisibility(!1),this._tryToggleDropdownIconRotation(!1),this._inputElement.removeAttribute("aria-activedescendant"),this._inputElement.removeAttribute("aria-controls"),this._inputElement.setAttribute("aria-expanded","false"),this._listDropdown.close(),this._listDropdown=void 0}setBusyVisibility(e){var t;(t=this._listDropdown)==null||t.setBusyVisibility(e)}toggleOptionMultiple(e,t){var i;(i=this._listDropdown)==null||i.toggleOptionMultiple(e,t)}setDismissListener(e){if(!this._listDropdown||!this._listDropdown.dropdownElement)return;let t=this._listDropdown.dropdownElement;t.targetElement&&t.targetElement.addEventListener(F.events.BLUR,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=k();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=this._component.querySelector("forge-text-field");if(e&&e.shadowRoot){let i=C(e,re.selectors.ROOT);if(i)return i}let t=this._component.querySelector("forge-chip-field");if(t&&t.shadowRoot){let i=C(t,y.selectors.ROOT);if(i)return i}return 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 ce=(e=>(e[e.Option=0]="Option",e[e.Group=1]="Group",e))(ce||{});function b(u,d){let e=u.some(i=>h(i)&&w(i)&&i.hasOwnProperty("options")&&(i.hasOwnProperty("text")||i.hasOwnProperty("builder"))),t=u.some(i=>h(i)&&w(i)&&i.hasOwnProperty("label")&&i.hasOwnProperty("value"));return e&&d===1||t&&d===0}function he(u,d){return u.find(e=>e.value===d)}function v(u,d,e=null){return e?!(e in u.value)||!(e in d)?!1:D(u.value[e],d[e]):D(u.value,d)}var E=class extends ue{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=x()}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._isDropdownOpen&&this._closeDropdown()}_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?B(this._debounceFilter,this._debounce,!1):this._debounceFilter}_initializeAccessibility(){this._adapter.initializeInputAccessibility(this._identifier)}get _flatOptions(){return b(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._clearValue(),this._adapter.setSelectedText(this._getSelectedText())}_onDropdownScrollEnd(){this._adapter.emitHostEvent(o.events.SCROLLED_BOTTOM)}_onFocus(){!this._isDropdownOpen&&this._adapter.getInputValue()&&!L.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,l=i.length===1&&t.selectionEnd===1,c=i.length===1&&t.selectionEnd===0,_=!i||n||l||c;!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:"",l=t?this._getValue():null;return new Promise((c,_)=>Promise.resolve(i(n,l)).then(s=>{this._options=s,c(this._options)}).catch(s=>_(`An unexpected error occurred while filtering: ${s}`)))}_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 l=this._allowUnmatched&&!this._selectedOptions.length;this._isDropdownOpen=!0;let c;if(this._optionBuilder){let s=this._optionBuilder;c=(m,f)=>s(m,this._filterText,f)}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:s=>{if(this._filterText){let m=Y(s,this._filterText);if(m)return m}return s},allowBusy:!0,optionBuilder:c,syncWidth:this._syncPopupWidth,observeScroll:this._observeScroll,observeScrollThreshold:this._observeScrollThreshold,scrollEndListener:this._dropdownScrollEndListener,activeChangeCallback:this._activeChangeListener,targetWidthCallback:this._targetWidthCallback,selectCallback:s=>this._onSelect(s),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(l)}catch(s){console.error(s)}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(){this._multiple&&(this._filterText=""),this._isDropdownOpen=!1,this._adapter.hide(this._dismissListener),this._sortSelectedOptions(),this._adapter.toggleHostAttribute(o.attributes.OPEN,this._isDropdownOpen)}_sortSelectedOptions(){if(this._multiple&&this._selectedOptions.length&&b(this._options,0)){let e=[],t=[];this._options.forEach(i=>{this._selectedOptions.find(n=>v(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 n=this._flatOptions,l=n.find(s=>v(s,e,this._matchKey)),c=l?l.value:"",_=l?l.label:"";if(this._multiple){let s=n.findIndex(f=>v(f,e,this._matchKey));if(s>=0){let f=this._selectedOptions.some(me=>v(me,e,this._matchKey));this._adapter.toggleOptionMultiple(s,f)}let m=he(this._selectedOptions,c);if(m){let f=this._selectedOptions.indexOf(m);this._selectedOptions.splice(f,1)}else this._selectedOptions.push(l)}else h(c)?(this._selectedOptions[0]=l,this._filterText=_):(this._selectedOptions=[],this._filterText="");if(this._isDropdownOpen&&this._adapter.setSelectedOptions(this._selectedOptions),this._values=this._selectedOptions.map(s=>s.value),this._adapter.setSelectedText(this._getSelectedText()),!L.isMobile&&t&&this._adapter.selectInputValue(),this._multiple){let s=n.findIndex(f=>v(f,e,this._matchKey)),m=this._values.includes(e);this._adapter.toggleOptionMultiple(s,m)}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]]),b(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=[]),b(e,0))for(let i of e){let n=t.find(l=>v(l,i.value,this._matchKey));n?this._selectedOptions.push(n):this._selectedOptions.push(i)}else for(let i of e){let n=t.find(l=>v(l,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=JSON.parse(JSON.stringify(e)):S(e)?t=[e]:t=[JSON.parse(JSON.stringify(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 Oe="<template><slot></slot></template>",Ie=":host{display:block}:host([hidden]){display:none}",r=class extends ie{constructor(){super();X.define([V,z,q]),H(this,Oe,Ie),this._foundation=new E(new I(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():M(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=g(i);break;case o.attributes.DEBOUNCE:this.debounce=P(i);break;case o.attributes.FILTER_ON_FOCUS:this.filterOnFocus=g(i);break;case o.attributes.FILTER_FOCUS_FIRST:this.filterFocusFirst=g(i);break;case o.attributes.ALLOW_UNMATCHED:this.allowUnmatched=g(i);break;case o.attributes.POPUP_TARGET:this.popupTarget=i;break;case o.attributes.OPEN:this.open=g(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}};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([R({name:o.elementName,dependencies:[le,oe,te,ee,Q,ne,Z,J]})],r);var _e=class extends ${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,l,c,_,s;let t={props:T({},(n=(i=this._config.options)==null?void 0:i.textFieldDelegateConfig)==null?void 0:n.props),options:T({},(c=(l=this._config.options)==null?void 0:l.textFieldDelegateConfig)==null?void 0:c.options)};t.options||(t.options={}),((_=this._config.options)==null?void 0:_.useDropdownIcon)!==!1&&!((s=t.options)!=null&&s.trailingElement)&&(t.options.trailingElement=this._createDropdownIconElement()),this._textFieldDelegate=new pe(t),e.appendChild(this._textFieldDelegate.element)}_createDropdownIconElement(){let e={props:{slot:"trailing",name:"arrow_drop_down"},options:{attributes:{"forge-dropdown-icon":""}}};return new j(e).element}};function Kt(){U(r)}export{o as a,de as b,I as c,ce as d,b as e,he as f,v as g,E as h,r as i,_e as j,Kt as k};
7
- //# sourceMappingURL=chunk.SA7OL5US.js.map
6
+ import{a as y}from"./chunk.FPMQAUL3.js";import{b as Q}from"./chunk.5MPUISW3.js";import{a as ie}from"./chunk.2TVYAW7Q.js";import{h as ae,i as ue}from"./chunk.FF5DED5D.js";import{b as Z}from"./chunk.RPKVFFQ6.js";import{a as F,e as oe}from"./chunk.FHW6LV4A.js";import{c as te}from"./chunk.HSXUQFHK.js";import{e as ee}from"./chunk.FZ43DC2H.js";import{b as ne}from"./chunk.7KEUUHXY.js";import{c as le}from"./chunk.A6RLV2QU.js";import{a as re,b as pe}from"./chunk.YTOYNJMD.js";import{a as se}from"./chunk.GO5A4GKZ.js";import{a as L}from"./chunk.MGLWXAZO.js";import{c as V,g as q,h as z}from"./chunk.MZLPUI6R.js";import{d as X,l as J,m as j}from"./chunk.T64UW37U.js";import{a as Y}from"./chunk.WDTA5G7R.js";import{a as $}from"./chunk.G4IN6Y46.js";import{a}from"./chunk.NVUMRW44.js";import{a as G}from"./chunk.TKDMM2ZZ.js";import{a as R,b as K,c as W}from"./chunk.55FCNVG5.js";import{a as U,e as H,g as C}from"./chunk.QH2GB3PD.js";import{m as M,r as N,s as k,u as A}from"./chunk.CFDK4RCW.js";import{a as x,b as h,c as S,j as w,k as g,l as P,n as D,o as B}from"./chunk.J2M2MXP2.js";import{a as T,d as p}from"./chunk.M3QDAYD2.js";var O=`${K}autocomplete`,fe={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"},ve={INPUT:se.selectors.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]"},ge={DEFAULT_DEBOUNCE_TIME:500,NUM_SKELETON_ITEMS:3},be={CHANGE:`${O}-change`,SELECT:`${O}-select`,SCROLLED_BOTTOM:`${O}-scrolled-bottom`},o={elementName:O,attributes:fe,selectors:ve,numbers:ge,events:be},de=(e=>(e.Default="default",e.Stateless="stateless",e))(de||{});var I=class extends G{constructor(e){super(e);this.setInputElement()}setInputElement(){let e=N(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(y.elementName)}show(e,t){this._targetElement=this._getTargetElement(t),this._targetElement&&(this._listDropdown=new ae(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))}hide(e){if(!this._listDropdown)return;let{targetElement:t}=this._listDropdown.dropdownElement;t.removeEventListener(F.events.BLUR,e),this.setBusyVisibility(!1),this._tryToggleDropdownIconRotation(!1),this._inputElement.removeAttribute("aria-activedescendant"),this._inputElement.removeAttribute("aria-controls"),this._inputElement.setAttribute("aria-expanded","false"),this._listDropdown.close(),this._listDropdown=void 0}setBusyVisibility(e){var t;(t=this._listDropdown)==null||t.setBusyVisibility(e)}toggleOptionMultiple(e,t){var i;(i=this._listDropdown)==null||i.toggleOptionMultiple(e,t)}setDismissListener(e){if(!this._listDropdown||!this._listDropdown.dropdownElement)return;let t=this._listDropdown.dropdownElement;t.targetElement&&t.targetElement.addEventListener(F.events.BLUR,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=k();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=this._component.querySelector("forge-text-field");if(e&&e.shadowRoot){let i=C(e,re.selectors.ROOT);if(i)return i}let t=this._component.querySelector("forge-chip-field");if(t&&t.shadowRoot){let i=C(t,y.selectors.ROOT);if(i)return i}return 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 ce=(e=>(e[e.Option=0]="Option",e[e.Group=1]="Group",e))(ce||{});function b(u,d){let e=u.some(i=>h(i)&&w(i)&&i.hasOwnProperty("options")&&(i.hasOwnProperty("text")||i.hasOwnProperty("builder"))),t=u.some(i=>h(i)&&w(i)&&i.hasOwnProperty("label")&&i.hasOwnProperty("value"));return e&&d===1||t&&d===0}function he(u,d){return u.find(e=>e.value===d)}function v(u,d,e=null){return e?!(e in u.value)||!(e in d)?!1:D(u.value[e],d[e]):D(u.value,d)}var E=class extends ue{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=x()}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._isDropdownOpen&&this._closeDropdown()}_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?B(this._debounceFilter,this._debounce,!1):this._debounceFilter}_initializeAccessibility(){this._adapter.initializeInputAccessibility(this._identifier)}get _flatOptions(){return b(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._clearValue(),this._adapter.setSelectedText(this._getSelectedText())}_onDropdownScrollEnd(){this._adapter.emitHostEvent(o.events.SCROLLED_BOTTOM)}_onFocus(){!this._isDropdownOpen&&this._adapter.getInputValue()&&!L.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,l=i.length===1&&t.selectionEnd===1,c=i.length===1&&t.selectionEnd===0,_=!i||n||l||c;!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:"",l=t?this._getValue():null;return new Promise((c,_)=>Promise.resolve(i(n,l)).then(s=>{this._options=s,c(this._options)}).catch(s=>_(`An unexpected error occurred while filtering: ${s}`)))}_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 l=this._allowUnmatched&&!this._selectedOptions.length;this._isDropdownOpen=!0;let c;if(this._optionBuilder){let s=this._optionBuilder;c=(m,f)=>s(m,this._filterText,f)}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:s=>{if(this._filterText){let m=Y(s,this._filterText);if(m)return m}return s},allowBusy:!0,optionBuilder:c,syncWidth:this._syncPopupWidth,observeScroll:this._observeScroll,observeScrollThreshold:this._observeScrollThreshold,scrollEndListener:this._dropdownScrollEndListener,activeChangeCallback:this._activeChangeListener,targetWidthCallback:this._targetWidthCallback,selectCallback:s=>this._onSelect(s),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(l)}catch(s){console.error(s)}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(){this._multiple&&(this._filterText=""),this._isDropdownOpen=!1,this._adapter.hide(this._dismissListener),this._sortSelectedOptions(),this._adapter.toggleHostAttribute(o.attributes.OPEN,this._isDropdownOpen)}_sortSelectedOptions(){if(this._multiple&&this._selectedOptions.length&&b(this._options,0)){let e=[],t=[];this._options.forEach(i=>{this._selectedOptions.find(n=>v(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 n=this._flatOptions,l=n.find(s=>v(s,e,this._matchKey)),c=l?l.value:"",_=l?l.label:"";if(this._multiple){let s=n.findIndex(f=>v(f,e,this._matchKey));if(s>=0){let f=this._selectedOptions.some(me=>v(me,e,this._matchKey));this._adapter.toggleOptionMultiple(s,f)}let m=he(this._selectedOptions,c);if(m){let f=this._selectedOptions.indexOf(m);this._selectedOptions.splice(f,1)}else this._selectedOptions.push(l)}else h(c)?(this._selectedOptions[0]=l,this._filterText=_):(this._selectedOptions=[],this._filterText="");if(this._isDropdownOpen&&this._adapter.setSelectedOptions(this._selectedOptions),this._values=this._selectedOptions.map(s=>s.value),this._adapter.setSelectedText(this._getSelectedText()),!L.isMobile&&t&&this._adapter.selectInputValue(),this._multiple){let s=n.findIndex(f=>v(f,e,this._matchKey)),m=this._values.includes(e);this._adapter.toggleOptionMultiple(s,m)}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]]),b(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=[]),b(e,0))for(let i of e){let n=t.find(l=>v(l,i.value,this._matchKey));n?this._selectedOptions.push(n):this._selectedOptions.push(i)}else for(let i of e){let n=t.find(l=>v(l,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=JSON.parse(JSON.stringify(e)):S(e)?t=[e]:t=[JSON.parse(JSON.stringify(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 Oe="<template><slot></slot></template>",Ie=":host{display:block}:host([hidden]){display:none}",r=class extends ie{constructor(){super();X.define([V,z,q]),H(this,Oe,Ie),this._foundation=new E(new I(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():M(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=g(i);break;case o.attributes.DEBOUNCE:this.debounce=P(i);break;case o.attributes.FILTER_ON_FOCUS:this.filterOnFocus=g(i);break;case o.attributes.FILTER_FOCUS_FIRST:this.filterFocusFirst=g(i);break;case o.attributes.ALLOW_UNMATCHED:this.allowUnmatched=g(i);break;case o.attributes.POPUP_TARGET:this.popupTarget=i;break;case o.attributes.OPEN:this.open=g(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}};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([R({name:o.elementName,dependencies:[le,oe,te,ee,Q,ne,Z,J]})],r);var _e=class extends ${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,l,c,_,s;let t={props:T({},(n=(i=this._config.options)==null?void 0:i.textFieldDelegateConfig)==null?void 0:n.props),options:T({},(c=(l=this._config.options)==null?void 0:l.textFieldDelegateConfig)==null?void 0:c.options)};t.options||(t.options={}),((_=this._config.options)==null?void 0:_.useDropdownIcon)!==!1&&!((s=t.options)!=null&&s.trailingElement)&&(t.options.trailingElement=this._createDropdownIconElement()),this._textFieldDelegate=new pe(t),e.appendChild(this._textFieldDelegate.element)}_createDropdownIconElement(){let e={props:{slot:"trailing",name:"arrow_drop_down"},options:{attributes:{"forge-dropdown-icon":""}}};return new j(e).element}};function Kt(){U(r)}export{o as a,de as b,I as c,ce as d,b as e,he as f,v as g,E as h,r as i,_e as j,Kt as k};
7
+ //# sourceMappingURL=chunk.VUGNSK4K.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 h,v as i,x as L}from"./chunk.FXUXL3D2.js";import{a as u}from"./chunk.NVUMRW44.js";import{a as E}from"./chunk.TKDMM2ZZ.js";import{a as I}from"./chunk.55FCNVG5.js";import{a as C,e as y,g as O,l as z}from"./chunk.QH2GB3PD.js";import{k as b,l as S,p as w}from"./chunk.J2M2MXP2.js";import{d as c}from"./chunk.M3QDAYD2.js";var p=class r{static observe(t,e,l){var o,a;r._targets.has(t)&&((o=r._observer)===null||o===void 0||o.unobserve(t)),r._targets.set(t,e),r._countTargets(),(a=r._observer)===null||a===void 0||a.observe(t,l)}static unobserve(t){var e;r._targets.delete(t),(e=r._observer)===null||e===void 0||e.unobserve(t),r._countTargets()}static _countTargets(){r._observer?r._targets.size<1&&(r._observer=void 0):r._targets.size&&(r._observer=new ResizeObserver(r._handleResize))}};p._targets=new Map;p._handleResize=r=>{r.forEach(t=>{var e;(e=p._targets.get(t.target))===null||e===void 0||e(t)})};var v=class extends E{constructor(e){super(e);this._root=O(e,i.selectors.ROOT)}registerSlotListener(e){this._root.addEventListener("slotchange",e)}registerDidOpenListener(e){this._root.addEventListener(h.events.DID_OPEN,e)}registerDidCloseListener(e){this._root.addEventListener(h.events.DID_CLOSE,e)}observeResize(e){p.observe(this._root,e)}unobserveResize(){p.unobserve(this._root)}getSlottedPanels(){let e=this._component.querySelectorAll(i.selectors.PANEL);return Array.from(e).filter(a=>a.parentElement===this._component)}refitSlottedPanels(e){let l=e==="horizontal"?this._root.clientWidth:this._root.clientHeight,o=this.getSlottedPanels(),a=o.map(d=>{var f;let n=(f=d.shadowRoot)==null?void 0:f.querySelector(h.selectors.ROOT),m=e==="horizontal"?n==null?void 0:n.clientWidth:n==null?void 0:n.clientHeight;return m!=null?m:0}).reduce((d,n)=>d+n,0);if(a<=l)return;let _=a-l;o.slice().reverse().forEach(d=>{if(_<=0)return;let n=d.getContentSize(),m=d.getCollapsibleSize(),f=Math.min(_,m),k=n-f;d.setContentSize(k),_-=f})}};var g=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,o=t.resizable==="start"?1:3;e.forEach(a=>{(a===t||o===2)&&(o+=l),a.style.setProperty(i.customCssProperties.ANIMATING_LAYER,o.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 T='<template><div class="forge-split-view" id="root" part="root"><slot></slot></div></template>',P='@-webkit-keyframes mdc-ripple-fg-radius-in{from{-webkit-animation-timing-function:cubic-bezier(0.4,0,0.2,1);animation-timing-function:cubic-bezier(0.4,0,0.2,1);-webkit-transform:translate(var(--mdc-ripple-fg-translate-start,0)) scale(1);transform:translate(var(--mdc-ripple-fg-translate-start,0)) scale(1)}to{-webkit-transform:translate(var(--mdc-ripple-fg-translate-end,0)) scale(var(--mdc-ripple-fg-scale,1));transform:translate(var(--mdc-ripple-fg-translate-end,0)) scale(var(--mdc-ripple-fg-scale,1))}}@keyframes mdc-ripple-fg-radius-in{from{-webkit-animation-timing-function:cubic-bezier(0.4,0,0.2,1);animation-timing-function:cubic-bezier(0.4,0,0.2,1);-webkit-transform:translate(var(--mdc-ripple-fg-translate-start,0)) scale(1);transform:translate(var(--mdc-ripple-fg-translate-start,0)) scale(1)}to{-webkit-transform:translate(var(--mdc-ripple-fg-translate-end,0)) scale(var(--mdc-ripple-fg-scale,1));transform:translate(var(--mdc-ripple-fg-translate-end,0)) scale(var(--mdc-ripple-fg-scale,1))}}@-webkit-keyframes mdc-ripple-fg-opacity-in{from{-webkit-animation-timing-function:linear;animation-timing-function:linear;opacity:0}to{opacity:var(--mdc-ripple-fg-opacity, 0)}}@keyframes mdc-ripple-fg-opacity-in{from{-webkit-animation-timing-function:linear;animation-timing-function:linear;opacity:0}to{opacity:var(--mdc-ripple-fg-opacity, 0)}}@-webkit-keyframes mdc-ripple-fg-opacity-out{from{-webkit-animation-timing-function:linear;animation-timing-function:linear;opacity:var(--mdc-ripple-fg-opacity, 0)}to{opacity:0}}@keyframes mdc-ripple-fg-opacity-out{from{-webkit-animation-timing-function:linear;animation-timing-function:linear;opacity:var(--mdc-ripple-fg-opacity, 0)}to{opacity:0}}.mdc-ripple-surface{--mdc-ripple-fg-size:0;--mdc-ripple-left:0;--mdc-ripple-top:0;--mdc-ripple-fg-scale:1;--mdc-ripple-fg-translate-end:0;--mdc-ripple-fg-translate-start:0;-webkit-tap-highlight-color:transparent;will-change:transform,opacity;position:relative;outline:0;overflow:hidden}.mdc-ripple-surface::after,.mdc-ripple-surface::before{position:absolute;border-radius:50%;opacity:0;pointer-events:none;content:""}.mdc-ripple-surface::before{-webkit-transition:opacity 15ms linear,background-color 15ms linear;transition:opacity 15ms linear,background-color 15ms linear;z-index:1;z-index:var(--mdc-ripple-z-index,1)}.mdc-ripple-surface::after{z-index:0;z-index:var(--mdc-ripple-z-index,0)}.mdc-ripple-surface.mdc-ripple-upgraded::before{-webkit-transform:scale(var(--mdc-ripple-fg-scale,1));transform:scale(var(--mdc-ripple-fg-scale,1))}.mdc-ripple-surface.mdc-ripple-upgraded::after{top:0;left:0;-webkit-transform:scale(0);transform:scale(0);-webkit-transform-origin:center center;transform-origin:center center}.mdc-ripple-surface.mdc-ripple-upgraded--unbounded::after{top:var(--mdc-ripple-top,0);left:var(--mdc-ripple-left,0)}.mdc-ripple-surface.mdc-ripple-upgraded--foreground-activation::after{-webkit-animation:mdc-ripple-fg-radius-in 225ms forwards,mdc-ripple-fg-opacity-in 75ms forwards;animation:mdc-ripple-fg-radius-in 225ms forwards,mdc-ripple-fg-opacity-in 75ms forwards}.mdc-ripple-surface.mdc-ripple-upgraded--foreground-deactivation::after{-webkit-animation:mdc-ripple-fg-opacity-out 150ms;animation:mdc-ripple-fg-opacity-out 150ms;-webkit-transform:translate(var(--mdc-ripple-fg-translate-end,0)) scale(var(--mdc-ripple-fg-scale,1));transform:translate(var(--mdc-ripple-fg-translate-end,0)) scale(var(--mdc-ripple-fg-scale,1))}.mdc-ripple-surface::after,.mdc-ripple-surface::before{top:calc(50% - 100%);left:calc(50% - 100%);width:200%;height:200%}.mdc-ripple-surface.mdc-ripple-upgraded::after{width:var(--mdc-ripple-fg-size,100%);height:var(--mdc-ripple-fg-size,100%)}.mdc-ripple-surface[data-mdc-ripple-is-unbounded],.mdc-ripple-upgraded--unbounded{overflow:visible}.mdc-ripple-surface[data-mdc-ripple-is-unbounded]::after,.mdc-ripple-surface[data-mdc-ripple-is-unbounded]::before,.mdc-ripple-upgraded--unbounded::after,.mdc-ripple-upgraded--unbounded::before{top:calc(50% - 50%);left:calc(50% - 50%);width:100%;height:100%}.mdc-ripple-surface[data-mdc-ripple-is-unbounded].mdc-ripple-upgraded::after,.mdc-ripple-surface[data-mdc-ripple-is-unbounded].mdc-ripple-upgraded::before,.mdc-ripple-upgraded--unbounded.mdc-ripple-upgraded::after,.mdc-ripple-upgraded--unbounded.mdc-ripple-upgraded::before{top:var(--mdc-ripple-top,calc(50% - 50%));left:var(--mdc-ripple-left,calc(50% - 50%));width:var(--mdc-ripple-fg-size,100%);height:var(--mdc-ripple-fg-size,100%)}.mdc-ripple-surface[data-mdc-ripple-is-unbounded].mdc-ripple-upgraded::after,.mdc-ripple-upgraded--unbounded.mdc-ripple-upgraded::after{width:var(--mdc-ripple-fg-size,100%);height:var(--mdc-ripple-fg-size,100%)}.mdc-ripple-surface::after,.mdc-ripple-surface::before{background-color:#000;background-color:var(--mdc-ripple-color,#000)}.mdc-ripple-surface.mdc-ripple-surface--hover::before,.mdc-ripple-surface:hover::before{opacity:.04;opacity:var(--mdc-ripple-hover-opacity, .04)}.mdc-ripple-surface.mdc-ripple-upgraded--background-focused::before,.mdc-ripple-surface:not(.mdc-ripple-upgraded):focus::before{-webkit-transition-duration:75ms;transition-duration:75ms;opacity:.12;opacity:var(--mdc-ripple-focus-opacity, .12)}.mdc-ripple-surface:not(.mdc-ripple-upgraded)::after{-webkit-transition:opacity 150ms linear;transition:opacity 150ms linear}.mdc-ripple-surface:not(.mdc-ripple-upgraded):active::after{-webkit-transition-duration:75ms;transition-duration:75ms;opacity:.12;opacity:var(--mdc-ripple-press-opacity, .12)}.mdc-ripple-surface.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.12)}.mdc-ripple-surface::after,.mdc-ripple-surface::before{--mdc-ripple-color:var(--mdc-theme-on-surface)}.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}',s=class extends z{constructor(){super();y(this,T,P),this._foundation=new g(new v(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,o){switch(e){case i.attributes.ORIENTATION:this.orientation=o;break;case i.attributes.DISABLED:this.disabled=b(o);break;case i.attributes.ALLOW_CLOSE:this.allowClose=b(o);break;case i.attributes.AUTO_CLOSE:this.autoClose=b(o);break;case i.attributes.AUTO_CLOSE_THRESHOLD:this.autoCloseThreshold=S(o);break}}layerSlottedPanels(e){this._foundation.layerSlottedPanels(e)}unlayerSlottedPanels(){this._foundation.unlayerSlottedPanels()}update(e){this._foundation.update(e)}refit(){this._foundation.refitSlottedPanels()}};c([u()],s.prototype,"orientation",2),c([u()],s.prototype,"disabled",2),c([u()],s.prototype,"allowClose",2),c([u()],s.prototype,"autoClose",2),c([u()],s.prototype,"autoCloseThreshold",2),s=c([I({name:i.elementName,dependencies:[L]})],s);function ce(){C(s)}export{v as a,g as b,s as c,ce as d};
7
- //# sourceMappingURL=chunk.3VZGVF2G.js.map
6
+ import{a as h,v as i,x as L}from"./chunk.EWEX3PHR.js";import{a as u}from"./chunk.NVUMRW44.js";import{a as E}from"./chunk.TKDMM2ZZ.js";import{a as I}from"./chunk.55FCNVG5.js";import{a as C,e as y,g as O,l as z}from"./chunk.QH2GB3PD.js";import{k as b,l as S,p as w}from"./chunk.J2M2MXP2.js";import{d as c}from"./chunk.M3QDAYD2.js";var p=class r{static observe(t,e,l){var o,a;r._targets.has(t)&&((o=r._observer)===null||o===void 0||o.unobserve(t)),r._targets.set(t,e),r._countTargets(),(a=r._observer)===null||a===void 0||a.observe(t,l)}static unobserve(t){var e;r._targets.delete(t),(e=r._observer)===null||e===void 0||e.unobserve(t),r._countTargets()}static _countTargets(){r._observer?r._targets.size<1&&(r._observer=void 0):r._targets.size&&(r._observer=new ResizeObserver(r._handleResize))}};p._targets=new Map;p._handleResize=r=>{r.forEach(t=>{var e;(e=p._targets.get(t.target))===null||e===void 0||e(t)})};var v=class extends E{constructor(e){super(e);this._root=O(e,i.selectors.ROOT)}registerSlotListener(e){this._root.addEventListener("slotchange",e)}registerDidOpenListener(e){this._root.addEventListener(h.events.DID_OPEN,e)}registerDidCloseListener(e){this._root.addEventListener(h.events.DID_CLOSE,e)}observeResize(e){p.observe(this._root,e)}unobserveResize(){p.unobserve(this._root)}getSlottedPanels(){let e=this._component.querySelectorAll(i.selectors.PANEL);return Array.from(e).filter(a=>a.parentElement===this._component)}refitSlottedPanels(e){let l=e==="horizontal"?this._root.clientWidth:this._root.clientHeight,o=this.getSlottedPanels(),a=o.map(d=>{var f;let n=(f=d.shadowRoot)==null?void 0:f.querySelector(h.selectors.ROOT),m=e==="horizontal"?n==null?void 0:n.clientWidth:n==null?void 0:n.clientHeight;return m!=null?m:0}).reduce((d,n)=>d+n,0);if(a<=l)return;let _=a-l;o.slice().reverse().forEach(d=>{if(_<=0)return;let n=d.getContentSize(),m=d.getCollapsibleSize(),f=Math.min(_,m),k=n-f;d.setContentSize(k),_-=f})}};var g=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,o=t.resizable==="start"?1:3;e.forEach(a=>{(a===t||o===2)&&(o+=l),a.style.setProperty(i.customCssProperties.ANIMATING_LAYER,o.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 T='<template><div class="forge-split-view" id="root" part="root"><slot></slot></div></template>',P='@-webkit-keyframes mdc-ripple-fg-radius-in{from{-webkit-animation-timing-function:cubic-bezier(0.4,0,0.2,1);animation-timing-function:cubic-bezier(0.4,0,0.2,1);-webkit-transform:translate(var(--mdc-ripple-fg-translate-start,0)) scale(1);transform:translate(var(--mdc-ripple-fg-translate-start,0)) scale(1)}to{-webkit-transform:translate(var(--mdc-ripple-fg-translate-end,0)) scale(var(--mdc-ripple-fg-scale,1));transform:translate(var(--mdc-ripple-fg-translate-end,0)) scale(var(--mdc-ripple-fg-scale,1))}}@keyframes mdc-ripple-fg-radius-in{from{-webkit-animation-timing-function:cubic-bezier(0.4,0,0.2,1);animation-timing-function:cubic-bezier(0.4,0,0.2,1);-webkit-transform:translate(var(--mdc-ripple-fg-translate-start,0)) scale(1);transform:translate(var(--mdc-ripple-fg-translate-start,0)) scale(1)}to{-webkit-transform:translate(var(--mdc-ripple-fg-translate-end,0)) scale(var(--mdc-ripple-fg-scale,1));transform:translate(var(--mdc-ripple-fg-translate-end,0)) scale(var(--mdc-ripple-fg-scale,1))}}@-webkit-keyframes mdc-ripple-fg-opacity-in{from{-webkit-animation-timing-function:linear;animation-timing-function:linear;opacity:0}to{opacity:var(--mdc-ripple-fg-opacity, 0)}}@keyframes mdc-ripple-fg-opacity-in{from{-webkit-animation-timing-function:linear;animation-timing-function:linear;opacity:0}to{opacity:var(--mdc-ripple-fg-opacity, 0)}}@-webkit-keyframes mdc-ripple-fg-opacity-out{from{-webkit-animation-timing-function:linear;animation-timing-function:linear;opacity:var(--mdc-ripple-fg-opacity, 0)}to{opacity:0}}@keyframes mdc-ripple-fg-opacity-out{from{-webkit-animation-timing-function:linear;animation-timing-function:linear;opacity:var(--mdc-ripple-fg-opacity, 0)}to{opacity:0}}.mdc-ripple-surface{--mdc-ripple-fg-size:0;--mdc-ripple-left:0;--mdc-ripple-top:0;--mdc-ripple-fg-scale:1;--mdc-ripple-fg-translate-end:0;--mdc-ripple-fg-translate-start:0;-webkit-tap-highlight-color:transparent;will-change:transform,opacity;position:relative;outline:0;overflow:hidden}.mdc-ripple-surface::after,.mdc-ripple-surface::before{position:absolute;border-radius:50%;opacity:0;pointer-events:none;content:""}.mdc-ripple-surface::before{-webkit-transition:opacity 15ms linear,background-color 15ms linear;transition:opacity 15ms linear,background-color 15ms linear;z-index:1;z-index:var(--mdc-ripple-z-index,1)}.mdc-ripple-surface::after{z-index:0;z-index:var(--mdc-ripple-z-index,0)}.mdc-ripple-surface.mdc-ripple-upgraded::before{-webkit-transform:scale(var(--mdc-ripple-fg-scale,1));transform:scale(var(--mdc-ripple-fg-scale,1))}.mdc-ripple-surface.mdc-ripple-upgraded::after{top:0;left:0;-webkit-transform:scale(0);transform:scale(0);-webkit-transform-origin:center center;transform-origin:center center}.mdc-ripple-surface.mdc-ripple-upgraded--unbounded::after{top:var(--mdc-ripple-top,0);left:var(--mdc-ripple-left,0)}.mdc-ripple-surface.mdc-ripple-upgraded--foreground-activation::after{-webkit-animation:mdc-ripple-fg-radius-in 225ms forwards,mdc-ripple-fg-opacity-in 75ms forwards;animation:mdc-ripple-fg-radius-in 225ms forwards,mdc-ripple-fg-opacity-in 75ms forwards}.mdc-ripple-surface.mdc-ripple-upgraded--foreground-deactivation::after{-webkit-animation:mdc-ripple-fg-opacity-out 150ms;animation:mdc-ripple-fg-opacity-out 150ms;-webkit-transform:translate(var(--mdc-ripple-fg-translate-end,0)) scale(var(--mdc-ripple-fg-scale,1));transform:translate(var(--mdc-ripple-fg-translate-end,0)) scale(var(--mdc-ripple-fg-scale,1))}.mdc-ripple-surface::after,.mdc-ripple-surface::before{top:calc(50% - 100%);left:calc(50% - 100%);width:200%;height:200%}.mdc-ripple-surface.mdc-ripple-upgraded::after{width:var(--mdc-ripple-fg-size,100%);height:var(--mdc-ripple-fg-size,100%)}.mdc-ripple-surface[data-mdc-ripple-is-unbounded],.mdc-ripple-upgraded--unbounded{overflow:visible}.mdc-ripple-surface[data-mdc-ripple-is-unbounded]::after,.mdc-ripple-surface[data-mdc-ripple-is-unbounded]::before,.mdc-ripple-upgraded--unbounded::after,.mdc-ripple-upgraded--unbounded::before{top:calc(50% - 50%);left:calc(50% - 50%);width:100%;height:100%}.mdc-ripple-surface[data-mdc-ripple-is-unbounded].mdc-ripple-upgraded::after,.mdc-ripple-surface[data-mdc-ripple-is-unbounded].mdc-ripple-upgraded::before,.mdc-ripple-upgraded--unbounded.mdc-ripple-upgraded::after,.mdc-ripple-upgraded--unbounded.mdc-ripple-upgraded::before{top:var(--mdc-ripple-top,calc(50% - 50%));left:var(--mdc-ripple-left,calc(50% - 50%));width:var(--mdc-ripple-fg-size,100%);height:var(--mdc-ripple-fg-size,100%)}.mdc-ripple-surface[data-mdc-ripple-is-unbounded].mdc-ripple-upgraded::after,.mdc-ripple-upgraded--unbounded.mdc-ripple-upgraded::after{width:var(--mdc-ripple-fg-size,100%);height:var(--mdc-ripple-fg-size,100%)}.mdc-ripple-surface::after,.mdc-ripple-surface::before{background-color:#000;background-color:var(--mdc-ripple-color,#000)}.mdc-ripple-surface.mdc-ripple-surface--hover::before,.mdc-ripple-surface:hover::before{opacity:.04;opacity:var(--mdc-ripple-hover-opacity, .04)}.mdc-ripple-surface.mdc-ripple-upgraded--background-focused::before,.mdc-ripple-surface:not(.mdc-ripple-upgraded):focus::before{-webkit-transition-duration:75ms;transition-duration:75ms;opacity:.12;opacity:var(--mdc-ripple-focus-opacity, .12)}.mdc-ripple-surface:not(.mdc-ripple-upgraded)::after{-webkit-transition:opacity 150ms linear;transition:opacity 150ms linear}.mdc-ripple-surface:not(.mdc-ripple-upgraded):active::after{-webkit-transition-duration:75ms;transition-duration:75ms;opacity:.12;opacity:var(--mdc-ripple-press-opacity, .12)}.mdc-ripple-surface.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.12)}.mdc-ripple-surface::after,.mdc-ripple-surface::before{--mdc-ripple-color:var(--mdc-theme-on-surface)}.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}',s=class extends z{constructor(){super();y(this,T,P),this._foundation=new g(new v(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,o){switch(e){case i.attributes.ORIENTATION:this.orientation=o;break;case i.attributes.DISABLED:this.disabled=b(o);break;case i.attributes.ALLOW_CLOSE:this.allowClose=b(o);break;case i.attributes.AUTO_CLOSE:this.autoClose=b(o);break;case i.attributes.AUTO_CLOSE_THRESHOLD:this.autoCloseThreshold=S(o);break}}layerSlottedPanels(e){this._foundation.layerSlottedPanels(e)}unlayerSlottedPanels(){this._foundation.unlayerSlottedPanels()}update(e){this._foundation.update(e)}refit(){this._foundation.refitSlottedPanels()}};c([u()],s.prototype,"orientation",2),c([u()],s.prototype,"disabled",2),c([u()],s.prototype,"allowClose",2),c([u()],s.prototype,"autoClose",2),c([u()],s.prototype,"autoCloseThreshold",2),s=c([I({name:i.elementName,dependencies:[L]})],s);function ce(){C(s)}export{v as a,g as b,s as c,ce as d};
7
+ //# sourceMappingURL=chunk.WQL55O4A.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 o}from"./chunk.HHC5NEUF.js";import{a as n}from"./chunk.G4IN6Y46.js";var l=class extends n{constructor(e){super(e)}_build(){return document.createElement(o.elementName)}_configure(){var e;typeof((e=this._config.options)==null?void 0:e.helperText)=="string"&&this.setHelperText(this._config.options.helperText)}get value(){return this._element.value}set value(e){this._element.value=e}get disabled(){return this._element.disabled}set disabled(e){this._element.disabled=e}get invalid(){return this._element.invalid||!1}set invalid(e){this._element.invalid=e}onChange(e){this._element.addEventListener("change",t=>e(t.detail))}onFocus(e){this._element.addEventListener("focus",t=>e(t))}onBlur(e){this._element.addEventListener("blur",t=>e(t))}setHelperText(e){e?(this._helperTextElement||(this._helperTextElement=document.createElement("span"),this._helperTextElement.slot="helper-text",this._element.appendChild(this._helperTextElement)),this._helperTextElement.textContent=e):this._helperTextElement&&this._helperTextElement.isConnected&&(this._element.removeChild(this._helperTextElement),this._helperTextElement=void 0)}};export{l as a};
7
- //# sourceMappingURL=chunk.6HMCSEKV.js.map
6
+ import{a as o}from"./chunk.TFMOLR6W.js";import{a as n}from"./chunk.G4IN6Y46.js";var l=class extends n{constructor(e){super(e)}_build(){return document.createElement(o.elementName)}_configure(){var e;typeof((e=this._config.options)==null?void 0:e.helperText)=="string"&&this.setHelperText(this._config.options.helperText)}get value(){return this._element.value}set value(e){this._element.value=e}get disabled(){return this._element.disabled}set disabled(e){this._element.disabled=e}get invalid(){return this._element.invalid||!1}set invalid(e){this._element.invalid=e}onChange(e){this._element.addEventListener("change",t=>e(t.detail))}onFocus(e){this._element.addEventListener("focus",t=>e(t))}onBlur(e){this._element.addEventListener("blur",t=>e(t))}setHelperText(e){e?(this._helperTextElement||(this._helperTextElement=document.createElement("span"),this._helperTextElement.slot="helper-text",this._element.appendChild(this._helperTextElement)),this._helperTextElement.textContent=e):this._helperTextElement&&this._helperTextElement.isConnected&&(this._element.removeChild(this._helperTextElement),this._helperTextElement=void 0)}};export{l as a};
7
+ //# sourceMappingURL=chunk.X63F5NVD.js.map
@@ -3,5 +3,5 @@
3
3
  * Copyright 2023 Tyler Technologies, Inc.
4
4
  * License: Apache-2.0
5
5
  */
6
- import{c as x,d as D}from"./chunk.4UHXQAOT.js";import{a as y}from"./chunk.RFLASSCI.js";import{a as l}from"./chunk.NVUMRW44.js";import{a as E}from"./chunk.TKDMM2ZZ.js";import{a as b,b as L}from"./chunk.55FCNVG5.js";import{a as v,e as f,g as c,l as _}from"./chunk.QH2GB3PD.js";import{k as p,l as u}from"./chunk.J2M2MXP2.js";import{d as s}from"./chunk.M3QDAYD2.js";var C=`${L}file-picker`,I={ACCEPT:"accept",MAX_SIZE:"max-size",CAPTURE:"capture",MULTIPLE:"multiple",DISABLED:"disabled",COMPACT:"compact",BORDERLESS:"borderless"},T={HIGHLIGHT:"highlight",DISABLED:"disabled",COMPACT:"compact",BORDERLESS:"borderless"},S={CONTAINER:"container",BUTTON:"button",INPUT:"input"},A={CONTAINER:"#container",BUTTON:"#button",INPUT:"#input",BUTTON_SLOT:"#button-slot"},P={FILES_CHANGED:`${C}-change`},i={elementName:C,attributes:I,classes:T,ids:S,selectors:A,events:P};var d=class extends E{constructor(e){super(e);this._container=c(e,i.selectors.CONTAINER),this._buttonSlot=c(e,i.selectors.BUTTON_SLOT),this._input=c(e,i.selectors.INPUT),this._inputEventListener=()=>{this._input.value="",this._input.click()},this._container.addEventListener("click",this._inputEventListener)}registerButtonSlotListener(e){this._buttonSlot.addEventListener("slotchange",e)}registerInputChangeListener(e){this._input.addEventListener("change",e)}registerDragEnterListener(e){this._container.addEventListener("dragenter",e)}registerDragLeaveListener(e){this._container.addEventListener("dragleave",e)}registerDragOverListener(e){this._container.addEventListener("dragover",e)}registerDropListener(e){this._container.addEventListener("drop",e)}removeDragEnterListener(e){this._container.removeEventListener("dragenter",e)}removeDragLeaveListener(e){this._container.removeEventListener("dragleave",e)}removeDragOverListener(e){this._container.removeEventListener("dragover",e)}removeDropListener(e){this._container.removeEventListener("drop",e)}initializeButton(){let e=this._component.querySelector("button");this._button=e||void 0}setHighlightState(e){this._container.classList.contains(i.classes.HIGHLIGHT)!==e&&this._container.classList.toggle(i.classes.HIGHLIGHT)}setAccept(e){e?this._input.setAttribute("accept",e):this._input.removeAttribute("accept")}setCapture(e){e?this._input.setAttribute("capture",e):this._input.removeAttribute("capture")}setMultiple(e){e?this._input.setAttribute("multiple",""):this._input.removeAttribute("multiple")}setDisabled(e){var n,o;e?(this._container.removeEventListener("click",this._inputEventListener),(n=this._button)==null||n.setAttribute("disabled",""),this._container.setAttribute("disabled","")):(this._container.addEventListener("click",this._inputEventListener),(o=this._button)==null||o.removeAttribute("disabled"),this._container.removeAttribute("disabled"))}setCompact(e){this._container.classList.contains(i.classes.COMPACT)!==e&&this._container.classList.toggle(i.classes.COMPACT)}setBorderless(e){this._container.classList.contains(i.classes.BORDERLESS)!==e&&this._container.classList.toggle(i.classes.BORDERLESS)}};var g=class{constructor(t){this._adapter=t;this._isInitialized=!1;this._accept=null;this._maxSize=null;this._capture=null;this._multiple=!1;this._disabled=!1;this._compact=!1;this._borderless=!1;this._buttonSlotListener=e=>this._onButtonSlotChanged(e),this._inputChangeListener=e=>this._onInputChange(e),this._dragEnterListener=e=>this._onDragEnter(e),this._dragLeaveListener=e=>this._onDragLeave(e),this._dragOverListener=e=>this._onDragOver(e),this._dropListener=e=>this._onDrop(e),this._adapter.registerButtonSlotListener(this._buttonSlotListener),this._adapter.registerInputChangeListener(this._inputChangeListener),this._compact||this._registerDragListeners()}initialize(){this._adapter.initializeButton(),this._adapter.setDisabled(this._disabled),this._isInitialized=!0}destroy(){this._isInitialized=!1}_onButtonSlotChanged(t){this._adapter.initializeButton()}_onInputChange(t){let e=t.target.files;e&&this._handleFiles(e)}_onDragEnter(t){this._handleDragEvent(t,!0)}_onDragLeave(t){this._handleDragEvent(t,!1)}_onDragOver(t){this._handleDragEvent(t,!0)}_onDrop(t){if(this._handleDragEvent(t,!1),!this._disabled){let e=t.dataTransfer;if(e){let n=e.files;this._handleFiles(n)}}}_registerDragListeners(){this._adapter.registerDragEnterListener(this._dragEnterListener),this._adapter.registerDragLeaveListener(this._dragLeaveListener),this._adapter.registerDragOverListener(this._dragOverListener),this._adapter.registerDropListener(this._dropListener)}_removeDragListeners(){this._adapter.removeDragEnterListener(this._dragEnterListener),this._adapter.removeDragLeaveListener(this._dragLeaveListener),this._adapter.removeDragOverListener(this._dragOverListener),this._adapter.removeDropListener(this._dropListener)}_handleFiles(t){let e={};if(t){let n=this._sortFiles(t),o=n.legalFiles||null;!this._multiple&&o&&o.length>1&&(o=o.splice(1)),e=n}this._adapter.emitHostEvent(i.events.FILES_CHANGED,e)}_sortFiles(t){let e=[],n=[];if(!this._accept&&!this.maxSize)return e=Array.from(t),{legalFiles:e,illegalFiles:n};let o=this._accept?this._accept.split(",").map(r=>r.trim().toLowerCase()):[""];for(let r=0;r<t.length;r++)!o.some(m=>t[r].type.toLowerCase().match(m)||t[r].name.toLowerCase().match("\\"+m))||this._maxSize&&t[r].size>this._maxSize?n.push(t[r]):e.push(t[r]);return{legalFiles:e,illegalFiles:n}}_handleDragEvent(t,e){this._disabled||(t.preventDefault(),t.stopPropagation(),this._adapter.setHighlightState(e))}get accept(){return this._accept}set accept(t){this._accept!==t&&(this._accept=t,this._adapter.setAccept(t),this._adapter.toggleHostAttribute(i.attributes.ACCEPT,!!t,String(t)))}get maxSize(){return this._maxSize}set maxSize(t){this._maxSize!==t&&(this._maxSize=t,this._adapter.toggleHostAttribute(i.attributes.MAX_SIZE,!!t,String(t)))}get capture(){return this._capture}set capture(t){this._capture!==t&&(this._capture=t,this._adapter.setCapture(t),this._adapter.toggleHostAttribute(i.attributes.CAPTURE,!!t,String(t)))}get multiple(){return this._multiple}set multiple(t){this._multiple!==t&&(this._multiple=t,this._adapter.setMultiple(t),this._adapter.toggleHostAttribute(i.attributes.MULTIPLE,t))}get disabled(){return this._disabled}set disabled(t){this._disabled!==t&&(this._disabled=t,this._isInitialized&&this._adapter.setDisabled(t),this._adapter.toggleHostAttribute(i.attributes.DISABLED,t))}get compact(){return this._compact}set compact(t){this._compact!==t&&(this._compact=t,this._adapter.setCompact(t),t?this._removeDragListeners():this._registerDragListeners(),this._adapter.toggleHostAttribute(i.attributes.COMPACT,t))}get borderless(){return this._borderless}set borderless(t){this._borderless!==t&&(this._borderless=t,this._adapter.setBorderless(t),this._adapter.toggleHostAttribute(i.attributes.BORDERLESS,t))}};var F='<template><form class="forge-file-picker" id="container" part="form"><div class="forge-file-picker__primary" id="primary" part="primary"><slot name="primary"></slot></div><slot id="button-slot"></slot><div class="forge-file-picker__secondary" id="secondary" part="secondary"><slot name="secondary"></slot></div><input type="file" class="forge-file-picker__input" id="input" part="input"></form><div class="forge-file-picker__helper-text" part="helper-text-container"><slot name="helper-text"></slot></div></template>',O=".forge-file-picker{-webkit-box-sizing:border-box;box-sizing:border-box;width:100%;height:100%;background-color:rgba(189,189,189,.12);border:1px dashed #e0e0e0;display:grid;-webkit-box-pack:center;justify-content:center;align-content:center;gap:16px;padding:16px;text-align:center;cursor:pointer}.forge-file-picker__primary{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-subtitle1-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:1rem;font-size:var(--mdc-typography-subtitle1-font-size, 1rem);line-height:1.75rem;line-height:var(--mdc-typography-subtitle1-line-height, 1.75rem);font-weight:400;font-weight:var(--mdc-typography-subtitle1-font-weight,400);letter-spacing:.009375em;letter-spacing:var(--mdc-typography-subtitle1-letter-spacing, .009375em);text-decoration:inherit;-webkit-text-decoration:var(--mdc-typography-subtitle1-text-decoration,inherit);text-decoration:var(--mdc-typography-subtitle1-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-subtitle1-text-transform,inherit);color:rgba(0,0,0,.87);color:var(--mdc-theme-text-primary-on-background,rgba(0,0,0,.87));max-width:auto;max-width:var(--forge-file-picker-max-content-width,auto)}.forge-file-picker__secondary{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-size:.875rem;font-size:var(--forge-typography-subtitle2-secondary-font-size, .875rem);line-height:1.375rem;line-height:var(--forge-typography-subtitle2-secondary-line-height, 1.375rem);font-weight:400;font-weight:var(--forge-typography-subtitle2-secondary-font-weight,400);letter-spacing:.0087500001em;letter-spacing:var(--forge-typography-subtitle2-secondary-letter-spacing, .0087500001em);text-decoration:inherit;-webkit-text-decoration:var(--forge-typography-subtitle2-secondary-text-decoration,inherit);text-decoration:var(--forge-typography-subtitle2-secondary-text-decoration,inherit);text-transform:inherit;text-transform:var(--forge-typography-subtitle2-secondary-text-transform,inherit);color:var(--mdc-theme-text-secondary-on-background);color:var(--forge-typography-subtitle2-secondary-color,var(--mdc-theme-text-secondary-on-background));color:rgba(0,0,0,.87);color:var(--mdc-theme-text-primary-on-background,rgba(0,0,0,.87));max-width:auto;max-width:var(--forge-file-picker-max-content-width,auto)}.forge-file-picker__input{display:none}.forge-file-picker__helper-text ::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));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);display:block;min-height:1.5rem;line-height:normal;padding-top:4px;-webkit-box-sizing:border-box;box-sizing:border-box;color:rgba(0,0,0,.54);color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54));margin-left:12px;-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;text-decoration:var(--mdc-typography-caption-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-caption-text-transform,inherit);text-align:start}.forge-file-picker[disabled]{background-color:#fafafa;background-color:var(--mdc-theme-background,#fafafa);border-color:#e0e0e0;border-color:var(--forge-theme-border-color,#e0e0e0);opacity:.38;cursor:unset}.forge-file-picker.compact{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;background-color:transparent;border:none;padding:0}.forge-file-picker.compact .forge-file-picker__primary,.forge-file-picker.compact .forge-file-picker__secondary{display:none}.forge-file-picker.compact .forge-file-picker__button>button{width:auto;width:var(--forge-file-picker-width,auto);background-color:transparent}.forge-file-picker:not(.compact).highlight{border-color:#3f51b5;border-color:var(--mdc-theme-primary,#3f51b5);background-color:rgba(63,81,181,.12);border-width:1px;border-style:solid}.forge-file-picker.borderless{--forge-file-picker-width:100%;border:none}.forge-file-picker.borderless:not(.compact).highlight{border:none}.forge-file-picker.borderless+.forge-file-picker__helper-text{display:none}:host{width:auto;width:var(--forge-file-picker-width,auto);height:auto;height:var(--forge-file-picker-height,auto);display:inline-block}:host([hidden]){display:none}",a=class extends _{constructor(){super();f(this,F,O),this._foundation=new g(new d(this))}static get observedAttributes(){return[i.attributes.ACCEPT,i.attributes.MAX_SIZE,i.attributes.CAPTURE,i.attributes.MULTIPLE,i.attributes.DISABLED,i.attributes.COMPACT,i.attributes.BORDERLESS]}connectedCallback(){this._foundation.initialize()}disconnectedCallback(){this._foundation.destroy()}attributeChangedCallback(e,n,o){switch(e){case i.attributes.ACCEPT:this.accept=o;break;case i.attributes.MAX_SIZE:this.maxSize=u(o);break;case i.attributes.CAPTURE:this.capture=o;break;case i.attributes.MULTIPLE:this.multiple=p(o);break;case i.attributes.DISABLED:this.disabled=p(o);break;case i.attributes.COMPACT:this.compact=p(o);break;case i.attributes.BORDERLESS:this.borderless=p(o);break}}};s([l()],a.prototype,"accept",2),s([l()],a.prototype,"maxSize",2),s([l()],a.prototype,"capture",2),s([l()],a.prototype,"multiple",2),s([l()],a.prototype,"disabled",2),s([l()],a.prototype,"compact",2),s([l()],a.prototype,"borderless",2),a=s([b({name:i.elementName,dependencies:[x]})],a);var k=class extends y{constructor(t){super(t)}_build(){return document.createElement(i.elementName)}_configure(){var t,e,n,o;if((t=this._config.options)!=null&&t.primaryText){let r=document.createElement("span");r.slot="primary",r.textContent=this._config.options.primaryText,this._element.appendChild(r)}if((e=this._config.options)!=null&&e.secondaryText){let r=document.createElement("span");r.slot="secondary",r.textContent=this._config.options.secondaryText,this._element.appendChild(r)}if((n=this._config.options)!=null&&n.buttonText&&new D({options:{parent:this._element,text:this._config.options.buttonText},props:{type:"outlined"}}),(o=this._config.options)!=null&&o.helperText){let r=document.createElement("span");r.slot="helper-text",r.textContent=this._config.options.helperText,this._element.appendChild(r)}}onChange(t){this._element.addEventListener(i.events.FILES_CHANGED,e=>t(e.detail))}};function ce(){v(a)}export{i as a,d as b,g as c,a as d,k as e,ce as f};
7
- //# sourceMappingURL=chunk.4DJEZHRT.js.map
6
+ import{c as x,d as D}from"./chunk.UEN7B7Q4.js";import{a as y}from"./chunk.RFLASSCI.js";import{a as l}from"./chunk.NVUMRW44.js";import{a as E}from"./chunk.TKDMM2ZZ.js";import{a as b,b as L}from"./chunk.55FCNVG5.js";import{a as v,e as f,g as c,l as _}from"./chunk.QH2GB3PD.js";import{k as p,l as u}from"./chunk.J2M2MXP2.js";import{d as s}from"./chunk.M3QDAYD2.js";var C=`${L}file-picker`,I={ACCEPT:"accept",MAX_SIZE:"max-size",CAPTURE:"capture",MULTIPLE:"multiple",DISABLED:"disabled",COMPACT:"compact",BORDERLESS:"borderless"},T={HIGHLIGHT:"highlight",DISABLED:"disabled",COMPACT:"compact",BORDERLESS:"borderless"},S={CONTAINER:"container",BUTTON:"button",INPUT:"input"},A={CONTAINER:"#container",BUTTON:"#button",INPUT:"#input",BUTTON_SLOT:"#button-slot"},P={FILES_CHANGED:`${C}-change`},i={elementName:C,attributes:I,classes:T,ids:S,selectors:A,events:P};var d=class extends E{constructor(e){super(e);this._container=c(e,i.selectors.CONTAINER),this._buttonSlot=c(e,i.selectors.BUTTON_SLOT),this._input=c(e,i.selectors.INPUT),this._inputEventListener=()=>{this._input.value="",this._input.click()},this._container.addEventListener("click",this._inputEventListener)}registerButtonSlotListener(e){this._buttonSlot.addEventListener("slotchange",e)}registerInputChangeListener(e){this._input.addEventListener("change",e)}registerDragEnterListener(e){this._container.addEventListener("dragenter",e)}registerDragLeaveListener(e){this._container.addEventListener("dragleave",e)}registerDragOverListener(e){this._container.addEventListener("dragover",e)}registerDropListener(e){this._container.addEventListener("drop",e)}removeDragEnterListener(e){this._container.removeEventListener("dragenter",e)}removeDragLeaveListener(e){this._container.removeEventListener("dragleave",e)}removeDragOverListener(e){this._container.removeEventListener("dragover",e)}removeDropListener(e){this._container.removeEventListener("drop",e)}initializeButton(){let e=this._component.querySelector("button");this._button=e||void 0}setHighlightState(e){this._container.classList.contains(i.classes.HIGHLIGHT)!==e&&this._container.classList.toggle(i.classes.HIGHLIGHT)}setAccept(e){e?this._input.setAttribute("accept",e):this._input.removeAttribute("accept")}setCapture(e){e?this._input.setAttribute("capture",e):this._input.removeAttribute("capture")}setMultiple(e){e?this._input.setAttribute("multiple",""):this._input.removeAttribute("multiple")}setDisabled(e){var n,o;e?(this._container.removeEventListener("click",this._inputEventListener),(n=this._button)==null||n.setAttribute("disabled",""),this._container.setAttribute("disabled","")):(this._container.addEventListener("click",this._inputEventListener),(o=this._button)==null||o.removeAttribute("disabled"),this._container.removeAttribute("disabled"))}setCompact(e){this._container.classList.contains(i.classes.COMPACT)!==e&&this._container.classList.toggle(i.classes.COMPACT)}setBorderless(e){this._container.classList.contains(i.classes.BORDERLESS)!==e&&this._container.classList.toggle(i.classes.BORDERLESS)}};var g=class{constructor(t){this._adapter=t;this._isInitialized=!1;this._accept=null;this._maxSize=null;this._capture=null;this._multiple=!1;this._disabled=!1;this._compact=!1;this._borderless=!1;this._buttonSlotListener=e=>this._onButtonSlotChanged(e),this._inputChangeListener=e=>this._onInputChange(e),this._dragEnterListener=e=>this._onDragEnter(e),this._dragLeaveListener=e=>this._onDragLeave(e),this._dragOverListener=e=>this._onDragOver(e),this._dropListener=e=>this._onDrop(e),this._adapter.registerButtonSlotListener(this._buttonSlotListener),this._adapter.registerInputChangeListener(this._inputChangeListener),this._compact||this._registerDragListeners()}initialize(){this._adapter.initializeButton(),this._adapter.setDisabled(this._disabled),this._isInitialized=!0}destroy(){this._isInitialized=!1}_onButtonSlotChanged(t){this._adapter.initializeButton()}_onInputChange(t){let e=t.target.files;e&&this._handleFiles(e)}_onDragEnter(t){this._handleDragEvent(t,!0)}_onDragLeave(t){this._handleDragEvent(t,!1)}_onDragOver(t){this._handleDragEvent(t,!0)}_onDrop(t){if(this._handleDragEvent(t,!1),!this._disabled){let e=t.dataTransfer;if(e){let n=e.files;this._handleFiles(n)}}}_registerDragListeners(){this._adapter.registerDragEnterListener(this._dragEnterListener),this._adapter.registerDragLeaveListener(this._dragLeaveListener),this._adapter.registerDragOverListener(this._dragOverListener),this._adapter.registerDropListener(this._dropListener)}_removeDragListeners(){this._adapter.removeDragEnterListener(this._dragEnterListener),this._adapter.removeDragLeaveListener(this._dragLeaveListener),this._adapter.removeDragOverListener(this._dragOverListener),this._adapter.removeDropListener(this._dropListener)}_handleFiles(t){let e={};if(t){let n=this._sortFiles(t),o=n.legalFiles||null;!this._multiple&&o&&o.length>1&&(o=o.splice(1)),e=n}this._adapter.emitHostEvent(i.events.FILES_CHANGED,e)}_sortFiles(t){let e=[],n=[];if(!this._accept&&!this.maxSize)return e=Array.from(t),{legalFiles:e,illegalFiles:n};let o=this._accept?this._accept.split(",").map(r=>r.trim().toLowerCase()):[""];for(let r=0;r<t.length;r++)!o.some(m=>t[r].type.toLowerCase().match(m)||t[r].name.toLowerCase().match("\\"+m))||this._maxSize&&t[r].size>this._maxSize?n.push(t[r]):e.push(t[r]);return{legalFiles:e,illegalFiles:n}}_handleDragEvent(t,e){this._disabled||(t.preventDefault(),t.stopPropagation(),this._adapter.setHighlightState(e))}get accept(){return this._accept}set accept(t){this._accept!==t&&(this._accept=t,this._adapter.setAccept(t),this._adapter.toggleHostAttribute(i.attributes.ACCEPT,!!t,String(t)))}get maxSize(){return this._maxSize}set maxSize(t){this._maxSize!==t&&(this._maxSize=t,this._adapter.toggleHostAttribute(i.attributes.MAX_SIZE,!!t,String(t)))}get capture(){return this._capture}set capture(t){this._capture!==t&&(this._capture=t,this._adapter.setCapture(t),this._adapter.toggleHostAttribute(i.attributes.CAPTURE,!!t,String(t)))}get multiple(){return this._multiple}set multiple(t){this._multiple!==t&&(this._multiple=t,this._adapter.setMultiple(t),this._adapter.toggleHostAttribute(i.attributes.MULTIPLE,t))}get disabled(){return this._disabled}set disabled(t){this._disabled!==t&&(this._disabled=t,this._isInitialized&&this._adapter.setDisabled(t),this._adapter.toggleHostAttribute(i.attributes.DISABLED,t))}get compact(){return this._compact}set compact(t){this._compact!==t&&(this._compact=t,this._adapter.setCompact(t),t?this._removeDragListeners():this._registerDragListeners(),this._adapter.toggleHostAttribute(i.attributes.COMPACT,t))}get borderless(){return this._borderless}set borderless(t){this._borderless!==t&&(this._borderless=t,this._adapter.setBorderless(t),this._adapter.toggleHostAttribute(i.attributes.BORDERLESS,t))}};var F='<template><form class="forge-file-picker" id="container" part="form"><div class="forge-file-picker__primary" id="primary" part="primary"><slot name="primary"></slot></div><slot id="button-slot"></slot><div class="forge-file-picker__secondary" id="secondary" part="secondary"><slot name="secondary"></slot></div><input type="file" class="forge-file-picker__input" id="input" part="input"></form><div class="forge-file-picker__helper-text" part="helper-text-container"><slot name="helper-text"></slot></div></template>',O=".forge-file-picker{-webkit-box-sizing:border-box;box-sizing:border-box;width:100%;height:100%;background-color:rgba(189,189,189,.12);border:1px dashed #e0e0e0;display:grid;-webkit-box-pack:center;justify-content:center;align-content:center;gap:16px;padding:16px;text-align:center;cursor:pointer}.forge-file-picker__primary{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-subtitle1-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:1rem;font-size:var(--mdc-typography-subtitle1-font-size, 1rem);line-height:1.75rem;line-height:var(--mdc-typography-subtitle1-line-height, 1.75rem);font-weight:400;font-weight:var(--mdc-typography-subtitle1-font-weight,400);letter-spacing:.009375em;letter-spacing:var(--mdc-typography-subtitle1-letter-spacing, .009375em);text-decoration:inherit;-webkit-text-decoration:var(--mdc-typography-subtitle1-text-decoration,inherit);text-decoration:var(--mdc-typography-subtitle1-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-subtitle1-text-transform,inherit);color:rgba(0,0,0,.87);color:var(--mdc-theme-text-primary-on-background,rgba(0,0,0,.87));max-width:auto;max-width:var(--forge-file-picker-max-content-width,auto)}.forge-file-picker__secondary{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-size:.875rem;font-size:var(--forge-typography-subtitle2-secondary-font-size, .875rem);line-height:1.375rem;line-height:var(--forge-typography-subtitle2-secondary-line-height, 1.375rem);font-weight:400;font-weight:var(--forge-typography-subtitle2-secondary-font-weight,400);letter-spacing:.0087500001em;letter-spacing:var(--forge-typography-subtitle2-secondary-letter-spacing, .0087500001em);text-decoration:inherit;-webkit-text-decoration:var(--forge-typography-subtitle2-secondary-text-decoration,inherit);text-decoration:var(--forge-typography-subtitle2-secondary-text-decoration,inherit);text-transform:inherit;text-transform:var(--forge-typography-subtitle2-secondary-text-transform,inherit);color:var(--mdc-theme-text-secondary-on-background);color:var(--forge-typography-subtitle2-secondary-color,var(--mdc-theme-text-secondary-on-background));color:rgba(0,0,0,.87);color:var(--mdc-theme-text-primary-on-background,rgba(0,0,0,.87));max-width:auto;max-width:var(--forge-file-picker-max-content-width,auto)}.forge-file-picker__input{display:none}.forge-file-picker__helper-text ::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));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);display:block;min-height:1.5rem;line-height:normal;padding-top:4px;-webkit-box-sizing:border-box;box-sizing:border-box;color:rgba(0,0,0,.54);color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54));margin-left:12px;-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;text-decoration:var(--mdc-typography-caption-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-caption-text-transform,inherit);text-align:start}.forge-file-picker[disabled]{background-color:#fafafa;background-color:var(--mdc-theme-background,#fafafa);border-color:#e0e0e0;border-color:var(--forge-theme-border-color,#e0e0e0);opacity:.38;cursor:unset}.forge-file-picker.compact{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;background-color:transparent;border:none;padding:0}.forge-file-picker.compact .forge-file-picker__primary,.forge-file-picker.compact .forge-file-picker__secondary{display:none}.forge-file-picker.compact .forge-file-picker__button>button{width:auto;width:var(--forge-file-picker-width,auto);background-color:transparent}.forge-file-picker:not(.compact).highlight{border-color:#3f51b5;border-color:var(--mdc-theme-primary,#3f51b5);background-color:rgba(63,81,181,.12);border-width:1px;border-style:solid}.forge-file-picker.borderless{--forge-file-picker-width:100%;border:none}.forge-file-picker.borderless:not(.compact).highlight{border:none}.forge-file-picker.borderless+.forge-file-picker__helper-text{display:none}:host{width:auto;width:var(--forge-file-picker-width,auto);height:auto;height:var(--forge-file-picker-height,auto);display:inline-block}:host([hidden]){display:none}",a=class extends _{constructor(){super();f(this,F,O),this._foundation=new g(new d(this))}static get observedAttributes(){return[i.attributes.ACCEPT,i.attributes.MAX_SIZE,i.attributes.CAPTURE,i.attributes.MULTIPLE,i.attributes.DISABLED,i.attributes.COMPACT,i.attributes.BORDERLESS]}connectedCallback(){this._foundation.initialize()}disconnectedCallback(){this._foundation.destroy()}attributeChangedCallback(e,n,o){switch(e){case i.attributes.ACCEPT:this.accept=o;break;case i.attributes.MAX_SIZE:this.maxSize=u(o);break;case i.attributes.CAPTURE:this.capture=o;break;case i.attributes.MULTIPLE:this.multiple=p(o);break;case i.attributes.DISABLED:this.disabled=p(o);break;case i.attributes.COMPACT:this.compact=p(o);break;case i.attributes.BORDERLESS:this.borderless=p(o);break}}};s([l()],a.prototype,"accept",2),s([l()],a.prototype,"maxSize",2),s([l()],a.prototype,"capture",2),s([l()],a.prototype,"multiple",2),s([l()],a.prototype,"disabled",2),s([l()],a.prototype,"compact",2),s([l()],a.prototype,"borderless",2),a=s([b({name:i.elementName,dependencies:[x]})],a);var k=class extends y{constructor(t){super(t)}_build(){return document.createElement(i.elementName)}_configure(){var t,e,n,o;if((t=this._config.options)!=null&&t.primaryText){let r=document.createElement("span");r.slot="primary",r.textContent=this._config.options.primaryText,this._element.appendChild(r)}if((e=this._config.options)!=null&&e.secondaryText){let r=document.createElement("span");r.slot="secondary",r.textContent=this._config.options.secondaryText,this._element.appendChild(r)}if((n=this._config.options)!=null&&n.buttonText&&new D({options:{parent:this._element,text:this._config.options.buttonText},props:{type:"outlined"}}),(o=this._config.options)!=null&&o.helperText){let r=document.createElement("span");r.slot="helper-text",r.textContent=this._config.options.helperText,this._element.appendChild(r)}}onChange(t){this._element.addEventListener(i.events.FILES_CHANGED,e=>t(e.detail))}};function ce(){v(a)}export{i as a,d as b,g as c,a as d,k as e,ce as f};
7
+ //# sourceMappingURL=chunk.XARGY3WT.js.map
@@ -3,5 +3,5 @@
3
3
  * Copyright 2023 Tyler Technologies, Inc.
4
4
  * License: Apache-2.0
5
5
  */
6
- import{c as re,f as ce}from"./chunk.JUIFPTRV.js";import{a as M,d as ae}from"./chunk.NSTCCETU.js";import{a as ne}from"./chunk.QUJL4A23.js";import{a as $,b as x,c as v,d as K}from"./chunk.UV3WIHCM.js";import{a as H}from"./chunk.LEVFMI2Q.js";import{b as te}from"./chunk.MZLPUI6R.js";import{a as ie,d as se,l as oe}from"./chunk.T64UW37U.js";import{a as X}from"./chunk.G4IN6Y46.js";import{a as le}from"./chunk.RFLASSCI.js";import{a as T}from"./chunk.NVUMRW44.js";import{a as Q}from"./chunk.TKDMM2ZZ.js";import{a as j,b as ee}from"./chunk.55FCNVG5.js";import{a as q,l as J}from"./chunk.QH2GB3PD.js";import{d as R,e as F,f as p,g as D,i as W,j as U,t as Z}from"./chunk.CFDK4RCW.js";import{b as f,c as Y,d as I,h as y,j as g,k as L,l as G,o as V}from"./chunk.J2M2MXP2.js";import{a as h,d as _}from"./chunk.M3QDAYD2.js";var w=class{constructor(e){this._key=e,this._items=[]}getItems(){return[...this._items]}count(){return this._items.length}setKey(e){this._key=e}add(e){return e instanceof Array||(e=[e]),e.forEach(t=>{this.exists(t)||this._items.push(t)}),this}remove(e){e instanceof Array||(e=[e]);for(let t=e.length-1;t>=0;t--)this.exists(e[t])&&this._items.splice(this._items.indexOf(this._getItem(e[t])),1);return this}clear(){return this._items=[],this}exists(e){return this._getItem(e)!==null}_getItem(e){return this._key?x(this._items,v(this._key,e))||null:this._items.find(t=>t===e)||null}};var S=`${ee}table`,de={TABLE:"forge-table",TABLE_DENSE:"forge-table--dense",TABLE_ROOMY:"forge-table--roomy",TABLE_RESIZABLE:"forge-table--resizable",TABLE_RESIZING:"forge-table--resizing",TABLE_RESIZE_HANDLE:"forge-table__resize-handle",TABLE_NO_WRAP_CONTENT:"forge-table--no-wrap-content",TABLE_LAYOUT_FIXED:"forge-table--layout-fixed",TABLE_FILTER_VISIBLE:"forge-table--filter-visible",TABLE_FIXED:"forge-table--fixed",TABLE_HEAD:"forge-table-head",TABLE_HEAD_ROW:"forge-table-head__row",TABLE_HEAD_ROW_FILTER:"forge-table-head__row__filter",TABLE_HEAD_CELL:"forge-table-head__cell",TABLE_HEAD_CELL_CONTAINER:"forge-table-head__cell-container",TABLE_HEAD_CELL_SORTABLE:"forge-table-head__cell--sortable",TABLE_HEAD_CELL_SORT_ICON:"forge-table-head__cell-sort-icon",TABLE_HEAD_CELL_TEXT:"forge-table-head__cell-text",TABLE_HEAD_CELL_SORT_ICON_ACTIVE:"forge-table-head__cell-sort-icon--active",TABLE_HEAD_CELL_SORTED_ASCENDING:"forge-table-head__cell--sorted-ascending",TABLE_HEAD_CELL_SORTED_DESCENDING:"forge-table-head__cell--sorted-descending",TABLE_HEAD_CELL_SORT_ORDER:"forge-table-head__cell__sort-order",TABLE_HEAD_CELL_SORT_ORDER_HIDDEN:"forge-table-head__cell__sort-order--hidden",TABLE_BODY:"forge-table-body",TABLE_BODY_ROW:"forge-table-body__row",TABLE_BODY_ROW_SELECTED:"forge-table-body__row--selected",TABLE_BODY_ROW_CLICKABLE:"forge-table-body__row--clickable",TABLE_BODY_CELL:"forge-table-body__cell",TABLE_ROW:"forge-table-row",TABLE_ROW_EXPANDED:"forge-table-row--expanded",TABLE_ROW_EXPANDABLE_CONTENT:"forge-table-row__expandable-content",TABLE_ROW_EXPANDABLE_CONTENT_CELL:"forge-table-row__expandable-content-cell",TABLE_CELL:"forge-table-cell",TABLE_CELL_SELECT:"forge-table-cell__select",TABLE_CELL_SELECT_CHECKBOX:"forge-table-cell__select-checkbox",TABLE_CELL_SELECT_CHECKBOX_CONTAINER:"forge-table-cell__select-checkbox-container",TABLE_CELL_SELECT_CHECKBOX_CONTAINER_ALIGN_RIGHT:"forge-table-cell__select-checkbox-container--align-right",TABLE_CELL_SELECT_CHECKBOX_CONTAINER_ALIGN_LEFT:"forge-table-cell__select-checkbox-container--align-left",TABLE_CELL_SELECT_CHECKBOX_CONTAINER_ALIGN_CENTER:"forge-table-cell__select-checkbox-container--align-center",TABLE_CELL_CONTAINER:"forge-table-cell__container",TABLE_CELL_CONTAINER_TEXT:"forge-table-cell__container-text",TABLE_CELL_CENTER:"forge-table-cell--center",TABLE_CELL_RIGHT:"forge-table-cell--right",TABLE_CELL_RESIZABLE:"forge-table-cell--resizing"},Ee={TABLE:".forge-table",CHECKBOX_INPUT:"forge-checkbox > input[type=checkbox]:not([forge-ignore])",SELECT_ALL_TEMPLATE_CHECKBOX_INPUT:"input[type=checkbox]:not([forge-ignore])",ROW_SELECTED:`.${de.TABLE_BODY_ROW_SELECTED}`},_e={SELECT:"select",MULTISELECT:"multiselect",SELECT_KEY:"select-key",DENSE:"dense",ROOMY:"roomy",FILTER:"filter",FIXED_HEADERS:"fixed-headers",LAYOUT_TYPE:"layout-type",WRAP_CONTENT:"wrap-content",RESIZABLE:"resizable",MIN_RESIZE_WIDTH:"min-resize-width",ALLOW_ROW_CLICK:"allow-row-click",MULTI_COLUMN_SORT:"multi-column-sort",SELECT_CHECKBOX_ALIGNMENT:"select-checkbox-alignment",TOOLTIP_SELECT:"tooltip-select",TOOLTIP_SELECT_ALL:"tooltip-select-all",CHECKBOX_TYPE:"forge-checkbox-type",CUSTOM_CELL_TEMPLATE:"data-cell-template",CUSTOM_CELL_TEMPLATE_STOP_PROPAGATION:"data-cell-template-stop-propagation"},Te={ROW_CLICK:`${S}-row-click`,SELECT:`${S}-select`,SELECT_DOUBLE:`${S}-select-double`,SELECT_ALL:`${S}-select-all`,SORT:`${S}-sort`,FILTER:`${S}-filter`,INITIALIZED:`${S}-initialized`,COLUMN_RESIZE:`${S}-column-resize`},pe={SELECT_ALL:"select-all",SELECT_ROW:"select-row",DEFAULT_LAYOUT_TYPE:"auto"},Ce={SORT_DOWN:"arrow_downward"},he={DEFAULT_FILTER_DEBOUNCE_TIME:750,MIN_RESIZE_WIDTH:100,RESIZE_HOVER_DURATION:150},s={elementName:S,classes:de,selectors:Ee,attributes:_e,events:Te,strings:pe,icons:Ce,numbers:he};var B=(l=>(l.Left="left",l.Right="right",l.Center="center",l))(B||{}),O=(l=>(l.Ascending="ASC",l.Descending="DESC",l.Unset="UNSET",l))(O||{}),Le=(a=>(a.InputText="text",a.InputNumber="number",a.Select="select",a.SelectMultiple="select-multiple",a.Date="date",a.DateRange="date-range",a))(Le||{});function me(n){return n&&typeof n=="object"&&"content"in n}var b=class n{static createTable(e){n._resetTable(e.tableElement);let t=n._createTableHead(e),l=n._createTableBody(e);e.clickListener&&(n._attachRowClickListeners(l,e.clickListener,e.doubleClickListener),n._addRowClickAttributes(l)),e.fixedHeaders&&n.setFixedHeaders(e),e.resizable&&n.setResizable(e),e.dense&&n.setDenseState(e.tableElement,e.dense),e.wrapContent&&n.setWrapContentState(e.tableElement,e.wrapContent),e.selectListener&&n._addSelectColumn(t,l,e.selectListener,e.selectAllListener,e.selectAllTemplate,e.selectCheckboxAlignment,e.data,e.tooltipSelect,e.tooltipSelectAll),(e.resizable||e.columnConfigurations.some(i=>!!i.sortable))&&(n._attachHeadRowMouseDownListener(t,e.headRowMouseDownListener),n._isMac()&&n._attachHeadRowContextMenuListener(t,e.headRowContextMenuListener)),n.setLayoutType(e),n._setTableHead(e.tableElement,t),e.filter&&n.setFilterRow(e),n._setTableBody(e.tableElement,l)}static _setTableHead(e,t){e.tHead?F(t,e.tHead):e.appendChild(t)}static _setTableBody(e,t){e.tBodies.length?F(t,e.tBodies[0]):e.appendChild(t)}static recreateTableBody(e){let t=n._createTableBody(e);e.clickListener&&(n._attachRowClickListeners(t,e.clickListener,e.doubleClickListener),n._addRowClickAttributes(t)),e.selectListener&&(n._createBodySelectColumn(t,e.selectCheckboxAlignment,e.data,e.tooltipSelect,e.tooltipSelectAll),n._attachRowSelectListeners(t,e.selectListener)),n._setTableBody(e.tableElement,t)}static _resetTable(e){R(e)}static _createMultisortTooltip(){let e=document.createElement(ne.elementName);return e.textContent="Ctrl + click to sort multiple columns",e.position="bottom",e.delay=0,e}static _createTableHead(e){let t=document.createElement("thead"),l=t.insertRow();p([s.classes.TABLE_ROW,s.classes.TABLE_HEAD_ROW],l);let i=!1;for(let o=0;o<e.columnConfigurations.length;o++){let a=e.columnConfigurations[o],r=document.createElement("th");r.scope="col",p([s.classes.TABLE_CELL,s.classes.TABLE_HEAD_CELL],r);let c=document.createElement("div");if(c.classList.add(s.classes.TABLE_HEAD_CELL_CONTAINER),e.multiColumnSort){let d=n._createMultisortTooltip();c.appendChild(d)}if(a.align&&n._setCellAlignmentClass(c,a.align),f(a.width)){let d=U(a.width);d&&(r.style.width=d)}if(e.resizable&&a.resizable!==!1){let d=document.createElement("div");d.classList.add(s.classes.TABLE_RESIZE_HANDLE),r.appendChild(d)}f(a.headerCellStyle)&&g(a.headerCellStyle)&&(Object.assign(r.style,a.headerCellStyle),Object.assign(c.style,a.headerCellStyle));let m=document.createElement("span");if(m.classList.add(s.classes.TABLE_HEAD_CELL_TEXT),m.textContent=a.header&&typeof a.header=="string"?a.header.trim():"",a.sortable){r.classList.add(s.classes.TABLE_HEAD_CELL_SORTABLE);let d=document.createElement("span");p([s.classes.TABLE_HEAD_CELL_SORT_ORDER_HIDDEN,s.classes.TABLE_HEAD_CELL_SORT_ORDER],d);let u=document.createElement(ie.elementName);u.name=s.icons.SORT_DOWN,p([s.classes.TABLE_HEAD_CELL_SORT_ICON],u),e.multiColumnSort?typeof a.initialSort=="object"&&a.initialSort.sortOrder&&(d.textContent=a.initialSort.sortOrder.toString(),e.columnConfigurations.filter(C=>typeof C.initialSort=="object").length>1&&D(s.classes.TABLE_HEAD_CELL_SORT_ORDER_HIDDEN,d),r.classList.add(s.classes.TABLE_HEAD_CELL_SORTED_DESCENDING),u.classList.add(s.classes.TABLE_HEAD_CELL_SORT_ICON_ACTIVE),n._setColumnSortDirection(r,a.initialSort.direction)):e.sortedColumn===o&&!i&&!e.multiColumnSort&&(r.classList.add(s.classes.TABLE_HEAD_CELL_SORTED_DESCENDING),u.classList.add(s.classes.TABLE_HEAD_CELL_SORT_ICON_ACTIVE),n._setColumnSortDirection(r,e.sortDirection),i=!0),c.appendChild(u),c.appendChild(d)}typeof a.headerTemplate=="function"?Promise.resolve(a.headerTemplate(o,c,a)).then(d=>{if(d){let u=document.createElement("div");p(s.classes.TABLE_CELL_CONTAINER,u),typeof d=="string"?u.innerHTML=d:n._prepend(d,u),u.setAttribute(s.attributes.CUSTOM_CELL_TEMPLATE,""),n._prepend(u,c)}}):n._prepend(m,c),r.appendChild(c),l.appendChild(r)}return t}static setSortDirection(e,t,l){let i=n._getHeaderCellByIndex(e,t);n._setColumnSortDirection(i,l)}static _setColumnSortDirection(e,t){e.classList.contains(s.classes.TABLE_HEAD_CELL_SORTED_ASCENDING)&&e.classList.remove(s.classes.TABLE_HEAD_CELL_SORTED_ASCENDING),e.classList.contains(s.classes.TABLE_HEAD_CELL_SORTED_DESCENDING)&&e.classList.remove(s.classes.TABLE_HEAD_CELL_SORTED_DESCENDING),!t||t==="DESC"?e.classList.add(s.classes.TABLE_HEAD_CELL_SORTED_DESCENDING):e.classList.add(s.classes.TABLE_HEAD_CELL_SORTED_ASCENDING)}static _createTableBody(e){let t=document.createElement("tbody");return n._getOrderedRowData(e.columnConfigurations,e.data).forEach((i,o)=>{let a=t.insertRow();p([s.classes.TABLE_ROW,s.classes.TABLE_BODY_ROW],a),n._populateRowCells(e,a,i,o),typeof e.rowCreatedCallback=="function"&&e.rowCreatedCallback(a,o,h({},e.data[o].data))}),t}static _populateRowCells(e,t,l,i){for(let o=0;o<l.length;o++){let a=e.columnConfigurations[o],r=t.insertCell();if(p([s.classes.TABLE_CELL,s.classes.TABLE_BODY_CELL],r),f(a.width)){let m=U(a.width);m&&(r.style.width=m)}let c=document.createElement("div");if(c.classList.add(s.classes.TABLE_CELL_CONTAINER),f(a.cellStyle)&&g(a.cellStyle)&&(Object.assign(r.style,a.cellStyle),Object.assign(c.style,a.cellStyle)),a.template&&typeof a.template=="function"){let m=e.data[i]?e.data[i].data:void 0;Promise.resolve(a.template(i,c,m,o)).then(d=>{let u=me(d)?d:{content:d,stopClickPropagation:a.stopCellTemplateClickPropagation};u.content&&(typeof u.content=="string"?c.innerHTML=u.content:c.appendChild(u.content),c.setAttribute(s.attributes.CUSTOM_CELL_TEMPLATE,""),u.stopClickPropagation&&c.setAttribute(s.attributes.CUSTOM_CELL_TEMPLATE_STOP_PROPAGATION,""))})}else if(a.property){let m=document.createElement("span");m.classList.add(s.classes.TABLE_CELL_CONTAINER_TEXT),c.appendChild(m),a.transform&&typeof a.transform=="function"?Promise.resolve(a.transform(l[o])).then(d=>m.textContent=d):l[o]==null?m.textContent="":m.textContent=l[o].toString()}if(a.align&&n._setCellAlignmentClass(c,a.align),r.appendChild(c),f(a.columnSpan)){if(a.columnSpan==="all"){r.colSpan=l.length-o;break}else if(typeof a.columnSpan=="number"&&a.columnSpan>0){let m=a.columnSpan;a.columnSpan>l.length-o&&(m=l.length),r.colSpan=m,o=o+(m-1)}}typeof e.cellCreatedCallback=="function"&&e.cellCreatedCallback(r,i,o)}}static _setCellAlignmentClass(e,t){switch(t){case"center":e.classList.add(s.classes.TABLE_CELL_CENTER);break;case"right":e.classList.add(s.classes.TABLE_CELL_RIGHT);break}}static _getNonExpandedRows(e){return Array.from(e).filter(t=>!t.classList.contains(s.classes.TABLE_ROW_EXPANDABLE_CONTENT))}static _getExpandedRows(e){return Array.from(e).filter(t=>t.classList.contains(s.classes.TABLE_ROW_EXPANDABLE_CONTENT))}static _createColumnDataMap(e,t){return e.map(l=>({config:l,data:t.map(i=>{if(l.property){let o=$(i.data,l.property);return f(o)?o:null}return null})}))}static _getOrderedRowData(e,t){let l=n._createColumnDataMap(e,t),i=[];for(let o of l)for(let a=0;a<o.data.length;a++)i[a]||(i[a]=[]),i[a].push(o.data[a]);return i}static _attachRowClickListeners(e,t,l){n._getNonExpandedRows(e.rows).forEach(o=>{o.addEventListener("click",t),l&&o.addEventListener("dblclick",l)})}static _addRowClickAttributes(e){n._getNonExpandedRows(e.rows).forEach(l=>{l.classList.add(s.classes.TABLE_BODY_ROW_CLICKABLE)})}static _removeRowClickAttributes(e){n._getNonExpandedRows(e.rows).forEach(l=>{l.classList.remove(s.classes.TABLE_BODY_ROW_CLICKABLE)})}static _attachRowSelectListeners(e,t){n._getNonExpandedRows(e.rows).forEach(i=>n._attachRowSelectListener(i,t))}static _attachRowSelectListener(e,t){let l=n._getCheckboxElement(e);l==null||l.addEventListener("click",t)}static _detachRowSelectListeners(e,t){Array.from(e.rows).forEach(l=>{let i=n._getCheckboxElement(l);i==null||i.removeEventListener("click",t)})}static _detachRowClickListeners(e,t,l){Array.from(e.rows).forEach(i=>{i.removeEventListener("click",t),i.removeEventListener("dblclick",l)})}static _attachSelectAllListener(e,t){let l=e.rows[e.rows.length-1],i=n._getCheckboxElement(l);if(!i)throw new Error("Checkbox element not found.");i.addEventListener("change",t)}static _tryAttachSelectAllTemplateListener(e,t){let l=e.rows[e.rows.length-1],i=n._tryGetSelectAllCheckboxElement(l);i&&i.addEventListener("change",t)}static _detachSelectAllListener(e,t){let l=e.rows[e.rows.length-1],i=n._tryGetSelectAllCheckboxElement(l);i&&i.removeEventListener("change",t)}static _attachHeadRowMouseDownListener(e,t){let l=e.rows[0];if(!l)throw new Error("Missing table header row. Unable to attach sort listener.");l.addEventListener("mousedown",t)}static _attachHeadRowContextMenuListener(e,t){let l=e.rows[0];if(!l)throw new Error("Missing table header row. Unable to attach sort listener.");l.addEventListener("contextmenu",t)}static _createSelectColumn(e,t,l,i,o,a,r,c,m){e&&n._createHeadSelectColumn(e,l,i,o,a,m),t&&n._createBodySelectColumn(t,a,r,c,m)}static _createHeadSelectColumn(e,t,l,i,o,a){var r;if(Array.from(e.rows).forEach(c=>{let m=document.createElement("th");p([s.classes.TABLE_CELL,s.classes.TABLE_HEAD_CELL],m),c.insertBefore(m,c.cells.item(0))}),t){let c=(r=e.rows.item(e.rows.length-1))==null?void 0:r.cells.item(0);c.classList.add(s.classes.TABLE_CELL_SELECT),typeof l=="function"?n._renderSelectAllTemplate(l,e).then(()=>{typeof i=="function"&&i()}):c==null||c.appendChild(n._createCheckboxElement(!0,o,null,null,null,a))}}static _createBodySelectColumn(e,t,l,i,o){if(n._getNonExpandedRows(e.rows).forEach((r,c)=>n._addRowSelectColumn(r,t,c,l[c],i,o)),e.rows.length){let r=e.rows.item(0);r&&n._updateExpandedRowColspan(e.rows,r.cells.length)}}static _addRowSelectColumn(e,t,l,i,o,a){let r=e.insertCell(0);p([s.classes.TABLE_CELL,s.classes.TABLE_BODY_CELL,s.classes.TABLE_CELL_SELECT],r),r.appendChild(n._createCheckboxElement(!1,t,l,i,o,a))}static _destroySelectColumn(e,t){let l=n._getNonExpandedRows(t.rows);if(Array.from(e.rows).forEach(i=>i.removeChild(i.cells.item(0))),Array.from(l).forEach(i=>i.removeChild(i.cells.item(0))),t.rows.length){let i=t.rows.item(0);i&&n._updateExpandedRowColspan(t.rows,i.cells.length)}}static _hasSelectColumn(e,t){return[...Array.from(e.rows),...Array.from(t.rows)].some(i=>i.cells.item(0).classList.contains(s.classes.TABLE_CELL_SELECT))}static _createCheckboxElement(e,t,l,i,o,a){let r=document.createElement("div");if(r.classList.add(s.classes.TABLE_CELL_SELECT_CHECKBOX_CONTAINER),t)switch(t){case"center":r.classList.add(s.classes.TABLE_CELL_SELECT_CHECKBOX_CONTAINER_ALIGN_CENTER);break;case"left":r.classList.add(s.classes.TABLE_CELL_SELECT_CHECKBOX_CONTAINER_ALIGN_LEFT);break;case"right":r.classList.add(s.classes.TABLE_CELL_SELECT_CHECKBOX_CONTAINER_ALIGN_RIGHT);break}let c=document.createElement(re.elementName),m=document.createElement("input");m.type="checkbox";let d=o||"";i&&typeof o=="function"&&(d=o.call(null,l,i.data));let u=document.createElement("forge-tooltip");return u.position="left",e?u.textContent=a||"":u.textContent=d,m.setAttribute("aria-label","Select row"),c.appendChild(m),r.appendChild(u),r.appendChild(c),r}static _getCheckboxElement(e){let t=e.querySelector(`.${s.classes.TABLE_CELL_SELECT}`);return t?t.querySelector(s.selectors.CHECKBOX_INPUT):null}static _tryGetSelectAllCheckboxElement(e){let t=e.querySelector(`.${s.classes.TABLE_CELL_SELECT}`);return t?t.querySelector(s.selectors.CHECKBOX_INPUT)||t.querySelector(s.selectors.SELECT_ALL_TEMPLATE_CHECKBOX_INPUT):null}static _setSelectedCheckboxState(e,t){e&&(e.checked=t)}static _setIndeterminateCheckboxState(e,t){e&&(e.indeterminate=t)}static _setRowSelectedState(e,t){t?e.classList.contains(s.classes.TABLE_BODY_ROW_SELECTED)||e.classList.add(s.classes.TABLE_BODY_ROW_SELECTED):e.classList.remove(s.classes.TABLE_BODY_ROW_SELECTED)}static _updateExpandedRowColspan(e,t){n._getExpandedRows(e).forEach(i=>{let o=i.cells.item(0);o&&(o.colSpan=t)})}static updateSelectedState(e,t){n._setRowSelectedState(e,t);let l=n._getCheckboxElement(e);l&&n._setSelectedCheckboxState(l,t)}static getRowByIndex(e,t){return n._getNonExpandedRows(e.tBodies[0].rows)[t]}static updateSelectAllState(e,t,l){if(!e.tHead)return;let i=e.tHead.rows[e.tHead.rows.length-1],o=n._tryGetSelectAllCheckboxElement(i);o&&(n._setSelectedCheckboxState(o,t),n._setIndeterminateCheckboxState(o,!!l))}static setSelectedRows(e,t,l,i,o=!1){if(!e.tBodies.length)return;o||n.clearSelectedRows(e);let a=e.tBodies[0].rows,r=0;i.length&&Array.from(a).forEach((c,m)=>{let d=l[m];if(x(i,v(t,d))){n._setRowSelectedState(c,!0);let C=n._getCheckboxElement(c);C&&n._setSelectedCheckboxState(C,!0),r++}}),n.updateSelectAllState(e,r>0&&a.length===r)}static clearSelectedRows(e){if(!e.tBodies.length)return;n._getNonExpandedRows(e.tBodies[0].rows).forEach(l=>{n._setRowSelectedState(l,!1);let i=n._getCheckboxElement(l);i&&n._setSelectedCheckboxState(i,!1)})}static setSortedColumn(e,t,l){let i=n._getHeaderCellByIndex(e,t);n._getSortIconElementFromHeaderCell(i).classList.add(s.classes.TABLE_HEAD_CELL_SORT_ICON_ACTIVE),n._setColumnSortDirection(i,l)}static setMultiSortColumnSortNumber(e,t,l,i){let r=n._getHeaderCellByIndex(e,l).querySelector(`.${s.classes.TABLE_HEAD_CELL_CONTAINER}`).querySelector(`.${s.classes.TABLE_HEAD_CELL_SORT_ORDER}`);r&&(Z(r,typeof i!="number"||!t,s.classes.TABLE_HEAD_CELL_SORT_ORDER_HIDDEN),i&&(r.textContent=i.toString()))}static removeColumnSort(e,t){let l=n._getHeaderCellByIndex(e,t);l.classList.contains(s.classes.TABLE_HEAD_CELL_SORTED_ASCENDING)&&l.classList.remove(s.classes.TABLE_HEAD_CELL_SORTED_ASCENDING),l.classList.contains(s.classes.TABLE_HEAD_CELL_SORTED_DESCENDING)&&l.classList.remove(s.classes.TABLE_HEAD_CELL_SORTED_DESCENDING);let i=n._getSortIconElementFromHeaderCell(l);i&&i.classList.contains(s.classes.TABLE_HEAD_CELL_SORT_ICON_ACTIVE)&&i.classList.remove(s.classes.TABLE_HEAD_CELL_SORT_ICON_ACTIVE)}static _getHeaderCellByIndex(e,t){if(!e.tHead)throw new Error("Table head element cannot be null.");return e.tHead.rows.item(0).cells.item(t)}static _getSortIconElementFromHeaderCell(e){return e.querySelector(`.${s.classes.TABLE_HEAD_CELL_SORT_ICON}`)}static setSelectColumnVisibility(e,t,l,i,o,a,r,c,m){let d=e.tHead,u=e.tBodies[0];!d||!u||(t?n._addSelectColumn(d,u,l,i,o,a,r,c,m):n._hasSelectColumn(d,u)&&(l&&n._detachRowSelectListeners(u,l),i&&n._detachSelectAllListener(d,i),n._destroySelectColumn(d,u)))}static _addSelectColumn(e,t,l,i,o,a,r,c,m){n._createSelectColumn(e,t,!!i,o,()=>{i&&n._tryAttachSelectAllTemplateListener(e,i)},a,r,c,m),l&&n._attachRowSelectListeners(t,l),i&&!o&&n._tryAttachSelectAllTemplateListener(e,i)}static setDenseState(e,t){e.classList.contains(s.classes.TABLE_DENSE)&&e.classList.remove(s.classes.TABLE_DENSE),t&&e.classList.add(s.classes.TABLE_DENSE)}static setRoomyState(e,t){e.classList.contains(s.classes.TABLE_ROOMY)&&e.classList.remove(s.classes.TABLE_ROOMY),t&&e.classList.add(s.classes.TABLE_ROOMY)}static setResizable(e){let t=e.tableElement.tHead;e.resizable?(e.tableElement.classList.add(s.classes.TABLE_RESIZABLE),n._addResizeHandles(t,e)):(e.tableElement.classList.remove(s.classes.TABLE_RESIZABLE),n._removeResizeHandles(t,e))}static _addResizeHandles(e,t){if(!e)return;let l=e.rows.item(0);if(l){let i=Array.from(l.cells);t.selectListener&&(i=i.slice(1));for(let o of i){let a=i.indexOf(o);if(t.columnConfigurations[a].resizable!==!1){let c=document.createElement("div");c.classList.add(s.classes.TABLE_RESIZE_HANDLE),o.appendChild(c)}}}}static _removeResizeHandles(e,t){if(!e)return;let l=e.rows.item(0);if(l){let i=Array.from(l.cells);t.selectListener&&(i=i.slice(1));for(let o of i){let a=document.querySelector(`.${s.classes.TABLE_RESIZE_HANDLE}`);a&&o.removeChild(a)}}}static setWrapContentState(e,t){t?e.classList.remove(s.classes.TABLE_NO_WRAP_CONTENT):e.classList.add(s.classes.TABLE_NO_WRAP_CONTENT)}static setSelectAllVisibility(e,t,l,i,o,a){let r=e.tHead;if(!r)return;!t&&l&&n._detachSelectAllListener(r,l);let m=r.rows[r.rows.length-1].cells.item(0);t?m.childElementCount||(m.classList.add(s.classes.TABLE_CELL_SELECT),i?n._renderSelectAllTemplate(i,r).then(()=>{l&&n._tryAttachSelectAllTemplateListener(r,l)}):m.appendChild(n._createCheckboxElement(!0,o||null,null,null,null,a)),l&&!i&&n._attachSelectAllListener(r,l)):(l&&n._detachSelectAllListener(r,l),R(m))}static setFilterRow(e){if(!e.tableElement.tHead)return;let t=n._getFilterRowElement(e.tableElement.tHead),l;if(e.filter?e.tableElement.classList.add(s.classes.TABLE_FILTER_VISIBLE):e.tableElement.classList.remove(s.classes.TABLE_FILTER_VISIBLE),e.filter&&!t){if(e.columnConfigurations.every(o=>!o.filter))return;e.selectListener&&e.selectAllListener&&(l=e.tableElement.tHead.rows[e.tableElement.tHead.rows.length-1].cells.item(0));let i=n._createFilterRowElement(e);i&&l&&Array.from(l.children).forEach(o=>{var a;(a=i.cells.item(0))==null||a.appendChild(o)})}else if(!e.filter&&t){if(e.selectListener&&e.selectAllListener){l=t.cells.item(0);let i=Array.from(e.tableElement.tHead.rows).indexOf(t)-1,o=e.tableElement.tHead.rows.item(i);o&&Array.from(l.children).forEach(a=>{var r;(r=o.cells.item(0))==null||r.appendChild(a)})}W(t)}}static _createFilterRowElement(e){if(!e.tableElement.tHead)throw new Error("Table head element cannot be null.");let t=e.tableElement.tHead.insertRow();if(p([s.classes.TABLE_ROW,s.classes.TABLE_HEAD_ROW_FILTER],t),e.selectListener){let l=document.createElement("th");p([s.classes.TABLE_CELL,s.classes.TABLE_HEAD_CELL],l),t.insertBefore(l,t.cells[0]),l.classList.add(s.classes.TABLE_CELL_SELECT)}return e.columnConfigurations.forEach((l,i)=>{let o=document.createElement("th");if(p([s.classes.TABLE_CELL,s.classes.TABLE_HEAD_CELL],o),l.filter&&f(l.filterDelegate)){let a=document.createElement("div");a.classList.add(s.classes.TABLE_HEAD_CELL_CONTAINER),l.align&&n._setCellAlignmentClass(a,l.align);let r=n._createFilterElement(l,i,e.filterListener);a.appendChild(r),o.appendChild(a)}t.appendChild(o)}),t}static _createFilterElement(e,t,l){let i;if(y(e.filterDelegate))i=e.filterDelegate();else if(e.filterDelegate instanceof X||e.filterDelegate instanceof le)i=e.filterDelegate;else throw new Error("Invalid filter delegate.");if(l&&i instanceof X&&y(i.onChange))if(!f(e.filterDebounceTime)||I(e.filterDebounceTime)){let o=f(e.filterDebounceTime)?e.filterDebounceTime:s.numbers.DEFAULT_FILTER_DEBOUNCE_TIME;i.onChange(V(a=>l(a,t),o))}else i.onChange(o=>l(o,t));return i.element}static _getFilterRowElement(e){if(e)return Array.from(e.rows).find(t=>t.classList.contains(s.classes.TABLE_HEAD_ROW_FILTER))}static async expandRow(e,t,l){let i=e.tableElement.tBodies[0],a=n._getNonExpandedRows(i.rows)[t];a.classList.add(s.classes.TABLE_ROW_EXPANDED);let r=Array.from(i.rows).indexOf(a),c=i.insertRow(r+1);p([s.classes.TABLE_ROW,s.classes.TABLE_BODY_ROW,s.classes.TABLE_ROW_EXPANDABLE_CONTENT],c);let m=c.insertCell();m.setAttribute("colspan",a.cells.length.toString()),m.classList.add(s.classes.TABLE_ROW_EXPANDABLE_CONTENT_CELL);let d=document.createElement("div"),u=document.createElement(M.elementName);u.appendChild(d),m.appendChild(u);let C=l;if(y(l)){let ue=e.data[t]?e.data[t].data:void 0,be=l(t,d,ue);try{let A=await Promise.resolve(be);C=me(A)?A.content:A}catch(A){console.error("Failed to load row template "+A.message),C=""}}C&&n._setRowTemplate(d,C),window.requestAnimationFrame(()=>u.open=!0)}static _setRowTemplate(e,t){Y(t)?e.innerHTML=t:e.appendChild(t)}static collapseRow(e,t){if(!e.tableElement||!e.tableElement.tBodies.length||!e.tableElement.tBodies[0].rows.length)return Promise.resolve();let l=e.tableElement.tBodies[0],o=n._getNonExpandedRows(l.rows)[t],a=Array.from(l.rows).indexOf(o);if(o&&o.classList.contains(s.classes.TABLE_ROW_EXPANDED)){let r=l.rows[a+1],c=r.querySelector(M.elementName);if(c&&c.open)return c.open=!1,new Promise(m=>{setTimeout(()=>{o.classList.remove(s.classes.TABLE_ROW_EXPANDED),W(r),m()},M.numbers.COLLAPSE_ANIMATION_DURATION)})}return Promise.resolve()}static isRowExpanded(e,t){let l=e.tableElement.tBodies[0],o=n._getNonExpandedRows(l.rows)[t];return o&&o.classList.contains(s.classes.TABLE_ROW_EXPANDED)}static setFixedHeaders(e){e.fixedHeaders?e.tableElement.classList.add(s.classes.TABLE_FIXED):e.tableElement.classList.remove(s.classes.TABLE_FIXED)}static setLayoutType(e){e.layoutType==="fixed"?e.tableElement.classList.add(s.classes.TABLE_LAYOUT_FIXED):e.tableElement.classList.remove(s.classes.TABLE_LAYOUT_FIXED)}static normalizeColumnWidths(e){let t=e.tableElement;if(t.tHead&&t.tHead.rows.length){let l=Array.from(t.tHead.rows[0].cells);for(let i of l){let o=getComputedStyle(i).width;i.style.width&&i.style.width!==o&&(i.style.width=o)}}}static setColumnResizeIndicatorVisibility(e,t,l){let i=e.tableElement;if(i.tHead&&i.tHead.rows.length){let o=Array.from(i.tHead.rows);for(let a of o){let r=a.cells[t];r&&(l?r.classList.add(s.classes.TABLE_CELL_RESIZABLE):r.classList.remove(s.classes.TABLE_CELL_RESIZABLE))}}if(i.tBodies.length){let o=Array.from(i.tBodies[0].rows);for(let a of o){let r=a.cells[t];r&&(l?r.classList.add(s.classes.TABLE_CELL_RESIZABLE):r.classList.remove(s.classes.TABLE_CELL_RESIZABLE))}}}static setRowClickListeners(e,t,l,i){let o=e.tBodies[0];o&&(t?n._attachRowClickListeners(o,l,i):n._detachRowClickListeners(o,l,i))}static setRowClickAttributes(e,t){let l=e.tBodies[0];l&&(t?n._addRowClickAttributes(l):n._removeRowClickAttributes(l))}static getOwnerDocument(e){return e.ownerDocument||document}static _prepend(e,t){let l=t.childNodes.item(0);l?t.insertBefore(e,l):t.appendChild(e)}static _isMac(){return!!(navigator&&navigator.platform&&navigator.platform.substr(0,3)==="Mac")}static _renderSelectAllTemplate(e,t){return Promise.resolve(e()).then(l=>{let i=t.rows.item(t.rows.length-1);if(!i)return;let o=i.cells.item(0);l&&o&&(typeof l=="string"?o.innerHTML=l:l instanceof HTMLElement&&o.appendChild(l),o.setAttribute(s.attributes.CUSTOM_CELL_TEMPLATE,""))})}};var N=class extends Q{constructor(t){super(t)}initialize(){this._tableElement||(this._tableElement=document.createElement("table"),this._tableElement.classList.add(s.classes.TABLE),this._component.children.length&&R(this._component),this._component.appendChild(this._tableElement))}getTableElement(){return this._tableElement||this.initialize(),this._tableElement}createTable(t){return b.createTable(t)}recreateTableBody(t){b.recreateTableBody(t)}setSelectedRows(t,l,i,o,a=!1){b.setSelectedRows(t,l,i,o,a)}clearSelectedRows(t){b.clearSelectedRows(t)}updateSelectedState(t,l){b.updateSelectedState(t,l)}updateSelectAllState(t,l,i){b.updateSelectAllState(t,l,i)}setSortedColumn(t,l,i){b.setSortedColumn(t,l,i)}removeColumnSort(t,l){b.removeColumnSort(t,l)}setSortDirection(t,l,i){b.setSortDirection(t,l,i)}setSelectColumnVisibility(t,l,i,o,a,r,c,m,d){b.setSelectColumnVisibility(t,l,i,o||null,a||null,r||null,c||[],m||null,d||null)}setDense(t,l){b.setDenseState(t,l)}setRoomy(t,l){b.setRoomyState(t,l)}setResizable(t){b.setResizable(t)}setSelectAllVisibility(t,l,i,o,a,r=null){b.setSelectAllVisibility(t,l,i,o,a||null,r||null)}setFilterRow(t){b.setFilterRow(t)}expandRow(t,l,i){return b.expandRow(t,l,i)}collapseRow(t,l){return b.collapseRow(t,l)}isRowExpanded(t,l){return b.isRowExpanded(t,l)}setFixedHeaders(t){b.setFixedHeaders(t)}setTableLayoutType(t){b.setLayoutType(t)}setWrapContentState(t){b.setWrapContentState(t.tableElement,t.wrapContent)}addDocumentListener(t,l){b.getOwnerDocument(this._component).addEventListener(t,l)}removeDocumentListener(t,l){b.getOwnerDocument(this._component).removeEventListener(t,l)}normalizeColumnWidths(t){b.normalizeColumnWidths(t)}setResizeColumnVisibility(t,l,i){b.setColumnResizeIndicatorVisibility(t,l,i)}addTableClass(t){p(t,this._tableElement)}removeTableClass(t){D(t,this._tableElement)}setRowClickListeners(t,l,i,o){b.setRowClickListeners(t,l,i,o)}setRowClickAttributes(t,l){b.setRowClickAttributes(t,l)}};var k=class{constructor(){this._sortedColumns=[]}get sortedColumns(){return[...this._sortedColumns.map(e=>h({},e))]}addSortColumn(e){this._sortedColumns.push(h({},e)),this._updateSortNumbers()}updateSortColumn(e){let t=this._sortedColumns.find(l=>l.columnIndex===e.columnIndex);if(t)switch(t.direction){case"ASC":this.removeSortColumn(e);break;case"DESC":t.direction="ASC";break;case"UNSET":t.direction="DESC";break}}setSortColumns(e){this._sortedColumns=[...e.map(t=>h({},t))]}removeSortColumn(e){typeof e=="number"?this._sortedColumns.splice(e,1):this._sortedColumns.splice(this._sortedColumns.indexOf(e),1),this._updateSortNumbers()}isSortColumn(e){return typeof e=="number"?this._sortedColumns.some(t=>t.columnIndex===e):this._sortedColumns.includes(e)}clearMultiSort(){this._sortedColumns=[]}getSortColumn(e){return this._sortedColumns.find(t=>t.columnIndex===e)}_updateSortNumbers(){this._sortedColumns.every(e=>typeof e.sortOrder=="number")&&this._sortedColumns.sort((e,t)=>e.sortOrder-t.sortOrder),this._sortedColumns.forEach((e,t)=>e.sortOrder=t+1)}};var P=class{constructor(e,t=!1){this.data=e;this.selected=t}};var z=class{constructor(e){this._adapter=e;this._tableRows=[];this._data=[];this._columnConfigurations=[];this._select=!1;this._multiselect=!0;this._dense=!1;this._roomy=!1;this._filter=!1;this._fixedHeaders=!1;this._layoutType=s.strings.DEFAULT_LAYOUT_TYPE;this._wrapContent=!0;this._resizable=!1;this._minResizeWidth=s.numbers.MIN_RESIZE_WIDTH;this._multiColumnSort=!1;this._selectCheckboxAlignment="center";this._isAllSelected=!1;this._sortedColumnIndex=-1;this._rendered=!1;this._allowRowClick=!1;this._multiSortManager=new k;this._rowClickListener=t=>this._onRowClick(t),this._rowDoubleClickListener=t=>this._onRowDoubleClick(t),this._selectRowListener=t=>this._onRowSelected(t),this._selectAllListener=t=>this._onSelectAll(t),this._headRowMouseDownListener=t=>this._onHeadRowMouseDown(t),this._headRowContextMenuListener=t=>this._onHeadRowContextMenu(t),this._documentMouseMoveListener=t=>this._onMouseMove(t),this._documentMouseUpListener=t=>this._onMouseUp(t),this._filterListener=(t,l)=>this._onFilter(t,l),this._selectionManager=new w(this._selectKey),this._hiddenColumnManager=new w}initialize(){this.connect(),this._adapter.setHostAttribute(s.attributes.SELECT,this._select.toString()),this._adapter.setHostAttribute(s.attributes.MULTISELECT,this._multiselect.toString()),this._adapter.setHostAttribute(s.attributes.DENSE,this._dense.toString()),this._adapter.setHostAttribute(s.attributes.ROOMY,this._roomy.toString()),this._adapter.setHostAttribute(s.attributes.FILTER,this._filter.toString()),this._adapter.emitHostEvent(s.events.INITIALIZED,void 0,!1)}connect(){this._adapter.initialize()}disconnect(){this._resizeDescriptor=void 0,this._adapter.removeDocumentListener("mousemove",this._documentMouseMoveListener),this._adapter.removeDocumentListener("mouseup",this._documentMouseUpListener)}set data(e){Array.isArray(e)&&e.length>0?g(e[0])?this._data=e.map(t=>h({},t)):this._data=[...e]:this._data=[],this._tableRows=this._data.map(t=>new P(t,this._selectionManager.exists(t))),this._renderBody()}get data(){return JSON.parse(JSON.stringify(this._data))}set columnConfigurations(e){this._columnConfigurations=e.map(t=>h({},t)),this._hiddenColumnManager.clear(),this._columnConfigurations.forEach(t=>{t.hidden&&this._hiddenColumnManager.add(t)}),this._refreshTableSort(),this.render()}get columnConfigurations(){return this._columnConfigurations.map(e=>h({},e))}get _visibleColumnConfigurations(){return this._columnConfigurations.filter(e=>!this._hiddenColumnManager.exists(e))}get _tableConfiguration(){return{tableElement:this._adapter.getTableElement(),columnConfigurations:this._visibleColumnConfigurations,data:this._tableRows,clickListener:this._allowRowClick?this._rowClickListener:null,doubleClickListener:this._allowRowClick?this._rowDoubleClickListener:null,selectListener:this._select?this._selectRowListener:null,selectAllListener:this._multiselect?this._selectAllListener:null,headRowMouseDownListener:this._headRowMouseDownListener,headRowContextMenuListener:this._headRowContextMenuListener,filterListener:this._filter?this._filterListener:null,sortDirection:this._sortDirection,sortedColumn:this._sortedColumnIndex,multiColumnSort:this._multiColumnSort,filter:this._filter,wrapContent:this._wrapContent,fixedHeaders:this._fixedHeaders,layoutType:this._layoutType,dense:this._dense,resizable:this._resizable,rowCreatedCallback:this._rowCreatedCallback,cellCreatedCallback:this._cellCreatedCallback,selectAllTemplate:this._selectAllTemplate,selectCheckboxAlignment:this._selectCheckboxAlignment,tooltipSelect:this._tooltipSelect,tooltipSelectAll:this._tooltipSelectAll}}set select(e){this._select!==e&&(this._select=e,this._adapter.setSelectColumnVisibility(this._adapter.getTableElement(),this._select,this._selectRowListener,this._multiselect?this._selectAllListener:void 0,this._multiselect?this._selectAllTemplate:null,this._selectCheckboxAlignment,this._tableRows,this._tooltipSelect,this._tooltipSelectAll),this._updateSelections(!0),this._select?this._adapter.setHostAttribute(s.attributes.SELECT,this._select.toString()):this._adapter.removeHostAttribute(s.attributes.SELECT))}get select(){return this._select}set multiselect(e){this._multiselect!==e&&(this._multiselect=e,this._select&&(this._adapter.setSelectAllVisibility(this._adapter.getTableElement(),this._multiselect,this._multiselect?this._selectAllListener:null,this._multiselect?this.selectAllTemplate:null,this._selectCheckboxAlignment,this._tooltipSelectAll),this._updateSelections(!0)),this._adapter.setHostAttribute(s.attributes.MULTISELECT,this._multiselect.toString()))}get multiselect(){return this._multiselect}get selectKey(){return Array.isArray(this._selectKey)?[...this._selectKey]:this._selectKey}set selectKey(e){this._originalSelectKey!==e&&(Array.isArray(e)?(this._originalSelectKey=[...e],this._selectKey=[...e]):(this._originalSelectKey=e,this._selectKey=[e]),this._selectionManager.setKey(this._selectKey),this._updateSelections(!1))}get dense(){return this._dense}set dense(e){this._dense!==e&&(this._dense=e,this._adapter.setDense(this._adapter.getTableElement(),this._dense),this._adapter.setHostAttribute(s.attributes.DENSE,this._dense.toString()))}get roomy(){return this._roomy}set roomy(e){e!==this._roomy&&(this._roomy=e,this._applyRoomy())}set filter(e){this._filter!==e&&(this._filter=e,this._adapter.setFilterRow(this._tableConfiguration),this._adapter.setHostAttribute(s.attributes.FILTER,this._filter.toString()))}get filter(){return this._filter}set fixedHeaders(e){this._fixedHeaders!==e&&(this._fixedHeaders=e,this._adapter.setFixedHeaders(this._tableConfiguration))}get fixedHeaders(){return this._fixedHeaders}get layoutType(){return this._layoutType}set layoutType(e){this._layoutType!==e&&(this._layoutType=e,this._adapter.setTableLayoutType(this._tableConfiguration))}get wrapContent(){return this._wrapContent}set wrapContent(e){this._wrapContent!==e&&(this._wrapContent=e,this._adapter.setWrapContentState(this._tableConfiguration))}get resizable(){return this._resizable}set resizable(e){this._resizable!==e&&(this._resizable=e,this._adapter.setResizable(this._tableConfiguration))}get minResizeWidth(){return this._minResizeWidth}set minResizeWidth(e){this._minResizeWidth!==e&&(this._minResizeWidth=e,I(this._minResizeWidth)?this._minResizeWidth<0&&(this._minResizeWidth=0):this._minResizeWidth=s.numbers.MIN_RESIZE_WIDTH)}get allowRowClick(){return this._allowRowClick}set allowRowClick(e){this._allowRowClick!==e&&(this._allowRowClick=e,this._rendered&&(this._adapter.setRowClickListeners(this._adapter.getTableElement(),this._allowRowClick,this._rowClickListener,this._rowDoubleClickListener),this._adapter.setRowClickAttributes(this._adapter.getTableElement(),this._allowRowClick)))}get multiColumnSort(){return this._multiColumnSort}set multiColumnSort(e){e!==this._multiColumnSort&&(this._multiColumnSort=e,this._refreshTableSort(),this.render())}get selectCheckboxAlignment(){return this._selectCheckboxAlignment}set selectCheckboxAlignment(e){e!==this._selectCheckboxAlignment&&(this._selectCheckboxAlignment=e,this._adapter.setHostAttribute(s.attributes.SELECT_CHECKBOX_ALIGNMENT,e),this.render())}get tooltipSelect(){return this._tooltipSelect}set tooltipSelect(e){e!==this._tooltipSelect&&(this._tooltipSelect=e,typeof e=="string"&&this._adapter.setHostAttribute(s.attributes.TOOLTIP_SELECT,e),this.render())}get tooltipSelectAll(){return this._tooltipSelectAll}set tooltipSelectAll(e){e!==this._tooltipSelectAll&&(this._tooltipSelectAll=e,this._adapter.setHostAttribute(s.attributes.TOOLTIP_SELECT_ALL,e),this.render())}get selectAllTemplate(){return this._selectAllTemplate}set selectAllTemplate(e){e!==this._selectAllTemplate&&(this._selectAllTemplate=e,this.render())}get rowCreated(){return this._rowCreatedCallback}set rowCreated(e){this._rowCreatedCallback=e}get cellCreated(){return this._cellCreatedCallback}set cellCreated(e){this._cellCreatedCallback=e}isRowSelected(e){let t=v(Array.isArray(this._selectKey)?this._selectKey:[this._selectKey],e);return this.selectKey?!!this._selectionManager.getItems().find(l=>K(l,t)):this._selectionManager.exists(e)}getSelectedRows(){return this._selectionManager.getItems()}selectRows(e,t){if(!this._selectKey)throw new Error("You must set a selectKey to select rows.");(!this._multiselect||t)&&this.clearSelections(),e&&e.length&&(this._selectionManager.add(e),this._updateSelections(!t))}deselectRows(e){e&&e.length&&(this._selectionManager.remove(e),this._updateSelections(!1))}clearSelections(){let e=this._adapter.getTableElement();this._selectionManager.clear(),this._tableRows.forEach(t=>t.selected=!1),this._isAllSelected=!1,this._adapter.clearSelectedRows(e),this._select&&this._multiselect&&this._adapter.updateSelectAllState(e,!1)}hideColumn(e){let t=this._columnConfigurations[e];this._sortedColumnIndex===e&&(this._sortedColumnIndex=-1),this._hiddenColumnManager.exists(t)||(this._hiddenColumnManager.add(t),this.render())}showColumn(e){let t=this._columnConfigurations[e];this._hiddenColumnManager.exists(t)&&(this._hiddenColumnManager.remove(t),this.render())}isColumnHidden(e){let t=this._columnConfigurations[e];return!!t&&this._hiddenColumnManager.exists(t)}render(){this._adapter.createTable(this._tableConfiguration),this._renderSelections(),this._rendered=!0}_renderBody(){this._rendered&&(this._adapter.recreateTableBody(this._tableConfiguration),this._renderSelections())}_renderSelections(){this.select&&(this._isAllSelected=this._getSelectAllState(),this._multiselect&&this._adapter.updateSelectAllState(this._adapter.getTableElement(),this._isAllSelected,this._isIndeterminate(this._isAllSelected)));let e=this._selectionManager.getItems();e.length&&this._adapter.setSelectedRows(this._adapter.getTableElement(),this._selectKey,this._data,e,!1)}expandRow(e,t){if(!this._rendered)throw new Error("Cannot expand a row before the table has rendered.");if(e<0||e>this._tableRows.length)throw new Error(`Invalid row index: ${e}.`);return this._adapter.expandRow(this._tableConfiguration,e,t)}collapseRow(e){return!this._rendered||e<0||e>this._tableRows.length?Promise.resolve():this._adapter.collapseRow(this._tableConfiguration,e)}isRowExpanded(e){return this._adapter.isRowExpanded(this._tableConfiguration,e)}selectRowsByIndex(e,t){let l=e.map(i=>this._data[i]).filter(i=>!!i);this.selectRows(l,!t)}deselectRowsByIndex(e){let t=e.map(l=>this._data[l]).filter(l=>!!l);this.deselectRows(t)}_getSelectAllState(){return this._tableRows.length>0&&this._tableRows.every(e=>e.selected)}_updateSelections(e){this._tableRows.forEach(l=>l.selected=this._selectionManager.exists(l.data));let t=this._getSelectAllState();this._adapter.setSelectedRows(this._adapter.getTableElement(),this._selectKey,this._data,this._selectionManager.getItems(),e),(t!==this._isAllSelected||this._isIndeterminate(t))&&(this._isAllSelected=t,this._multiselect&&this._adapter.updateSelectAllState(this._adapter.getTableElement(),this._isAllSelected,this._isIndeterminate(this._isAllSelected)))}_onRowClick(e){if(e.stopImmediatePropagation(),e.target.tagName==="INPUT"&&e.target.type==="checkbox")return;let i=H(e).filter(m=>m.nodeType===1).find(m=>m.hasAttribute(s.attributes.CUSTOM_CELL_TEMPLATE));if(i&&i.hasAttribute(s.attributes.CUSTOM_CELL_TEMPLATE_STOP_PROPAGATION))return;let{index:a,data:r}=this._getSelectedRowFromEvent(e),c={index:a,data:r};this._adapter.emitHostEvent(s.events.ROW_CLICK,c,!0,!1)}_onRowDoubleClick(e){if(e.stopPropagation(),e.target.tagName==="INPUT"&&e.target.type==="checkbox")return;let t=this._getSelectedRowFromEvent(e),l={index:t.index,data:t.data};this._adapter.emitHostEvent(s.events.SELECT_DOUBLE,l,!0,!1)}_onRowSelected(e){let t=this._getSelectedRowFromEvent(e);this._multiselect||this._tableRows.filter(r=>r.selected).forEach(r=>{K(r.data,v(this._selectKey,t.data))||this.deselectRows([r.data])});let l=!this._selectionManager.exists(t.data);this._adapter.updateSelectedState(t.rowElement,l),l?this._selectionManager.add(t.data):this._selectionManager.remove(t.data),this._tableRows[t.index].selected=l;let i=[t.index],o=!1;if(this._multiselect){if(e.shiftKey&&this._previouslyClickedRow&&(i=this._shiftSelectRows(t),i.includes(this._previouslyClickedRow.index))){let r=i.indexOf(this._previouslyClickedRow.index);i.splice(r,1)}o=this._getSelectAllState(),this._adapter.updateSelectAllState(this._adapter.getTableElement(),o,this._isIndeterminate(o))}for(let a of i){let r=this._tableRows[a].data,m={selected:this._selectionManager.exists(r),index:a,data:r};this._adapter.emitHostEvent(s.events.SELECT,m,!0,!1)}if(this._isAllSelected!==o){this._isAllSelected=o;let a={status:this._isAllSelected,count:this._tableRows.filter(r=>r.selected).length,data:[...this._data],targetType:"row"};this._adapter.emitHostEvent(s.events.SELECT_ALL,a,!0,!1)}this._previouslyClickedRow=h({},t)}_getSelectedRowFromEvent(e){let l=H(e).find(r=>r.tagName==="TR"),i=l.parentElement,o=this._getNonExpandedRows(i).findIndex(r=>r===l),a=this._tableRows[o].data;return{rowElement:l,index:o,data:a}}_getNonExpandedRows(e){return Array.from(e.rows).filter(t=>!t.classList.contains(s.classes.TABLE_ROW_EXPANDABLE_CONTENT))}_onSelectAll(e){e.stopPropagation(),this._isAllSelected=!this._isAllSelected;let t=this._adapter.getTableElement();this._adapter.updateSelectAllState(t,this._isAllSelected),this._tableRows.forEach((i,o)=>{i.selected=this._isAllSelected,this._isAllSelected?this._selectionManager.add(i.data):this._selectionManager.remove(i.data);let a=b.getRowByIndex(t,o);a&&this._adapter.updateSelectedState(a,this._isAllSelected)});let l={status:this._isAllSelected,count:this._tableRows.filter(i=>i.selected).length,data:[...this._data],targetType:"select-all"};this._adapter.emitHostEvent(s.events.SELECT_ALL,l,!0,!1)}_onHeadRowContextMenu(e){e.preventDefault()}_onHeadRowMouseDown(e){if(e.button!==0)return;let t=H(e),l=e.target,i=t.find(r=>r.tagName==="TR"),o=t.find(r=>r.tagName==="TH"),a=Array.from(i.cells).findIndex(r=>r===o);this._headCellMouseDownIndex=a,l!==o&&l.classList.contains(s.classes.TABLE_RESIZE_HANDLE)&&(this._resizeDescriptor={element:o,startWidth:o.offsetWidth,startX:e.pageX,width:o.offsetWidth,index:this._select?a-1:a},this._adapter.addDocumentListener("mousemove",this._documentMouseMoveListener),this._adapter.setResizeColumnVisibility(this._tableConfiguration,a,!0)),this._adapter.addDocumentListener("mouseup",this._documentMouseUpListener)}_onMouseMove(e){if(this._resizeDescriptor){let t=this._resizeDescriptor.startWidth+(e.pageX-this._resizeDescriptor.startX);t<this._minResizeWidth&&(t=this._minResizeWidth),this._resizeDescriptor.width=t,this._resizeDescriptor.element.style.width=`${t}px`,this._adapter.addTableClass(s.classes.TABLE_RESIZING)}}_onMouseUp(e){if(this._adapter.removeDocumentListener("mousemove",this._documentMouseMoveListener),this._adapter.removeDocumentListener("mouseup",this._documentMouseUpListener),this._adapter.removeTableClass(s.classes.TABLE_RESIZING),this._headCellMouseDownIndex!==void 0){if(this._resizeDescriptor){this._adapter.normalizeColumnWidths(this._tableConfiguration),this._adapter.setResizeColumnVisibility(this._tableConfiguration,this._headCellMouseDownIndex,!1);let t={index:this._resizeDescriptor.index,width:this._resizeDescriptor.width};this._adapter.emitHostEvent(s.events.COLUMN_RESIZE,t),this._resizeDescriptor=void 0}else this._tableConfiguration.tableElement.tHead.contains(e.target)&&(this._multiColumnSort?this._onMultiSort(this._headCellMouseDownIndex,e.ctrlKey):this._onSort(this._headCellMouseDownIndex));this._headCellMouseDownIndex=void 0}}_onSort(e){let t=this._select?e-1:e,l=t>=0?this._visibleColumnConfigurations[t]:null;if(!l||!l.sortable)return;let i="ASC",o=t===this._sortedColumnIndex,a=this._sortDirection==="ASC"||this._sortDirection===void 0,r=o&&this._sortDirection==="DESC";o&&a&&(i="DESC"),r&&!l.preventUnsort&&(i="UNSET");let c={direction:i,columnIndex:t};if(this._adapter.emitHostEvent(s.events.SORT,c,!0,!0)){if(o&&this._sortDirection==="DESC"&&!l.preventUnsort){this._adapter.removeColumnSort(this._adapter.getTableElement(),this._select?this._sortedColumnIndex+1:this._sortedColumnIndex),this._sortedColumnIndex=-1;return}this._sortDirection=i,t===this._sortedColumnIndex?this._adapter.setSortDirection(this._adapter.getTableElement(),e,this._sortDirection):(this._sortedColumnIndex>=0&&this._adapter.removeColumnSort(this._adapter.getTableElement(),this._select?this._sortedColumnIndex+1:this._sortedColumnIndex),this._sortedColumnIndex=t,this._adapter.setSortedColumn(this._adapter.getTableElement(),e,this._sortDirection))}}_onMultiSort(e,t){let l=this._select?e-1:e,i=l>=0?this._visibleColumnConfigurations[l]:null;if(!i||!i.sortable)return;let o=this._multiSortManager.sortedColumns,a=this._multiSortManager.getSortColumn(l);a?this._multiSortManager.updateSortColumn(a):t?this._multiSortManager.addSortColumn({direction:"DESC",columnIndex:l,propertyName:i.property}):(this._multiSortManager.clearMultiSort(),this._multiSortManager.addSortColumn({direction:"DESC",columnIndex:l,propertyName:i.property}));let r=this._multiSortManager.sortedColumns.map(d=>h({},d));if(!this._adapter.emitHostEvent(s.events.SORT,r,!0,!0)){this._multiSortManager.setSortColumns(o);return}let m=this._multiSortManager.sortedColumns.length>1;for(let d=0;d<this._visibleColumnConfigurations.length;d++){let u=this._select?d+1:d;if(!this._multiSortManager.isSortColumn(d))this._adapter.removeColumnSort(this._adapter.getTableElement(),u),b.setMultiSortColumnSortNumber(this._adapter.getTableElement(),m,u,null);else{let C=this._multiSortManager.getSortColumn(d);C&&(this._adapter.setSortedColumn(this._adapter.getTableElement(),u,C.direction),b.setMultiSortColumnSortNumber(this._adapter.getTableElement(),m,u,C.sortOrder||null))}}}_onFilter(e,t){let l={value:e,columnIndex:t};this._adapter.emitHostEvent(s.events.FILTER,l,!0,!1)}_shiftSelectRows(e){let t=[];if(this._previouslyClickedRow){let l=this._previouslyClickedRow.index,i=e.index,o=i>=l?l:i,a=i>=l?i:l;a+=a>o?1:0,o+=o>a?1:0;let r=d=>this.selectRows(d,!1),c=this._tableRows.find(d=>d.selected&&d.data===e.data),m=this._tableRows.find(d=>{var u;return d.data===((u=this._previouslyClickedRow)==null?void 0:u.data)&&!d.selected});(!c||m)&&(r=d=>this.deselectRows(d));for(let d=o;d<a;d++)t.push(d);r(this.data.filter((d,u)=>t.includes(u)))}return t}_isIndeterminate(e){return!e&&this.getSelectedRows().length>0&&this._data.length!==this.getSelectedRows().length}_applyRoomy(){this._adapter.setRoomy(this._adapter.getTableElement(),this._roomy),this._adapter.setHostAttribute(s.attributes.ROOMY,this._roomy.toString())}_refreshTableSort(){if(this._sortedColumnIndex=this._visibleColumnConfigurations.findIndex(e=>e.initialSort),this._sortDirection=this._sortedColumnIndex>=0?this._visibleColumnConfigurations[this._sortedColumnIndex].sortDirection:void 0,this._multiColumnSort){let e=[];this._visibleColumnConfigurations.forEach((t,l)=>{typeof t.initialSort=="object"&&e.push({columnIndex:l,direction:t.initialSort.direction,sortOrder:t.initialSort.sortOrder,propertyName:t.property})}),this._multiSortManager.setSortColumns(e)}}};var E=class extends J{constructor(){super();se.define(te),this._foundation=new z(new N(this))}static get observedAttributes(){return[s.attributes.SELECT,s.attributes.MULTISELECT,s.attributes.SELECT_KEY,s.attributes.DENSE,s.attributes.ROOMY,s.attributes.FILTER,s.attributes.FIXED_HEADERS,s.attributes.LAYOUT_TYPE,s.attributes.WRAP_CONTENT,s.attributes.RESIZABLE,s.attributes.MIN_RESIZE_WIDTH,s.attributes.ALLOW_ROW_CLICK,s.attributes.MULTI_COLUMN_SORT,s.attributes.SELECT_CHECKBOX_ALIGNMENT,s.attributes.TOOLTIP_SELECT,s.attributes.TOOLTIP_SELECT_ALL]}initializedCallback(){this._foundation.initialize()}connectedCallback(){this._foundation.connect()}disconnectedCallback(){this._foundation.disconnect()}attributeChangedCallback(t,l,i){switch(t){case s.attributes.SELECT:this.select=L(i);break;case s.attributes.MULTISELECT:this.multiselect=L(i);break;case s.attributes.SELECT_KEY:this.selectKey=i;break;case s.attributes.DENSE:this.dense=L(i);break;case s.attributes.ROOMY:this.roomy=L(i);break;case s.attributes.FILTER:this.filter=L(i);break;case s.attributes.FIXED_HEADERS:this.fixedHeaders=L(i);break;case s.attributes.LAYOUT_TYPE:this.layoutType=i;break;case s.attributes.WRAP_CONTENT:this.wrapContent=L(i);break;case s.attributes.RESIZABLE:this.resizable=L(i);break;case s.attributes.MIN_RESIZE_WIDTH:this.minResizeWidth=G(i);break;case s.attributes.ALLOW_ROW_CLICK:this.allowRowClick=L(i);break;case s.attributes.MULTI_COLUMN_SORT:this.multiColumnSort=L(i);break;case s.attributes.SELECT_CHECKBOX_ALIGNMENT:this.selectCheckboxAlignment=this.getAttribute(s.attributes.SELECT_CHECKBOX_ALIGNMENT)||"center";break;case s.attributes.TOOLTIP_SELECT:this.tooltipSelect=i;break;case s.attributes.TOOLTIP_SELECT_ALL:this.tooltipSelectAll=i;break}}hideColumn(t){this._foundation.hideColumn(t)}showColumn(t){this._foundation.showColumn(t)}isColumnHidden(t){return this._foundation.isColumnHidden(t)}getSelectedRows(){return this._foundation.getSelectedRows()}selectRow(t){this._foundation.selectRows([t],!1)}selectRows(t,l=!1){this._foundation.selectRows(t,!l)}deselectRow(t){this._foundation.deselectRows([t])}deselectRows(t){this._foundation.deselectRows(t)}clearSelections(){this._foundation.clearSelections()}render(){this._foundation.render()}expandRow(t,l){return this._foundation.expandRow(t,l)}collapseRow(t){return this._foundation.collapseRow(t)}isRowExpanded(t){return this._foundation.isRowExpanded(t)}selectRowsByIndex(t,l){typeof t=="number"?this._foundation.selectRowsByIndex([t],l):Array.isArray(t)&&this._foundation.selectRowsByIndex(t,l)}deselectRowsByIndex(t){typeof t=="number"?this._foundation.deselectRowsByIndex([t]):Array.isArray(t)&&this._foundation.deselectRowsByIndex(t)}isRowSelected(t){return this._foundation.isRowSelected(t)}};_([T()],E.prototype,"data",2),_([T()],E.prototype,"columnConfigurations",2),_([T()],E.prototype,"select",2),_([T()],E.prototype,"multiselect",2),_([T()],E.prototype,"selectKey",2),_([T()],E.prototype,"tooltipSelect",2),_([T()],E.prototype,"tooltipSelectAll",2),_([T()],E.prototype,"dense",2),_([T()],E.prototype,"roomy",2),_([T()],E.prototype,"filter",2),_([T()],E.prototype,"fixedHeaders",2),_([T()],E.prototype,"layoutType",2),_([T()],E.prototype,"wrapContent",2),_([T()],E.prototype,"resizable",2),_([T()],E.prototype,"minResizeWidth",2),_([T()],E.prototype,"allowRowClick",2),_([T()],E.prototype,"multiColumnSort",2),_([T()],E.prototype,"rowCreated",2),_([T()],E.prototype,"cellCreated",2),_([T()],E.prototype,"selectAllTemplate",2),_([T()],E.prototype,"selectCheckboxAlignment",2),E=_([j({name:s.elementName,dependencies:[ae,oe,ce]})],E);function pl(){q(E)}export{s as a,B as b,O as c,Le as d,N as e,P as f,z as g,E as h,pl as i};
7
- //# sourceMappingURL=chunk.Q6ELPSPD.js.map
6
+ import{c as re,f as ce}from"./chunk.SSJYPH4U.js";import{a as M,d as ae}from"./chunk.NSTCCETU.js";import{a as ne}from"./chunk.QUJL4A23.js";import{a as $,b as x,c as v,d as K}from"./chunk.UV3WIHCM.js";import{a as H}from"./chunk.LEVFMI2Q.js";import{b as te}from"./chunk.MZLPUI6R.js";import{a as ie,d as se,l as oe}from"./chunk.T64UW37U.js";import{a as X}from"./chunk.G4IN6Y46.js";import{a as le}from"./chunk.RFLASSCI.js";import{a as T}from"./chunk.NVUMRW44.js";import{a as Q}from"./chunk.TKDMM2ZZ.js";import{a as j,b as ee}from"./chunk.55FCNVG5.js";import{a as q,l as J}from"./chunk.QH2GB3PD.js";import{d as R,e as F,f as p,g as D,i as W,j as U,t as Z}from"./chunk.CFDK4RCW.js";import{b as f,c as Y,d as I,h as y,j as g,k as L,l as G,o as V}from"./chunk.J2M2MXP2.js";import{a as h,d as _}from"./chunk.M3QDAYD2.js";var w=class{constructor(e){this._key=e,this._items=[]}getItems(){return[...this._items]}count(){return this._items.length}setKey(e){this._key=e}add(e){return e instanceof Array||(e=[e]),e.forEach(t=>{this.exists(t)||this._items.push(t)}),this}remove(e){e instanceof Array||(e=[e]);for(let t=e.length-1;t>=0;t--)this.exists(e[t])&&this._items.splice(this._items.indexOf(this._getItem(e[t])),1);return this}clear(){return this._items=[],this}exists(e){return this._getItem(e)!==null}_getItem(e){return this._key?x(this._items,v(this._key,e))||null:this._items.find(t=>t===e)||null}};var S=`${ee}table`,de={TABLE:"forge-table",TABLE_DENSE:"forge-table--dense",TABLE_ROOMY:"forge-table--roomy",TABLE_RESIZABLE:"forge-table--resizable",TABLE_RESIZING:"forge-table--resizing",TABLE_RESIZE_HANDLE:"forge-table__resize-handle",TABLE_NO_WRAP_CONTENT:"forge-table--no-wrap-content",TABLE_LAYOUT_FIXED:"forge-table--layout-fixed",TABLE_FILTER_VISIBLE:"forge-table--filter-visible",TABLE_FIXED:"forge-table--fixed",TABLE_HEAD:"forge-table-head",TABLE_HEAD_ROW:"forge-table-head__row",TABLE_HEAD_ROW_FILTER:"forge-table-head__row__filter",TABLE_HEAD_CELL:"forge-table-head__cell",TABLE_HEAD_CELL_CONTAINER:"forge-table-head__cell-container",TABLE_HEAD_CELL_SORTABLE:"forge-table-head__cell--sortable",TABLE_HEAD_CELL_SORT_ICON:"forge-table-head__cell-sort-icon",TABLE_HEAD_CELL_TEXT:"forge-table-head__cell-text",TABLE_HEAD_CELL_SORT_ICON_ACTIVE:"forge-table-head__cell-sort-icon--active",TABLE_HEAD_CELL_SORTED_ASCENDING:"forge-table-head__cell--sorted-ascending",TABLE_HEAD_CELL_SORTED_DESCENDING:"forge-table-head__cell--sorted-descending",TABLE_HEAD_CELL_SORT_ORDER:"forge-table-head__cell__sort-order",TABLE_HEAD_CELL_SORT_ORDER_HIDDEN:"forge-table-head__cell__sort-order--hidden",TABLE_BODY:"forge-table-body",TABLE_BODY_ROW:"forge-table-body__row",TABLE_BODY_ROW_SELECTED:"forge-table-body__row--selected",TABLE_BODY_ROW_CLICKABLE:"forge-table-body__row--clickable",TABLE_BODY_CELL:"forge-table-body__cell",TABLE_ROW:"forge-table-row",TABLE_ROW_EXPANDED:"forge-table-row--expanded",TABLE_ROW_EXPANDABLE_CONTENT:"forge-table-row__expandable-content",TABLE_ROW_EXPANDABLE_CONTENT_CELL:"forge-table-row__expandable-content-cell",TABLE_CELL:"forge-table-cell",TABLE_CELL_SELECT:"forge-table-cell__select",TABLE_CELL_SELECT_CHECKBOX:"forge-table-cell__select-checkbox",TABLE_CELL_SELECT_CHECKBOX_CONTAINER:"forge-table-cell__select-checkbox-container",TABLE_CELL_SELECT_CHECKBOX_CONTAINER_ALIGN_RIGHT:"forge-table-cell__select-checkbox-container--align-right",TABLE_CELL_SELECT_CHECKBOX_CONTAINER_ALIGN_LEFT:"forge-table-cell__select-checkbox-container--align-left",TABLE_CELL_SELECT_CHECKBOX_CONTAINER_ALIGN_CENTER:"forge-table-cell__select-checkbox-container--align-center",TABLE_CELL_CONTAINER:"forge-table-cell__container",TABLE_CELL_CONTAINER_TEXT:"forge-table-cell__container-text",TABLE_CELL_CENTER:"forge-table-cell--center",TABLE_CELL_RIGHT:"forge-table-cell--right",TABLE_CELL_RESIZABLE:"forge-table-cell--resizing"},Ee={TABLE:".forge-table",CHECKBOX_INPUT:"forge-checkbox > input[type=checkbox]:not([forge-ignore])",SELECT_ALL_TEMPLATE_CHECKBOX_INPUT:"input[type=checkbox]:not([forge-ignore])",ROW_SELECTED:`.${de.TABLE_BODY_ROW_SELECTED}`},_e={SELECT:"select",MULTISELECT:"multiselect",SELECT_KEY:"select-key",DENSE:"dense",ROOMY:"roomy",FILTER:"filter",FIXED_HEADERS:"fixed-headers",LAYOUT_TYPE:"layout-type",WRAP_CONTENT:"wrap-content",RESIZABLE:"resizable",MIN_RESIZE_WIDTH:"min-resize-width",ALLOW_ROW_CLICK:"allow-row-click",MULTI_COLUMN_SORT:"multi-column-sort",SELECT_CHECKBOX_ALIGNMENT:"select-checkbox-alignment",TOOLTIP_SELECT:"tooltip-select",TOOLTIP_SELECT_ALL:"tooltip-select-all",CHECKBOX_TYPE:"forge-checkbox-type",CUSTOM_CELL_TEMPLATE:"data-cell-template",CUSTOM_CELL_TEMPLATE_STOP_PROPAGATION:"data-cell-template-stop-propagation"},Te={ROW_CLICK:`${S}-row-click`,SELECT:`${S}-select`,SELECT_DOUBLE:`${S}-select-double`,SELECT_ALL:`${S}-select-all`,SORT:`${S}-sort`,FILTER:`${S}-filter`,INITIALIZED:`${S}-initialized`,COLUMN_RESIZE:`${S}-column-resize`},pe={SELECT_ALL:"select-all",SELECT_ROW:"select-row",DEFAULT_LAYOUT_TYPE:"auto"},Ce={SORT_DOWN:"arrow_downward"},he={DEFAULT_FILTER_DEBOUNCE_TIME:750,MIN_RESIZE_WIDTH:100,RESIZE_HOVER_DURATION:150},s={elementName:S,classes:de,selectors:Ee,attributes:_e,events:Te,strings:pe,icons:Ce,numbers:he};var B=(l=>(l.Left="left",l.Right="right",l.Center="center",l))(B||{}),O=(l=>(l.Ascending="ASC",l.Descending="DESC",l.Unset="UNSET",l))(O||{}),Le=(a=>(a.InputText="text",a.InputNumber="number",a.Select="select",a.SelectMultiple="select-multiple",a.Date="date",a.DateRange="date-range",a))(Le||{});function me(n){return n&&typeof n=="object"&&"content"in n}var b=class n{static createTable(e){n._resetTable(e.tableElement);let t=n._createTableHead(e),l=n._createTableBody(e);e.clickListener&&(n._attachRowClickListeners(l,e.clickListener,e.doubleClickListener),n._addRowClickAttributes(l)),e.fixedHeaders&&n.setFixedHeaders(e),e.resizable&&n.setResizable(e),e.dense&&n.setDenseState(e.tableElement,e.dense),e.wrapContent&&n.setWrapContentState(e.tableElement,e.wrapContent),e.selectListener&&n._addSelectColumn(t,l,e.selectListener,e.selectAllListener,e.selectAllTemplate,e.selectCheckboxAlignment,e.data,e.tooltipSelect,e.tooltipSelectAll),(e.resizable||e.columnConfigurations.some(i=>!!i.sortable))&&(n._attachHeadRowMouseDownListener(t,e.headRowMouseDownListener),n._isMac()&&n._attachHeadRowContextMenuListener(t,e.headRowContextMenuListener)),n.setLayoutType(e),n._setTableHead(e.tableElement,t),e.filter&&n.setFilterRow(e),n._setTableBody(e.tableElement,l)}static _setTableHead(e,t){e.tHead?F(t,e.tHead):e.appendChild(t)}static _setTableBody(e,t){e.tBodies.length?F(t,e.tBodies[0]):e.appendChild(t)}static recreateTableBody(e){let t=n._createTableBody(e);e.clickListener&&(n._attachRowClickListeners(t,e.clickListener,e.doubleClickListener),n._addRowClickAttributes(t)),e.selectListener&&(n._createBodySelectColumn(t,e.selectCheckboxAlignment,e.data,e.tooltipSelect,e.tooltipSelectAll),n._attachRowSelectListeners(t,e.selectListener)),n._setTableBody(e.tableElement,t)}static _resetTable(e){R(e)}static _createMultisortTooltip(){let e=document.createElement(ne.elementName);return e.textContent="Ctrl + click to sort multiple columns",e.position="bottom",e.delay=0,e}static _createTableHead(e){let t=document.createElement("thead"),l=t.insertRow();p([s.classes.TABLE_ROW,s.classes.TABLE_HEAD_ROW],l);let i=!1;for(let o=0;o<e.columnConfigurations.length;o++){let a=e.columnConfigurations[o],r=document.createElement("th");r.scope="col",p([s.classes.TABLE_CELL,s.classes.TABLE_HEAD_CELL],r);let c=document.createElement("div");if(c.classList.add(s.classes.TABLE_HEAD_CELL_CONTAINER),e.multiColumnSort){let d=n._createMultisortTooltip();c.appendChild(d)}if(a.align&&n._setCellAlignmentClass(c,a.align),f(a.width)){let d=U(a.width);d&&(r.style.width=d)}if(e.resizable&&a.resizable!==!1){let d=document.createElement("div");d.classList.add(s.classes.TABLE_RESIZE_HANDLE),r.appendChild(d)}f(a.headerCellStyle)&&g(a.headerCellStyle)&&(Object.assign(r.style,a.headerCellStyle),Object.assign(c.style,a.headerCellStyle));let m=document.createElement("span");if(m.classList.add(s.classes.TABLE_HEAD_CELL_TEXT),m.textContent=a.header&&typeof a.header=="string"?a.header.trim():"",a.sortable){r.classList.add(s.classes.TABLE_HEAD_CELL_SORTABLE);let d=document.createElement("span");p([s.classes.TABLE_HEAD_CELL_SORT_ORDER_HIDDEN,s.classes.TABLE_HEAD_CELL_SORT_ORDER],d);let u=document.createElement(ie.elementName);u.name=s.icons.SORT_DOWN,p([s.classes.TABLE_HEAD_CELL_SORT_ICON],u),e.multiColumnSort?typeof a.initialSort=="object"&&a.initialSort.sortOrder&&(d.textContent=a.initialSort.sortOrder.toString(),e.columnConfigurations.filter(C=>typeof C.initialSort=="object").length>1&&D(s.classes.TABLE_HEAD_CELL_SORT_ORDER_HIDDEN,d),r.classList.add(s.classes.TABLE_HEAD_CELL_SORTED_DESCENDING),u.classList.add(s.classes.TABLE_HEAD_CELL_SORT_ICON_ACTIVE),n._setColumnSortDirection(r,a.initialSort.direction)):e.sortedColumn===o&&!i&&!e.multiColumnSort&&(r.classList.add(s.classes.TABLE_HEAD_CELL_SORTED_DESCENDING),u.classList.add(s.classes.TABLE_HEAD_CELL_SORT_ICON_ACTIVE),n._setColumnSortDirection(r,e.sortDirection),i=!0),c.appendChild(u),c.appendChild(d)}typeof a.headerTemplate=="function"?Promise.resolve(a.headerTemplate(o,c,a)).then(d=>{if(d){let u=document.createElement("div");p(s.classes.TABLE_CELL_CONTAINER,u),typeof d=="string"?u.innerHTML=d:n._prepend(d,u),u.setAttribute(s.attributes.CUSTOM_CELL_TEMPLATE,""),n._prepend(u,c)}}):n._prepend(m,c),r.appendChild(c),l.appendChild(r)}return t}static setSortDirection(e,t,l){let i=n._getHeaderCellByIndex(e,t);n._setColumnSortDirection(i,l)}static _setColumnSortDirection(e,t){e.classList.contains(s.classes.TABLE_HEAD_CELL_SORTED_ASCENDING)&&e.classList.remove(s.classes.TABLE_HEAD_CELL_SORTED_ASCENDING),e.classList.contains(s.classes.TABLE_HEAD_CELL_SORTED_DESCENDING)&&e.classList.remove(s.classes.TABLE_HEAD_CELL_SORTED_DESCENDING),!t||t==="DESC"?e.classList.add(s.classes.TABLE_HEAD_CELL_SORTED_DESCENDING):e.classList.add(s.classes.TABLE_HEAD_CELL_SORTED_ASCENDING)}static _createTableBody(e){let t=document.createElement("tbody");return n._getOrderedRowData(e.columnConfigurations,e.data).forEach((i,o)=>{let a=t.insertRow();p([s.classes.TABLE_ROW,s.classes.TABLE_BODY_ROW],a),n._populateRowCells(e,a,i,o),typeof e.rowCreatedCallback=="function"&&e.rowCreatedCallback(a,o,h({},e.data[o].data))}),t}static _populateRowCells(e,t,l,i){for(let o=0;o<l.length;o++){let a=e.columnConfigurations[o],r=t.insertCell();if(p([s.classes.TABLE_CELL,s.classes.TABLE_BODY_CELL],r),f(a.width)){let m=U(a.width);m&&(r.style.width=m)}let c=document.createElement("div");if(c.classList.add(s.classes.TABLE_CELL_CONTAINER),f(a.cellStyle)&&g(a.cellStyle)&&(Object.assign(r.style,a.cellStyle),Object.assign(c.style,a.cellStyle)),a.template&&typeof a.template=="function"){let m=e.data[i]?e.data[i].data:void 0;Promise.resolve(a.template(i,c,m,o)).then(d=>{let u=me(d)?d:{content:d,stopClickPropagation:a.stopCellTemplateClickPropagation};u.content&&(typeof u.content=="string"?c.innerHTML=u.content:c.appendChild(u.content),c.setAttribute(s.attributes.CUSTOM_CELL_TEMPLATE,""),u.stopClickPropagation&&c.setAttribute(s.attributes.CUSTOM_CELL_TEMPLATE_STOP_PROPAGATION,""))})}else if(a.property){let m=document.createElement("span");m.classList.add(s.classes.TABLE_CELL_CONTAINER_TEXT),c.appendChild(m),a.transform&&typeof a.transform=="function"?Promise.resolve(a.transform(l[o])).then(d=>m.textContent=d):l[o]==null?m.textContent="":m.textContent=l[o].toString()}if(a.align&&n._setCellAlignmentClass(c,a.align),r.appendChild(c),f(a.columnSpan)){if(a.columnSpan==="all"){r.colSpan=l.length-o;break}else if(typeof a.columnSpan=="number"&&a.columnSpan>0){let m=a.columnSpan;a.columnSpan>l.length-o&&(m=l.length),r.colSpan=m,o=o+(m-1)}}typeof e.cellCreatedCallback=="function"&&e.cellCreatedCallback(r,i,o)}}static _setCellAlignmentClass(e,t){switch(t){case"center":e.classList.add(s.classes.TABLE_CELL_CENTER);break;case"right":e.classList.add(s.classes.TABLE_CELL_RIGHT);break}}static _getNonExpandedRows(e){return Array.from(e).filter(t=>!t.classList.contains(s.classes.TABLE_ROW_EXPANDABLE_CONTENT))}static _getExpandedRows(e){return Array.from(e).filter(t=>t.classList.contains(s.classes.TABLE_ROW_EXPANDABLE_CONTENT))}static _createColumnDataMap(e,t){return e.map(l=>({config:l,data:t.map(i=>{if(l.property){let o=$(i.data,l.property);return f(o)?o:null}return null})}))}static _getOrderedRowData(e,t){let l=n._createColumnDataMap(e,t),i=[];for(let o of l)for(let a=0;a<o.data.length;a++)i[a]||(i[a]=[]),i[a].push(o.data[a]);return i}static _attachRowClickListeners(e,t,l){n._getNonExpandedRows(e.rows).forEach(o=>{o.addEventListener("click",t),l&&o.addEventListener("dblclick",l)})}static _addRowClickAttributes(e){n._getNonExpandedRows(e.rows).forEach(l=>{l.classList.add(s.classes.TABLE_BODY_ROW_CLICKABLE)})}static _removeRowClickAttributes(e){n._getNonExpandedRows(e.rows).forEach(l=>{l.classList.remove(s.classes.TABLE_BODY_ROW_CLICKABLE)})}static _attachRowSelectListeners(e,t){n._getNonExpandedRows(e.rows).forEach(i=>n._attachRowSelectListener(i,t))}static _attachRowSelectListener(e,t){let l=n._getCheckboxElement(e);l==null||l.addEventListener("click",t)}static _detachRowSelectListeners(e,t){Array.from(e.rows).forEach(l=>{let i=n._getCheckboxElement(l);i==null||i.removeEventListener("click",t)})}static _detachRowClickListeners(e,t,l){Array.from(e.rows).forEach(i=>{i.removeEventListener("click",t),i.removeEventListener("dblclick",l)})}static _attachSelectAllListener(e,t){let l=e.rows[e.rows.length-1],i=n._getCheckboxElement(l);if(!i)throw new Error("Checkbox element not found.");i.addEventListener("change",t)}static _tryAttachSelectAllTemplateListener(e,t){let l=e.rows[e.rows.length-1],i=n._tryGetSelectAllCheckboxElement(l);i&&i.addEventListener("change",t)}static _detachSelectAllListener(e,t){let l=e.rows[e.rows.length-1],i=n._tryGetSelectAllCheckboxElement(l);i&&i.removeEventListener("change",t)}static _attachHeadRowMouseDownListener(e,t){let l=e.rows[0];if(!l)throw new Error("Missing table header row. Unable to attach sort listener.");l.addEventListener("mousedown",t)}static _attachHeadRowContextMenuListener(e,t){let l=e.rows[0];if(!l)throw new Error("Missing table header row. Unable to attach sort listener.");l.addEventListener("contextmenu",t)}static _createSelectColumn(e,t,l,i,o,a,r,c,m){e&&n._createHeadSelectColumn(e,l,i,o,a,m),t&&n._createBodySelectColumn(t,a,r,c,m)}static _createHeadSelectColumn(e,t,l,i,o,a){var r;if(Array.from(e.rows).forEach(c=>{let m=document.createElement("th");p([s.classes.TABLE_CELL,s.classes.TABLE_HEAD_CELL],m),c.insertBefore(m,c.cells.item(0))}),t){let c=(r=e.rows.item(e.rows.length-1))==null?void 0:r.cells.item(0);c.classList.add(s.classes.TABLE_CELL_SELECT),typeof l=="function"?n._renderSelectAllTemplate(l,e).then(()=>{typeof i=="function"&&i()}):c==null||c.appendChild(n._createCheckboxElement(!0,o,null,null,null,a))}}static _createBodySelectColumn(e,t,l,i,o){if(n._getNonExpandedRows(e.rows).forEach((r,c)=>n._addRowSelectColumn(r,t,c,l[c],i,o)),e.rows.length){let r=e.rows.item(0);r&&n._updateExpandedRowColspan(e.rows,r.cells.length)}}static _addRowSelectColumn(e,t,l,i,o,a){let r=e.insertCell(0);p([s.classes.TABLE_CELL,s.classes.TABLE_BODY_CELL,s.classes.TABLE_CELL_SELECT],r),r.appendChild(n._createCheckboxElement(!1,t,l,i,o,a))}static _destroySelectColumn(e,t){let l=n._getNonExpandedRows(t.rows);if(Array.from(e.rows).forEach(i=>i.removeChild(i.cells.item(0))),Array.from(l).forEach(i=>i.removeChild(i.cells.item(0))),t.rows.length){let i=t.rows.item(0);i&&n._updateExpandedRowColspan(t.rows,i.cells.length)}}static _hasSelectColumn(e,t){return[...Array.from(e.rows),...Array.from(t.rows)].some(i=>i.cells.item(0).classList.contains(s.classes.TABLE_CELL_SELECT))}static _createCheckboxElement(e,t,l,i,o,a){let r=document.createElement("div");if(r.classList.add(s.classes.TABLE_CELL_SELECT_CHECKBOX_CONTAINER),t)switch(t){case"center":r.classList.add(s.classes.TABLE_CELL_SELECT_CHECKBOX_CONTAINER_ALIGN_CENTER);break;case"left":r.classList.add(s.classes.TABLE_CELL_SELECT_CHECKBOX_CONTAINER_ALIGN_LEFT);break;case"right":r.classList.add(s.classes.TABLE_CELL_SELECT_CHECKBOX_CONTAINER_ALIGN_RIGHT);break}let c=document.createElement(re.elementName),m=document.createElement("input");m.type="checkbox";let d=o||"";i&&typeof o=="function"&&(d=o.call(null,l,i.data));let u=document.createElement("forge-tooltip");return u.position="left",e?u.textContent=a||"":u.textContent=d,m.setAttribute("aria-label","Select row"),c.appendChild(m),r.appendChild(u),r.appendChild(c),r}static _getCheckboxElement(e){let t=e.querySelector(`.${s.classes.TABLE_CELL_SELECT}`);return t?t.querySelector(s.selectors.CHECKBOX_INPUT):null}static _tryGetSelectAllCheckboxElement(e){let t=e.querySelector(`.${s.classes.TABLE_CELL_SELECT}`);return t?t.querySelector(s.selectors.CHECKBOX_INPUT)||t.querySelector(s.selectors.SELECT_ALL_TEMPLATE_CHECKBOX_INPUT):null}static _setSelectedCheckboxState(e,t){e&&(e.checked=t)}static _setIndeterminateCheckboxState(e,t){e&&(e.indeterminate=t)}static _setRowSelectedState(e,t){t?e.classList.contains(s.classes.TABLE_BODY_ROW_SELECTED)||e.classList.add(s.classes.TABLE_BODY_ROW_SELECTED):e.classList.remove(s.classes.TABLE_BODY_ROW_SELECTED)}static _updateExpandedRowColspan(e,t){n._getExpandedRows(e).forEach(i=>{let o=i.cells.item(0);o&&(o.colSpan=t)})}static updateSelectedState(e,t){n._setRowSelectedState(e,t);let l=n._getCheckboxElement(e);l&&n._setSelectedCheckboxState(l,t)}static getRowByIndex(e,t){return n._getNonExpandedRows(e.tBodies[0].rows)[t]}static updateSelectAllState(e,t,l){if(!e.tHead)return;let i=e.tHead.rows[e.tHead.rows.length-1],o=n._tryGetSelectAllCheckboxElement(i);o&&(n._setSelectedCheckboxState(o,t),n._setIndeterminateCheckboxState(o,!!l))}static setSelectedRows(e,t,l,i,o=!1){if(!e.tBodies.length)return;o||n.clearSelectedRows(e);let a=e.tBodies[0].rows,r=0;i.length&&Array.from(a).forEach((c,m)=>{let d=l[m];if(x(i,v(t,d))){n._setRowSelectedState(c,!0);let C=n._getCheckboxElement(c);C&&n._setSelectedCheckboxState(C,!0),r++}}),n.updateSelectAllState(e,r>0&&a.length===r)}static clearSelectedRows(e){if(!e.tBodies.length)return;n._getNonExpandedRows(e.tBodies[0].rows).forEach(l=>{n._setRowSelectedState(l,!1);let i=n._getCheckboxElement(l);i&&n._setSelectedCheckboxState(i,!1)})}static setSortedColumn(e,t,l){let i=n._getHeaderCellByIndex(e,t);n._getSortIconElementFromHeaderCell(i).classList.add(s.classes.TABLE_HEAD_CELL_SORT_ICON_ACTIVE),n._setColumnSortDirection(i,l)}static setMultiSortColumnSortNumber(e,t,l,i){let r=n._getHeaderCellByIndex(e,l).querySelector(`.${s.classes.TABLE_HEAD_CELL_CONTAINER}`).querySelector(`.${s.classes.TABLE_HEAD_CELL_SORT_ORDER}`);r&&(Z(r,typeof i!="number"||!t,s.classes.TABLE_HEAD_CELL_SORT_ORDER_HIDDEN),i&&(r.textContent=i.toString()))}static removeColumnSort(e,t){let l=n._getHeaderCellByIndex(e,t);l.classList.contains(s.classes.TABLE_HEAD_CELL_SORTED_ASCENDING)&&l.classList.remove(s.classes.TABLE_HEAD_CELL_SORTED_ASCENDING),l.classList.contains(s.classes.TABLE_HEAD_CELL_SORTED_DESCENDING)&&l.classList.remove(s.classes.TABLE_HEAD_CELL_SORTED_DESCENDING);let i=n._getSortIconElementFromHeaderCell(l);i&&i.classList.contains(s.classes.TABLE_HEAD_CELL_SORT_ICON_ACTIVE)&&i.classList.remove(s.classes.TABLE_HEAD_CELL_SORT_ICON_ACTIVE)}static _getHeaderCellByIndex(e,t){if(!e.tHead)throw new Error("Table head element cannot be null.");return e.tHead.rows.item(0).cells.item(t)}static _getSortIconElementFromHeaderCell(e){return e.querySelector(`.${s.classes.TABLE_HEAD_CELL_SORT_ICON}`)}static setSelectColumnVisibility(e,t,l,i,o,a,r,c,m){let d=e.tHead,u=e.tBodies[0];!d||!u||(t?n._addSelectColumn(d,u,l,i,o,a,r,c,m):n._hasSelectColumn(d,u)&&(l&&n._detachRowSelectListeners(u,l),i&&n._detachSelectAllListener(d,i),n._destroySelectColumn(d,u)))}static _addSelectColumn(e,t,l,i,o,a,r,c,m){n._createSelectColumn(e,t,!!i,o,()=>{i&&n._tryAttachSelectAllTemplateListener(e,i)},a,r,c,m),l&&n._attachRowSelectListeners(t,l),i&&!o&&n._tryAttachSelectAllTemplateListener(e,i)}static setDenseState(e,t){e.classList.contains(s.classes.TABLE_DENSE)&&e.classList.remove(s.classes.TABLE_DENSE),t&&e.classList.add(s.classes.TABLE_DENSE)}static setRoomyState(e,t){e.classList.contains(s.classes.TABLE_ROOMY)&&e.classList.remove(s.classes.TABLE_ROOMY),t&&e.classList.add(s.classes.TABLE_ROOMY)}static setResizable(e){let t=e.tableElement.tHead;e.resizable?(e.tableElement.classList.add(s.classes.TABLE_RESIZABLE),n._addResizeHandles(t,e)):(e.tableElement.classList.remove(s.classes.TABLE_RESIZABLE),n._removeResizeHandles(t,e))}static _addResizeHandles(e,t){if(!e)return;let l=e.rows.item(0);if(l){let i=Array.from(l.cells);t.selectListener&&(i=i.slice(1));for(let o of i){let a=i.indexOf(o);if(t.columnConfigurations[a].resizable!==!1){let c=document.createElement("div");c.classList.add(s.classes.TABLE_RESIZE_HANDLE),o.appendChild(c)}}}}static _removeResizeHandles(e,t){if(!e)return;let l=e.rows.item(0);if(l){let i=Array.from(l.cells);t.selectListener&&(i=i.slice(1));for(let o of i){let a=document.querySelector(`.${s.classes.TABLE_RESIZE_HANDLE}`);a&&o.removeChild(a)}}}static setWrapContentState(e,t){t?e.classList.remove(s.classes.TABLE_NO_WRAP_CONTENT):e.classList.add(s.classes.TABLE_NO_WRAP_CONTENT)}static setSelectAllVisibility(e,t,l,i,o,a){let r=e.tHead;if(!r)return;!t&&l&&n._detachSelectAllListener(r,l);let m=r.rows[r.rows.length-1].cells.item(0);t?m.childElementCount||(m.classList.add(s.classes.TABLE_CELL_SELECT),i?n._renderSelectAllTemplate(i,r).then(()=>{l&&n._tryAttachSelectAllTemplateListener(r,l)}):m.appendChild(n._createCheckboxElement(!0,o||null,null,null,null,a)),l&&!i&&n._attachSelectAllListener(r,l)):(l&&n._detachSelectAllListener(r,l),R(m))}static setFilterRow(e){if(!e.tableElement.tHead)return;let t=n._getFilterRowElement(e.tableElement.tHead),l;if(e.filter?e.tableElement.classList.add(s.classes.TABLE_FILTER_VISIBLE):e.tableElement.classList.remove(s.classes.TABLE_FILTER_VISIBLE),e.filter&&!t){if(e.columnConfigurations.every(o=>!o.filter))return;e.selectListener&&e.selectAllListener&&(l=e.tableElement.tHead.rows[e.tableElement.tHead.rows.length-1].cells.item(0));let i=n._createFilterRowElement(e);i&&l&&Array.from(l.children).forEach(o=>{var a;(a=i.cells.item(0))==null||a.appendChild(o)})}else if(!e.filter&&t){if(e.selectListener&&e.selectAllListener){l=t.cells.item(0);let i=Array.from(e.tableElement.tHead.rows).indexOf(t)-1,o=e.tableElement.tHead.rows.item(i);o&&Array.from(l.children).forEach(a=>{var r;(r=o.cells.item(0))==null||r.appendChild(a)})}W(t)}}static _createFilterRowElement(e){if(!e.tableElement.tHead)throw new Error("Table head element cannot be null.");let t=e.tableElement.tHead.insertRow();if(p([s.classes.TABLE_ROW,s.classes.TABLE_HEAD_ROW_FILTER],t),e.selectListener){let l=document.createElement("th");p([s.classes.TABLE_CELL,s.classes.TABLE_HEAD_CELL],l),t.insertBefore(l,t.cells[0]),l.classList.add(s.classes.TABLE_CELL_SELECT)}return e.columnConfigurations.forEach((l,i)=>{let o=document.createElement("th");if(p([s.classes.TABLE_CELL,s.classes.TABLE_HEAD_CELL],o),l.filter&&f(l.filterDelegate)){let a=document.createElement("div");a.classList.add(s.classes.TABLE_HEAD_CELL_CONTAINER),l.align&&n._setCellAlignmentClass(a,l.align);let r=n._createFilterElement(l,i,e.filterListener);a.appendChild(r),o.appendChild(a)}t.appendChild(o)}),t}static _createFilterElement(e,t,l){let i;if(y(e.filterDelegate))i=e.filterDelegate();else if(e.filterDelegate instanceof X||e.filterDelegate instanceof le)i=e.filterDelegate;else throw new Error("Invalid filter delegate.");if(l&&i instanceof X&&y(i.onChange))if(!f(e.filterDebounceTime)||I(e.filterDebounceTime)){let o=f(e.filterDebounceTime)?e.filterDebounceTime:s.numbers.DEFAULT_FILTER_DEBOUNCE_TIME;i.onChange(V(a=>l(a,t),o))}else i.onChange(o=>l(o,t));return i.element}static _getFilterRowElement(e){if(e)return Array.from(e.rows).find(t=>t.classList.contains(s.classes.TABLE_HEAD_ROW_FILTER))}static async expandRow(e,t,l){let i=e.tableElement.tBodies[0],a=n._getNonExpandedRows(i.rows)[t];a.classList.add(s.classes.TABLE_ROW_EXPANDED);let r=Array.from(i.rows).indexOf(a),c=i.insertRow(r+1);p([s.classes.TABLE_ROW,s.classes.TABLE_BODY_ROW,s.classes.TABLE_ROW_EXPANDABLE_CONTENT],c);let m=c.insertCell();m.setAttribute("colspan",a.cells.length.toString()),m.classList.add(s.classes.TABLE_ROW_EXPANDABLE_CONTENT_CELL);let d=document.createElement("div"),u=document.createElement(M.elementName);u.appendChild(d),m.appendChild(u);let C=l;if(y(l)){let ue=e.data[t]?e.data[t].data:void 0,be=l(t,d,ue);try{let A=await Promise.resolve(be);C=me(A)?A.content:A}catch(A){console.error("Failed to load row template "+A.message),C=""}}C&&n._setRowTemplate(d,C),window.requestAnimationFrame(()=>u.open=!0)}static _setRowTemplate(e,t){Y(t)?e.innerHTML=t:e.appendChild(t)}static collapseRow(e,t){if(!e.tableElement||!e.tableElement.tBodies.length||!e.tableElement.tBodies[0].rows.length)return Promise.resolve();let l=e.tableElement.tBodies[0],o=n._getNonExpandedRows(l.rows)[t],a=Array.from(l.rows).indexOf(o);if(o&&o.classList.contains(s.classes.TABLE_ROW_EXPANDED)){let r=l.rows[a+1],c=r.querySelector(M.elementName);if(c&&c.open)return c.open=!1,new Promise(m=>{setTimeout(()=>{o.classList.remove(s.classes.TABLE_ROW_EXPANDED),W(r),m()},M.numbers.COLLAPSE_ANIMATION_DURATION)})}return Promise.resolve()}static isRowExpanded(e,t){let l=e.tableElement.tBodies[0],o=n._getNonExpandedRows(l.rows)[t];return o&&o.classList.contains(s.classes.TABLE_ROW_EXPANDED)}static setFixedHeaders(e){e.fixedHeaders?e.tableElement.classList.add(s.classes.TABLE_FIXED):e.tableElement.classList.remove(s.classes.TABLE_FIXED)}static setLayoutType(e){e.layoutType==="fixed"?e.tableElement.classList.add(s.classes.TABLE_LAYOUT_FIXED):e.tableElement.classList.remove(s.classes.TABLE_LAYOUT_FIXED)}static normalizeColumnWidths(e){let t=e.tableElement;if(t.tHead&&t.tHead.rows.length){let l=Array.from(t.tHead.rows[0].cells);for(let i of l){let o=getComputedStyle(i).width;i.style.width&&i.style.width!==o&&(i.style.width=o)}}}static setColumnResizeIndicatorVisibility(e,t,l){let i=e.tableElement;if(i.tHead&&i.tHead.rows.length){let o=Array.from(i.tHead.rows);for(let a of o){let r=a.cells[t];r&&(l?r.classList.add(s.classes.TABLE_CELL_RESIZABLE):r.classList.remove(s.classes.TABLE_CELL_RESIZABLE))}}if(i.tBodies.length){let o=Array.from(i.tBodies[0].rows);for(let a of o){let r=a.cells[t];r&&(l?r.classList.add(s.classes.TABLE_CELL_RESIZABLE):r.classList.remove(s.classes.TABLE_CELL_RESIZABLE))}}}static setRowClickListeners(e,t,l,i){let o=e.tBodies[0];o&&(t?n._attachRowClickListeners(o,l,i):n._detachRowClickListeners(o,l,i))}static setRowClickAttributes(e,t){let l=e.tBodies[0];l&&(t?n._addRowClickAttributes(l):n._removeRowClickAttributes(l))}static getOwnerDocument(e){return e.ownerDocument||document}static _prepend(e,t){let l=t.childNodes.item(0);l?t.insertBefore(e,l):t.appendChild(e)}static _isMac(){return!!(navigator&&navigator.platform&&navigator.platform.substr(0,3)==="Mac")}static _renderSelectAllTemplate(e,t){return Promise.resolve(e()).then(l=>{let i=t.rows.item(t.rows.length-1);if(!i)return;let o=i.cells.item(0);l&&o&&(typeof l=="string"?o.innerHTML=l:l instanceof HTMLElement&&o.appendChild(l),o.setAttribute(s.attributes.CUSTOM_CELL_TEMPLATE,""))})}};var N=class extends Q{constructor(t){super(t)}initialize(){this._tableElement||(this._tableElement=document.createElement("table"),this._tableElement.classList.add(s.classes.TABLE),this._component.children.length&&R(this._component),this._component.appendChild(this._tableElement))}getTableElement(){return this._tableElement||this.initialize(),this._tableElement}createTable(t){return b.createTable(t)}recreateTableBody(t){b.recreateTableBody(t)}setSelectedRows(t,l,i,o,a=!1){b.setSelectedRows(t,l,i,o,a)}clearSelectedRows(t){b.clearSelectedRows(t)}updateSelectedState(t,l){b.updateSelectedState(t,l)}updateSelectAllState(t,l,i){b.updateSelectAllState(t,l,i)}setSortedColumn(t,l,i){b.setSortedColumn(t,l,i)}removeColumnSort(t,l){b.removeColumnSort(t,l)}setSortDirection(t,l,i){b.setSortDirection(t,l,i)}setSelectColumnVisibility(t,l,i,o,a,r,c,m,d){b.setSelectColumnVisibility(t,l,i,o||null,a||null,r||null,c||[],m||null,d||null)}setDense(t,l){b.setDenseState(t,l)}setRoomy(t,l){b.setRoomyState(t,l)}setResizable(t){b.setResizable(t)}setSelectAllVisibility(t,l,i,o,a,r=null){b.setSelectAllVisibility(t,l,i,o,a||null,r||null)}setFilterRow(t){b.setFilterRow(t)}expandRow(t,l,i){return b.expandRow(t,l,i)}collapseRow(t,l){return b.collapseRow(t,l)}isRowExpanded(t,l){return b.isRowExpanded(t,l)}setFixedHeaders(t){b.setFixedHeaders(t)}setTableLayoutType(t){b.setLayoutType(t)}setWrapContentState(t){b.setWrapContentState(t.tableElement,t.wrapContent)}addDocumentListener(t,l){b.getOwnerDocument(this._component).addEventListener(t,l)}removeDocumentListener(t,l){b.getOwnerDocument(this._component).removeEventListener(t,l)}normalizeColumnWidths(t){b.normalizeColumnWidths(t)}setResizeColumnVisibility(t,l,i){b.setColumnResizeIndicatorVisibility(t,l,i)}addTableClass(t){p(t,this._tableElement)}removeTableClass(t){D(t,this._tableElement)}setRowClickListeners(t,l,i,o){b.setRowClickListeners(t,l,i,o)}setRowClickAttributes(t,l){b.setRowClickAttributes(t,l)}};var k=class{constructor(){this._sortedColumns=[]}get sortedColumns(){return[...this._sortedColumns.map(e=>h({},e))]}addSortColumn(e){this._sortedColumns.push(h({},e)),this._updateSortNumbers()}updateSortColumn(e){let t=this._sortedColumns.find(l=>l.columnIndex===e.columnIndex);if(t)switch(t.direction){case"ASC":this.removeSortColumn(e);break;case"DESC":t.direction="ASC";break;case"UNSET":t.direction="DESC";break}}setSortColumns(e){this._sortedColumns=[...e.map(t=>h({},t))]}removeSortColumn(e){typeof e=="number"?this._sortedColumns.splice(e,1):this._sortedColumns.splice(this._sortedColumns.indexOf(e),1),this._updateSortNumbers()}isSortColumn(e){return typeof e=="number"?this._sortedColumns.some(t=>t.columnIndex===e):this._sortedColumns.includes(e)}clearMultiSort(){this._sortedColumns=[]}getSortColumn(e){return this._sortedColumns.find(t=>t.columnIndex===e)}_updateSortNumbers(){this._sortedColumns.every(e=>typeof e.sortOrder=="number")&&this._sortedColumns.sort((e,t)=>e.sortOrder-t.sortOrder),this._sortedColumns.forEach((e,t)=>e.sortOrder=t+1)}};var P=class{constructor(e,t=!1){this.data=e;this.selected=t}};var z=class{constructor(e){this._adapter=e;this._tableRows=[];this._data=[];this._columnConfigurations=[];this._select=!1;this._multiselect=!0;this._dense=!1;this._roomy=!1;this._filter=!1;this._fixedHeaders=!1;this._layoutType=s.strings.DEFAULT_LAYOUT_TYPE;this._wrapContent=!0;this._resizable=!1;this._minResizeWidth=s.numbers.MIN_RESIZE_WIDTH;this._multiColumnSort=!1;this._selectCheckboxAlignment="center";this._isAllSelected=!1;this._sortedColumnIndex=-1;this._rendered=!1;this._allowRowClick=!1;this._multiSortManager=new k;this._rowClickListener=t=>this._onRowClick(t),this._rowDoubleClickListener=t=>this._onRowDoubleClick(t),this._selectRowListener=t=>this._onRowSelected(t),this._selectAllListener=t=>this._onSelectAll(t),this._headRowMouseDownListener=t=>this._onHeadRowMouseDown(t),this._headRowContextMenuListener=t=>this._onHeadRowContextMenu(t),this._documentMouseMoveListener=t=>this._onMouseMove(t),this._documentMouseUpListener=t=>this._onMouseUp(t),this._filterListener=(t,l)=>this._onFilter(t,l),this._selectionManager=new w(this._selectKey),this._hiddenColumnManager=new w}initialize(){this.connect(),this._adapter.setHostAttribute(s.attributes.SELECT,this._select.toString()),this._adapter.setHostAttribute(s.attributes.MULTISELECT,this._multiselect.toString()),this._adapter.setHostAttribute(s.attributes.DENSE,this._dense.toString()),this._adapter.setHostAttribute(s.attributes.ROOMY,this._roomy.toString()),this._adapter.setHostAttribute(s.attributes.FILTER,this._filter.toString()),this._adapter.emitHostEvent(s.events.INITIALIZED,void 0,!1)}connect(){this._adapter.initialize()}disconnect(){this._resizeDescriptor=void 0,this._adapter.removeDocumentListener("mousemove",this._documentMouseMoveListener),this._adapter.removeDocumentListener("mouseup",this._documentMouseUpListener)}set data(e){Array.isArray(e)&&e.length>0?g(e[0])?this._data=e.map(t=>h({},t)):this._data=[...e]:this._data=[],this._tableRows=this._data.map(t=>new P(t,this._selectionManager.exists(t))),this._renderBody()}get data(){return JSON.parse(JSON.stringify(this._data))}set columnConfigurations(e){this._columnConfigurations=e.map(t=>h({},t)),this._hiddenColumnManager.clear(),this._columnConfigurations.forEach(t=>{t.hidden&&this._hiddenColumnManager.add(t)}),this._refreshTableSort(),this.render()}get columnConfigurations(){return this._columnConfigurations.map(e=>h({},e))}get _visibleColumnConfigurations(){return this._columnConfigurations.filter(e=>!this._hiddenColumnManager.exists(e))}get _tableConfiguration(){return{tableElement:this._adapter.getTableElement(),columnConfigurations:this._visibleColumnConfigurations,data:this._tableRows,clickListener:this._allowRowClick?this._rowClickListener:null,doubleClickListener:this._allowRowClick?this._rowDoubleClickListener:null,selectListener:this._select?this._selectRowListener:null,selectAllListener:this._multiselect?this._selectAllListener:null,headRowMouseDownListener:this._headRowMouseDownListener,headRowContextMenuListener:this._headRowContextMenuListener,filterListener:this._filter?this._filterListener:null,sortDirection:this._sortDirection,sortedColumn:this._sortedColumnIndex,multiColumnSort:this._multiColumnSort,filter:this._filter,wrapContent:this._wrapContent,fixedHeaders:this._fixedHeaders,layoutType:this._layoutType,dense:this._dense,resizable:this._resizable,rowCreatedCallback:this._rowCreatedCallback,cellCreatedCallback:this._cellCreatedCallback,selectAllTemplate:this._selectAllTemplate,selectCheckboxAlignment:this._selectCheckboxAlignment,tooltipSelect:this._tooltipSelect,tooltipSelectAll:this._tooltipSelectAll}}set select(e){this._select!==e&&(this._select=e,this._adapter.setSelectColumnVisibility(this._adapter.getTableElement(),this._select,this._selectRowListener,this._multiselect?this._selectAllListener:void 0,this._multiselect?this._selectAllTemplate:null,this._selectCheckboxAlignment,this._tableRows,this._tooltipSelect,this._tooltipSelectAll),this._updateSelections(!0),this._select?this._adapter.setHostAttribute(s.attributes.SELECT,this._select.toString()):this._adapter.removeHostAttribute(s.attributes.SELECT))}get select(){return this._select}set multiselect(e){this._multiselect!==e&&(this._multiselect=e,this._select&&(this._adapter.setSelectAllVisibility(this._adapter.getTableElement(),this._multiselect,this._multiselect?this._selectAllListener:null,this._multiselect?this.selectAllTemplate:null,this._selectCheckboxAlignment,this._tooltipSelectAll),this._updateSelections(!0)),this._adapter.setHostAttribute(s.attributes.MULTISELECT,this._multiselect.toString()))}get multiselect(){return this._multiselect}get selectKey(){return Array.isArray(this._selectKey)?[...this._selectKey]:this._selectKey}set selectKey(e){this._originalSelectKey!==e&&(Array.isArray(e)?(this._originalSelectKey=[...e],this._selectKey=[...e]):(this._originalSelectKey=e,this._selectKey=[e]),this._selectionManager.setKey(this._selectKey),this._updateSelections(!1))}get dense(){return this._dense}set dense(e){this._dense!==e&&(this._dense=e,this._adapter.setDense(this._adapter.getTableElement(),this._dense),this._adapter.setHostAttribute(s.attributes.DENSE,this._dense.toString()))}get roomy(){return this._roomy}set roomy(e){e!==this._roomy&&(this._roomy=e,this._applyRoomy())}set filter(e){this._filter!==e&&(this._filter=e,this._adapter.setFilterRow(this._tableConfiguration),this._adapter.setHostAttribute(s.attributes.FILTER,this._filter.toString()))}get filter(){return this._filter}set fixedHeaders(e){this._fixedHeaders!==e&&(this._fixedHeaders=e,this._adapter.setFixedHeaders(this._tableConfiguration))}get fixedHeaders(){return this._fixedHeaders}get layoutType(){return this._layoutType}set layoutType(e){this._layoutType!==e&&(this._layoutType=e,this._adapter.setTableLayoutType(this._tableConfiguration))}get wrapContent(){return this._wrapContent}set wrapContent(e){this._wrapContent!==e&&(this._wrapContent=e,this._adapter.setWrapContentState(this._tableConfiguration))}get resizable(){return this._resizable}set resizable(e){this._resizable!==e&&(this._resizable=e,this._adapter.setResizable(this._tableConfiguration))}get minResizeWidth(){return this._minResizeWidth}set minResizeWidth(e){this._minResizeWidth!==e&&(this._minResizeWidth=e,I(this._minResizeWidth)?this._minResizeWidth<0&&(this._minResizeWidth=0):this._minResizeWidth=s.numbers.MIN_RESIZE_WIDTH)}get allowRowClick(){return this._allowRowClick}set allowRowClick(e){this._allowRowClick!==e&&(this._allowRowClick=e,this._rendered&&(this._adapter.setRowClickListeners(this._adapter.getTableElement(),this._allowRowClick,this._rowClickListener,this._rowDoubleClickListener),this._adapter.setRowClickAttributes(this._adapter.getTableElement(),this._allowRowClick)))}get multiColumnSort(){return this._multiColumnSort}set multiColumnSort(e){e!==this._multiColumnSort&&(this._multiColumnSort=e,this._refreshTableSort(),this.render())}get selectCheckboxAlignment(){return this._selectCheckboxAlignment}set selectCheckboxAlignment(e){e!==this._selectCheckboxAlignment&&(this._selectCheckboxAlignment=e,this._adapter.setHostAttribute(s.attributes.SELECT_CHECKBOX_ALIGNMENT,e),this.render())}get tooltipSelect(){return this._tooltipSelect}set tooltipSelect(e){e!==this._tooltipSelect&&(this._tooltipSelect=e,typeof e=="string"&&this._adapter.setHostAttribute(s.attributes.TOOLTIP_SELECT,e),this.render())}get tooltipSelectAll(){return this._tooltipSelectAll}set tooltipSelectAll(e){e!==this._tooltipSelectAll&&(this._tooltipSelectAll=e,this._adapter.setHostAttribute(s.attributes.TOOLTIP_SELECT_ALL,e),this.render())}get selectAllTemplate(){return this._selectAllTemplate}set selectAllTemplate(e){e!==this._selectAllTemplate&&(this._selectAllTemplate=e,this.render())}get rowCreated(){return this._rowCreatedCallback}set rowCreated(e){this._rowCreatedCallback=e}get cellCreated(){return this._cellCreatedCallback}set cellCreated(e){this._cellCreatedCallback=e}isRowSelected(e){let t=v(Array.isArray(this._selectKey)?this._selectKey:[this._selectKey],e);return this.selectKey?!!this._selectionManager.getItems().find(l=>K(l,t)):this._selectionManager.exists(e)}getSelectedRows(){return this._selectionManager.getItems()}selectRows(e,t){if(!this._selectKey)throw new Error("You must set a selectKey to select rows.");(!this._multiselect||t)&&this.clearSelections(),e&&e.length&&(this._selectionManager.add(e),this._updateSelections(!t))}deselectRows(e){e&&e.length&&(this._selectionManager.remove(e),this._updateSelections(!1))}clearSelections(){let e=this._adapter.getTableElement();this._selectionManager.clear(),this._tableRows.forEach(t=>t.selected=!1),this._isAllSelected=!1,this._adapter.clearSelectedRows(e),this._select&&this._multiselect&&this._adapter.updateSelectAllState(e,!1)}hideColumn(e){let t=this._columnConfigurations[e];this._sortedColumnIndex===e&&(this._sortedColumnIndex=-1),this._hiddenColumnManager.exists(t)||(this._hiddenColumnManager.add(t),this.render())}showColumn(e){let t=this._columnConfigurations[e];this._hiddenColumnManager.exists(t)&&(this._hiddenColumnManager.remove(t),this.render())}isColumnHidden(e){let t=this._columnConfigurations[e];return!!t&&this._hiddenColumnManager.exists(t)}render(){this._adapter.createTable(this._tableConfiguration),this._renderSelections(),this._rendered=!0}_renderBody(){this._rendered&&(this._adapter.recreateTableBody(this._tableConfiguration),this._renderSelections())}_renderSelections(){this.select&&(this._isAllSelected=this._getSelectAllState(),this._multiselect&&this._adapter.updateSelectAllState(this._adapter.getTableElement(),this._isAllSelected,this._isIndeterminate(this._isAllSelected)));let e=this._selectionManager.getItems();e.length&&this._adapter.setSelectedRows(this._adapter.getTableElement(),this._selectKey,this._data,e,!1)}expandRow(e,t){if(!this._rendered)throw new Error("Cannot expand a row before the table has rendered.");if(e<0||e>this._tableRows.length)throw new Error(`Invalid row index: ${e}.`);return this._adapter.expandRow(this._tableConfiguration,e,t)}collapseRow(e){return!this._rendered||e<0||e>this._tableRows.length?Promise.resolve():this._adapter.collapseRow(this._tableConfiguration,e)}isRowExpanded(e){return this._adapter.isRowExpanded(this._tableConfiguration,e)}selectRowsByIndex(e,t){let l=e.map(i=>this._data[i]).filter(i=>!!i);this.selectRows(l,!t)}deselectRowsByIndex(e){let t=e.map(l=>this._data[l]).filter(l=>!!l);this.deselectRows(t)}_getSelectAllState(){return this._tableRows.length>0&&this._tableRows.every(e=>e.selected)}_updateSelections(e){this._tableRows.forEach(l=>l.selected=this._selectionManager.exists(l.data));let t=this._getSelectAllState();this._adapter.setSelectedRows(this._adapter.getTableElement(),this._selectKey,this._data,this._selectionManager.getItems(),e),(t!==this._isAllSelected||this._isIndeterminate(t))&&(this._isAllSelected=t,this._multiselect&&this._adapter.updateSelectAllState(this._adapter.getTableElement(),this._isAllSelected,this._isIndeterminate(this._isAllSelected)))}_onRowClick(e){if(e.stopImmediatePropagation(),e.target.tagName==="INPUT"&&e.target.type==="checkbox")return;let i=H(e).filter(m=>m.nodeType===1).find(m=>m.hasAttribute(s.attributes.CUSTOM_CELL_TEMPLATE));if(i&&i.hasAttribute(s.attributes.CUSTOM_CELL_TEMPLATE_STOP_PROPAGATION))return;let{index:a,data:r}=this._getSelectedRowFromEvent(e),c={index:a,data:r};this._adapter.emitHostEvent(s.events.ROW_CLICK,c,!0,!1)}_onRowDoubleClick(e){if(e.stopPropagation(),e.target.tagName==="INPUT"&&e.target.type==="checkbox")return;let t=this._getSelectedRowFromEvent(e),l={index:t.index,data:t.data};this._adapter.emitHostEvent(s.events.SELECT_DOUBLE,l,!0,!1)}_onRowSelected(e){let t=this._getSelectedRowFromEvent(e);this._multiselect||this._tableRows.filter(r=>r.selected).forEach(r=>{K(r.data,v(this._selectKey,t.data))||this.deselectRows([r.data])});let l=!this._selectionManager.exists(t.data);this._adapter.updateSelectedState(t.rowElement,l),l?this._selectionManager.add(t.data):this._selectionManager.remove(t.data),this._tableRows[t.index].selected=l;let i=[t.index],o=!1;if(this._multiselect){if(e.shiftKey&&this._previouslyClickedRow&&(i=this._shiftSelectRows(t),i.includes(this._previouslyClickedRow.index))){let r=i.indexOf(this._previouslyClickedRow.index);i.splice(r,1)}o=this._getSelectAllState(),this._adapter.updateSelectAllState(this._adapter.getTableElement(),o,this._isIndeterminate(o))}for(let a of i){let r=this._tableRows[a].data,m={selected:this._selectionManager.exists(r),index:a,data:r};this._adapter.emitHostEvent(s.events.SELECT,m,!0,!1)}if(this._isAllSelected!==o){this._isAllSelected=o;let a={status:this._isAllSelected,count:this._tableRows.filter(r=>r.selected).length,data:[...this._data],targetType:"row"};this._adapter.emitHostEvent(s.events.SELECT_ALL,a,!0,!1)}this._previouslyClickedRow=h({},t)}_getSelectedRowFromEvent(e){let l=H(e).find(r=>r.tagName==="TR"),i=l.parentElement,o=this._getNonExpandedRows(i).findIndex(r=>r===l),a=this._tableRows[o].data;return{rowElement:l,index:o,data:a}}_getNonExpandedRows(e){return Array.from(e.rows).filter(t=>!t.classList.contains(s.classes.TABLE_ROW_EXPANDABLE_CONTENT))}_onSelectAll(e){e.stopPropagation(),this._isAllSelected=!this._isAllSelected;let t=this._adapter.getTableElement();this._adapter.updateSelectAllState(t,this._isAllSelected),this._tableRows.forEach((i,o)=>{i.selected=this._isAllSelected,this._isAllSelected?this._selectionManager.add(i.data):this._selectionManager.remove(i.data);let a=b.getRowByIndex(t,o);a&&this._adapter.updateSelectedState(a,this._isAllSelected)});let l={status:this._isAllSelected,count:this._tableRows.filter(i=>i.selected).length,data:[...this._data],targetType:"select-all"};this._adapter.emitHostEvent(s.events.SELECT_ALL,l,!0,!1)}_onHeadRowContextMenu(e){e.preventDefault()}_onHeadRowMouseDown(e){if(e.button!==0)return;let t=H(e),l=e.target,i=t.find(r=>r.tagName==="TR"),o=t.find(r=>r.tagName==="TH"),a=Array.from(i.cells).findIndex(r=>r===o);this._headCellMouseDownIndex=a,l!==o&&l.classList.contains(s.classes.TABLE_RESIZE_HANDLE)&&(this._resizeDescriptor={element:o,startWidth:o.offsetWidth,startX:e.pageX,width:o.offsetWidth,index:this._select?a-1:a},this._adapter.addDocumentListener("mousemove",this._documentMouseMoveListener),this._adapter.setResizeColumnVisibility(this._tableConfiguration,a,!0)),this._adapter.addDocumentListener("mouseup",this._documentMouseUpListener)}_onMouseMove(e){if(this._resizeDescriptor){let t=this._resizeDescriptor.startWidth+(e.pageX-this._resizeDescriptor.startX);t<this._minResizeWidth&&(t=this._minResizeWidth),this._resizeDescriptor.width=t,this._resizeDescriptor.element.style.width=`${t}px`,this._adapter.addTableClass(s.classes.TABLE_RESIZING)}}_onMouseUp(e){if(this._adapter.removeDocumentListener("mousemove",this._documentMouseMoveListener),this._adapter.removeDocumentListener("mouseup",this._documentMouseUpListener),this._adapter.removeTableClass(s.classes.TABLE_RESIZING),this._headCellMouseDownIndex!==void 0){if(this._resizeDescriptor){this._adapter.normalizeColumnWidths(this._tableConfiguration),this._adapter.setResizeColumnVisibility(this._tableConfiguration,this._headCellMouseDownIndex,!1);let t={index:this._resizeDescriptor.index,width:this._resizeDescriptor.width};this._adapter.emitHostEvent(s.events.COLUMN_RESIZE,t),this._resizeDescriptor=void 0}else this._tableConfiguration.tableElement.tHead.contains(e.target)&&(this._multiColumnSort?this._onMultiSort(this._headCellMouseDownIndex,e.ctrlKey):this._onSort(this._headCellMouseDownIndex));this._headCellMouseDownIndex=void 0}}_onSort(e){let t=this._select?e-1:e,l=t>=0?this._visibleColumnConfigurations[t]:null;if(!l||!l.sortable)return;let i="ASC",o=t===this._sortedColumnIndex,a=this._sortDirection==="ASC"||this._sortDirection===void 0,r=o&&this._sortDirection==="DESC";o&&a&&(i="DESC"),r&&!l.preventUnsort&&(i="UNSET");let c={direction:i,columnIndex:t};if(this._adapter.emitHostEvent(s.events.SORT,c,!0,!0)){if(o&&this._sortDirection==="DESC"&&!l.preventUnsort){this._adapter.removeColumnSort(this._adapter.getTableElement(),this._select?this._sortedColumnIndex+1:this._sortedColumnIndex),this._sortedColumnIndex=-1;return}this._sortDirection=i,t===this._sortedColumnIndex?this._adapter.setSortDirection(this._adapter.getTableElement(),e,this._sortDirection):(this._sortedColumnIndex>=0&&this._adapter.removeColumnSort(this._adapter.getTableElement(),this._select?this._sortedColumnIndex+1:this._sortedColumnIndex),this._sortedColumnIndex=t,this._adapter.setSortedColumn(this._adapter.getTableElement(),e,this._sortDirection))}}_onMultiSort(e,t){let l=this._select?e-1:e,i=l>=0?this._visibleColumnConfigurations[l]:null;if(!i||!i.sortable)return;let o=this._multiSortManager.sortedColumns,a=this._multiSortManager.getSortColumn(l);a?this._multiSortManager.updateSortColumn(a):t?this._multiSortManager.addSortColumn({direction:"DESC",columnIndex:l,propertyName:i.property}):(this._multiSortManager.clearMultiSort(),this._multiSortManager.addSortColumn({direction:"DESC",columnIndex:l,propertyName:i.property}));let r=this._multiSortManager.sortedColumns.map(d=>h({},d));if(!this._adapter.emitHostEvent(s.events.SORT,r,!0,!0)){this._multiSortManager.setSortColumns(o);return}let m=this._multiSortManager.sortedColumns.length>1;for(let d=0;d<this._visibleColumnConfigurations.length;d++){let u=this._select?d+1:d;if(!this._multiSortManager.isSortColumn(d))this._adapter.removeColumnSort(this._adapter.getTableElement(),u),b.setMultiSortColumnSortNumber(this._adapter.getTableElement(),m,u,null);else{let C=this._multiSortManager.getSortColumn(d);C&&(this._adapter.setSortedColumn(this._adapter.getTableElement(),u,C.direction),b.setMultiSortColumnSortNumber(this._adapter.getTableElement(),m,u,C.sortOrder||null))}}}_onFilter(e,t){let l={value:e,columnIndex:t};this._adapter.emitHostEvent(s.events.FILTER,l,!0,!1)}_shiftSelectRows(e){let t=[];if(this._previouslyClickedRow){let l=this._previouslyClickedRow.index,i=e.index,o=i>=l?l:i,a=i>=l?i:l;a+=a>o?1:0,o+=o>a?1:0;let r=d=>this.selectRows(d,!1),c=this._tableRows.find(d=>d.selected&&d.data===e.data),m=this._tableRows.find(d=>{var u;return d.data===((u=this._previouslyClickedRow)==null?void 0:u.data)&&!d.selected});(!c||m)&&(r=d=>this.deselectRows(d));for(let d=o;d<a;d++)t.push(d);r(this.data.filter((d,u)=>t.includes(u)))}return t}_isIndeterminate(e){return!e&&this.getSelectedRows().length>0&&this._data.length!==this.getSelectedRows().length}_applyRoomy(){this._adapter.setRoomy(this._adapter.getTableElement(),this._roomy),this._adapter.setHostAttribute(s.attributes.ROOMY,this._roomy.toString())}_refreshTableSort(){if(this._sortedColumnIndex=this._visibleColumnConfigurations.findIndex(e=>e.initialSort),this._sortDirection=this._sortedColumnIndex>=0?this._visibleColumnConfigurations[this._sortedColumnIndex].sortDirection:void 0,this._multiColumnSort){let e=[];this._visibleColumnConfigurations.forEach((t,l)=>{typeof t.initialSort=="object"&&e.push({columnIndex:l,direction:t.initialSort.direction,sortOrder:t.initialSort.sortOrder,propertyName:t.property})}),this._multiSortManager.setSortColumns(e)}}};var E=class extends J{constructor(){super();se.define(te),this._foundation=new z(new N(this))}static get observedAttributes(){return[s.attributes.SELECT,s.attributes.MULTISELECT,s.attributes.SELECT_KEY,s.attributes.DENSE,s.attributes.ROOMY,s.attributes.FILTER,s.attributes.FIXED_HEADERS,s.attributes.LAYOUT_TYPE,s.attributes.WRAP_CONTENT,s.attributes.RESIZABLE,s.attributes.MIN_RESIZE_WIDTH,s.attributes.ALLOW_ROW_CLICK,s.attributes.MULTI_COLUMN_SORT,s.attributes.SELECT_CHECKBOX_ALIGNMENT,s.attributes.TOOLTIP_SELECT,s.attributes.TOOLTIP_SELECT_ALL]}initializedCallback(){this._foundation.initialize()}connectedCallback(){this._foundation.connect()}disconnectedCallback(){this._foundation.disconnect()}attributeChangedCallback(t,l,i){switch(t){case s.attributes.SELECT:this.select=L(i);break;case s.attributes.MULTISELECT:this.multiselect=L(i);break;case s.attributes.SELECT_KEY:this.selectKey=i;break;case s.attributes.DENSE:this.dense=L(i);break;case s.attributes.ROOMY:this.roomy=L(i);break;case s.attributes.FILTER:this.filter=L(i);break;case s.attributes.FIXED_HEADERS:this.fixedHeaders=L(i);break;case s.attributes.LAYOUT_TYPE:this.layoutType=i;break;case s.attributes.WRAP_CONTENT:this.wrapContent=L(i);break;case s.attributes.RESIZABLE:this.resizable=L(i);break;case s.attributes.MIN_RESIZE_WIDTH:this.minResizeWidth=G(i);break;case s.attributes.ALLOW_ROW_CLICK:this.allowRowClick=L(i);break;case s.attributes.MULTI_COLUMN_SORT:this.multiColumnSort=L(i);break;case s.attributes.SELECT_CHECKBOX_ALIGNMENT:this.selectCheckboxAlignment=this.getAttribute(s.attributes.SELECT_CHECKBOX_ALIGNMENT)||"center";break;case s.attributes.TOOLTIP_SELECT:this.tooltipSelect=i;break;case s.attributes.TOOLTIP_SELECT_ALL:this.tooltipSelectAll=i;break}}hideColumn(t){this._foundation.hideColumn(t)}showColumn(t){this._foundation.showColumn(t)}isColumnHidden(t){return this._foundation.isColumnHidden(t)}getSelectedRows(){return this._foundation.getSelectedRows()}selectRow(t){this._foundation.selectRows([t],!1)}selectRows(t,l=!1){this._foundation.selectRows(t,!l)}deselectRow(t){this._foundation.deselectRows([t])}deselectRows(t){this._foundation.deselectRows(t)}clearSelections(){this._foundation.clearSelections()}render(){this._foundation.render()}expandRow(t,l){return this._foundation.expandRow(t,l)}collapseRow(t){return this._foundation.collapseRow(t)}isRowExpanded(t){return this._foundation.isRowExpanded(t)}selectRowsByIndex(t,l){typeof t=="number"?this._foundation.selectRowsByIndex([t],l):Array.isArray(t)&&this._foundation.selectRowsByIndex(t,l)}deselectRowsByIndex(t){typeof t=="number"?this._foundation.deselectRowsByIndex([t]):Array.isArray(t)&&this._foundation.deselectRowsByIndex(t)}isRowSelected(t){return this._foundation.isRowSelected(t)}};_([T()],E.prototype,"data",2),_([T()],E.prototype,"columnConfigurations",2),_([T()],E.prototype,"select",2),_([T()],E.prototype,"multiselect",2),_([T()],E.prototype,"selectKey",2),_([T()],E.prototype,"tooltipSelect",2),_([T()],E.prototype,"tooltipSelectAll",2),_([T()],E.prototype,"dense",2),_([T()],E.prototype,"roomy",2),_([T()],E.prototype,"filter",2),_([T()],E.prototype,"fixedHeaders",2),_([T()],E.prototype,"layoutType",2),_([T()],E.prototype,"wrapContent",2),_([T()],E.prototype,"resizable",2),_([T()],E.prototype,"minResizeWidth",2),_([T()],E.prototype,"allowRowClick",2),_([T()],E.prototype,"multiColumnSort",2),_([T()],E.prototype,"rowCreated",2),_([T()],E.prototype,"cellCreated",2),_([T()],E.prototype,"selectAllTemplate",2),_([T()],E.prototype,"selectCheckboxAlignment",2),E=_([j({name:s.elementName,dependencies:[ae,oe,ce]})],E);function pl(){q(E)}export{s as a,B as b,O as c,Le as d,N as e,P as f,z as g,E as h,pl as i};
7
+ //# sourceMappingURL=chunk.XBW6KSW3.js.map