@mhmo91/schmancy 0.7.6 → 0.8.3

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 (549) hide show
  1. package/ai/audio.md +241 -0
  2. package/ai/content-drawer.md +163 -70
  3. package/ai/details.md +309 -44
  4. package/ai/lightbox.md +381 -0
  5. package/ai/typography.md +75 -49
  6. package/dist/ai/audio.md +241 -0
  7. package/dist/ai/content-drawer.md +163 -70
  8. package/dist/ai/details.md +309 -44
  9. package/dist/ai/lightbox.md +381 -0
  10. package/dist/ai/typography.md +75 -49
  11. package/dist/{animated-text-1FDC-OTA.cjs → animated-text-Bc3qyXjp.cjs} +2 -2
  12. package/dist/{animated-text-1FDC-OTA.cjs.map → animated-text-Bc3qyXjp.cjs.map} +1 -1
  13. package/dist/{animated-text-1_latidd.js → animated-text-CNx6Pmlo.js} +3 -3
  14. package/dist/{animated-text-1_latidd.js.map → animated-text-CNx6Pmlo.js.map} +1 -1
  15. package/dist/animated-text.cjs +1 -1
  16. package/dist/animated-text.js +1 -1
  17. package/dist/area.cjs +1 -1
  18. package/dist/{area.component-CQq-Mh0Z.js → area.component-7mWxekxE.js} +104 -98
  19. package/dist/area.component-7mWxekxE.js.map +1 -0
  20. package/dist/area.component-CS_gSutH.cjs +12 -0
  21. package/dist/area.component-CS_gSutH.cjs.map +1 -0
  22. package/dist/area.js +1 -1
  23. package/dist/audio.cjs +2 -0
  24. package/dist/audio.cjs.map +1 -0
  25. package/dist/audio.js +9 -0
  26. package/dist/audio.js.map +1 -0
  27. package/dist/{autocomplete-DT9MFPEG.js → autocomplete-Ci4jo3Ur.js} +4 -4
  28. package/dist/{autocomplete-DT9MFPEG.js.map → autocomplete-Ci4jo3Ur.js.map} +1 -1
  29. package/dist/{autocomplete-auTO_M_w.cjs → autocomplete-y-IyzH4r.cjs} +2 -2
  30. package/dist/{autocomplete-auTO_M_w.cjs.map → autocomplete-y-IyzH4r.cjs.map} +1 -1
  31. package/dist/autocomplete.cjs +1 -1
  32. package/dist/autocomplete.js +1 -1
  33. package/dist/{avatar-Dm_qg-n1.js → avatar-BdyuuIk7.js} +243 -258
  34. package/dist/avatar-BdyuuIk7.js.map +1 -0
  35. package/dist/avatar-DBfJucB9.cjs +273 -0
  36. package/dist/avatar-DBfJucB9.cjs.map +1 -0
  37. package/dist/badge.cjs +1 -1
  38. package/dist/badge.js +1 -1
  39. package/dist/{boat-RNCKlx8b.js → boat-CowHieO2.js} +6 -6
  40. package/dist/{boat-RNCKlx8b.js.map → boat-CowHieO2.js.map} +1 -1
  41. package/dist/{boat-98He5-K8.cjs → boat-DkNUc1UO.cjs} +5 -5
  42. package/dist/{boat-98He5-K8.cjs.map → boat-DkNUc1UO.cjs.map} +1 -1
  43. package/dist/boat.cjs +1 -1
  44. package/dist/boat.js +1 -1
  45. package/dist/busy.cjs +1 -1
  46. package/dist/busy.js +1 -1
  47. package/dist/button.cjs +1 -1
  48. package/dist/button.js +1 -1
  49. package/dist/card.cjs +1 -1
  50. package/dist/card.js +1 -1
  51. package/dist/charts.cjs +2 -0
  52. package/dist/charts.cjs.map +1 -0
  53. package/dist/charts.js +9 -0
  54. package/dist/charts.js.map +1 -0
  55. package/dist/{checkbox-Bdn1_WJg.js → checkbox-BY4Sn8F2.js} +6 -6
  56. package/dist/{checkbox-Bdn1_WJg.js.map → checkbox-BY4Sn8F2.js.map} +1 -1
  57. package/dist/{checkbox-Dj06r6MD.cjs → checkbox-BvWcABPr.cjs} +2 -2
  58. package/dist/{checkbox-Dj06r6MD.cjs.map → checkbox-BvWcABPr.cjs.map} +1 -1
  59. package/dist/checkbox.cjs +1 -1
  60. package/dist/checkbox.js +1 -1
  61. package/dist/chips.cjs +1 -1
  62. package/dist/chips.js +2 -2
  63. package/dist/code-highlight.cjs +1 -1
  64. package/dist/code-highlight.js +1 -1
  65. package/dist/{code-preview-ByxcwPma.cjs → code-preview-BIFIJigy.cjs} +2 -2
  66. package/dist/{code-preview-ByxcwPma.cjs.map → code-preview-BIFIJigy.cjs.map} +1 -1
  67. package/dist/{code-preview-Br7zBkyM.js → code-preview-CYjmAxfs.js} +3 -3
  68. package/dist/{code-preview-Br7zBkyM.js.map → code-preview-CYjmAxfs.js.map} +1 -1
  69. package/dist/components.cjs +1 -1
  70. package/dist/components.js +1 -1
  71. package/dist/content-drawer.cjs +1 -1
  72. package/dist/content-drawer.js +1 -1
  73. package/dist/{context-create-BvxbWTgj.js → context-create-B_S-sD5B.js} +69 -57
  74. package/dist/context-create-B_S-sD5B.js.map +1 -0
  75. package/dist/context-create-DTybDbZp.cjs +2 -0
  76. package/dist/context-create-DTybDbZp.cjs.map +1 -0
  77. package/dist/date-range-B80Ummtv.cjs +119 -0
  78. package/dist/date-range-B80Ummtv.cjs.map +1 -0
  79. package/dist/date-range-BdIqI7LC.js +639 -0
  80. package/dist/date-range-BdIqI7LC.js.map +1 -0
  81. package/dist/{date-range-inline-l2G48xTX.js → date-range-inline-Cnhs9atd.js} +3 -3
  82. package/dist/{date-range-inline-l2G48xTX.js.map → date-range-inline-Cnhs9atd.js.map} +1 -1
  83. package/dist/{date-range-inline-kbokz03Z.cjs → date-range-inline-Df8u6Ecy.cjs} +2 -2
  84. package/dist/{date-range-inline-kbokz03Z.cjs.map → date-range-inline-Df8u6Ecy.cjs.map} +1 -1
  85. package/dist/date-range-inline.cjs +1 -1
  86. package/dist/date-range-inline.js +1 -1
  87. package/dist/date-range.cjs +1 -1
  88. package/dist/date-range.js +1 -1
  89. package/dist/{delay-CCreUpYu.cjs → delay-BWsVHQib.cjs} +2 -2
  90. package/dist/delay-BWsVHQib.cjs.map +1 -0
  91. package/dist/{delay-Nu7RVtYd.js → delay-CCa9nN4A.js} +45 -45
  92. package/dist/delay-CCa9nN4A.js.map +1 -0
  93. package/dist/delay.cjs +1 -1
  94. package/dist/delay.js +1 -1
  95. package/dist/details-Bee5ya0L.js +100 -0
  96. package/dist/details-Bee5ya0L.js.map +1 -0
  97. package/dist/details-oaVHXU7U.cjs +55 -0
  98. package/dist/details-oaVHXU7U.cjs.map +1 -0
  99. package/dist/details.cjs +1 -1
  100. package/dist/details.js +1 -1
  101. package/dist/dialog-service-C86xTS8q.cjs +2 -0
  102. package/dist/dialog-service-C86xTS8q.cjs.map +1 -0
  103. package/dist/dialog-service-D9E3jLAR.js +118 -0
  104. package/dist/dialog-service-D9E3jLAR.js.map +1 -0
  105. package/dist/dialog.cjs +1 -1
  106. package/dist/dialog.component-BriB-kFi.cjs +48 -0
  107. package/dist/dialog.component-BriB-kFi.cjs.map +1 -0
  108. package/dist/dialog.component-CMUoCC7O.js +145 -0
  109. package/dist/dialog.component-CMUoCC7O.js.map +1 -0
  110. package/dist/dialog.js +7 -7
  111. package/dist/directives.cjs +1 -1
  112. package/dist/directives.js +11 -10
  113. package/dist/directives.js.map +1 -1
  114. package/dist/{divider-CqyzFfn1.js → divider-B7DBbYFI.js} +3 -3
  115. package/dist/{divider-CqyzFfn1.js.map → divider-B7DBbYFI.js.map} +1 -1
  116. package/dist/{divider-0yHQS8kR.cjs → divider-Dl4TToQZ.cjs} +2 -2
  117. package/dist/{divider-0yHQS8kR.cjs.map → divider-Dl4TToQZ.cjs.map} +1 -1
  118. package/dist/divider.cjs +1 -1
  119. package/dist/divider.js +1 -1
  120. package/dist/{dropdown-content-BmHQE5-P.cjs → dropdown-content-C2W7OttQ.cjs} +2 -2
  121. package/dist/{dropdown-content-BmHQE5-P.cjs.map → dropdown-content-C2W7OttQ.cjs.map} +1 -1
  122. package/dist/{dropdown-content-iFlLupVo.js → dropdown-content-DzhOtilY.js} +3 -3
  123. package/dist/{dropdown-content-iFlLupVo.js.map → dropdown-content-DzhOtilY.js.map} +1 -1
  124. package/dist/dropdown.cjs +1 -1
  125. package/dist/dropdown.js +1 -1
  126. package/dist/{email-recipients-CmAEJDMC.js → email-recipients-BWqZKo3m.js} +8 -7
  127. package/dist/{email-recipients-CmAEJDMC.js.map → email-recipients-BWqZKo3m.js.map} +1 -1
  128. package/dist/{email-recipients-Cioc3U0Z.cjs → email-recipients-Bh5VC0rc.cjs} +2 -2
  129. package/dist/{email-recipients-Cioc3U0Z.cjs.map → email-recipients-Bh5VC0rc.cjs.map} +1 -1
  130. package/dist/emotional-sounds-BRnFhww6.js +234 -0
  131. package/dist/emotional-sounds-BRnFhww6.js.map +1 -0
  132. package/dist/emotional-sounds-DVGhmoZf.cjs +2 -0
  133. package/dist/emotional-sounds-DVGhmoZf.cjs.map +1 -0
  134. package/dist/extra.cjs +1 -1
  135. package/dist/extra.js +1 -1
  136. package/dist/flex-53G-PJx7.js +183 -0
  137. package/dist/flex-53G-PJx7.js.map +1 -0
  138. package/dist/flex-DFSIy0t4.cjs +18 -0
  139. package/dist/flex-DFSIy0t4.cjs.map +1 -0
  140. package/dist/{form-CxrvY530.js → form-BtRK9bnp.js} +2 -2
  141. package/dist/{form-CxrvY530.js.map → form-BtRK9bnp.js.map} +1 -1
  142. package/dist/{form-DFDTspmH.cjs → form-Zq7g2JS8.cjs} +2 -2
  143. package/dist/{form-DFDTspmH.cjs.map → form-Zq7g2JS8.cjs.map} +1 -1
  144. package/dist/form.cjs +1 -1
  145. package/dist/form.js +1 -1
  146. package/dist/{formField.mixin-hZ2qP4iG.js → formField.mixin-2jSL7WF_.js} +2 -2
  147. package/dist/{formField.mixin-hZ2qP4iG.js.map → formField.mixin-2jSL7WF_.js.map} +1 -1
  148. package/dist/{formField.mixin-C7H5DaEl.cjs → formField.mixin-DkN2ufR_.cjs} +2 -2
  149. package/dist/{formField.mixin-C7H5DaEl.cjs.map → formField.mixin-DkN2ufR_.cjs.map} +1 -1
  150. package/dist/height-CfECBO2j.js +44 -0
  151. package/dist/height-CfECBO2j.js.map +1 -0
  152. package/dist/height-Z70qJYJK.cjs +2 -0
  153. package/dist/height-Z70qJYJK.cjs.map +1 -0
  154. package/dist/{icon-D0FAI5uJ.js → icon-B5qeYrDu.js} +17 -17
  155. package/dist/icon-B5qeYrDu.js.map +1 -0
  156. package/dist/icon-button-BpmGFjaR.cjs +70 -0
  157. package/dist/icon-button-BpmGFjaR.cjs.map +1 -0
  158. package/dist/icon-button-HSYaQBNF.js +164 -0
  159. package/dist/icon-button-HSYaQBNF.js.map +1 -0
  160. package/dist/icon-pU_cfmpD.cjs +49 -0
  161. package/dist/icon-pU_cfmpD.cjs.map +1 -0
  162. package/dist/icons.cjs +1 -1
  163. package/dist/icons.js +1 -1
  164. package/dist/index.cjs +1 -1
  165. package/dist/index.js +275 -250
  166. package/dist/index.js.map +1 -1
  167. package/dist/input-8G9YY9qv.cjs +51 -0
  168. package/dist/input-8G9YY9qv.cjs.map +1 -0
  169. package/dist/{input-DLnKAj3B.js → input-BJMF5Fyk.js} +35 -31
  170. package/dist/input-BJMF5Fyk.js.map +1 -0
  171. package/dist/{input-chip-C3EPsHcP.cjs → input-chip-CocdqTzr.cjs} +2 -2
  172. package/dist/{input-chip-C3EPsHcP.cjs.map → input-chip-CocdqTzr.cjs.map} +1 -1
  173. package/dist/{input-chip-dmqYCExV.js → input-chip-tbrw56ix.js} +2 -2
  174. package/dist/{input-chip-dmqYCExV.js.map → input-chip-tbrw56ix.js.map} +1 -1
  175. package/dist/input.cjs +1 -1
  176. package/dist/input.js +1 -1
  177. package/dist/json-CvcloKQv.js +51 -0
  178. package/dist/json-CvcloKQv.js.map +1 -0
  179. package/dist/json-DPnyOA3K.cjs +12 -0
  180. package/dist/json-DPnyOA3K.cjs.map +1 -0
  181. package/dist/json.cjs +2 -0
  182. package/dist/json.cjs.map +1 -0
  183. package/dist/json.js +5 -0
  184. package/dist/json.js.map +1 -0
  185. package/dist/layout.cjs +1 -1
  186. package/dist/layout.js +4 -3
  187. package/dist/layout.js.map +1 -1
  188. package/dist/lightbox-service-3mHqBKEh.cjs +202 -0
  189. package/dist/lightbox-service-3mHqBKEh.cjs.map +1 -0
  190. package/dist/lightbox-service-DxbYZAuv.js +458 -0
  191. package/dist/lightbox-service-DxbYZAuv.js.map +1 -0
  192. package/dist/lightbox.cjs +2 -0
  193. package/dist/lightbox.cjs.map +1 -0
  194. package/dist/lightbox.js +8 -0
  195. package/dist/lightbox.js.map +1 -0
  196. package/dist/{list-BegNkhOn.js → list-FWXmY-eQ.js} +2 -2
  197. package/dist/{list-BegNkhOn.js.map → list-FWXmY-eQ.js.map} +1 -1
  198. package/dist/{list-CLKiZ6lk.cjs → list-JjR7WOrd.cjs} +2 -2
  199. package/dist/{list-CLKiZ6lk.cjs.map → list-JjR7WOrd.cjs.map} +1 -1
  200. package/dist/list.cjs +1 -1
  201. package/dist/list.js +1 -1
  202. package/dist/{litElement.mixin-CPQYJnK_.cjs → litElement.mixin-BVBdv0GP.cjs} +2 -2
  203. package/dist/{litElement.mixin-CPQYJnK_.cjs.map → litElement.mixin-BVBdv0GP.cjs.map} +1 -1
  204. package/dist/{litElement.mixin-DWDPaNoc.js → litElement.mixin-Wcu4yIIs.js} +2 -2
  205. package/dist/{litElement.mixin-DWDPaNoc.js.map → litElement.mixin-Wcu4yIIs.js.map} +1 -1
  206. package/dist/mailbox.cjs +1 -1
  207. package/dist/mailbox.js +1 -1
  208. package/dist/{map-CUKZ6LrR.js → map-Br6xJFxG.js} +2 -2
  209. package/dist/{map-CUKZ6LrR.js.map → map-Br6xJFxG.js.map} +1 -1
  210. package/dist/{map-w4Kdtycx.cjs → map-D9R3OCne.cjs} +2 -2
  211. package/dist/{map-w4Kdtycx.cjs.map → map-D9R3OCne.cjs.map} +1 -1
  212. package/dist/map.cjs +1 -1
  213. package/dist/map.js +1 -1
  214. package/dist/{media-CjdCchz8.js → media-BV_1DfcW.js} +2 -2
  215. package/dist/{media-CjdCchz8.js.map → media-BV_1DfcW.js.map} +1 -1
  216. package/dist/{media-DDNmuoV0.cjs → media-DibPwAjJ.cjs} +2 -2
  217. package/dist/{media-DDNmuoV0.cjs.map → media-DibPwAjJ.cjs.map} +1 -1
  218. package/dist/menu-HKqlq99V.js +60 -0
  219. package/dist/{menu-ofiPDY2a.js.map → menu-HKqlq99V.js.map} +1 -1
  220. package/dist/{menu-D9-9vipn.cjs → menu-vNrV-Nuq.cjs} +4 -6
  221. package/dist/{menu-D9-9vipn.cjs.map → menu-vNrV-Nuq.cjs.map} +1 -1
  222. package/dist/menu.cjs +1 -1
  223. package/dist/menu.js +1 -1
  224. package/dist/mixins.cjs +1 -1
  225. package/dist/mixins.js +3 -3
  226. package/dist/nav-drawer.cjs +1 -1
  227. package/dist/nav-drawer.js +1 -1
  228. package/dist/navigation-bar.cjs +1 -1
  229. package/dist/navigation-bar.js +1 -1
  230. package/dist/{navigation-rail-CEDLJTrH.cjs → navigation-rail-D1o3qDe_.cjs} +15 -17
  231. package/dist/navigation-rail-D1o3qDe_.cjs.map +1 -0
  232. package/dist/{navigation-rail-weSW6BCv.js → navigation-rail-DKXumnmt.js} +30 -32
  233. package/dist/navigation-rail-DKXumnmt.js.map +1 -0
  234. package/dist/navigation-rail.cjs +1 -1
  235. package/dist/navigation-rail.js +1 -1
  236. package/dist/notification-service-B5ljba4P.js +155 -0
  237. package/dist/notification-service-B5ljba4P.js.map +1 -0
  238. package/dist/notification-service-ICRT05L0.cjs +19 -0
  239. package/dist/notification-service-ICRT05L0.cjs.map +1 -0
  240. package/dist/notification.cjs +1 -1
  241. package/dist/notification.js +6 -8
  242. package/dist/{notify-Ci0HrUIo.js → notify-B9CpO1Ru.js} +2 -2
  243. package/dist/notify-B9CpO1Ru.js.map +1 -0
  244. package/dist/{notify-aasSKQGA.cjs → notify-NX-dl60E.cjs} +2 -2
  245. package/dist/notify-NX-dl60E.cjs.map +1 -0
  246. package/dist/{option-Cs4e3CzF.js → option-B4JKMrLg.js} +2 -2
  247. package/dist/{option-Cs4e3CzF.js.map → option-B4JKMrLg.js.map} +1 -1
  248. package/dist/{option-Uze_q9Ef.cjs → option-epyXLWoY.cjs} +2 -2
  249. package/dist/{option-Uze_q9Ef.cjs.map → option-epyXLWoY.cjs.map} +1 -1
  250. package/dist/option.cjs +1 -1
  251. package/dist/option.js +1 -1
  252. package/dist/page-Bmi1QHtq.cjs +20 -0
  253. package/dist/page-Bmi1QHtq.cjs.map +1 -0
  254. package/dist/page-BpygEntU.js +48 -0
  255. package/dist/page-BpygEntU.js.map +1 -0
  256. package/dist/page.cjs +2 -0
  257. package/dist/page.cjs.map +1 -0
  258. package/dist/page.js +5 -0
  259. package/dist/page.js.map +1 -0
  260. package/dist/{payment-card-form-rJCPUtWE.cjs → payment-card-form-3kAXDbXf.cjs} +2 -2
  261. package/dist/{payment-card-form-rJCPUtWE.cjs.map → payment-card-form-3kAXDbXf.cjs.map} +1 -1
  262. package/dist/{payment-card-form-BLoUTYiB.js → payment-card-form-BxkHuSls.js} +3 -3
  263. package/dist/{payment-card-form-BLoUTYiB.js.map → payment-card-form-BxkHuSls.js.map} +1 -1
  264. package/dist/pills-C3fIvfn8.js +346 -0
  265. package/dist/pills-C3fIvfn8.js.map +1 -0
  266. package/dist/pills-MmHyBGQu.cjs +113 -0
  267. package/dist/pills-MmHyBGQu.cjs.map +1 -0
  268. package/dist/progress-0POmJs5o.js +59 -0
  269. package/dist/progress-0POmJs5o.js.map +1 -0
  270. package/dist/progress-qx8jtrOA.cjs +35 -0
  271. package/dist/progress-qx8jtrOA.cjs.map +1 -0
  272. package/dist/progress.cjs +1 -1
  273. package/dist/progress.js +1 -1
  274. package/dist/qr-scanner-DQq-WLyo.cjs +29 -0
  275. package/dist/qr-scanner-DQq-WLyo.cjs.map +1 -0
  276. package/dist/qr-scanner-jwOSrD0N.js +743 -0
  277. package/dist/qr-scanner-jwOSrD0N.js.map +1 -0
  278. package/dist/qr-scanner.cjs +2 -0
  279. package/dist/qr-scanner.cjs.map +1 -0
  280. package/dist/qr-scanner.js +5 -0
  281. package/dist/qr-scanner.js.map +1 -0
  282. package/dist/{radio-button-CaDaw5VH.js → radio-button-B0EUK_wg.js} +3 -3
  283. package/dist/{radio-button-CaDaw5VH.js.map → radio-button-B0EUK_wg.js.map} +1 -1
  284. package/dist/{radio-button-BAS7gKmA.cjs → radio-button-DraEYR2R.cjs} +2 -2
  285. package/dist/{radio-button-BAS7gKmA.cjs.map → radio-button-DraEYR2R.cjs.map} +1 -1
  286. package/dist/radio-group.cjs +1 -1
  287. package/dist/radio-group.js +1 -1
  288. package/dist/ripple-BgJXbNSP.js +124 -0
  289. package/dist/ripple-BgJXbNSP.js.map +1 -0
  290. package/dist/ripple-x6sTX02K.cjs +16 -0
  291. package/dist/ripple-x6sTX02K.cjs.map +1 -0
  292. package/dist/{schmancy-steps-container-wQsksygx.cjs → schmancy-steps-container-B5aiqgMA.cjs} +2 -2
  293. package/dist/{schmancy-steps-container-wQsksygx.cjs.map → schmancy-steps-container-B5aiqgMA.cjs.map} +1 -1
  294. package/dist/{schmancy-steps-container-BInNput3.js → schmancy-steps-container-C2StAA5K.js} +3 -3
  295. package/dist/{schmancy-steps-container-BInNput3.js.map → schmancy-steps-container-C2StAA5K.js.map} +1 -1
  296. package/dist/scroll-BqT7bvhu.cjs +27 -0
  297. package/dist/scroll-BqT7bvhu.cjs.map +1 -0
  298. package/dist/scroll-Bu-vAg3d.js +87 -0
  299. package/dist/scroll-Bu-vAg3d.js.map +1 -0
  300. package/dist/{select-_2Ag_znm.cjs → select-HiEGJvOX.cjs} +2 -2
  301. package/dist/select-HiEGJvOX.cjs.map +1 -0
  302. package/dist/{select-ApLZefMf.js → select-i-uKur-W.js} +5 -4
  303. package/dist/select-i-uKur-W.js.map +1 -0
  304. package/dist/select.cjs +1 -1
  305. package/dist/select.js +1 -1
  306. package/dist/{selector-hook-Cok22ifx.cjs → selector-hook-9w2auh2O.cjs} +2 -2
  307. package/dist/{selector-hook-Cok22ifx.cjs.map → selector-hook-9w2auh2O.cjs.map} +1 -1
  308. package/dist/{selector-hook-l2fe2UO5.js → selector-hook-CHV4kDMd.js} +3 -3
  309. package/dist/{selector-hook-l2fe2UO5.js.map → selector-hook-CHV4kDMd.js.map} +1 -1
  310. package/dist/{sheet-DovyNsok.js → sheet-B1g7E4dQ.js} +5 -5
  311. package/dist/{sheet-DovyNsok.js.map → sheet-B1g7E4dQ.js.map} +1 -1
  312. package/dist/{sheet-wjDOQ8Hs.cjs → sheet-BbrRW0S5.cjs} +2 -2
  313. package/dist/{sheet-wjDOQ8Hs.cjs.map → sheet-BbrRW0S5.cjs.map} +1 -1
  314. package/dist/sheet.cjs +1 -1
  315. package/dist/sheet.js +2 -2
  316. package/dist/{sheet.service-BvOiOFMm.js → sheet.service-4etIM-p6.js} +20 -18
  317. package/dist/sheet.service-4etIM-p6.js.map +1 -0
  318. package/dist/sheet.service-BiRZjCdN.cjs +2 -0
  319. package/dist/sheet.service-BiRZjCdN.cjs.map +1 -0
  320. package/dist/{slider-CeVgx4pL.js → slider-8E3Wad0t.js} +3 -3
  321. package/dist/{slider-CeVgx4pL.js.map → slider-8E3Wad0t.js.map} +1 -1
  322. package/dist/{slider-BgJccHrg.cjs → slider-VYnbIRH2.cjs} +2 -2
  323. package/dist/{slider-BgJccHrg.cjs.map → slider-VYnbIRH2.cjs.map} +1 -1
  324. package/dist/slider.cjs +1 -1
  325. package/dist/slider.js +1 -1
  326. package/dist/sound.service-Nza4c6wv.js +102 -0
  327. package/dist/sound.service-Nza4c6wv.js.map +1 -0
  328. package/dist/sound.service-eRirZw59.cjs +2 -0
  329. package/dist/sound.service-eRirZw59.cjs.map +1 -0
  330. package/dist/{spinner-Brq1TenP.js → spinner-CKm13CKN.js} +15 -12
  331. package/dist/spinner-CKm13CKN.js.map +1 -0
  332. package/dist/{spinner-BKeA2bdB.cjs → spinner-DJgcI5wr.cjs} +9 -9
  333. package/dist/spinner-DJgcI5wr.cjs.map +1 -0
  334. package/dist/steps.cjs +1 -1
  335. package/dist/steps.js +1 -1
  336. package/dist/store.cjs +1 -1
  337. package/dist/store.js +2 -2
  338. package/dist/{suggestion-chip-CWBSzu7C.js → suggestion-chip-6njXvvHm.js} +50 -46
  339. package/dist/suggestion-chip-6njXvvHm.js.map +1 -0
  340. package/dist/{suggestion-chip-dq20NKWy.cjs → suggestion-chip-DdLfqk7o.cjs} +18 -23
  341. package/dist/suggestion-chip-DdLfqk7o.cjs.map +1 -0
  342. package/dist/{surface-Bf8pvmdG.js → surface-BYU3l_Q2.js} +12 -11
  343. package/dist/surface-BYU3l_Q2.js.map +1 -0
  344. package/dist/{surface-fEPJ-cuu.cjs → surface-DcqbWGub.cjs} +5 -4
  345. package/dist/surface-DcqbWGub.cjs.map +1 -0
  346. package/dist/surface.cjs +1 -1
  347. package/dist/surface.js +1 -1
  348. package/dist/{table-DEnB9_Rf.cjs → table-C9fzDjjk.cjs} +2 -2
  349. package/dist/{table-DEnB9_Rf.cjs.map → table-C9fzDjjk.cjs.map} +1 -1
  350. package/dist/{table-MLd3oXm6.js → table-Dq12ollZ.js} +3 -3
  351. package/dist/{table-MLd3oXm6.js.map → table-Dq12ollZ.js.map} +1 -1
  352. package/dist/table.cjs +1 -1
  353. package/dist/table.js +1 -1
  354. package/dist/{tabs-compatibility-CXVHOR5X.cjs → tabs-compatibility-Dwtjfkcf.cjs} +2 -2
  355. package/dist/{tabs-compatibility-CXVHOR5X.cjs.map → tabs-compatibility-Dwtjfkcf.cjs.map} +1 -1
  356. package/dist/{tabs-compatibility-KWKzYolX.js → tabs-compatibility-wnzlHtln.js} +2 -2
  357. package/dist/{tabs-compatibility-KWKzYolX.js.map → tabs-compatibility-wnzlHtln.js.map} +1 -1
  358. package/dist/tabs.cjs +1 -1
  359. package/dist/tabs.js +1 -1
  360. package/dist/tailwind.mixin-Ddt05Frc.js +67 -0
  361. package/dist/{tailwind.mixin-DIW0B_of.js.map → tailwind.mixin-Ddt05Frc.js.map} +1 -1
  362. package/dist/tailwind.mixin-UijsBrYW.cjs +2 -0
  363. package/dist/{tailwind.mixin-3TPVvhYf.cjs.map → tailwind.mixin-UijsBrYW.cjs.map} +1 -1
  364. package/dist/teleport.cjs +1 -1
  365. package/dist/teleport.js +1 -1
  366. package/dist/textarea-DGmsw1B_.cjs +44 -0
  367. package/dist/{textarea-B7arkA7y.cjs.map → textarea-DGmsw1B_.cjs.map} +1 -1
  368. package/dist/{textarea-BK1m_CFR.js → textarea-Vd3zayJZ.js} +4 -3
  369. package/dist/{textarea-BK1m_CFR.js.map → textarea-Vd3zayJZ.js.map} +1 -1
  370. package/dist/textarea.cjs +1 -1
  371. package/dist/textarea.js +1 -1
  372. package/dist/{theme-button-BTKwL3oC.cjs → theme-button-DG_Xwg9H.cjs} +2 -2
  373. package/dist/{theme-button-BTKwL3oC.cjs.map → theme-button-DG_Xwg9H.cjs.map} +1 -1
  374. package/dist/{theme-button-C6kk8bay.js → theme-button-rGpEW_xS.js} +2 -2
  375. package/dist/{theme-button-C6kk8bay.js.map → theme-button-rGpEW_xS.js.map} +1 -1
  376. package/dist/theme-button.cjs +1 -1
  377. package/dist/theme-button.js +1 -1
  378. package/dist/{theme-controller-boat-BK59LqH9.js → theme-controller-boat-B1fjcqJI.js} +420 -228
  379. package/dist/theme-controller-boat-B1fjcqJI.js.map +1 -0
  380. package/dist/theme-controller-boat-pLzK5zxL.cjs +178 -0
  381. package/dist/theme-controller-boat-pLzK5zxL.cjs.map +1 -0
  382. package/dist/theme.cjs +1 -1
  383. package/dist/theme.js +13 -11
  384. package/dist/{timezone-nbn0o5GC.cjs → timezone-BhUaIAV7.cjs} +2 -2
  385. package/dist/{timezone-nbn0o5GC.cjs.map → timezone-BhUaIAV7.cjs.map} +1 -1
  386. package/dist/{timezone-D_skWX6Z.js → timezone-IQkwr6Oh.js} +3 -3
  387. package/dist/{timezone-D_skWX6Z.js.map → timezone-IQkwr6Oh.js.map} +1 -1
  388. package/dist/{tooltip-Btl0IKYC.js → tooltip-CwaiZC8f.js} +2 -2
  389. package/dist/{tooltip-Btl0IKYC.js.map → tooltip-CwaiZC8f.js.map} +1 -1
  390. package/dist/{tooltip-DyuMJEjL.cjs → tooltip-iEvxKg8g.cjs} +2 -2
  391. package/dist/{tooltip-DyuMJEjL.cjs.map → tooltip-iEvxKg8g.cjs.map} +1 -1
  392. package/dist/tooltip.cjs +1 -1
  393. package/dist/tooltip.js +1 -1
  394. package/dist/{tree-N4Y6MoQe.cjs → tree-Bclu6uvv.cjs} +2 -2
  395. package/dist/{tree-N4Y6MoQe.cjs.map → tree-Bclu6uvv.cjs.map} +1 -1
  396. package/dist/{tree-B_2eIFQi.js → tree-D9EbEsxn.js} +2 -2
  397. package/dist/{tree-B_2eIFQi.js.map → tree-D9EbEsxn.js.map} +1 -1
  398. package/dist/tree.cjs +1 -1
  399. package/dist/tree.js +1 -1
  400. package/dist/{typewriter-Blyrk_4c.js → typewriter-BjDPgRlj.js} +5 -5
  401. package/dist/{typewriter-Blyrk_4c.js.map → typewriter-BjDPgRlj.js.map} +1 -1
  402. package/dist/{typewriter-CFQAeOaw.cjs → typewriter-Bscwd-36.cjs} +4 -4
  403. package/dist/{typewriter-CFQAeOaw.cjs.map → typewriter-Bscwd-36.cjs.map} +1 -1
  404. package/dist/typewriter.cjs +1 -1
  405. package/dist/typewriter.js +1 -1
  406. package/dist/{typography-DjGWK58I.js → typography-CConBBFH.js} +13 -53
  407. package/dist/typography-CConBBFH.js.map +1 -0
  408. package/dist/{typography-DsIU0TGe.cjs → typography-DLGT3DGz.cjs} +3 -46
  409. package/dist/typography-DLGT3DGz.cjs.map +1 -0
  410. package/dist/typography.cjs +1 -1
  411. package/dist/typography.js +1 -1
  412. package/mixins/tailwind.css +37 -6
  413. package/package.json +21 -20
  414. package/types/src/area/area.service.d.ts +1 -1
  415. package/types/src/area/router.types.d.ts +1 -0
  416. package/types/src/audio/emotional-sounds.d.ts +122 -0
  417. package/types/src/audio/index.d.ts +30 -0
  418. package/types/src/audio/sound.service.d.ts +111 -0
  419. package/types/src/avatar.d.ts +10 -1
  420. package/types/src/busy/spinner.d.ts +6 -1
  421. package/types/src/button/button.d.ts +15 -2
  422. package/types/src/button/icon-button.d.ts +1 -1
  423. package/types/src/charts/area-chart.d.ts +58 -0
  424. package/types/src/charts/index.d.ts +4 -0
  425. package/types/src/charts/pills.d.ts +51 -0
  426. package/types/src/charts/types.d.ts +62 -0
  427. package/types/src/charts/utils.d.ts +28 -0
  428. package/types/src/checkbox/checkbox.d.ts +3 -2
  429. package/types/src/chips/chips.d.ts +2 -0
  430. package/types/src/content-drawer/drawer.service.d.ts +1 -7
  431. package/types/src/date-range/date-range-dialog.d.ts +16 -0
  432. package/types/src/date-range/date-range.d.ts +1 -1
  433. package/types/src/details/details.d.ts +8 -3
  434. package/types/src/dialog/dailog.d.ts +1 -5
  435. package/types/src/dialog/dialog-base.mixin.d.ts +26 -0
  436. package/types/src/dialog/dialog-service.d.ts +3 -66
  437. package/types/src/dialog/dialog.component.d.ts +63 -30
  438. package/types/src/dialog/index.d.ts +1 -3
  439. package/types/src/directives/height.d.ts +11 -6
  440. package/types/src/icons/icon.d.ts +17 -0
  441. package/types/src/index.d.ts +6 -0
  442. package/types/src/input/input.d.ts +13 -9
  443. package/types/src/json/index.d.ts +1 -0
  444. package/types/src/json/json.d.ts +15 -0
  445. package/types/src/lightbox/flip-directive.d.ts +29 -0
  446. package/types/src/lightbox/flip.directive.d.ts +22 -0
  447. package/types/src/lightbox/index.d.ts +4 -0
  448. package/types/src/lightbox/lightbox-service.d.ts +24 -0
  449. package/types/src/lightbox/lightbox.d.ts +34 -0
  450. package/types/src/lightbox/lightbox.directive.d.ts +30 -0
  451. package/types/src/nav-drawer/appbar.d.ts +0 -5
  452. package/types/src/nav-drawer/drawer.d.ts +1 -32
  453. package/types/src/notification/index.d.ts +1 -3
  454. package/types/src/notification/notification-service.d.ts +13 -1
  455. package/types/src/notification/notification.d.ts +13 -12
  456. package/types/src/notification/notify.d.ts +1 -1
  457. package/types/src/page/index.d.ts +1 -0
  458. package/types/src/page/page.d.ts +31 -0
  459. package/types/src/progress/progress.d.ts +2 -2
  460. package/types/src/qr-scanner/index.d.ts +1 -0
  461. package/types/src/qr-scanner/qr-scanner.d.ts +26 -0
  462. package/types/src/select/select.d.ts +1 -1
  463. package/types/src/theme/index.d.ts +1 -0
  464. package/types/src/theme/theme-audio-player.d.ts +100 -0
  465. package/types/src/theme/theme-controller-boat.d.ts +1 -0
  466. package/types/src/theme/theme.component.d.ts +1 -1
  467. package/types/src/types/index.d.ts +1 -0
  468. package/types/src/types/mood-audio.types.d.ts +173 -0
  469. package/types/src/typography/typography.d.ts +1 -0
  470. package/dist/area.component-CQq-Mh0Z.js.map +0 -1
  471. package/dist/area.component-Ciw7vGsx.cjs +0 -12
  472. package/dist/area.component-Ciw7vGsx.cjs.map +0 -1
  473. package/dist/avatar-Bo8kRnA-.cjs +0 -288
  474. package/dist/avatar-Bo8kRnA-.cjs.map +0 -1
  475. package/dist/avatar-Dm_qg-n1.js.map +0 -1
  476. package/dist/context-create-BJkkLr1D.cjs +0 -2
  477. package/dist/context-create-BJkkLr1D.cjs.map +0 -1
  478. package/dist/context-create-BvxbWTgj.js.map +0 -1
  479. package/dist/date-range-VkIMcQdT.js +0 -664
  480. package/dist/date-range-VkIMcQdT.js.map +0 -1
  481. package/dist/date-range-xYUr_KKx.cjs +0 -134
  482. package/dist/date-range-xYUr_KKx.cjs.map +0 -1
  483. package/dist/delay-CCreUpYu.cjs.map +0 -1
  484. package/dist/delay-Nu7RVtYd.js.map +0 -1
  485. package/dist/details-CjQrqBli.cjs +0 -98
  486. package/dist/details-CjQrqBli.cjs.map +0 -1
  487. package/dist/details-DVIWpEsI.js +0 -137
  488. package/dist/details-DVIWpEsI.js.map +0 -1
  489. package/dist/dialog-content-BgxKi73O.js +0 -256
  490. package/dist/dialog-content-BgxKi73O.js.map +0 -1
  491. package/dist/dialog-content-CM3-RXQQ.cjs +0 -85
  492. package/dist/dialog-content-CM3-RXQQ.cjs.map +0 -1
  493. package/dist/dialog-service-B4nR8Em5.cjs +0 -2
  494. package/dist/dialog-service-B4nR8Em5.cjs.map +0 -1
  495. package/dist/dialog-service-Bege4HF4.js +0 -140
  496. package/dist/dialog-service-Bege4HF4.js.map +0 -1
  497. package/dist/flex-BEB1yuMF.cjs +0 -43
  498. package/dist/flex-BEB1yuMF.cjs.map +0 -1
  499. package/dist/flex-BgcbHlPo.js +0 -260
  500. package/dist/flex-BgcbHlPo.js.map +0 -1
  501. package/dist/icon-D0FAI5uJ.js.map +0 -1
  502. package/dist/icon-DJnGMAQ2.cjs +0 -49
  503. package/dist/icon-DJnGMAQ2.cjs.map +0 -1
  504. package/dist/icon-button-CSZtSmOy.cjs +0 -65
  505. package/dist/icon-button-CSZtSmOy.cjs.map +0 -1
  506. package/dist/icon-button-CbgQp3AL.js +0 -156
  507. package/dist/icon-button-CbgQp3AL.js.map +0 -1
  508. package/dist/input-DLnKAj3B.js.map +0 -1
  509. package/dist/input-wZ6ORWru.cjs +0 -51
  510. package/dist/input-wZ6ORWru.cjs.map +0 -1
  511. package/dist/menu-ofiPDY2a.js +0 -61
  512. package/dist/navigation-rail-CEDLJTrH.cjs.map +0 -1
  513. package/dist/navigation-rail-weSW6BCv.js.map +0 -1
  514. package/dist/notification-service-B4nvP2Jc.js +0 -532
  515. package/dist/notification-service-B4nvP2Jc.js.map +0 -1
  516. package/dist/notification-service-B_pa74hl.cjs +0 -143
  517. package/dist/notification-service-B_pa74hl.cjs.map +0 -1
  518. package/dist/notify-Ci0HrUIo.js.map +0 -1
  519. package/dist/notify-aasSKQGA.cjs.map +0 -1
  520. package/dist/progress-B1f3y-Mf.js +0 -58
  521. package/dist/progress-B1f3y-Mf.js.map +0 -1
  522. package/dist/progress-DdBHNIMT.cjs +0 -35
  523. package/dist/progress-DdBHNIMT.cjs.map +0 -1
  524. package/dist/ripple-QoNZUUw_.js +0 -148
  525. package/dist/ripple-QoNZUUw_.js.map +0 -1
  526. package/dist/ripple-Ujq_REH4.cjs +0 -16
  527. package/dist/ripple-Ujq_REH4.cjs.map +0 -1
  528. package/dist/select-ApLZefMf.js.map +0 -1
  529. package/dist/select-_2Ag_znm.cjs.map +0 -1
  530. package/dist/sheet.service-BvOiOFMm.js.map +0 -1
  531. package/dist/sheet.service-DfHrOxyc.cjs +0 -2
  532. package/dist/sheet.service-DfHrOxyc.cjs.map +0 -1
  533. package/dist/spinner-BKeA2bdB.cjs.map +0 -1
  534. package/dist/spinner-Brq1TenP.js.map +0 -1
  535. package/dist/suggestion-chip-CWBSzu7C.js.map +0 -1
  536. package/dist/suggestion-chip-dq20NKWy.cjs.map +0 -1
  537. package/dist/surface-Bf8pvmdG.js.map +0 -1
  538. package/dist/surface-fEPJ-cuu.cjs.map +0 -1
  539. package/dist/tailwind.mixin-3TPVvhYf.cjs +0 -2
  540. package/dist/tailwind.mixin-DIW0B_of.js +0 -67
  541. package/dist/textarea-B7arkA7y.cjs +0 -44
  542. package/dist/theme-controller-boat-BK59LqH9.js.map +0 -1
  543. package/dist/theme-controller-boat-Y5QXwJxW.cjs +0 -64
  544. package/dist/theme-controller-boat-Y5QXwJxW.cjs.map +0 -1
  545. package/dist/typography-DjGWK58I.js.map +0 -1
  546. package/dist/typography-DsIU0TGe.cjs.map +0 -1
  547. package/types/src/notification/notification-audio-generator.d.ts +0 -45
  548. package/types/src/notification/notification-audio.d.ts +0 -79
  549. package/types/src/notification/notification-container.d.ts +0 -48
