@mhmo91/schmancy 0.10.30 → 0.10.31

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 (325) hide show
  1. package/dist/{SchmancyElement-DhSiMp6Y.cjs → SchmancyElement-D8_z9JrW.cjs} +1 -1
  2. package/dist/{SchmancyElement-DhSiMp6Y.cjs.map → SchmancyElement-D8_z9JrW.cjs.map} +1 -1
  3. package/dist/{SchmancyElement-BQ4DFufc.js → SchmancyElement-DuzT2AMa.js} +16 -32
  4. package/dist/{SchmancyElement-BQ4DFufc.js.map → SchmancyElement-DuzT2AMa.js.map} +1 -1
  5. package/dist/agent/schmancy.agent.js +1770 -1793
  6. package/dist/agent/schmancy.agent.js.map +1 -1
  7. package/dist/{area-BjpUWvzE.js → area-0l8V7HlF.js} +7 -7
  8. package/dist/{area-BjpUWvzE.js.map → area-0l8V7HlF.js.map} +1 -1
  9. package/dist/{area-CgTzkxah.cjs → area-WGfTrwcJ.cjs} +3 -3
  10. package/dist/{area-CgTzkxah.cjs.map → area-WGfTrwcJ.cjs.map} +1 -1
  11. package/dist/area.cjs +1 -1
  12. package/dist/area.js +1 -1
  13. package/dist/{audio-DISBFOaR.cjs → audio-9QLk4pU-.cjs} +1 -1
  14. package/dist/{audio-DISBFOaR.cjs.map → audio-9QLk4pU-.cjs.map} +1 -1
  15. package/dist/{audio-CwBJntnB.js → audio-x9oLVKBH.js} +1 -1
  16. package/dist/{audio-CwBJntnB.js.map → audio-x9oLVKBH.js.map} +1 -1
  17. package/dist/audio.cjs +1 -1
  18. package/dist/audio.js +2 -2
  19. package/dist/{autocomplete-DbCUOgWU.cjs → autocomplete-CjjfXbJC.cjs} +2 -2
  20. package/dist/{autocomplete-DbCUOgWU.cjs.map → autocomplete-CjjfXbJC.cjs.map} +1 -1
  21. package/dist/{autocomplete-Dy708jem.js → autocomplete-sjZovPcs.js} +3 -3
  22. package/dist/{autocomplete-Dy708jem.js.map → autocomplete-sjZovPcs.js.map} +1 -1
  23. package/dist/autocomplete.cjs +1 -1
  24. package/dist/autocomplete.js +1 -1
  25. package/dist/avatar.cjs +2 -2
  26. package/dist/avatar.js +5 -5
  27. package/dist/badge.cjs +1 -1
  28. package/dist/badge.js +1 -1
  29. package/dist/{boat-Z4Lzl3ai.js → boat-CEaQaCmG.js} +8 -8
  30. package/dist/{boat-Z4Lzl3ai.js.map → boat-CEaQaCmG.js.map} +1 -1
  31. package/dist/{boat-BzZN_iwp.cjs → boat-CI5rcGS5.cjs} +2 -2
  32. package/dist/{boat-BzZN_iwp.cjs.map → boat-CI5rcGS5.cjs.map} +1 -1
  33. package/dist/boat.cjs +1 -1
  34. package/dist/boat.js +1 -1
  35. package/dist/breadcrumb.cjs +3 -3
  36. package/dist/breadcrumb.js +7 -7
  37. package/dist/{busy-Cu-47DfN.cjs → busy-DDKXlzDA.cjs} +3 -3
  38. package/dist/{busy-Cu-47DfN.cjs.map → busy-DDKXlzDA.cjs.map} +1 -1
  39. package/dist/{busy-CRFGPkcP.js → busy-DwD-XHqS.js} +7 -7
  40. package/dist/{busy-CRFGPkcP.js.map → busy-DwD-XHqS.js.map} +1 -1
  41. package/dist/busy.cjs +1 -1
  42. package/dist/busy.js +1 -1
  43. package/dist/{button-D_USF3tt.js → button-BnGN6SsV.js} +10 -10
  44. package/dist/{button-D_USF3tt.js.map → button-BnGN6SsV.js.map} +1 -1
  45. package/dist/{button-CN_JTjRd.cjs → button-DlqCWuk-.cjs} +2 -2
  46. package/dist/{button-CN_JTjRd.cjs.map → button-DlqCWuk-.cjs.map} +1 -1
  47. package/dist/button.cjs +2 -2
  48. package/dist/button.js +9 -9
  49. package/dist/{card-DpN5KIYc.js → card-D3IxxBBP.js} +15 -15
  50. package/dist/{card-DpN5KIYc.js.map → card-D3IxxBBP.js.map} +1 -1
  51. package/dist/{card-D4P5_gg9.cjs → card-DWZhZ5Ds.cjs} +5 -5
  52. package/dist/{card-D4P5_gg9.cjs.map → card-DWZhZ5Ds.cjs.map} +1 -1
  53. package/dist/card.cjs +1 -1
  54. package/dist/card.js +1 -1
  55. package/dist/{checkbox-hhXVXDV1.cjs → checkbox-BBttnA_a.cjs} +2 -2
  56. package/dist/{checkbox-hhXVXDV1.cjs.map → checkbox-BBttnA_a.cjs.map} +1 -1
  57. package/dist/{checkbox-C8ChypKf.js → checkbox-t__wRS-9.js} +2 -2
  58. package/dist/{checkbox-C8ChypKf.js.map → checkbox-t__wRS-9.js.map} +1 -1
  59. package/dist/checkbox.cjs +1 -1
  60. package/dist/checkbox.js +1 -1
  61. package/dist/{chips-B8R9q4yl.js → chips-B8HM25xv.js} +27 -27
  62. package/dist/{chips-B8R9q4yl.js.map → chips-B8HM25xv.js.map} +1 -1
  63. package/dist/{chips-BTLlO_Ow.cjs → chips-lipKBK9P.cjs} +5 -5
  64. package/dist/{chips-BTLlO_Ow.cjs.map → chips-lipKBK9P.cjs.map} +1 -1
  65. package/dist/chips.cjs +1 -1
  66. package/dist/chips.js +2 -2
  67. package/dist/connectivity.cjs +2 -2
  68. package/dist/connectivity.js +5 -5
  69. package/dist/content-drawer.cjs +1 -1
  70. package/dist/content-drawer.js +1 -1
  71. package/dist/{date-range-CS96dWMh.js → date-range-CObvXmZ4.js} +6 -6
  72. package/dist/{date-range-CS96dWMh.js.map → date-range-CObvXmZ4.js.map} +1 -1
  73. package/dist/{date-range-9h6ZSkZb.cjs → date-range-DXct0_Jg.cjs} +3 -3
  74. package/dist/{date-range-9h6ZSkZb.cjs.map → date-range-DXct0_Jg.cjs.map} +1 -1
  75. package/dist/{date-range-inline-DCXdGeRv.js → date-range-inline-BEP-oWJZ.js} +2 -2
  76. package/dist/{date-range-inline-DCXdGeRv.js.map → date-range-inline-BEP-oWJZ.js.map} +1 -1
  77. package/dist/{date-range-inline-CAxnHA-l.cjs → date-range-inline-lhkwHFxY.cjs} +2 -2
  78. package/dist/{date-range-inline-CAxnHA-l.cjs.map → date-range-inline-lhkwHFxY.cjs.map} +1 -1
  79. package/dist/date-range-inline.cjs +1 -1
  80. package/dist/date-range-inline.js +1 -1
  81. package/dist/date-range.cjs +1 -1
  82. package/dist/date-range.js +1 -1
  83. package/dist/delay.cjs +2 -2
  84. package/dist/delay.js +6 -6
  85. package/dist/{details-BC0IObBd.cjs → details-DSGEewvZ.cjs} +2 -2
  86. package/dist/{details-BC0IObBd.cjs.map → details-DSGEewvZ.cjs.map} +1 -1
  87. package/dist/{details-Pgd0slKn.js → details-nRdT8J-W.js} +11 -11
  88. package/dist/{details-Pgd0slKn.js.map → details-nRdT8J-W.js.map} +1 -1
  89. package/dist/details.cjs +1 -1
  90. package/dist/details.js +1 -1
  91. package/dist/{directives-CFWacnWU.cjs → directives-DJbBHfID.cjs} +1 -1
  92. package/dist/{directives-CFWacnWU.cjs.map → directives-DJbBHfID.cjs.map} +1 -1
  93. package/dist/{directives-B-RT9R2u.js → directives-DZzxV3Hh.js} +3 -3
  94. package/dist/{directives-B-RT9R2u.js.map → directives-DZzxV3Hh.js.map} +1 -1
  95. package/dist/directives.cjs +1 -1
  96. package/dist/directives.js +2 -2
  97. package/dist/{divider-BMzm0lOz.js → divider-BHgrisGQ.js} +5 -5
  98. package/dist/{divider-BMzm0lOz.js.map → divider-BHgrisGQ.js.map} +1 -1
  99. package/dist/{divider-D1OzaRAQ.cjs → divider-D21yKZNJ.cjs} +2 -2
  100. package/dist/{divider-D1OzaRAQ.cjs.map → divider-D21yKZNJ.cjs.map} +1 -1
  101. package/dist/divider.cjs +1 -1
  102. package/dist/divider.js +1 -1
  103. package/dist/dropdown.cjs +3 -3
  104. package/dist/dropdown.js +8 -8
  105. package/dist/{expand-C0Uqxfv0.js → expand-2TTbmm_z.js} +10 -10
  106. package/dist/{expand-C0Uqxfv0.js.map → expand-2TTbmm_z.js.map} +1 -1
  107. package/dist/{expand-CiQkzth9.cjs → expand-wRphbpW6.cjs} +3 -3
  108. package/dist/{expand-CiQkzth9.cjs.map → expand-wRphbpW6.cjs.map} +1 -1
  109. package/dist/expand.cjs +1 -1
  110. package/dist/expand.js +1 -1
  111. package/dist/float-B0L_CH4v.cjs +1 -0
  112. package/dist/{float-Bu_IfKRd.cjs.map → float-B0L_CH4v.cjs.map} +1 -1
  113. package/dist/{float-DwBMXhek.js → float-dtDqRmcL.js} +2 -2
  114. package/dist/{float-DwBMXhek.js.map → float-dtDqRmcL.js.map} +1 -1
  115. package/dist/float.cjs +1 -1
  116. package/dist/float.js +1 -1
  117. package/dist/{form-B9Je2W_m.js → form-BxY-9F6N.js} +6 -6
  118. package/dist/{form-B9Je2W_m.js.map → form-BxY-9F6N.js.map} +1 -1
  119. package/dist/{form-BnbAVZyf.cjs → form-DvqHReDF.cjs} +2 -2
  120. package/dist/{form-BnbAVZyf.cjs.map → form-DvqHReDF.cjs.map} +1 -1
  121. package/dist/form.cjs +2 -2
  122. package/dist/form.js +12 -12
  123. package/dist/handover/agent-runtime-followups.md +1 -1
  124. package/dist/handover/agent-runtime-v1.md +3 -3
  125. package/dist/{icons-BfWQl5k5.cjs → icons-BbC4t44c.cjs} +2 -2
  126. package/dist/{icons-BfWQl5k5.cjs.map → icons-BbC4t44c.cjs.map} +1 -1
  127. package/dist/{icons-DJHPXKgR.js → icons-CO8UrTJQ.js} +4 -4
  128. package/dist/{icons-DJHPXKgR.js.map → icons-CO8UrTJQ.js.map} +1 -1
  129. package/dist/icons.cjs +1 -1
  130. package/dist/icons.js +1 -1
  131. package/dist/{iframe-UtczJypj.cjs → iframe-BepoWz9Z.cjs} +2 -2
  132. package/dist/{iframe-UtczJypj.cjs.map → iframe-BepoWz9Z.cjs.map} +1 -1
  133. package/dist/{iframe-DLz8ll0s.js → iframe-t5zo89Fs.js} +5 -5
  134. package/dist/{iframe-DLz8ll0s.js.map → iframe-t5zo89Fs.js.map} +1 -1
  135. package/dist/iframe.cjs +1 -1
  136. package/dist/iframe.js +1 -1
  137. package/dist/index.cjs +1 -1
  138. package/dist/index.js +69 -69
  139. package/dist/{input-AQbBEj2f.js → input-2OR6wjfT.js} +2 -2
  140. package/dist/{input-AQbBEj2f.js.map → input-2OR6wjfT.js.map} +1 -1
  141. package/dist/{input-Pp6A1m3s.cjs → input-B-wPPC5o.cjs} +2 -2
  142. package/dist/{input-Pp6A1m3s.cjs.map → input-B-wPPC5o.cjs.map} +1 -1
  143. package/dist/{input-chip-Bbs_gXOB.js → input-chip-NBsnZkzu.js} +10 -10
  144. package/dist/{input-chip-Bbs_gXOB.js.map → input-chip-NBsnZkzu.js.map} +1 -1
  145. package/dist/{input-chip-B5vYNuEm.cjs → input-chip-O5-pgek1.cjs} +2 -2
  146. package/dist/{input-chip-B5vYNuEm.cjs.map → input-chip-O5-pgek1.cjs.map} +1 -1
  147. package/dist/input.cjs +1 -1
  148. package/dist/input.js +1 -1
  149. package/dist/json.cjs +2 -2
  150. package/dist/json.js +5 -5
  151. package/dist/kbd.cjs +2 -2
  152. package/dist/kbd.js +5 -5
  153. package/dist/{layout-9K1zxhZn.js → layout-CJ01zE9V.js} +1 -1
  154. package/dist/{layout-9K1zxhZn.js.map → layout-CJ01zE9V.js.map} +1 -1
  155. package/dist/{layout-B0dct--7.cjs → layout-D7nKwpa5.cjs} +1 -1
  156. package/dist/{layout-B0dct--7.cjs.map → layout-D7nKwpa5.cjs.map} +1 -1
  157. package/dist/layout.cjs +2 -2
  158. package/dist/layout.js +7 -7
  159. package/dist/{lightbox-D_EizrG3.cjs → lightbox-DVpvjsYb.cjs} +3 -3
  160. package/dist/{lightbox-D_EizrG3.cjs.map → lightbox-DVpvjsYb.cjs.map} +1 -1
  161. package/dist/{lightbox-DmJTs2My.js → lightbox-Droe9dYY.js} +4 -4
  162. package/dist/{lightbox-DmJTs2My.js.map → lightbox-Droe9dYY.js.map} +1 -1
  163. package/dist/lightbox.cjs +1 -1
  164. package/dist/lightbox.js +1 -1
  165. package/dist/{list-DjSSRZxF.js → list-DzAWv99q.js} +12 -12
  166. package/dist/{list-DjSSRZxF.js.map → list-DzAWv99q.js.map} +1 -1
  167. package/dist/{list-BSn8czyO.cjs → list-JjUsFCP6.cjs} +3 -3
  168. package/dist/{list-BSn8czyO.cjs.map → list-JjUsFCP6.cjs.map} +1 -1
  169. package/dist/list.cjs +1 -1
  170. package/dist/list.js +1 -1
  171. package/dist/{menu-DTNnq7j_.cjs → menu-BNPbrAmd.cjs} +3 -3
  172. package/dist/{menu-DTNnq7j_.cjs.map → menu-BNPbrAmd.cjs.map} +1 -1
  173. package/dist/{menu-CCVEde6u.js → menu-D2cZSp74.js} +7 -7
  174. package/dist/{menu-CCVEde6u.js.map → menu-D2cZSp74.js.map} +1 -1
  175. package/dist/menu.cjs +1 -1
  176. package/dist/menu.js +1 -1
  177. package/dist/{mixins-BYfSDvbP.js → mixins-Cevarn7V.js} +21 -21
  178. package/dist/{mixins-BYfSDvbP.js.map → mixins-Cevarn7V.js.map} +1 -1
  179. package/dist/{mixins-YQI9JogS.cjs → mixins-JyO9GSGy.cjs} +2 -2
  180. package/dist/{mixins-YQI9JogS.cjs.map → mixins-JyO9GSGy.cjs.map} +1 -1
  181. package/dist/mixins.cjs +1 -1
  182. package/dist/mixins.js +3 -3
  183. package/dist/nav-drawer.cjs +1 -1
  184. package/dist/nav-drawer.js +1 -1
  185. package/dist/navigation-bar.cjs +1 -1
  186. package/dist/navigation-bar.js +1 -1
  187. package/dist/navigation-rail.cjs +3 -3
  188. package/dist/navigation-rail.js +15 -15
  189. package/dist/{notification-RhaYvA1I.cjs → notification-CaeRS5US.cjs} +2 -2
  190. package/dist/{notification-RhaYvA1I.cjs.map → notification-CaeRS5US.cjs.map} +1 -1
  191. package/dist/{notification-BNEuu3Q2.js → notification-Dxwx0Zln.js} +7 -7
  192. package/dist/{notification-BNEuu3Q2.js.map → notification-Dxwx0Zln.js.map} +1 -1
  193. package/dist/notification.cjs +1 -1
  194. package/dist/notification.js +1 -1
  195. package/dist/{option-BLMYRy5C.js → option-BCnYutZz.js} +6 -6
  196. package/dist/{option-BLMYRy5C.js.map → option-BCnYutZz.js.map} +1 -1
  197. package/dist/{option-Dk7UFFlr.cjs → option-C6wXFQOM.cjs} +2 -2
  198. package/dist/{option-Dk7UFFlr.cjs.map → option-C6wXFQOM.cjs.map} +1 -1
  199. package/dist/option.cjs +1 -1
  200. package/dist/option.js +1 -1
  201. package/dist/{overlay-CujzmLxg.js → overlay-BVdgWkIj.js} +11 -11
  202. package/dist/{overlay-CujzmLxg.js.map → overlay-BVdgWkIj.js.map} +1 -1
  203. package/dist/{overlay-BbntqsVm.cjs → overlay-U5jr3OYG.cjs} +2 -2
  204. package/dist/{overlay-BbntqsVm.cjs.map → overlay-U5jr3OYG.cjs.map} +1 -1
  205. package/dist/overlay.cjs +1 -1
  206. package/dist/{overlay.confirm-body-CMge0LP5.cjs → overlay.confirm-body-BCWt92R7.cjs} +2 -2
  207. package/dist/{overlay.confirm-body-CMge0LP5.cjs.map → overlay.confirm-body-BCWt92R7.cjs.map} +1 -1
  208. package/dist/{overlay.confirm-body-CRk4MvKh.js → overlay.confirm-body-BYPEKZtR.js} +13 -13
  209. package/dist/{overlay.confirm-body-CRk4MvKh.js.map → overlay.confirm-body-BYPEKZtR.js.map} +1 -1
  210. package/dist/overlay.js +3 -3
  211. package/dist/{overlay.service-Dq5XtSEL.cjs → overlay.service-D4_SgGuT.cjs} +1 -1
  212. package/dist/{overlay.service-Dq5XtSEL.cjs.map → overlay.service-D4_SgGuT.cjs.map} +1 -1
  213. package/dist/{overlay.service-DnT4SBlJ.js → overlay.service-Dq2X6ibl.js} +2 -2
  214. package/dist/{overlay.service-DnT4SBlJ.js.map → overlay.service-Dq2X6ibl.js.map} +1 -1
  215. package/dist/{progress-Bqd4DdOQ.cjs → progress-Bc_IBaNH.cjs} +2 -2
  216. package/dist/{progress-Bqd4DdOQ.cjs.map → progress-Bc_IBaNH.cjs.map} +1 -1
  217. package/dist/{progress-Cu_wh6Sl.js → progress-BoFm3r6h.js} +10 -10
  218. package/dist/{progress-Cu_wh6Sl.js.map → progress-BoFm3r6h.js.map} +1 -1
  219. package/dist/progress.cjs +1 -1
  220. package/dist/progress.js +1 -1
  221. package/dist/{radio-group-C8rUbYL6.cjs → radio-group-C34WDjrN.cjs} +3 -3
  222. package/dist/{radio-group-C8rUbYL6.cjs.map → radio-group-C34WDjrN.cjs.map} +1 -1
  223. package/dist/{radio-group-Duzgx17I.js → radio-group-DnHhGrXp.js} +7 -7
  224. package/dist/{radio-group-Duzgx17I.js.map → radio-group-DnHhGrXp.js.map} +1 -1
  225. package/dist/radio-group.cjs +1 -1
  226. package/dist/radio-group.js +1 -1
  227. package/dist/range.cjs +2 -2
  228. package/dist/range.js +2 -2
  229. package/dist/{select-DdqEsfnG.cjs → select-Gb9fTA4M.cjs} +2 -2
  230. package/dist/{select-DdqEsfnG.cjs.map → select-Gb9fTA4M.cjs.map} +1 -1
  231. package/dist/{select-CzCv1f1c.js → select-gRJb1TEf.js} +3 -3
  232. package/dist/{select-CzCv1f1c.js.map → select-gRJb1TEf.js.map} +1 -1
  233. package/dist/select.cjs +1 -1
  234. package/dist/select.js +1 -1
  235. package/dist/skeleton.cjs +2 -2
  236. package/dist/skeleton.js +5 -5
  237. package/dist/slider.cjs +3 -3
  238. package/dist/slider.js +6 -6
  239. package/dist/{sound.service-BOWTBG16.js → sound.service-Cuo4-X_-.js} +1 -1
  240. package/dist/{sound.service-BOWTBG16.js.map → sound.service-Cuo4-X_-.js.map} +1 -1
  241. package/dist/{sound.service-BwIzAFQx.cjs → sound.service-Czs3gmRx.cjs} +1 -1
  242. package/dist/{sound.service-BwIzAFQx.cjs.map → sound.service-Czs3gmRx.cjs.map} +1 -1
  243. package/dist/{splash-screen-_KhxgneW.cjs → splash-screen-C0oeDPxV.cjs} +2 -2
  244. package/dist/{splash-screen-_KhxgneW.cjs.map → splash-screen-C0oeDPxV.cjs.map} +1 -1
  245. package/dist/{splash-screen-Dj-zuGuB.js → splash-screen-CbcYpkIx.js} +6 -6
  246. package/dist/{splash-screen-Dj-zuGuB.js.map → splash-screen-CbcYpkIx.js.map} +1 -1
  247. package/dist/splash-screen.cjs +1 -1
  248. package/dist/splash-screen.js +1 -1
  249. package/dist/{src-BSjgxN07.cjs → src-C_7k7YhE.cjs} +11 -11
  250. package/dist/{src-BSjgxN07.cjs.map → src-C_7k7YhE.cjs.map} +1 -1
  251. package/dist/{src-Curgs4Yp.js → src-DavVEUeO.js} +82 -82
  252. package/dist/{src-Curgs4Yp.js.map → src-DavVEUeO.js.map} +1 -1
  253. package/dist/{state-E0bVrZ7q.js → state-B-5H9i10.js} +295 -302
  254. package/dist/state-B-5H9i10.js.map +1 -0
  255. package/dist/{state-BthYuA3T.cjs → state-D85Se4Fx.cjs} +1 -1
  256. package/dist/state-D85Se4Fx.cjs.map +1 -0
  257. package/dist/state.cjs +1 -1
  258. package/dist/state.js +3 -3
  259. package/dist/steps.cjs +3 -3
  260. package/dist/steps.js +9 -9
  261. package/dist/{surface-D-GqzyLn.cjs → surface-DHPaLOTA.cjs} +2 -2
  262. package/dist/{surface-D-GqzyLn.cjs.map → surface-DHPaLOTA.cjs.map} +1 -1
  263. package/dist/{surface-C2TIedTq.js → surface-gZpeCF6E.js} +4 -4
  264. package/dist/{surface-C2TIedTq.js.map → surface-gZpeCF6E.js.map} +1 -1
  265. package/dist/surface.cjs +1 -1
  266. package/dist/surface.js +1 -1
  267. package/dist/switch.cjs +2 -2
  268. package/dist/switch.js +2 -2
  269. package/dist/table.cjs +3 -3
  270. package/dist/table.js +10 -10
  271. package/dist/{tabs-CLRVe23a.js → tabs-DJNdoE-x.js} +11 -11
  272. package/dist/{tabs-CLRVe23a.js.map → tabs-DJNdoE-x.js.map} +1 -1
  273. package/dist/{tabs-C_493iod.cjs → tabs-DgaVwuOo.cjs} +2 -2
  274. package/dist/{tabs-C_493iod.cjs.map → tabs-DgaVwuOo.cjs.map} +1 -1
  275. package/dist/tabs.cjs +1 -1
  276. package/dist/tabs.js +1 -1
  277. package/dist/teleport.cjs +1 -1
  278. package/dist/teleport.js +1 -1
  279. package/dist/{textarea-CICgd2oP.cjs → textarea-2QE5z6Ny.cjs} +2 -2
  280. package/dist/{textarea-CICgd2oP.cjs.map → textarea-2QE5z6Ny.cjs.map} +1 -1
  281. package/dist/{textarea-BWEyOtPy.js → textarea-8x0prbgm.js} +2 -2
  282. package/dist/{textarea-BWEyOtPy.js.map → textarea-8x0prbgm.js.map} +1 -1
  283. package/dist/textarea.cjs +1 -1
  284. package/dist/textarea.js +1 -1
  285. package/dist/{theme-D7zOJiyg.cjs → theme-D0yboni1.cjs} +5 -5
  286. package/dist/{theme-D7zOJiyg.cjs.map → theme-D0yboni1.cjs.map} +1 -1
  287. package/dist/{theme-Bfg_H2AF.js → theme-DSD9Bs69.js} +12 -12
  288. package/dist/{theme-Bfg_H2AF.js.map → theme-DSD9Bs69.js.map} +1 -1
  289. package/dist/{theme-button-DgeBcqFm.cjs → theme-button-Dpr6SGzB.cjs} +2 -2
  290. package/dist/{theme-button-DgeBcqFm.cjs.map → theme-button-Dpr6SGzB.cjs.map} +1 -1
  291. package/dist/{theme-button-C53GdQER.js → theme-button-nd6Z7plT.js} +4 -4
  292. package/dist/{theme-button-C53GdQER.js.map → theme-button-nd6Z7plT.js.map} +1 -1
  293. package/dist/theme-button.cjs +1 -1
  294. package/dist/theme-button.js +1 -1
  295. package/dist/theme.cjs +1 -1
  296. package/dist/theme.js +3 -3
  297. package/dist/{theme.service-C3PoISGd.cjs → theme.service-LtQw04e6.cjs} +1 -1
  298. package/dist/{theme.service-C3PoISGd.cjs.map → theme.service-LtQw04e6.cjs.map} +1 -1
  299. package/dist/{theme.service-BqDuioYc.js → theme.service-mRlvWZVs.js} +1 -1
  300. package/dist/{theme.service-BqDuioYc.js.map → theme.service-mRlvWZVs.js.map} +1 -1
  301. package/dist/tree.cjs +2 -2
  302. package/dist/tree.js +4 -4
  303. package/dist/{typography-B19fJ5YT.cjs → typography-CiZQpzE4.cjs} +2 -2
  304. package/dist/{typography-B19fJ5YT.cjs.map → typography-CiZQpzE4.cjs.map} +1 -1
  305. package/dist/{typography-CzbQv-X0.js → typography-DXyf-KdK.js} +10 -10
  306. package/dist/{typography-CzbQv-X0.js.map → typography-DXyf-KdK.js.map} +1 -1
  307. package/dist/typography.cjs +1 -1
  308. package/dist/typography.js +1 -1
  309. package/dist/visually-hidden.cjs +2 -2
  310. package/dist/visually-hidden.js +4 -4
  311. package/dist/{window-DpctMXiy.js → window-C_ATa3qM.js} +9 -9
  312. package/dist/{window-DpctMXiy.js.map → window-C_ATa3qM.js.map} +1 -1
  313. package/dist/{window-DXB53PuA.cjs → window-qKfP5c6M.cjs} +2 -2
  314. package/dist/{window-DXB53PuA.cjs.map → window-qKfP5c6M.cjs.map} +1 -1
  315. package/dist/window.cjs +1 -1
  316. package/dist/window.js +1 -1
  317. package/package.json +1 -1
  318. package/src/state/active-host.ts +1 -50
  319. package/src/state/index.ts +10 -24
  320. package/src/state/schmancy-context.ts +2 -10
  321. package/types/src/state/active-host.d.ts +0 -3
  322. package/types/src/state/index.d.ts +1 -1
  323. package/dist/float-Bu_IfKRd.cjs +0 -1
  324. package/dist/state-BthYuA3T.cjs.map +0 -1
  325. package/dist/state-E0bVrZ7q.js.map +0 -1