@@ -1 +1 @@
1
- {"version":3,"file":"selector-hook-l2fe2UO5.js","sources":["../src/store/filter-directive.ts","../src/store/selectors.ts","../src/store/selector-hook.ts"],"sourcesContent":["// src/store/filter-directive.ts\n\n/** Supported comparison operators with TypeScript literal types */\nexport type ComparisonOperator =\n\t| '=='\n\t| '!='\n\t| '>'\n\t| '<'\n\t| '>='\n\t| '<='\n\t| 'includes'\n\t| 'notIncludes'\n\t| 'startsWith'\n\t| 'endsWith'\n\t| 'in'\n\t| 'notIn'\n\t| 'any' // fuzzy search operator\n\n/**\n * Type-safe condition tuple\n */\nexport type ConditionTuple = [field: string, op: ComparisonOperator, expected: unknown, strict?: boolean]\n\n/**\n * Type-safe condition object\n */\nexport interface ConditionObject {\n\tkey: string | string[] // Array of keys applies OR logic across fields\n\toperator: ComparisonOperator\n\tvalue: unknown\n\tstrict?: boolean\n}\n\n/**\n * Unified query condition type\n */\nexport type QueryCondition = ConditionTuple | ConditionObject\n\n/**\n * Filter result with item and score\n */\nexport interface ScoredItem<T> {\n\titem: T\n\tscore: number\n}\n\n/**\n * Get a nested value from an object using a dot-separated path.\n * Checks explicitly for null/undefined so falsy values like 0 or false are preserved.\n */\nexport const getFieldValue = <T = any>(item: Record<string, any>, path: string): T => {\n\tif (!path) return item as unknown as T\n\n\tconst parts = path.split('.')\n\tlet value: any = item\n\n\tfor (const part of parts) {\n\t\tif (value == null) return undefined as unknown as T\n\t\tvalue = value[part]\n\t}\n\n\treturn value as T\n}\n\n/**\n * Compute the Levenshtein distance between two strings.\n */\nconst levenshtein = (a: string, b: string): number => {\n\tif (a === b) return 0\n\n\tconst matrix: number[][] = Array(b.length + 1)\n\t\t.fill(null)\n\t\t.map((_, i) => [i])\n\n\t// initialize the first row\n\tfor (let j = 0; j <= a.length; j++) {\n\t\tmatrix[0][j] = j\n\t}\n\n\tfor (let i = 1; i <= b.length; i++) {\n\t\tfor (let j = 1; j <= a.length; j++) {\n\t\t\tif (b.charAt(i - 1) === a.charAt(j - 1)) {\n\t\t\t\tmatrix[i][j] = matrix[i - 1][j - 1]\n\t\t\t} else {\n\t\t\t\tmatrix[i][j] = Math.min(\n\t\t\t\t\tmatrix[i - 1][j] + 1, // deletion\n\t\t\t\t\tmatrix[i][j - 1] + 1, // insertion\n\t\t\t\t\tmatrix[i - 1][j - 1] + 1, // substitution\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\t}\n\treturn matrix[b.length][a.length]\n}\n\n/**\n * Check if string `sub` is a subsequence of string `str`.\n * All characters in `sub` must appear in order in `str` (they need not be contiguous).\n */\nconst isSubsequence = (sub: string, str: string): boolean => {\n\tif (!sub) return true\n\tif (!str) return false\n\n\tlet i = 0,\n\t\tj = 0\n\twhile (i < sub.length && j < str.length) {\n\t\tif (sub[i].toLowerCase() === str[j].toLowerCase()) i++\n\t\tj++\n\t}\n\treturn i === sub.length\n}\n\n/**\n * Check if every character (with frequency) in the query exists in the target.\n * For example, \"aovc\" matches \"avocados\".\n */\nconst anagramMatch = (query: string, target: string): boolean => {\n\tif (!query) return true\n\tif (!target) return false\n\n\tconst countChars = (s: string): Record<string, number> =>\n\t\ts\n\t\t\t.toLowerCase()\n\t\t\t.split('')\n\t\t\t.reduce(\n\t\t\t\t(acc, char) => {\n\t\t\t\t\tacc[char] = (acc[char] || 0) + 1\n\t\t\t\t\treturn acc\n\t\t\t\t},\n\t\t\t\t{} as Record<string, number>,\n\t\t\t)\n\n\tconst queryCount = countChars(query)\n\tconst targetCount = countChars(target)\n\treturn Object.keys(queryCount).every(char => (targetCount[char] || 0) >= queryCount[char])\n}\n\n/**\n * Generate bigrams for a string.\n */\nconst getBigrams = (s: string): string[] => {\n\tif (!s || s.length < 2) return []\n\n\tconst bigrams: string[] = []\n\tfor (let i = 0; i < s.length - 1; i++) {\n\t\tbigrams.push(s.substring(i, i + 2).toLowerCase())\n\t}\n\treturn bigrams\n}\n\n/**\n * Compute Dice's coefficient for two strings based on bigrams.\n * Returns a value between 0 (no similarity) and 1 (perfect match).\n */\nconst diceCoefficient = (s1: string, s2: string): number => {\n\tif (!s1 || !s2 || s1.length < 2 || s2.length < 2) return 0\n\n\tconst bigrams1 = getBigrams(s1)\n\tconst bigrams2 = getBigrams(s2)\n\n\tif (bigrams1.length === 0 || bigrams2.length === 0) return 0\n\n\tlet intersection = 0\n\tconst used = new Array(bigrams2.length).fill(false)\n\n\tfor (const bigram of bigrams1) {\n\t\tfor (let i = 0; i < bigrams2.length; i++) {\n\t\t\tif (!used[i] && bigrams2[i] === bigram) {\n\t\t\t\tintersection++\n\t\t\t\tused[i] = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\treturn (2 * intersection) / (bigrams1.length + bigrams2.length)\n}\n\n/**\n * Compute a fuzzy similarity score between two strings.\n * The score is computed by taking the maximum of several methods:\n * - Direct substring match (score 1)\n * - Subsequence check (score 0.8)\n * - Anagram subset match (score 0.7)\n * - Dice coefficient\n * - Normalized Levenshtein similarity\n */\nconst computeFuzzyScore = (actual: string, expected: string): number => {\n\tif (!actual || !expected) return 0\n\n\tconst a = actual.toLowerCase().trim()\n\tconst b = expected.toLowerCase().trim()\n\n\tif (a === b) return 1\n\n\tconst substringScore = a.includes(b) ? 1 : 0\n\tconst subsequenceScore = isSubsequence(b, a) ? 0.8 : 0\n\tconst anagramScore = anagramMatch(b, a) ? 0.7 : 0\n\tconst diceScore = diceCoefficient(a, b)\n\n\tconst maxLen = Math.max(a.length, b.length)\n\tconst levenshteinScore = maxLen ? 1 - levenshtein(a, b) / maxLen : 0\n\n\treturn Math.max(substringScore, subsequenceScore, anagramScore, diceScore, levenshteinScore)\n}\n\n/**\n * Safely coerce value to string if possible, or return empty string\n */\nconst safeString = (value: unknown): string => {\n\tif (value == null) return ''\n\treturn String(value)\n}\n\n/**\n * Apply a query condition to an item and return score\n */\nfunction applyQueryCondition<T extends Record<string, any>>(\n\titem: T,\n\tquery: QueryCondition,\n\tfuzzyThreshold: number = 0.3,\n): { valid: boolean; score: number } {\n\tlet field: string,\n\t\top: ComparisonOperator,\n\t\texpected: unknown,\n\t\tstrict = false\n\n\tif (Array.isArray(query)) {\n\t\t;[field, op, expected, strict = false] = query\n\t} else {\n\t\t// Handle array of keys (OR logic)\n\t\tif (Array.isArray(query.key)) {\n\t\t\tconst results = query.key.map(k =>\n\t\t\t\tapplyQueryCondition(item, { ...query, key: k }, fuzzyThreshold)\n\t\t\t)\n\t\t\t// Return best valid result, or invalid if none valid\n\t\t\treturn results.reduce(\n\t\t\t\t(best, curr) => (curr.valid ? (curr.score > best.score ? curr : best) : best),\n\t\t\t\t{ valid: false, score: 0 }\n\t\t\t)\n\t\t}\n\n\t\tfield = query.key\n\t\top = query.operator\n\t\texpected = query.value\n\t\tstrict = query.strict || false\n\t}\n\n\t// Skip empty filters for non-strict queries\n\tif (!strict && (expected === '' || expected == null || (isArray(expected) && expected.length === 0))) {\n\t\treturn { valid: true, score: 1 }\n\t}\n\n\tconst actual = getFieldValue(item, field)\n\n\t// FIXED: Properly handle strict mode\n\tif (strict) {\n\t\t// For strict mode, use exact equality comparison for all operators except 'any'\n\t\tif (op === 'any') {\n\t\t\t// Fuzzy search still applies with strict mode\n\t\t\tif (typeof actual !== 'string' || typeof expected !== 'string') {\n\t\t\t\treturn { valid: false, score: 0 }\n\t\t\t}\n\n\t\t\tconst score = computeFuzzyScore(actual, expected)\n\t\t\treturn {\n\t\t\t\tvalid: score >= fuzzyThreshold,\n\t\t\t\tscore: score >= fuzzyThreshold ? score : 0,\n\t\t\t}\n\t\t} else {\n\t\t\t// For all other operators in strict mode,\n\t\t\t// delegate to compareValues function but return precise scores\n\t\t\tconst matches = compareValues(op, actual, expected)\n\t\t\treturn {\n\t\t\t\tvalid: matches,\n\t\t\t\tscore: matches ? 1 : 0,\n\t\t\t}\n\t\t}\n\t} else if (op === 'any') {\n\t\t// Fuzzy search requires both values to be strings\n\t\tif (typeof actual !== 'string' || typeof expected !== 'string') {\n\t\t\treturn { valid: false, score: 0 }\n\t\t}\n\n\t\tconst score = computeFuzzyScore(actual, expected)\n\t\tif (score < fuzzyThreshold) {\n\t\t\treturn { valid: false, score: 0 }\n\t\t}\n\n\t\treturn { valid: true, score }\n\t} else {\n\t\t// For non-fuzzy operators, check condition\n\t\tconst matches = compareValues(op, actual, expected)\n\t\treturn {\n\t\t\tvalid: matches,\n\t\t\tscore: matches ? 1 : 0,\n\t\t}\n\t}\n}\n\n/**\n * Filter a Map of items given an array of query conditions.\n * For each query condition:\n * - If the expected value is empty/null/undefined, it is treated as a match.\n * - For non-fuzzy operators, the condition must strictly match.\n * - For the \"any\" operator, a fuzzy similarity score is computed.\n * Items with a fuzzy score below a given threshold (e.g., 0.3) are excluded.\n *\n * The overall item score is the average of the scores from all conditions.\n * The results are sorted in descending order of relevance.\n *\n * @param items - A Map containing items to filter.\n * @param queries - An array of query conditions to apply.\n * @param fuzzyThreshold - Minimum score required for fuzzy matches (default: 0.3)\n * @returns An array of items that match all query conditions, sorted by relevance.\n */\nexport function filterMapItems<T extends Record<string, any>>(\n\titems: Map<string, T>,\n\tqueries: QueryCondition[] = [],\n\tfuzzyThreshold: number = 0.3,\n): T[] {\n\t// If no queries, return all items unsorted\n\tif (!queries.length) {\n\t\treturn Array.from(items.values())\n\t}\n\n\t// Score and filter each item\n\tconst scoredItems: ScoredItem<T>[] = []\n\n\tfor (const [_, item] of items.entries()) {\n\t\tlet totalScore = 0\n\t\tlet matchCount = 0\n\t\tlet valid = true\n\n\t\tfor (const query of queries) {\n\t\t\tconst result = applyQueryCondition(item, query, fuzzyThreshold)\n\n\t\t\tif (!result.valid) {\n\t\t\t\tvalid = false\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\ttotalScore += result.score\n\t\t\tmatchCount++\n\t\t}\n\n\t\tif (valid) {\n\t\t\tscoredItems.push({\n\t\t\t\titem,\n\t\t\t\tscore: matchCount > 0 ? totalScore / matchCount : 1,\n\t\t\t})\n\t\t}\n\t}\n\n\t// Sort by descending score\n\tscoredItems.sort((a, b) => b.score - a.score)\n\n\treturn scoredItems.map(x => x.item)\n}\n\n/**\n * Filter an array of items using query conditions\n */\nexport function filterArrayItems<T extends Record<string, any>>(\n\titems: T[],\n\tqueries: QueryCondition[] = [],\n\tfuzzyThreshold: number = 0.3,\n): T[] {\n\t// Create temporary map with numeric indices as keys\n\tconst map = new Map<string, T>()\n\titems.forEach((item, index) => map.set(String(index), item))\n\n\treturn filterMapItems(map, queries, fuzzyThreshold)\n}\n\n// Improved type guards for filter-directive.ts\n\n/**\n * Type guard for checking if a value is an array with better type inference\n * @param value Value to check\n * @returns True if the value is an array\n */\nexport function isArray<T = unknown>(value: unknown): value is Array<T> {\n\treturn Array.isArray(value)\n}\n\n/**\n * Type guard for checking if a value is a string\n * @param value Value to check\n * @returns True if the value is a string\n */\nexport function isString(value: unknown): value is string {\n\treturn typeof value === 'string'\n}\n\n/**\n * Type guard for checking if a value is a number\n * @param value Value to check\n * @returns True if the value is a number and not NaN\n */\nexport function isNumber(value: unknown): value is number {\n\treturn typeof value === 'number' && !isNaN(value)\n}\n\n/**\n * Type guard for checking if a value is a date\n * @param value Value to check\n * @returns True if the value is a valid Date object\n */\nexport function isDate(value: unknown): value is Date {\n\treturn value instanceof Date && !isNaN(value.getTime())\n}\n\n/**\n * Type guard for checking if a value is an iterable collection\n * @param value Value to check\n * @returns True if the value implements the iterable protocol\n */\nexport function isIterable<T = unknown>(value: unknown): value is Iterable<T> {\n\t// Must be non-null and of type 'object'\n\tif (value == null || typeof value !== 'object') {\n\t\treturn false\n\t}\n\n\t// Check for Symbol.iterator method\n\treturn Symbol.iterator in Object(value) && typeof (value as any)[Symbol.iterator] === 'function'\n}\n\n/**\n * Type guard for checking if a value is a Map\n * @param value Value to check\n * @returns True if the value is a Map\n */\nexport function isMap<K = unknown, V = unknown>(value: unknown): value is Map<K, V> {\n\treturn value instanceof Map\n}\n\n/**\n * Type guard for checking if a value is a Set\n * @param value Value to check\n * @returns True if the value is a Set\n */\nexport function isSet<T = unknown>(value: unknown): value is Set<T> {\n\treturn value instanceof Set\n}\n\n/**\n * Type guard for checking if a value is a plain object (not an array, Map, etc.)\n * @param value Value to check\n * @returns True if the value is a plain object\n */\nexport function isPlainObject(value: unknown): value is Record<string, unknown> {\n\tif (value === null || typeof value !== 'object') {\n\t\treturn false\n\t}\n\n\tconst proto = Object.getPrototypeOf(value)\n\treturn proto === Object.prototype || proto === null\n}\n\n/**\n * Type guard for checking if a value is undefined or null\n * @param value Value to check\n * @returns True if the value is undefined or null\n */\nexport function isNil(value: unknown): value is undefined | null {\n\treturn value === undefined || value === null\n}\n\n/**\n * Improved type-safe comparison function that uses appropriate type guards\n * @param op Comparison operator\n * @param actual Actual value\n * @param expected Expected value\n * @returns Result of the comparison\n */\nexport function compareValues(op: ComparisonOperator, actual: unknown, expected: unknown): boolean {\n\t// Handle null/undefined cases\n\tif (isNil(actual) && isNil(expected)) return true\n\tif (isNil(actual) || isNil(expected)) {\n\t\t// For equality operators, null == null but null != non-null\n\t\tif (op === '==') return actual === expected\n\t\tif (op === '!=') return actual !== expected\n\t\t// Other operators should return false for null/undefined values\n\t\treturn false\n\t}\n\n\tswitch (op) {\n\t\tcase '==':\n\t\t\treturn actual === expected\n\t\tcase '!=':\n\t\t\treturn actual !== expected\n\t\tcase '>':\n\t\t\tif (isNumber(actual) && isNumber(expected)) {\n\t\t\t\treturn actual > expected\n\t\t\t}\n\t\t\tif (isDate(actual) && isDate(expected)) {\n\t\t\t\treturn actual.getTime() > expected.getTime()\n\t\t\t}\n\t\t\tif (isString(actual) && isString(expected)) {\n\t\t\t\treturn actual.localeCompare(expected) > 0\n\t\t\t}\n\t\t\treturn false\n\t\tcase '<':\n\t\t\tif (isNumber(actual) && isNumber(expected)) {\n\t\t\t\treturn actual < expected\n\t\t\t}\n\t\t\tif (isDate(actual) && isDate(expected)) {\n\t\t\t\treturn actual.getTime() < expected.getTime()\n\t\t\t}\n\t\t\tif (isString(actual) && isString(expected)) {\n\t\t\t\treturn actual.localeCompare(expected) < 0\n\t\t\t}\n\t\t\treturn false\n\t\tcase '>=':\n\t\t\tif (isNumber(actual) && isNumber(expected)) {\n\t\t\t\treturn actual >= expected\n\t\t\t}\n\t\t\tif (isDate(actual) && isDate(expected)) {\n\t\t\t\treturn actual.getTime() >= expected.getTime()\n\t\t\t}\n\t\t\tif (isString(actual) && isString(expected)) {\n\t\t\t\treturn actual.localeCompare(expected) >= 0\n\t\t\t}\n\t\t\treturn false\n\t\tcase '<=':\n\t\t\tif (isNumber(actual) && isNumber(expected)) {\n\t\t\t\treturn actual <= expected\n\t\t\t}\n\t\t\tif (isDate(actual) && isDate(expected)) {\n\t\t\t\treturn actual.getTime() <= expected.getTime()\n\t\t\t}\n\t\t\tif (isString(actual) && isString(expected)) {\n\t\t\t\treturn actual.localeCompare(expected) <= 0\n\t\t\t}\n\t\t\treturn false\n\t\tcase 'includes': {\n\t\t\tif (isString(actual)) {\n\t\t\t\treturn actual.toLowerCase().includes(safeString(expected).toLowerCase())\n\t\t\t}\n\t\t\tif (isArray(actual)) {\n\t\t\t\treturn actual.includes(expected as any)\n\t\t\t}\n\t\t\tif (isSet(actual)) {\n\t\t\t\treturn actual.has(expected as any)\n\t\t\t}\n\t\t\tif (isMap(actual)) {\n\t\t\t\treturn Array.from(actual.values()).includes(expected as any)\n\t\t\t}\n\t\t\treturn false\n\t\t}\n\t\tcase 'notIncludes': {\n\t\t\tif (isString(actual)) {\n\t\t\t\treturn !actual.toLowerCase().includes(safeString(expected).toLowerCase())\n\t\t\t}\n\t\t\tif (isArray(actual)) {\n\t\t\t\treturn !actual.includes(expected as any)\n\t\t\t}\n\t\t\tif (isSet(actual)) {\n\t\t\t\treturn !actual.has(expected as any)\n\t\t\t}\n\t\t\tif (isMap(actual)) {\n\t\t\t\treturn !Array.from(actual.values()).includes(expected as any)\n\t\t\t}\n\t\t\treturn true\n\t\t}\n\t\tcase 'startsWith': {\n\t\t\tif (isString(actual) && isString(expected)) {\n\t\t\t\treturn actual.toLowerCase().startsWith(expected.toLowerCase())\n\t\t\t}\n\t\t\treturn false\n\t\t}\n\t\tcase 'endsWith': {\n\t\t\tif (isString(actual) && isString(expected)) {\n\t\t\t\treturn actual.toLowerCase().endsWith(expected.toLowerCase())\n\t\t\t}\n\t\t\treturn false\n\t\t}\n\t\tcase 'in': {\n\t\t\tif (isArray(expected)) {\n\t\t\t\treturn expected.includes(actual as any)\n\t\t\t}\n\t\t\tif (isSet(expected)) {\n\t\t\t\treturn expected.has(actual as any)\n\t\t\t}\n\t\t\tif (isMap(expected)) {\n\t\t\t\treturn expected.has(actual as any) || Array.from(expected.values()).includes(actual as any)\n\t\t\t}\n\t\t\treturn false\n\t\t}\n\t\tcase 'notIn': {\n\t\t\tif (isArray(expected)) {\n\t\t\t\treturn !expected.includes(actual as any)\n\t\t\t}\n\t\t\tif (isSet(expected)) {\n\t\t\t\treturn !expected.has(actual as any)\n\t\t\t}\n\t\t\tif (isMap(expected)) {\n\t\t\t\treturn !expected.has(actual as any) && !Array.from(expected.values()).includes(actual as any)\n\t\t\t}\n\t\t\treturn true\n\t\t}\n\t\tdefault: {\n\t\t\tconsole.warn(`Operator \"${op}\" is not supported in comparison.`)\n\t\t\treturn false\n\t\t}\n\t}\n}\n\n// Export a simpler alias for filterMapItems\nexport const filterMap = filterMapItems\n\n// Export an alias for filterArrayItems\nexport const filterArray = filterArrayItems\n","// src/store/selectors.ts\nimport { BehaviorSubject, Observable, combineLatest, distinctUntilChanged, map, share, shareReplay } from 'rxjs'\nimport { ICollectionStore, IStore, StoreError } from './types'\n\n/**\n * Deep equality comparison for maps and complex objects\n * More efficient than JSON.stringify for large objects\n */\nfunction deepEqual(a: unknown, b: unknown): boolean {\n\tif (a === b) return true\n\n\tif (a instanceof Map && b instanceof Map) {\n\t\tif (a.size !== b.size) return false\n\t\tfor (const [key, value] of a) {\n\t\t\tif (!b.has(key) || !deepEqual(value, b.get(key))) return false\n\t\t}\n\t\treturn true\n\t}\n\n\tif (a instanceof Set && b instanceof Set) {\n\t\tif (a.size !== b.size) return false\n\t\tfor (const item of a) {\n\t\t\tif (!b.has(item)) return false\n\t\t}\n\t\treturn true\n\t}\n\n\tif (typeof a === 'object' && a !== null && typeof b === 'object' && b !== null) {\n\t\tconst keysA = Object.keys(a)\n\t\tconst keysB = Object.keys(b)\n\n\t\tif (keysA.length !== keysB.length) return false\n\n\t\tfor (const key of keysA) {\n\t\t\t// @ts-ignore: Index signature\n\t\t\tif (!deepEqual(a[key], b[key])) return false\n\t\t}\n\n\t\treturn true\n\t}\n\n\treturn false\n}\n\n/**\n * Creates a selector that derives a value from store state\n *\n * @param store The store to observe\n * @param selectorFn Function that transforms the state\n * @returns An observable of the selected state that only emits when the derived value changes\n */\nexport function createSelector<T, R>(store: IStore<T>, selectorFn: (state: T) => R): Observable<R> {\n\treturn store.$.pipe(map(selectorFn), distinctUntilChanged<R>(deepEqual), shareReplay(1))\n}\n\n/**\n * Creates a selector for collection stores that derives a value from the collection\n *\n * @param store The collection store to observe\n * @param selectorFn Function that transforms the collection\n * @returns An observable of the selected state that only emits when the derived value changes\n */\nexport function createCollectionSelector<T, R>(\n\tstore: ICollectionStore<T>,\n\tselectorFn: (state: Map<string, T>) => R,\n): Observable<R> {\n\treturn store.$.pipe(map(selectorFn), distinctUntilChanged<R>(deepEqual), shareReplay(1))\n}\n\n/**\n * Creates a selector that returns all items from a collection as an array\n *\n * @param store The collection store\n * @returns An observable of all items as an array\n */\nexport function createItemsSelector<T>(store: ICollectionStore<T>): Observable<T[]> {\n\treturn createCollectionSelector(store, collection => Array.from(collection.values()))\n}\n\n/**\n * Creates a selector that retrieves a single item from a collection\n *\n * @param store The collection store\n * @param itemKey The key of the item to select\n * @returns An observable of the selected item that emits when the item changes\n */\nexport function createItemSelector<T>(store: ICollectionStore<T>, itemKey: string): Observable<T | undefined> {\n\treturn createCollectionSelector(store, collection => collection.get(itemKey))\n}\n\n/**\n * Creates a selector that returns all keys from a collection\n */\nexport function createKeysSelector<T>(store: ICollectionStore<T>): Observable<string[]> {\n\treturn createCollectionSelector(store, collection => Array.from(collection.keys()))\n}\n\n/**\n * Creates a selector that returns entries (key-value pairs) from a collection\n */\nexport function createEntriesSelector<T>(store: ICollectionStore<T>): Observable<[string, T][]> {\n\treturn createCollectionSelector(store, collection => Array.from(collection.entries()))\n}\n\n/**\n * Creates a selector that sorts collection items\n */\nexport function createSortSelector<T>(store: ICollectionStore<T>, compareFn: (a: T, b: T) => number): Observable<T[]> {\n\treturn createCollectionSelector(store, collection => {\n\t\treturn Array.from(collection.values()).sort(compareFn)\n\t})\n}\n\n/**\n * Creates a selector that finds the first item matching a predicate\n */\nexport function createFindSelector<T>(\n\tstore: ICollectionStore<T>,\n\tpredicate: (item: T, key: string) => boolean,\n): Observable<T | undefined> {\n\treturn createCollectionSelector(store, collection => {\n\t\tfor (const [key, item] of collection.entries()) {\n\t\t\tif (predicate(item, key)) {\n\t\t\t\treturn item\n\t\t\t}\n\t\t}\n\t\treturn undefined\n\t})\n}\n\n/**\n * Creates a selector that filters items from a collection - OPTIMIZED\n *\n * @param store The collection store\n * @param filterFn Function that returns true for items to include\n * @returns An observable of filtered items as an array\n */\nexport function createFilterSelector<T>(\n\tstore: ICollectionStore<T>,\n\tfilterFn: (item: T, key: string) => boolean,\n): Observable<T[]> {\n\treturn createCollectionSelector(store, collection =>\n\t\tArray.from(collection.entries())\n\t\t\t.filter(([key, item]) => filterFn(item, key))\n\t\t\t.map(([_, item]) => item),\n\t)\n}\n\n/**\n * Creates a selector that maps collection values through a transform function - OPTIMIZED\n */\nexport function createMapSelector<T, R>(\n\tstore: ICollectionStore<T>,\n\tmapFn: (item: T, key: string) => R,\n): Observable<R[]> {\n\treturn createCollectionSelector(store, collection =>\n\t\tArray.from(collection.entries()).map(([key, item]) => mapFn(item, key)),\n\t)\n}\n\n/**\n * Creates a selector that counts items in a collection, optionally filtered - OPTIMIZED\n *\n * @param store The collection store\n * @param filterFn Optional function to filter which items to count\n * @returns An observable of the count\n */\nexport function createCountSelector<T>(\n\tstore: ICollectionStore<T>,\n\tfilterFn?: (item: T, key: string) => boolean,\n): Observable<number> {\n\treturn createCollectionSelector(store, collection => {\n\t\tif (!filterFn) return collection.size\n\n\t\treturn Array.from(collection.entries()).filter(([key, item]) => filterFn(item, key)).length\n\t})\n}\n\n/**\n * Optimized RxJS Pipeline - use share with reset on refCount zero for better memory management\n * in scenarios where selector subscriptions come and go\n *\n * @param store The store to observe\n * @param selectorFn Function that transforms the state\n * @returns An observable of the selected state with improved memory management\n */\nexport function createOptimizedSelector<T, R>(store: IStore<T>, selectorFn: (state: T) => R): Observable<R> {\n\treturn store.$.pipe(\n\t\tmap(selectorFn),\n\t\tdistinctUntilChanged<R>(deepEqual),\n\t\tshare({\n\t\t\tresetOnRefCountZero: true,\n\t\t\tresetOnError: false,\n\t\t\tresetOnComplete: false,\n\t\t}),\n\t)\n}\n\n/**\n * Creates a compound selector from multiple stores\n *\n * This function combines data from multiple stores to create a derived\n * state that's compatible with the @select decorator.\n *\n * @param stores Array of stores to derive state from\n * @param selectorFns Selector functions for each store\n * @param combinerFn Function that combines the selected values\n * @returns A store-compatible object to use with @select\n */\nexport function createCompoundSelector<R>(\n\tstores: Array<IStore<any> | ICollectionStore<any>>,\n\tselectorFns: Array<(state: any) => any>,\n\tcombinerFn: (...values: any[]) => R,\n): IStore<R> {\n\t// Calculate initial value\n\tconst initialValues = stores.map((store, index) => selectorFns[index](store.value))\n\tconst initialValue = combinerFn(...initialValues)\n\n\t// Create a store with the initial value\n\tconst result: IStore<R> = {\n\t\t$: new BehaviorSubject<R>(initialValue),\n\t\terror$: new BehaviorSubject<StoreError | null>(null),\n\t\tready: true,\n\t\tdefaultValue: initialValue,\n\n\t\tget value(): R {\n\t\t\treturn this.$.getValue()\n\t\t},\n\n\t\t// These methods are no-ops for read-only stores\n\t\tset(_value: Partial<R>, _merge?: boolean): void {\n\t\t\tconsole.warn('Compound selector store is read-only')\n\t\t},\n\n\t\tclear(): void {\n\t\t\tthis.$.next(this.defaultValue)\n\t\t},\n\n\t\treplace(_newValue: R): void {\n\t\t\tconsole.warn('Compound selector store is read-only')\n\t\t},\n\n\t\tdelete<K extends keyof R>(_key: K): void {\n\t\t\tconsole.warn('Compound selector store is read-only')\n\t\t},\n\n\t\tdestroy(): void {\n\t\t\tthis.$.complete()\n\t\t\tthis.error$.complete()\n\t\t},\n\t}\n\n\t// Set up the reactivity by subscribing to all source stores\n\tconst observables = stores.map((store, _) => store.$)\n\n\t// Create a subscription that updates the result whenever any source changes\n\tconst subscription = combineLatest(observables).subscribe({\n\t\tnext: storeValues => {\n\t\t\ttry {\n\t\t\t\t// Apply selectors to each store value\n\t\t\t\tconst selectedValues = storeValues.map((value, index) => selectorFns[index](value))\n\n\t\t\t\t// Apply combiner function\n\t\t\t\tconst newValue = combinerFn(...selectedValues)\n\n\t\t\t\t// Update the BehaviorSubject\n\t\t\t\tresult.$.next(newValue)\n\t\t\t} catch (err) {\n\t\t\t\tconst error = new StoreError('Error in compound selector', err)\n\t\t\t\tresult.error$.next(error)\n\t\t\t\tconsole.error(error)\n\t\t\t}\n\t\t},\n\t\terror: err => {\n\t\t\tconst error = new StoreError('Error in store subscription', err)\n\t\t\tresult.error$.next(error)\n\t\t\tconsole.error(error)\n\t\t},\n\t})\n\n\t// Ensure the subscription is cleaned up when the store is destroyed\n\tconst originalDestroy = result.destroy\n\tresult.destroy = function () {\n\t\tsubscription.unsubscribe()\n\t\toriginalDestroy.call(this)\n\t}\n\n\treturn result\n}\n","// src/store/selector-hook.ts - Improved memory management\nimport { property as litProperty } from 'lit/decorators.js'\nimport { Observable, Subject, Subscription } from 'rxjs'\nimport { takeUntil } from 'rxjs/operators'\nimport { createCollectionSelector, createSelector } from './selectors'\nimport { ICollectionStore, IStore } from './types'\n\n/**\n * Symbol used for storing cleanup resources\n * Using a Symbol prevents name collisions with component properties\n */\nconst CLEANUP_SUBJECT = Symbol('selectorCleanup')\nconst SUBSCRIPTIONS = Symbol('selectorSubscriptions')\nconst INITIALIZED = Symbol('selectorInitialized')\nconst CONNECTED_CALLED = Symbol('connectedCallbackCalled')\n\n/**\n * Component lifecycle interface\n */\ninterface ComponentWithLifecycle {\n\t// Lifecycle hooks\n\tisConnected: boolean\n\tdisconnectedCallback?: () => void\n\tconnectedCallback?: () => void\n\trequestUpdate?: () => void\n\n\t// Internal properties using symbols to avoid name collisions\n\t[CLEANUP_SUBJECT]?: Subject<void>\n\t[SUBSCRIPTIONS]?: Map<string, Subscription>\n\t[INITIALIZED]?: Set<string>\n\t[CONNECTED_CALLED]?: boolean\n\n\t// Value storage\n\t[key: string]: any\n}\n\n/**\n * Property descriptor interface\n */\ntype PropertyDescriptor<T> = {\n\tget?: () => T\n\tset?: (value: T) => void\n\tvalue?: T\n\tconfigurable?: boolean\n\tenumerable?: boolean\n\twritable?: boolean\n}\n\n/**\n * Options for selecting from a store\n */\ninterface SelectOptions {\n\t/** If true, will wait for selector to emit a value (including null) before calling connectedCallback. Only undefined is considered \"not ready\". Default is true. */\n\trequired?: boolean\n\n\t/** If true, will only update the component and not set the property value */\n\tupdateOnly?: boolean\n\n\t/** If true, will use structuredClone to deeply clone values (prevents mutations) */\n\tdeepClone?: boolean\n\n\t/** Custom equality function to determine when to update */\n\tequals?: (a: any, b: any) => boolean\n\n\t/** Debug mode - logs selector activity */\n\tdebug?: boolean\n}\n\n/**\n * Type guard to check if a store is a collection store\n */\nfunction isCollectionStore<T>(store: IStore<any> | ICollectionStore<T>): store is ICollectionStore<T> {\n\treturn 'set' in store && typeof store.set === 'function' && store.value instanceof Map\n}\n\n/**\n * Ensures the cleanup resources exist on the component\n */\nfunction ensureCleanupResources(component: ComponentWithLifecycle): void {\n\tif (!component[CLEANUP_SUBJECT] || component[CLEANUP_SUBJECT].closed) {\n\t\tcomponent[CLEANUP_SUBJECT] = new Subject<void>()\n\t}\n\n\tif (!component[SUBSCRIPTIONS]) {\n\t\tcomponent[SUBSCRIPTIONS] = new Map()\n\t}\n\n\tif (!component[INITIALIZED]) {\n\t\tcomponent[INITIALIZED] = new Set()\n\t}\n}\n\n/**\n * Cleans up all selector resources\n */\nfunction cleanupSelectorResources(component: ComponentWithLifecycle): void {\n\tif (component[CLEANUP_SUBJECT]) {\n\t\tcomponent[CLEANUP_SUBJECT].next()\n\t\tcomponent[CLEANUP_SUBJECT].complete()\n\t\tcomponent[CLEANUP_SUBJECT] = undefined\n\t}\n\n\tif (component[SUBSCRIPTIONS]) {\n\t\tcomponent[SUBSCRIPTIONS].forEach(sub => sub.unsubscribe())\n\t\tcomponent[SUBSCRIPTIONS].clear()\n\t\tcomponent[SUBSCRIPTIONS] = undefined\n\t}\n\n\tif (component[INITIALIZED]) {\n\t\tcomponent[INITIALIZED].clear()\n\t\tcomponent[INITIALIZED] = undefined\n\t}\n\n\t// Reset the connected flag when cleaning up\n\tcomponent[CONNECTED_CALLED] = undefined\n}\n\n/**\n * Selector decorator that connects a component property to a store selector\n * with improved memory management\n *\n * @param store The store to select from\n * @param selectorFn Optional function to transform the store state\n * @param options Additional options for the selector\n */\nexport function select<T, R>(\n\tstore: IStore<T> | ICollectionStore<T>,\n\tselectorFn: (state: any) => R = (state: R) => state,\n\toptions: SelectOptions = { required: true },\n) {\n\treturn function (proto: Record<string, any>, propName: string, _descriptor?: PropertyDescriptor<R>) {\n\t\t// Register as a Lit property\n\t\tlitProperty({ attribute: false, type: Object })(proto, propName)\n\n\t\t// Store original lifecycle methods\n\t\tconst originalConnectedCallback = proto.connectedCallback\n\t\tconst originalDisconnectedCallback = proto.disconnectedCallback\n\n\t\t// Override connectedCallback to set up subscription\n\t\tproto.connectedCallback = function (this: ComponentWithLifecycle) {\n\t\t\t// Initialize cleanup resources\n\t\t\tensureCleanupResources(this)\n\n\t\t\t// Create the appropriate selector\n\t\t\tconst selector: Observable<R> = isCollectionStore(store)\n\t\t\t\t? createCollectionSelector(store, selectorFn)\n\t\t\t\t: createSelector(store as IStore<T>, selectorFn)\n\n\t\t\t// Call original connectedCallback immediately if not waiting for data\n\t\t\tif (!options.required && !this[CONNECTED_CALLED]) {\n\t\t\t\toriginalConnectedCallback?.call(this)\n\t\t\t\tthis[CONNECTED_CALLED] = true\n\t\t\t}\n\n\t\t\t// Clean up any existing subscription\n\t\t\tif (this[SUBSCRIPTIONS]!.has(propName)) {\n\t\t\t\tthis[SUBSCRIPTIONS]!.get(propName)?.unsubscribe()\n\t\t\t\tthis[SUBSCRIPTIONS]!.delete(propName)\n\t\t\t}\n\n\t\t\t// Debug log if needed\n\t\t\tif (options.debug) {\n\t\t\t\tconsole.debug(`[select] Setting up subscription for ${propName}`)\n\t\t\t}\n\n\t\t\t// Create new subscription with better error handling\n\t\t\tconst subscription = selector.pipe(takeUntil(this[CLEANUP_SUBJECT]!)).subscribe({\n\t\t\t\tnext: (value: R) => {\n\t\t\t\t\t// Handle value updates\n\t\t\t\t\tconst newValue = options.deepClone ? structuredClone(value) : value\n\n\t\t\t\t\tif (options.debug) {\n\t\t\t\t\t\tconsole.debug(`[select] New value for ${propName}:`, newValue)\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!options.updateOnly) {\n\t\t\t\t\t\tthis[propName] = newValue\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.requestUpdate?.()\n\n\t\t\t\t\t// If required and not initialized, call connectedCallback when we get a value\n\t\t\t\t\t// Allow null values but not undefined (undefined means the selector hasn't emitted yet)\n\t\t\t\t\tif (options.required && !this[INITIALIZED]!.has(propName) && newValue !== undefined) {\n\t\t\t\t\t\tthis[INITIALIZED]!.add(propName)\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Only call original connectedCallback once, regardless of how many selectors\n\t\t\t\t\t\tif (!this[CONNECTED_CALLED]) {\n\t\t\t\t\t\t\tif (options.debug) {\n\t\t\t\t\t\t\t\tconsole.debug(`[select] Calling delayed connectedCallback for ${propName}`)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\toriginalConnectedCallback?.call(this)\n\t\t\t\t\t\t\tthis[CONNECTED_CALLED] = true\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\terror: (err: Error) => {\n\t\t\t\t\tconsole.error(`Error in selector subscription for ${propName}:`, err)\n\t\t\t\t\t// Resubscribe on error to prevent component from becoming unresponsive\n\t\t\t\t\tif (this.isConnected) {\n\t\t\t\t\t\t// Small delay to prevent immediate resubscription\n\t\t\t\t\t\tsetTimeout(() => {\n\t\t\t\t\t\t\tif (this.isConnected) {\n\t\t\t\t\t\t\t\tif (options.debug) {\n\t\t\t\t\t\t\t\t\tconsole.debug(`[select] Resubscribing after error for ${propName}`)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tthis.connectedCallback?.()\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}, 1000)\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t})\n\n\t\t\t// Store the subscription for cleanup\n\t\t\tthis[SUBSCRIPTIONS]!.set(propName, subscription)\n\t\t}\n\n\t\t// Override disconnectedCallback to clean up subscriptions\n\t\tproto.disconnectedCallback = function (this: ComponentWithLifecycle) {\n\t\t\t// Call original disconnectedCallback\n\t\t\toriginalDisconnectedCallback?.call(this)\n\n\t\t\t// Debug log if needed\n\t\t\tif (options.debug) {\n\t\t\t\tconsole.debug(`[select] Cleaning up resources in disconnectedCallback`)\n\t\t\t}\n\n\t\t\t// Clean up all subscription resources\n\t\t\tcleanupSelectorResources(this)\n\t\t}\n\t}\n}\n\n/**\n * Creates a selector decorator that selects a specific item from a collection store\n * with improved memory management\n *\n * @param store The collection store\n * @param keyGetter Function that returns the key to select\n * @param options Additional options\n */\nexport function selectItem<T>(\n\tstore: ICollectionStore<T>,\n\tkeyGetter: (component: any) => string,\n\toptions: SelectOptions = { required: true },\n) {\n\treturn function (proto: Record<string, any>, propName: string, _descriptor?: PropertyDescriptor<T | undefined>) {\n\t\tselect(\n\t\t\tstore,\n\t\t\tfunction (state) {\n\t\t\t\t// This will be evaluated during subscription, when 'this' is available\n\t\t\t\tconst itemKey = keyGetter(this)\n\t\t\t\treturn itemKey ? state.get(itemKey) : undefined\n\t\t\t},\n\t\t\toptions,\n\t\t)(proto, propName)\n\t}\n}\n"],"names":["getFieldValue","item","path","parts","split","value","part","getBigrams","s","length","bigrams","i","push","substring","toLowerCase","computeFuzzyScore","actual","expected","a","trim","b","substringScore","includes","subsequenceScore","sub","str","j","anagramScore","query","target","countChars","reduce","acc","char","queryCount","targetCount","Object","keys","every","diceScore","s1","s2","bigrams1","bigrams2","intersection","used","Array","fill","bigram","maxLen","Math","max","levenshteinScore","matrix","map","_","charAt","min","safeString","String","applyQueryCondition","fuzzyThreshold","field","op","strict","isArray","key","k","best","curr","valid","score","operator","matches","compareValues","filterMapItems","items","queries","from","values","scoredItems","entries","totalScore","matchCount","result","sort","x","filterArrayItems","Map","forEach","index","set","isString","isNumber","isNaN","isDate","Date","getTime","isIterable","Symbol","iterator","isMap","isSet","Set","isPlainObject","proto","getPrototypeOf","prototype","isNil","localeCompare","has","startsWith","endsWith","filterMap","filterArray","deepEqual","size","get","keysA","keysB","createSelector","store","selectorFn","$","pipe","distinctUntilChanged","shareReplay","createCollectionSelector","createItemsSelector","collection","createItemSelector","itemKey","createKeysSelector","createEntriesSelector","createSortSelector","compareFn","createFindSelector","predicate","createFilterSelector","filterFn","filter","createMapSelector","mapFn","createCountSelector","createOptimizedSelector","share","resetOnRefCountZero","resetOnError","resetOnComplete","createCompoundSelector","stores","selectorFns","combinerFn","initialValues","initialValue","BehaviorSubject","error$","ready","defaultValue","this","getValue","_value","_merge","next","_newValue","_key","destroy","complete","observables","subscription","combineLatest","subscribe","storeValues","selectedValues","newValue","err","error","StoreError","originalDestroy","unsubscribe","call","CLEANUP_SUBJECT","SUBSCRIPTIONS","INITIALIZED","CONNECTED_CALLED","select","state","options","required","propName","_descriptor","litProperty","attribute","type","originalConnectedCallback","connectedCallback","originalDisconnectedCallback","disconnectedCallback","component","closed","Subject","selector","delete","debug","takeUntil","deepClone","structuredClone","updateOnly","requestUpdate","add","isConnected","setTimeout","clear","selectItem","keyGetter"],"mappings":";;;;AAkDO,MAAMA,IAAgB,CAAUC,GAA2BC,MAAAA;AACjE,MAAA,CAAKA,EAAM,QAAOD;AAElB,QAAME,IAAQD,EAAKE,MAAM;AACzB,MAAIC,IAAaJ;AAEjB,aAAWK,KAAQH,GAAO;AACzB,QAAIE,KAAS,KAAM;AACnBA,IAAAA,IAAQA,EAAMC,CAAAA;AAAAA,EACf;AAEA,SAAOD;AAAAA,GA+EFE,IAAcC,CAAAA,MAAAA;AACnB,MAAA,CAAKA,KAAKA,EAAEC,SAAS,UAAU,CAAA;AAE/B,QAAMC,IAAoB,CAAA;AAC1B,WAASC,IAAI,GAAGA,IAAIH,EAAEC,SAAS,GAAGE,IACjCD,CAAAA,EAAQE,KAAKJ,EAAEK,UAAUF,GAAGA,IAAI,CAAA,EAAGG,YAAAA,CAAAA;AAEpC,SAAOJ;AAAAA,GAwCFK,IAAoB,CAACC,GAAgBC,MAAAA;AAC1C,MAAA,CAAK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,IAAIc,CAAAA,IAAAA;AAAAA,IAC5B,GACAwD,CAAAA,EACClF,GAAOoF,CAAAA;AAAAA,EACV;AACD;"}
1
+ {"version":3,"file":"selector-hook-CHV4kDMd.js","sources":["../src/store/filter-directive.ts","../src/store/selectors.ts","../src/store/selector-hook.ts"],"sourcesContent":["// src/store/filter-directive.ts\n\n/** Supported comparison operators with TypeScript literal types */\nexport type ComparisonOperator =\n\t| '=='\n\t| '!='\n\t| '>'\n\t| '<'\n\t| '>='\n\t| '<='\n\t| 'includes'\n\t| 'notIncludes'\n\t| 'startsWith'\n\t| 'endsWith'\n\t| 'in'\n\t| 'notIn'\n\t| 'any' // fuzzy search operator\n\n/**\n * Type-safe condition tuple\n */\nexport type ConditionTuple = [field: string, op: ComparisonOperator, expected: unknown, strict?: boolean]\n\n/**\n * Type-safe condition object\n */\nexport interface ConditionObject {\n\tkey: string | string[] // Array of keys applies OR logic across fields\n\toperator: ComparisonOperator\n\tvalue: unknown\n\tstrict?: boolean\n}\n\n/**\n * Unified query condition type\n */\nexport type QueryCondition = ConditionTuple | ConditionObject\n\n/**\n * Filter result with item and score\n */\nexport interface ScoredItem<T> {\n\titem: T\n\tscore: number\n}\n\n/**\n * Get a nested value from an object using a dot-separated path.\n * Checks explicitly for null/undefined so falsy values like 0 or false are preserved.\n */\nexport const getFieldValue = <T = any>(item: Record<string, any>, path: string): T => {\n\tif (!path) return item as unknown as T\n\n\tconst parts = path.split('.')\n\tlet value: any = item\n\n\tfor (const part of parts) {\n\t\tif (value == null) return undefined as unknown as T\n\t\tvalue = value[part]\n\t}\n\n\treturn value as T\n}\n\n/**\n * Compute the Levenshtein distance between two strings.\n */\nconst levenshtein = (a: string, b: string): number => {\n\tif (a === b) return 0\n\n\tconst matrix: number[][] = Array(b.length + 1)\n\t\t.fill(null)\n\t\t.map((_, i) => [i])\n\n\t// initialize the first row\n\tfor (let j = 0; j <= a.length; j++) {\n\t\tmatrix[0][j] = j\n\t}\n\n\tfor (let i = 1; i <= b.length; i++) {\n\t\tfor (let j = 1; j <= a.length; j++) {\n\t\t\tif (b.charAt(i - 1) === a.charAt(j - 1)) {\n\t\t\t\tmatrix[i][j] = matrix[i - 1][j - 1]\n\t\t\t} else {\n\t\t\t\tmatrix[i][j] = Math.min(\n\t\t\t\t\tmatrix[i - 1][j] + 1, // deletion\n\t\t\t\t\tmatrix[i][j - 1] + 1, // insertion\n\t\t\t\t\tmatrix[i - 1][j - 1] + 1, // substitution\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\t}\n\treturn matrix[b.length][a.length]\n}\n\n/**\n * Check if string `sub` is a subsequence of string `str`.\n * All characters in `sub` must appear in order in `str` (they need not be contiguous).\n */\nconst isSubsequence = (sub: string, str: string): boolean => {\n\tif (!sub) return true\n\tif (!str) return false\n\n\tlet i = 0,\n\t\tj = 0\n\twhile (i < sub.length && j < str.length) {\n\t\tif (sub[i].toLowerCase() === str[j].toLowerCase()) i++\n\t\tj++\n\t}\n\treturn i === sub.length\n}\n\n/**\n * Check if every character (with frequency) in the query exists in the target.\n * For example, \"aovc\" matches \"avocados\".\n */\nconst anagramMatch = (query: string, target: string): boolean => {\n\tif (!query) return true\n\tif (!target) return false\n\n\tconst countChars = (s: string): Record<string, number> =>\n\t\ts\n\t\t\t.toLowerCase()\n\t\t\t.split('')\n\t\t\t.reduce(\n\t\t\t\t(acc, char) => {\n\t\t\t\t\tacc[char] = (acc[char] || 0) + 1\n\t\t\t\t\treturn acc\n\t\t\t\t},\n\t\t\t\t{} as Record<string, number>,\n\t\t\t)\n\n\tconst queryCount = countChars(query)\n\tconst targetCount = countChars(target)\n\treturn Object.keys(queryCount).every(char => (targetCount[char] || 0) >= queryCount[char])\n}\n\n/**\n * Generate bigrams for a string.\n */\nconst getBigrams = (s: string): string[] => {\n\tif (!s || s.length < 2) return []\n\n\tconst bigrams: string[] = []\n\tfor (let i = 0; i < s.length - 1; i++) {\n\t\tbigrams.push(s.substring(i, i + 2).toLowerCase())\n\t}\n\treturn bigrams\n}\n\n/**\n * Compute Dice's coefficient for two strings based on bigrams.\n * Returns a value between 0 (no similarity) and 1 (perfect match).\n */\nconst diceCoefficient = (s1: string, s2: string): number => {\n\tif (!s1 || !s2 || s1.length < 2 || s2.length < 2) return 0\n\n\tconst bigrams1 = getBigrams(s1)\n\tconst bigrams2 = getBigrams(s2)\n\n\tif (bigrams1.length === 0 || bigrams2.length === 0) return 0\n\n\tlet intersection = 0\n\tconst used = new Array(bigrams2.length).fill(false)\n\n\tfor (const bigram of bigrams1) {\n\t\tfor (let i = 0; i < bigrams2.length; i++) {\n\t\t\tif (!used[i] && bigrams2[i] === bigram) {\n\t\t\t\tintersection++\n\t\t\t\tused[i] = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\treturn (2 * intersection) / (bigrams1.length + bigrams2.length)\n}\n\n/**\n * Compute a fuzzy similarity score between two strings.\n * The score is computed by taking the maximum of several methods:\n * - Direct substring match (score 1)\n * - Subsequence check (score 0.8)\n * - Anagram subset match (score 0.7)\n * - Dice coefficient\n * - Normalized Levenshtein similarity\n */\nconst computeFuzzyScore = (actual: string, expected: string): number => {\n\tif (!actual || !expected) return 0\n\n\tconst a = actual.toLowerCase().trim()\n\tconst b = expected.toLowerCase().trim()\n\n\tif (a === b) return 1\n\n\tconst substringScore = a.includes(b) ? 1 : 0\n\tconst subsequenceScore = isSubsequence(b, a) ? 0.8 : 0\n\tconst anagramScore = anagramMatch(b, a) ? 0.7 : 0\n\tconst diceScore = diceCoefficient(a, b)\n\n\tconst maxLen = Math.max(a.length, b.length)\n\tconst levenshteinScore = maxLen ? 1 - levenshtein(a, b) / maxLen : 0\n\n\treturn Math.max(substringScore, subsequenceScore, anagramScore, diceScore, levenshteinScore)\n}\n\n/**\n * Safely coerce value to string if possible, or return empty string\n */\nconst safeString = (value: unknown): string => {\n\tif (value == null) return ''\n\treturn String(value)\n}\n\n/**\n * Apply a query condition to an item and return score\n */\nfunction applyQueryCondition<T extends Record<string, any>>(\n\titem: T,\n\tquery: QueryCondition,\n\tfuzzyThreshold: number = 0.3,\n): { valid: boolean; score: number } {\n\tlet field: string,\n\t\top: ComparisonOperator,\n\t\texpected: unknown,\n\t\tstrict = false\n\n\tif (Array.isArray(query)) {\n\t\t;[field, op, expected, strict = false] = query\n\t} else {\n\t\t// Handle array of keys (OR logic)\n\t\tif (Array.isArray(query.key)) {\n\t\t\tconst results = query.key.map(k =>\n\t\t\t\tapplyQueryCondition(item, { ...query, key: k }, fuzzyThreshold)\n\t\t\t)\n\t\t\t// Return best valid result, or invalid if none valid\n\t\t\treturn results.reduce(\n\t\t\t\t(best, curr) => (curr.valid ? (curr.score > best.score ? curr : best) : best),\n\t\t\t\t{ valid: false, score: 0 }\n\t\t\t)\n\t\t}\n\n\t\tfield = query.key\n\t\top = query.operator\n\t\texpected = query.value\n\t\tstrict = query.strict || false\n\t}\n\n\t// Skip empty filters for non-strict queries\n\tif (!strict && (expected === '' || expected == null || (isArray(expected) && expected.length === 0))) {\n\t\treturn { valid: true, score: 1 }\n\t}\n\n\tconst actual = getFieldValue(item, field)\n\n\t// FIXED: Properly handle strict mode\n\tif (strict) {\n\t\t// For strict mode, use exact equality comparison for all operators except 'any'\n\t\tif (op === 'any') {\n\t\t\t// Fuzzy search still applies with strict mode\n\t\t\tif (typeof actual !== 'string' || typeof expected !== 'string') {\n\t\t\t\treturn { valid: false, score: 0 }\n\t\t\t}\n\n\t\t\tconst score = computeFuzzyScore(actual, expected)\n\t\t\treturn {\n\t\t\t\tvalid: score >= fuzzyThreshold,\n\t\t\t\tscore: score >= fuzzyThreshold ? score : 0,\n\t\t\t}\n\t\t} else {\n\t\t\t// For all other operators in strict mode,\n\t\t\t// delegate to compareValues function but return precise scores\n\t\t\tconst matches = compareValues(op, actual, expected)\n\t\t\treturn {\n\t\t\t\tvalid: matches,\n\t\t\t\tscore: matches ? 1 : 0,\n\t\t\t}\n\t\t}\n\t} else if (op === 'any') {\n\t\t// Fuzzy search requires both values to be strings\n\t\tif (typeof actual !== 'string' || typeof expected !== 'string') {\n\t\t\treturn { valid: false, score: 0 }\n\t\t}\n\n\t\tconst score = computeFuzzyScore(actual, expected)\n\t\tif (score < fuzzyThreshold) {\n\t\t\treturn { valid: false, score: 0 }\n\t\t}\n\n\t\treturn { valid: true, score }\n\t} else {\n\t\t// For non-fuzzy operators, check condition\n\t\tconst matches = compareValues(op, actual, expected)\n\t\treturn {\n\t\t\tvalid: matches,\n\t\t\tscore: matches ? 1 : 0,\n\t\t}\n\t}\n}\n\n/**\n * Filter a Map of items given an array of query conditions.\n * For each query condition:\n * - If the expected value is empty/null/undefined, it is treated as a match.\n * - For non-fuzzy operators, the condition must strictly match.\n * - For the \"any\" operator, a fuzzy similarity score is computed.\n * Items with a fuzzy score below a given threshold (e.g., 0.3) are excluded.\n *\n * The overall item score is the average of the scores from all conditions.\n * The results are sorted in descending order of relevance.\n *\n * @param items - A Map containing items to filter.\n * @param queries - An array of query conditions to apply.\n * @param fuzzyThreshold - Minimum score required for fuzzy matches (default: 0.3)\n * @returns An array of items that match all query conditions, sorted by relevance.\n */\nexport function filterMapItems<T extends Record<string, any>>(\n\titems: Map<string, T>,\n\tqueries: QueryCondition[] = [],\n\tfuzzyThreshold: number = 0.3,\n): T[] {\n\t// If no queries, return all items unsorted\n\tif (!queries.length) {\n\t\treturn Array.from(items.values())\n\t}\n\n\t// Score and filter each item\n\tconst scoredItems: ScoredItem<T>[] = []\n\n\tfor (const [_, item] of items.entries()) {\n\t\tlet totalScore = 0\n\t\tlet matchCount = 0\n\t\tlet valid = true\n\n\t\tfor (const query of queries) {\n\t\t\tconst result = applyQueryCondition(item, query, fuzzyThreshold)\n\n\t\t\tif (!result.valid) {\n\t\t\t\tvalid = false\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\ttotalScore += result.score\n\t\t\tmatchCount++\n\t\t}\n\n\t\tif (valid) {\n\t\t\tscoredItems.push({\n\t\t\t\titem,\n\t\t\t\tscore: matchCount > 0 ? totalScore / matchCount : 1,\n\t\t\t})\n\t\t}\n\t}\n\n\t// Sort by descending score\n\tscoredItems.sort((a, b) => b.score - a.score)\n\n\treturn scoredItems.map(x => x.item)\n}\n\n/**\n * Filter an array of items using query conditions\n */\nexport function filterArrayItems<T extends Record<string, any>>(\n\titems: T[],\n\tqueries: QueryCondition[] = [],\n\tfuzzyThreshold: number = 0.3,\n): T[] {\n\t// Create temporary map with numeric indices as keys\n\tconst map = new Map<string, T>()\n\titems.forEach((item, index) => map.set(String(index), item))\n\n\treturn filterMapItems(map, queries, fuzzyThreshold)\n}\n\n// Improved type guards for filter-directive.ts\n\n/**\n * Type guard for checking if a value is an array with better type inference\n * @param value Value to check\n * @returns True if the value is an array\n */\nexport function isArray<T = unknown>(value: unknown): value is Array<T> {\n\treturn Array.isArray(value)\n}\n\n/**\n * Type guard for checking if a value is a string\n * @param value Value to check\n * @returns True if the value is a string\n */\nexport function isString(value: unknown): value is string {\n\treturn typeof value === 'string'\n}\n\n/**\n * Type guard for checking if a value is a number\n * @param value Value to check\n * @returns True if the value is a number and not NaN\n */\nexport function isNumber(value: unknown): value is number {\n\treturn typeof value === 'number' && !isNaN(value)\n}\n\n/**\n * Type guard for checking if a value is a date\n * @param value Value to check\n * @returns True if the value is a valid Date object\n */\nexport function isDate(value: unknown): value is Date {\n\treturn value instanceof Date && !isNaN(value.getTime())\n}\n\n/**\n * Type guard for checking if a value is an iterable collection\n * @param value Value to check\n * @returns True if the value implements the iterable protocol\n */\nexport function isIterable<T = unknown>(value: unknown): value is Iterable<T> {\n\t// Must be non-null and of type 'object'\n\tif (value == null || typeof value !== 'object') {\n\t\treturn false\n\t}\n\n\t// Check for Symbol.iterator method\n\treturn Symbol.iterator in Object(value) && typeof (value as any)[Symbol.iterator] === 'function'\n}\n\n/**\n * Type guard for checking if a value is a Map\n * @param value Value to check\n * @returns True if the value is a Map\n */\nexport function isMap<K = unknown, V = unknown>(value: unknown): value is Map<K, V> {\n\treturn value instanceof Map\n}\n\n/**\n * Type guard for checking if a value is a Set\n * @param value Value to check\n * @returns True if the value is a Set\n */\nexport function isSet<T = unknown>(value: unknown): value is Set<T> {\n\treturn value instanceof Set\n}\n\n/**\n * Type guard for checking if a value is a plain object (not an array, Map, etc.)\n * @param value Value to check\n * @returns True if the value is a plain object\n */\nexport function isPlainObject(value: unknown): value is Record<string, unknown> {\n\tif (value === null || typeof value !== 'object') {\n\t\treturn false\n\t}\n\n\tconst proto = Object.getPrototypeOf(value)\n\treturn proto === Object.prototype || proto === null\n}\n\n/**\n * Type guard for checking if a value is undefined or null\n * @param value Value to check\n * @returns True if the value is undefined or null\n */\nexport function isNil(value: unknown): value is undefined | null {\n\treturn value === undefined || value === null\n}\n\n/**\n * Improved type-safe comparison function that uses appropriate type guards\n * @param op Comparison operator\n * @param actual Actual value\n * @param expected Expected value\n * @returns Result of the comparison\n */\nexport function compareValues(op: ComparisonOperator, actual: unknown, expected: unknown): boolean {\n\t// Handle null/undefined cases\n\tif (isNil(actual) && isNil(expected)) return true\n\tif (isNil(actual) || isNil(expected)) {\n\t\t// For equality operators, null == null but null != non-null\n\t\tif (op === '==') return actual === expected\n\t\tif (op === '!=') return actual !== expected\n\t\t// Other operators should return false for null/undefined values\n\t\treturn false\n\t}\n\n\tswitch (op) {\n\t\tcase '==':\n\t\t\treturn actual === expected\n\t\tcase '!=':\n\t\t\treturn actual !== expected\n\t\tcase '>':\n\t\t\tif (isNumber(actual) && isNumber(expected)) {\n\t\t\t\treturn actual > expected\n\t\t\t}\n\t\t\tif (isDate(actual) && isDate(expected)) {\n\t\t\t\treturn actual.getTime() > expected.getTime()\n\t\t\t}\n\t\t\tif (isString(actual) && isString(expected)) {\n\t\t\t\treturn actual.localeCompare(expected) > 0\n\t\t\t}\n\t\t\treturn false\n\t\tcase '<':\n\t\t\tif (isNumber(actual) && isNumber(expected)) {\n\t\t\t\treturn actual < expected\n\t\t\t}\n\t\t\tif (isDate(actual) && isDate(expected)) {\n\t\t\t\treturn actual.getTime() < expected.getTime()\n\t\t\t}\n\t\t\tif (isString(actual) && isString(expected)) {\n\t\t\t\treturn actual.localeCompare(expected) < 0\n\t\t\t}\n\t\t\treturn false\n\t\tcase '>=':\n\t\t\tif (isNumber(actual) && isNumber(expected)) {\n\t\t\t\treturn actual >= expected\n\t\t\t}\n\t\t\tif (isDate(actual) && isDate(expected)) {\n\t\t\t\treturn actual.getTime() >= expected.getTime()\n\t\t\t}\n\t\t\tif (isString(actual) && isString(expected)) {\n\t\t\t\treturn actual.localeCompare(expected) >= 0\n\t\t\t}\n\t\t\treturn false\n\t\tcase '<=':\n\t\t\tif (isNumber(actual) && isNumber(expected)) {\n\t\t\t\treturn actual <= expected\n\t\t\t}\n\t\t\tif (isDate(actual) && isDate(expected)) {\n\t\t\t\treturn actual.getTime() <= expected.getTime()\n\t\t\t}\n\t\t\tif (isString(actual) && isString(expected)) {\n\t\t\t\treturn actual.localeCompare(expected) <= 0\n\t\t\t}\n\t\t\treturn false\n\t\tcase 'includes': {\n\t\t\tif (isString(actual)) {\n\t\t\t\treturn actual.toLowerCase().includes(safeString(expected).toLowerCase())\n\t\t\t}\n\t\t\tif (isArray(actual)) {\n\t\t\t\treturn actual.includes(expected as any)\n\t\t\t}\n\t\t\tif (isSet(actual)) {\n\t\t\t\treturn actual.has(expected as any)\n\t\t\t}\n\t\t\tif (isMap(actual)) {\n\t\t\t\treturn Array.from(actual.values()).includes(expected as any)\n\t\t\t}\n\t\t\treturn false\n\t\t}\n\t\tcase 'notIncludes': {\n\t\t\tif (isString(actual)) {\n\t\t\t\treturn !actual.toLowerCase().includes(safeString(expected).toLowerCase())\n\t\t\t}\n\t\t\tif (isArray(actual)) {\n\t\t\t\treturn !actual.includes(expected as any)\n\t\t\t}\n\t\t\tif (isSet(actual)) {\n\t\t\t\treturn !actual.has(expected as any)\n\t\t\t}\n\t\t\tif (isMap(actual)) {\n\t\t\t\treturn !Array.from(actual.values()).includes(expected as any)\n\t\t\t}\n\t\t\treturn true\n\t\t}\n\t\tcase 'startsWith': {\n\t\t\tif (isString(actual) && isString(expected)) {\n\t\t\t\treturn actual.toLowerCase().startsWith(expected.toLowerCase())\n\t\t\t}\n\t\t\treturn false\n\t\t}\n\t\tcase 'endsWith': {\n\t\t\tif (isString(actual) && isString(expected)) {\n\t\t\t\treturn actual.toLowerCase().endsWith(expected.toLowerCase())\n\t\t\t}\n\t\t\treturn false\n\t\t}\n\t\tcase 'in': {\n\t\t\tif (isArray(expected)) {\n\t\t\t\treturn expected.includes(actual as any)\n\t\t\t}\n\t\t\tif (isSet(expected)) {\n\t\t\t\treturn expected.has(actual as any)\n\t\t\t}\n\t\t\tif (isMap(expected)) {\n\t\t\t\treturn expected.has(actual as any) || Array.from(expected.values()).includes(actual as any)\n\t\t\t}\n\t\t\treturn false\n\t\t}\n\t\tcase 'notIn': {\n\t\t\tif (isArray(expected)) {\n\t\t\t\treturn !expected.includes(actual as any)\n\t\t\t}\n\t\t\tif (isSet(expected)) {\n\t\t\t\treturn !expected.has(actual as any)\n\t\t\t}\n\t\t\tif (isMap(expected)) {\n\t\t\t\treturn !expected.has(actual as any) && !Array.from(expected.values()).includes(actual as any)\n\t\t\t}\n\t\t\treturn true\n\t\t}\n\t\tdefault: {\n\t\t\tconsole.warn(`Operator \"${op}\" is not supported in comparison.`)\n\t\t\treturn false\n\t\t}\n\t}\n}\n\n// Export a simpler alias for filterMapItems\nexport const filterMap = filterMapItems\n\n// Export an alias for filterArrayItems\nexport const filterArray = filterArrayItems\n","// src/store/selectors.ts\nimport { BehaviorSubject, Observable, combineLatest, distinctUntilChanged, map, share, shareReplay } from 'rxjs'\nimport { ICollectionStore, IStore, StoreError } from './types'\n\n/**\n * Deep equality comparison for maps and complex objects\n * More efficient than JSON.stringify for large objects\n */\nfunction deepEqual(a: unknown, b: unknown): boolean {\n\tif (a === b) return true\n\n\tif (a instanceof Map && b instanceof Map) {\n\t\tif (a.size !== b.size) return false\n\t\tfor (const [key, value] of a) {\n\t\t\tif (!b.has(key) || !deepEqual(value, b.get(key))) return false\n\t\t}\n\t\treturn true\n\t}\n\n\tif (a instanceof Set && b instanceof Set) {\n\t\tif (a.size !== b.size) return false\n\t\tfor (const item of a) {\n\t\t\tif (!b.has(item)) return false\n\t\t}\n\t\treturn true\n\t}\n\n\tif (typeof a === 'object' && a !== null && typeof b === 'object' && b !== null) {\n\t\tconst keysA = Object.keys(a)\n\t\tconst keysB = Object.keys(b)\n\n\t\tif (keysA.length !== keysB.length) return false\n\n\t\tfor (const key of keysA) {\n\t\t\t// @ts-ignore: Index signature\n\t\t\tif (!deepEqual(a[key], b[key])) return false\n\t\t}\n\n\t\treturn true\n\t}\n\n\treturn false\n}\n\n/**\n * Creates a selector that derives a value from store state\n *\n * @param store The store to observe\n * @param selectorFn Function that transforms the state\n * @returns An observable of the selected state that only emits when the derived value changes\n */\nexport function createSelector<T, R>(store: IStore<T>, selectorFn: (state: T) => R): Observable<R> {\n\treturn store.$.pipe(map(selectorFn), distinctUntilChanged<R>(deepEqual), shareReplay(1))\n}\n\n/**\n * Creates a selector for collection stores that derives a value from the collection\n *\n * @param store The collection store to observe\n * @param selectorFn Function that transforms the collection\n * @returns An observable of the selected state that only emits when the derived value changes\n */\nexport function createCollectionSelector<T, R>(\n\tstore: ICollectionStore<T>,\n\tselectorFn: (state: Map<string, T>) => R,\n): Observable<R> {\n\treturn store.$.pipe(map(selectorFn), distinctUntilChanged<R>(deepEqual), shareReplay(1))\n}\n\n/**\n * Creates a selector that returns all items from a collection as an array\n *\n * @param store The collection store\n * @returns An observable of all items as an array\n */\nexport function createItemsSelector<T>(store: ICollectionStore<T>): Observable<T[]> {\n\treturn createCollectionSelector(store, collection => Array.from(collection.values()))\n}\n\n/**\n * Creates a selector that retrieves a single item from a collection\n *\n * @param store The collection store\n * @param itemKey The key of the item to select\n * @returns An observable of the selected item that emits when the item changes\n */\nexport function createItemSelector<T>(store: ICollectionStore<T>, itemKey: string): Observable<T | undefined> {\n\treturn createCollectionSelector(store, collection => collection.get(itemKey))\n}\n\n/**\n * Creates a selector that returns all keys from a collection\n */\nexport function createKeysSelector<T>(store: ICollectionStore<T>): Observable<string[]> {\n\treturn createCollectionSelector(store, collection => Array.from(collection.keys()))\n}\n\n/**\n * Creates a selector that returns entries (key-value pairs) from a collection\n */\nexport function createEntriesSelector<T>(store: ICollectionStore<T>): Observable<[string, T][]> {\n\treturn createCollectionSelector(store, collection => Array.from(collection.entries()))\n}\n\n/**\n * Creates a selector that sorts collection items\n */\nexport function createSortSelector<T>(store: ICollectionStore<T>, compareFn: (a: T, b: T) => number): Observable<T[]> {\n\treturn createCollectionSelector(store, collection => {\n\t\treturn Array.from(collection.values()).sort(compareFn)\n\t})\n}\n\n/**\n * Creates a selector that finds the first item matching a predicate\n */\nexport function createFindSelector<T>(\n\tstore: ICollectionStore<T>,\n\tpredicate: (item: T, key: string) => boolean,\n): Observable<T | undefined> {\n\treturn createCollectionSelector(store, collection => {\n\t\tfor (const [key, item] of collection.entries()) {\n\t\t\tif (predicate(item, key)) {\n\t\t\t\treturn item\n\t\t\t}\n\t\t}\n\t\treturn undefined\n\t})\n}\n\n/**\n * Creates a selector that filters items from a collection - OPTIMIZED\n *\n * @param store The collection store\n * @param filterFn Function that returns true for items to include\n * @returns An observable of filtered items as an array\n */\nexport function createFilterSelector<T>(\n\tstore: ICollectionStore<T>,\n\tfilterFn: (item: T, key: string) => boolean,\n): Observable<T[]> {\n\treturn createCollectionSelector(store, collection =>\n\t\tArray.from(collection.entries())\n\t\t\t.filter(([key, item]) => filterFn(item, key))\n\t\t\t.map(([_, item]) => item),\n\t)\n}\n\n/**\n * Creates a selector that maps collection values through a transform function - OPTIMIZED\n */\nexport function createMapSelector<T, R>(\n\tstore: ICollectionStore<T>,\n\tmapFn: (item: T, key: string) => R,\n): Observable<R[]> {\n\treturn createCollectionSelector(store, collection =>\n\t\tArray.from(collection.entries()).map(([key, item]) => mapFn(item, key)),\n\t)\n}\n\n/**\n * Creates a selector that counts items in a collection, optionally filtered - OPTIMIZED\n *\n * @param store The collection store\n * @param filterFn Optional function to filter which items to count\n * @returns An observable of the count\n */\nexport function createCountSelector<T>(\n\tstore: ICollectionStore<T>,\n\tfilterFn?: (item: T, key: string) => boolean,\n): Observable<number> {\n\treturn createCollectionSelector(store, collection => {\n\t\tif (!filterFn) return collection.size\n\n\t\treturn Array.from(collection.entries()).filter(([key, item]) => filterFn(item, key)).length\n\t})\n}\n\n/**\n * Optimized RxJS Pipeline - use share with reset on refCount zero for better memory management\n * in scenarios where selector subscriptions come and go\n *\n * @param store The store to observe\n * @param selectorFn Function that transforms the state\n * @returns An observable of the selected state with improved memory management\n */\nexport function createOptimizedSelector<T, R>(store: IStore<T>, selectorFn: (state: T) => R): Observable<R> {\n\treturn store.$.pipe(\n\t\tmap(selectorFn),\n\t\tdistinctUntilChanged<R>(deepEqual),\n\t\tshare({\n\t\t\tresetOnRefCountZero: true,\n\t\t\tresetOnError: false,\n\t\t\tresetOnComplete: false,\n\t\t}),\n\t)\n}\n\n/**\n * Creates a compound selector from multiple stores\n *\n * This function combines data from multiple stores to create a derived\n * state that's compatible with the @select decorator.\n *\n * @param stores Array of stores to derive state from\n * @param selectorFns Selector functions for each store\n * @param combinerFn Function that combines the selected values\n * @returns A store-compatible object to use with @select\n */\nexport function createCompoundSelector<R>(\n\tstores: Array<IStore<any> | ICollectionStore<any>>,\n\tselectorFns: Array<(state: any) => any>,\n\tcombinerFn: (...values: any[]) => R,\n): IStore<R> {\n\t// Calculate initial value\n\tconst initialValues = stores.map((store, index) => selectorFns[index](store.value))\n\tconst initialValue = combinerFn(...initialValues)\n\n\t// Create a store with the initial value\n\tconst result: IStore<R> = {\n\t\t$: new BehaviorSubject<R>(initialValue),\n\t\terror$: new BehaviorSubject<StoreError | null>(null),\n\t\tready: true,\n\t\tdefaultValue: initialValue,\n\n\t\tget value(): R {\n\t\t\treturn this.$.getValue()\n\t\t},\n\n\t\t// These methods are no-ops for read-only stores\n\t\tset(_value: Partial<R>, _merge?: boolean): void {\n\t\t\tconsole.warn('Compound selector store is read-only')\n\t\t},\n\n\t\tclear(): void {\n\t\t\tthis.$.next(this.defaultValue)\n\t\t},\n\n\t\treplace(_newValue: R): void {\n\t\t\tconsole.warn('Compound selector store is read-only')\n\t\t},\n\n\t\tdelete<K extends keyof R>(_key: K): void {\n\t\t\tconsole.warn('Compound selector store is read-only')\n\t\t},\n\n\t\tdestroy(): void {\n\t\t\tthis.$.complete()\n\t\t\tthis.error$.complete()\n\t\t},\n\t}\n\n\t// Set up the reactivity by subscribing to all source stores\n\tconst observables = stores.map((store, _) => store.$)\n\n\t// Create a subscription that updates the result whenever any source changes\n\tconst subscription = combineLatest(observables).subscribe({\n\t\tnext: storeValues => {\n\t\t\ttry {\n\t\t\t\t// Apply selectors to each store value\n\t\t\t\tconst selectedValues = storeValues.map((value, index) => selectorFns[index](value))\n\n\t\t\t\t// Apply combiner function\n\t\t\t\tconst newValue = combinerFn(...selectedValues)\n\n\t\t\t\t// Update the BehaviorSubject\n\t\t\t\tresult.$.next(newValue)\n\t\t\t} catch (err) {\n\t\t\t\tconst error = new StoreError('Error in compound selector', err)\n\t\t\t\tresult.error$.next(error)\n\t\t\t\tconsole.error(error)\n\t\t\t}\n\t\t},\n\t\terror: err => {\n\t\t\tconst error = new StoreError('Error in store subscription', err)\n\t\t\tresult.error$.next(error)\n\t\t\tconsole.error(error)\n\t\t},\n\t})\n\n\t// Ensure the subscription is cleaned up when the store is destroyed\n\tconst originalDestroy = result.destroy\n\tresult.destroy = function () {\n\t\tsubscription.unsubscribe()\n\t\toriginalDestroy.call(this)\n\t}\n\n\treturn result\n}\n","// src/store/selector-hook.ts - Improved memory management\nimport { property as litProperty } from 'lit/decorators.js'\nimport { Observable, Subject, Subscription } from 'rxjs'\nimport { takeUntil } from 'rxjs/operators'\nimport { createCollectionSelector, createSelector } from './selectors'\nimport { ICollectionStore, IStore } from './types'\n\n/**\n * Symbol used for storing cleanup resources\n * Using a Symbol prevents name collisions with component properties\n */\nconst CLEANUP_SUBJECT = Symbol('selectorCleanup')\nconst SUBSCRIPTIONS = Symbol('selectorSubscriptions')\nconst INITIALIZED = Symbol('selectorInitialized')\nconst CONNECTED_CALLED = Symbol('connectedCallbackCalled')\n\n/**\n * Component lifecycle interface\n */\ninterface ComponentWithLifecycle {\n\t// Lifecycle hooks\n\tisConnected: boolean\n\tdisconnectedCallback?: () => void\n\tconnectedCallback?: () => void\n\trequestUpdate?: () => void\n\n\t// Internal properties using symbols to avoid name collisions\n\t[CLEANUP_SUBJECT]?: Subject<void>\n\t[SUBSCRIPTIONS]?: Map<string, Subscription>\n\t[INITIALIZED]?: Set<string>\n\t[CONNECTED_CALLED]?: boolean\n\n\t// Value storage\n\t[key: string]: any\n}\n\n/**\n * Property descriptor interface\n */\ntype PropertyDescriptor<T> = {\n\tget?: () => T\n\tset?: (value: T) => void\n\tvalue?: T\n\tconfigurable?: boolean\n\tenumerable?: boolean\n\twritable?: boolean\n}\n\n/**\n * Options for selecting from a store\n */\ninterface SelectOptions {\n\t/** If true, will wait for selector to emit a value (including null) before calling connectedCallback. Only undefined is considered \"not ready\". Default is true. */\n\trequired?: boolean\n\n\t/** If true, will only update the component and not set the property value */\n\tupdateOnly?: boolean\n\n\t/** If true, will use structuredClone to deeply clone values (prevents mutations) */\n\tdeepClone?: boolean\n\n\t/** Custom equality function to determine when to update */\n\tequals?: (a: any, b: any) => boolean\n\n\t/** Debug mode - logs selector activity */\n\tdebug?: boolean\n}\n\n/**\n * Type guard to check if a store is a collection store\n */\nfunction isCollectionStore<T>(store: IStore<any> | ICollectionStore<T>): store is ICollectionStore<T> {\n\treturn 'set' in store && typeof store.set === 'function' && store.value instanceof Map\n}\n\n/**\n * Ensures the cleanup resources exist on the component\n */\nfunction ensureCleanupResources(component: ComponentWithLifecycle): void {\n\tif (!component[CLEANUP_SUBJECT] || component[CLEANUP_SUBJECT].closed) {\n\t\tcomponent[CLEANUP_SUBJECT] = new Subject<void>()\n\t}\n\n\tif (!component[SUBSCRIPTIONS]) {\n\t\tcomponent[SUBSCRIPTIONS] = new Map()\n\t}\n\n\tif (!component[INITIALIZED]) {\n\t\tcomponent[INITIALIZED] = new Set()\n\t}\n}\n\n/**\n * Cleans up all selector resources\n */\nfunction cleanupSelectorResources(component: ComponentWithLifecycle): void {\n\tif (component[CLEANUP_SUBJECT]) {\n\t\tcomponent[CLEANUP_SUBJECT].next()\n\t\tcomponent[CLEANUP_SUBJECT].complete()\n\t\tcomponent[CLEANUP_SUBJECT] = undefined\n\t}\n\n\tif (component[SUBSCRIPTIONS]) {\n\t\tcomponent[SUBSCRIPTIONS].forEach(sub => sub.unsubscribe())\n\t\tcomponent[SUBSCRIPTIONS].clear()\n\t\tcomponent[SUBSCRIPTIONS] = undefined\n\t}\n\n\tif (component[INITIALIZED]) {\n\t\tcomponent[INITIALIZED].clear()\n\t\tcomponent[INITIALIZED] = undefined\n\t}\n\n\t// Reset the connected flag when cleaning up\n\tcomponent[CONNECTED_CALLED] = undefined\n}\n\n/**\n * Selector decorator that connects a component property to a store selector\n * with improved memory management\n *\n * @param store The store to select from\n * @param selectorFn Optional function to transform the store state\n * @param options Additional options for the selector\n */\nexport function select<T, R>(\n\tstore: IStore<T> | ICollectionStore<T>,\n\tselectorFn: (state: any) => R = (state: R) => state,\n\toptions: SelectOptions = { required: true },\n) {\n\treturn function (proto: Record<string, any>, propName: string, _descriptor?: PropertyDescriptor<R>) {\n\t\t// Register as a Lit property\n\t\tlitProperty({ attribute: false, type: Object })(proto, propName)\n\n\t\t// Store original lifecycle methods\n\t\tconst originalConnectedCallback = proto.connectedCallback\n\t\tconst originalDisconnectedCallback = proto.disconnectedCallback\n\n\t\t// Override connectedCallback to set up subscription\n\t\tproto.connectedCallback = function (this: ComponentWithLifecycle) {\n\t\t\t// Initialize cleanup resources\n\t\t\tensureCleanupResources(this)\n\n\t\t\t// Create the appropriate selector\n\t\t\tconst selector: Observable<R> = isCollectionStore(store)\n\t\t\t\t? createCollectionSelector(store, selectorFn)\n\t\t\t\t: createSelector(store as IStore<T>, selectorFn)\n\n\t\t\t// Call original connectedCallback immediately if not waiting for data\n\t\t\tif (!options.required && !this[CONNECTED_CALLED]) {\n\t\t\t\toriginalConnectedCallback?.call(this)\n\t\t\t\tthis[CONNECTED_CALLED] = true\n\t\t\t}\n\n\t\t\t// Clean up any existing subscription\n\t\t\tif (this[SUBSCRIPTIONS]!.has(propName)) {\n\t\t\t\tthis[SUBSCRIPTIONS]!.get(propName)?.unsubscribe()\n\t\t\t\tthis[SUBSCRIPTIONS]!.delete(propName)\n\t\t\t}\n\n\t\t\t// Debug log if needed\n\t\t\tif (options.debug) {\n\t\t\t\tconsole.debug(`[select] Setting up subscription for ${propName}`)\n\t\t\t}\n\n\t\t\t// Create new subscription with better error handling\n\t\t\tconst subscription = selector.pipe(takeUntil(this[CLEANUP_SUBJECT]!)).subscribe({\n\t\t\t\tnext: (value: R) => {\n\t\t\t\t\t// Handle value updates\n\t\t\t\t\tconst newValue = options.deepClone ? structuredClone(value) : value\n\n\t\t\t\t\tif (options.debug) {\n\t\t\t\t\t\tconsole.debug(`[select] New value for ${propName}:`, newValue)\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!options.updateOnly) {\n\t\t\t\t\t\tthis[propName] = newValue\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.requestUpdate?.()\n\n\t\t\t\t\t// If required and not initialized, call connectedCallback when we get a value\n\t\t\t\t\t// Allow null values but not undefined (undefined means the selector hasn't emitted yet)\n\t\t\t\t\tif (options.required && !this[INITIALIZED]!.has(propName) && newValue !== undefined) {\n\t\t\t\t\t\tthis[INITIALIZED]!.add(propName)\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Only call original connectedCallback once, regardless of how many selectors\n\t\t\t\t\t\tif (!this[CONNECTED_CALLED]) {\n\t\t\t\t\t\t\tif (options.debug) {\n\t\t\t\t\t\t\t\tconsole.debug(`[select] Calling delayed connectedCallback for ${propName}`)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\toriginalConnectedCallback?.call(this)\n\t\t\t\t\t\t\tthis[CONNECTED_CALLED] = true\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\terror: (err: Error) => {\n\t\t\t\t\tconsole.error(`Error in selector subscription for ${propName}:`, err)\n\t\t\t\t\t// Resubscribe on error to prevent component from becoming unresponsive\n\t\t\t\t\tif (this.isConnected) {\n\t\t\t\t\t\t// Small delay to prevent immediate resubscription\n\t\t\t\t\t\tsetTimeout(() => {\n\t\t\t\t\t\t\tif (this.isConnected) {\n\t\t\t\t\t\t\t\tif (options.debug) {\n\t\t\t\t\t\t\t\t\tconsole.debug(`[select] Resubscribing after error for ${propName}`)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tthis.connectedCallback?.()\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}, 1000)\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t})\n\n\t\t\t// Store the subscription for cleanup\n\t\t\tthis[SUBSCRIPTIONS]!.set(propName, subscription)\n\t\t}\n\n\t\t// Override disconnectedCallback to clean up subscriptions\n\t\tproto.disconnectedCallback = function (this: ComponentWithLifecycle) {\n\t\t\t// Call original disconnectedCallback\n\t\t\toriginalDisconnectedCallback?.call(this)\n\n\t\t\t// Debug log if needed\n\t\t\tif (options.debug) {\n\t\t\t\tconsole.debug(`[select] Cleaning up resources in disconnectedCallback`)\n\t\t\t}\n\n\t\t\t// Clean up all subscription resources\n\t\t\tcleanupSelectorResources(this)\n\t\t}\n\t}\n}\n\n/**\n * Creates a selector decorator that selects a specific item from a collection store\n * with improved memory management\n *\n * @param store The collection store\n * @param keyGetter Function that returns the key to select\n * @param options Additional options\n */\nexport function selectItem<T>(\n\tstore: ICollectionStore<T>,\n\tkeyGetter: (component: any) => string,\n\toptions: SelectOptions = { required: true },\n) {\n\treturn function (proto: Record<string, any>, propName: string, _descriptor?: PropertyDescriptor<T | undefined>) {\n\t\tselect(\n\t\t\tstore,\n\t\t\tfunction (state) {\n\t\t\t\t// This will be evaluated during subscription, when 'this' is available\n\t\t\t\tconst itemKey = keyGetter(this)\n\t\t\t\treturn itemKey ? state.get(itemKey) : undefined\n\t\t\t},\n\t\t\toptions,\n\t\t)(proto, propName)\n\t}\n}\n"],"names":["getFieldValue","item","path","parts","split","value","part","getBigrams","s","length","bigrams","i","push","substring","toLowerCase","computeFuzzyScore","actual","expected","a","trim","b","substringScore","includes","subsequenceScore","sub","str","j","anagramScore","query","target","countChars","reduce","acc","char","queryCount","targetCount","Object","keys","every","diceScore","s1","s2","bigrams1","bigrams2","intersection","used","Array","fill","bigram","maxLen","Math","max","levenshteinScore","matrix","map","_","charAt","min","safeString","String","applyQueryCondition","fuzzyThreshold","field","op","strict","isArray","key","k","best","curr","valid","score","operator","matches","compareValues","filterMapItems","items","queries","from","values","scoredItems","entries","totalScore","matchCount","result","sort","x","filterArrayItems","Map","forEach","index","set","isString","isNumber","isNaN","isDate","Date","getTime","isIterable","Symbol","iterator","isMap","isSet","Set","isPlainObject","proto","getPrototypeOf","prototype","isNil","localeCompare","has","startsWith","endsWith","filterMap","filterArray","deepEqual","size","get","keysA","keysB","createSelector","store","selectorFn","$","pipe","distinctUntilChanged","shareReplay","createCollectionSelector","createItemsSelector","collection","createItemSelector","itemKey","createKeysSelector","createEntriesSelector","createSortSelector","compareFn","createFindSelector","predicate","createFilterSelector","filterFn","filter","createMapSelector","mapFn","createCountSelector","createOptimizedSelector","share","resetOnRefCountZero","resetOnError","resetOnComplete","createCompoundSelector","stores","selectorFns","combinerFn","initialValues","initialValue","BehaviorSubject","error$","ready","defaultValue","this","getValue","_value","_merge","next","_newValue","_key","destroy","complete","observables","subscription","combineLatest","subscribe","storeValues","selectedValues","newValue","err","error","StoreError","originalDestroy","unsubscribe","call","CLEANUP_SUBJECT","SUBSCRIPTIONS","INITIALIZED","CONNECTED_CALLED","select","state","options","required","propName","_descriptor","litProperty","attribute","type","originalConnectedCallback","connectedCallback","originalDisconnectedCallback","disconnectedCallback","component","closed","Subject","selector","delete","debug","takeUntil","deepClone","structuredClone","updateOnly","requestUpdate","add","isConnected","setTimeout","clear","selectItem","keyGetter"],"mappings":";;;;AAkDO,MAAMA,IAAgB,CAAUC,GAA2BC,MAAAA;AACjE,MAAA,CAAKA,EAAM,QAAOD;AAElB,QAAME,IAAQD,EAAKE,MAAM;AACzB,MAAIC,IAAaJ;AAEjB,aAAWK,KAAQH,GAAO;AACzB,QAAIE,KAAS,KAAM;AACnBA,IAAAA,IAAQA,EAAMC,CAAAA;AAAAA,EACf;AAEA,SAAOD;AAAAA,GA+EFE,IAAcC,CAAAA,MAAAA;AACnB,MAAA,CAAKA,KAAKA,EAAEC,SAAS,UAAU,CAAA;AAE/B,QAAMC,IAAoB,CAAA;AAC1B,WAASC,IAAI,GAAGA,IAAIH,EAAEC,SAAS,GAAGE,IACjCD,CAAAA,EAAQE,KAAKJ,EAAEK,UAAUF,GAAGA,IAAI,CAAA,EAAGG,YAAAA,CAAAA;AAEpC,SAAOJ;AAAAA,GAwCFK,IAAoB,CAACC,GAAgBC,MAAAA;AAC1C,MAAA,CAAKD,KAAAA,CAAWC,EAAU,QAAO;AAEjC,QAAMC,IAAIF,EAAOF,YAAAA,EAAcK,KAAAA,GACzBC,IAAIH,EAASH,YAAAA,EAAcK,KAAAA;AAEjC,MAAID,MAAME,EAAG,QAAO;AAEpB,QAAMC,IAAiBH,EAAEI,SAASF,CAAAA,IAAK,IAAI,GACrCG,KAjGe,CAACC,GAAaC,MAAAA;AACnC,QAAA,CAAKD,EAAK;AACV,QAAA,CAAKC,EAAK,QAAA;AAEV,QAAId,IAAI,GACPe,IAAI;AACL,WAAOf,IAAIa,EAAIf,UAAUiB,IAAID,EAAIhB,SAC5Be,CAAAA,EAAIb,CAAAA,EAAGG,YAAAA,MAAkBW,EAAIC,CAAAA,EAAGZ,YAAAA,KAAeH,KACnDe;AAED,WAAOf,MAAMa,EAAIf;AAAAA,EAAAA,GAuFsBW,GAAGF,CAAAA,IAAK,MAAM,GAC/CS,KAjFc,CAACC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bsB,CAAAA,MACbiB,EAAUjB,CAAAA,EAAiBlB,KAAAA,GAC3BmC,EAAUjB,CAAAA,EAAiBd,SAAAA,GAC3B+B,EAAUjB,cAGPiB,EAAUhB,CAAAA,MACbgB,EAAUhB,CAAAA,EAAe7F,QAAQjE,CAAAA,MAAOA,EAAI2J,YAAAA,CAAAA,GAC5CmB,EAAUhB,CAAAA,EAAe8B,MAAAA,GACzBd,EAAUhB,cAGPgB,EAAUf,CAAAA,MACbe,EAAUf,CAAAA,EAAa6B,MAAAA,GACvBd,EAAUf,CAAAA,IAAAA,SAIXe,EAAUd,CAAAA,IAAAA;AAAAA,IAoHT;AAAA,EACD;AACD;AAUO,SAAS6B,GACf5F,GACA6F,GACA3B,IAAyB,EAAEC,aAAU,GAAA;AAErC,SAAO,SAAUnF,GAA4BoF,GAAkBC,GAAAA;AAC9DL,IAAAA,EACChE,GACA,SAAUiE,GAAAA;AAET,YAAMvD,IAAUmF,EAAUvD;AAC1B,aAAO5B,IAAUuD,EAAMrE,IAAIc,CAAAA,IAAAA;AAAAA,IAC5B,GACAwD,CAAAA,EACClF,GAAOoF,CAAAA;AAAAA,EACV;AACD;"}
@@ -3,11 +3,11 @@ import "rxjs/operators";
3
3
  import "lit/directives/class-map.js";
4
4
  import "lit/directives/style-map.js";
5
5
  import { property as l, query as y, customElement as w } from "lit/decorators.js";
6
- import "./tailwind.mixin-DIW0B_of.js";
7
- import { $ as b } from "./litElement.mixin-DWDPaNoc.js";
8
- import { a as k } from "./area.component-CQq-Mh0Z.js";
6
+ import "./tailwind.mixin-Ddt05Frc.js";
7
+ import { $ as b } from "./litElement.mixin-Wcu4yIIs.js";
8
+ import { a as k } from "./area.component-7mWxekxE.js";
9
9
  import { html as S } from "lit";
10
- import { S as c, s as v } from "./sheet.service-BvOiOFMm.js";
10
+ import { S as c, s as v } from "./sheet.service-4etIM-p6.js";
11
11
  var x = Object.defineProperty, O = Object.getOwnPropertyDescriptor, r = (t, e, i, o) => {
12
12
  for (var s, a = o > 1 ? void 0 : o ? O(e, i) : e, m = t.length - 1; m >= 0; m--) (s = t[m]) && (a = (o ? s(e, i, a) : s(a)) || a);
13
13
  return o && a && x(e, i, a), a;
@@ -94,4 +94,4 @@ r([l({ type: String, reflect: !0 })], n.prototype, "uid", 2), r([l({ type: Boole
94
94
  }
95
95
  };
96
96
  })], n.prototype, "onOpenChange", 1), n = r([w("schmancy-sheet")], n);