@@ -1,2 +1,2 @@
1
- import { t as e } from "./typography-CzbQv-X0.js";
1
+ import { t as e } from "./typography-DXyf-KdK.js";
2
2
  export { e as SchmancyTypography };
@@ -1,4 +1,4 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`./chunk-CncqDLb2.cjs`);const e=require(`./SchmancyElement-DhSiMp6Y.cjs`);require(`./mixins-YQI9JogS.cjs`);let t=require(`lit/decorators.js`),n=require(`lit`);var r=class extends e.t{static{this.styles=[n.css`
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`./chunk-CncqDLb2.cjs`);const e=require(`./SchmancyElement-D8_z9JrW.cjs`);require(`./mixins-JyO9GSGy.cjs`);let t=require(`lit/decorators.js`),n=require(`lit`);var r=class extends e.t{static{this.styles=[n.css`
2
2
  :host {
3
3
  position: absolute;
4
4
  width: 1px;
@@ -10,4 +10,4 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`./ch
10
10
  white-space: nowrap;
11
11
  border-width: 0;
12
12
  }
13
- `]}render(){return n.html`<slot></slot>`}};r=e.p([(0,t.customElement)(`schmancy-visually-hidden`)],r),Object.defineProperty(exports,`SchmancyVisuallyHidden`,{enumerable:!0,get:function(){return r}});
13
+ `]}render(){return n.html`<slot></slot>`}};r=e.u([(0,t.customElement)(`schmancy-visually-hidden`)],r),Object.defineProperty(exports,`SchmancyVisuallyHidden`,{enumerable:!0,get:function(){return r}});
@@ -1,8 +1,8 @@
1
- import { p as e, t } from "./SchmancyElement-BQ4DFufc.js";
2
- import "./mixins-BYfSDvbP.js";
1
+ import { t as e, u as t } from "./SchmancyElement-DuzT2AMa.js";
2
+ import "./mixins-Cevarn7V.js";
3
3
  import { customElement as n } from "lit/decorators.js";
4
4
  import { css as r, html as i } from "lit";
5
- var a = class extends t {
5
+ var a = class extends e {
6
6
  static {
7
7
  this.styles = [r`
8
8
  :host {
@@ -22,5 +22,5 @@ var a = class extends t {
22
22
  return i`<slot></slot>`;
23
23
  }
24
24
  };
25
- a = e([n("schmancy-visually-hidden")], a);
25
+ a = t([n("schmancy-visually-hidden")], a);
26
26
  export { a as SchmancyVisuallyHidden };
@@ -1,9 +1,9 @@
1
- import { p as e, t } from "./SchmancyElement-BQ4DFufc.js";
2
- import "./mixins-BYfSDvbP.js";
1
+ import { t as e, u as t } from "./SchmancyElement-DuzT2AMa.js";
2
+ import "./mixins-Cevarn7V.js";
3
3
  import { d as n, f as r } from "./animation-DCznELuT.js";
4
4
  import { t as i } from "./reduced-motion-D-L12p7G.js";
5
5
  import { t as a } from "./cursor-glow-Ah7VXSj7.js";
6
- import { n as o } from "./theme.service-BqDuioYc.js";
6
+ import { n as o } from "./theme.service-mRlvWZVs.js";
7
7
  import { t as s } from "./overlay-stack-D2rgxQLh.js";
8
8
  import { BehaviorSubject as c, EMPTY as l, Observable as u, animationFrameScheduler as d, auditTime as f, catchError as p, distinctUntilChanged as m, filter as h, finalize as g, from as _, fromEvent as v, map as y, merge as b, switchMap as x, take as S, takeUntil as C, tap as w } from "rxjs";
9
9
  import { classMap as T } from "lit/directives/class-map.js";
@@ -152,7 +152,7 @@ function B(e, t, n) {
152
152
  };
153
153
  }(r, n);
154
154
  }