97
- //# sourceMappingURL=sheet-DovyNsok.js.map
97
+ //# sourceMappingURL=sheet-B1g7E4dQ.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sheet-DovyNsok.js","sources":["../src/sheet/sheet.ts","../src/sheet/hook.ts"],"sourcesContent":["import { $LitElement } from '@mixins/index'\nimport { area } from '../area'\nimport { html } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\nimport { fromEvent, merge, takeUntil, tap, filter } from 'rxjs'\nimport { on } from './hook'\nimport style from './sheet.scss?inline'\nimport { SchmancySheetPosition, sheet } from './sheet.service'\n\n@customElement('schmancy-sheet')\nexport default class SchmancySheet extends $LitElement(style) {\n\t@property({ type: String, reflect: true }) uid!: string\n\t@property({ type: Boolean, reflect: true }) open = false\n\t@property({ type: String, reflect: true }) position: SchmancySheetPosition = SchmancySheetPosition.Side\n\t@property({ type: Boolean, reflect: true }) persist = false\n\t@property({ type: Boolean, reflect: true }) lock = false\n\t@property({ type: Boolean, reflect: true }) handleHistory = true\n\n\tprivate lastFocusedElement: HTMLElement | null = null\n\t@query('.overlay') private overlayEl!: HTMLDivElement\n\t@query('.content') private contentEl!: HTMLDivElement\n\n\t@on('open')\n\tonOpenChange(_oldValue: boolean, newValue: boolean) {\n\t\tif (newValue) {\n\t\t\tthis.lastFocusedElement = document.activeElement as HTMLElement\n\t\t\tthis.setBackgroundInert(true)\n\t\t\tthis.animateIn()\n\t\t\tthis.focus()\n\t\t} else {\n\t\t\tthis.animateOut()\n\t\t\tthis.setBackgroundInert(false)\n\t\t\tthis.lastFocusedElement?.focus()\n\t\t\tthis.lastFocusedElement = null\n\t\t}\n\t}\n\n\tprivate animateIn() {\n\t\tif (!this.overlayEl || !this.contentEl) return\n\n\t\tconst timing = {\n\t\t\tduration: 250,\n\t\t\teasing: 'cubic-bezier(0.16, 1, 0.3, 1)',\n\t\t\tfill: 'forwards' as FillMode,\n\t\t}\n\n\t\t// Animate overlay\n\t\tthis.overlayEl.animate([{ opacity: 0 }, { opacity: 0.8 }], timing)\n\n\t\t// Animate content based on position\n\t\tconst transform =\n\t\t\tthis.position === SchmancySheetPosition.Side\n\t\t\t\t? [{ transform: 'translateX(100%)' }, { transform: 'translateX(0)' }]\n\t\t\t\t: [{ transform: 'translateY(100%)' }, { transform: 'translateY(0)' }]\n\n\t\tthis.contentEl.animate(transform, timing)\n\t}\n\n\tprivate animateOut() {\n\t\tif (!this.overlayEl || !this.contentEl) return\n\n\t\tconst timing = {\n\t\t\tduration: 250,\n\t\t\teasing: 'cubic-bezier(0.16, 1, 0.3, 1)',\n\t\t\tfill: 'forwards' as FillMode,\n\t\t}\n\n\t\t// Animate overlay\n\t\tthis.overlayEl.animate([{ opacity: 0.8 }, { opacity: 0 }], timing)\n\n\t\t// Animate content based on position\n\t\tconst transform =\n\t\t\tthis.position === SchmancySheetPosition.Side\n\t\t\t\t? [{ transform: 'translateX(0)' }, { transform: 'translateX(100%)' }]\n\t\t\t\t: [{ transform: 'translateY(0)' }, { transform: 'translateY(100%)' }]\n\n\t\tthis.contentEl.animate(transform, timing)\n\t}\n\n\tconnectedCallback() {\n\t\tsuper.connectedCallback()\n\t\tthis.setupEventListeners()\n\t}\n\n\tdisconnectedCallback() {\n\t\tsuper.disconnectedCallback()\n\t\tthis.disconnecting.next(true)\n\t}\n\n\tprivate setupEventListeners() {\n\t\t// Handle browser back button\n\t\tconst popState$ = fromEvent<PopStateEvent>(window, 'popstate').pipe(\n\t\t\tfilter(() => this.handleHistory),\n\t\t\ttap(e => {\n\t\t\t\te.preventDefault()\n\t\t\t\tthis.closeSheet()\n\t\t\t}),\n\t\t)\n\n\t\t// Handle ESC key\n\t\tconst keyUp$ = fromEvent<KeyboardEvent>(this, 'keydown').pipe(\n\t\t\ttap(event => {\n\t\t\t\tif (event.key === 'Escape' && !this.lock && this.open) {\n\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\tevent.stopPropagation()\n\t\t\t\t\tsheet.dismiss(this.uid)\n\t\t\t\t}\n\t\t\t}),\n\t\t)\n\n\t\t// Handle render events from sheet service\n\t\tconst render$ = fromEvent<CustomEvent>(window, 'schmancy-sheet-render').pipe(\n\t\t\tfilter(e => e.detail.uid === this.uid),\n\t\t\ttap(e => {\n\t\t\t\tarea.push({\n\t\t\t\t\tarea: this.uid,\n\t\t\t\t\tcomponent: e.detail.component,\n\t\t\t\t\tprops: e.detail.props,\n\t\t\t\t\thistoryStrategy: 'silent',\n\t\t\t\t})\n\t\t\t}),\n\t\t)\n\n\t\t// Handle dismiss events from sheet service\n\t\tconst dismiss$ = fromEvent<CustomEvent>(window, 'schmancy-sheet-dismiss').pipe(\n\t\t\tfilter(e => e.detail.uid === this.uid),\n\t\t\ttap(() => {\n\t\t\t\tthis.closeSheet()\n\t\t\t}),\n\t\t)\n\n\t\tmerge(popState$, keyUp$, render$, dismiss$).pipe(takeUntil(this.disconnecting)).subscribe()\n\t}\n\n\tprivate setBackgroundInert(inert: boolean) {\n\t\tconst parent = this.parentElement\n\t\tif (!parent) return\n\n\t\tArray.from(parent.children).forEach(child => {\n\t\t\tif (child !== this && child instanceof HTMLElement) {\n\t\t\t\tchild.toggleAttribute('inert', inert)\n\t\t\t}\n\t\t})\n\t}\n\n\tcloseSheet() {\n\t\tthis.open = false\n\t\tthis.dispatchEvent(new CustomEvent('close'))\n\t}\n\n\toverride focus() {\n\t\t// delegatesFocus in shadowRootOptions handles automatic focus\n\t\t// Just focus first element with autofocus attribute if present\n\t\tconst element = this.querySelector('[autofocus]')\n\t\tif (element instanceof HTMLElement) {\n\t\t\telement.focus()\n\t\t}\n\t}\n\n\tprivate handleOverlayClick = (e: Event) => {\n\t\te.stopPropagation()\n\t\tif (!this.lock) {\n\t\t\tsheet.dismiss(this.uid)\n\t\t}\n\t}\n\n\trender() {\n\t\tconst sheetClasses = `fixed inset-0 z-[999] flex ${this.open ? '' : 'invisible pointer-events-none'}`\n\n\t\tconst overlayClasses = `overlay absolute inset-0 bg-surface-container/10 backdrop-blur-xs ${this.lock ? '' : 'cursor-pointer'}`\n\n\t\tconst contentClasses =\n\t\t\tthis.position === SchmancySheetPosition.Side\n\t\t\t\t? 'content h-full min-w-[320px] max-w-[90vw] w-fit ml-auto overflow-hidden z-10'\n\t\t\t\t: 'content w-full mt-auto rounded-t-2xl max-h-[90vh] overflow-hidden z-10'\n\n\t\tconst bodyClasses = this.position === SchmancySheetPosition.Side ? 'max-h-screen' : 'max-h-[90vh]'\n\n\t\treturn html`\n\t\t\t<div class=${sheetClasses} role=\"dialog\" aria-hidden=${!this.open} aria-modal=${this.open} tabindex=\"0\">\n\t\t\t\t<div class=${overlayClasses} @click=${this.handleOverlayClick}></div>\n\t\t\t\t<div class=${contentClasses}>\n\t\t\t\t\t<schmancy-surface rounded=\"left\" fill=\"all\" id=\"body\" class=\"overflow-auto ${bodyClasses}\" type=\"surface\">\n\t\t\t\t\t\t<schmancy-scroll>\n\t\t\t\t\t\t\t<schmancy-area class=\"h-full\" name=${this.uid}>\n\t\t\t\t\t\t\t\t<slot></slot>\n\t\t\t\t\t\t\t</schmancy-area>\n\t\t\t\t\t\t</schmancy-scroll>\n\t\t\t\t\t</schmancy-surface>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-sheet': SchmancySheet\n\t}\n}\n","// @watch decorator\n//\n// Runs when an observed property changes, e.g. @property or @state, but before the component updates.\n//\n// To wait for an update to complete after a change occurs, use `await this.updateComplete` in the handler. To start\n// watching after the initial update/render, use `{ waitUntilFirstUpdate: true }` or `this.hasUpdated` in the handler.\n//\n// Usage:\n//\n// @watch('propName')\n// handlePropChange(oldValue, newValue) {\n// ...\n// }\n//\ninterface WatchOptions {\n\twaitUntilFirstUpdate?: boolean\n}\n\nexport function on(propName: string, options?: WatchOptions) {\n\treturn (protoOrDescriptor: any, name: string): any => {\n\t\tconst { willUpdate } = protoOrDescriptor\n\n\t\toptions = Object.assign({ waitUntilFirstUpdate: false }, options) as WatchOptions\n\n\t\tprotoOrDescriptor.willUpdate = function (changedProps: Map<string, any>) {\n\t\t\twillUpdate.call(this, changedProps)\n\n\t\t\tif (changedProps.has(propName)) {\n\t\t\t\tconst oldValue = changedProps.get(propName)\n\t\t\t\tconst newValue = this[propName]\n\n\t\t\t\tif (oldValue !== newValue) {\n\t\t\t\t\tif (!options?.waitUntilFirstUpdate || this.hasUpdated) {\n\t\t\t\t\t\tthis[name].call(this, oldValue, newValue)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n"],"names":["SchmancySheet","$LitElement","super","arguments","this","open","position","SchmancySheetPosition","Side","persist","lock","handleHistory","lastFocusedElement","handleOverlayClick","e","stopPropagation","sheet","dismiss","uid","_oldValue","newValue","document","activeElement","setBackgroundInert","animateIn","focus","animateOut","overlayEl","contentEl","timing","duration","easing","fill","animate","opacity","transform","connectedCallback","setupEventListeners","disconnectedCallback","disconnecting","next","popState$","fromEvent","window","pipe","filter","tap","preventDefault","closeSheet","keyUp$","event","key","render$","detail","area","push","component","props","historyStrategy","dismiss$","merge","takeUntil","subscribe","inert","parent","parentElement","Array","from","children","forEach","child","HTMLElement","toggleAttribute","dispatchEvent","CustomEvent","element","querySelector","render","sheetClasses","overlayClasses","contentClasses","bodyClasses","html","propName","options","__decorateClass","property","type","String","reflect","prototype","Boolean","query","protoOrDescriptor","name","willUpdate","Object","assign","waitUntilFirstUpdate","changedProps","call","has","oldValue","get","hasUpdated","customElement"],"mappings":";;;;;;;;;;;;;;AAUA,IAAqBA,IAArB,cAA2CC;EAA3C;AAA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AA,EAAMM,KAAKhG,MAAMkG,GAAUlF;IAGnC;AAAA,EACD;AAAA,EAAA,GD3BmBpB,EAapB0F,WAAA,gBAAA,CAAA,GAboB1F,IAArBqF,EAAA,CADCoB,EAAc,gBAAA,CAAA,GACMzG,CAAAA;"}
1
+ {"version":3,"file":"sheet-B1g7E4dQ.js","sources":["../src/sheet/sheet.ts","../src/sheet/hook.ts"],"sourcesContent":["import { $LitElement } from '@mixins/index'\nimport { area } from '../area'\nimport { html } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\nimport { fromEvent, merge, takeUntil, tap, filter } from 'rxjs'\nimport { on } from './hook'\nimport style from './sheet.scss?inline'\nimport { SchmancySheetPosition, sheet } from './sheet.service'\n\n@customElement('schmancy-sheet')\nexport default class SchmancySheet extends $LitElement(style) {\n\t@property({ type: String, reflect: true }) uid!: string\n\t@property({ type: Boolean, reflect: true }) open = false\n\t@property({ type: String, reflect: true }) position: SchmancySheetPosition = SchmancySheetPosition.Side\n\t@property({ type: Boolean, reflect: true }) persist = false\n\t@property({ type: Boolean, reflect: true }) lock = false\n\t@property({ type: Boolean, reflect: true }) handleHistory = true\n\n\tprivate lastFocusedElement: HTMLElement | null = null\n\t@query('.overlay') private overlayEl!: HTMLDivElement\n\t@query('.content') private contentEl!: HTMLDivElement\n\n\t@on('open')\n\tonOpenChange(_oldValue: boolean, newValue: boolean) {\n\t\tif (newValue) {\n\t\t\tthis.lastFocusedElement = document.activeElement as HTMLElement\n\t\t\tthis.setBackgroundInert(true)\n\t\t\tthis.animateIn()\n\t\t\tthis.focus()\n\t\t} else {\n\t\t\tthis.animateOut()\n\t\t\tthis.setBackgroundInert(false)\n\t\t\tthis.lastFocusedElement?.focus()\n\t\t\tthis.lastFocusedElement = null\n\t\t}\n\t}\n\n\tprivate animateIn() {\n\t\tif (!this.overlayEl || !this.contentEl) return\n\n\t\tconst timing = {\n\t\t\tduration: 250,\n\t\t\teasing: 'cubic-bezier(0.16, 1, 0.3, 1)',\n\t\t\tfill: 'forwards' as FillMode,\n\t\t}\n\n\t\t// Animate overlay\n\t\tthis.overlayEl.animate([{ opacity: 0 }, { opacity: 0.8 }], timing)\n\n\t\t// Animate content based on position\n\t\tconst transform =\n\t\t\tthis.position === SchmancySheetPosition.Side\n\t\t\t\t? [{ transform: 'translateX(100%)' }, { transform: 'translateX(0)' }]\n\t\t\t\t: [{ transform: 'translateY(100%)' }, { transform: 'translateY(0)' }]\n\n\t\tthis.contentEl.animate(transform, timing)\n\t}\n\n\tprivate animateOut() {\n\t\tif (!this.overlayEl || !this.contentEl) return\n\n\t\tconst timing = {\n\t\t\tduration: 250,\n\t\t\teasing: 'cubic-bezier(0.16, 1, 0.3, 1)',\n\t\t\tfill: 'forwards' as FillMode,\n\t\t}\n\n\t\t// Animate overlay\n\t\tthis.overlayEl.animate([{ opacity: 0.8 }, { opacity: 0 }], timing)\n\n\t\t// Animate content based on position\n\t\tconst transform =\n\t\t\tthis.position === SchmancySheetPosition.Side\n\t\t\t\t? [{ transform: 'translateX(0)' }, { transform: 'translateX(100%)' }]\n\t\t\t\t: [{ transform: 'translateY(0)' }, { transform: 'translateY(100%)' }]\n\n\t\tthis.contentEl.animate(transform, timing)\n\t}\n\n\tconnectedCallback() {\n\t\tsuper.connectedCallback()\n\t\tthis.setupEventListeners()\n\t}\n\n\tdisconnectedCallback() {\n\t\tsuper.disconnectedCallback()\n\t\tthis.disconnecting.next(true)\n\t}\n\n\tprivate setupEventListeners() {\n\t\t// Handle browser back button\n\t\tconst popState$ = fromEvent<PopStateEvent>(window, 'popstate').pipe(\n\t\t\tfilter(() => this.handleHistory),\n\t\t\ttap(e => {\n\t\t\t\te.preventDefault()\n\t\t\t\tthis.closeSheet()\n\t\t\t}),\n\t\t)\n\n\t\t// Handle ESC key\n\t\tconst keyUp$ = fromEvent<KeyboardEvent>(this, 'keydown').pipe(\n\t\t\ttap(event => {\n\t\t\t\tif (event.key === 'Escape' && !this.lock && this.open) {\n\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\tevent.stopPropagation()\n\t\t\t\t\tsheet.dismiss(this.uid)\n\t\t\t\t}\n\t\t\t}),\n\t\t)\n\n\t\t// Handle render events from sheet service\n\t\tconst render$ = fromEvent<CustomEvent>(window, 'schmancy-sheet-render').pipe(\n\t\t\tfilter(e => e.detail.uid === this.uid),\n\t\t\ttap(e => {\n\t\t\t\tarea.push({\n\t\t\t\t\tarea: this.uid,\n\t\t\t\t\tcomponent: e.detail.component,\n\t\t\t\t\tprops: e.detail.props,\n\t\t\t\t\thistoryStrategy: 'silent',\n\t\t\t\t})\n\t\t\t}),\n\t\t)\n\n\t\t// Handle dismiss events from sheet service\n\t\tconst dismiss$ = fromEvent<CustomEvent>(window, 'schmancy-sheet-dismiss').pipe(\n\t\t\tfilter(e => e.detail.uid === this.uid),\n\t\t\ttap(() => {\n\t\t\t\tthis.closeSheet()\n\t\t\t}),\n\t\t)\n\n\t\tmerge(popState$, keyUp$, render$, dismiss$).pipe(takeUntil(this.disconnecting)).subscribe()\n\t}\n\n\tprivate setBackgroundInert(inert: boolean) {\n\t\tconst parent = this.parentElement\n\t\tif (!parent) return\n\n\t\tArray.from(parent.children).forEach(child => {\n\t\t\tif (child !== this && child instanceof HTMLElement) {\n\t\t\t\tchild.toggleAttribute('inert', inert)\n\t\t\t}\n\t\t})\n\t}\n\n\tcloseSheet() {\n\t\tthis.open = false\n\t\tthis.dispatchEvent(new CustomEvent('close'))\n\t}\n\n\toverride focus() {\n\t\t// delegatesFocus in shadowRootOptions handles automatic focus\n\t\t// Just focus first element with autofocus attribute if present\n\t\tconst element = this.querySelector('[autofocus]')\n\t\tif (element instanceof HTMLElement) {\n\t\t\telement.focus()\n\t\t}\n\t}\n\n\tprivate handleOverlayClick = (e: Event) => {\n\t\te.stopPropagation()\n\t\tif (!this.lock) {\n\t\t\tsheet.dismiss(this.uid)\n\t\t}\n\t}\n\n\trender() {\n\t\tconst sheetClasses = `fixed inset-0 z-[999] flex ${this.open ? '' : 'invisible pointer-events-none'}`\n\n\t\tconst overlayClasses = `overlay absolute inset-0 bg-surface-container/10 backdrop-blur-xs ${this.lock ? '' : 'cursor-pointer'}`\n\n\t\tconst contentClasses =\n\t\t\tthis.position === SchmancySheetPosition.Side\n\t\t\t\t? 'content h-full min-w-[320px] max-w-[90vw] w-fit ml-auto overflow-hidden z-10'\n\t\t\t\t: 'content w-full mt-auto rounded-t-2xl max-h-[90vh] overflow-hidden z-10'\n\n\t\tconst bodyClasses = this.position === SchmancySheetPosition.Side ? 'max-h-screen' : 'max-h-[90vh]'\n\n\t\treturn html`\n\t\t\t<div class=${sheetClasses} role=\"dialog\" aria-hidden=${!this.open} aria-modal=${this.open} tabindex=\"0\">\n\t\t\t\t<div class=${overlayClasses} @click=${this.handleOverlayClick}></div>\n\t\t\t\t<div class=${contentClasses}>\n\t\t\t\t\t<schmancy-surface rounded=\"left\" fill=\"all\" id=\"body\" class=\"overflow-auto ${bodyClasses}\" type=\"surface\">\n\t\t\t\t\t\t<schmancy-scroll>\n\t\t\t\t\t\t\t<schmancy-area class=\"h-full\" name=${this.uid}>\n\t\t\t\t\t\t\t\t<slot></slot>\n\t\t\t\t\t\t\t</schmancy-area>\n\t\t\t\t\t\t</schmancy-scroll>\n\t\t\t\t\t</schmancy-surface>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-sheet': SchmancySheet\n\t}\n}\n","// @watch decorator\n//\n// Runs when an observed property changes, e.g. @property or @state, but before the component updates.\n//\n// To wait for an update to complete after a change occurs, use `await this.updateComplete` in the handler. To start\n// watching after the initial update/render, use `{ waitUntilFirstUpdate: true }` or `this.hasUpdated` in the handler.\n//\n// Usage:\n//\n// @watch('propName')\n// handlePropChange(oldValue, newValue) {\n// ...\n// }\n//\ninterface WatchOptions {\n\twaitUntilFirstUpdate?: boolean\n}\n\nexport function on(propName: string, options?: WatchOptions) {\n\treturn (protoOrDescriptor: any, name: string): any => {\n\t\tconst { willUpdate } = protoOrDescriptor\n\n\t\toptions = Object.assign({ waitUntilFirstUpdate: false }, options) as WatchOptions\n\n\t\tprotoOrDescriptor.willUpdate = function (changedProps: Map<string, any>) {\n\t\t\twillUpdate.call(this, changedProps)\n\n\t\t\tif (changedProps.has(propName)) {\n\t\t\t\tconst oldValue = changedProps.get(propName)\n\t\t\t\tconst newValue = this[propName]\n\n\t\t\t\tif (oldValue !== newValue) {\n\t\t\t\t\tif (!options?.waitUntilFirstUpdate || this.hasUpdated) {\n\t\t\t\t\t\tthis[name].call(this, oldValue, newValue)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n"],"names":["SchmancySheet","$LitElement","super","arguments","this","open","position","SchmancySheetPosition","Side","persist","lock","handleHistory","lastFocusedElement","handleOverlayClick","e","stopPropagation","sheet","dismiss","uid","_oldValue","newValue","document","activeElement","setBackgroundInert","animateIn","focus","animateOut","overlayEl","contentEl","timing","duration","easing","fill","animate","opacity","transform","connectedCallback","setupEventListeners","disconnectedCallback","disconnecting","next","popState$","fromEvent","window","pipe","filter","tap","preventDefault","closeSheet","keyUp$","event","key","render$","detail","area","push","component","props","historyStrategy","dismiss$","merge","takeUntil","subscribe","inert","parent","parentElement","Array","from","children","forEach","child","HTMLElement","toggleAttribute","dispatchEvent","CustomEvent","element","querySelector","render","sheetClasses","overlayClasses","contentClasses","bodyClasses","html","propName","options","__decorateClass","property","type","String","reflect","prototype","Boolean","query","protoOrDescriptor","name","willUpdate","Object","assign","waitUntilFirstUpdate","changedProps","call","has","oldValue","get","hasUpdated","customElement"],"mappings":";;;;;;;;;;;;;;AAUA,IAAqBA,IAArB,cAA2CC;EAA3C;AAAAC,UAAAA,GAAAC,SAAAA,GAE6CC,KAAAC,OAAAA,IACDD,KAAAE,WAAkCC,EAAsBC,MACvDJ,KAAAK,UAAAA,IACAL,KAAAM,WACAN,KAAAO,gBAAAA,IAE5CP,KAAQQ,qBAAyC,MA6IjDR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}
@@ -1,4 +1,4 @@
1
- "use strict";const n=require("rxjs");require("rxjs/operators"),require("lit/directives/class-map.js"),require("lit/directives/style-map.js");const c=require("lit/decorators.js");require("./tailwind.mixin-3TPVvhYf.cjs");const m=require("./litElement.mixin-CPQYJnK_.cjs"),y=require("./area.component-Ciw7vGsx.cjs"),f=require("lit"),h=require("./sheet.service-DfHrOxyc.cjs");var v=Object.defineProperty,E=Object.getOwnPropertyDescriptor,l=(t,e,i,o)=>{for(var s,a=o>1?void 0:o?E(e,i):e,d=t.length-1;d>=0;d--)(s=t[d])&&(a=(o?s(e,i,a):s(a))||a);return o&&a&&v(e,i,a),a};let r=class extends m.$LitElement(":host{display:block}"){constructor(){super(...arguments),this.open=!1,this.position=h.SchmancySheetPosition.Side,this.persist=!1,this.lock=!1,this.handleHistory=!0,this.lastFocusedElement=null,this.handleOverlayClick=t=>{t.stopPropagation(),this.lock||h.sheet.dismiss(this.uid)}}onOpenChange(t,e){e?(this.lastFocusedElement=document.activeElement,this.setBackgroundInert(!0),this.animateIn(),this.focus()):(this.animateOut(),this.setBackgroundInert(!1),this.lastFocusedElement?.focus(),this.lastFocusedElement=null)}animateIn(){if(!this.overlayEl||!this.contentEl)return;const t={duration:250,easing:"cubic-bezier(0.16, 1, 0.3, 1)",fill:"forwards"};this.overlayEl.animate([{opacity:0},{opacity:.8}],t);const e=this.position===h.SchmancySheetPosition.Side?[{transform:"translateX(100%)"},{transform:"translateX(0)"}]:[{transform:"translateY(100%)"},{transform:"translateY(0)"}];this.contentEl.animate(e,t)}animateOut(){if(!this.overlayEl||!this.contentEl)return;const t={duration:250,easing:"cubic-bezier(0.16, 1, 0.3, 1)",fill:"forwards"};this.overlayEl.animate([{opacity:.8},{opacity:0}],t);const e=this.position===h.SchmancySheetPosition.Side?[{transform:"translateX(0)"},{transform:"translateX(100%)"}]:[{transform:"translateY(0)"},{transform:"translateY(100%)"}];this.contentEl.animate(e,t)}connectedCallback(){super.connectedCallback(),this.setupEventListeners()}disconnectedCallback(){super.disconnectedCallback(),this.disconnecting.next(!0)}setupEventListeners(){const t=n.fromEvent(window,"popstate").pipe(n.filter(()=>this.handleHistory),n.tap(s=>{s.preventDefault(),this.closeSheet()})),e=n.fromEvent(this,"keydown").pipe(n.tap(s=>{s.key==="Escape"&&!this.lock&&this.open&&(s.preventDefault(),s.stopPropagation(),h.sheet.dismiss(this.uid))})),i=n.fromEvent(window,"schmancy-sheet-render").pipe(n.filter(s=>s.detail.uid===this.uid),n.tap(s=>{y.area.push({area:this.uid,component:s.detail.component,props:s.detail.props,historyStrategy:"silent"})})),o=n.fromEvent(window,"schmancy-sheet-dismiss").pipe(n.filter(s=>s.detail.uid===this.uid),n.tap(()=>{this.closeSheet()}));n.merge(t,e,i,o).pipe(n.takeUntil(this.disconnecting)).subscribe()}setBackgroundInert(t){const e=this.parentElement;e&&Array.from(e.children).forEach(i=>{i!==this&&i instanceof HTMLElement&&i.toggleAttribute("inert",t)})}closeSheet(){this.open=!1,this.dispatchEvent(new CustomEvent("close"))}focus(){const t=this.querySelector("[autofocus]");t instanceof HTMLElement&&t.focus()}render(){const t="fixed inset-0 z-[999] flex "+(this.open?"":"invisible pointer-events-none"),e="overlay absolute inset-0 bg-surface-container/10 backdrop-blur-xs "+(this.lock?"":"cursor-pointer"),i=this.position===h.SchmancySheetPosition.Side?"content h-full min-w-[320px] max-w-[90vw] w-fit ml-auto overflow-hidden z-10":"content w-full mt-auto rounded-t-2xl max-h-[90vh] overflow-hidden z-10",o=this.position===h.SchmancySheetPosition.Side?"max-h-screen":"max-h-[90vh]";return f.html`
1
+ "use strict";const n=require("rxjs");require("rxjs/operators"),require("lit/directives/class-map.js"),require("lit/directives/style-map.js");const c=require("lit/decorators.js");require("./tailwind.mixin-UijsBrYW.cjs");const m=require("./litElement.mixin-BVBdv0GP.cjs"),y=require("./area.component-CS_gSutH.cjs"),f=require("lit"),h=require("./sheet.service-BiRZjCdN.cjs");var v=Object.defineProperty,E=Object.getOwnPropertyDescriptor,l=(t,e,i,o)=>{for(var s,a=o>1?void 0:o?E(e,i):e,d=t.length-1;d>=0;d--)(s=t[d])&&(a=(o?s(e,i,a):s(a))||a);return o&&a&&v(e,i,a),a};let r=class extends m.$LitElement(":host{display:block}"){constructor(){super(...arguments),this.open=!1,this.position=h.SchmancySheetPosition.Side,this.persist=!1,this.lock=!1,this.handleHistory=!0,this.lastFocusedElement=null,this.handleOverlayClick=t=>{t.stopPropagation(),this.lock||h.sheet.dismiss(this.uid)}}onOpenChange(t,e){e?(this.lastFocusedElement=document.activeElement,this.setBackgroundInert(!0),this.animateIn(),this.focus()):(this.animateOut(),this.setBackgroundInert(!1),this.lastFocusedElement?.focus(),this.lastFocusedElement=null)}animateIn(){if(!this.overlayEl||!this.contentEl)return;const t={duration:250,easing:"cubic-bezier(0.16, 1, 0.3, 1)",fill:"forwards"};this.overlayEl.animate([{opacity:0},{opacity:.8}],t);const e=this.position===h.SchmancySheetPosition.Side?[{transform:"translateX(100%)"},{transform:"translateX(0)"}]:[{transform:"translateY(100%)"},{transform:"translateY(0)"}];this.contentEl.animate(e,t)}animateOut(){if(!this.overlayEl||!this.contentEl)return;const t={duration:250,easing:"cubic-bezier(0.16, 1, 0.3, 1)",fill:"forwards"};this.overlayEl.animate([{opacity:.8},{opacity:0}],t);const e=this.position===h.SchmancySheetPosition.Side?[{transform:"translateX(0)"},{transform:"translateX(100%)"}]:[{transform:"translateY(0)"},{transform:"translateY(100%)"}];this.contentEl.animate(e,t)}connectedCallback(){super.connectedCallback(),this.setupEventListeners()}disconnectedCallback(){super.disconnectedCallback(),this.disconnecting.next(!0)}setupEventListeners(){const t=n.fromEvent(window,"popstate").pipe(n.filter(()=>this.handleHistory),n.tap(s=>{s.preventDefault(),this.closeSheet()})),e=n.fromEvent(this,"keydown").pipe(n.tap(s=>{s.key==="Escape"&&!this.lock&&this.open&&(s.preventDefault(),s.stopPropagation(),h.sheet.dismiss(this.uid))})),i=n.fromEvent(window,"schmancy-sheet-render").pipe(n.filter(s=>s.detail.uid===this.uid),n.tap(s=>{y.area.push({area:this.uid,component:s.detail.component,props:s.detail.props,historyStrategy:"silent"})})),o=n.fromEvent(window,"schmancy-sheet-dismiss").pipe(n.filter(s=>s.detail.uid===this.uid),n.tap(()=>{this.closeSheet()}));n.merge(t,e,i,o).pipe(n.takeUntil(this.disconnecting)).subscribe()}setBackgroundInert(t){const e=this.parentElement;e&&Array.from(e.children).forEach(i=>{i!==this&&i instanceof HTMLElement&&i.toggleAttribute("inert",t)})}closeSheet(){this.open=!1,this.dispatchEvent(new CustomEvent("close"))}focus(){const t=this.querySelector("[autofocus]");t instanceof HTMLElement&&t.focus()}render(){const t="fixed inset-0 z-[999] flex "+(this.open?"":"invisible pointer-events-none"),e="overlay absolute inset-0 bg-surface-container/10 backdrop-blur-xs "+(this.lock?"":"cursor-pointer"),i=this.position===h.SchmancySheetPosition.Side?"content h-full min-w-[320px] max-w-[90vw] w-fit ml-auto overflow-hidden z-10":"content w-full mt-auto rounded-t-2xl max-h-[90vh] overflow-hidden z-10",o=this.position===h.SchmancySheetPosition.Side?"max-h-screen":"max-h-[90vh]";return f.html`
2
2
  <div class=${t} role="dialog" aria-hidden=${!this.open} aria-modal=${this.open} tabindex="0">
3
3
  <div class=${e} @click=${this.handleOverlayClick}></div>
4
4
  <div class=${i}>
@@ -12,4 +12,4 @@
12
12
  </div>
13
13
  </div>
14
14
  `}};var p,u;l([c.property({type:String,reflect:!0})],r.prototype,"uid",2),l([c.property({type:Boolean,reflect:!0})],r.prototype,"open",2),l([c.property({type:String,reflect:!0})],r.prototype,"position",2),l([c.property({type:Boolean,reflect:!0})],r.prototype,"persist",2),l([c.property({type:Boolean,reflect:!0})],r.prototype,"lock",2),l([c.property({type:Boolean,reflect:!0})],r.prototype,"handleHistory",2),l([c.query(".overlay")],r.prototype,"overlayEl",2),l([c.query(".content")],r.prototype,"contentEl",2),l([(p="open",(t,e)=>{const{willUpdate:i}=t;u=Object.assign({waitUntilFirstUpdate:!1},u),t.willUpdate=function(o){if(i.call(this,o),o.has(p)){const s=o.get(p),a=this[p];s!==a&&(u?.waitUntilFirstUpdate&&!this.hasUpdated||this[e].call(this,s,a))}}})],r.prototype,"onOpenChange",1),r=l([c.customElement("schmancy-sheet")],r);
15
- //# sourceMappingURL=sheet-wjDOQ8Hs.cjs.map
15
+ //# sourceMappingURL=sheet-BbrRW0S5.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"sheet-wjDOQ8Hs.cjs","sources":["../src/sheet/sheet.ts","../src/sheet/hook.ts"],"sourcesContent":["import { $LitElement } from '@mixins/index'\nimport { area } from '../area'\nimport { html } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\nimport { fromEvent, merge, takeUntil, tap, filter } from 'rxjs'\nimport { on } from './hook'\nimport style from './sheet.scss?inline'\nimport { SchmancySheetPosition, sheet } from './sheet.service'\n\n@customElement('schmancy-sheet')\nexport default class SchmancySheet extends $LitElement(style) {\n\t@property({ type: String, reflect: true }) uid!: string\n\t@property({ type: Boolean, reflect: true }) open = false\n\t@property({ type: String, reflect: true }) position: SchmancySheetPosition = SchmancySheetPosition.Side\n\t@property({ type: Boolean, reflect: true }) persist = false\n\t@property({ type: Boolean, reflect: true }) lock = false\n\t@property({ type: Boolean, reflect: true }) handleHistory = true\n\n\tprivate lastFocusedElement: HTMLElement | null = null\n\t@query('.overlay') private overlayEl!: HTMLDivElement\n\t@query('.content') private contentEl!: HTMLDivElement\n\n\t@on('open')\n\tonOpenChange(_oldValue: boolean, newValue: boolean) {\n\t\tif (newValue) {\n\t\t\tthis.lastFocusedElement = document.activeElement as HTMLElement\n\t\t\tthis.setBackgroundInert(true)\n\t\t\tthis.animateIn()\n\t\t\tthis.focus()\n\t\t} else {\n\t\t\tthis.animateOut()\n\t\t\tthis.setBackgroundInert(false)\n\t\t\tthis.lastFocusedElement?.focus()\n\t\t\tthis.lastFocusedElement = null\n\t\t}\n\t}\n\n\tprivate animateIn() {\n\t\tif (!this.overlayEl || !this.contentEl) return\n\n\t\tconst timing = {\n\t\t\tduration: 250,\n\t\t\teasing: 'cubic-bezier(0.16, 1, 0.3, 1)',\n\t\t\tfill: 'forwards' as FillMode,\n\t\t}\n\n\t\t// Animate overlay\n\t\tthis.overlayEl.animate([{ opacity: 0 }, { opacity: 0.8 }], timing)\n\n\t\t// Animate content based on position\n\t\tconst transform =\n\t\t\tthis.position === SchmancySheetPosition.Side\n\t\t\t\t? [{ transform: 'translateX(100%)' }, { transform: 'translateX(0)' }]\n\t\t\t\t: [{ transform: 'translateY(100%)' }, { transform: 'translateY(0)' }]\n\n\t\tthis.contentEl.animate(transform, timing)\n\t}\n\n\tprivate animateOut() {\n\t\tif (!this.overlayEl || !this.contentEl) return\n\n\t\tconst timing = {\n\t\t\tduration: 250,\n\t\t\teasing: 'cubic-bezier(0.16, 1, 0.3, 1)',\n\t\t\tfill: 'forwards' as FillMode,\n\t\t}\n\n\t\t// Animate overlay\n\t\tthis.overlayEl.animate([{ opacity: 0.8 }, { opacity: 0 }], timing)\n\n\t\t// Animate content based on position\n\t\tconst transform =\n\t\t\tthis.position === SchmancySheetPosition.Side\n\t\t\t\t? [{ transform: 'translateX(0)' }, { transform: 'translateX(100%)' }]\n\t\t\t\t: [{ transform: 'translateY(0)' }, { transform: 'translateY(100%)' }]\n\n\t\tthis.contentEl.animate(transform, timing)\n\t}\n\n\tconnectedCallback() {\n\t\tsuper.connectedCallback()\n\t\tthis.setupEventListeners()\n\t}\n\n\tdisconnectedCallback() {\n\t\tsuper.disconnectedCallback()\n\t\tthis.disconnecting.next(true)\n\t}\n\n\tprivate setupEventListeners() {\n\t\t// Handle browser back button\n\t\tconst popState$ = fromEvent<PopStateEvent>(window, 'popstate').pipe(\n\t\t\tfilter(() => this.handleHistory),\n\t\t\ttap(e => {\n\t\t\t\te.preventDefault()\n\t\t\t\tthis.closeSheet()\n\t\t\t}),\n\t\t)\n\n\t\t// Handle ESC key\n\t\tconst keyUp$ = fromEvent<KeyboardEvent>(this, 'keydown').pipe(\n\t\t\ttap(event => {\n\t\t\t\tif (event.key === 'Escape' && !this.lock && this.open) {\n\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\tevent.stopPropagation()\n\t\t\t\t\tsheet.dismiss(this.uid)\n\t\t\t\t}\n\t\t\t}),\n\t\t)\n\n\t\t// Handle render events from sheet service\n\t\tconst render$ = fromEvent<CustomEvent>(window, 'schmancy-sheet-render').pipe(\n\t\t\tfilter(e => e.detail.uid === this.uid),\n\t\t\ttap(e => {\n\t\t\t\tarea.push({\n\t\t\t\t\tarea: this.uid,\n\t\t\t\t\tcomponent: e.detail.component,\n\t\t\t\t\tprops: e.detail.props,\n\t\t\t\t\thistoryStrategy: 'silent',\n\t\t\t\t})\n\t\t\t}),\n\t\t)\n\n\t\t// Handle dismiss events from sheet service\n\t\tconst dismiss$ = fromEvent<CustomEvent>(window, 'schmancy-sheet-dismiss').pipe(\n\t\t\tfilter(e => e.detail.uid === this.uid),\n\t\t\ttap(() => {\n\t\t\t\tthis.closeSheet()\n\t\t\t}),\n\t\t)\n\n\t\tmerge(popState$, keyUp$, render$, dismiss$).pipe(takeUntil(this.disconnecting)).subscribe()\n\t}\n\n\tprivate setBackgroundInert(inert: boolean) {\n\t\tconst parent = this.parentElement\n\t\tif (!parent) return\n\n\t\tArray.from(parent.children).forEach(child => {\n\t\t\tif (child !== this && child instanceof HTMLElement) {\n\t\t\t\tchild.toggleAttribute('inert', inert)\n\t\t\t}\n\t\t})\n\t}\n\n\tcloseSheet() {\n\t\tthis.open = false\n\t\tthis.dispatchEvent(new CustomEvent('close'))\n\t}\n\n\toverride focus() {\n\t\t// delegatesFocus in shadowRootOptions handles automatic focus\n\t\t// Just focus first element with autofocus attribute if present\n\t\tconst element = this.querySelector('[autofocus]')\n\t\tif (element instanceof HTMLElement) {\n\t\t\telement.focus()\n\t\t}\n\t}\n\n\tprivate handleOverlayClick = (e: Event) => {\n\t\te.stopPropagation()\n\t\tif (!this.lock) {\n\t\t\tsheet.dismiss(this.uid)\n\t\t}\n\t}\n\n\trender() {\n\t\tconst sheetClasses = `fixed inset-0 z-[999] flex ${this.open ? '' : 'invisible pointer-events-none'}`\n\n\t\tconst overlayClasses = `overlay absolute inset-0 bg-surface-container/10 backdrop-blur-xs ${this.lock ? '' : 'cursor-pointer'}`\n\n\t\tconst contentClasses =\n\t\t\tthis.position === SchmancySheetPosition.Side\n\t\t\t\t? 'content h-full min-w-[320px] max-w-[90vw] w-fit ml-auto overflow-hidden z-10'\n\t\t\t\t: 'content w-full mt-auto rounded-t-2xl max-h-[90vh] overflow-hidden z-10'\n\n\t\tconst bodyClasses = this.position === SchmancySheetPosition.Side ? 'max-h-screen' : 'max-h-[90vh]'\n\n\t\treturn html`\n\t\t\t<div class=${sheetClasses} role=\"dialog\" aria-hidden=${!this.open} aria-modal=${this.open} tabindex=\"0\">\n\t\t\t\t<div class=${overlayClasses} @click=${this.handleOverlayClick}></div>\n\t\t\t\t<div class=${contentClasses}>\n\t\t\t\t\t<schmancy-surface rounded=\"left\" fill=\"all\" id=\"body\" class=\"overflow-auto ${bodyClasses}\" type=\"surface\">\n\t\t\t\t\t\t<schmancy-scroll>\n\t\t\t\t\t\t\t<schmancy-area class=\"h-full\" name=${this.uid}>\n\t\t\t\t\t\t\t\t<slot></slot>\n\t\t\t\t\t\t\t</schmancy-area>\n\t\t\t\t\t\t</schmancy-scroll>\n\t\t\t\t\t</schmancy-surface>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-sheet': SchmancySheet\n\t}\n}\n","// @watch decorator\n//\n// Runs when an observed property changes, e.g. @property or @state, but before the component updates.\n//\n// To wait for an update to complete after a change occurs, use `await this.updateComplete` in the handler. To start\n// watching after the initial update/render, use `{ waitUntilFirstUpdate: true }` or `this.hasUpdated` in the handler.\n//\n// Usage:\n//\n// @watch('propName')\n// handlePropChange(oldValue, newValue) {\n// ...\n// }\n//\ninterface WatchOptions {\n\twaitUntilFirstUpdate?: boolean\n}\n\nexport function on(propName: string, options?: WatchOptions) {\n\treturn (protoOrDescriptor: any, name: string): any => {\n\t\tconst { willUpdate } = protoOrDescriptor\n\n\t\toptions = Object.assign({ waitUntilFirstUpdate: false }, options) as WatchOptions\n\n\t\tprotoOrDescriptor.willUpdate = function (changedProps: Map<string, any>) {\n\t\t\twillUpdate.call(this, changedProps)\n\n\t\t\tif (changedProps.has(propName)) {\n\t\t\t\tconst oldValue = changedProps.get(propName)\n\t\t\t\tconst newValue = this[propName]\n\n\t\t\t\tif (oldValue !== newValue) {\n\t\t\t\t\tif (!options?.waitUntilFirstUpdate || this.hasUpdated) {\n\t\t\t\t\t\tthis[name].call(this, oldValue, newValue)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n"],"names":["SchmancySheet","$LitElement","constructor","super","arguments","this","open","position","SchmancySheetPosition","Side","persist","lock","handleHistory","lastFocusedElement","handleOverlayClick","e","stopPropagation","sheet","dismiss","uid","_oldValue","newValue","document","activeElement","setBackgroundInert","animateIn","focus","animateOut","overlayEl","contentEl","timing","duration","easing","fill","animate","opacity","transform","connectedCallback","setupEventListeners","disconnectedCallback","disconnecting","next","popState$","fromEvent","window","pipe","filter","tap","preventDefault","closeSheet","keyUp$","event","key","render$","detail","area","push","component","props","historyStrategy","dismiss$","merge","takeUntil","subscribe","inert","parent","parentElement","Array","from","children","forEach","child","HTMLElement","toggleAttribute","dispatchEvent","CustomEvent","element","querySelector","render","sheetClasses","overlayClasses","contentClasses","bodyClasses","html","propName","options","__decorateClass","property","type","String","reflect","prototype","Boolean","query","protoOrDescriptor","name","willUpdate","Object","assign","waitUntilFirstUpdate","changedProps","call","has","oldValue","get","hasUpdated","customElement"],"mappings":"ojBAUA,IAAqBA,EAArB,cAA2CC,sCAA3C,aAAAC,CAAAC,MAAAA,GAAAC,SAAAA,EAE6CC,KAAAC,KAAAA,GACDD,KAAAE,SAAkCC,EAAAA,sBAAsBC,KAC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A,cAAc,gBAAA,CAAA,EACM1G,CAAAA"}
1
+ {"version":3,"file":"sheet-BbrRW0S5.cjs","sources":["../src/sheet/sheet.ts","../src/sheet/hook.ts"],"sourcesContent":["import { $LitElement } from '@mixins/index'\nimport { area } from '../area'\nimport { html } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\nimport { fromEvent, merge, takeUntil, tap, filter } from 'rxjs'\nimport { on } from './hook'\nimport style from './sheet.scss?inline'\nimport { SchmancySheetPosition, sheet } from './sheet.service'\n\n@customElement('schmancy-sheet')\nexport default class SchmancySheet extends $LitElement(style) {\n\t@property({ type: String, reflect: true }) uid!: string\n\t@property({ type: Boolean, reflect: true }) open = false\n\t@property({ type: String, reflect: true }) position: SchmancySheetPosition = SchmancySheetPosition.Side\n\t@property({ type: Boolean, reflect: true }) persist = false\n\t@property({ type: Boolean, reflect: true }) lock = false\n\t@property({ type: Boolean, reflect: true }) handleHistory = true\n\n\tprivate lastFocusedElement: HTMLElement | null = null\n\t@query('.overlay') private overlayEl!: HTMLDivElement\n\t@query('.content') private contentEl!: HTMLDivElement\n\n\t@on('open')\n\tonOpenChange(_oldValue: boolean, newValue: boolean) {\n\t\tif (newValue) {\n\t\t\tthis.lastFocusedElement = document.activeElement as HTMLElement\n\t\t\tthis.setBackgroundInert(true)\n\t\t\tthis.animateIn()\n\t\t\tthis.focus()\n\t\t} else {\n\t\t\tthis.animateOut()\n\t\t\tthis.setBackgroundInert(false)\n\t\t\tthis.lastFocusedElement?.focus()\n\t\t\tthis.lastFocusedElement = null\n\t\t}\n\t}\n\n\tprivate animateIn() {\n\t\tif (!this.overlayEl || !this.contentEl) return\n\n\t\tconst timing = {\n\t\t\tduration: 250,\n\t\t\teasing: 'cubic-bezier(0.16, 1, 0.3, 1)',\n\t\t\tfill: 'forwards' as FillMode,\n\t\t}\n\n\t\t// Animate overlay\n\t\tthis.overlayEl.animate([{ opacity: 0 }, { opacity: 0.8 }], timing)\n\n\t\t// Animate content based on position\n\t\tconst transform =\n\t\t\tthis.position === SchmancySheetPosition.Side\n\t\t\t\t? [{ transform: 'translateX(100%)' }, { transform: 'translateX(0)' }]\n\t\t\t\t: [{ transform: 'translateY(100%)' }, { transform: 'translateY(0)' }]\n\n\t\tthis.contentEl.animate(transform, timing)\n\t}\n\n\tprivate animateOut() {\n\t\tif (!this.overlayEl || !this.contentEl) return\n\n\t\tconst timing = {\n\t\t\tduration: 250,\n\t\t\teasing: 'cubic-bezier(0.16, 1, 0.3, 1)',\n\t\t\tfill: 'forwards' as FillMode,\n\t\t}\n\n\t\t// Animate overlay\n\t\tthis.overlayEl.animate([{ opacity: 0.8 }, { opacity: 0 }], timing)\n\n\t\t// Animate content based on position\n\t\tconst transform =\n\t\t\tthis.position === SchmancySheetPosition.Side\n\t\t\t\t? [{ transform: 'translateX(0)' }, { transform: 'translateX(100%)' }]\n\t\t\t\t: [{ transform: 'translateY(0)' }, { transform: 'translateY(100%)' }]\n\n\t\tthis.contentEl.animate(transform, timing)\n\t}\n\n\tconnectedCallback() {\n\t\tsuper.connectedCallback()\n\t\tthis.setupEventListeners()\n\t}\n\n\tdisconnectedCallback() {\n\t\tsuper.disconnectedCallback()\n\t\tthis.disconnecting.next(true)\n\t}\n\n\tprivate setupEventListeners() {\n\t\t// Handle browser back button\n\t\tconst popState$ = fromEvent<PopStateEvent>(window, 'popstate').pipe(\n\t\t\tfilter(() => this.handleHistory),\n\t\t\ttap(e => {\n\t\t\t\te.preventDefault()\n\t\t\t\tthis.closeSheet()\n\t\t\t}),\n\t\t)\n\n\t\t// Handle ESC key\n\t\tconst keyUp$ = fromEvent<KeyboardEvent>(this, 'keydown').pipe(\n\t\t\ttap(event => {\n\t\t\t\tif (event.key === 'Escape' && !this.lock && this.open) {\n\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\tevent.stopPropagation()\n\t\t\t\t\tsheet.dismiss(this.uid)\n\t\t\t\t}\n\t\t\t}),\n\t\t)\n\n\t\t// Handle render events from sheet service\n\t\tconst render$ = fromEvent<CustomEvent>(window, 'schmancy-sheet-render').pipe(\n\t\t\tfilter(e => e.detail.uid === this.uid),\n\t\t\ttap(e => {\n\t\t\t\tarea.push({\n\t\t\t\t\tarea: this.uid,\n\t\t\t\t\tcomponent: e.detail.component,\n\t\t\t\t\tprops: e.detail.props,\n\t\t\t\t\thistoryStrategy: 'silent',\n\t\t\t\t})\n\t\t\t}),\n\t\t)\n\n\t\t// Handle dismiss events from sheet service\n\t\tconst dismiss$ = fromEvent<CustomEvent>(window, 'schmancy-sheet-dismiss').pipe(\n\t\t\tfilter(e => e.detail.uid === this.uid),\n\t\t\ttap(() => {\n\t\t\t\tthis.closeSheet()\n\t\t\t}),\n\t\t)\n\n\t\tmerge(popState$, keyUp$, render$, dismiss$).pipe(takeUntil(this.disconnecting)).subscribe()\n\t}\n\n\tprivate setBackgroundInert(inert: boolean) {\n\t\tconst parent = this.parentElement\n\t\tif (!parent) return\n\n\t\tArray.from(parent.children).forEach(child => {\n\t\t\tif (child !== this && child instanceof HTMLElement) {\n\t\t\t\tchild.toggleAttribute('inert', inert)\n\t\t\t}\n\t\t})\n\t}\n\n\tcloseSheet() {\n\t\tthis.open = false\n\t\tthis.dispatchEvent(new CustomEvent('close'))\n\t}\n\n\toverride focus() {\n\t\t// delegatesFocus in shadowRootOptions handles automatic focus\n\t\t// Just focus first element with autofocus attribute if present\n\t\tconst element = this.querySelector('[autofocus]')\n\t\tif (element instanceof HTMLElement) {\n\t\t\telement.focus()\n\t\t}\n\t}\n\n\tprivate handleOverlayClick = (e: Event) => {\n\t\te.stopPropagation()\n\t\tif (!this.lock) {\n\t\t\tsheet.dismiss(this.uid)\n\t\t}\n\t}\n\n\trender() {\n\t\tconst sheetClasses = `fixed inset-0 z-[999] flex ${this.open ? '' : 'invisible pointer-events-none'}`\n\n\t\tconst overlayClasses = `overlay absolute inset-0 bg-surface-container/10 backdrop-blur-xs ${this.lock ? '' : 'cursor-pointer'}`\n\n\t\tconst contentClasses =\n\t\t\tthis.position === SchmancySheetPosition.Side\n\t\t\t\t? 'content h-full min-w-[320px] max-w-[90vw] w-fit ml-auto overflow-hidden z-10'\n\t\t\t\t: 'content w-full mt-auto rounded-t-2xl max-h-[90vh] overflow-hidden z-10'\n\n\t\tconst bodyClasses = this.position === SchmancySheetPosition.Side ? 'max-h-screen' : 'max-h-[90vh]'\n\n\t\treturn html`\n\t\t\t<div class=${sheetClasses} role=\"dialog\" aria-hidden=${!this.open} aria-modal=${this.open} tabindex=\"0\">\n\t\t\t\t<div class=${overlayClasses} @click=${this.handleOverlayClick}></div>\n\t\t\t\t<div class=${contentClasses}>\n\t\t\t\t\t<schmancy-surface rounded=\"left\" fill=\"all\" id=\"body\" class=\"overflow-auto ${bodyClasses}\" type=\"surface\">\n\t\t\t\t\t\t<schmancy-scroll>\n\t\t\t\t\t\t\t<schmancy-area class=\"h-full\" name=${this.uid}>\n\t\t\t\t\t\t\t\t<slot></slot>\n\t\t\t\t\t\t\t</schmancy-area>\n\t\t\t\t\t\t</schmancy-scroll>\n\t\t\t\t\t</schmancy-surface>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-sheet': SchmancySheet\n\t}\n}\n","// @watch decorator\n//\n// Runs when an observed property changes, e.g. @property or @state, but before the component updates.\n//\n// To wait for an update to complete after a change occurs, use `await this.updateComplete` in the handler. To start\n// watching after the initial update/render, use `{ waitUntilFirstUpdate: true }` or `this.hasUpdated` in the handler.\n//\n// Usage:\n//\n// @watch('propName')\n// handlePropChange(oldValue, newValue) {\n// ...\n// }\n//\ninterface WatchOptions {\n\twaitUntilFirstUpdate?: boolean\n}\n\nexport function on(propName: string, options?: WatchOptions) {\n\treturn (protoOrDescriptor: any, name: string): any => {\n\t\tconst { willUpdate } = protoOrDescriptor\n\n\t\toptions = Object.assign({ waitUntilFirstUpdate: false }, options) as WatchOptions\n\n\t\tprotoOrDescriptor.willUpdate = function (changedProps: Map<string, any>) {\n\t\t\twillUpdate.call(this, changedProps)\n\n\t\t\tif (changedProps.has(propName)) {\n\t\t\t\tconst oldValue = changedProps.get(propName)\n\t\t\t\tconst newValue = this[propName]\n\n\t\t\t\tif (oldValue !== newValue) {\n\t\t\t\t\tif (!options?.waitUntilFirstUpdate || this.hasUpdated) {\n\t\t\t\t\t\tthis[name].call(this, oldValue, newValue)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n"],"names":["SchmancySheet","$LitElement","constructor","super","arguments","this","open","position","SchmancySheetPosition","Side","persist","lock","handleHistory","lastFocusedElement","handleOverlayClick","e","stopPropagation","sheet","dismiss","uid","_oldValue","newValue","document","activeElement","setBackgroundInert","animateIn","focus","animateOut","overlayEl","contentEl","timing","duration","easing","fill","animate","opacity","transform","connectedCallback","setupEventListeners","disconnectedCallback","disconnecting","next","popState$","fromEvent","window","pipe","filter","tap","preventDefault","closeSheet","keyUp$","event","key","render$","detail","area","push","component","props","historyStrategy","dismiss$","merge","takeUntil","subscribe","inert","parent","parentElement","Array","from","children","forEach","child","HTMLElement","toggleAttribute","dispatchEvent","CustomEvent","element","querySelector","render","sheetClasses","overlayClasses","contentClasses","bodyClasses","html","propName","options","__decorateClass","property","type","String","reflect","prototype","Boolean","query","protoOrDescriptor","name","willUpdate","Object","assign","waitUntilFirstUpdate","changedProps","call","has","oldValue","get","hasUpdated","customElement"],"mappings":"ojBAUA,IAAqBA,EAArB,cAA2CC,sCAA3C,aAAAC,CAAAC,MAAAA,GAAAC,SAAAA,EAE6CC,KAAAC,KAAAA,GACDD,KAAAE,SAAkCC,EAAAA,sBAAsBC,KACvDJ,KAAAK,QAAAA,GACAL,KAAAM,KAAAA,GACAN,KAAAO,cAAAA,GAE5CP,KAAQQ,mBAAyC,KA6IjDR,KAAQS,mBAAsBC,GAAAA,CAC7BA,EAAEC,gBAAAA,EACGX,KAAKM,MACTM,QAAMC,QAAQb,KAAKc,GAAAA,CAAAA,CAErB,CA7IA,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F,QAAAA,EAAS,CAAA,CAAA,EAJhB1F,EAIwB2F,UAAA,UAAA,CAAA,EACAL,EAAA,CAA3CC,EAAAA,SAAS,CAAEC,KAAMI,QAASF,QAAAA,EAAS,CAAA,CAAA,EALhB1F,EAKwB2F,UAAA,OAAA,CAAA,EACAL,EAAA,CAA3CC,EAAAA,SAAS,CAAEC,KAAMI,QAASF,QAAAA,EAAS,CAAA,CAAA,EANhB1F,EAMwB2F,UAAA,gBAAA,CAAA,EAGjBL,EAAA,CAA1BO,EAAAA,MAAM,UAAA,CAAA,EATa7F,EASO2F,UAAA,YAAA,CAAA,EACAL,EAAA,CAA1BO,EAAAA,MAAM,UAAA,CAAA,EAVa7F,EAUO2F,UAAA,YAAA,CAAA,EAG3BL,EAAA,ECLkBF,EDId,OCHG,CAACU,EAAwBC,IAAAA,CAC/B,KAAA,CAAMC,WAAEA,CAAAA,EAAeF,EAEvBT,EAAUY,OAAOC,OAAO,CAAEC,qBAAAA,IAA+Bd,CAAAA,EAEzDS,EAAkBE,WAAa,SAAUI,EAAAA,CAGxC,GAFAJ,EAAWK,KAAKhG,KAAM+F,CAAAA,EAElBA,EAAaE,IAAIlB,GAAW,CAC/B,MAAMmB,EAAWH,EAAaI,IAAIpB,CAAAA,EAC5B/D,EAAWhB,KAAK+E,CAAAA,EAElBmB,IAAalF,IACXgE,GAASc,sBAAAA,CAAwB9F,KAAKoG,YAC1CpG,KAAK0F,CAAAA,EAAMM,KAAKhG,KAAMkG,EAAUlF,GAGnC,CACD,CAAA,EAAA,ED3BmBrB,EAapB2F,UAAA,eAAA,CAAA,EAboB3F,EAArBsF,EAAA,CADCoB,EAAAA,cAAc,gBAAA,CAAA,EACM1G,CAAAA"}
package/dist/sheet.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./sheet.service-DfHrOxyc.cjs");require("./sheet-wjDOQ8Hs.cjs"),exports.SchmancySheetPosition=e.SchmancySheetPosition,exports.sheet=e.sheet;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./sheet.service-BiRZjCdN.cjs");require("./sheet-BbrRW0S5.cjs"),exports.SchmancySheetPosition=e.SchmancySheetPosition,exports.sheet=e.sheet;
2
2
  //# sourceMappingURL=sheet.cjs.map