155
- var V = 48, H = class extends t {
155
+ var V = 48, H = class extends e {
156
156
  static {
157
157
  R = this;
158
158
  }
@@ -525,15 +525,15 @@ var V = 48, H = class extends t {
525
525
  `;
526
526
  }
527
527
  };
528
- e([O({ type: String })], H.prototype, "id", void 0), e([O({ type: String })], H.prototype, "expandedWidth", void 0), e([O({ type: String })], H.prototype, "expandedHeight", void 0), e([O({
528
+ t([O({ type: String })], H.prototype, "id", void 0), t([O({ type: String })], H.prototype, "expandedWidth", void 0), t([O({ type: String })], H.prototype, "expandedHeight", void 0), t([O({
529
529
  type: Boolean,
530
530
  reflect: !0
531
- })], H.prototype, "lowered", void 0), e([O({ type: String })], H.prototype, "corner", void 0), e([O({ type: Boolean })], H.prototype, "resizable", void 0), e([O({ type: Boolean })], H.prototype, "freePosition", void 0), e([O({
531
+ })], H.prototype, "lowered", void 0), t([O({ type: String })], H.prototype, "corner", void 0), t([O({ type: Boolean })], H.prototype, "resizable", void 0), t([O({ type: Boolean })], H.prototype, "freePosition", void 0), t([O({
532
532
  type: String,
533
533
  reflect: !0
534
- })], H.prototype, "visualState", void 0), e([O({ type: Number })], H.prototype, "minWidth", void 0), e([O({ type: Number })], H.prototype, "minHeight", void 0), e([O({
534
+ })], H.prototype, "visualState", void 0), t([O({ type: Number })], H.prototype, "minWidth", void 0), t([O({ type: Number })], H.prototype, "minHeight", void 0), t([O({
535
535
  type: Boolean,
536
536
  reflect: !0
537
- })], H.prototype, "open", void 0), e([k()], H.prototype, "_hasOpened", void 0), e([k()], H.prototype, "_currentCorner", void 0);
538
- var U = H = R = e([D("schmancy-window")], H);
537
+ })], H.prototype, "open", void 0), t([k()], H.prototype, "_hasOpened", void 0), t([k()], H.prototype, "_currentCorner", void 0);
538
+ var U = H = R = t([D("schmancy-window")], H);
539
539
  export { z as n, U as t };
@@ -1 +1 @@
1
- {"version":3,"file":"window-DpctMXiy.js","names":[],"sources":["../src/window/window-manager.ts","../src/window/window-position.ts","../src/window/window.ts"],"sourcesContent":["/**\n * Window Manager — singleton service for multi-window coordination.\n *\n * Tracks all schmancy-window instances: positions, z-indices, focus, visual states.\n * Components register on connectedCallback, unregister on disconnectedCallback.\n * Focus changes, position updates, and overlap queries all flow through here.\n *\n * Follows the ThemeService singleton pattern (theme/theme.service.ts).\n *\n * Example:\n * windowManager.register('chat-1', bounds, 'bottom-right')\n * windowManager.focus('chat-1') // bumps z-index, updates focusedId\n * const overlaps = windowManager.findOverlaps(projectedBounds, 'chat-1')\n */\n\nimport { BehaviorSubject, Observable, distinctUntilChanged, map } from 'rxjs'\nimport { overlayStack } from '../utils/overlay-stack.js'\nimport type { WindowBounds, WindowRecord, WindowRegistryState, SnapTarget } from './window-registry.js'\n\nconst STORAGE_PREFIX = 'schmancy-window-'\nconst LEGACY_STORAGE_PREFIX = 'schmancy-float-'\n\nclass WindowManagerService {\n\tprivate static instance: WindowManagerService\n\n\tprivate readonly _state$ = new BehaviorSubject<WindowRegistryState>({\n\t\twindows: new Map(),\n\t\tfocusedId: null,\n\t\tstackOrder: [],\n\t})\n\n\treadonly state$ = this._state$.asObservable()\n\n\tprivate constructor() {}\n\n\tstatic getInstance(): WindowManagerService {\n\t\tif (!WindowManagerService.instance) {\n\t\t\tWindowManagerService.instance = new WindowManagerService()\n\t\t}\n\t\treturn WindowManagerService.instance\n\t}\n\n\t// ── Synchronous accessors ──────────────────────────────────────────\n\n\tget windows(): Map<string, WindowRecord> {\n\t\treturn this._state$.value.windows\n\t}\n\n\tget focusedId(): string | null {\n\t\treturn this._state$.value.focusedId\n\t}\n\n\t// ── Registration ───────────────────────────────────────────────────\n\n\tregister(id: string, initialBounds: WindowBounds, snapTarget: SnapTarget): void {\n\t\tconst state = this._state$.value\n\t\tif (state.windows.has(id)) return\n\n\t\tconst zIndex = overlayStack.assignZIndex(id)\n\t\tconst record: WindowRecord = {\n\t\t\tid,\n\t\t\tbounds: initialBounds,\n\t\t\tvisualState: 'normal',\n\t\t\tzIndex,\n\t\t\topen: false,\n\t\t\tsnapTarget,\n\t\t}\n\n\t\tconst windows = new Map(state.windows)\n\t\twindows.set(id, record)\n\t\tconst stackOrder = overlayStack.getStackOrder()\n\n\t\tthis._state$.next({ ...state, windows, stackOrder })\n\t}\n\n\tunregister(id: string): void {\n\t\tconst state = this._state$.value\n\t\tif (!state.windows.has(id)) return\n\n\t\toverlayStack.releaseId(id)\n\t\tconst windows = new Map(state.windows)\n\t\twindows.delete(id)\n\t\tconst stackOrder = overlayStack.getStackOrder()\n\t\tconst focusedId = state.focusedId === id ? null : state.focusedId\n\n\t\tthis._state$.next({ ...state, windows, stackOrder, focusedId })\n\t}\n\n\t// ── State mutations ────────────────────────────────────────────────\n\n\tupdateBounds(id: string, bounds: WindowBounds): void {\n\t\tthis._updateRecord(id, { bounds })\n\t}\n\n\tupdateVisualState(id: string, visualState: WindowRecord['visualState']): void {\n\t\tthis._updateRecord(id, { visualState })\n\t}\n\n\tupdateOpen(id: string, open: boolean): void {\n\t\tthis._updateRecord(id, { open })\n\t}\n\n\tfocus(id: string): void {\n\t\tconst state = this._state$.value\n\t\tif (!state.windows.has(id)) return\n\t\tif (state.focusedId === id) return\n\n\t\tconst zIndex = overlayStack.bringToFront(id)\n\t\tconst windows = new Map(state.windows)\n\t\tconst record = windows.get(id)\n\t\tif (record) {\n\t\t\twindows.set(id, { ...record, zIndex })\n\t\t}\n\t\tconst stackOrder = overlayStack.getStackOrder()\n\n\t\tthis._state$.next({ ...state, windows, stackOrder, focusedId: id })\n\t}\n\n\t// ── Queries ────────────────────────────────────────────────────────\n\n\tfindOverlaps(bounds: WindowBounds, excludeId: string): WindowRecord[] {\n\t\tconst result: WindowRecord[] = []\n\t\tfor (const [id, record] of this._state$.value.windows) {\n\t\t\tif (id === excludeId) continue\n\t\t\tif (rectsOverlap(bounds, record.bounds)) {\n\t\t\t\tresult.push(record)\n\t\t\t}\n\t\t}\n\t\treturn result\n\t}\n\n\tgetNeighbors(id: string): WindowRecord[] {\n\t\tconst result: WindowRecord[] = []\n\t\tfor (const [otherId, record] of this._state$.value.windows) {\n\t\t\tif (otherId !== id) result.push(record)\n\t\t}\n\t\treturn result\n\t}\n\n\t// ── Selectors ──────────────────────────────────────────────────────\n\n\tselectWindow(id: string): Observable<WindowRecord | undefined> {\n\t\treturn this._state$.pipe(\n\t\t\tmap(state => state.windows.get(id)),\n\t\t\tdistinctUntilChanged(),\n\t\t)\n\t}\n\n\tselectFocused(): Observable<string | null> {\n\t\treturn this._state$.pipe(\n\t\t\tmap(state => state.focusedId),\n\t\t\tdistinctUntilChanged(),\n\t\t)\n\t}\n\n\t// ── Persistence ────────────────────────────────────────────────────\n\n\tloadPosition(id: string): { x: number; y: number; anchor: string } | null {\n\t\ttry {\n\t\t\t// Try new key first, fall back to legacy\n\t\t\tconst raw = localStorage.getItem(STORAGE_PREFIX + id) ?? localStorage.getItem(LEGACY_STORAGE_PREFIX + id)\n\t\t\tif (!raw) return null\n\t\t\treturn JSON.parse(raw) as { x: number; y: number; anchor: string }\n\t\t} catch {\n\t\t\treturn null\n\t\t}\n\t}\n\n\tsavePosition(id: string, data: { x: number; y: number; anchor: string }): void {\n\t\ttry {\n\t\t\tlocalStorage.setItem(STORAGE_PREFIX + id, JSON.stringify(data))\n\t\t} catch {\n\t\t\t// ignore\n\t\t}\n\t}\n\n\tclearPosition(id: string): void {\n\t\ttry {\n\t\t\tlocalStorage.removeItem(STORAGE_PREFIX + id)\n\t\t\tlocalStorage.removeItem(LEGACY_STORAGE_PREFIX + id)\n\t\t} catch {\n\t\t\t// ignore\n\t\t}\n\t}\n\n\t// ── Internal ───────────────────────────────────────────────────────\n\n\tprivate _updateRecord(id: string, updates: Partial<WindowRecord>): void {\n\t\tconst state = this._state$.value\n\t\tconst record = state.windows.get(id)\n\t\tif (!record) return\n\n\t\tconst windows = new Map(state.windows)\n\t\twindows.set(id, { ...record, ...updates })\n\t\tthis._state$.next({ ...state, windows })\n\t}\n}\n\n/** Simple rect overlap check (inline — no circular import with window-position) */\nfunction rectsOverlap(a: WindowBounds, b: WindowBounds): boolean {\n\treturn !(a.left >= b.left + b.width || a.left + a.width <= b.left || a.top >= b.top + b.height || a.top + a.height <= b.top)\n}\n\nexport const windowManager = WindowManagerService.getInstance()\n","/**\n * Window Position — pure functions for overlap resolution, cascade, and snapping.\n *\n * All functions are stateless: they take window bounds and viewport dimensions,\n * return new bounds. No side effects, no DOM access, no subscriptions.\n *\n * Example:\n * const projected = { left: 100, top: 400, width: 360, height: 500 }\n * const neighbors = windowManager.findOverlaps(projected, 'my-id')\n * const resolved = resolveOverlap(projected, neighbors, { width: 1440, height: 900 })\n * // → { left: 144, top: 444, width: 360, height: 500 } (cascaded away from conflict)\n */\n\nimport type { WindowBounds, WindowRecord } from './window-registry.js'\n\nconst HEAD_HEIGHT = 44\nconst CASCADE_OFFSET = HEAD_HEIGHT\nconst MAX_CASCADE_ATTEMPTS = 10\n\n/** Check if two rectangles overlap (edges touching does NOT count as overlap) */\nexport function rectsOverlap(a: WindowBounds, b: WindowBounds): boolean {\n\treturn !(a.left >= b.left + b.width || a.left + a.width <= b.left || a.top >= b.top + b.height || a.top + a.height <= b.top)\n}\n\n/**\n * Resolve overlap by cascading diagonally until no conflict.\n * Shifts by (HEAD_HEIGHT, HEAD_HEIGHT) per attempt, clamped to viewport.\n */\nexport function resolveOverlap(\n\tcandidate: WindowBounds,\n\texisting: WindowRecord[],\n\tviewport: { width: number; height: number },\n): WindowBounds {\n\tconst bounds = { ...candidate }\n\n\tfor (let attempt = 0; attempt < MAX_CASCADE_ATTEMPTS; attempt++) {\n\t\tconst hasOverlap = existing.some(w => rectsOverlap(bounds, w.bounds))\n\t\tif (!hasOverlap) break\n\n\t\tbounds.left += CASCADE_OFFSET\n\t\tbounds.top += CASCADE_OFFSET\n\t}\n\n\treturn clampToViewport(bounds, viewport)\n}\n\n/**\n * Clamp bounds so the window stays fully within the viewport.\n */\nexport function clampToViewport(\n\tbounds: WindowBounds,\n\tviewport: { width: number; height: number },\n): WindowBounds {\n\treturn {\n\t\twidth: bounds.width,\n\t\theight: bounds.height,\n\t\tleft: Math.max(0, Math.min(bounds.left, viewport.width - bounds.width)),\n\t\ttop: Math.max(0, Math.min(bounds.top, viewport.height - bounds.height)),\n\t}\n}\n","import { SchmancyElement } from '@mixins/index'\nimport { css, html, nothing } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\nimport { classMap } from 'lit/directives/class-map.js'\nimport { createRef, ref } from 'lit/directives/ref.js'\nimport { styleMap } from 'lit/directives/style-map.js'\nimport {\n\tanimationFrameScheduler,\n\tauditTime,\n\tcatchError,\n\tEMPTY,\n\tfilter,\n\tfinalize,\n\tfrom,\n\tfromEvent,\n\tmap,\n\tmerge,\n\tObservable,\n\tswitchMap,\n\ttake,\n\ttakeUntil,\n\ttap,\n} from 'rxjs'\nimport { SPRING_SMOOTH, SPRING_SNAPPY } from '../utils/animation.js'\nimport { cursorGlow } from '../directives/cursor-glow'\nimport { reducedMotion$ } from '../directives/reduced-motion'\nimport { theme } from '../theme/theme.service.js'\nimport type { SnapCorner, WindowBounds, WindowVisualState } from './window-registry.js'\nimport { windowManager } from './window-manager.js'\nimport { resolveOverlap } from './window-position.js'\n\nconst HEAD_HEIGHT = 48\nconst DRAG_THRESHOLD = 5\n\ninterface Position {\n\tx: number\n\ty: number\n}\n\n@customElement('schmancy-window')\nexport default class SchmancyWindow extends SchmancyElement {\n\tstatic styles = [css`\n\t:host {\n\t\tdisplay: contents;\n\t\tposition: relative;\n\t\tz-index: 1000;\n\t}\n\t:host([hidden]) {\n\t\tdisplay: none !important;\n\t}\n`]\n\n\t@property({ type: String }) id: string = 'default'\n\t/** Override the expanded panel width (e.g. '320px', '24rem'). Defaults to responsive sizing. */\n\t@property({ type: String }) expandedWidth?: string\n\t/** Override the expanded panel height (e.g. '400px', '50vh'). */\n\t@property({ type: String }) expandedHeight?: string\n\t/** When true, uses a lower elevation shadow in the collapsed state. */\n\t@property({ type: Boolean, reflect: true }) lowered: boolean = false\n\t/** Corner the window is anchored to. */\n\t@property({ type: String }) corner: SnapCorner = 'bottom-right'\n\t/** When true, window can be resized by the user. */\n\t@property({ type: Boolean }) resizable = false\n\t/** When true, window stays at its dragged position instead of snapping to a corner. */\n\t@property({ type: Boolean }) freePosition = false\n\t/** Visual state of the window (minimized, normal, maximized). */\n\t@property({ type: String, reflect: true }) visualState: WindowVisualState = 'normal'\n\t/** Minimum width in pixels. */\n\t@property({ type: Number }) minWidth = 280\n\t/** Minimum height in pixels. */\n\t@property({ type: Number }) minHeight = 200\n\n\t/** Whether the body is expanded. */\n\t@property({ type: Boolean, reflect: true }) open = false\n\n\tprivate _currentAnimation?: Animation\n\n\t/** Lazy rendering: body content not in DOM until first expand. */\n\t@state() private _hasOpened = false\n\n\t// Internal position -- plain fields, updated directly during drag\n\tprivate _position: Position = { x: 16, y: 16 }\n\t@state() private _currentCorner: SnapCorner = 'bottom-right'\n\n\t// Track applied corner to avoid unnecessary style.removeProperty calls during drag\n\tprivate _appliedCorner: string = ''\n\n\t// Refs\n\tprivate _containerRef = createRef<HTMLElement>()\n\tprivate _bodyRef = createRef<HTMLElement>()\n\tprivate _headRef = createRef<HTMLElement>()\n\n\t// ============================================\n\t// COMPUTED\n\t// ============================================\n\n\tprivate get panelWidth(): string {\n\t\treturn this.expandedWidth ?? 'min(360px, calc(100vw - 32px))'\n\t}\n\n\tprivate get isBottomCorner(): boolean {\n\t\treturn this._currentCorner.startsWith('bottom')\n\t}\n\n\tprivate get closedClipPath(): string {\n\t\treturn this.isBottomCorner\n\t\t\t? `inset(calc(100% - ${HEAD_HEIGHT}px) 0px 0px 0px round 22px)`\n\t\t\t: `inset(0px 0px calc(100% - ${HEAD_HEIGHT}px) 0px round 22px)`\n\t}\n\n\tprivate get openClipPath(): string {\n\t\treturn 'inset(0px 0px 0px 0px round 12px)'\n\t}\n\n\tprivate get elevation(): 0 | 1 | 2 | 3 | 4 | 5 {\n\t\tif (this.open) return 4\n\t\treturn this.lowered ? 1 : 3\n\t}\n\n\t// ============================================\n\t// POSITION MANAGEMENT\n\t// ============================================\n\n\tprivate _applyContainerPosition() {\n\t\tconst container = this._containerRef.value\n\t\tif (!container) return\n\t\t// Only clear position properties when corner changes (avoids 4 style invalidations per drag frame)\n\t\tif (this._appliedCorner !== this._currentCorner) {\n\t\t\tcontainer.style.removeProperty('left')\n\t\t\tcontainer.style.removeProperty('right')\n\t\t\tcontainer.style.removeProperty('top')\n\t\t\tcontainer.style.removeProperty('bottom')\n\t\t\tthis._appliedCorner = this._currentCorner\n\t\t}\n\t\tconst { x, y } = this._position\n\t\tif (this._currentCorner.includes('right')) {\n\t\t\tcontainer.style.right = `${x}px`\n\t\t} else {\n\t\t\tcontainer.style.left = `${x}px`\n\t\t}\n\t\tif (this._currentCorner.includes('bottom')) {\n\t\t\tcontainer.style.bottom = `${y + theme.bottomOffset}px`\n\t\t} else {\n\t\t\tcontainer.style.top = `${y}px`\n\t\t}\n\t}\n\n\tprivate static readonly VALID_CORNERS = new Set<string>(['top-left', 'top-right', 'bottom-left', 'bottom-right'])\n\n\tprivate _loadPosition() {\n\t\tconst saved = windowManager.loadPosition(this.id)\n\t\tif (saved) {\n\t\t\tthis._position = { x: saved.x, y: saved.y }\n\t\t\tif (SchmancyWindow.VALID_CORNERS.has(saved.anchor)) {\n\t\t\t\tthis._currentCorner = saved.anchor as SnapCorner\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate _savePosition() {\n\t\twindowManager.savePosition(this.id, { ...this._position, anchor: this._currentCorner })\n\t}\n\n\tprivate _validateBounds() {\n\t\tconst container = this._containerRef.value\n\t\tif (!container) return\n\t\tconst rect = container.getBoundingClientRect()\n\t\tif (rect.width === 0) return\n\t\tconst vw = window.innerWidth\n\t\tconst vh = window.innerHeight\n\t\tconst isRight = this._currentCorner.includes('right')\n\t\tconst isBottom = this._currentCorner.includes('bottom')\n\t\tconst actualLeft = isRight ? vw - this._position.x - rect.width : this._position.x\n\t\tconst actualTop = isBottom ? vh - this._position.y - rect.height : this._position.y\n\t\tconst newLeft = Math.max(0, Math.min(actualLeft, vw - rect.width))\n\t\tconst newTop = Math.max(0, Math.min(actualTop, vh - rect.height))\n\t\tthis._position = {\n\t\t\tx: isRight ? vw - newLeft - rect.width : newLeft,\n\t\t\ty: isBottom ? vh - newTop - rect.height : newTop,\n\t\t}\n\t\tthis._applyContainerPosition()\n\t}\n\n\t// ============================================\n\t// CORNER SNAPPING\n\t// ============================================\n\n\tprivate _reorientToNearestCorner(skipAnimation = false): void {\n\t\t// Free position mode: skip corner snapping\n\t\tif (this.freePosition) {\n\t\t\tthis._savePosition()\n\t\t\tconst rect = this._containerRef.value?.getBoundingClientRect()\n\t\t\tif (rect) {\n\t\t\t\twindowManager.updateBounds(this.id, { left: rect.left, top: rect.top, width: rect.width, height: rect.height })\n\t\t\t}\n\t\t\treturn\n\t\t}\n\n\t\tconst container = this._containerRef.value\n\t\tif (!container) return\n\n\t\t// F -- record current screen position before DOM mutation\n\t\tconst rect = container.getBoundingClientRect()\n\n\t\t// L -- calculate nearest corner using head visual center\n\t\tconst currentIsBottom = this._currentCorner.includes('bottom')\n\t\tconst headCenterX = rect.left + rect.width / 2\n\t\tconst headCenterY = currentIsBottom\n\t\t\t? rect.bottom - HEAD_HEIGHT / 2\n\t\t\t: rect.top + HEAD_HEIGHT / 2\n\t\tconst side = headCenterX > window.innerWidth / 2 ? 'right' : 'left'\n\t\tconst vert = headCenterY > window.innerHeight / 2 ? 'bottom' : 'top'\n\t\tconst newCorner: SnapCorner = `${vert}-${side}` as SnapCorner\n\n\t\t// Snap corner and reset offset to standard edge gap\n\t\tthis._currentCorner = newCorner\n\t\tthis._position = { x: 16, y: 16 }\n\t\tthis._applyContainerPosition()\n\t\t// Sync clip-path to new corner\n\t\tif (!this.open) {\n\t\t\tcontainer.style.clipPath = this.closedClipPath\n\t\t}\n\n\t\tif (skipAnimation || reducedMotion$.value) {\n\t\t\tthis._savePosition()\n\t\t\tconst snapRect = container.getBoundingClientRect()\n\t\t\twindowManager.updateBounds(this.id, { left: snapRect.left, top: snapRect.top, width: snapRect.width, height: snapRect.height })\n\t\t\treturn\n\t\t}\n\n\t\t// I -- invert: shift element back to its original visual position\n\t\tconst newRect = container.getBoundingClientRect()\n\t\tconst dx = rect.left - newRect.left\n\t\tconst dy = rect.top - newRect.top\n\t\tcontainer.style.translate = `${dx}px ${dy}px`\n\n\t\t// P -- play: animate from the inverse offset to natural resting position\n\t\tconst flipKeyframes: Keyframe[] = [{ translate: `${dx}px ${dy}px` }, { translate: '0px 0px' }]\n\t\tconst anim = container.animate(\n\t\t\tflipKeyframes,\n\t\t\t{\n\t\t\t\tduration: SPRING_SMOOTH.duration,\n\t\t\t\teasing: SPRING_SMOOTH.easingFallback,\n\t\t\t\tfill: 'forwards',\n\t\t\t},\n\t\t)\n\t\tfrom(anim.finished).pipe(\n\t\t\ttake(1),\n\t\t\ttap(() => {\n\t\t\t\tif (container.isConnected) container.style.translate = ''\n\t\t\t\t// Report final resting bounds after animation completes\n\t\t\t\tconst finalRect = container.getBoundingClientRect()\n\t\t\t\twindowManager.updateBounds(this.id, { left: finalRect.left, top: finalRect.top, width: finalRect.width, height: finalRect.height })\n\t\t\t}),\n\t\t\tcatchError(() => EMPTY),\n\t\t\ttakeUntil(this.disconnecting),\n\t\t).subscribe()\n\n\t\tthis._savePosition()\n\t}\n\n\t// ============================================\n\t// DRAG PIPELINE\n\t// ============================================\n\n\tprivate _drag$(): Observable<never> {\n\t\treturn new Observable(() => {\n\t\t\tconst head = this._headRef.value\n\t\t\tconst container = this._containerRef.value\n\t\t\tif (!head || !container) return\n\n\t\t\tlet didDrag = false\n\n\t\t\tconst sub = fromEvent<PointerEvent>(head, 'pointerdown').pipe(\n\t\t\t\tfilter(e => e.button === 0),\n\t\t\t\tfilter(e => {\n\t\t\t\t\tconst tag = (e.target as HTMLElement).tagName?.toLowerCase()\n\t\t\t\t\treturn !['input', 'textarea', 'select', 'button'].includes(tag)\n\t\t\t\t\t\t&& !(e.target as HTMLElement).closest('schmancy-input, schmancy-icon-button, button, a')\n\t\t\t\t}),\n\t\t\t\ttap(e => {\n\t\t\t\t\te.preventDefault()\n\t\t\t\t\te.stopPropagation()\n\t\t\t\t}),\n\t\t\t)\n\t\t\t\t.pipe(\n\t\t\t\t\tmap(e => {\n\t\t\t\t\t\tconst rect = container.getBoundingClientRect()\n\t\t\t\t\t\tconst isBottom = this._currentCorner.includes('bottom')\n\t\t\t\t\t\tconst wasOpen = this.open\n\t\t\t\t\t\tdidDrag = false\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tstartX: e.clientX,\n\t\t\t\t\t\t\tstartY: e.clientY,\n\t\t\t\t\t\t\toffsetX: e.clientX - rect.left,\n\t\t\t\t\t\t\toffsetY: e.clientY - rect.top,\n\t\t\t\t\t\t\trect,\n\t\t\t\t\t\t\tvw: window.innerWidth,\n\t\t\t\t\t\t\tvh: window.innerHeight,\n\t\t\t\t\t\t\tisBottom,\n\t\t\t\t\t\t\twasOpen,\n\t\t\t\t\t\t\tpointerId: e.pointerId,\n\t\t\t\t\t\t}\n\t\t\t\t\t}),\n\t\t\t\t\tswitchMap(({ startX, startY, offsetX, offsetY, rect, vw, vh, isBottom, wasOpen, pointerId }) => {\n\t\t\t\t\t\tconst move$ = fromEvent<PointerEvent>(window, 'pointermove').pipe(\n\t\t\t\t\t\t\tfilter(e => e.pointerId === pointerId),\n\t\t\t\t\t\t\tauditTime(0, animationFrameScheduler),\n\t\t\t\t\t\t\tmap(e => ({ clientX: e.clientX, clientY: e.clientY })),\n\t\t\t\t\t\t)\n\t\t\t\t\t\tconst end$ = fromEvent<PointerEvent>(window, 'pointerup').pipe(\n\t\t\t\t\t\t\tfilter(e => e.pointerId === pointerId),\n\t\t\t\t\t\t)\n\n\t\t\t\t\t\treturn move$.pipe(\n\t\t\t\t\t\t\ttap(({ clientX, clientY }) => {\n\t\t\t\t\t\t\t\tconst dx = clientX - startX\n\t\t\t\t\t\t\t\tconst dy = clientY - startY\n\t\t\t\t\t\t\t\tif (Math.sqrt(dx * dx + dy * dy) > DRAG_THRESHOLD && !didDrag) {\n\t\t\t\t\t\t\t\t\tdidDrag = true\n\t\t\t\t\t\t\t\t\tthis._applyDragVisuals(true)\n\t\t\t\t\t\t\t\t\t// Collapse on first confirmed drag move\n\t\t\t\t\t\t\t\t\tif (wasOpen) {\n\t\t\t\t\t\t\t\t\t\tthis.open = false\n\t\t\t\t\t\t\t\t\t\tcontainer.style.clipPath = this.closedClipPath\n\t\t\t\t\t\t\t\t\t\tcontainer.style.overflow = 'hidden'\n\t\t\t\t\t\t\t\t\t\tconst body = this._bodyRef.value\n\t\t\t\t\t\t\t\t\t\tif (body) {\n\t\t\t\t\t\t\t\t\t\t\tbody.inert = true\n\t\t\t\t\t\t\t\t\t\t\tbody.style.visibility = 'hidden'\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (!didDrag) return\n\n\t\t\t\t\t\t\t\tconst left = Math.max(0, Math.min(clientX - offsetX, vw - rect.width))\n\t\t\t\t\t\t\t\tconst minTop = isBottom ? HEAD_HEIGHT - rect.height : 0\n\t\t\t\t\t\t\t\tconst maxTop = isBottom ? vh - rect.height : vh - HEAD_HEIGHT\n\t\t\t\t\t\t\t\tconst top = Math.max(minTop, Math.min(clientY - offsetY, maxTop))\n\n\t\t\t\t\t\t\t\tthis._position = {\n\t\t\t\t\t\t\t\t\tx: this._currentCorner.includes('right') ? vw - left - rect.width : left,\n\t\t\t\t\t\t\t\t\ty: isBottom ? vh - top - rect.height : top,\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tthis._applyContainerPosition()\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\ttakeUntil(end$),\n\t\t\t\t\t\t\tfinalize(() => {\n\t\t\t\t\t\t\t\tif (didDrag) {\n\t\t\t\t\t\t\t\t\tthis._reorientToNearestCorner()\n\t\t\t\t\t\t\t\t\tthis._applyDragVisuals(false)\n\t\t\t\t\t\t\t\t\tdidDrag = false\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tdidDrag = false\n\t\t\t\t\t\t\t\t\tthis.toggle()\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t)\n\t\t\t\t\t}),\n\t\t\t\t)\n\t\t\t\t.subscribe()\n\n\t\t\treturn () => sub.unsubscribe()\n\t\t})\n\t}\n\n\t// ============================================\n\t// LIFECYCLE\n\t// ============================================\n\n\tconnectedCallback() {\n\t\tsuper.connectedCallback()\n\n\t\t// Pipeline 1: DOM setup + manager registration + drag + z-index sync\n\t\tfrom(this.updateComplete).pipe(\n\t\t\ttake(1),\n\t\t\ttap(() => {\n\t\t\t\tthis._currentCorner = this.corner\n\t\t\t\tthis._loadPosition()\n\t\t\t\tthis._applyContainerPosition()\n\t\t\t\tthis._initDOMState()\n\t\t\t\t// Register with window manager\n\t\t\t\tconst container = this._containerRef.value\n\t\t\t\tif (container) {\n\t\t\t\t\tconst rect = container.getBoundingClientRect()\n\t\t\t\t\tconst bounds: WindowBounds = { left: rect.left, top: rect.top, width: rect.width, height: rect.height }\n\t\t\t\t\twindowManager.register(this.id, bounds, this.freePosition ? 'free' : this._currentCorner)\n\t\t\t\t}\n\t\t\t}),\n\t\t\tswitchMap(() => merge(\n\t\t\t\tthis._drag$(),\n\t\t\t\twindowManager.selectWindow(this.id).pipe(\n\t\t\t\t\ttap(record => {\n\t\t\t\t\t\tif (!record) return\n\t\t\t\t\t\tconst container = this._containerRef.value\n\t\t\t\t\t\tif (container) container.style.zIndex = String(record.zIndex)\n\t\t\t\t\t}),\n\t\t\t\t),\n\t\t\t)),\n\t\t\ttakeUntil(this.disconnecting),\n\t\t).subscribe()\n\n\n\t\t// Pipeline 3: Environment -- one subscription\n\t\tmerge(\n\t\t\tfromEvent(window, 'resize').pipe(\n\t\t\t\tauditTime(0, animationFrameScheduler),\n\t\t\t\ttap(() => this._validateBounds()),\n\t\t\t),\n\t\t\ttheme.bottomOffset$.pipe(\n\t\t\t\ttap(() => this._applyContainerPosition()),\n\t\t\t),\n\t\t).pipe(takeUntil(this.disconnecting)).subscribe()\n\t}\n\n\tdisconnectedCallback() {\n\t\tsuper.disconnectedCallback()\n\t\twindowManager.unregister(this.id)\n\t}\n\n\tprivate _initDOMState() {\n\t\tconst container = this._containerRef.value\n\t\tconst body = this._bodyRef.value\n\t\tif (!container) return\n\n\t\tthis._applyContainerPosition()\n\n\t\tif (this.open) {\n\t\t\tthis._hasOpened = true\n\t\t\tcontainer.style.overflow = ''\n\t\t\tif (body) {\n\t\t\t\tbody.inert = false\n\t\t\t\tbody.style.visibility = 'visible'\n\t\t\t}\n\t\t} else {\n\t\t\tcontainer.style.clipPath = this.closedClipPath\n\t\t\tcontainer.style.overflow = 'hidden'\n\t\t\tif (body) {\n\t\t\t\tbody.inert = true\n\t\t\t\tbody.style.visibility = 'hidden'\n\t\t\t}\n\t\t}\n\t}\n\n\t// ============================================\n\t// ANIMATION\n\t// ============================================\n\n\tprivate _animateOpen() {\n\t\tconst container = this._containerRef.value\n\t\tconst body = this._bodyRef.value\n\t\tif (!container) return\n\n\t\tthis._hasOpened = true\n\t\tthis.open = true\n\n\t\t// Overlap avoidance\n\t\tconst rect = container.getBoundingClientRect()\n\t\tconst projectedBounds: WindowBounds = {\n\t\t\tleft: rect.left,\n\t\t\ttop: this.isBottomCorner ? rect.top - 400 : rect.top,\n\t\t\twidth: rect.width,\n\t\t\theight: 400 + HEAD_HEIGHT,\n\t\t}\n\t\tconst overlaps = windowManager.findOverlaps(projectedBounds, this.id)\n\t\tif (overlaps.length > 0) {\n\t\t\tconst resolved = resolveOverlap(projectedBounds, overlaps, { width: window.innerWidth, height: window.innerHeight })\n\t\t\tif (Math.abs(resolved.left - projectedBounds.left) > 10 || Math.abs(resolved.top - projectedBounds.top) > 10) {\n\t\t\t\tconst isRight = this._currentCorner.includes('right')\n\t\t\t\tconst isBottom = this._currentCorner.includes('bottom')\n\t\t\t\tthis._position = {\n\t\t\t\t\tx: isRight ? window.innerWidth - resolved.left - resolved.width : resolved.left,\n\t\t\t\t\ty: isBottom ? window.innerHeight - resolved.top - resolved.height : resolved.top,\n\t\t\t\t}\n\t\t\t\tthis._applyContainerPosition()\n\t\t\t}\n\t\t}\n\n\t\tif (body) {\n\t\t\tbody.style.visibility = 'visible'\n\t\t\tbody.inert = false\n\t\t}\n\n\t\tif (reducedMotion$.value) {\n\t\t\tcontainer.style.clipPath = ''\n\t\t\tcontainer.style.overflow = ''\n\t\t\tthis.dispatchScopedEvent('window-toggle', { state: 'expanded' })\n\t\t\treturn\n\t\t}\n\n\t\tthis._currentAnimation?.cancel()\n\t\tcontainer.style.overflow = 'hidden'\n\t\tcontainer.style.willChange = 'opacity'\n\t\tconst openKeyframes: Keyframe[] = [\n\t\t\t{ clipPath: this.closedClipPath, opacity: 0.95 },\n\t\t\t{ clipPath: this.openClipPath, opacity: 1 },\n\t\t]\n\t\tconst anim = container.animate(openKeyframes, {\n\t\t\tduration: SPRING_SNAPPY.duration,\n\t\t\teasing: SPRING_SNAPPY.easingFallback,\n\t\t\tfill: 'forwards',\n\t\t})\n\t\tthis._currentAnimation = anim\n\n\t\tfrom(anim.finished).pipe(\n\t\t\ttake(1),\n\t\t\ttap(() => {\n\t\t\t\tif (container.isConnected) {\n\t\t\t\t\tcontainer.style.clipPath = ''\n\t\t\t\t\tcontainer.style.overflow = ''\n\t\t\t\t\tcontainer.style.willChange = ''\n\t\t\t\t}\n\t\t\t}),\n\t\t\tcatchError(() => EMPTY),\n\t\t\ttakeUntil(this.disconnecting),\n\t\t).subscribe()\n\n\t\tthis.dispatchScopedEvent('window-toggle', { state: 'expanded' })\n\t}\n\n\tprivate _animateClose() {\n\t\tconst container = this._containerRef.value\n\t\tif (!container) return\n\n\t\tif (reducedMotion$.value) {\n\t\t\tcontainer.style.clipPath = this.closedClipPath\n\t\t\tcontainer.style.overflow = 'hidden'\n\t\t\tthis.open = false\n\t\t\tconst body = this._bodyRef.value\n\t\t\tif (body) { body.inert = true; body.style.visibility = 'hidden' }\n\t\t\tthis.dispatchScopedEvent('window-toggle', { state: 'collapsed' })\n\t\t\treturn\n\t\t}\n\n\t\tthis._currentAnimation?.cancel()\n\t\tcontainer.style.overflow = 'hidden'\n\t\tcontainer.style.willChange = 'opacity'\n\t\tconst closeKeyframes: Keyframe[] = [\n\t\t\t{ clipPath: this.openClipPath, opacity: 1 },\n\t\t\t{ clipPath: this.closedClipPath, opacity: 0.95 },\n\t\t]\n\t\tconst anim = container.animate(closeKeyframes, {\n\t\t\tduration: Math.round(SPRING_SNAPPY.duration * 0.7),\n\t\t\teasing: 'cubic-bezier(0.4, 0, 0.8, 0.15)',\n\t\t\tfill: 'forwards',\n\t\t})\n\t\tthis._currentAnimation = anim\n\n\t\tfrom(anim.finished).pipe(\n\t\t\ttake(1),\n\t\t\ttap(() => {\n\t\t\t\tthis.open = false\n\t\t\t\tcontainer.style.willChange = ''\n\t\t\t\tconst body = this._bodyRef.value\n\t\t\t\tif (body) { body.inert = true; body.style.visibility = 'hidden' }\n\t\t\t}),\n\t\t\tcatchError(() => EMPTY),\n\t\t\ttakeUntil(this.disconnecting),\n\t\t).subscribe()\n\n\t\tthis.dispatchScopedEvent('window-toggle', { state: 'collapsed' })\n\t}\n\n\t// ============================================\n\t// VISUAL STATE HELPERS\n\t// ============================================\n\n\t/** Apply drag visuals directly on DOM refs — avoids full Lit re-render for cursor + opacity */\n\tprivate _applyDragVisuals(dragging: boolean) {\n\t\tconst head = this._headRef.value\n\t\tconst container = this._containerRef.value\n\t\tif (head) {\n\t\t\thead.classList.toggle('cursor-grabbing', dragging)\n\t\t\thead.classList.toggle('cursor-move', !dragging)\n\t\t}\n\t\tif (container) {\n\t\t\tcontainer.style.opacity = dragging ? '0.95' : ''\n\t\t}\n\t}\n\n\tprivate _handleFocus = () => windowManager.focus(this.id)\n\n\tprivate _handleHeadKeydown = (e: KeyboardEvent) => {\n\t\tif (e.key === 'Enter' || e.key === ' ') {\n\t\t\te.preventDefault()\n\t\t\tthis.toggle()\n\t\t\treturn\n\t\t}\n\t\tif (e.key === 'ArrowUp' || e.key === 'ArrowDown' || e.key === 'ArrowLeft' || e.key === 'ArrowRight') {\n\t\t\te.preventDefault()\n\t\t\tconst step = e.shiftKey ? 20 : 5\n\t\t\tconst dx = e.key === 'ArrowRight' ? step : e.key === 'ArrowLeft' ? -step : 0\n\t\t\tconst dy = e.key === 'ArrowDown' ? step : e.key === 'ArrowUp' ? -step : 0\n\t\t\tthis._position = { x: this._position.x + dx, y: this._position.y + dy }\n\t\t\tthis._applyContainerPosition()\n\t\t\tthis._savePosition()\n\t\t}\n\t}\n\n\t// ============================================\n\t// PUBLIC API\n\t// ============================================\n\n\ttoggle() {\n\t\tif (this.open) this._animateClose()\n\t\telse this._animateOpen()\n\t}\n\n\texpand() {\n\t\tif (this.open) return\n\t\tthis._animateOpen()\n\t}\n\n\tclose() {\n\t\tif (!this.open) return\n\t\tthis._animateClose()\n\t}\n\n\t// ============================================\n\t// RENDER\n\t// ============================================\n\n\tprotected render(): unknown {\n\t\tconst isBottom = this._currentCorner.startsWith('bottom')\n\n\t\tconst containerClasses = classMap({\n\t\t\tfixed: true,\n\t\t\tflex: true,\n\t\t\t'flex-col': isBottom,\n\t\t\t'flex-col-reverse': !isBottom,\n\t\t\t'z-1000': true,\n\t\t\t'rounded-2xl': this.open,\n\t\t\t'rounded-[22px]': !this.open,\n\t\t\t'overflow-hidden': true,\n\t\t})\n\n\t\tconst containerStyles = styleMap({\n\t\t\twidth: this.panelWidth,\n\t\t\t'max-height': 'calc(100vh - 32px)',\n\t\t\t'pointer-events': 'none',\n\t\t})\n\n\t\tconst bodyStyles = styleMap({\n\t\t\t'pointer-events': this.open ? 'auto' : 'none',\n\t\t})\n\n\t\tconst headClasses = classMap({\n\t\t\t'h-full': true,\n\t\t\t'px-3': true,\n\t\t\tflex: true,\n\t\t\t'items-center': true,\n\t\t\t'gap-2': true,\n\t\t\t'select-none': true,\n\t\t\t'cursor-move': true,\n\t\t})\n\n\t\treturn html`\n\t\t\t<schmancy-surface\n\t\t\t\t${ref(this._containerRef)}\n\t\t\t\ttype=\"glass\"\n\t\t\t\t.elevation=${this.elevation}\n\t\t\t\tclass=${containerClasses}\n\t\t\t\tstyle=${containerStyles}\n\t\t\t\taria-expanded=${this.open}\n\t\t\t\t@pointerdown=${this._handleFocus}\n\t\t\t>\n\t\t\t\t<!-- Details section (visually above summary for bottom corners) -->\n\t\t\t\t<section\n\t\t\t\t\t${ref(this._bodyRef)}\n\t\t\t\t\tclass=\"flex-1 min-h-0 overflow-hidden flex flex-col\"\n\t\t\t\t\tstyle=${bodyStyles}\n\t\t\t\t\trole=\"region\"\n\t\t\t\t\taria-label=\"Expandable content\"\n\t\t\t\t>\n\t\t\t\t\t${this._hasOpened ? html`<slot name=\"details\"></slot>` : nothing}\n\t\t\t\t</section>\n\n\t\t\t\t<!-- Summary section -- always interactive, always visible -->\n\t\t\t\t<section\n\t\t\t\t\tclass=\"shrink-0 bg-surface-lowest\"\n\t\t\t\t\tstyle=${styleMap({ 'pointer-events': 'auto', height: `${HEAD_HEIGHT}px` })}\n\t\t\t\t>\n\t\t\t\t\t<div\n\t\t\t\t\t\t${ref(this._headRef)}\n\t\t\t\t\t\t${cursorGlow({ radius: 200, intensity: 0.10 })}\n\t\t\t\t\t\tclass=${headClasses}\n\t\t\t\t\t\trole=\"button\"\n\t\t\t\t\t\ttabindex=\"0\"\n\t\t\t\t\t\ttitle=\"Drag to move, click to expand\"\n\t\t\t\t\t\taria-label=\"${this.open ? 'Collapse window' : 'Expand window'}\"\n\t\t\t\t\t\t@keydown=${this._handleHeadKeydown}\n\t\t\t\t\t>\n\t\t\t\t\t\t<div class=\"flex-1 min-w-0\">\n\t\t\t\t\t\t\t<slot></slot>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<svg\n\t\t\t\t\t\t\twidth=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\"\n\t\t\t\t\t\t\tclass=\"shrink-0 text-surface-on/40 transition-transform duration-200 ${this.open ? 'rotate-180' : ''}\"\n\t\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<path d=\"M6 9L12 15L18 9\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" />\n\t\t\t\t\t\t</svg>\n\t\t\t\t\t</div>\n\t\t\t\t</section>\n\t\t\t</schmancy-surface>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-window': SchmancyWindow\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;AAmBA,IAAM,IAAiB,oBACjB,IAAwB;AAmL9B,SAAS,EAAa,GAAiB,GAAA;CACtC,OAAA,EAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE;AACzH;AAEA,IAAA,GAAa,IArLb,MAAM,EAAA;CAWL,cAAA;EAAA,KAAA,UAR2B,IAAI,EAAqC;GACnE,yBAAS,IAAI,IAAA;GACb,WAAW;GACX,YAAY,CAAA;EAAA,CAAA,GAAA,KAAA,SAGK,KAAK,QAAQ,aAAA;CAER;CAEvB,OAAA,cAAO;EAIN,OAHK,AACJ,EAAqB,aAAW,IAAI,KAE9B,EAAqB;CAC7B;CAIA,IAAA,UAAI;EACH,OAAO,KAAK,QAAQ,MAAM;CAC3B;CAEA,IAAA,YAAI;EACH,OAAO,KAAK,QAAQ,MA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A,EAAA,CAE1B,EAAS,EAAE,MAAM,QAAA,CAAA,CAAA,GAAS,EAAA,WAAA,gBAAA,KAAA,CAAA,GAAA,EAAA,CAE1B,EAAS;CAAE,MAAM;CAAQ,SAAA,CAAS;AAAA,CAAA,CAAA,GAAM,EAAA,WAAA,eAAA,KAAA,CAAA,GAAA,EAAA,CAExC,EAAS,EAAE,MAAM,OAAA,CAAA,CAAA,GAAQ,EAAA,WAAA,YAAA,KAAA,CAAA,GAAA,EAAA,CAEzB,EAAS,EAAE,MAAM,OAAA,CAAA,CAAA,GAAQ,EAAA,WAAA,aAAA,KAAA,CAAA,GAAA,EAAA,CAGzB,EAAS;CAAE,MAAM;CAAS,SAAA,CAAS;AAAA,CAAA,CAAA,GAAM,EAAA,WAAA,QAAA,KAAA,CAAA,GAAA,EAAA,CAKzC,EAAA,CAAA,GAAM,EAAA,WAAA,cAAA,KAAA,CAAA,GAAA,EAAA,CAIN,EAAA,CAAA,GAAM,EAAA,WAAA,kBAAA,KAAA,CAAA;AAAA,IAAA,IAAA,IAAA,IAAA,EAAA,CA3CP,EAAc,iBAAA,CAAA,GAAiB,CAAA;AAAA,SAAA,KAAA,GAAA,KAAA"}
1
+ {"version":3,"file":"window-C_ATa3qM.js","names":[],"sources":["../src/window/window-manager.ts","../src/window/window-position.ts","../src/window/window.ts"],"sourcesContent":["/**\n * Window Manager — singleton service for multi-window coordination.\n *\n * Tracks all schmancy-window instances: positions, z-indices, focus, visual states.\n * Components register on connectedCallback, unregister on disconnectedCallback.\n * Focus changes, position updates, and overlap queries all flow through here.\n *\n * Follows the ThemeService singleton pattern (theme/theme.service.ts).\n *\n * Example:\n * windowManager.register('chat-1', bounds, 'bottom-right')\n * windowManager.focus('chat-1') // bumps z-index, updates focusedId\n * const overlaps = windowManager.findOverlaps(projectedBounds, 'chat-1')\n */\n\nimport { BehaviorSubject, Observable, distinctUntilChanged, map } from 'rxjs'\nimport { overlayStack } from '../utils/overlay-stack.js'\nimport type { WindowBounds, WindowRecord, WindowRegistryState, SnapTarget } from './window-registry.js'\n\nconst STORAGE_PREFIX = 'schmancy-window-'\nconst LEGACY_STORAGE_PREFIX = 'schmancy-float-'\n\nclass WindowManagerService {\n\tprivate static instance: WindowManagerService\n\n\tprivate readonly _state$ = new BehaviorSubject<WindowRegistryState>({\n\t\twindows: new Map(),\n\t\tfocusedId: null,\n\t\tstackOrder: [],\n\t})\n\n\treadonly state$ = this._state$.asObservable()\n\n\tprivate constructor() {}\n\n\tstatic getInstance(): WindowManagerService {\n\t\tif (!WindowManagerService.instance) {\n\t\t\tWindowManagerService.instance = new WindowManagerService()\n\t\t}\n\t\treturn WindowManagerService.instance\n\t}\n\n\t// ── Synchronous accessors ──────────────────────────────────────────\n\n\tget windows(): Map<string, WindowRecord> {\n\t\treturn this._state$.value.windows\n\t}\n\n\tget focusedId(): string | null {\n\t\treturn this._state$.value.focusedId\n\t}\n\n\t// ── Registration ───────────────────────────────────────────────────\n\n\tregister(id: string, initialBounds: WindowBounds, snapTarget: SnapTarget): void {\n\t\tconst state = this._state$.value\n\t\tif (state.windows.has(id)) return\n\n\t\tconst zIndex = overlayStack.assignZIndex(id)\n\t\tconst record: WindowRecord = {\n\t\t\tid,\n\t\t\tbounds: initialBounds,\n\t\t\tvisualState: 'normal',\n\t\t\tzIndex,\n\t\t\topen: false,\n\t\t\tsnapTarget,\n\t\t}\n\n\t\tconst windows = new Map(state.windows)\n\t\twindows.set(id, record)\n\t\tconst stackOrder = overlayStack.getStackOrder()\n\n\t\tthis._state$.next({ ...state, windows, stackOrder })\n\t}\n\n\tunregister(id: string): void {\n\t\tconst state = this._state$.value\n\t\tif (!state.windows.has(id)) return\n\n\t\toverlayStack.releaseId(id)\n\t\tconst windows = new Map(state.windows)\n\t\twindows.delete(id)\n\t\tconst stackOrder = overlayStack.getStackOrder()\n\t\tconst focusedId = state.focusedId === id ? null : state.focusedId\n\n\t\tthis._state$.next({ ...state, windows, stackOrder, focusedId })\n\t}\n\n\t// ── State mutations ────────────────────────────────────────────────\n\n\tupdateBounds(id: string, bounds: WindowBounds): void {\n\t\tthis._updateRecord(id, { bounds })\n\t}\n\n\tupdateVisualState(id: string, visualState: WindowRecord['visualState']): void {\n\t\tthis._updateRecord(id, { visualState })\n\t}\n\n\tupdateOpen(id: string, open: boolean): void {\n\t\tthis._updateRecord(id, { open })\n\t}\n\n\tfocus(id: string): void {\n\t\tconst state = this._state$.value\n\t\tif (!state.windows.has(id)) return\n\t\tif (state.focusedId === id) return\n\n\t\tconst zIndex = overlayStack.bringToFront(id)\n\t\tconst windows = new Map(state.windows)\n\t\tconst record = windows.get(id)\n\t\tif (record) {\n\t\t\twindows.set(id, { ...record, zIndex })\n\t\t}\n\t\tconst stackOrder = overlayStack.getStackOrder()\n\n\t\tthis._state$.next({ ...state, windows, stackOrder, focusedId: id })\n\t}\n\n\t// ── Queries ────────────────────────────────────────────────────────\n\n\tfindOverlaps(bounds: WindowBounds, excludeId: string): WindowRecord[] {\n\t\tconst result: WindowRecord[] = []\n\t\tfor (const [id, record] of this._state$.value.windows) {\n\t\t\tif (id === excludeId) continue\n\t\t\tif (rectsOverlap(bounds, record.bounds)) {\n\t\t\t\tresult.push(record)\n\t\t\t}\n\t\t}\n\t\treturn result\n\t}\n\n\tgetNeighbors(id: string): WindowRecord[] {\n\t\tconst result: WindowRecord[] = []\n\t\tfor (const [otherId, record] of this._state$.value.windows) {\n\t\t\tif (otherId !== id) result.push(record)\n\t\t}\n\t\treturn result\n\t}\n\n\t// ── Selectors ──────────────────────────────────────────────────────\n\n\tselectWindow(id: string): Observable<WindowRecord | undefined> {\n\t\treturn this._state$.pipe(\n\t\t\tmap(state => state.windows.get(id)),\n\t\t\tdistinctUntilChanged(),\n\t\t)\n\t}\n\n\tselectFocused(): Observable<string | null> {\n\t\treturn this._state$.pipe(\n\t\t\tmap(state => state.focusedId),\n\t\t\tdistinctUntilChanged(),\n\t\t)\n\t}\n\n\t// ── Persistence ────────────────────────────────────────────────────\n\n\tloadPosition(id: string): { x: number; y: number; anchor: string } | null {\n\t\ttry {\n\t\t\t// Try new key first, fall back to legacy\n\t\t\tconst raw = localStorage.getItem(STORAGE_PREFIX + id) ?? localStorage.getItem(LEGACY_STORAGE_PREFIX + id)\n\t\t\tif (!raw) return null\n\t\t\treturn JSON.parse(raw) as { x: number; y: number; anchor: string }\n\t\t} catch {\n\t\t\treturn null\n\t\t}\n\t}\n\n\tsavePosition(id: string, data: { x: number; y: number; anchor: string }): void {\n\t\ttry {\n\t\t\tlocalStorage.setItem(STORAGE_PREFIX + id, JSON.stringify(data))\n\t\t} catch {\n\t\t\t// ignore\n\t\t}\n\t}\n\n\tclearPosition(id: string): void {\n\t\ttry {\n\t\t\tlocalStorage.removeItem(STORAGE_PREFIX + id)\n\t\t\tlocalStorage.removeItem(LEGACY_STORAGE_PREFIX + id)\n\t\t} catch {\n\t\t\t// ignore\n\t\t}\n\t}\n\n\t// ── Internal ───────────────────────────────────────────────────────\n\n\tprivate _updateRecord(id: string, updates: Partial<WindowRecord>): void {\n\t\tconst state = this._state$.value\n\t\tconst record = state.windows.get(id)\n\t\tif (!record) return\n\n\t\tconst windows = new Map(state.windows)\n\t\twindows.set(id, { ...record, ...updates })\n\t\tthis._state$.next({ ...state, windows })\n\t}\n}\n\n/** Simple rect overlap check (inline — no circular import with window-position) */\nfunction rectsOverlap(a: WindowBounds, b: WindowBounds): boolean {\n\treturn !(a.left >= b.left + b.width || a.left + a.width <= b.left || a.top >= b.top + b.height || a.top + a.height <= b.top)\n}\n\nexport const windowManager = WindowManagerService.getInstance()\n","/**\n * Window Position — pure functions for overlap resolution, cascade, and snapping.\n *\n * All functions are stateless: they take window bounds and viewport dimensions,\n * return new bounds. No side effects, no DOM access, no subscriptions.\n *\n * Example:\n * const projected = { left: 100, top: 400, width: 360, height: 500 }\n * const neighbors = windowManager.findOverlaps(projected, 'my-id')\n * const resolved = resolveOverlap(projected, neighbors, { width: 1440, height: 900 })\n * // → { left: 144, top: 444, width: 360, height: 500 } (cascaded away from conflict)\n */\n\nimport type { WindowBounds, WindowRecord } from './window-registry.js'\n\nconst HEAD_HEIGHT = 44\nconst CASCADE_OFFSET = HEAD_HEIGHT\nconst MAX_CASCADE_ATTEMPTS = 10\n\n/** Check if two rectangles overlap (edges touching does NOT count as overlap) */\nexport function rectsOverlap(a: WindowBounds, b: WindowBounds): boolean {\n\treturn !(a.left >= b.left + b.width || a.left + a.width <= b.left || a.top >= b.top + b.height || a.top + a.height <= b.top)\n}\n\n/**\n * Resolve overlap by cascading diagonally until no conflict.\n * Shifts by (HEAD_HEIGHT, HEAD_HEIGHT) per attempt, clamped to viewport.\n */\nexport function resolveOverlap(\n\tcandidate: WindowBounds,\n\texisting: WindowRecord[],\n\tviewport: { width: number; height: number },\n): WindowBounds {\n\tconst bounds = { ...candidate }\n\n\tfor (let attempt = 0; attempt < MAX_CASCADE_ATTEMPTS; attempt++) {\n\t\tconst hasOverlap = existing.some(w => rectsOverlap(bounds, w.bounds))\n\t\tif (!hasOverlap) break\n\n\t\tbounds.left += CASCADE_OFFSET\n\t\tbounds.top += CASCADE_OFFSET\n\t}\n\n\treturn clampToViewport(bounds, viewport)\n}\n\n/**\n * Clamp bounds so the window stays fully within the viewport.\n */\nexport function clampToViewport(\n\tbounds: WindowBounds,\n\tviewport: { width: number; height: number },\n): WindowBounds {\n\treturn {\n\t\twidth: bounds.width,\n\t\theight: bounds.height,\n\t\tleft: Math.max(0, Math.min(bounds.left, viewport.width - bounds.width)),\n\t\ttop: Math.max(0, Math.min(bounds.top, viewport.height - bounds.height)),\n\t}\n}\n","import { SchmancyElement } from '@mixins/index'\nimport { css, html, nothing } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\nimport { classMap } from 'lit/directives/class-map.js'\nimport { createRef, ref } from 'lit/directives/ref.js'\nimport { styleMap } from 'lit/directives/style-map.js'\nimport {\n\tanimationFrameScheduler,\n\tauditTime,\n\tcatchError,\n\tEMPTY,\n\tfilter,\n\tfinalize,\n\tfrom,\n\tfromEvent,\n\tmap,\n\tmerge,\n\tObservable,\n\tswitchMap,\n\ttake,\n\ttakeUntil,\n\ttap,\n} from 'rxjs'\nimport { SPRING_SMOOTH, SPRING_SNAPPY } from '../utils/animation.js'\nimport { cursorGlow } from '../directives/cursor-glow'\nimport { reducedMotion$ } from '../directives/reduced-motion'\nimport { theme } from '../theme/theme.service.js'\nimport type { SnapCorner, WindowBounds, WindowVisualState } from './window-registry.js'\nimport { windowManager } from './window-manager.js'\nimport { resolveOverlap } from './window-position.js'\n\nconst HEAD_HEIGHT = 48\nconst DRAG_THRESHOLD = 5\n\ninterface Position {\n\tx: number\n\ty: number\n}\n\n@customElement('schmancy-window')\nexport default class SchmancyWindow extends SchmancyElement {\n\tstatic styles = [css`\n\t:host {\n\t\tdisplay: contents;\n\t\tposition: relative;\n\t\tz-index: 1000;\n\t}\n\t:host([hidden]) {\n\t\tdisplay: none !important;\n\t}\n`]\n\n\t@property({ type: String }) id: string = 'default'\n\t/** Override the expanded panel width (e.g. '320px', '24rem'). Defaults to responsive sizing. */\n\t@property({ type: String }) expandedWidth?: string\n\t/** Override the expanded panel height (e.g. '400px', '50vh'). */\n\t@property({ type: String }) expandedHeight?: string\n\t/** When true, uses a lower elevation shadow in the collapsed state. */\n\t@property({ type: Boolean, reflect: true }) lowered: boolean = false\n\t/** Corner the window is anchored to. */\n\t@property({ type: String }) corner: SnapCorner = 'bottom-right'\n\t/** When true, window can be resized by the user. */\n\t@property({ type: Boolean }) resizable = false\n\t/** When true, window stays at its dragged position instead of snapping to a corner. */\n\t@property({ type: Boolean }) freePosition = false\n\t/** Visual state of the window (minimized, normal, maximized). */\n\t@property({ type: String, reflect: true }) visualState: WindowVisualState = 'normal'\n\t/** Minimum width in pixels. */\n\t@property({ type: Number }) minWidth = 280\n\t/** Minimum height in pixels. */\n\t@property({ type: Number }) minHeight = 200\n\n\t/** Whether the body is expanded. */\n\t@property({ type: Boolean, reflect: true }) open = false\n\n\tprivate _currentAnimation?: Animation\n\n\t/** Lazy rendering: body content not in DOM until first expand. */\n\t@state() private _hasOpened = false\n\n\t// Internal position -- plain fields, updated directly during drag\n\tprivate _position: Position = { x: 16, y: 16 }\n\t@state() private _currentCorner: SnapCorner = 'bottom-right'\n\n\t// Track applied corner to avoid unnecessary style.removeProperty calls during drag\n\tprivate _appliedCorner: string = ''\n\n\t// Refs\n\tprivate _containerRef = createRef<HTMLElement>()\n\tprivate _bodyRef = createRef<HTMLElement>()\n\tprivate _headRef = createRef<HTMLElement>()\n\n\t// ============================================\n\t// COMPUTED\n\t// ============================================\n\n\tprivate get panelWidth(): string {\n\t\treturn this.expandedWidth ?? 'min(360px, calc(100vw - 32px))'\n\t}\n\n\tprivate get isBottomCorner(): boolean {\n\t\treturn this._currentCorner.startsWith('bottom')\n\t}\n\n\tprivate get closedClipPath(): string {\n\t\treturn this.isBottomCorner\n\t\t\t? `inset(calc(100% - ${HEAD_HEIGHT}px) 0px 0px 0px round 22px)`\n\t\t\t: `inset(0px 0px calc(100% - ${HEAD_HEIGHT}px) 0px round 22px)`\n\t}\n\n\tprivate get openClipPath(): string {\n\t\treturn 'inset(0px 0px 0px 0px round 12px)'\n\t}\n\n\tprivate get elevation(): 0 | 1 | 2 | 3 | 4 | 5 {\n\t\tif (this.open) return 4\n\t\treturn this.lowered ? 1 : 3\n\t}\n\n\t// ============================================\n\t// POSITION MANAGEMENT\n\t// ============================================\n\n\tprivate _applyContainerPosition() {\n\t\tconst container = this._containerRef.value\n\t\tif (!container) return\n\t\t// Only clear position properties when corner changes (avoids 4 style invalidations per drag frame)\n\t\tif (this._appliedCorner !== this._currentCorner) {\n\t\t\tcontainer.style.removeProperty('left')\n\t\t\tcontainer.style.removeProperty('right')\n\t\t\tcontainer.style.removeProperty('top')\n\t\t\tcontainer.style.removeProperty('bottom')\n\t\t\tthis._appliedCorner = this._currentCorner\n\t\t}\n\t\tconst { x, y } = this._position\n\t\tif (this._currentCorner.includes('right')) {\n\t\t\tcontainer.style.right = `${x}px`\n\t\t} else {\n\t\t\tcontainer.style.left = `${x}px`\n\t\t}\n\t\tif (this._currentCorner.includes('bottom')) {\n\t\t\tcontainer.style.bottom = `${y + theme.bottomOffset}px`\n\t\t} else {\n\t\t\tcontainer.style.top = `${y}px`\n\t\t}\n\t}\n\n\tprivate static readonly VALID_CORNERS = new Set<string>(['top-left', 'top-right', 'bottom-left', 'bottom-right'])\n\n\tprivate _loadPosition() {\n\t\tconst saved = windowManager.loadPosition(this.id)\n\t\tif (saved) {\n\t\t\tthis._position = { x: saved.x, y: saved.y }\n\t\t\tif (SchmancyWindow.VALID_CORNERS.has(saved.anchor)) {\n\t\t\t\tthis._currentCorner = saved.anchor as SnapCorner\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate _savePosition() {\n\t\twindowManager.savePosition(this.id, { ...this._position, anchor: this._currentCorner })\n\t}\n\n\tprivate _validateBounds() {\n\t\tconst container = this._containerRef.value\n\t\tif (!container) return\n\t\tconst rect = container.getBoundingClientRect()\n\t\tif (rect.width === 0) return\n\t\tconst vw = window.innerWidth\n\t\tconst vh = window.innerHeight\n\t\tconst isRight = this._currentCorner.includes('right')\n\t\tconst isBottom = this._currentCorner.includes('bottom')\n\t\tconst actualLeft = isRight ? vw - this._position.x - rect.width : this._position.x\n\t\tconst actualTop = isBottom ? vh - this._position.y - rect.height : this._position.y\n\t\tconst newLeft = Math.max(0, Math.min(actualLeft, vw - rect.width))\n\t\tconst newTop = Math.max(0, Math.min(actualTop, vh - rect.height))\n\t\tthis._position = {\n\t\t\tx: isRight ? vw - newLeft - rect.width : newLeft,\n\t\t\ty: isBottom ? vh - newTop - rect.height : newTop,\n\t\t}\n\t\tthis._applyContainerPosition()\n\t}\n\n\t// ============================================\n\t// CORNER SNAPPING\n\t// ============================================\n\n\tprivate _reorientToNearestCorner(skipAnimation = false): void {\n\t\t// Free position mode: skip corner snapping\n\t\tif (this.freePosition) {\n\t\t\tthis._savePosition()\n\t\t\tconst rect = this._containerRef.value?.getBoundingClientRect()\n\t\t\tif (rect) {\n\t\t\t\twindowManager.updateBounds(this.id, { left: rect.left, top: rect.top, width: rect.width, height: rect.height })\n\t\t\t}\n\t\t\treturn\n\t\t}\n\n\t\tconst container = this._containerRef.value\n\t\tif (!container) return\n\n\t\t// F -- record current screen position before DOM mutation\n\t\tconst rect = container.getBoundingClientRect()\n\n\t\t// L -- calculate nearest corner using head visual center\n\t\tconst currentIsBottom = this._currentCorner.includes('bottom')\n\t\tconst headCenterX = rect.left + rect.width / 2\n\t\tconst headCenterY = currentIsBottom\n\t\t\t? rect.bottom - HEAD_HEIGHT / 2\n\t\t\t: rect.top + HEAD_HEIGHT / 2\n\t\tconst side = headCenterX > window.innerWidth / 2 ? 'right' : 'left'\n\t\tconst vert = headCenterY > window.innerHeight / 2 ? 'bottom' : 'top'\n\t\tconst newCorner: SnapCorner = `${vert}-${side}` as SnapCorner\n\n\t\t// Snap corner and reset offset to standard edge gap\n\t\tthis._currentCorner = newCorner\n\t\tthis._position = { x: 16, y: 16 }\n\t\tthis._applyContainerPosition()\n\t\t// Sync clip-path to new corner\n\t\tif (!this.open) {\n\t\t\tcontainer.style.clipPath = this.closedClipPath\n\t\t}\n\n\t\tif (skipAnimation || reducedMotion$.value) {\n\t\t\tthis._savePosition()\n\t\t\tconst snapRect = container.getBoundingClientRect()\n\t\t\twindowManager.updateBounds(this.id, { left: snapRect.left, top: snapRect.top, width: snapRect.width, height: snapRect.height })\n\t\t\treturn\n\t\t}\n\n\t\t// I -- invert: shift element back to its original visual position\n\t\tconst newRect = container.getBoundingClientRect()\n\t\tconst dx = rect.left - newRect.left\n\t\tconst dy = rect.top - newRect.top\n\t\tcontainer.style.translate = `${dx}px ${dy}px`\n\n\t\t// P -- play: animate from the inverse offset to natural resting position\n\t\tconst flipKeyframes: Keyframe[] = [{ translate: `${dx}px ${dy}px` }, { translate: '0px 0px' }]\n\t\tconst anim = container.animate(\n\t\t\tflipKeyframes,\n\t\t\t{\n\t\t\t\tduration: SPRING_SMOOTH.duration,\n\t\t\t\teasing: SPRING_SMOOTH.easingFallback,\n\t\t\t\tfill: 'forwards',\n\t\t\t},\n\t\t)\n\t\tfrom(anim.finished).pipe(\n\t\t\ttake(1),\n\t\t\ttap(() => {\n\t\t\t\tif (container.isConnected) container.style.translate = ''\n\t\t\t\t// Report final resting bounds after animation completes\n\t\t\t\tconst finalRect = container.getBoundingClientRect()\n\t\t\t\twindowManager.updateBounds(this.id, { left: finalRect.left, top: finalRect.top, width: finalRect.width, height: finalRect.height })\n\t\t\t}),\n\t\t\tcatchError(() => EMPTY),\n\t\t\ttakeUntil(this.disconnecting),\n\t\t).subscribe()\n\n\t\tthis._savePosition()\n\t}\n\n\t// ============================================\n\t// DRAG PIPELINE\n\t// ============================================\n\n\tprivate _drag$(): Observable<never> {\n\t\treturn new Observable(() => {\n\t\t\tconst head = this._headRef.value\n\t\t\tconst container = this._containerRef.value\n\t\t\tif (!head || !container) return\n\n\t\t\tlet didDrag = false\n\n\t\t\tconst sub = fromEvent<PointerEvent>(head, 'pointerdown').pipe(\n\t\t\t\tfilter(e => e.button === 0),\n\t\t\t\tfilter(e => {\n\t\t\t\t\tconst tag = (e.target as HTMLElement).tagName?.toLowerCase()\n\t\t\t\t\treturn !['input', 'textarea', 'select', 'button'].includes(tag)\n\t\t\t\t\t\t&& !(e.target as HTMLElement).closest('schmancy-input, schmancy-icon-button, button, a')\n\t\t\t\t}),\n\t\t\t\ttap(e => {\n\t\t\t\t\te.preventDefault()\n\t\t\t\t\te.stopPropagation()\n\t\t\t\t}),\n\t\t\t)\n\t\t\t\t.pipe(\n\t\t\t\t\tmap(e => {\n\t\t\t\t\t\tconst rect = container.getBoundingClientRect()\n\t\t\t\t\t\tconst isBottom = this._currentCorner.includes('bottom')\n\t\t\t\t\t\tconst wasOpen = this.open\n\t\t\t\t\t\tdidDrag = false\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tstartX: e.clientX,\n\t\t\t\t\t\t\tstartY: e.clientY,\n\t\t\t\t\t\t\toffsetX: e.clientX - rect.left,\n\t\t\t\t\t\t\toffsetY: e.clientY - rect.top,\n\t\t\t\t\t\t\trect,\n\t\t\t\t\t\t\tvw: window.innerWidth,\n\t\t\t\t\t\t\tvh: window.innerHeight,\n\t\t\t\t\t\t\tisBottom,\n\t\t\t\t\t\t\twasOpen,\n\t\t\t\t\t\t\tpointerId: e.pointerId,\n\t\t\t\t\t\t}\n\t\t\t\t\t}),\n\t\t\t\t\tswitchMap(({ startX, startY, offsetX, offsetY, rect, vw, vh, isBottom, wasOpen, pointerId }) => {\n\t\t\t\t\t\tconst move$ = fromEvent<PointerEvent>(window, 'pointermove').pipe(\n\t\t\t\t\t\t\tfilter(e => e.pointerId === pointerId),\n\t\t\t\t\t\t\tauditTime(0, animationFrameScheduler),\n\t\t\t\t\t\t\tmap(e => ({ clientX: e.clientX, clientY: e.clientY })),\n\t\t\t\t\t\t)\n\t\t\t\t\t\tconst end$ = fromEvent<PointerEvent>(window, 'pointerup').pipe(\n\t\t\t\t\t\t\tfilter(e => e.pointerId === pointerId),\n\t\t\t\t\t\t)\n\n\t\t\t\t\t\treturn move$.pipe(\n\t\t\t\t\t\t\ttap(({ clientX, clientY }) => {\n\t\t\t\t\t\t\t\tconst dx = clientX - startX\n\t\t\t\t\t\t\t\tconst dy = clientY - startY\n\t\t\t\t\t\t\t\tif (Math.sqrt(dx * dx + dy * dy) > DRAG_THRESHOLD && !didDrag) {\n\t\t\t\t\t\t\t\t\tdidDrag = true\n\t\t\t\t\t\t\t\t\tthis._applyDragVisuals(true)\n\t\t\t\t\t\t\t\t\t// Collapse on first confirmed drag move\n\t\t\t\t\t\t\t\t\tif (wasOpen) {\n\t\t\t\t\t\t\t\t\t\tthis.open = false\n\t\t\t\t\t\t\t\t\t\tcontainer.style.clipPath = this.closedClipPath\n\t\t\t\t\t\t\t\t\t\tcontainer.style.overflow = 'hidden'\n\t\t\t\t\t\t\t\t\t\tconst body = this._bodyRef.value\n\t\t\t\t\t\t\t\t\t\tif (body) {\n\t\t\t\t\t\t\t\t\t\t\tbody.inert = true\n\t\t\t\t\t\t\t\t\t\t\tbody.style.visibility = 'hidden'\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (!didDrag) return\n\n\t\t\t\t\t\t\t\tconst left = Math.max(0, Math.min(clientX - offsetX, vw - rect.width))\n\t\t\t\t\t\t\t\tconst minTop = isBottom ? HEAD_HEIGHT - rect.height : 0\n\t\t\t\t\t\t\t\tconst maxTop = isBottom ? vh - rect.height : vh - HEAD_HEIGHT\n\t\t\t\t\t\t\t\tconst top = Math.max(minTop, Math.min(clientY - offsetY, maxTop))\n\n\t\t\t\t\t\t\t\tthis._position = {\n\t\t\t\t\t\t\t\t\tx: this._currentCorner.includes('right') ? vw - left - rect.width : left,\n\t\t\t\t\t\t\t\t\ty: isBottom ? vh - top - rect.height : top,\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tthis._applyContainerPosition()\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\ttakeUntil(end$),\n\t\t\t\t\t\t\tfinalize(() => {\n\t\t\t\t\t\t\t\tif (didDrag) {\n\t\t\t\t\t\t\t\t\tthis._reorientToNearestCorner()\n\t\t\t\t\t\t\t\t\tthis._applyDragVisuals(false)\n\t\t\t\t\t\t\t\t\tdidDrag = false\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tdidDrag = false\n\t\t\t\t\t\t\t\t\tthis.toggle()\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t)\n\t\t\t\t\t}),\n\t\t\t\t)\n\t\t\t\t.subscribe()\n\n\t\t\treturn () => sub.unsubscribe()\n\t\t})\n\t}\n\n\t// ============================================\n\t// LIFECYCLE\n\t// ============================================\n\n\tconnectedCallback() {\n\t\tsuper.connectedCallback()\n\n\t\t// Pipeline 1: DOM setup + manager registration + drag + z-index sync\n\t\tfrom(this.updateComplete).pipe(\n\t\t\ttake(1),\n\t\t\ttap(() => {\n\t\t\t\tthis._currentCorner = this.corner\n\t\t\t\tthis._loadPosition()\n\t\t\t\tthis._applyContainerPosition()\n\t\t\t\tthis._initDOMState()\n\t\t\t\t// Register with window manager\n\t\t\t\tconst container = this._containerRef.value\n\t\t\t\tif (container) {\n\t\t\t\t\tconst rect = container.getBoundingClientRect()\n\t\t\t\t\tconst bounds: WindowBounds = { left: rect.left, top: rect.top, width: rect.width, height: rect.height }\n\t\t\t\t\twindowManager.register(this.id, bounds, this.freePosition ? 'free' : this._currentCorner)\n\t\t\t\t}\n\t\t\t}),\n\t\t\tswitchMap(() => merge(\n\t\t\t\tthis._drag$(),\n\t\t\t\twindowManager.selectWindow(this.id).pipe(\n\t\t\t\t\ttap(record => {\n\t\t\t\t\t\tif (!record) return\n\t\t\t\t\t\tconst container = this._containerRef.value\n\t\t\t\t\t\tif (container) container.style.zIndex = String(record.zIndex)\n\t\t\t\t\t}),\n\t\t\t\t),\n\t\t\t)),\n\t\t\ttakeUntil(this.disconnecting),\n\t\t).subscribe()\n\n\n\t\t// Pipeline 3: Environment -- one subscription\n\t\tmerge(\n\t\t\tfromEvent(window, 'resize').pipe(\n\t\t\t\tauditTime(0, animationFrameScheduler),\n\t\t\t\ttap(() => this._validateBounds()),\n\t\t\t),\n\t\t\ttheme.bottomOffset$.pipe(\n\t\t\t\ttap(() => this._applyContainerPosition()),\n\t\t\t),\n\t\t).pipe(takeUntil(this.disconnecting)).subscribe()\n\t}\n\n\tdisconnectedCallback() {\n\t\tsuper.disconnectedCallback()\n\t\twindowManager.unregister(this.id)\n\t}\n\n\tprivate _initDOMState() {\n\t\tconst container = this._containerRef.value\n\t\tconst body = this._bodyRef.value\n\t\tif (!container) return\n\n\t\tthis._applyContainerPosition()\n\n\t\tif (this.open) {\n\t\t\tthis._hasOpened = true\n\t\t\tcontainer.style.overflow = ''\n\t\t\tif (body) {\n\t\t\t\tbody.inert = false\n\t\t\t\tbody.style.visibility = 'visible'\n\t\t\t}\n\t\t} else {\n\t\t\tcontainer.style.clipPath = this.closedClipPath\n\t\t\tcontainer.style.overflow = 'hidden'\n\t\t\tif (body) {\n\t\t\t\tbody.inert = true\n\t\t\t\tbody.style.visibility = 'hidden'\n\t\t\t}\n\t\t}\n\t}\n\n\t// ============================================\n\t// ANIMATION\n\t// ============================================\n\n\tprivate _animateOpen() {\n\t\tconst container = this._containerRef.value\n\t\tconst body = this._bodyRef.value\n\t\tif (!container) return\n\n\t\tthis._hasOpened = true\n\t\tthis.open = true\n\n\t\t// Overlap avoidance\n\t\tconst rect = container.getBoundingClientRect()\n\t\tconst projectedBounds: WindowBounds = {\n\t\t\tleft: rect.left,\n\t\t\ttop: this.isBottomCorner ? rect.top - 400 : rect.top,\n\t\t\twidth: rect.width,\n\t\t\theight: 400 + HEAD_HEIGHT,\n\t\t}\n\t\tconst overlaps = windowManager.findOverlaps(projectedBounds, this.id)\n\t\tif (overlaps.length > 0) {\n\t\t\tconst resolved = resolveOverlap(projectedBounds, overlaps, { width: window.innerWidth, height: window.innerHeight })\n\t\t\tif (Math.abs(resolved.left - projectedBounds.left) > 10 || Math.abs(resolved.top - projectedBounds.top) > 10) {\n\t\t\t\tconst isRight = this._currentCorner.includes('right')\n\t\t\t\tconst isBottom = this._currentCorner.includes('bottom')\n\t\t\t\tthis._position = {\n\t\t\t\t\tx: isRight ? window.innerWidth - resolved.left - resolved.width : resolved.left,\n\t\t\t\t\ty: isBottom ? window.innerHeight - resolved.top - resolved.height : resolved.top,\n\t\t\t\t}\n\t\t\t\tthis._applyContainerPosition()\n\t\t\t}\n\t\t}\n\n\t\tif (body) {\n\t\t\tbody.style.visibility = 'visible'\n\t\t\tbody.inert = false\n\t\t}\n\n\t\tif (reducedMotion$.value) {\n\t\t\tcontainer.style.clipPath = ''\n\t\t\tcontainer.style.overflow = ''\n\t\t\tthis.dispatchScopedEvent('window-toggle', { state: 'expanded' })\n\t\t\treturn\n\t\t}\n\n\t\tthis._currentAnimation?.cancel()\n\t\tcontainer.style.overflow = 'hidden'\n\t\tcontainer.style.willChange = 'opacity'\n\t\tconst openKeyframes: Keyframe[] = [\n\t\t\t{ clipPath: this.closedClipPath, opacity: 0.95 },\n\t\t\t{ clipPath: this.openClipPath, opacity: 1 },\n\t\t]\n\t\tconst anim = container.animate(openKeyframes, {\n\t\t\tduration: SPRING_SNAPPY.duration,\n\t\t\teasing: SPRING_SNAPPY.easingFallback,\n\t\t\tfill: 'forwards',\n\t\t})\n\t\tthis._currentAnimation = anim\n\n\t\tfrom(anim.finished).pipe(\n\t\t\ttake(1),\n\t\t\ttap(() => {\n\t\t\t\tif (container.isConnected) {\n\t\t\t\t\tcontainer.style.clipPath = ''\n\t\t\t\t\tcontainer.style.overflow = ''\n\t\t\t\t\tcontainer.style.willChange = ''\n\t\t\t\t}\n\t\t\t}),\n\t\t\tcatchError(() => EMPTY),\n\t\t\ttakeUntil(this.disconnecting),\n\t\t).subscribe()\n\n\t\tthis.dispatchScopedEvent('window-toggle', { state: 'expanded' })\n\t}\n\n\tprivate _animateClose() {\n\t\tconst container = this._containerRef.value\n\t\tif (!container) return\n\n\t\tif (reducedMotion$.value) {\n\t\t\tcontainer.style.clipPath = this.closedClipPath\n\t\t\tcontainer.style.overflow = 'hidden'\n\t\t\tthis.open = false\n\t\t\tconst body = this._bodyRef.value\n\t\t\tif (body) { body.inert = true; body.style.visibility = 'hidden' }\n\t\t\tthis.dispatchScopedEvent('window-toggle', { state: 'collapsed' })\n\t\t\treturn\n\t\t}\n\n\t\tthis._currentAnimation?.cancel()\n\t\tcontainer.style.overflow = 'hidden'\n\t\tcontainer.style.willChange = 'opacity'\n\t\tconst closeKeyframes: Keyframe[] = [\n\t\t\t{ clipPath: this.openClipPath, opacity: 1 },\n\t\t\t{ clipPath: this.closedClipPath, opacity: 0.95 },\n\t\t]\n\t\tconst anim = container.animate(closeKeyframes, {\n\t\t\tduration: Math.round(SPRING_SNAPPY.duration * 0.7),\n\t\t\teasing: 'cubic-bezier(0.4, 0, 0.8, 0.15)',\n\t\t\tfill: 'forwards',\n\t\t})\n\t\tthis._currentAnimation = anim\n\n\t\tfrom(anim.finished).pipe(\n\t\t\ttake(1),\n\t\t\ttap(() => {\n\t\t\t\tthis.open = false\n\t\t\t\tcontainer.style.willChange = ''\n\t\t\t\tconst body = this._bodyRef.value\n\t\t\t\tif (body) { body.inert = true; body.style.visibility = 'hidden' }\n\t\t\t}),\n\t\t\tcatchError(() => EMPTY),\n\t\t\ttakeUntil(this.disconnecting),\n\t\t).subscribe()\n\n\t\tthis.dispatchScopedEvent('window-toggle', { state: 'collapsed' })\n\t}\n\n\t// ============================================\n\t// VISUAL STATE HELPERS\n\t// ============================================\n\n\t/** Apply drag visuals directly on DOM refs — avoids full Lit re-render for cursor + opacity */\n\tprivate _applyDragVisuals(dragging: boolean) {\n\t\tconst head = this._headRef.value\n\t\tconst container = this._containerRef.value\n\t\tif (head) {\n\t\t\thead.classList.toggle('cursor-grabbing', dragging)\n\t\t\thead.classList.toggle('cursor-move', !dragging)\n\t\t}\n\t\tif (container) {\n\t\t\tcontainer.style.opacity = dragging ? '0.95' : ''\n\t\t}\n\t}\n\n\tprivate _handleFocus = () => windowManager.focus(this.id)\n\n\tprivate _handleHeadKeydown = (e: KeyboardEvent) => {\n\t\tif (e.key === 'Enter' || e.key === ' ') {\n\t\t\te.preventDefault()\n\t\t\tthis.toggle()\n\t\t\treturn\n\t\t}\n\t\tif (e.key === 'ArrowUp' || e.key === 'ArrowDown' || e.key === 'ArrowLeft' || e.key === 'ArrowRight') {\n\t\t\te.preventDefault()\n\t\t\tconst step = e.shiftKey ? 20 : 5\n\t\t\tconst dx = e.key === 'ArrowRight' ? step : e.key === 'ArrowLeft' ? -step : 0\n\t\t\tconst dy = e.key === 'ArrowDown' ? step : e.key === 'ArrowUp' ? -step : 0\n\t\t\tthis._position = { x: this._position.x + dx, y: this._position.y + dy }\n\t\t\tthis._applyContainerPosition()\n\t\t\tthis._savePosition()\n\t\t}\n\t}\n\n\t// ============================================\n\t// PUBLIC API\n\t// ============================================\n\n\ttoggle() {\n\t\tif (this.open) this._animateClose()\n\t\telse this._animateOpen()\n\t}\n\n\texpand() {\n\t\tif (this.open) return\n\t\tthis._animateOpen()\n\t}\n\n\tclose() {\n\t\tif (!this.open) return\n\t\tthis._animateClose()\n\t}\n\n\t// ============================================\n\t// RENDER\n\t// ============================================\n\n\tprotected render(): unknown {\n\t\tconst isBottom = this._currentCorner.startsWith('bottom')\n\n\t\tconst containerClasses = classMap({\n\t\t\tfixed: true,\n\t\t\tflex: true,\n\t\t\t'flex-col': isBottom,\n\t\t\t'flex-col-reverse': !isBottom,\n\t\t\t'z-1000': true,\n\t\t\t'rounded-2xl': this.open,\n\t\t\t'rounded-[22px]': !this.open,\n\t\t\t'overflow-hidden': true,\n\t\t})\n\n\t\tconst containerStyles = styleMap({\n\t\t\twidth: this.panelWidth,\n\t\t\t'max-height': 'calc(100vh - 32px)',\n\t\t\t'pointer-events': 'none',\n\t\t})\n\n\t\tconst bodyStyles = styleMap({\n\t\t\t'pointer-events': this.open ? 'auto' : 'none',\n\t\t})\n\n\t\tconst headClasses = classMap({\n\t\t\t'h-full': true,\n\t\t\t'px-3': true,\n\t\t\tflex: true,\n\t\t\t'items-center': true,\n\t\t\t'gap-2': true,\n\t\t\t'select-none': true,\n\t\t\t'cursor-move': true,\n\t\t})\n\n\t\treturn html`\n\t\t\t<schmancy-surface\n\t\t\t\t${ref(this._containerRef)}\n\t\t\t\ttype=\"glass\"\n\t\t\t\t.elevation=${this.elevation}\n\t\t\t\tclass=${containerClasses}\n\t\t\t\tstyle=${containerStyles}\n\t\t\t\taria-expanded=${this.open}\n\t\t\t\t@pointerdown=${this._handleFocus}\n\t\t\t>\n\t\t\t\t<!-- Details section (visually above summary for bottom corners) -->\n\t\t\t\t<section\n\t\t\t\t\t${ref(this._bodyRef)}\n\t\t\t\t\tclass=\"flex-1 min-h-0 overflow-hidden flex flex-col\"\n\t\t\t\t\tstyle=${bodyStyles}\n\t\t\t\t\trole=\"region\"\n\t\t\t\t\taria-label=\"Expandable content\"\n\t\t\t\t>\n\t\t\t\t\t${this._hasOpened ? html`<slot name=\"details\"></slot>` : nothing}\n\t\t\t\t</section>\n\n\t\t\t\t<!-- Summary section -- always interactive, always visible -->\n\t\t\t\t<section\n\t\t\t\t\tclass=\"shrink-0 bg-surface-lowest\"\n\t\t\t\t\tstyle=${styleMap({ 'pointer-events': 'auto', height: `${HEAD_HEIGHT}px` })}\n\t\t\t\t>\n\t\t\t\t\t<div\n\t\t\t\t\t\t${ref(this._headRef)}\n\t\t\t\t\t\t${cursorGlow({ radius: 200, intensity: 0.10 })}\n\t\t\t\t\t\tclass=${headClasses}\n\t\t\t\t\t\trole=\"button\"\n\t\t\t\t\t\ttabindex=\"0\"\n\t\t\t\t\t\ttitle=\"Drag to move, click to expand\"\n\t\t\t\t\t\taria-label=\"${this.open ? 'Collapse window' : 'Expand window'}\"\n\t\t\t\t\t\t@keydown=${this._handleHeadKeydown}\n\t\t\t\t\t>\n\t\t\t\t\t\t<div class=\"flex-1 min-w-0\">\n\t\t\t\t\t\t\t<slot></slot>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<svg\n\t\t\t\t\t\t\twidth=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\"\n\t\t\t\t\t\t\tclass=\"shrink-0 text-surface-on/40 transition-transform duration-200 ${this.open ? 'rotate-180' : ''}\"\n\t\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<path d=\"M6 9L12 15L18 9\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" />\n\t\t\t\t\t\t</svg>\n\t\t\t\t\t</div>\n\t\t\t\t</section>\n\t\t\t</schmancy-surface>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-window': SchmancyWindow\n\t}\n}\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,kBAAA,KAAA,CAAA;AAAA,IAAA,IAAA,IAAA,IAAA,EAAA,CA3CP,EAAc,iBAAA,CAAA,GAAiB,CAAA;AAAA,SAAA,KAAA,GAAA,KAAA"}
@@ -1,4 +1,4 @@
1
- require(`./chunk-CncqDLb2.cjs`);const e=require(`./SchmancyElement-DhSiMp6Y.cjs`);require(`./mixins-YQI9JogS.cjs`);const t=require(`./animation-CCOIW4wJ.cjs`),n=require(`./reduced-motion-Ds-HjMzn.cjs`),r=require(`./cursor-glow-Bulq-38P.cjs`),i=require(`./theme.service-C3PoISGd.cjs`),a=require(`./overlay-stack-Bdr9lOqi.cjs`);let o=require(`rxjs`),s=require(`lit/directives/class-map.js`),c=require(`lit/directives/style-map.js`),l=require(`lit/decorators.js`),u=require(`lit`),d=require(`lit/directives/ref.js`);var f=`schmancy-window-`,p=`schmancy-float-`;function m(e,t){return!(e.left>=t.left+t.width||e.left+e.width<=t.left||e.top>=t.top+t.height||e.top+e.height<=t.top)}var h,g=class e{constructor(){this._state$=new o.BehaviorSubject({windows:new Map,focusedId:null,stackOrder:[]}),this.state$=this._state$.asObservable()}static getInstance(){return e.instance||=new e,e.instance}get windows(){return this._state$.value.windows}get focusedId(){return this._state$.value.focusedId}register(e,t,n){let r=this._state$.value;if(r.windows.has(e))return;let i={id:e,bounds:t,visualState:`normal`,zIndex:a.t.assignZIndex(e),open:!1,snapTarget:n},o=new Map(r.windows);o.set(e,i);let s=a.t.getStackOrder();this._state$.next({...r,windows:o,stackOrder:s})}unregister(e){let t=this._state$.value;if(!t.windows.has(e))return;a.t.releaseId(e);let n=new Map(t.windows);n.delete(e);let r=a.t.getStackOrder(),i=t.focusedId===e?null:t.focusedId;this._state$.next({...t,windows:n,stackOrder:r,focusedId:i})}updateBounds(e,t){this._updateRecord(e,{bounds:t})}updateVisualState(e,t){this._updateRecord(e,{visualState:t})}updateOpen(e,t){this._updateRecord(e,{open:t})}focus(e){let t=this._state$.value;if(!t.windows.has(e)||t.focusedId===e)return;let n=a.t.bringToFront(e),r=new Map(t.windows),i=r.get(e);i&&r.set(e,{...i,zIndex:n});let o=a.t.getStackOrder();this._state$.next({...t,windows:r,stackOrder:o,focusedId:e})}findOverlaps(e,t){let n=[];for(let[r,i]of this._state$.value.windows)r!==t&&m(e,i.bounds)&&n.push(i);return n}getNeighbors(e){let t=[];for(let[n,r]of this._state$.value.windows)n!==e&&t.push(r);return t}selectWindow(e){return this._state$.pipe((0,o.map)(t=>t.windows.get(e)),(0,o.distinctUntilChanged)())}selectFocused(){return this._state$.pipe((0,o.map)(e=>e.focusedId),(0,o.distinctUntilChanged)())}loadPosition(e){try{let t=localStorage.getItem(f+e)??localStorage.getItem(p+e);return t?JSON.parse(t):null}catch{return null}}savePosition(e,t){try{localStorage.setItem(f+e,JSON.stringify(t))}catch{}}clearPosition(e){try{localStorage.removeItem(f+e),localStorage.removeItem(p+e)}catch{}}_updateRecord(e,t){let n=this._state$.value,r=n.windows.get(e);if(!r)return;let i=new Map(n.windows);i.set(e,{...r,...t}),this._state$.next({...n,windows:i})}}.getInstance();function _(e,t,n){let r={...e};for(let e=0;e<10&&t.some(e=>{return t=r,n=e.bounds,!(t.left>=n.left+n.width||t.left+t.width<=n.left||t.top>=n.top+n.height||t.top+t.height<=n.top);var t,n});e++)r.left+=44,r.top+=44;return function(e,t){return{width:e.width,height:e.height,left:Math.max(0,Math.min(e.left,t.width-e.width)),top:Math.max(0,Math.min(e.top,t.height-e.height))}}(r,n)}var v=48,y=class extends e.t{static{h=this}constructor(...e){super(...e),this.id=`default`,this.lowered=!1,this.corner=`bottom-right`,this.resizable=!1,this.freePosition=!1,this.visualState=`normal`,this.minWidth=280,this.minHeight=200,this.open=!1,this._hasOpened=!1,this._position={x:16,y:16},this._currentCorner=`bottom-right`,this._appliedCorner=``,this._containerRef=(0,d.createRef)(),this._bodyRef=(0,d.createRef)(),this._headRef=(0,d.createRef)(),this._handleFocus=()=>g.focus(this.id),this._handleHeadKeydown=e=>{if(e.key===`Enter`||e.key===` `)return e.preventDefault(),void this.toggle();if(e.key===`ArrowUp`||e.key===`ArrowDown`||e.key===`ArrowLeft`||e.key===`ArrowRight`){e.preventDefault();let t=e.shiftKey?20:5,n=e.key===`ArrowRight`?t:e.key===`ArrowLeft`?-t:0,r=e.key===`ArrowDown`?t:e.key===`ArrowUp`?-t:0;this._position={x:this._position.x+n,y:this._position.y+r},this._applyContainerPosition(),this._savePosition()}}}static{this.styles=[u.css`
1
+ require(`./chunk-CncqDLb2.cjs`);const e=require(`./SchmancyElement-D8_z9JrW.cjs`);require(`./mixins-JyO9GSGy.cjs`);const t=require(`./animation-CCOIW4wJ.cjs`),n=require(`./reduced-motion-Ds-HjMzn.cjs`),r=require(`./cursor-glow-Bulq-38P.cjs`),i=require(`./theme.service-LtQw04e6.cjs`),a=require(`./overlay-stack-Bdr9lOqi.cjs`);let o=require(`rxjs`),s=require(`lit/directives/class-map.js`),c=require(`lit/directives/style-map.js`),l=require(`lit/decorators.js`),u=require(`lit`),d=require(`lit/directives/ref.js`);var f=`schmancy-window-`,p=`schmancy-float-`;function m(e,t){return!(e.left>=t.left+t.width||e.left+e.width<=t.left||e.top>=t.top+t.height||e.top+e.height<=t.top)}var h,g=class e{constructor(){this._state$=new o.BehaviorSubject({windows:new Map,focusedId:null,stackOrder:[]}),this.state$=this._state$.asObservable()}static getInstance(){return e.instance||=new e,e.instance}get windows(){return this._state$.value.windows}get focusedId(){return this._state$.value.focusedId}register(e,t,n){let r=this._state$.value;if(r.windows.has(e))return;let i={id:e,bounds:t,visualState:`normal`,zIndex:a.t.assignZIndex(e),open:!1,snapTarget:n},o=new Map(r.windows);o.set(e,i);let s=a.t.getStackOrder();this._state$.next({...r,windows:o,stackOrder:s})}unregister(e){let t=this._state$.value;if(!t.windows.has(e))return;a.t.releaseId(e);let n=new Map(t.windows);n.delete(e);let r=a.t.getStackOrder(),i=t.focusedId===e?null:t.focusedId;this._state$.next({...t,windows:n,stackOrder:r,focusedId:i})}updateBounds(e,t){this._updateRecord(e,{bounds:t})}updateVisualState(e,t){this._updateRecord(e,{visualState:t})}updateOpen(e,t){this._updateRecord(e,{open:t})}focus(e){let t=this._state$.value;if(!t.windows.has(e)||t.focusedId===e)return;let n=a.t.bringToFront(e),r=new Map(t.windows),i=r.get(e);i&&r.set(e,{...i,zIndex:n});let o=a.t.getStackOrder();this._state$.next({...t,windows:r,stackOrder:o,focusedId:e})}findOverlaps(e,t){let n=[];for(let[r,i]of this._state$.value.windows)r!==t&&m(e,i.bounds)&&n.push(i);return n}getNeighbors(e){let t=[];for(let[n,r]of this._state$.value.windows)n!==e&&t.push(r);return t}selectWindow(e){return this._state$.pipe((0,o.map)(t=>t.windows.get(e)),(0,o.distinctUntilChanged)())}selectFocused(){return this._state$.pipe((0,o.map)(e=>e.focusedId),(0,o.distinctUntilChanged)())}loadPosition(e){try{let t=localStorage.getItem(f+e)??localStorage.getItem(p+e);return t?JSON.parse(t):null}catch{return null}}savePosition(e,t){try{localStorage.setItem(f+e,JSON.stringify(t))}catch{}}clearPosition(e){try{localStorage.removeItem(f+e),localStorage.removeItem(p+e)}catch{}}_updateRecord(e,t){let n=this._state$.value,r=n.windows.get(e);if(!r)return;let i=new Map(n.windows);i.set(e,{...r,...t}),this._state$.next({...n,windows:i})}}.getInstance();function _(e,t,n){let r={...e};for(let e=0;e<10&&t.some(e=>{return t=r,n=e.bounds,!(t.left>=n.left+n.width||t.left+t.width<=n.left||t.top>=n.top+n.height||t.top+t.height<=n.top);var t,n});e++)r.left+=44,r.top+=44;return function(e,t){return{width:e.width,height:e.height,left:Math.max(0,Math.min(e.left,t.width-e.width)),top:Math.max(0,Math.min(e.top,t.height-e.height))}}(r,n)}var v=48,y=class extends e.t{static{h=this}constructor(...e){super(...e),this.id=`default`,this.lowered=!1,this.corner=`bottom-right`,this.resizable=!1,this.freePosition=!1,this.visualState=`normal`,this.minWidth=280,this.minHeight=200,this.open=!1,this._hasOpened=!1,this._position={x:16,y:16},this._currentCorner=`bottom-right`,this._appliedCorner=``,this._containerRef=(0,d.createRef)(),this._bodyRef=(0,d.createRef)(),this._headRef=(0,d.createRef)(),this._handleFocus=()=>g.focus(this.id),this._handleHeadKeydown=e=>{if(e.key===`Enter`||e.key===` `)return e.preventDefault(),void this.toggle();if(e.key===`ArrowUp`||e.key===`ArrowDown`||e.key===`ArrowLeft`||e.key===`ArrowRight`){e.preventDefault();let t=e.shiftKey?20:5,n=e.key===`ArrowRight`?t:e.key===`ArrowLeft`?-t:0,r=e.key===`ArrowDown`?t:e.key===`ArrowUp`?-t:0;this._position={x:this._position.x+n,y:this._position.y+r},this._applyContainerPosition(),this._savePosition()}}}static{this.styles=[u.css`
2
2
  :host {
3
3
  display: contents;
4
4
  position: relative;
@@ -56,4 +56,4 @@ require(`./chunk-CncqDLb2.cjs`);const e=require(`./SchmancyElement-DhSiMp6Y.cjs`
56
56
  </div>
57
57
  </section>
58
58
  </schmancy-surface>
59
- `}};e.p([(0,l.property)({type:String})],y.prototype,`id`,void 0),e.p([(0,l.property)({type:String})],y.prototype,`expandedWidth`,void 0),e.p([(0,l.property)({type:String})],y.prototype,`expandedHeight`,void 0),e.p([(0,l.property)({type:Boolean,reflect:!0})],y.prototype,`lowered`,void 0),e.p([(0,l.property)({type:String})],y.prototype,`corner`,void 0),e.p([(0,l.property)({type:Boolean})],y.prototype,`resizable`,void 0),e.p([(0,l.property)({type:Boolean})],y.prototype,`freePosition`,void 0),e.p([(0,l.property)({type:String,reflect:!0})],y.prototype,`visualState`,void 0),e.p([(0,l.property)({type:Number})],y.prototype,`minWidth`,void 0),e.p([(0,l.property)({type:Number})],y.prototype,`minHeight`,void 0),e.p([(0,l.property)({type:Boolean,reflect:!0})],y.prototype,`open`,void 0),e.p([(0,l.state)()],y.prototype,`_hasOpened`,void 0),e.p([(0,l.state)()],y.prototype,`_currentCorner`,void 0);var b=y=h=e.p([(0,l.customElement)(`schmancy-window`)],y);Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return b}});
59
+ `}};e.u([(0,l.property)({type:String})],y.prototype,`id`,void 0),e.u([(0,l.property)({type:String})],y.prototype,`expandedWidth`,void 0),e.u([(0,l.property)({type:String})],y.prototype,`expandedHeight`,void 0),e.u([(0,l.property)({type:Boolean,reflect:!0})],y.prototype,`lowered`,void 0),e.u([(0,l.property)({type:String})],y.prototype,`corner`,void 0),e.u([(0,l.property)({type:Boolean})],y.prototype,`resizable`,void 0),e.u([(0,l.property)({type:Boolean})],y.prototype,`freePosition`,void 0),e.u([(0,l.property)({type:String,reflect:!0})],y.prototype,`visualState`,void 0),e.u([(0,l.property)({type:Number})],y.prototype,`minWidth`,void 0),e.u([(0,l.property)({type:Number})],y.prototype,`minHeight`,void 0),e.u([(0,l.property)({type:Boolean,reflect:!0})],y.prototype,`open`,void 0),e.u([(0,l.state)()],y.prototype,`_hasOpened`,void 0),e.u([(0,l.state)()],y.prototype,`_currentCorner`,void 0);var b=y=h=e.u([(0,l.customElement)(`schmancy-window`)],y);Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return b}});