package/dist/sheet.js CHANGED
@@ -1,5 +1,5 @@
1
- import { S as t, s as a } from "./sheet.service-BvOiOFMm.js";
2
- import "./sheet-DovyNsok.js";
1
+ import { S as t, s as a } from "./sheet.service-4etIM-p6.js";
2
+ import "./sheet-B1g7E4dQ.js";
3
3
  export {
4
4
  t as SchmancySheetPosition,
5
5
  a as sheet
@@ -1,28 +1,30 @@
1
- import { Subject as u, switchMap as r, map as a, of as m, tap as h, delay as n, fromEvent as c, take as S } from "rxjs";
2
- import { d as p } from "./tailwind.mixin-DIW0B_of.js";
3
- var b = ((e) => (e.Side = "side", e.Bottom = "bottom", e))(b || {});
4
- const w = new class {
1
+ import { Subject as m, switchMap as a, map as h, of as S, tap as n, delay as r, fromEvent as c, take as b } from "rxjs";
2
+ import "./sound.service-Nza4c6wv.js";
3
+ import { $ as p } from "./emotional-sounds-BRnFhww6.js";
4
+ import { d } from "./tailwind.mixin-Ddt05Frc.js";
5
+ var l = ((e) => (e.Side = "side", e.Bottom = "bottom", e))(l || {});
6
+ const f = new class {
5
7
  constructor() {
6
- this.bottomSheet = new u(), this.activeSheets = /* @__PURE__ */ new Set(), this.popStateListenerActive = !1, this.setupSheetOpeningLogic(), this.setupPopStateListener();
8
+ this.bottomSheet = new m(), this.activeSheets = /* @__PURE__ */ new Set(), this.popStateListenerActive = !1, this.setupSheetOpeningLogic(), this.setupPopStateListener();
7
9
  }
8
10
  setupSheetOpeningLogic() {
9
- this.bottomSheet.pipe(r((e) => {
11
+ this.bottomSheet.pipe(a((e) => {
10
12
  const t = e.uid ?? `sheet-${Date.now()}`;
11
- return p("schmancy-sheet").pipe(a((s) => {
13
+ return d("schmancy-sheet").pipe(h((s) => {
12
14
  const i = s?.getAttribute("uid") === t ? s : null;
13
15
  return { target: e, existingSheet: i, uid: t };
14
16
  }));
15
- }), r(({ target: e, existingSheet: t, uid: s }) => t ? m({ target: e, sheet: t, uid: s }) : p("schmancy-theme").pipe(a((i) => {
16
- const d = i || document.body, o = document.createElement("schmancy-sheet");
17
- return o.setAttribute("uid", s), d.appendChild(o), { target: e, sheet: o, uid: s };
18
- }))), h(({ target: e, sheet: t }) => {
17
+ }), a(({ target: e, existingSheet: t, uid: s }) => t ? S({ target: e, sheet: t, uid: s }) : d("schmancy-theme").pipe(h((i) => {
18
+ const u = i || document.body, o = document.createElement("schmancy-sheet");
19
+ return o.setAttribute("uid", s), u.appendChild(o), { target: e, sheet: o, uid: s };
20
+ }))), n(({ target: e, sheet: t }) => {
19
21
  e.lock && t.setAttribute("lock", "true");
20
22
  const s = e.position || (window.innerWidth >= 768 ? "side" : "bottom");
21
23
  t.setAttribute("position", s), e.persist && t.setAttribute("persist", String(e.persist)), document.body.style.overflow = "hidden";
22
- }), n(20), h(({ target: e, uid: t }) => {
24
+ }), r(20), n(({ target: e, uid: t }) => {
23
25
  window.dispatchEvent(new CustomEvent("schmancy-sheet-render", { detail: { component: e.component, uid: t, props: e.props }, bubbles: !0, composed: !0 }));
24
- }), n(1), h(({ sheet: e, uid: t }) => {
25
- e.setAttribute("open", "true"), this.activeSheets.add(t), c(e, "close").pipe(S(1), n(300)).subscribe(() => {
26
+ }), r(1), n(({ sheet: e, uid: t }) => {
27
+ e.setAttribute("open", "true"), p.play("curious"), this.activeSheets.add(t), c(e, "close").pipe(b(1), r(300)).subscribe(() => {
26
28
  this.activeSheets.delete(t);
27
29
  const s = e.getAttribute("persist");
28
30
  (!s || s === "false") && e.remove(), document.body.style.overflow = "auto";
@@ -42,7 +44,7 @@ const w = new class {
42
44
  const t = Array.from(this.activeSheets);
43
45
  e = t[t.length - 1];
44
46
  }
45
- e && (window.dispatchEvent(new CustomEvent("schmancy-sheet-dismiss", { detail: { uid: e }, bubbles: !0, composed: !0 })), this.activeSheets.delete(e));
47
+ e && (p.play("atEase"), window.dispatchEvent(new CustomEvent("schmancy-sheet-dismiss", { detail: { uid: e }, bubbles: !0, composed: !0 })), this.activeSheets.delete(e));
46
48
  }
47
49
  open(e) {
48
50
  this.bottomSheet.next(e);
@@ -60,7 +62,7 @@ const w = new class {
60
62
  }
61
63
  }();
62
64
  export {
63
- b as S,
64
- w as s
65
+ l as S,
66
+ f as s
65
67
  };
66
- //# sourceMappingURL=sheet.service-BvOiOFMm.js.map
68
+ //# sourceMappingURL=sheet.service-4etIM-p6.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sheet.service-4etIM-p6.js","sources":["../src/sheet/sheet.service.ts"],"sourcesContent":["import {\n\tdelay,\n\tfromEvent,\n\tmap,\n\tof,\n\tSubject,\n\tswitchMap,\n\ttake,\n\ttap,\n} from 'rxjs'\nimport { $sounds } from '../audio'\nimport { ComponentType } from '../area/router.types'\nimport { discoverComponent } from '@mixins/discovery.service'\nimport SchmancySheet from './sheet'\n\nexport enum SchmancySheetPosition {\n\tSide = 'side',\n\tBottom = 'bottom',\n}\n\nexport type SheetConfig = {\n\tcomponent: ComponentType\n\tuid?: string\n\tposition?: SchmancySheetPosition\n\tpersist?: boolean\n\tclose?: () => void\n\tlock?: boolean // Controls both ESC and overlay click dismissal\n\tonBeforeOpen?: (component: HTMLElement) => void\n\tonAfterOpen?: (component: HTMLElement) => void\n\tprops?: Record<string, unknown> // Properties to pass to the component\n}\n\n// Keep old name for backward compatibility\ntype BottomSheeetTarget = SheetConfig\n\n// Function to determine the position based on screen size\nconst getPosition = (): SchmancySheetPosition => {\n\treturn window.innerWidth >= 768 ? SchmancySheetPosition.Side : SchmancySheetPosition.Bottom // Adjust 768 as needed for your breakpoint\n}\n\nclass BottomSheetService {\n\tbottomSheet = new Subject<BottomSheeetTarget>()\n\t// Track currently open sheets\n\tprivate activeSheets = new Set<string>()\n\t// To track if we've set up the popstate listener\n\tprivate popStateListenerActive = false\n\n\tconstructor() {\n\t\tthis.setupSheetOpeningLogic()\n\t\tthis.setupPopStateListener()\n\t}\n\n\t/**\n\t * Sets up the main sheet opening logic\n\t */\n\tprivate setupSheetOpeningLogic() {\n\t\tthis.bottomSheet\n\t\t\t.pipe(\n\t\t\t\tswitchMap(target => {\n\t\t\t\t\tconst uid = target.uid ?? `sheet-${Date.now()}`\n\n\t\t\t\t\t// Discover existing sheet with this uid\n\t\t\t\t\treturn discoverComponent<SchmancySheet>('schmancy-sheet').pipe(\n\t\t\t\t\t\tmap(existingSheet => {\n\t\t\t\t\t\t\t// Check if discovered sheet matches our uid\n\t\t\t\t\t\t\tconst sheet = existingSheet?.getAttribute('uid') === uid ? existingSheet : null\n\t\t\t\t\t\t\treturn { target, existingSheet: sheet, uid }\n\t\t\t\t\t\t})\n\t\t\t\t\t)\n\t\t\t\t}),\n\t\t\t\tswitchMap(({ target, existingSheet, uid }) => {\n\t\t\t\t\t// Discover theme container if creating new sheet\n\t\t\t\t\tif (existingSheet) {\n\t\t\t\t\t\treturn of({ target, sheet: existingSheet, uid })\n\t\t\t\t\t}\n\n\t\t\t\t\treturn discoverComponent<HTMLElement>('schmancy-theme').pipe(\n\t\t\t\t\t\tmap(theme => {\n\t\t\t\t\t\t\t// Determine container - use theme or fallback to body\n\t\t\t\t\t\t\tconst targetContainer = theme || document.body\n\n\t\t\t\t\t\t\t// Create new sheet\n\t\t\t\t\t\t\tconst sheet = document.createElement('schmancy-sheet')\n\t\t\t\t\t\t\tsheet.setAttribute('uid', uid)\n\t\t\t\t\t\t\ttargetContainer.appendChild(sheet)\n\n\t\t\t\t\t\t\treturn { target, sheet: sheet as SchmancySheet, uid }\n\t\t\t\t\t\t})\n\t\t\t\t\t)\n\t\t\t\t}),\n\t\t\t\ttap(({ target, sheet }) => {\n\t\t\t\t\t// Configure sheet attributes\n\t\t\t\t\tif (target.lock) sheet.setAttribute('lock', 'true')\n\n\t\t\t\t\tconst position = target.position || getPosition()\n\t\t\t\t\tsheet.setAttribute('position', position)\n\n\t\t\t\t\tif (target.persist) sheet.setAttribute('persist', String(target.persist))\n\n\t\t\t\t\tdocument.body.style.overflow = 'hidden' // lock the scroll of the host\n\t\t\t\t}),\n\t\t\t\tdelay(20),\n\t\t\t\ttap(({ target, uid }) => {\n\t\t\t\t\t// Dispatch render event - area router handles duplicate prevention\n\t\t\t\t\twindow.dispatchEvent(\n\t\t\t\t\t\tnew CustomEvent('schmancy-sheet-render', {\n\t\t\t\t\t\t\tdetail: {\n\t\t\t\t\t\t\t\tcomponent: target.component,\n\t\t\t\t\t\t\t\tuid,\n\t\t\t\t\t\t\t\tprops: target.props\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t\t}),\n\t\t\t\t\t)\n\t\t\t\t}),\n\t\t\t\tdelay(1),\n\t\t\t\ttap(({ sheet, uid }) => {\n\t\t\t\t\tsheet.setAttribute('open', 'true')\n\t\t\t\t\t$sounds.play('curious')\n\n\t\t\t\t\t// Add to active sheets tracking\n\t\t\t\t\tthis.activeSheets.add(uid)\n\n\t\t\t\t\t// Set up close event listener\n\t\t\t\t\tfromEvent<CustomEvent>(sheet, 'close')\n\t\t\t\t\t\t.pipe(take(1), delay(300))\n\t\t\t\t\t\t.subscribe(() => {\n\t\t\t\t\t\t\t// Remove from active sheets tracking\n\t\t\t\t\t\t\tthis.activeSheets.delete(uid)\n\n\t\t\t\t\t\t\t// Only keep sheet if persist is explicitly set to a truthy value\n\t\t\t\t\t\t\tconst persistAttr = sheet.getAttribute('persist')\n\t\t\t\t\t\t\tconst shouldRemove = !persistAttr || persistAttr === 'false'\n\n\t\t\t\t\t\t\tif (shouldRemove) {\n\t\t\t\t\t\t\t\tsheet.remove()\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tdocument.body.style.overflow = 'auto' // unlock the scroll of the host\n\t\t\t\t\t\t})\n\t\t\t\t}),\n\t\t\t)\n\t\t\t.subscribe()\n\t}\n\n\t/**\n\t * Sets up the popstate listener to handle browser back button\n\t */\n\tprivate setupPopStateListener() {\n\t\tif (this.popStateListenerActive) return\n\n\t\tfromEvent<PopStateEvent>(window, 'popstate').subscribe(event => {\n\t\t\t// If we have active sheets, close the most recently opened one\n\t\t\tif (this.activeSheets.size > 0) {\n\t\t\t\t// Get the last sheet (Set maintains insertion order)\n\t\t\t\tconst lastSheet = Array.from(this.activeSheets).pop()\n\t\t\t\tif (lastSheet) {\n\t\t\t\t\tthis.dismiss(lastSheet)\n\n\t\t\t\t\t// Prevent default navigation behavior by pushing a new state\n\t\t\t\t\t// This effectively cancels out the back navigation\n\t\t\t\t\tif (event.state && event.state.schmancySheet) {\n\t\t\t\t\t\thistory.pushState({}, '', window.location.href)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\n\t\tthis.popStateListenerActive = true\n\t}\n\n\t/**\n\t * Dismiss a sheet by uid, or dismiss the most recently opened sheet if no uid provided\n\t */\n\tdismiss(uid?: string) {\n\t\tif (!uid && this.activeSheets.size > 0) {\n\t\t\t// Get the last sheet opened (Set maintains insertion order)\n\t\t\tconst sheetsArray = Array.from(this.activeSheets)\n\t\t\tuid = sheetsArray[sheetsArray.length - 1]\n\t\t}\n\n\t\tif (uid) {\n\t\t\t$sounds.play('atEase')\n\t\t\twindow.dispatchEvent(\n\t\t\t\tnew CustomEvent('schmancy-sheet-dismiss', {\n\t\t\t\t\tdetail: { uid },\n\t\t\t\t\tbubbles: true,\n\t\t\t\t\tcomposed: true,\n\t\t\t\t})\n\t\t\t)\n\t\t\tthis.activeSheets.delete(uid)\n\t\t}\n\t}\n\n\t/**\n\t * Open a sheet with the given target configuration\n\t * @deprecated Use `push` instead for consistency with area router API\n\t */\n\topen(target: BottomSheeetTarget) {\n\t\tthis.bottomSheet.next(target)\n\t}\n\n\t/**\n\t * Push a component to the sheet (recommended method)\n\t * Follows the same API pattern as area.push for consistency\n\t */\n\tpush(target: BottomSheeetTarget) {\n\t\tthis.bottomSheet.next(target)\n\t}\n\n\t/**\n\t * Check if a sheet is currently open by uid\n\t */\n\tisOpen(uid: string): boolean {\n\t\treturn this.activeSheets.has(uid)\n\t}\n\n\t/**\n\t * Close all open sheets\n\t */\n\tcloseAll() {\n\t\t// Copy the set to avoid modification during iteration\n\t\tArray.from(this.activeSheets).forEach(uid => {\n\t\t\tthis.dismiss(uid)\n\t\t})\n\t}\n\n}\nexport const sheet = new BottomSheetService()\n"],"names":["SchmancySheetPosition","sheet","constructor","this","bottomSheet","Subject","activeSheets","Set","popStateListenerActive","setupSheetOpeningLogic","setupPopStateListener","pipe","switchMap","target","uid","Date","now","discoverComponent","map","existingSheet","getAttribute","of","theme","targetContainer","document","body","createElement","setAttribute","appendChild","tap","lock","position","window","innerWidth","persist","String","style","overflow","delay","dispatchEvent","CustomEvent","detail","component","props","bubbles","composed","$sounds","play","add","fromEvent","take","subscribe","delete","persistAttr","remove","event","size","lastSheet","Array","from","pop","dismiss","state","schmancySheet","history","pushState","location","href","sheetsArray","length","next","has","closeAll","forEach"],"mappings":";;;;AAeO,IAAKA,KAAAA,CAAAA,OACXA,EAAA,OAAO,QACPA,EAAA,SAAS,UAFEA,IAAAA,KAAA,CAAA,CAAA;AAsNL,MAAMC,IAAQ,IA7LrB;EAOC,cAAAC;AANAC,SAAAC,cAAc,IAAIC,KAElBF,KAAQG,mCAAmBC,OAE3BJ,KAAQK,yBAAAA,IAGPL,KAAKM,uBAAAA,GACLN,KAAKO;EACN;AAAA,EAKQ;AACPP,SAAKC,YACHO,KACAC,EAAUC,CAAAA;AACT,YAAMC,IAAMD,EAAOC,OAAO,SAASC,KAAKC,IAAAA,CAAAA;AAGxC,aAAOC,EAAiC,gBAAA,EAAkBN,KACzDO,EAAIC,CAAAA,MAAAA;AAEH,cAAMlB,IAAQkB,GAAeC,aAAa,KAAA,MAAWN,IAAMK,IAAgB;AAC3E,eAAO,EAAEN,QAAAA,GAAQM,e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