@opengis/form 0.0.46 → 0.0.48

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 (399) hide show
  1. package/dist/components/behavior.vue.d.ts.map +1 -0
  2. package/dist/{form/src/components → components}/container-views/index.d.ts.map +1 -1
  3. package/dist/components/container-views/vs-container-accordion.vue.d.ts.map +1 -0
  4. package/dist/components/container-views/vs-container-default.vue.d.ts.map +1 -0
  5. package/dist/components/container-views/vs-container-switcher.vue.d.ts.map +1 -0
  6. package/dist/components/form/vs-compact-form-navigation.vue.d.ts.map +1 -0
  7. package/dist/components/form/vs-compact-form.vue.d.ts.map +1 -0
  8. package/dist/components/icons/icon-arrow-top-bottom.vue.d.ts.map +1 -0
  9. package/dist/components/icons/icon-check.vue.d.ts.map +1 -0
  10. package/dist/components/icons/icon-chevron-down.vue.d.ts.map +1 -0
  11. package/dist/components/icons/icon-chevron-top-bottom.vue.d.ts.map +1 -0
  12. package/dist/components/icons/icon-close.vue.d.ts.map +1 -0
  13. package/dist/components/icons/icon-csv.vue.d.ts.map +1 -0
  14. package/dist/components/icons/icon-delete.vue.d.ts.map +1 -0
  15. package/dist/components/icons/icon-download.vue.d.ts.map +1 -0
  16. package/dist/components/icons/icon-export.vue.d.ts.map +1 -0
  17. package/dist/components/icons/icon-file.vue.d.ts.map +1 -0
  18. package/dist/components/icons/icon-geojson.vue.d.ts.map +1 -0
  19. package/dist/components/icons/icon-grip-vertical.vue.d.ts.map +1 -0
  20. package/dist/components/icons/icon-import.vue.d.ts.map +1 -0
  21. package/dist/components/icons/icon-info.vue.d.ts.map +1 -0
  22. package/dist/components/icons/icon-magnifying-glass.vue.d.ts.map +1 -0
  23. package/dist/components/icons/icon-no-data.vue.d.ts.map +1 -0
  24. package/dist/components/icons/icon-pdf.vue.d.ts.map +1 -0
  25. package/dist/components/icons/icon-pen.vue.d.ts.map +1 -0
  26. package/dist/components/icons/icon-plus.vue.d.ts.map +1 -0
  27. package/dist/components/icons/icon-upload.vue.d.ts.map +1 -0
  28. package/dist/components/icons/icon-zip.vue.d.ts.map +1 -0
  29. package/dist/components/icons/index.d.ts.map +1 -0
  30. package/dist/components/inputs/array/vs-input-array.vue.d.ts.map +1 -0
  31. package/dist/components/inputs/base/vs-input-color.vue.d.ts.map +1 -0
  32. package/dist/components/inputs/base/vs-input-email.vue.d.ts.map +1 -0
  33. package/dist/components/inputs/base/vs-input-mask.vue.d.ts.map +1 -0
  34. package/dist/components/inputs/base/vs-input-number.vue.d.ts.map +1 -0
  35. package/dist/components/inputs/base/vs-input-password.vue.d.ts.map +1 -0
  36. package/dist/components/inputs/base/vs-input-range.vue.d.ts.map +1 -0
  37. package/dist/components/inputs/base/vs-input-static.vue.d.ts.map +1 -0
  38. package/dist/components/inputs/base/vs-input-switcher.vue.d.ts.map +1 -0
  39. package/dist/components/inputs/base/vs-input-text.vue.d.ts.map +1 -0
  40. package/dist/components/inputs/base/vs-input-textarea.vue.d.ts.map +1 -0
  41. package/dist/components/inputs/date/vs-date-text.vue.d.ts.map +1 -0
  42. package/dist/components/inputs/date/vs-input-date.vue.d.ts.map +1 -0
  43. package/dist/components/inputs/date/vs-input-date1.vue.d.ts.map +1 -0
  44. package/dist/components/inputs/date/vs-input-time.vue.d.ts.map +1 -0
  45. package/dist/components/inputs/file/vs-input-file-list-item.vue.d.ts.map +1 -0
  46. package/dist/components/inputs/file/vs-input-file.vue.d.ts.map +1 -0
  47. package/dist/components/inputs/file-list/vs-input-file-list.vue.d.ts.map +1 -0
  48. package/dist/components/inputs/file-list/vs-widget-file-info.vue.d.ts.map +1 -0
  49. package/dist/components/inputs/file-list/vs-widget-file-item.vue.d.ts.map +1 -0
  50. package/dist/{form/src/components → components}/inputs/index.d.ts +4 -4
  51. package/dist/{form/src/components → components}/inputs/index.d.ts.map +1 -1
  52. package/dist/components/inputs/map/icons/icon-compass.vue.d.ts.map +1 -0
  53. package/dist/components/inputs/map/icons/icon-full-screen.vue.d.ts.map +1 -0
  54. package/dist/components/inputs/map/icons/icon-line.vue.d.ts.map +1 -0
  55. package/dist/components/inputs/map/icons/icon-map-pin.vue.d.ts.map +1 -0
  56. package/dist/components/inputs/map/icons/icon-poligon-rectangle.vue.d.ts.map +1 -0
  57. package/dist/components/inputs/map/icons/icon-poligon.vue.d.ts.map +1 -0
  58. package/dist/components/inputs/map/map-layers.vue.d.ts.map +1 -0
  59. package/dist/components/inputs/map/map-scroll-wheel-toggle.vue.d.ts.map +1 -0
  60. package/dist/components/inputs/map/map-search.vue.d.ts.map +1 -0
  61. package/dist/components/inputs/map/map.d.ts.map +1 -0
  62. package/dist/components/inputs/map/util.d.ts.map +1 -0
  63. package/dist/components/inputs/map/vs-input-map.vue.d.ts.map +1 -0
  64. package/dist/components/inputs/options/checkbox/index.d.ts.map +1 -0
  65. package/dist/components/inputs/options/checkbox/vs-checkbox-buttons.vue.d.ts.map +1 -0
  66. package/dist/components/inputs/options/checkbox/vs-checkbox-default.vue.d.ts.map +1 -0
  67. package/dist/components/inputs/options/checkbox/vs-input-checkbox-item.vue.d.ts.map +1 -0
  68. package/dist/components/inputs/options/checkbox/vs-input-checkbox.vue.d.ts.map +1 -0
  69. package/dist/components/inputs/options/radio/index.d.ts.map +1 -0
  70. package/dist/components/inputs/options/radio/vs-input-radio-buttons.vue.d.ts.map +1 -0
  71. package/dist/components/inputs/options/radio/vs-input-radio-default.vue.d.ts.map +1 -0
  72. package/dist/components/inputs/options/radio/vs-input-radio.vue.d.ts.map +1 -0
  73. package/dist/components/inputs/table/vs-input-datatable.vue.d.ts.map +1 -0
  74. package/dist/components/inputs/tag/vs-input-tag.vue.d.ts.map +1 -0
  75. package/dist/components/inputs/vs-input-container.vue.d.ts.map +1 -0
  76. package/dist/components/inputs/vs-input-key-value.vue.d.ts.map +1 -0
  77. package/dist/{form/src/components → components}/inputs/vs-input-select.vue.d.ts +2 -2
  78. package/dist/components/inputs/vs-input-select.vue.d.ts.map +1 -0
  79. package/dist/components/inputs/vs-input-slug.vue.d.ts.map +1 -0
  80. package/dist/components/layouts/index.d.ts.map +1 -0
  81. package/dist/components/layouts/vs-compact-form-layout.vue.d.ts.map +1 -0
  82. package/dist/components/layouts/vs-layout-default.vue.d.ts.map +1 -0
  83. package/dist/components/layouts/vs-layout-horizontal.vue.d.ts.map +1 -0
  84. package/dist/components/layouts/vs-layout-inline.vue.d.ts.map +1 -0
  85. package/dist/components/layouts/vs-layout-settings.vue.d.ts.map +1 -0
  86. package/dist/components/modal/modal-edit.vue.d.ts.map +1 -0
  87. package/dist/components/ui/vs-calendar.vue.d.ts.map +1 -0
  88. package/dist/composables/i18n.d.ts.map +1 -0
  89. package/dist/composables/useForm.d.ts.map +1 -0
  90. package/dist/composables/useLocale.d.ts.map +1 -0
  91. package/dist/composables/useStyle.d.ts.map +1 -0
  92. package/dist/index.css +1 -1
  93. package/dist/index.d.ts.map +1 -0
  94. package/dist/index.js +1731 -1973
  95. package/dist/index.umd.cjs +3 -3
  96. package/dist/plugin/form-plugin.d.ts.map +1 -0
  97. package/dist/schema.d.ts.map +1 -0
  98. package/dist/{form/src/types → types}/form.d.ts +1 -0
  99. package/dist/types/form.d.ts.map +1 -0
  100. package/dist/{form/src/types → types}/rules.d.ts.map +1 -1
  101. package/dist/utils/convertForm.d.ts.map +1 -0
  102. package/dist/utils/dynamicPosition.d.ts.map +1 -0
  103. package/dist/utils/file.api.d.ts.map +1 -0
  104. package/dist/utils/file.preview.d.ts.map +1 -0
  105. package/dist/utils/formConditions.d.ts.map +1 -0
  106. package/dist/utils/formRules.d.ts.map +1 -0
  107. package/dist/utils/index.d.ts.map +1 -0
  108. package/dist/utils/randomId.d.ts.map +1 -0
  109. package/package.json +67 -67
  110. package/dist/core/src/components/base/button.vue.d.ts +0 -19
  111. package/dist/core/src/components/base/button.vue.d.ts.map +0 -1
  112. package/dist/core/src/components/base/vs-grid-gallery.vue.d.ts +0 -4
  113. package/dist/core/src/components/base/vs-grid-gallery.vue.d.ts.map +0 -1
  114. package/dist/core/src/components/base/vs-lightbox.vue.d.ts +0 -12
  115. package/dist/core/src/components/base/vs-lightbox.vue.d.ts.map +0 -1
  116. package/dist/core/src/components/base/vs-switch.vue.d.ts +0 -49
  117. package/dist/core/src/components/base/vs-switch.vue.d.ts.map +0 -1
  118. package/dist/core/src/components/navigation/vs-pagination.vue.d.ts +0 -19
  119. package/dist/core/src/components/navigation/vs-pagination.vue.d.ts.map +0 -1
  120. package/dist/core/src/components/navigation/vs-slider.vue.d.ts +0 -7
  121. package/dist/core/src/components/navigation/vs-slider.vue.d.ts.map +0 -1
  122. package/dist/core/src/components/overlays/message-box.vue.d.ts +0 -32
  123. package/dist/core/src/components/overlays/message-box.vue.d.ts.map +0 -1
  124. package/dist/core/src/components/overlays/vs-confirm-modal.vue.d.ts +0 -29
  125. package/dist/core/src/components/overlays/vs-confirm-modal.vue.d.ts.map +0 -1
  126. package/dist/core/src/components/overlays/vs-drawer.vue.d.ts +0 -31
  127. package/dist/core/src/components/overlays/vs-drawer.vue.d.ts.map +0 -1
  128. package/dist/core/src/components/overlays/vs-loading.vue.d.ts +0 -6
  129. package/dist/core/src/components/overlays/vs-loading.vue.d.ts.map +0 -1
  130. package/dist/core/src/components/overlays/vs-modal.vue.d.ts +0 -30
  131. package/dist/core/src/components/overlays/vs-modal.vue.d.ts.map +0 -1
  132. package/dist/core/src/components/overlays/vs-notify.vue.d.ts +0 -4
  133. package/dist/core/src/components/overlays/vs-notify.vue.d.ts.map +0 -1
  134. package/dist/core/src/components/overlays/vs-popover.vue.d.ts +0 -40
  135. package/dist/core/src/components/overlays/vs-popover.vue.d.ts.map +0 -1
  136. package/dist/core/src/components/types/vs-badge-value.vue.d.ts +0 -32
  137. package/dist/core/src/components/types/vs-badge-value.vue.d.ts.map +0 -1
  138. package/dist/core/src/components/types/vs-data-value.vue.d.ts +0 -17
  139. package/dist/core/src/components/types/vs-data-value.vue.d.ts.map +0 -1
  140. package/dist/core/src/directives/focus.d.ts +0 -4
  141. package/dist/core/src/directives/focus.d.ts.map +0 -1
  142. package/dist/core/src/directives/loading.d.ts +0 -11
  143. package/dist/core/src/directives/loading.d.ts.map +0 -1
  144. package/dist/core/src/directives/tooltip.d.ts +0 -7
  145. package/dist/core/src/directives/tooltip.d.ts.map +0 -1
  146. package/dist/core/src/emitter/eventBus.d.ts +0 -12
  147. package/dist/core/src/emitter/eventBus.d.ts.map +0 -1
  148. package/dist/core/src/icons/chevron-down-icon.vue.d.ts +0 -3
  149. package/dist/core/src/icons/chevron-down-icon.vue.d.ts.map +0 -1
  150. package/dist/core/src/icons/close-Icon.vue.d.ts +0 -3
  151. package/dist/core/src/icons/close-Icon.vue.d.ts.map +0 -1
  152. package/dist/core/src/icons/delete-icon.vue.d.ts +0 -3
  153. package/dist/core/src/icons/delete-icon.vue.d.ts.map +0 -1
  154. package/dist/core/src/icons/download-icon.vue.d.ts +0 -3
  155. package/dist/core/src/icons/download-icon.vue.d.ts.map +0 -1
  156. package/dist/core/src/icons/notify/icon-error.vue.d.ts +0 -3
  157. package/dist/core/src/icons/notify/icon-error.vue.d.ts.map +0 -1
  158. package/dist/core/src/icons/notify/icon-info.vue.d.ts.map +0 -1
  159. package/dist/core/src/icons/notify/icon-success.vue.d.ts +0 -3
  160. package/dist/core/src/icons/notify/icon-success.vue.d.ts.map +0 -1
  161. package/dist/core/src/icons/notify/icon-warning.vue.d.ts +0 -3
  162. package/dist/core/src/icons/notify/icon-warning.vue.d.ts.map +0 -1
  163. package/dist/core/src/icons/pagination/icon-arrow-down.vue.d.ts +0 -3
  164. package/dist/core/src/icons/pagination/icon-arrow-down.vue.d.ts.map +0 -1
  165. package/dist/core/src/icons/pagination/icon-arrow-left.vue.d.ts +0 -3
  166. package/dist/core/src/icons/pagination/icon-arrow-left.vue.d.ts.map +0 -1
  167. package/dist/core/src/icons/pagination/icon-arrow-right.vue.d.ts +0 -3
  168. package/dist/core/src/icons/pagination/icon-arrow-right.vue.d.ts.map +0 -1
  169. package/dist/core/src/icons/pagination/icon-check.vue.d.ts.map +0 -1
  170. package/dist/core/src/index.d.ts +0 -29
  171. package/dist/core/src/index.d.ts.map +0 -1
  172. package/dist/core/src/plugins/api.d.ts +0 -13
  173. package/dist/core/src/plugins/api.d.ts.map +0 -1
  174. package/dist/core/src/plugins/confirm.d.ts +0 -18
  175. package/dist/core/src/plugins/confirm.d.ts.map +0 -1
  176. package/dist/core/src/plugins/loading.d.ts +0 -3
  177. package/dist/core/src/plugins/loading.d.ts.map +0 -1
  178. package/dist/core/src/plugins/modal.d.ts +0 -6
  179. package/dist/core/src/plugins/modal.d.ts.map +0 -1
  180. package/dist/core/src/plugins/notify.d.ts +0 -4
  181. package/dist/core/src/plugins/notify.d.ts.map +0 -1
  182. package/dist/core/src/types/drawer.d.ts +0 -8
  183. package/dist/core/src/types/drawer.d.ts.map +0 -1
  184. package/dist/core/src/types/gallery.d.ts +0 -11
  185. package/dist/core/src/types/gallery.d.ts.map +0 -1
  186. package/dist/core/src/types/lightbox.d.ts +0 -14
  187. package/dist/core/src/types/lightbox.d.ts.map +0 -1
  188. package/dist/core/src/types/modal.d.ts +0 -11
  189. package/dist/core/src/types/modal.d.ts.map +0 -1
  190. package/dist/core/src/types/notify.d.ts +0 -14
  191. package/dist/core/src/types/notify.d.ts.map +0 -1
  192. package/dist/core/src/types/pagination.d.ts +0 -17
  193. package/dist/core/src/types/pagination.d.ts.map +0 -1
  194. package/dist/core/src/types/slider.d.ts +0 -5
  195. package/dist/core/src/types/slider.d.ts.map +0 -1
  196. package/dist/core/src/utils/colorFormater.d.ts +0 -3
  197. package/dist/core/src/utils/colorFormater.d.ts.map +0 -1
  198. package/dist/core/src/utils/dynamic.position.d.ts +0 -3
  199. package/dist/core/src/utils/dynamic.position.d.ts.map +0 -1
  200. package/dist/form/src/components/behavior.vue.d.ts.map +0 -1
  201. package/dist/form/src/components/container-views/vs-container-accordion.vue.d.ts.map +0 -1
  202. package/dist/form/src/components/container-views/vs-container-default.vue.d.ts.map +0 -1
  203. package/dist/form/src/components/container-views/vs-container-switcher.vue.d.ts.map +0 -1
  204. package/dist/form/src/components/form/vs-compact-form-navigation.vue.d.ts.map +0 -1
  205. package/dist/form/src/components/form/vs-compact-form.vue.d.ts.map +0 -1
  206. package/dist/form/src/components/icons/icon-arrow-top-bottom.vue.d.ts.map +0 -1
  207. package/dist/form/src/components/icons/icon-check.vue.d.ts +0 -3
  208. package/dist/form/src/components/icons/icon-check.vue.d.ts.map +0 -1
  209. package/dist/form/src/components/icons/icon-chevron-down.vue.d.ts.map +0 -1
  210. package/dist/form/src/components/icons/icon-chevron-top-bottom.vue.d.ts.map +0 -1
  211. package/dist/form/src/components/icons/icon-close.vue.d.ts.map +0 -1
  212. package/dist/form/src/components/icons/icon-csv.vue.d.ts.map +0 -1
  213. package/dist/form/src/components/icons/icon-delete.vue.d.ts.map +0 -1
  214. package/dist/form/src/components/icons/icon-download.vue.d.ts.map +0 -1
  215. package/dist/form/src/components/icons/icon-export.vue.d.ts.map +0 -1
  216. package/dist/form/src/components/icons/icon-file.vue.d.ts.map +0 -1
  217. package/dist/form/src/components/icons/icon-geojson.vue.d.ts.map +0 -1
  218. package/dist/form/src/components/icons/icon-grip-vertical.vue.d.ts.map +0 -1
  219. package/dist/form/src/components/icons/icon-import.vue.d.ts.map +0 -1
  220. package/dist/form/src/components/icons/icon-info.vue.d.ts +0 -3
  221. package/dist/form/src/components/icons/icon-info.vue.d.ts.map +0 -1
  222. package/dist/form/src/components/icons/icon-magnifying-glass.vue.d.ts.map +0 -1
  223. package/dist/form/src/components/icons/icon-no-data.vue.d.ts.map +0 -1
  224. package/dist/form/src/components/icons/icon-pdf.vue.d.ts.map +0 -1
  225. package/dist/form/src/components/icons/icon-pen.vue.d.ts.map +0 -1
  226. package/dist/form/src/components/icons/icon-plus.vue.d.ts.map +0 -1
  227. package/dist/form/src/components/icons/icon-upload.vue.d.ts.map +0 -1
  228. package/dist/form/src/components/icons/icon-zip.vue.d.ts.map +0 -1
  229. package/dist/form/src/components/icons/index.d.ts.map +0 -1
  230. package/dist/form/src/components/inputs/array/vs-input-array.vue.d.ts.map +0 -1
  231. package/dist/form/src/components/inputs/base/vs-input-color.vue.d.ts.map +0 -1
  232. package/dist/form/src/components/inputs/base/vs-input-email.vue.d.ts.map +0 -1
  233. package/dist/form/src/components/inputs/base/vs-input-mask.vue.d.ts.map +0 -1
  234. package/dist/form/src/components/inputs/base/vs-input-number.vue.d.ts.map +0 -1
  235. package/dist/form/src/components/inputs/base/vs-input-password.vue.d.ts.map +0 -1
  236. package/dist/form/src/components/inputs/base/vs-input-range.vue.d.ts.map +0 -1
  237. package/dist/form/src/components/inputs/base/vs-input-static.vue.d.ts.map +0 -1
  238. package/dist/form/src/components/inputs/base/vs-input-switcher.vue.d.ts.map +0 -1
  239. package/dist/form/src/components/inputs/base/vs-input-text.vue.d.ts.map +0 -1
  240. package/dist/form/src/components/inputs/base/vs-input-textarea.vue.d.ts.map +0 -1
  241. package/dist/form/src/components/inputs/date/vs-date-text.vue.d.ts.map +0 -1
  242. package/dist/form/src/components/inputs/date/vs-input-date.vue.d.ts.map +0 -1
  243. package/dist/form/src/components/inputs/date/vs-input-date1.vue.d.ts.map +0 -1
  244. package/dist/form/src/components/inputs/date/vs-input-time.vue.d.ts.map +0 -1
  245. package/dist/form/src/components/inputs/file/vs-input-file-list-item.vue.d.ts.map +0 -1
  246. package/dist/form/src/components/inputs/file/vs-input-file.vue.d.ts.map +0 -1
  247. package/dist/form/src/components/inputs/file-list/vs-input-file-list.vue.d.ts.map +0 -1
  248. package/dist/form/src/components/inputs/file-list/vs-widget-file-info.vue.d.ts.map +0 -1
  249. package/dist/form/src/components/inputs/file-list/vs-widget-file-item.vue.d.ts.map +0 -1
  250. package/dist/form/src/components/inputs/map/icons/icon-compass.vue.d.ts.map +0 -1
  251. package/dist/form/src/components/inputs/map/icons/icon-full-screen.vue.d.ts.map +0 -1
  252. package/dist/form/src/components/inputs/map/icons/icon-line.vue.d.ts.map +0 -1
  253. package/dist/form/src/components/inputs/map/icons/icon-map-pin.vue.d.ts.map +0 -1
  254. package/dist/form/src/components/inputs/map/icons/icon-poligon-rectangle.vue.d.ts.map +0 -1
  255. package/dist/form/src/components/inputs/map/icons/icon-poligon.vue.d.ts.map +0 -1
  256. package/dist/form/src/components/inputs/map/map-layers.vue.d.ts.map +0 -1
  257. package/dist/form/src/components/inputs/map/map-scroll-wheel-toggle.vue.d.ts.map +0 -1
  258. package/dist/form/src/components/inputs/map/map-search.vue.d.ts.map +0 -1
  259. package/dist/form/src/components/inputs/map/map.d.ts.map +0 -1
  260. package/dist/form/src/components/inputs/map/util.d.ts.map +0 -1
  261. package/dist/form/src/components/inputs/map/vs-input-map.vue.d.ts.map +0 -1
  262. package/dist/form/src/components/inputs/options/checkbox/index.d.ts.map +0 -1
  263. package/dist/form/src/components/inputs/options/checkbox/vs-checkbox-buttons.vue.d.ts.map +0 -1
  264. package/dist/form/src/components/inputs/options/checkbox/vs-checkbox-default.vue.d.ts.map +0 -1
  265. package/dist/form/src/components/inputs/options/checkbox/vs-input-checkbox-item.vue.d.ts.map +0 -1
  266. package/dist/form/src/components/inputs/options/checkbox/vs-input-checkbox.vue.d.ts.map +0 -1
  267. package/dist/form/src/components/inputs/options/radio/index.d.ts.map +0 -1
  268. package/dist/form/src/components/inputs/options/radio/vs-input-radio-buttons.vue.d.ts.map +0 -1
  269. package/dist/form/src/components/inputs/options/radio/vs-input-radio-default.vue.d.ts.map +0 -1
  270. package/dist/form/src/components/inputs/options/radio/vs-input-radio.vue.d.ts.map +0 -1
  271. package/dist/form/src/components/inputs/table/vs-input-datatable.vue.d.ts.map +0 -1
  272. package/dist/form/src/components/inputs/tag/vs-input-tag.vue.d.ts.map +0 -1
  273. package/dist/form/src/components/inputs/vs-input-container.vue.d.ts.map +0 -1
  274. package/dist/form/src/components/inputs/vs-input-key-value.vue.d.ts.map +0 -1
  275. package/dist/form/src/components/inputs/vs-input-select.vue.d.ts.map +0 -1
  276. package/dist/form/src/components/inputs/vs-input-slug.vue.d.ts.map +0 -1
  277. package/dist/form/src/components/layouts/index.d.ts.map +0 -1
  278. package/dist/form/src/components/layouts/vs-compact-form-layout.vue.d.ts.map +0 -1
  279. package/dist/form/src/components/layouts/vs-layout-default.vue.d.ts.map +0 -1
  280. package/dist/form/src/components/layouts/vs-layout-horizontal.vue.d.ts.map +0 -1
  281. package/dist/form/src/components/layouts/vs-layout-inline.vue.d.ts.map +0 -1
  282. package/dist/form/src/components/layouts/vs-layout-settings.vue.d.ts.map +0 -1
  283. package/dist/form/src/components/modal/modal-edit.vue.d.ts.map +0 -1
  284. package/dist/form/src/components/ui/vs-calendar.vue.d.ts.map +0 -1
  285. package/dist/form/src/composables/i18n.d.ts.map +0 -1
  286. package/dist/form/src/composables/useForm.d.ts.map +0 -1
  287. package/dist/form/src/composables/useLocale.d.ts.map +0 -1
  288. package/dist/form/src/composables/useStyle.d.ts.map +0 -1
  289. package/dist/form/src/index.d.ts.map +0 -1
  290. package/dist/form/src/plugin/form-plugin.d.ts.map +0 -1
  291. package/dist/form/src/schema.d.ts.map +0 -1
  292. package/dist/form/src/types/form.d.ts.map +0 -1
  293. package/dist/form/src/utils/convertForm.d.ts.map +0 -1
  294. package/dist/form/src/utils/dynamicPosition.d.ts.map +0 -1
  295. package/dist/form/src/utils/file.api.d.ts.map +0 -1
  296. package/dist/form/src/utils/file.preview.d.ts.map +0 -1
  297. package/dist/form/src/utils/formConditions.d.ts.map +0 -1
  298. package/dist/form/src/utils/formRules.d.ts.map +0 -1
  299. package/dist/form/src/utils/index.d.ts.map +0 -1
  300. package/dist/form/src/utils/randomId.d.ts.map +0 -1
  301. /package/dist/{form/src/components → components}/behavior.vue.d.ts +0 -0
  302. /package/dist/{form/src/components → components}/container-views/index.d.ts +0 -0
  303. /package/dist/{form/src/components → components}/container-views/vs-container-accordion.vue.d.ts +0 -0
  304. /package/dist/{form/src/components → components}/container-views/vs-container-default.vue.d.ts +0 -0
  305. /package/dist/{form/src/components → components}/container-views/vs-container-switcher.vue.d.ts +0 -0
  306. /package/dist/{form/src/components → components}/form/vs-compact-form-navigation.vue.d.ts +0 -0
  307. /package/dist/{form/src/components → components}/form/vs-compact-form.vue.d.ts +0 -0
  308. /package/dist/{form/src/components → components}/icons/icon-arrow-top-bottom.vue.d.ts +0 -0
  309. /package/dist/{core/src/icons/pagination → components/icons}/icon-check.vue.d.ts +0 -0
  310. /package/dist/{form/src/components → components}/icons/icon-chevron-down.vue.d.ts +0 -0
  311. /package/dist/{form/src/components → components}/icons/icon-chevron-top-bottom.vue.d.ts +0 -0
  312. /package/dist/{form/src/components → components}/icons/icon-close.vue.d.ts +0 -0
  313. /package/dist/{form/src/components → components}/icons/icon-csv.vue.d.ts +0 -0
  314. /package/dist/{form/src/components → components}/icons/icon-delete.vue.d.ts +0 -0
  315. /package/dist/{form/src/components → components}/icons/icon-download.vue.d.ts +0 -0
  316. /package/dist/{form/src/components → components}/icons/icon-export.vue.d.ts +0 -0
  317. /package/dist/{form/src/components → components}/icons/icon-file.vue.d.ts +0 -0
  318. /package/dist/{form/src/components → components}/icons/icon-geojson.vue.d.ts +0 -0
  319. /package/dist/{form/src/components → components}/icons/icon-grip-vertical.vue.d.ts +0 -0
  320. /package/dist/{form/src/components → components}/icons/icon-import.vue.d.ts +0 -0
  321. /package/dist/{core/src/icons/notify → components/icons}/icon-info.vue.d.ts +0 -0
  322. /package/dist/{form/src/components → components}/icons/icon-magnifying-glass.vue.d.ts +0 -0
  323. /package/dist/{form/src/components → components}/icons/icon-no-data.vue.d.ts +0 -0
  324. /package/dist/{form/src/components → components}/icons/icon-pdf.vue.d.ts +0 -0
  325. /package/dist/{form/src/components → components}/icons/icon-pen.vue.d.ts +0 -0
  326. /package/dist/{form/src/components → components}/icons/icon-plus.vue.d.ts +0 -0
  327. /package/dist/{form/src/components → components}/icons/icon-upload.vue.d.ts +0 -0
  328. /package/dist/{form/src/components → components}/icons/icon-zip.vue.d.ts +0 -0
  329. /package/dist/{form/src/components → components}/icons/index.d.ts +0 -0
  330. /package/dist/{form/src/components → components}/inputs/array/vs-input-array.vue.d.ts +0 -0
  331. /package/dist/{form/src/components → components}/inputs/base/vs-input-color.vue.d.ts +0 -0
  332. /package/dist/{form/src/components → components}/inputs/base/vs-input-email.vue.d.ts +0 -0
  333. /package/dist/{form/src/components → components}/inputs/base/vs-input-mask.vue.d.ts +0 -0
  334. /package/dist/{form/src/components → components}/inputs/base/vs-input-number.vue.d.ts +0 -0
  335. /package/dist/{form/src/components → components}/inputs/base/vs-input-password.vue.d.ts +0 -0
  336. /package/dist/{form/src/components → components}/inputs/base/vs-input-range.vue.d.ts +0 -0
  337. /package/dist/{form/src/components → components}/inputs/base/vs-input-static.vue.d.ts +0 -0
  338. /package/dist/{form/src/components → components}/inputs/base/vs-input-switcher.vue.d.ts +0 -0
  339. /package/dist/{form/src/components → components}/inputs/base/vs-input-text.vue.d.ts +0 -0
  340. /package/dist/{form/src/components → components}/inputs/base/vs-input-textarea.vue.d.ts +0 -0
  341. /package/dist/{form/src/components → components}/inputs/date/vs-date-text.vue.d.ts +0 -0
  342. /package/dist/{form/src/components → components}/inputs/date/vs-input-date.vue.d.ts +0 -0
  343. /package/dist/{form/src/components → components}/inputs/date/vs-input-date1.vue.d.ts +0 -0
  344. /package/dist/{form/src/components → components}/inputs/date/vs-input-time.vue.d.ts +0 -0
  345. /package/dist/{form/src/components → components}/inputs/file/vs-input-file-list-item.vue.d.ts +0 -0
  346. /package/dist/{form/src/components → components}/inputs/file/vs-input-file.vue.d.ts +0 -0
  347. /package/dist/{form/src/components → components}/inputs/file-list/vs-input-file-list.vue.d.ts +0 -0
  348. /package/dist/{form/src/components → components}/inputs/file-list/vs-widget-file-info.vue.d.ts +0 -0
  349. /package/dist/{form/src/components → components}/inputs/file-list/vs-widget-file-item.vue.d.ts +0 -0
  350. /package/dist/{form/src/components → components}/inputs/map/icons/icon-compass.vue.d.ts +0 -0
  351. /package/dist/{form/src/components → components}/inputs/map/icons/icon-full-screen.vue.d.ts +0 -0
  352. /package/dist/{form/src/components → components}/inputs/map/icons/icon-line.vue.d.ts +0 -0
  353. /package/dist/{form/src/components → components}/inputs/map/icons/icon-map-pin.vue.d.ts +0 -0
  354. /package/dist/{form/src/components → components}/inputs/map/icons/icon-poligon-rectangle.vue.d.ts +0 -0
  355. /package/dist/{form/src/components → components}/inputs/map/icons/icon-poligon.vue.d.ts +0 -0
  356. /package/dist/{form/src/components → components}/inputs/map/map-layers.vue.d.ts +0 -0
  357. /package/dist/{form/src/components → components}/inputs/map/map-scroll-wheel-toggle.vue.d.ts +0 -0
  358. /package/dist/{form/src/components → components}/inputs/map/map-search.vue.d.ts +0 -0
  359. /package/dist/{form/src/components → components}/inputs/map/map.d.ts +0 -0
  360. /package/dist/{form/src/components → components}/inputs/map/util.d.ts +0 -0
  361. /package/dist/{form/src/components → components}/inputs/map/vs-input-map.vue.d.ts +0 -0
  362. /package/dist/{form/src/components → components}/inputs/options/checkbox/index.d.ts +0 -0
  363. /package/dist/{form/src/components → components}/inputs/options/checkbox/vs-checkbox-buttons.vue.d.ts +0 -0
  364. /package/dist/{form/src/components → components}/inputs/options/checkbox/vs-checkbox-default.vue.d.ts +0 -0
  365. /package/dist/{form/src/components → components}/inputs/options/checkbox/vs-input-checkbox-item.vue.d.ts +0 -0
  366. /package/dist/{form/src/components → components}/inputs/options/checkbox/vs-input-checkbox.vue.d.ts +0 -0
  367. /package/dist/{form/src/components → components}/inputs/options/radio/index.d.ts +0 -0
  368. /package/dist/{form/src/components → components}/inputs/options/radio/vs-input-radio-buttons.vue.d.ts +0 -0
  369. /package/dist/{form/src/components → components}/inputs/options/radio/vs-input-radio-default.vue.d.ts +0 -0
  370. /package/dist/{form/src/components → components}/inputs/options/radio/vs-input-radio.vue.d.ts +0 -0
  371. /package/dist/{form/src/components → components}/inputs/table/vs-input-datatable.vue.d.ts +0 -0
  372. /package/dist/{form/src/components → components}/inputs/tag/vs-input-tag.vue.d.ts +0 -0
  373. /package/dist/{form/src/components → components}/inputs/vs-input-container.vue.d.ts +0 -0
  374. /package/dist/{form/src/components → components}/inputs/vs-input-key-value.vue.d.ts +0 -0
  375. /package/dist/{form/src/components → components}/inputs/vs-input-slug.vue.d.ts +0 -0
  376. /package/dist/{form/src/components → components}/layouts/index.d.ts +0 -0
  377. /package/dist/{form/src/components → components}/layouts/vs-compact-form-layout.vue.d.ts +0 -0
  378. /package/dist/{form/src/components → components}/layouts/vs-layout-default.vue.d.ts +0 -0
  379. /package/dist/{form/src/components → components}/layouts/vs-layout-horizontal.vue.d.ts +0 -0
  380. /package/dist/{form/src/components → components}/layouts/vs-layout-inline.vue.d.ts +0 -0
  381. /package/dist/{form/src/components → components}/layouts/vs-layout-settings.vue.d.ts +0 -0
  382. /package/dist/{form/src/components → components}/modal/modal-edit.vue.d.ts +0 -0
  383. /package/dist/{form/src/components → components}/ui/vs-calendar.vue.d.ts +0 -0
  384. /package/dist/{form/src/composables → composables}/i18n.d.ts +0 -0
  385. /package/dist/{form/src/composables → composables}/useForm.d.ts +0 -0
  386. /package/dist/{form/src/composables → composables}/useLocale.d.ts +0 -0
  387. /package/dist/{form/src/composables → composables}/useStyle.d.ts +0 -0
  388. /package/dist/{form/src/index.d.ts → index.d.ts} +0 -0
  389. /package/dist/{form/src/plugin → plugin}/form-plugin.d.ts +0 -0
  390. /package/dist/{form/src/schema.d.ts → schema.d.ts} +0 -0
  391. /package/dist/{form/src/types → types}/rules.d.ts +0 -0
  392. /package/dist/{form/src/utils → utils}/convertForm.d.ts +0 -0
  393. /package/dist/{form/src/utils → utils}/dynamicPosition.d.ts +0 -0
  394. /package/dist/{form/src/utils → utils}/file.api.d.ts +0 -0
  395. /package/dist/{form/src/utils → utils}/file.preview.d.ts +0 -0
  396. /package/dist/{form/src/utils → utils}/formConditions.d.ts +0 -0
  397. /package/dist/{form/src/utils → utils}/formRules.d.ts +0 -0
  398. /package/dist/{form/src/utils → utils}/index.d.ts +0 -0
  399. /package/dist/{form/src/utils → utils}/randomId.d.ts +0 -0
@@ -1,3 +1,3 @@
1
- (function(H,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("@opengis/core")):typeof define=="function"&&define.amd?define(["exports","vue","@opengis/core"],e):(H=typeof globalThis<"u"?globalThis:H||self,e(H.FormBuilder={},H.Vue,H.OpenGISCore))})(this,function(H,e,J){"use strict";const Kt={class:"w-full relative"},Zt={key:0,class:"text-[14px] font-medium text-gray-900 mb-2"},Wt={class:"opacity-100"},Yt={key:0,class:"text-red-500 text-[14px]"},Jt={key:1,class:"text-red-500 text-[10px] absolute bottom-[-14px]"},Xt=e.defineComponent({__name:"vs-layout-default",props:{ua:{default:""},uk:{},en:{},de:{},es:{},fr:{},item:{default:()=>({})},error:{type:[String,Boolean],default:""},label:{default:""}},setup(a){const t=e.ref("uk"),n=s=>{s.detail.key==="locale"&&(t.value=s.detail.newValue)};return e.onMounted(()=>{t.value=localStorage.locale,window.addEventListener("storage",n)}),e.onUnmounted(()=>{window.removeEventListener("resize",n)}),(s,l)=>(e.openBlock(),e.createElementBlock("div",Kt,[s.ua||s.label?(e.openBlock(),e.createElementBlock("div",Zt,[e.createElementVNode("span",Wt,e.toDisplayString(s.item[t.value]||s.ua||s.label),1),s.item?.rules?.includes("required")?(e.openBlock(),e.createElementBlock("span",Yt,"*")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.renderSlot(s.$slots,"default",e.mergeProps(s.$attrs,{class:{"opacity-60":s.item.disabled}})),s.error?(e.openBlock(),e.createElementBlock("span",Jt,e.toDisplayString(s.error),1)):e.createCommentVNode("",!0)]))}}),Qt={class:"w-full relative flex flex-row items-center gap-2"},en={key:0,class:"text-sm text-gray-900 font-medium flex shrink-0 w-3/12 max-w-[250px]"},tn={key:0,class:"text-red-500 text-[14px]"},nn={key:1,class:"text-red-500 text-[10px] absolute bottom-[-14px]"},sn=e.defineComponent({__name:"vs-layout-horizontal",props:{ua:{default:""},uk:{},en:{},de:{},es:{},fr:{},item:{default:()=>({})},error:{type:[String,Boolean],default:""},label:{default:""}},setup(a){return(t,n)=>(e.openBlock(),e.createElementBlock("div",Qt,[t.item?.type!=="html"?(e.openBlock(),e.createElementBlock("span",en,[e.createTextVNode(e.toDisplayString(t.ua||t.label)+" ",1),t.item?.rules?.includes("required")&&(t.ua||t.label)?(e.openBlock(),e.createElementBlock("span",tn,"*")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.renderSlot(t.$slots,"default",e.normalizeProps(e.guardReactiveProps(t.$attrs))),t.error?(e.openBlock(),e.createElementBlock("span",nn,e.toDisplayString(t.error),1)):e.createCommentVNode("",!0)]))}}),ln={class:"w-full relative"},on={key:0,class:"text-red-500 text-[10px] absolute bottom-[-14px]"},rn=e.defineComponent({__name:"vs-layout-inline",props:{ua:{default:""},uk:{},en:{},de:{},es:{},fr:{},item:{default:()=>({})},error:{type:[String,Boolean],default:""},label:{default:""}},setup(a){return(t,n)=>(e.openBlock(),e.createElementBlock("div",ln,[e.renderSlot(t.$slots,"default",e.normalizeProps(e.guardReactiveProps(t.$attrs))),t.error?(e.openBlock(),e.createElementBlock("span",on,e.toDisplayString(t.error),1)):e.createCommentVNode("",!0)]))}}),an={class:"flex-1 min-w-0"},dn={key:0,class:"text-sm font-medium text-slate-700 dark:text-slate-200 flex items-center gap-1"},cn={class:"truncate"},un={key:0,class:"text-red-500 text-[14px]"},pn={key:1,class:"text-xs text-slate-500 dark:text-slate-400"},hn={class:"w-full md:w-auto"},mn={key:0,class:"mt-1 text-xs text-red-500"},fn={default:Xt,horizontal:sn,inline:rn,settings:e.defineComponent({__name:"vs-layout-settings",props:{ua:{default:""},uk:{},en:{},de:{},es:{},fr:{},item:{default:()=>({})},error:{type:[String,Boolean],default:""},label:{default:""}},setup(a){const t=a,n=e.ref("uk");e.computed(()=>(t.item??{})?.[n.value]??t.ua??t.label??"");const s=e.computed(()=>t.item?.description??""),l=e.computed(()=>Array.isArray(t.item?.rules)&&t.item.rules.includes("required")),o=e.computed(()=>(typeof t.error=="string"?t.error:"")??""),r=i=>{i.key==="locale"&&(n.value=i.newValue??"uk")};return e.onMounted(()=>{try{typeof localStorage<"u"&&localStorage.locale&&(n.value=localStorage.locale)}catch{}window.addEventListener("storage",r)}),e.onUnmounted(()=>{window.removeEventListener("storage",r)}),(i,d)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["w-full relative",{"opacity-60":i.item?.disabled}])},[e.createElementVNode("div",{class:e.normalizeClass(["gap-2 md:flex-row md:items-center md:justify-between",[["switcher","native-select"].includes(i.item.type)?"flex flex-col":""]])},[e.createElementVNode("div",an,[i.ua||i.label?(e.openBlock(),e.createElementBlock("p",dn,[e.createElementVNode("span",cn,e.toDisplayString(i.item[n.value]||i.ua||i.label),1),l.value?(e.openBlock(),e.createElementBlock("span",un,"*")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),s.value?(e.openBlock(),e.createElementBlock("p",pn,e.toDisplayString(s.value),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",hn,[e.renderSlot(i.$slots,"default",e.normalizeProps(e.guardReactiveProps(i.$attrs)))])],2),o.value?(e.openBlock(),e.createElementBlock("p",mn,e.toDisplayString(o.value),1)):e.createCommentVNode("",!0)],2))}})};function se(a){return{inputClass:e.computed(()=>{const n=`disabled:opacity-50 disabled:cursor-not-allowed outline-none focus:ring-2 focus:ring-ring focus:ring-${a?.primaryColor||"blue"}-500 border border-solid border-stone-200 rounded-md text-sm text-stone-800 placeholder:text-stone-400 `;return a?.size==="sm"?`${n}h-[32px]`:`${n}h-[38px]`})}}const gn=["placeholder","disabled"],kn=e.defineComponent({__name:"vs-input-password",props:e.mergeModels({style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{default:""},name:{},placeholder:{default:""}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(a){const t=a,{inputClass:n}=se(t.style),s=e.useModel(a,"modelValue");return(l,o)=>e.withDirectives((e.openBlock(),e.createElementBlock("input",{type:"password","onUpdate:modelValue":o[0]||(o[0]=r=>s.value=r),placeholder:l.placeholder,disabled:l.disabled,class:e.normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white",[e.unref(n),{"!border-red-600":l.error}]]),style:{border:"1px solid #CFD9E0"}},null,10,gn)),[[e.vModelText,s.value]])}}),bn=["placeholder","disabled"],_e=e.defineComponent({__name:"vs-input-text",props:e.mergeModels({style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{default:""},name:{},placeholder:{default:""}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(a){const t=a,{inputClass:n}=se(t.style),s=e.useModel(a,"modelValue");return(l,o)=>e.withDirectives((e.openBlock(),e.createElementBlock("input",{type:"text","onUpdate:modelValue":o[0]||(o[0]=r=>s.value=r),placeholder:l.placeholder,disabled:l.disabled,class:e.normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white",[e.unref(n),{"!border-red-600":l.error}]]),style:{border:"1px solid #CFD9E0"}},null,10,bn)),[[e.vModelText,s.value]])}}),yn=["placeholder","min","max"],Je=e.defineComponent({__name:"vs-input-number",props:e.mergeModels({min:{},max:{},style:{default:()=>({})},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{default:""}},{modelValue:{default:null},modelModifiers:{}}),emits:["update:modelValue"],setup(a){const t=a,{inputClass:n}=se(t.style),s=e.useModel(a,"modelValue");return(l,o)=>e.withDirectives((e.openBlock(),e.createElementBlock("input",{type:"number",step:"any","onUpdate:modelValue":o[0]||(o[0]=r=>s.value=r),placeholder:l.placeholder,class:e.normalizeClass(["py-1.5 px-3 block w-full bg-white",[e.unref(n)]]),style:{border:"1px solid #CFD9E0"},min:l.min,max:l.max},null,10,yn)),[[e.vModelText,s.value]])}}),j=(a,t)=>{const n=a.__vccOpts||a;for(const[s,l]of t)n[s]=l;return n},xn={},wn={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"4","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-check"};function _n(a,t){return e.openBlock(),e.createElementBlock("svg",wn,t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M5 12l5 5l10 -10"},null,-1)]))}const En=j(xn,[["render",_n]]),Vn={class:"flex items-center gap-[4px]"},Cn=["value","id","disabled"],Bn=["for"],vn={class:"text-[14px] text-gray-700 flex items-center gap-x-1 ml-1 dark:text-neutral-400"},Nn=e.defineComponent({__name:"vs-checkbox-default",props:{value:{default:""},label:{default:""},disabled:{type:Boolean,default:!1},id:{},modelValue:{default:""},info:{},error:{}},emits:["update:modelValue"],setup(a,{emit:t}){const n=t,s=a,l=e.computed({get:()=>s.modelValue,set:o=>n("update:modelValue",o)});return(o,r)=>(e.openBlock(),e.createElementBlock("div",Vn,[e.withDirectives(e.createElementVNode("input",{type:"checkbox",value:o.value,"onUpdate:modelValue":r[0]||(r[0]=i=>l.value=i),class:e.normalizeClass(["shrink-0 border border-solid hidden border-gray-700 w-3.5 h-3.5 rounded text-blue-600 focus:ring-offset-0 dark:bg-neutral-800 dark:border-neutral-700 cursor-pointer",{"!cursor-not-allowed":o.disabled}]),id:o.id,disabled:o.disabled},null,10,Cn),[[e.vModelCheckbox,l.value]]),e.createElementVNode("label",{for:o.id,class:e.normalizeClass(["flex flex-1 checkbox-label items-center gap-x-2 cursor-pointer text-sm text-gray-800 dark:text-neutral-300",{"!cursor-not-allowed":o.disabled}])},[e.createElementVNode("div",{class:e.normalizeClass(["h-[16px] text-white w-[16px] flex items-center justify-center shrink-0 border rounded",[l.value?"bg-blue-600 border-blue-600":"bg-white border-gray-600",o.error?"border-red-600":""]])},[e.createVNode(En,{height:"12",width:"12"})],2),e.createElementVNode("span",vn,[e.renderSlot(o.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(o.label),1)])])],10,Bn)]))}}),Sn=["name","value","disabled"],Mn={class:"flex items-center gap-[6px] text-[14px]"},$n={key:0,class:"text-[16px]"},Fn=["src"],An=e.defineComponent({__name:"vs-checkbox-buttons",props:{value:{type:[String,Number,Boolean],default:""},label:{default:""},modelValue:{default:""},disabled:{type:Boolean},id:{},icon:{},imgUrl:{},style:{}},emits:["update:modelValue"],setup(a,{emit:t}){const n=a,s=t,l=e.computed({get:()=>n.modelValue,set:i=>{s("update:modelValue",i)}}),o=e.computed(()=>Array.isArray(l.value)?l.value.includes(n.value):l.value===!0||l.value===n.value),r=e.computed(()=>n.style?.size==="xs"?"p-1.5 text-xs":n.style?.size==="lg"?"p-3.5 text-[20px]":"p-2.5 text-xs");return(i,d)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(["group relative flex justify-center items-center gap-x-3 text-center bg-white text-gray-800 ring-ring ring-2 cursor-pointer rounded-lg",[r.value,o.value?"ring-blue-500":"border border-gray-200 ring-transparent"]])},[e.withDirectives(e.createElementVNode("input",{type:"checkbox",class:"hidden",name:i.id,value:i.value,"onUpdate:modelValue":d[0]||(d[0]=c=>l.value=c),disabled:i.disabled},null,8,Sn),[[e.vModelCheckbox,l.value]]),e.createElementVNode("span",Mn,[i.icon||i.imgUrl?(e.openBlock(),e.createElementBlock("span",$n,[i.icon?(e.openBlock(),e.createElementBlock("i",{key:0,class:e.normalizeClass(i.icon)},null,2)):e.createCommentVNode("",!0),i.imgUrl?(e.openBlock(),e.createElementBlock("img",{key:1,src:i.imgUrl,width:"16",height:"16",alt:"icon"},null,8,Fn)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.renderSlot(i.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(i.label),1)])])],2))}}),Dn={class:"flex items-center"},Xe=e.defineComponent({__name:"vs-input-checkbox-item",props:{value:{default:""},label:{default:""},disabled:{type:Boolean,default:!1},view:{default:"default"},modelValue:{type:[Boolean,Array],default:!1},icon:{},imgUrl:{},slots:{},option:{},style:{},error:{default:""}},emits:["update:modelValue"],setup(a,{emit:t}){const n=a,s=t,l=`radio-${Math.floor(Math.random()*1e4)}`,o=e.computed({get:()=>Array.isArray(n.modelValue)?Array.isArray(n.modelValue)&&n.modelValue.includes(n.value):n.modelValue,set:i=>{if(Array.isArray(n.modelValue)){let d=[...n.modelValue];i?d.includes(n.value)||d.push(n.value):d=d.filter(c=>c!==n.value),s("update:modelValue",d)}else s("update:modelValue",i)}}),r=e.ref(`vs-checkbox-${n.view||"default"}`);return(i,d)=>(e.openBlock(),e.createElementBlock("div",Dn,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.value==="vs-checkbox-buttons"?e.unref(An):e.unref(Nn)),{value:i.value,label:i.label,info:i.option?.info,disabled:i.disabled,modelValue:o.value,"onUpdate:modelValue":d[0]||(d[0]=c=>o.value=c),id:l,icon:i.icon,imgUrl:i.imgUrl,style:e.normalizeStyle(i.style),error:i.error},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.label),1)]),_:1},8,["value","label","info","disabled","modelValue","icon","imgUrl","style","error"]))]))}}),In={},Ln={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-chevron-down"};function Tn(a,t){return e.openBlock(),e.createElementBlock("svg",Ln,t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M6 9l6 6l6 -6"},null,-1)]))}const Rn=j(In,[["render",Tn]]),On={},zn={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-x"};function jn(a,t){return e.openBlock(),e.createElementBlock("svg",zn,t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M18 6l-12 12"},null,-1),e.createElementVNode("path",{d:"M6 6l12 12"},null,-1)]))}const Un=j(On,[["render",jn]]),Pn={},Hn={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function qn(a,t){return e.openBlock(),e.createElementBlock("svg",Hn,t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M12 9h.01"},null,-1),e.createElementVNode("path",{d:"M11 12h1v4h1"},null,-1),e.createElementVNode("path",{d:"M12 3c7.2 0 9 1.8 9 9s-1.8 9 -9 9s-9 -1.8 -9 -9s1.8 -9 9 -9z"},null,-1)]))}const Gn=j(Pn,[["render",qn]]),Kn={key:0,class:"flex items-start gap-x-1"},Zn={key:0,class:"text-red-500 text-[14px]"},Wn=["title"],Yn=["disabled"],je=e.defineComponent({__name:"vs-input-switcher",props:e.mergeModels({rules:{default:()=>[]},view:{default:"checkbox"},label:{default:""},i:{default:""},text:{default:""},style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{default:""},name:{},placeholder:{}},{modelValue:{type:Boolean,default:!1},modelModifiers:{}}),emits:["update:modelValue"],setup(a){const t=a,n=e.useModel(a,"modelValue");return(s,l)=>t.view==="checkbox"?(e.openBlock(),e.createElementBlock("div",Kn,[e.createVNode(Xe,{modelValue:n.value,"onUpdate:modelValue":l[0]||(l[0]=o=>n.value=o),label:s.text,error:s.error||""},null,8,["modelValue","label","error"]),s.rules?.includes("required")?(e.openBlock(),e.createElementBlock("span",Zn,"*")):e.createCommentVNode("",!0),s.i?(e.openBlock(),e.createElementBlock("button",{key:1,class:"cursor-pointer",title:s.i,onClick:l[1]||(l[1]=e.withModifiers(()=>{},["prevent"]))},[e.createVNode(e.unref(Gn),{class:"text-gray-500 w-[14px] h-[14px]"})],8,Wn)):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:e.normalizeClass(["inline-flex h-5 w-9 shrink-0 px-[2px] cursor-pointer items-center rounded-full shadow-sm disabled:cursor-not-allowed disabled:opacity-50",[n.value?`bg-${s.style?.primaryColor||"blue"}-500`:"bg-stone-200",s.customClass]]),disabled:s.disabled,onClick:l[2]||(l[2]=o=>n.value=!n.value)},[e.createElementVNode("span",{"data-state":"checked",class:e.normalizeClass(["pointer-events-none block h-4 w-4 rounded-full bg-white shadow-lg ring-0 transition-transform",[n.value?"translate-x-4":"translate-x-0"]])},null,2)],10,Yn))}}),Jn=["id","innerHTML"],Ue=e.defineComponent({__name:"vs-input-static",props:{text:{default:""},html:{default:""},style:{},customClass:{default:""},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{}},setup(a){return(t,n)=>(e.openBlock(),e.createElementBlock("div",{id:t.name,class:e.normalizeClass(["text-gray-900",t.customClass]),innerHTML:t.html?t.html:t.text},null,10,Jn))}}),Xn=["placeholder","disabled","name"],Qe=e.defineComponent({__name:"vs-input-mask",props:e.mergeModels({name:{},mask:{default:""},unmask:{type:Boolean,default:!1},placeholder:{default:"_"},style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(a){const t=a,{inputClass:n}=se(t.style),s=e.useModel(a,"modelValue"),l=e.ref(null);let o=null;return e.onMounted(async()=>{if(l.value){const{default:r}=await Promise.resolve().then(()=>Li);o=r(l.value,{mask:t.mask||"",definitions:{9:/[0-9]/,A:/[a-zA-Z]/,"*":/[a-zA-Z0-9]/},lazy:!1}),o.on("accept",()=>{s.value=t.unmask?o.unmaskedValue:o.value}),o.on("complete",()=>{s.value=t.unmask?o.unmaskedValue:o.value}),o.value=s.value??""}}),e.onBeforeUnmount(()=>{o?.destroy()}),e.watch(()=>t.mask,r=>{o&&o.updateOptions({mask:r,definitions:{9:/[0-9]/,A:/[a-zA-Z]/,"*":/[a-zA-Z0-9]/}})}),e.watch(s,r=>{o&&o.unmaskedValue!==r&&(o.value=r||"")}),(r,i)=>(e.openBlock(),e.createElementBlock("input",{type:"text",ref_key:"inputEl",ref:l,placeholder:r.placeholder,disabled:r.disabled,name:r.name,class:e.normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white",[e.unref(n)]]),style:{border:"1px solid #CFD9E0"}},null,10,Xn))}}),Qn={class:"relative w-full bg-white rounded-lg"},es=["placeholder","disabled"],et=e.defineComponent({__name:"vs-input-email",props:e.mergeModels({style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{default:null},name:{},placeholder:{default:""}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(a){const t=a,{inputClass:n}=se(t.style),s=e.useModel(a,"modelValue");return(l,o)=>(e.openBlock(),e.createElementBlock("div",Qn,[o[1]||(o[1]=e.createStaticVNode('<div class="absolute bottom-2/4 translate-y-2/4 left-[10px] cursor-pointer"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="stroke-gray-500 transition-all"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M3 7a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v10a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-10z"></path><path d="M3 7l9 6l9 -6"></path></svg></div>',1)),e.withDirectives(e.createElementVNode("input",{type:"email","onUpdate:modelValue":o[0]||(o[0]=r=>s.value=r),placeholder:l.placeholder,disabled:l.disabled,class:e.normalizeClass(["!pl-8 py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white",[e.unref(n),{"!border-red-600":l.error}]]),style:{border:"1px solid #CFD9E0"}},null,10,es),[[e.vModelText,s.value]])]))}}),ts=["value","disabled"],ns={class:"text-[13px] text-gray-700"},ss=e.defineComponent({__name:"vs-input-radio-default",props:e.mergeModels({style:{},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{},name:{},placeholder:{},value:{},text:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(a){const t=e.useModel(a,"modelValue");return(n,s)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(["flex items-center gap-0",[n.customClass]])},[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":s[0]||(s[0]=l=>t.value=l),type:"radio",value:n.value,disabled:n.disabled,class:"hidden"},null,8,ts),[[e.vModelRadio,t.value]]),e.createElementVNode("span",{class:e.normalizeClass(["w-[16px] shrink-0 h-[16px] border rounded-full flex items-center justify-center mr-[10px]",[`border-${n.style?.primaryColor||"blue"}-500`,n.disabled?"opacity-50 cursor-not-allowed":""]])},[t.value==n.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["w-[12px] h-[12px] shrink-0 rounded-full",[`bg-${n.style?.primaryColor||"blue"}-500`]])},null,2)):e.createCommentVNode("",!0)],2),e.createElementVNode("span",ns,e.toDisplayString(n.text),1)],2))}}),ls=["value","disabled"],os={class:"text-[13px] text-gray-700"},rs={"vs-input-radio-default":ss,"vs-input-radio-buttons":e.defineComponent({__name:"vs-input-radio-buttons",props:e.mergeModels({style:{},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{},name:{},placeholder:{},value:{},text:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(a){const t=e.useModel(a,"modelValue");return(n,s)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(["flex items-center border rounded-lg px-2 py-1",[t.value==n.value?`ring-2 ring-ring ring-${n.style?.primaryColor||"blue"}-500`:"",n.customClass]])},[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":s[0]||(s[0]=l=>t.value=l),type:"radio",value:n.value,disabled:n.disabled,class:"hidden"},null,8,ls),[[e.vModelRadio,t.value]]),e.createElementVNode("span",os,e.toDisplayString(n.text),1)],2))}})},Pe=e.defineComponent({__name:"vs-input-radio",props:e.mergeModels({options:{},position:{default:"vertical"},view:{default:"default"},style:{},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(a){const t=a,n=e.useModel(a,"modelValue"),s=e.computed(()=>rs[`vs-input-radio-${t.view}`]);return(l,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([l.position==="horizontal"?"flex items-center flex-wrap gap-2":""])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.options,r=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(s.value),e.mergeProps({key:r?.id,text:r.text,value:r.id.toString(),checked:n.value===r.id,modelValue:n.value,"onUpdate:modelValue":o[0]||(o[0]=i=>n.value=i)},{ref_for:!0},l.$attrs),null,16,["text","value","checked","modelValue"]))),128))],2))}}),tt=j(e.defineComponent({__name:"vs-input-checkbox",props:{options:{default:()=>[]},position:{default:"vertical"},slots:{default:null},colSpan:{default:0},data:{},view:{},style:{},customClass:{},disabled:{type:Boolean},modelValue:{default:!1},error:{},name:{},placeholder:{}},emits:["update:modelValue"],setup(a,{emit:t}){const n=a,s=t,l=e.ref([]),o=e.reactive({}),r=u=>u?.value||u?.id||u?.text||u,i=u=>u.text||String(u),d=u=>`lg:col-span-${u||12}`,c=async()=>{try{const u=await fetch(`/api/suggest/${n.data}`).then(p=>p.json());l.value=u?.data||u}catch(u){console.error(u)}};return e.watch(()=>n.modelValue,u=>{if(typeof u=="boolean"&&l.value.length===1){const p=r(l.value[0]);o[p]=u}else if(Array.isArray(u)){const p=new Set(u);l.value.forEach(h=>{if(!h.disabled){const E=r(h);o[E]=p.has(E)}})}},{immediate:!0}),e.watch(o,()=>{if(!l.value.length){s("update:modelValue",null);return}const u=Object.entries(o).filter(([,p])=>p).map(([p])=>p);s("update:modelValue",u.length===0?[]:u)},{deep:!0}),e.onMounted(()=>{if(n.data)c().then(()=>{if(typeof n.modelValue=="boolean"&&l.value.length===1){const u=r(l.value[0]);o[u]=n.modelValue}else if(Array.isArray(n.modelValue)){const u=new Set(n.modelValue);l.value.forEach(p=>{if(!p.disabled){const h=r(p);o[h]=u.has(h)}})}});else if(l.value=n.options,typeof n.modelValue=="boolean"&&l.value.length===1){const u=r(l.value[0]);o[u]=n.modelValue}else if(Array.isArray(n.modelValue)){const u=new Set(n.modelValue);l.value.forEach(p=>{if(!p.disabled){const h=r(p);o[h]=u.has(h)}})}}),(u,p)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["p-0 w-full gap-[6px]",[u.position==="vertical"?"flex-col":"",u.colSpan?"grid":"flex justify-start"]])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,h=>(e.openBlock(),e.createBlock(Xe,{modelValue:o[r(h)],"onUpdate:modelValue":E=>o[r(h)]=E,value:r(h),class:e.normalizeClass(d(u.colSpan)),disabled:h.disabled,label:i(h),key:r(h),icon:h?.icon,imgUrl:h?.imgUrl,option:h,view:u.view},null,8,["modelValue","onUpdate:modelValue","value","class","disabled","label","icon","imgUrl","option","view"]))),128))],2))}}),[["__scopeId","data-v-91f3584a"]]),as=["type","placeholder","disabled"],nt=e.defineComponent({__name:"vs-input-date1",props:{style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{},name:{},placeholder:{default:""},mode:{default:"date"}},emits:["update:modelValue"],setup(a,{emit:t}){const n=a;function s(d){return d?n.mode==="datetime"?(d.includes("T")?d:null)||d+(d.includes(" ")?"":"T00:00"):d?.split(" ")[0]:null}const{inputClass:l}=se(n.style),o=t,r=e.computed({get:()=>s(n.modelValue),set:d=>o("update:modelValue",d)}),i=e.computed(()=>n.mode==="datetime"?"datetime-local":n.mode);return(d,c)=>e.withDirectives((e.openBlock(),e.createElementBlock("input",{type:i.value,"onUpdate:modelValue":c[0]||(c[0]=u=>r.value=u),placeholder:d.placeholder,disabled:d.disabled,ref:"date",class:e.normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white",[d.modelValue?"":"text-opacity-50",e.unref(l)].join(" ")]),style:{border:"1px solid #CFD9E0"}},null,10,as)),[[e.vModelDynamic,r.value]])}}),is=async(a,t,n,s)=>{try{const l=new FormData;return l.append("unique","true"),l.append("file",a),(await fetch(`/file/upload/uploads?id=${t||""}&form=${n||""}&table=${s||""}`,{method:"POST",body:l}).then(r=>r.json()))?.result}catch(l){return J.notify({type:"error",title:"Помилка!",message:"Сталась помилка під час завантаження файлу",position:"right-bottom"}),console.error("Сталась помилка завантаження файлу",l),null}},ds=async a=>{try{return await fetch(`file/delete${a}`),!0}catch(t){return console.error(t),!1}},st=async a=>{try{const t=await fetch(`file/download/files/uploads${a}`),n=await t.arrayBuffer(),s=t.headers["content-type"],l=new TextDecoder("utf-8").decode(n),o=new Blob([l],{type:s}),r=document.createElement("a");r.setAttribute("download",a),r.href=window.URL.createObjectURL(o),r.click()}catch(t){console.error(t.message)}},cs={},us={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function ps(a,t){return e.openBlock(),e.createElementBlock("svg",us,t[0]||(t[0]=[e.createElementVNode("path",{d:"M5 12h14"},null,-1),e.createElementVNode("path",{d:"M12 5v14"},null,-1)]))}const Ee=j(cs,[["render",ps]]),hs={},ms={xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-file-text",width:"44",height:"44",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"};function fs(a,t,n,s,l,o){return e.openBlock(),e.createElementBlock("svg",ms,t[0]||(t[0]=[e.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"></path><line x1="9" y1="9" x2="10" y2="9"></line><line x1="9" y1="13" x2="15" y2="13"></line><line x1="9" y1="17" x2="15" y2="17"></line>',6)]))}const gs=j(hs,[["render",fs]]),ks={},bs={xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-table",width:"44",height:"44",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"};function ys(a,t,n,s,l,o){return e.openBlock(),e.createElementBlock("svg",bs,t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("rect",{x:"4",y:"4",width:"16",height:"16",rx:"2"},null,-1),e.createElementVNode("line",{x1:"4",y1:"10",x2:"20",y2:"10"},null,-1),e.createElementVNode("line",{x1:"10",y1:"4",x2:"10",y2:"20"},null,-1)]))}const xs=j(ks,[["render",ys]]),ws={},_s={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function Es(a,t){return e.openBlock(),e.createElementBlock("svg",_s,t[0]||(t[0]=[e.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"></path><path d="M9 9l1 0"></path><path d="M9 13l6 0"></path><path d="M9 17l6 0"></path>',6)]))}const lt=j(ws,[["render",Es]]),Vs={},Cs={xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-file-zip",width:"44",height:"44",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"};function Bs(a,t,n,s,l,o){return e.openBlock(),e.createElementBlock("svg",Cs,t[0]||(t[0]=[e.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M6 20.735a2 2 0 0 1 -1 -1.735v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2h-1"></path><path d="M11 17a2 2 0 0 1 2 2v2a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1v-2a2 2 0 0 1 2 -2z"></path><line x1="11" y1="5" x2="10" y2="5"></line><line x1="13" y1="7" x2="12" y2="7"></line><line x1="11" y1="9" x2="10" y2="9"></line><line x1="13" y1="11" x2="12" y2="11"></line><line x1="11" y1="13" x2="10" y2="13"></line><line x1="13" y1="15" x2="12" y2="15"></line>',9)]))}const vs=j(Vs,[["render",Bs]]),Ns={},Ss={xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-file-code",width:"44",height:"44",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"};function Ms(a,t,n,s,l,o){return e.openBlock(),e.createElementBlock("svg",Ss,t[0]||(t[0]=[e.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"></path><path d="M10 13l-1 2l1 2"></path><path d="M14 13l1 2l-1 2"></path>',5)]))}const $s=j(Ns,[["render",Ms]]),Fs=a=>{if(!a)return"";const t=a?.split(".");return t[t.length-1]},As=a=>{const t=Fs(a),n={imageFormat:["tiff","jpg","jpeg","png","svg","ico","webp"],sheetsFormat:["xls","csv","xlsx"],archivesFormat:["zip","rar"],textsFormat:["json","geojson","txt","yml","yaml","shp"],documentsFormat:["pdf"]};return n.imageFormat.includes(t)?"img":n.sheetsFormat.includes(t)?xs:n.textsFormat.includes(t)?$s:n.documentsFormat.includes(t)?gs:n.archivesFormat.includes(t)?vs:lt},Ds={},Is={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-trash"};function Ls(a,t){return e.openBlock(),e.createElementBlock("svg",Is,t[0]||(t[0]=[e.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M4 7l16 0"></path><path d="M10 11l0 6"></path><path d="M14 11l0 6"></path><path d="M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12"></path><path d="M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3"></path>',6)]))}const Fe=j(Ds,[["render",Ls]]),Ts={},Rs={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-download"};function Os(a,t){return e.openBlock(),e.createElementBlock("svg",Rs,t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"},null,-1),e.createElementVNode("path",{d:"M7 11l5 5l5 -5"},null,-1),e.createElementVNode("path",{d:"M12 4l0 12"},null,-1)]))}const ot=j(Ts,[["render",Os]]),zs={class:"h-[120px] w-[120px] border text-gray-300 border-dashed border-[#CFD9E0] rounded-lg overflow-hidden relative item-file"},js={class:"absolute hidden top-0 right-0 flex items-center gap-x-2 w-full h-full justify-center"},rt=j(e.defineComponent({__name:"vs-input-file-list-item",props:e.mergeModels({format:{},multiple:{type:Boolean},style:{},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{}},{value:{},valueModifiers:{},item:{},itemModifiers:{}}),emits:["update:value","update:item"],setup(a){const t=e.useModel(a,"value"),n=e.useModel(a,"item"),s=a;return(l,o)=>(e.openBlock(),e.createElementBlock("div",zs,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(As)(n.value)),{src:n.value,alt:"file",class:"w-full h-full object-cover cursor-pointer",onClick:o[0]||(o[0]=r=>e.unref(st)(n.value))},null,8,["src"])),e.createElementVNode("div",js,[e.createElementVNode("button",{type:"button",onClick:o[1]||(o[1]=r=>{e.unref(ds)(n.value),t.value=s.multiple?t.value?.filter(i=>i!==n.value):""}),class:"w-6 h-6 flex items-center justify-center text-gray-500 bg-gray-200 rounded-lg hover:text-red-500"},[e.createVNode(Fe,{class:"w-4 h-4"})]),e.createElementVNode("button",{type:"button",onClick:o[2]||(o[2]=r=>e.unref(st)(n.value)),class:"w-6 h-6 flex items-center justify-center text-gray-500 bg-gray-200 rounded-lg hover:text-blue-500"},[e.createVNode(ot,{class:"w-4 h-4"})])])]))}}),[["__scopeId","data-v-0ca886b3"]]),Us={class:"flex items-center gap-x-2"},Ps={key:1,class:"flex items-center flex-wrap gap-2"},at=e.defineComponent({__name:"vs-input-file",props:e.mergeModels({format:{},multiple:{type:Boolean},style:{},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(a){const t=a,n=e.useModel(a,"modelValue"),s=e.ref(null),l=r=>Array.isArray(n.value)&&n.value[r]||"",o=async r=>{if(t.format){const c=r.target.files?.[0];if(!c||!c.name.endsWith(t.format))return}const i=r.target.files?.[0];if(!i)return;const d=await is(i,"1","form","table");n.value=t.multiple?[...n.value||[],d?.file_path]:d?.file_path};return(r,i)=>(e.openBlock(),e.createElementBlock("div",Us,[e.createElementVNode("input",{class:"hidden",ref_key:"fileInput",ref:s,type:"file",onChange:o},null,544),!r.multiple&&n.value?(e.openBlock(),e.createBlock(rt,{key:0,item:n.value,"onUpdate:item":i[0]||(i[0]=d=>n.value=d),value:n.value,"onUpdate:value":i[1]||(i[1]=d=>n.value=d)},null,8,["item","value"])):r.multiple?(e.openBlock(),e.createElementBlock("div",Ps,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,(d,c)=>(e.openBlock(),e.createBlock(rt,{multiple:r.multiple,key:c,value:n.value,"onUpdate:value":i[2]||(i[2]=u=>n.value=u),item:l(c)},null,8,["multiple","value","item"]))),128)),e.createElementVNode("div",{onClick:i[3]||(i[3]=d=>!r.disabled&&s.value?.click()),class:e.normalizeClass(["h-[120px] w-[120px] border text-gray-300 hover:text-blue-500 border-dashed border-[#CFD9E0] rounded-lg flex items-center justify-center transition-all duration-300",r.disabled?"opacity-50 cursor-not-allowed":"cursor-pointer hover:border-blue-500 hover:bg-blue-50"])},[e.createVNode(Ee,{class:"w-6 h-6"})],2)])):e.createCommentVNode("",!0),r.multiple?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:2,onClick:i[4]||(i[4]=d=>s.value?.click()),class:e.normalizeClass([r.disabled?"opacity-50 cursor-not-allowed":"cursor-pointer hover:border-blue-500","h-[120px] w-[120px] border text-gray-300 hover:text-blue-500 border-dashed border-gray-300 rounded-lg flex items-center justify-center cursor-pointer hover:border-blue-500 transition-all duration-300 hover:bg-blue-50"])},[e.createVNode(Ee,{class:"w-6 h-6"})],2))]))}}),Hs={class:"max-w-[55vw]"},qs={class:"text-sm font-semibold text-gray-800 truncate dark:text-neutral-200"},Gs={class:"flex items-center text-xs text-gray-500 truncate dark:text-neutral-500"},Ks={class:"px-[5px]"},Zs={class:""},Ae=e.defineComponent({__name:"vs-widget-file-info",props:{item:{default:null}},setup(a){const t=a,n=e.computed(()=>{try{return new Date(t.item.cdate).toLocaleDateString("uk-UA",{day:"2-digit",month:"long",year:"numeric"})}catch{return""}});function s(l){if(l<1024)return`${l} B`;const o=l/1024;return o<1024?`${o.toFixed(2)} KB`:`${(o/1024).toFixed(2)} MB`}return(l,o)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[o[1]||(o[1]=e.createStaticVNode('<div class="flex items-center justify-center h-[30px] w-[30px]"><svg xmlns="http://www.w3.org/2000/svg" height="24" width="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-file"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"></path></svg></div>',1)),e.createElementVNode("div",Hs,[e.createElementVNode("p",qs,e.toDisplayString(l.item?.uploaded_name),1),e.createElementVNode("p",Gs,[e.createElementVNode("span",null,e.toDisplayString(l.item?.username),1),e.withDirectives(e.createElementVNode("span",Ks,"|",512),[[e.vShow,l.item?.username]]),e.createElementVNode("span",null,e.toDisplayString(n.value),1),o[0]||(o[0]=e.createElementVNode("span",{class:"px-[5px]"},"|",-1)),e.createElementVNode("span",Zs,e.toDisplayString(s(l.item?.size)),1)])])],64))}}),Ws={class:"p-3 relative group flex items-center gap-x-3 border border-gray-200 bg-white rounded-md w-full"},Ys={key:0,class:"flex w-full gap-x-3 items-center"},Js={key:1,class:"flex gap-x-3 w-full items-center"},Xs={key:2,class:"flex gap-x-3 w-full items-center"},Qs=["href"],el={key:3,class:"flex gap-x-3 w-full items-center"},tl={class:"lg:absolute lg:top-3 lg:end-1 opacity-100"},nl={class:"p-0.5 sm:p-1 inline-flex items-center gap-0.5 bg-white rounded-lg dark:bg-neutral-800 dark:border-neutral-700"},sl={class:"inline-block"},ll={class:"inline-block"},ol=e.defineComponent({__name:"vs-widget-file-item",props:{item:{default:null},index:{default:0},prefix:{default:"/api"}},emits:["update","openModal","openLightbox"],setup(a,{emit:t}){const n=a,s=t;function l(u){return["pdf","json"].includes(u.ext)}function o(u){return["ppt","pptx","doc","docx","xls","xlsx"].includes(u.ext)}function r(u){const p=document.createElement("a");p.setAttribute("download",u?.uploaded_name),p.href=u?.file_path,p.click()}async function i(){try{await fetch(`${n.prefix}/widget/file/${n.item.entity_id}/${n.item.file_id}`),s("update")}catch(u){console.error(u)}}function d(){s("openModal",{title:"Ви впевнені?",message:"Ви впевнені, що хочете видалити цей файл?",confirmButtonText:"Так, я впевнена/ий",cancelButtonText:"Скасувати",confirm:i,updateListOnConfirm:!0})}function c(u){(n.item.ext==="jpg"||n.item.ext==="png")&&s("openLightbox",{item:n.item,index:u})}return(u,p)=>(e.openBlock(),e.createElementBlock("div",Ws,[u.item.ext==="jpg"||u.item.ext==="png"?(e.openBlock(),e.createElementBlock("div",Ys,[e.createElementVNode("div",{class:"max-w-[55vw] cursor-pointer flex gap-x-3 w-full items-center",onClick:p[0]||(p[0]=h=>c(u.index))},[e.createVNode(Ae,{item:u.item},null,8,["item"])])])):l(u.item)?(e.openBlock(),e.createElementBlock("div",Js,[e.createVNode(Ae,{item:u.item},null,8,["item"])])):o(u.item)?(e.openBlock(),e.createElementBlock("div",Xs,[e.createElementVNode("a",{href:`/api/file-preview?id=${u.item.file_id}`,target:"_blank",class:"flex gap-x-3 w-full items-center"},[e.createVNode(Ae,{item:u.item},null,8,["item"])],8,Qs)])):(e.openBlock(),e.createElementBlock("div",el,[e.createVNode(Ae,{item:u.item},null,8,["item"])])),e.createElementVNode("div",tl,[e.createElementVNode("div",nl,[e.createElementVNode("div",sl,[e.createElementVNode("button",{class:"inline-flex p-[6px] justify-center items-center gap-x-2 rounded-lg border border-transparent text-gray-500 hover:bg-gray-100 disabled:opacity-50 disabled:pointer-events-none dark:text-neutral-400 focus:outline-none focus:bg-gray-100 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700",onClick:p[1]||(p[1]=h=>r(u.item))},[e.createVNode(ot,{height:"14",width:"14"})])]),p[3]||(p[3]=e.createElementVNode("div",{class:"w-px h-5 mx-1 bg-gray-200 dark:bg-neutral-700"},null,-1)),e.createElementVNode("div",ll,[e.createElementVNode("button",{type:"button",class:"size-[30px] inline-flex justify-center items-center gap-x-2 rounded-lg border border-transparent text-red-600 hover:bg-red-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-red-100 dark:text-red-500 dark:hover:bg-red-500/20 dark:focus:bg-red-500/20",onClick:p[2]||(p[2]=h=>d())},[e.createVNode(Fe,{height:"14",width:"14"})])])])])]))}}),rl={},al={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-download"};function il(a,t){return e.openBlock(),e.createElementBlock("svg",al,t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"},null,-1),e.createElementVNode("path",{d:"M7 11l5 5l5 -5"},null,-1),e.createElementVNode("path",{d:"M12 4l0 12"},null,-1)]))}const dl=j(rl,[["render",il]]),cl={class:"flex flex-col widget-file xl:bg-white xl:rounded-xl dark:xl:bg-neutral-800 dark:xl:border-neutral-700 w-full"},ul={class:"flex w-full mb-[12px] items-center gap-x-2"},pl={class:"font-semibold text-gray-800 dark:text-neutral-200 text-[14px]"},hl={class1:"ml-auto"},ml={class:"py-1.5 px-4 inline-flex items-center gap-x-2 text-sm font-medium rounded-lg bg-gray-100 cursor-pointer hover:bg-gray-200 text-gray-800 shadow-2xs hover:bg-gray-50 focus:outline-hidden focus:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-800 dark:border-neutral-700 dark:text-white dark:hover:bg-neutral-700 dark:focus:bg-neutral-700"},fl={key:0,class:"py-4 mb-4 space-y-4 border-gray-200 border-y dark:border-neutral-700"},gl={class:"relative"},kl={key:1,class:"space-y-3 max-h-[300px] overflow-y-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"},bl={key:0},it=e.defineComponent({__name:"vs-input-file-list",props:{id:{default:""},prefix:{default:"/api"},style:{},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{}},emits:["update"],setup(a,{emit:t}){const n=a,s=e.inject("form"),l=e.computed(()=>s.value.formId),o=e.ref(!1),r=e.ref(0),i=t,d=e.ref(!1),c=e.ref({}),u=e.ref([]),p=e.ref(""),h=e.computed(()=>Array.isArray(u.value)?u.value.filter(_=>_.ext==="jpg"||_.ext==="png").map(_=>_?.file_path):[]),E=e.computed(()=>p.value===""?u.value:u.value.filter(_=>_?.uploaded_name?.includes(p.value))),F=_=>{const m=h.value.findIndex(g=>g===_.item.file_path);m!==-1&&(o.value=!0,r.value=m)},$=async()=>{try{const _=await fetch(`${n.prefix}/widget/file/${l.value}`).then(m=>m.json());u.value=_?.rows}catch(_){console.error(_)}},A=async _=>{await Promise.all(Array.from(_.target.files).map(async m=>{const g=new FormData;g.append("file",m);try{const x=`${n.prefix}/widget/file/${l.value}`,w=await fetch(x,{method:"POST",body:g});return w.ok?(i("update","file-list"),m):(J.notify({type:w.status>=400&&w.status<500?"warning":"error",title:"Error",message:`Error code: ${w.status}`}),null)}catch(x){return J.notify({type:"error",title:"Error",message:x.message||"Unknown error"}),console.error(x),null}})),await $()},V=_=>{const m={..._};return _.cancel||(m.cancel=()=>{d.value=!1}),_.updateListOnConfirm&&(m.confirm=async()=>{await _.confirm(),d.value=!1,$()}),m},D=_=>{c.value=V(_),d.value=!0};return e.watch(l,_=>{_&&$()}),e.onMounted(()=>{l.value&&$()}),(_,m)=>{const g=e.resolveComponent("Lightbox"),x=e.resolveComponent("MessageBox");return e.openBlock(),e.createElementBlock("div",cl,[e.createElementVNode("div",ul,[e.createElementVNode("h2",pl," Файлів: "+e.toDisplayString(u.value?.length),1),e.createElementVNode("div",hl,[e.createElementVNode("label",null,[e.createElementVNode("input",{type:"file",class:"hidden",onChange:m[0]||(m[0]=w=>A(w))},null,32),e.createElementVNode("div",ml,[e.createVNode(dl,{height:"16",width:"16"})])])])]),u.value?.length>4?(e.openBlock(),e.createElementBlock("div",fl,[e.createElementVNode("div",null,[e.createElementVNode("div",gl,[m[8]||(m[8]=e.createElementVNode("div",{class:"absolute inset-y-0 start-0 flex items-center pointer-events-none z-[1] ps-3.5"},[e.createElementVNode("svg",{class:"flex-shrink-0 text-gray-500 size-4 dark:text-neutral-400",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("circle",{cx:"11",cy:"11",r:"8"}),e.createElementVNode("path",{d:"m21 21-4.3-4.3"})])],-1)),e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":m[1]||(m[1]=w=>p.value=w),class:"py-2 px-3 ps-10 pe-16 block w-full bg-gray-200 xl:bg-gray-100 rounded-lg text-sm focus:border-blue-500 h-[40px] focus:border-2 focus:outline-none disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:border-transparent dark:text-neutral-400 dark:placeholder:text-neutral-400 dark:focus:ring-neutral-600",placeholder:"Введіть назву файлу"},null,512),[[e.vModelText,p.value,void 0,{trim:!0}]])])])])):e.createCommentVNode("",!0),u.value?.length?(e.openBlock(),e.createElementBlock("div",kl,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E.value,(w,z)=>(e.openBlock(),e.createBlock(ol,{key:z,prefix:_.prefix,item:w,index:z,onUpdate:m[2]||(m[2]=Y=>_.$emit("update","file-list")),onOpenModal:m[3]||(m[3]=Y=>D(Y)),onOpenLightbox:m[4]||(m[4]=Y=>F(Y))},null,8,["prefix","item","index"]))),128)),E.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",bl,m[9]||(m[9]=[e.createElementVNode("p",{class:"text-sm text-gray-600 font-sm"}," Файлів з такою назвою не існує, введіть інше пошукове слово ",-1)])))])):e.createCommentVNode("",!0),e.createVNode(g,{modelValue:o.value,"onUpdate:modelValue":m[5]||(m[5]=w=>o.value=w),startIndex:r.value,"onUpdate:index":m[6]||(m[6]=w=>r.value=w),images:h.value},null,8,["modelValue","startIndex","images"]),e.createVNode(x,e.mergeProps({modelValue:d.value,"onUpdate:modelValue":m[7]||(m[7]=w=>d.value=w),onConfirm:c.value.confirm},c.value),null,16,["modelValue","onConfirm"])])}}}),yl={class:"flex items-center justify-between"},xl={class:"text-[16px] text-gray-900 font-medium"},wl={class:"grid gap-3"},_l=j(e.defineComponent({__name:"vs-container-switcher",props:{title:{type:String,default:""},style:{type:Object,default:()=>({})},isOpen:{type:Boolean,default:!1}},setup(a){const t=a,n=e.ref(t.isOpen);return e.watch(()=>t.isOpen,s=>{n.value=s}),(s,l)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",yl,[e.createElementVNode("p",xl,e.toDisplayString(a.title),1),e.createVNode(je,{modelValue:n.value,"onUpdate:modelValue":l[0]||(l[0]=o=>n.value=o),style:e.normalizeStyle(a.style)},null,8,["modelValue","style"])]),e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",wl,[e.renderSlot(s.$slots,"default",{},void 0,!0)],512),[[e.vShow,n.value]])]),_:3})]))}}),[["__scopeId","data-v-90320b87"]]),El={class:"text-[16px] text-gray-900 font-medium"},Vl={class:"grid gap-3"},Cl=j(e.defineComponent({__name:"vs-container-accordion",props:{title:{type:String,default:""},style:{type:Object,default:()=>({})},isOpen:{type:Boolean,default:!1}},setup(a){const t=a,n=e.ref(t.isOpen);return e.watch(()=>t.isOpen,s=>{n.value=s}),(s,l)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("button",{type:"button",onClick:l[0]||(l[0]=o=>n.value=!n.value),class:"flex items-center gap-2"},[e.createVNode(e.unref(Rn),{class:e.normalizeClass(["h-4 w-4 duration-300",[n.value?"-rotate-180":""]])},null,8,["class"]),e.createElementVNode("span",El,e.toDisplayString(a.title),1)]),e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",Vl,[e.renderSlot(s.$slots,"default",{},void 0,!0)],512),[[e.vShow,n.value]])]),_:3})]))}}),[["__scopeId","data-v-590eff11"]]),Bl={class:"flex items-center justify-between"},vl={switcher:_l,accordion:Cl,default:e.defineComponent({__name:"vs-container-default",props:{title:{type:String,default:""},style:{type:Object,default:()=>({})}},setup(a){return(t,n)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",Bl,[e.createElementVNode("p",null,e.toDisplayString(a.title),1)]),e.renderSlot(t.$slots,"default")]))}})},le={Equal:"==",Inequal:"!=",Higer:">",HigerOrEqual:">=",Lower:"<",LowerOrEqual:"<=",Between:"between",StartWith:"^",EndWith:"$",Contain:"*",In:"in",NotIn:"not_in"},Nl=(a,t)=>String(a)===String(t),Sl=(a,t)=>String(a)!==String(t),Ml=(a,t)=>a>t,$l=(a,t)=>a>=t,Fl=(a,t)=>a<t,Al=(a,t)=>a<=t,Dl=(a,t)=>Array.isArray(t)&&t.length===2?a>=t[0]&&a<=t[1]:!1,Il=(a,t)=>String(a).startsWith(String(t)),Ll=(a,t)=>String(a).endsWith(String(t)),Tl=(a,t)=>String(a).includes(String(t)),Rl=(a,t)=>Array.isArray(t)?t.includes(a):!1,Ol=(a,t)=>Array.isArray(t)?!t.includes(a):!0,dt=(a,t)=>{if(!t)return!0;switch(t?.[1]){case le.Equal:return Nl(a,t?.[2]);case le.Inequal:return Sl(a,t?.[2]);case le.Higer:return Ml(a,t?.[2]);case le.HigerOrEqual:return $l(a,t?.[2]);case le.Lower:return Fl(a,t?.[2]);case le.LowerOrEqual:return Al(a,t?.[2]);case le.Between:return Dl(a,t?.[2]);case le.StartWith:return Il(a,t?.[2]);case le.EndWith:return Ll(a,t?.[2]);case le.Contain:return Tl(a,t?.[2]);case le.In:return Rl(a,t?.[2]);case le.NotIn:return Ol(a,t?.[2]);default:return!0}},ct=e.defineComponent({__name:"vs-input-container",props:{style:{type:Object,default:()=>({})},title:{type:String,default:""},view:{type:String,default:"default"},schema:{type:Array,default:()=>[]}},setup(a){const t=a,n=e.inject("formValues",{default:{}}),s=e.inject("form"),l=e.computed(()=>t.schema?.filter(r=>{const i=r?.conditions;if(!i)return!0;const d=Array.isArray(i)?i[0]:i,c=n?.value?.[d];return dt(c,i)})),o=e.computed(()=>vl[t.view]);return(r,i)=>a.schema?.length?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.value),{key:0,title:a.title,style:e.normalizeStyle(a.style)},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,d=>(e.openBlock(),e.createBlock(_t,e.mergeProps({key:d.name},{ref_for:!0},d,{item:d,modelValue:e.unref(n)[d.name],"onUpdate:modelValue":c=>e.unref(n)[d.name]=c,style:a.style,error:e.unref(s)?.errors?.[d.name]}),null,16,["item","modelValue","onUpdate:modelValue","style","error"]))),128))]),_:1},8,["title","style"])):e.createCommentVNode("",!0)}});e.defineComponent({props:{modelValue:{type:Boolean,default:()=>!1},title:{type:String,default:()=>""},disabled:{type:Boolean,default:()=>!1}},data(){return{}},mounted(){this.modelValue||this.$emit("update:modelValue",!1)},computed:{modelState:{get(){return this.modelValue},set(a){this.$emit("update:modelValue",a)}},labelCursorClasses(){return[{"cursor-not-allowed":this.disabled},{"cursor-pointer":!this.disabled}]}},methods:{handleEnterDown(a){const{keyCode:t}=a;t===13&&(this.modelState=!this.modelState)},addKeyHandler(){window.addEventListener("keydown",this.handleEnterDown)},removeKeyHandler(){window.removeEventListener("keydown",this.handleEnterDown)}}});const zl={key:0,class:"vsTailwind ui-dialog__wrapper"},jl={class:"py-2.5 px-4 flex justify-between items-center border-0 border-b border-solid border-gray-200 dark:border-b-[#454545]"},Ul={class:"font-medium text-gray-800 dark:text-[#ffffff]"},Pl={class:"ui-dialog__content p-4"},Hl={key:0,class:"flex justify-end gap-x-2"},ql=j(e.defineComponent({__name:"vs-modal",props:{title:{default:""},template:{},visible:{type:Boolean,default:!1},size:{default:"small"},closeClickBack:{type:Boolean,default:!1},content:{},contentProps:{}},emits:["update:visible","close"],setup(a,{emit:t}){const n=a,s=t,l=e.computed(()=>n.size==="small"?"md:w-5/12 w-9/12":n.size==="medium"?"md:w-6/12 w-9/12":"lg:w-7/12 w-11/12"),o=e.useAttrs();function r(){s("update:visible",!1),s("close")}function i(c){c.key==="Escape"&&r()}function d(c,u){u&&c.target.classList.contains("vs-dialog-overlay")&&r()}return e.onMounted(()=>{window.addEventListener("keydown",i)}),e.onUnmounted(()=>{window.removeEventListener("keydown",i)}),(c,u)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[c.visible?(e.openBlock(),e.createElementBlock("div",zl,[e.createElementVNode("div",{onMousedown:u[0]||(u[0]=p=>d(p,c.closeClickBack)),class:e.normalizeClass(["vs-dialog-overlay vs-dialog w-full h-full fixed top-0 start-0 z-[1000] bg-black bg-opacity-50",[e.unref(o).class]])},[e.createVNode(e.Transition,{name:"content",appear:""},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["ui-dialog__modal opacity-1 flex flex-col bg-white dark:bg-[#1A1A1A] border dark:border-[#454545] pointer-events-auto shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-xl",l.value])},[e.createElementVNode("div",jl,[e.createElementVNode("h3",Ul,e.toDisplayString(c.title),1),e.createElementVNode("button",{type:"button",class:"size-8 inline-flex justify-center items-center gap-x-2 rounded-full border border-transparent bg-gray-100 text-gray-800 hover:bg-gray-200 focus:outline-none focus:bg-gray-200 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:hover:bg-neutral-600 dark:text-neutral-400 dark:focus:bg-neutral-600",onClick:r},u[1]||(u[1]=[e.createElementVNode("span",{class:"sr-only"},"Close",-1),e.createElementVNode("svg",{class:"flex-shrink-0 w-4 h-4",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("path",{d:"M18 6 6 18"}),e.createElementVNode("path",{d:"m6 6 12 12"})],-1)]))]),e.createElementVNode("div",Pl,[e.renderSlot(c.$slots,"default",{},void 0,!0)]),c.$slots.footer?(e.openBlock(),e.createElementBlock("div",Hl,[e.renderSlot(c.$slots,"footer",{handleClose:r},void 0,!0)])):e.createCommentVNode("",!0)],2)]),_:3})],34)])):e.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-a6dcf7e1"]]),Gl={},Kl={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"size-6 text-green-600"};function Zl(a,t){return e.openBlock(),e.createElementBlock("svg",Kl,t[0]||(t[0]=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1)]))}const Wl=j(Gl,[["render",Zl]]),Yl={},Jl={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"orange",class:"size-6 text-orange-600"};function Xl(a,t){return e.openBlock(),e.createElementBlock("svg",Jl,t[0]||(t[0]=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 9v3m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1)]))}const Ql=j(Yl,[["render",Xl]]),eo={},to={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"size-6 text-blue-600"};function no(a,t){return e.openBlock(),e.createElementBlock("svg",to,t[0]||(t[0]=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m11.25 11.25.041-.02a.75.75 0 0 1 1.063.852l-.708 2.836a.75.75 0 0 0 1.063.853l.041-.021M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9-3.75h.008v.008H12V8.25Z"},null,-1)]))}const so=j(eo,[["render",no]]),lo={},oo={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"red",class:"size-6 text-red-600"};function ro(a,t){return e.openBlock(),e.createElementBlock("svg",oo,t[0]||(t[0]=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"},null,-1)]))}const ao=j(lo,[["render",ro]]),io={class:"rounded-md border border-gray-300 bg-white p-4 shadow-sm"},co={class:"flex items-start gap-4 opacity-100 scale-5 transition-all duration-300"},uo={class:"flex-1"},po={class:"font-medium text-gray-900"},ho={class:"mt-0.5 text-sm text-gray-700"},mo=e.defineComponent({__name:"vs-notify",props:{type:{},title:{},message:{}},setup(a){const t={success:Wl,warning:Ql,error:ao,info:so};return(n,s)=>(e.openBlock(),e.createElementBlock("div",io,[e.createElementVNode("div",co,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t[n.type]))),e.createElementVNode("div",uo,[e.createElementVNode("strong",po,e.toDisplayString(n.title),1),e.createElementVNode("p",ho,e.toDisplayString(n.message),1)]),s[0]||(s[0]=e.createElementVNode("button",{class:"m-3 rounded-full p-1.5 text-gray-500 transition-colors hover:bg-gray-50 hover:text-gray-700",type:"button","aria-label":"Dismiss notify"},[e.createElementVNode("span",{class:"sr-only"},"Dismiss popup"),e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"size-5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"})])],-1))])]))}});e.reactive({visible:!0});const De={top:"top-4 left-1/2 transform -translate-x-1/2","left-bottom":"bottom-4 left-4 transform","right-bottom":"bottom-4 right-4 transform",bottom:"bottom-4 left-1/2 transform -translate-x-1/2"},fo=a=>{const{type:t="info",title:n,message:s,position:l="right-bottom"}=a||{};let o=document.querySelector("#notify-root");o||(o=document.createElement("div"),o.id="notify-root",o.className=`fixed z-[2000] flex flex-col gap-3 ${De[l]} p-6 max-w-md mx-auto font-sans antialiased`,document.body.appendChild(o)),o.className.includes(De[l])||(Object.values(De).forEach(c=>{o.classList.remove(...c.split(" "))}),o.classList.add(...De[l].split(" ")));const r=document.createElement("div");o.appendChild(r);const i=e.createApp({render(){return e.h(mo,{type:t,title:n,message:s,onClose:()=>{i.unmount(),r.remove()}})}});i.mount(r),r.querySelector("button")?.addEventListener("click",()=>{r.classList.add("opacity-0","scale-95","transition-all","duration-300"),setTimeout(()=>{i.unmount(),r.remove()},350)}),setTimeout(()=>{r.classList.add("opacity-0","scale-95","transition-all","duration-300"),setTimeout(()=>{i.unmount(),r.remove()},350)},3500)},go=["aria-expanded","data-focus"],ko={class:"flex items-center"},bo=["title"],yo=["onClick"],xo=["title"],wo={key:2,class:"text-gray-500 truncate"},_o={class:"flex-1 min-w-[2px]"},Eo=["placeholder"],Vo={class:"flex items-center shrink-0"},Co=["disabled"],Bo=["disabled","title"],vo=["aria-disabled","onClick"],No={key:1,class:"px-3 py-2 text-center text-gray-500"},So=["disabled"],He=e.defineComponent({__name:"vs-input-select",props:{multiple:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},mode:{},defaultValue:{},search:{type:Boolean,default:!0},placeholder:{default:"Оберіть значення"},prefix:{default:"api"},host:{default:""},data:{default:""},options:{default:()=>[]},api:{default:null},maxHeight:{default:400},parent:{},add:{},teleport:{default:"body"},style:{default:()=>({})},customClass:{default:""},modelValue:{},error:{default:null},name:{}},emits:["change","update:modelValue"],setup(a,{emit:t}){const n=a,s=t,l=e.computed(()=>n.multiple),o=e.computed(()=>n.disabled);se(n.style);const r=e.computed({get:()=>n.modelValue,set:k=>s("update:modelValue",k)});!r.value&&n.defaultValue&&(r.value=n.defaultValue);const i=e.ref(null),d=e.ref(null),c=e.ref(null),u=e.ref(null),p=e.ref(!1),h=e.ref(!1),E=e.ref(null),F=e.ref([]),$=e.ref(-1),A=e.ref([]),V=e.ref(""),D=e.ref(null),_=e.ref("bottom"),m=e.ref({}),g=e.ref([]),x=e.computed(()=>{if(!g.value.length)return[];const k=new Map(F.value.map(f=>[f.id?.toString(),f]));return g.value.map(f=>k.get(f?.toString())).filter(f=>!!f)}),w=e.computed(()=>n.placeholder||"Select..."),z=e.computed(()=>l.value?!g.value.length&&V.value==="":!E.value?.text&&V.value===""),Y=e.computed(()=>o.value?!1:l.value?g.value.length>0:!!r.value),X=k=>l.value?g.value.some(f=>f?.toString()===k?.toString()):r.value?.toString()===k?.toString(),B=e.computed(()=>{let k=F.value??[];if(!n.data&&V.value.trim()!==""){const f=V.value.toLowerCase();k=k.filter(C=>C.text?.toLowerCase?.().includes(f))}if(l.value&&g.value.length){const f=new Set(g.value.map(C=>C?.toString()));k=k.filter(C=>!f.has(C.id?.toString()))}return k}),P=e.inject("values"),q=e.computed(()=>n.parent?P?.value?.[n.parent]??null:null),G=async k=>{if(!n.data){let f=n.options??[];if(k?.trim()){const C=k.toLowerCase();f=f.filter(U=>U.text?.toLowerCase?.().includes(C))}return f}try{const f=n.host??"",C=n.prefix??"api",U=n.api??`/${C}/suggest/${n.data}`,te=`${f}${U}`,re=new URLSearchParams;return re.set("json","1"),k&&re.set("key",k),q.value!==void 0&&q.value!==null&&q.value!==""&&re.set("parent",String(q.value)),(await fetch(`${te}?${re.toString()}`).then(we=>we.json()))?.data??[]}catch{return[]}},M=async()=>{n.data?F.value=await G(V.value):F.value=n.options?[...n.options]:[]},S=async k=>{if(k==null)return null;const f=F.value?.find(U=>U?.id?.toString()===String(k));return f||((await G(String(k)))?.[0]??null)},v=async k=>{const f=new Set(F.value.map(U=>U.id?.toString())),C=k.filter(U=>!f.has(U?.toString()));C.length&&await C.reduce(async(U,te)=>{await U;const re=await S(te);re&&F.value.push(re)},Promise.resolve())},R=async()=>{o.value||(p.value=!0,await M(),await e.nextTick(()=>{oe(),D.value?.focus(),B.value.length?$.value=0:$.value=-1}))},Z=()=>{p.value=!1,$.value=-1},ce=async k=>{if(o.value)return;!p.value?await R():Z()},ue=async()=>{p.value?D.value?.focus():await R()},b=()=>{l.value?(g.value=[],r.value=[],s("change",[])):(E.value=null,r.value=null,s("change",null)),V.value="",e.nextTick(()=>D.value?.focus())},y=k=>{l.value&&(g.value=g.value.filter(f=>f?.toString()!==k?.toString()),r.value=[...g.value],s("change",r.value),e.nextTick(()=>D.value?.focus()))},T=k=>{l.value?(X(k.id)||(g.value=[...g.value,k.id],r.value=[...g.value],s("change",r.value)),V.value="",e.nextTick(()=>{D.value?.focus(),$.value=Math.min($.value,B.value.length-1)})):(E.value=k,r.value=k.id,s("change",r.value),V.value="",Z())},K=k=>{X(k.id)||T(k)},W=(k,f)=>{if(!k||!f)return;const C=k.offsetTop,U=C+k.offsetHeight,te=f.scrollTop,re=te+f.clientHeight;let ye=f.scrollTop;C<te?ye=C-80:U>re&&(ye=U-f.clientHeight+4);const we=f;we.scrollTop=ye},pe=k=>{let f=k.parentElement;for(;f;){if(f.classList.contains("ui-dialog__content"))return f;const C=window.getComputedStyle(f),U=C.overflow+C.overflowY+C.overflowX;if(U.includes("auto")||U.includes("scroll")||f===document.body||f===document.documentElement)return f;f=f.parentElement}return document.body},oe=()=>{if(!d.value)return;const k=d.value.getBoundingClientRect(),f=window.innerHeight||document.documentElement.clientHeight,C=window.innerWidth||document.documentElement.clientWidth,U=8,te=8,re=n.maxHeight||300,ye=f-k.bottom-te-U,we=k.top-te-U,ze=ye>=we,Ye=Math.max(C-U*2,0);let{width:Me}=k;Ye>0&&Me>Ye&&(Me=Ye);let{left:$e}=k;$e+Me+U>C&&($e=C-Me-U),$e=Math.max($e,U);const Ui=Math.min(re,Math.max(ze?ye:we,50));_.value=ze?"bottom":"top",m.value={position:"fixed",left:`${$e}px`,width:`${Me}px`,minWidth:"300px",maxHeight:`${Ui}px`,transform:ze?"none":"translateY(-100%)",top:ze?`${k.bottom+te}px`:`${k.top-te}px`}},ge=async k=>{o.value||!p.value&&(k.key==="ArrowDown"||k.key==="ArrowUp")&&(k.preventDefault(),await R())},ke=k=>{if(!p.value)return;const{key:f}=k;if(f==="ArrowDown")k.preventDefault(),$.value+1<B.value.length&&($.value+=1,W(A.value[$.value],c.value));else if(f==="ArrowUp")k.preventDefault(),$.value>0&&($.value-=1,W(A.value[$.value],c.value));else if(f==="Enter"){k.preventDefault();const C=B.value[$.value];C&&T(C),D.value?.blur()}else f==="Escape"?(k.preventDefault(),Z()):f==="Backspace"?l.value&&V.value===""&&g.value.length&&(g.value=g.value.slice(0,-1),r.value=[...g.value],s("change",r.value)):f==="Home"?($.value=0,W(A.value[0],c.value)):f==="End"?($.value=B.value.length-1,W(A.value[$.value],c.value)):f==="Tab"&&Z()},be=()=>{o.value||(h.value=!0)},Ti=()=>{h.value=!1,V.value=""},Ot=k=>{k.key==="Escape"&&p.value&&Z()},zt=k=>{const f=k.target;i.value?.contains(f)||u.value?.contains(f)||Z()},jt=k=>{p.value&&c.value&&!c.value.contains(k.target)&&oe()},Ut=()=>{p.value&&oe()},Pt=()=>{p.value&&oe()};e.watch(()=>n.options,k=>{k?.length&&(F.value=[...k])},{immediate:!0});const Ht=async()=>{if(l.value)Array.isArray(r.value)?g.value=[...r.value]:(g.value=r.value==null?[]:[r.value],r.value=[...g.value]),!n.options?.length&&n.data&&await v(g.value);else{if(Array.isArray(r.value)){const k=r.value[0]??null;r.value=k??null}E.value=await S(r.value)}};e.watch(r,()=>{Ht()}),e.onMounted(async()=>{addEventListener("keydown",Ot),addEventListener("scroll",jt,!0),addEventListener("resize",Ut),document.addEventListener("click",zt,!0),d.value&&pe(d.value).addEventListener("scroll",Pt,!0),n.options?.length?F.value=[...n.options]:n.data&&(F.value=await G("")),await Ht()}),e.onUnmounted(()=>{removeEventListener("keydown",Ot),removeEventListener("scroll",jt,!0),removeEventListener("resize",Ut),document.removeEventListener("click",zt,!0),d.value&&pe(d.value).removeEventListener("scroll",Pt,!0)});const Oe=e.ref(!1),We=e.ref({}),qt=e.ref([]),Gt=e.ref(null);async function Ri(){if(!n.add?.token||Gt?.value.validate())return;const f=n.add.api??`/api/table/${n.add.token}`,{id:C}=await fetch(f,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(We.value)}).then(U=>U.json());if(!n.options?.length&&n.data){const{data:U}=await fetch(`${n.api??`/api/suggest/${n.data}`}?val=${C}`).then(te=>te.json());E.value=U[0],F.value.push(U[0]),r.value=C}Oe.value=!1,fo({title:"Success!",message:"Object created."})}async function Oi(){if(!n.add)return null;const k=await fetch(`/api/template/form/${n.add.form}`).then(f=>f.json());return qt.value=k.schema,Oe.value=!0,null}function zi(k,f=200){let C;return(...U)=>{C&&clearTimeout(C),C=window.setTimeout(()=>k(...U),f)}}const ji=zi(async k=>{F.value=await G(k)},200);return e.watch(V,k=>{n.data&&ji(k.trim())}),e.watch(()=>n.options,k=>{!n.data&&k?.length&&(F.value=[...k])},{immediate:!0}),e.watch(()=>n.parent??n.parentValue,()=>{n.data&&M()}),e.watch(q,async()=>{n.data&&(l.value?(g.value=[],r.value=[],s("change",[])):(E.value=null,r.value=null,s("change",null)))}),(k,f)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(e.unref(ql),{visible:Oe.value,"onUpdate:visible":f[1]||(f[1]=C=>Oe.value=C),title:"Додати",buttonText:"Додати",onDone:Ri,teleport:k.teleport},{default:e.withCtx(()=>[e.createVNode(fe,{schema:qt.value,modelValue:We.value,"onUpdate:modelValue":f[0]||(f[0]=C=>We.value=C),ref_key:"addForm",ref:Gt},null,8,["schema","modelValue"])]),_:1},8,["visible","teleport"]),e.createElementVNode("div",{class:"flex gap-1 w-full",ref_key:"selectRoot",ref:i,onClick:f[4]||(f[4]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:e.normalizeClass(["relative w-full font-sans",n.customClass])},[f[9]||(f[9]=e.createElementVNode("span",{id:"react-select-live-region",class:"sr-only"},null,-1)),f[10]||(f[10]=e.createElementVNode("span",{"aria-live":"polite","aria-atomic":"false","aria-relevant":"additions text",role:"log",class:"sr-only"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["flex min-h-[38px] items-center justify-between rounded border transition-colors bg-white","border-gray-300 hover:border-gray-400",p.value||h.value?"border-blue-500 ring-1 ring-blue-500":"",o.value?"bg-gray-100 text-gray-400 cursor-not-allowed hover:border-gray-300":""]),role:"combobox","aria-expanded":p.value,"aria-haspopup":"listbox",onKeydown:ge,onClick:ue,"data-focus":p.value||h.value?"true":"false"},[e.createElementVNode("div",{class:"flex flex-1 items-center gap-1 py-0.5 pl-2 pr-0 overflow-hidden",ref_key:"triggerRef",ref:d},[l.value&&g.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(x.value,C=>(e.openBlock(),e.createElementBlock("div",{class:"flex min-w-0 bg-[#e6e6e6] rounded-sm m-0.5 box-border",key:C.id},[e.createElementVNode("div",ko,[C?.color?(e.openBlock(),e.createElementBlock("span",{key:0,class:"w-[16px] h-[16px] rounded-md block ml-1.5",style:e.normalizeStyle({backgroundColor:C?.color})},null,4)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"truncate text-gray-900 overflow-hidden",title:C.text},e.toDisplayString(C.text),9,bo)]),e.createElementVNode("div",{role:"button",class:"flex items-center rounded-sm px-1 box-border hover:bg-[#ffbdad] hover:text-[#de350b]",onClick:e.withModifiers(U=>y(C.id),["stop"])},f[5]||(f[5]=[e.createElementVNode("svg",{height:"14",width:"14",viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",class:"inline-block fill-current stroke-current leading-none stroke-0"},[e.createElementVNode("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"})],-1)]),8,yo)]))),128)):!l.value&&!h.value&&E.value?.text&&V.value===""?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["truncate text-gray-900"]),title:E.value.text},[E.value?.color?(e.openBlock(),e.createElementBlock("span",{key:0,class:"w-[14px] h-[14px] rounded-md block mr-1 mt-1 absolute",style:e.normalizeStyle({backgroundColor:E.value?.color})},null,4)):e.createCommentVNode("",!0),e.createElementVNode("span",{class:e.normalizeClass({"pl-5":E.value?.color})},e.toDisplayString(E.value.text),3)],8,xo)):e.createCommentVNode("",!0),z.value?(e.openBlock(),e.createElementBlock("div",wo,e.toDisplayString(w.value),1)):e.createCommentVNode("",!0),e.createElementVNode("div",_o,[!o.value&&k.search?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,ref_key:"inputRef",ref:D,class:"w-full bg-transparent outline-none border-0 m-0 p-0 text-gray-900",autocapitalize:"none",autocomplete:"off",autocorrect:"off",spellcheck:"false",type:"text",tabindex:"0","aria-autocomplete":"list",placeholder:(l.value&&g.value.length?" ":null)||(h.value&&!V.value?.length?E.value?.text:" "),"onUpdate:modelValue":f[2]||(f[2]=C=>V.value=C),onFocus:be,onBlur:Ti,onKeydown:ke},null,40,Eo)),[[e.vModelText,V.value]]):e.createCommentVNode("",!0)])],512),e.createElementVNode("div",Vo,[Y.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"px-2 text-gray-400 hover:text-gray-500 transition-colors disabled:opacity-50","aria-hidden":"true",disabled:o.value,onClick:e.withModifiers(b,["stop"])},f[6]||(f[6]=[e.createElementVNode("svg",{height:"20",width:"20",viewBox:"0 0 20 20",class:"fill-current"},[e.createElementVNode("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"})],-1)]),8,Co)):e.createCommentVNode("",!0),f[8]||(f[8]=e.createElementVNode("div",{class:"self-stretch w-px bg-[#ccc] my-[1px]"},null,-1)),e.createElementVNode("button",{type:"button",class:"px-2 text-gray-400 hover:text-gray-500 transition-colors disabled:opacity-50","aria-hidden":"true",disabled:o.value,onClick:f[3]||(f[3]=e.withModifiers(C=>ce(),["stop"])),title:p.value?"Закрити список":"Відкрити список"},f[7]||(f[7]=[e.createElementVNode("svg",{height:"20",width:"20",viewBox:"0 0 20 20",class:"fill-current"},[e.createElementVNode("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"})],-1)]),8,Bo)])],42,go),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[p.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"dropdownRef",ref:u,class:e.normalizeClass(["fixed z-[3000] rounded bg-white shadow-[0_0_0_1px_rgba(0,0,0,0.1),0_4px_11px_rgba(0,0,0,0.1)]"]),style:e.normalizeStyle(m.value),role:"listbox"},[e.createElementVNode("div",{class:"overflow-y-auto py-1",style:e.normalizeStyle({maxHeight:m.value.maxHeight||"300px"}),ref_key:"listRef",ref:c},[B.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(B.value,(C,U)=>(e.openBlock(),e.createElementBlock("div",{key:C.id,ref_for:!0,ref:te=>A.value[U]=te,class:e.normalizeClass(["flex px-3 py-2 cursor-default select-none text-gray-900 ",X(C.id)?"bg-blue-500 text-white":"bg-white hover:bg-blue-100",$.value===U&&!X(C.id)?"bg-blue-100":""]),"aria-disabled":X(C.id)?"true":"false",role:"option",tabindex:"-1",onClick:te=>K(C)},[C?.color?(e.openBlock(),e.createElementBlock("span",{key:0,class:"w-[11px] h-[11px] rounded-full block mr-1 mt-1.5",style:e.normalizeStyle({backgroundColor:C?.color})},null,4)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["leading-[19px]",$.value===C.id?"text-white":"",($.value===U,"")])},e.toDisplayString(C.text),3)],10,vo))),128)):(e.openBlock(),e.createElementBlock("div",No," No options "))],4)],4)):e.createCommentVNode("",!0)]))],2),n.add?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:Oi,class:"bg-white hover:bg-gray-100 text-sm text-gray-900 py-[10px] px-3 border border-stone-200 rounded-md h-[38px] flex items-center gap-2",disabled:o.value,type:"button"},[e.createVNode(Ee,{width:"16",height:"16"}),f[11]||(f[11]=e.createElementVNode("span",null,"Додати",-1))],8,So)):e.createCommentVNode("",!0)],512)],64))}}),Mo=["placeholder","disabled"],ut=e.defineComponent({__name:"vs-input-textarea",props:e.mergeModels({style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{},name:{},placeholder:{default:""}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(a){const t=a,{inputClass:n}=se(t.style),s=e.useModel(a,"modelValue");return(l,o)=>e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{"onUpdate:modelValue":o[0]||(o[0]=r=>s.value=r),placeholder:l.placeholder,disabled:l.disabled,row:"2",class:e.normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f] h-auto bg-white",[e.unref(n)]]),style:{border:"1px solid #CFD9E0"}},null,10,Mo)),[[e.vModelText,s.value]])}}),$o={},Fo={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-search stroke-gray-500 transition-all"};function Ao(a,t){return e.openBlock(),e.createElementBlock("svg",Fo,t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0"},null,-1),e.createElementVNode("path",{d:"M21 21l-6 -6"},null,-1)]))}const Do=j($o,[["render",Ao]]),Io={},Lo={class:"flex-shrink-0 mt-0.5 size-3.5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function To(a,t){return e.openBlock(),e.createElementBlock("svg",Lo,t[0]||(t[0]=[e.createElementVNode("path",{d:"m3 16 4 4 4-4"},null,-1),e.createElementVNode("path",{d:"M7 20V4"},null,-1),e.createElementVNode("path",{d:"m21 8-4-4-4 4"},null,-1),e.createElementVNode("path",{d:"M17 4v16"},null,-1)]))}const Ro=j(Io,[["render",To]]),Oo={},zo={xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function jo(a,t){return e.openBlock(),e.createElementBlock("svg",zo,t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"},null,-1),e.createElementVNode("path",{d:"M7 9l5 -5l5 5"},null,-1),e.createElementVNode("path",{d:"M12 4l0 12"},null,-1)]))}const Uo=j(Oo,[["render",jo]]),Po={},Ho={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function qo(a,t){return e.openBlock(),e.createElementBlock("svg",Ho,t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"},null,-1),e.createElementVNode("path",{d:"M7 11l5 5l5 -5"},null,-1),e.createElementVNode("path",{d:"M12 4l0 12"},null,-1)]))}const Go=j(Po,[["render",qo]]),Ko={},Zo={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function Wo(a,t){return e.openBlock(),e.createElementBlock("svg",Zo,t[0]||(t[0]=[e.createStaticVNode('<circle cx="9" cy="12" r="1"></circle><circle cx="9" cy="5" r="1"></circle><circle cx="9" cy="19" r="1"></circle><circle cx="15" cy="12" r="1"></circle><circle cx="15" cy="5" r="1"></circle><circle cx="15" cy="19" r="1"></circle>',6)]))}const pt=j(Ko,[["render",Wo]]),Yo={},Jo={viewBox:"0 0 178 90",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function Xo(a,t){return e.openBlock(),e.createElementBlock("svg",Jo,t[0]||(t[0]=[e.createStaticVNode('<rect x="27" y="50.5" width="124" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="27" y="50.5" width="124" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-50 dark:stroke-neutral-700/10"></rect><rect x="34.5" y="58" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="61" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="73" width="77" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/30"></rect><rect x="27" y="36" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="39" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="51" width="92" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><g filter="url(#filter1)"><rect x="12" y="6" width="154" height="40" rx="8" fill="currentColor" class="fill-white dark:fill-neutral-800" shape-rendering="crispEdges"></rect><rect x="12.5" y="6.5" width="153" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/60" shape-rendering="crispEdges"></rect><rect x="20" y="14" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="17" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="29" width="106" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect></g><defs><filter id="filter1" x="0" y="0" width="178" height="64" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"></feColorMatrix><feOffset dy="6"></feOffset><feGaussianBlur stdDeviation="6"></feGaussianBlur><feComposite in2="hardAlpha" operator="out"></feComposite><feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.03 0"></feColorMatrix><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1187_14810"></feBlend><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1187_14810" result="shape"></feBlend></filter></defs>',12)]))}const Qo=j(Yo,[["render",Xo]]),er={},tr={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function nr(a,t){return e.openBlock(),e.createElementBlock("svg",tr,t[0]||(t[0]=[e.createElementVNode("path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z"},null,-1)]))}const sr=j(er,[["render",nr]]),lr={class:"vs-datatable border rounded-xl w-full flex-grow"},or={class:"flex items-center npm gap-[16px] justify-between p-[20px] pb-[16px]"},rr={class:"relative w-full"},ar={class:"table-wrapper flex gap-2"},ir={class:"vs-popover inline-block text-slate-700"},dr={class:"text-center"},cr={class:""},ur={class:"py-1 px-0 w-full text-sm text-stone-800 bg-white shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-lg focus:outline-none focus:bg-stone-100 dark:bg-neutral-900 dark:text-neutral-200 dark:focus:bg-neutral-800 after:h-4 after:absolute after:-bottom-4 after:start-0 after:w-full before:h-4 before:absolute before:-top-4 before:start-0 before:w-full"},pr={class:"flex flex-col p-[1px] gap-[2px] w-[140px]"},hr={class:"text-sm items-center text-gray-800 flex gap-1"},mr={class:"w-full overflow-x-auto"},fr={class:"w-full table-auto caption-bottom text-sm"},gr={class:"[&_tr]:border-b"},kr={class:"border-b data-[state=selected]:bg-muted bg-slate-50/50 dark:bg-slate-700/50 hover:bg-slate-50/80 dark:hover:bg-slate-700/80 transition-colors"},br={class:"h-10 px-2 align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] w-12 text-center"},yr={key:0,colspan:"100%",class:"text-center"},xr={class:"w-full"},wr={class:"p-5 min-h-[200px] flex flex-col justify-center items-center text-center"},_r=["onDragstart","onDragover","onDrop"],Er={class:"p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] text-center"},Vr={class:"flex items-center justify-center"},Cr={key:0,class:"inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 border-transparent bg-slate-100 dark:bg-slate-700 text-slate-700 dark:text-slate-300 hover:bg-slate-200 dark:hover:bg-slate-600 transition-colors"},Br={key:0},vr=["src"],Nr={key:1,class:"rounded-md max-w-[45px] w-[45px] max-h-[45px] h-[45px] bg-gray-200 flex items-center justify-center"},Sr=["innerHTML"],Mr={key:2,class:"inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 border-transparent bg-slate-100 dark:bg-slate-700 text-slate-700 dark:text-slate-300 hover:bg-slate-200 dark:hover:bg-slate-600 transition-colors"},$r={class:"p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]"},Fr={class:"flex items-center justify-center gap-2"},Ar=["onClick"],Dr=["onClick"],Ir={class:"vs-form__head mr-5 mt-3 flex items-center justify-end sticky top-0 left-0 z-[60] bg-white"},ht=e.defineComponent({__name:"vs-input-datatable",props:e.mergeModels({colModel:{},style:{},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{}},{modelValue:{default:[]},modelModifiers:{}}),emits:["update:modelValue"],setup(a){const t=a,n=e.useModel(a,"modelValue"),s=e.ref({}),l=e.ref(""),o=e.computed(()=>{if(!l.value)return n.value??[];const M=l.value.toLowerCase();return n.value.filter(S=>t.colModel?.some(v=>{const R=S[v.key];return R?Array.isArray(R)?R.join(", ").toLowerCase().includes(M):String(R).toLowerCase().includes(M):!1}))}),r=e.ref(null),i=e.ref(null),d=e.ref(!1),c=e.ref(null),u=e.ref({top:0,left:0}),p=M=>{r.value=M},h=M=>{i.value=M},E=M=>{if(r.value===null||r.value===M){r.value=null,i.value=null;return}const S=[...n.value],[v]=S.splice(r.value,1);S.splice(M,0,v),n.value=S,r.value=null,i.value=null},F=M=>{const v=M.currentTarget.getBoundingClientRect();u.value={top:v.bottom+window.scrollY,left:v.left+window.scrollX},d.value=!d.value},$=()=>{c.value&&c.value.click()},A=M=>{const S=[".jpg",".jpeg",".png",".gif",".bmp",".webp",".svg",".ico",".tiff",".tif"],v=M.toLowerCase();return S.some(R=>v.endsWith(R))},V=M=>{const v=M.target.files?.[0];if(!v)return;const R=new FileReader;R.onload=Z=>{try{const ce=Z.target?.result;if(typeof ce=="string"){const ue=JSON.parse(ce);Array.isArray(ue)&&n.value.push(...ue)}}catch(ce){console.error("Error parsing file:",ce)}},R.readAsText(v)},D=()=>{const M=JSON.stringify(n.value,null,2),S=new Blob([M],{type:"application/json"}),v=URL.createObjectURL(S),R=document.createElement("a");R.href=v,R.download="data.json",R.click(),URL.revokeObjectURL(v)};e.onMounted(async()=>{const M=t.colModel?.filter(S=>S.data);M?.length&&Promise.all(M.map(async S=>{const R=await(await fetch(`/api/suggest/${S.data}`)).json();s.value[S.key]=R.data}))});const _=e.ref(""),m=e.ref(!1);let g="edit",x=0;const w=e.ref({}),z=e.ref({});async function Y(){_.value="Додати",m.value=!0,g="add",w.value={}}function X(M,S){const v=S.key||S.name;return s.value[v]&&M[v]?s.value[v].find(R=>R.id.toString()===M[v].toString())?.text??M[v]:M[v]||"-"}async function B(M,S){_.value="Редагувати",m.value=!0,g="edit",x=S,w.value={...M}}function P(){const M=z.value.validate();if(M){J.notify({type:"warning",title:"Помилка валідації",message:Object.entries(M).map(([S,v])=>`${S}: ${v}`).join(`
2
- `)});return}g==="add"?Array.isArray(n.value)?n.value=[...n.value,w.value]:n.value=[w.value]:n.value=n.value.map((S,v)=>v===x?w.value:S),m.value=!1}function q(M){n.value=n.value.filter((S,v)=>v!==M)}function G(){m.value=!1}return(M,S)=>(e.openBlock(),e.createElementBlock("div",lr,[e.createElementVNode("div",or,[e.createElementVNode("div",rr,[e.createVNode(Do,{width:"14",height:"14",class:"absolute left-3 top-1/2 transform -translate-y-1/2 text-stone-500"}),e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":S[0]||(S[0]=v=>l.value=v),placeholder:"Пошук",class:"py-2 px-3 pl-10 w-full bg-gray-100 h-[36px] rounded-[8px] text-[15px] leading-[18px] focus:border-1 text-stone-800 placeholder:text-[#6B7280] focus:outline-blue-500 focus:outline-2"},null,512),[[e.vModelText,l.value]])]),e.createElementVNode("div",ar,[e.createElementVNode("input",{ref_key:"fileInput",ref:c,onChange:V,class:"hidden",accept:".json",type:"file"},null,544),e.createElementVNode("div",ir,[e.createElementVNode("div",dr,[e.createElementVNode("div",cr,[e.createElementVNode("button",{onClick:F,class:"bg-white hover:bg-gray-100 font-semibold text-[15px] leadig-[18.5px] py-[10px] px-[12px] border border-[#E5E7EB] rounded-[8px] h-[38px] max-h-[38px] gap-[8px] flex items-center"},[e.createVNode(Ro,{height:"16",width:"16"})])])])])]),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[d.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"text-slate-700 vsTailwind vs-popover__content bottom",style:e.normalizeStyle([{width:"fit-content","z-index":"10002",position:"fixed"},{position:"absolute",top:u.value.top+"px",left:u.value.left+"px"}])},[e.createElementVNode("div",ur,[e.createElementVNode("div",pr,[e.createElementVNode("button",{onClick:$,class:"text-slate-700 flex items-center gap-1 px-3 py-2 rounded-md cursor-pointer group hover:bg-gray-100"},[e.createVNode(Uo,{class:"text-black",width:"14",height:"14"}),S[4]||(S[4]=e.createTextVNode(" Імпортувати ",-1))]),e.createElementVNode("button",{onClick:D,class:"text-slate-700 flex items-center px-3 py-2 rounded-md cursor-pointer group hover:bg-gray-100"},[e.createElementVNode("span",hr,[e.createVNode(Go,{class:"text-black",width:"14",height:"14"}),S[5]||(S[5]=e.createTextVNode(" Експортувати ",-1))])])])])],4)):e.createCommentVNode("",!0)])),e.createElementVNode("button",{onClick:Y,class:"text-slate-700 bg-white hover:bg-gray-100 font-semibold text-[15px] leadig-[18.5px] py-[10px] px-[12px] border border-[#E5E7EB] rounded-[8px] h-[38px] max-h-[38px] gap-[8px] flex items-center"},[e.createVNode(Ee),S[6]||(S[6]=e.createTextVNode(" Додати ",-1))])]),e.createElementVNode("div",mr,[e.createElementVNode("table",fr,[e.createElementVNode("thead",gr,[e.createElementVNode("tr",kr,[e.createElementVNode("th",br,[e.createVNode(pt,{width:"24",height:"24",class:"w-4 h-4 mx-auto text-slate-400 dark:text-slate-500"})]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(M.colModel,v=>(e.openBlock(),e.createElementBlock("th",{key:v.key,class:"h-10 px-2 text-left align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] font-semibold text-slate-700 dark:text-slate-300 min-w-[150px]"},e.toDisplayString(v.ua||v.label),1))),128)),S[7]||(S[7]=e.createElementVNode("th",{class:"h-10 px-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] font-semibold text-slate-700 dark:text-slate-300 text-center"}," Дії ",-1))])]),e.createElementVNode("tbody",{class:e.normalizeClass({"[&_tr:last-child]:border-0":!i.value})},[o.value.length===0?(e.openBlock(),e.createElementBlock("td",yr,[e.createElementVNode("div",xr,[e.createElementVNode("div",wr,[e.createVNode(Qo,{class:"w-48 mx-auto"}),S[8]||(S[8]=e.createElementVNode("div",{class:"max-w-sm mx-auto mt-6"},[e.createElementVNode("p",{class:"font-medium text-gray-800 dark:text-neutral-200"},"Нічого не знайдено"),e.createElementVNode("p",{class:"mt-2 text-sm text-gray-500 dark:text-neutral-500"})],-1))])])])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,(v,R)=>(e.openBlock(),e.createElementBlock("tr",{key:v.id,class:e.normalizeClass(["border-b data-[state=selected]:bg-muted transition-all duration-200 hover:bg-slate-50/60 dark:hover:bg-slate-700/60 cursor-move",{"opacity-50":r.value===R,"border-t-2 border-b-2 border-blue-500 bg-blue-50 dark:bg-blue-900/20":i.value===R}]),draggable:"true",onDragstart:Z=>p(R),onDragover:e.withModifiers(Z=>h(R),["prevent"]),onDrop:Z=>E(R)},[e.createElementVNode("td",Er,[e.createElementVNode("div",Vr,[e.createVNode(pt,{width:"24",height:"24",class:"w-4 h-4 mx-auto text-slate-400 dark:text-slate-500"})])]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(M.colModel,Z=>(e.openBlock(),e.createElementBlock("td",{key:Z.key,class:"p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]"},[Z.type==="file"?(e.openBlock(),e.createElementBlock("div",Cr,[A(X(v,Z))?(e.openBlock(),e.createElementBlock("div",Br,[e.createElementVNode("img",{src:X(v,Z),alt:"alt",width:"45",class:"rounded-md max-w-[45px] h-[45px] object-cover"},null,8,vr)])):(e.openBlock(),e.createElementBlock("div",Nr,[e.createVNode(lt,{class:"w-[25px] min-w-[25px] h-[25px]"})]))])):Z.type==="tiptap-editor"?(e.openBlock(),e.createElementBlock("div",{key:1,class:"inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 border-transparent bg-slate-100 dark:bg-slate-700 text-slate-700 dark:text-slate-300 hover:bg-slate-200 dark:hover:bg-slate-600 transition-colors",innerHTML:X(v,Z)},null,8,Sr)):(e.openBlock(),e.createElementBlock("div",Mr,e.toDisplayString(X(v,Z)),1))]))),128)),e.createElementVNode("td",$r,[e.createElementVNode("div",Fr,[e.createElementVNode("button",{onClick:Z=>B(v,R),class:"text-slate-700 inline-flex items-center justify-center whitespace-nowrap font-medium focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 border rounded-md text-xs h-7 w-7 p-0 border-slate-300 dark:border-slate-600 bg-white dark:bg-slate-700 hover:bg-blue-50 dark:hover:bg-slate-600 hover:border-blue-300 dark:hover:border-slate-500 hover:text-blue-600 dark:hover:text-slate-200 transition-all duration-200 shadow-sm"},[e.createVNode(sr,{width:"24",height:"24",class:"w-3 h-3"})],8,Ar),e.createElementVNode("button",{onClick:Z=>q(R),class:"text-slate-700 inline-flex items-center justify-center whitespace-nowrap font-medium focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 border rounded-md text-xs h-7 w-7 p-0 border-slate-300 dark:border-slate-600 bg-white dark:bg-slate-700 hover:bg-red-50 dark:hover:bg-slate-600 hover:border-red-300 dark:hover:border-slate-500 hover:text-red-600 dark:hover:text-slate-200 transition-all duration-200 shadow-sm"},[e.createVNode(Fe,{width:"24",height:"24",class:"w-3 h-3"})],8,Dr)])])],42,_r))),128))],2)])]),e.createVNode(e.unref(J.VsModal),{visible:m.value,title:_.value,size:"lg",onClose:G},{default:e.withCtx(()=>[e.createVNode(fe,{schema:t.colModel,values:w.value,"onUpdate:values":S[1]||(S[1]=v=>w.value=v),form:z.value,"onUpdate:form":S[2]||(S[2]=v=>z.value=v)},null,8,["schema","values","form"]),e.createElementVNode("div",Ir,[e.createElementVNode("button",{type:"button",onClick:S[3]||(S[3]=v=>m.value=!1),class:"vs-button inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border !border-gray-200 hover:text-white bg-white text-red-500 hover:border-red-500 hover:bg-red-500 focus:ring-red-500 py-1.5 px-5 focus:ring-1 focus:ring-offset-1 mr-2"}," Скасувати "),e.createElementVNode("button",{onClick:P,type:"button",class:"vs-button inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border-1 border-transparent text-white bg-blue-500 hover:bg-blue-600 focus:ring-blue-500 py-1.5 px-5 focus:ring-1 focus:ring-offset-1"}," Зберегти ")])]),_:1},8,["visible","title"])]))}}),Lr={draw:{toolbar:{actions:{title:"Скасувати малювання",text:"Скасувати"},finish:{title:"Завершити малювання",text:"Завершити"},undo:{title:"Видалити останню точку",text:"Видалити останню"},buttons:{polyline:"Намалювати лінію",polygon:"Намалювати полігон",rectangle:"Намалювати прямокутник",circle:"Намалювати коло",marker:"Додати точку",circlemarker:"Додати маркер-коло"}},handlers:{circle:{tooltip:{start:"Клацніть і тягніть, щоб намалювати коло",end:"Відпустіть кнопку миші, щоб завершити"},radius:"Радіус"},circlemarker:{tooltip:{start:"Клацніть на карту, щоб додати маркер-коло"}},marker:{tooltip:{start:"Клацніть на карту, щоб додати точку"}},polygon:{tooltip:{start:"Клацніть, щоб почати малювати полігон",cont:"Клацайте, щоб продовжити малювати полігон",end:"Клацніть першу точку, щоб завершити полігон"}},polyline:{error:"<strong>Помилка:</strong> лінія не може перетинатися сама з собою",tooltip:{start:"Клацніть, щоб почати малювати лінію",cont:"Клацайте, щоб продовжити малювати лінію",end:"Клацніть останню точку, щоб завершити лінію"}},rectangle:{tooltip:{start:"Клацніть і тягніть, щоб намалювати прямокутник",end:"Відпустіть кнопку миші, щоб завершити"}},simpleshape:{tooltip:{end:"Відпустіть кнопку миші, щоб завершити"}}}},edit:{toolbar:{actions:{save:{title:"Зберегти зміни",text:"Зберегти"},cancel:{title:"Скасувати редагування",text:"Скасувати"},clearAll:{title:"Очистити всі шари",text:"Очистити все"}},buttons:{edit:"Редагувати шари",editDisabled:"Немає шарів для редагування",remove:"Видалити шари",removeDisabled:"Немає шарів для видалення"}},handlers:{edit:{tooltip:{text:"Перетягніть маркери, щоб редагувати шари",subtext:"Натисніть 'Скасувати', щоб повернутися"}},remove:{tooltip:{text:"Клацніть на шари, щоб видалити їх"}}}}};function Ve(a){return a?a.type==="Polygon"?{type:"MultiPolygon",coordinates:[a.coordinates]}:a.type==="Feature"?{...a,geometry:Ve(a.geometry)}:a.type==="FeatureCollection"?{...a,features:(a.features||[]).map(t=>Ve(t)).filter(Boolean)}:a:null}function Tr(a){return a?a.type==="FeatureCollection"||a.type==="Feature"?Ve(a):a.geom?{type:"Feature",geometry:Ve({type:a.geom.type,coordinates:a.geom.coordinates}),properties:{}}:a.type&&a.coordinates?{type:"Feature",geometry:Ve(a),properties:{}}:null:null}const Rr={},Or={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",stroke:"currentColor",fill:"none","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-map-pin"};function zr(a,t){return e.openBlock(),e.createElementBlock("svg",Or,t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M9 11a3 3 0 1 0 6 0a3 3 0 0 0 -6 0"},null,-1),e.createElementVNode("path",{d:"M17.657 16.657l-4.243 4.243a2 2 0 0 1 -2.827 0l-4.244 -4.243a8 8 0 1 1 11.314 0z"},null,-1)]))}const jr=j(Rr,[["render",zr]]),Ur={},Pr={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none","stroke-width":"2",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-line"};function Hr(a,t){return e.openBlock(),e.createElementBlock("svg",Pr,t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M6 18m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"},null,-1),e.createElementVNode("path",{d:"M18 6m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"},null,-1),e.createElementVNode("path",{d:"M7.5 16.5l9 -9"},null,-1)]))}const qr=j(Ur,[["render",Hr]]),Gr={},Kr={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-polygon"};function Zr(a,t){return e.openBlock(),e.createElementBlock("svg",Kr,t[0]||(t[0]=[e.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M12 5m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path><path d="M19 8m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path><path d="M5 11m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path><path d="M15 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path><path d="M6.5 9.5l3.5 -3"></path><path d="M14 5.5l3 1.5"></path><path d="M18.5 10l-2.5 7"></path><path d="M13.5 17.5l-7 -5"></path>',9)]))}const Wr=j(Gr,[["render",Zr]]),Yr={},Jr={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-topology-ring-3"};function Xr(a,t){return e.openBlock(),e.createElementBlock("svg",Jr,t[0]||(t[0]=[e.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M8 18a2 2 0 1 0 -4 0a2 2 0 0 0 4 0z"></path><path d="M20 18a2 2 0 1 0 -4 0a2 2 0 0 0 4 0z"></path><path d="M20 6a2 2 0 1 0 -4 0a2 2 0 0 0 4 0z"></path><path d="M8 6a2 2 0 1 0 -4 0a2 2 0 0 0 4 0z"></path><path d="M6 8v8"></path><path d="M18 16v-8"></path><path d="M8 6h8"></path><path d="M16 18h-8"></path>',9)]))}const Qr=j(Yr,[["render",Xr]]),ea={},ta={version:"1.1",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg","xmlns:sketch":"http://www.bohemiancoding.com/sketch/ns","xmlns:xlink":"http://www.w3.org/1999/xlink",class:"fullscreen-icon"};function na(a,t){return e.openBlock(),e.createElementBlock("svg",ta,t[0]||(t[0]=[e.createElementVNode("title",null,null,-1),e.createElementVNode("desc",null,null,-1),e.createElementVNode("defs",null,null,-1),e.createElementVNode("g",{fill:"none","fill-rule":"evenodd",id:"Page-1",stroke:"none","stroke-width":"1"},[e.createElementVNode("g",{fill:"#000000",id:"Core",transform:"translate(-215.000000, -257.000000)"},[e.createElementVNode("g",{id:"fullscreen",transform:"translate(215.000000, 257.000000)"},[e.createElementVNode("path",{d:"M2,9 L0,9 L0,14 L5,14 L5,12 L2,12 L2,9 L2,9 Z M0,5 L2,5 L2,2 L5,2 L5,0 L0,0 L0,5 L0,5 Z M12,12 L9,12 L9,14 L14,14 L14,9 L12,9 L12,12 L12,12 Z M9,0 L9,2 L12,2 L12,5 L14,5 L14,0 L9,0 L9,0 Z",id:"Shape"})])])],-1)]))}const sa=j(ea,[["render",na]]),la={class:"map-search-widget flex flex-col gap-2 rounded-xl widget min-w-[200px]"},oa={key:0,class:"vs-select__options absolute z-50 mt-1 w-full bg-white border border-gray-300 shadow-lg rounded-lg text-sm"},ra=["onClick"],aa={class:"relative flex-1 min-w-[140px]"},ia=["placeholder"],da="https://data.softpro.ua/api-user/gis-url-proxy",ca="https://geo.rv.ua/api-user/dzk.api",ua=j(e.defineComponent({__name:"map-search",props:{config:{}},emits:["goToCoordinates"],setup(a,{emit:t}){const n=a,s=t,l=["here","xy","parcel"],o=e.computed(()=>{const m=n.config?.tools?.filter(g=>l.includes(g));return m&&m.length?m:l}),r=e.computed(()=>n.config?.placeholder?.trim()||"Пошук…"),i=e.ref(o.value[0]??l[0]);e.watch(o,m=>{m.includes(i.value)||(i.value=m[0])});const d=e.ref(""),c=e.ref(!1),u=e.ref(null);e.watch(i,()=>{d.value="",c.value=!1});function p(m){i.value=m}function h(m){if(!c.value)return;const g=u.value;g&&!g.contains(m.target)&&(c.value=!1)}e.onMounted(()=>{window.addEventListener("click",h,!0)}),e.onBeforeUnmount(()=>{window.removeEventListener("click",h,!0)});function E(m){return m==="xy"?"Координати":m==="parcel"?"Кадастр":"Адреси"}function F(m){const g=m.replace(/[,]+/g," ").trim();if(!g)return null;const x=g.split(/\s+/).filter(Boolean);if(x.length<2)return null;const w=x.slice(0,2).map(Number);if(!w.every(G=>Number.isFinite(G)))return null;let[z,Y]=w,X=z,B=Y;const P=G=>Math.abs(G)<=90,q=G=>Math.abs(G)<=180;if(!P(X)||!q(B))if(P(B)&&q(X))X=Y,B=z;else return null;return{lat:X,lng:B}}function $(m){return(m?.items||[]).map((x,w)=>({id:String(x?.id??w),title:x?.title||x?.address?.label||"Знайдений обʼєкт",lat:Number(x?.position?.lat),lng:Number(x?.position?.lng)})).filter(x=>Number.isFinite(x.lat)&&Number.isFinite(x.lng))}function A(m){const g=m?.result||m?.data||m;if(!g)return[];const x=g.geom_centroid;if(!x||!Array.isArray(x.coordinates))return[];const[w,z]=x.coordinates;return!Number.isFinite(z)||!Number.isFinite(w)?[]:[{id:"parcel",title:g.cadnum||g.cad_num||"Земельна ділянка",lat:z,lng:w}]}function V(m){const x=m.replace(/\s+/g,"").split(":");if(x.length!==4)return!1;const w=[10,2,3,4];return x.every((z,Y)=>z.length===w[Y]&&/^\d+$/.test(z))}function D(m){s("goToCoordinates",[m.lat,m.lng])}async function _(){const m=d.value.trim();if(m){if(i.value==="xy"){const g=F(m);if(!g){J.notify({type:"warning",title:"Пошук координат",message:"Не знайдено або невірний формат координат"});return}D(g),d.value="";return}try{const g=new URL(i.value==="here"?da:ca);if(i.value==="here")g.searchParams.set("searchtext",m);else{if(!V(m)){J.notify({type:"warning",title:"Пошук кадастру",message:"Кадастровий номер має формат ХХХХХХХХХХ:ХХ:ХХХ:ХХХХ"});return}g.searchParams.set("cad_num",m)}const x=await fetch(g.toString());if(!x.ok)throw new Error(`HTTP ${x.status}`);const w=await x.json(),z=i.value==="here"?$(w):A(w);if(!z.length)J.notify({type:"warning",title:"Пошук",message:"Не знайдено результатів"});else{const Y=z[0];D(Y),d.value=""}}catch(g){const x=g?.message||"Помилка пошуку";J.notify({type:"error",title:"Пошук",message:x})}}}return(m,g)=>(e.openBlock(),e.createElementBlock("div",la,[e.createElementVNode("form",{class:"flex gap-2",onSubmit:e.withModifiers(_,["prevent"])},[o.value.length>1?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"dropdownRef",ref:u,class:"relative search-type w-[140px]"},[e.createElementVNode("button",{type:"button",class:"vstSelect-input transition-all text-left bg-white border border-gray-200 text-gray-900 rounded-lg focus:ring-blue-500 focus:border-blue-100 block w-full py-1.5 px-3 text-sm cursor-pointer flex items-center justify-between gap-2",onClick:g[0]||(g[0]=x=>c.value=!c.value)},[e.createElementVNode("span",null,e.toDisplayString(E(i.value)),1),(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["w-4 h-4 text-gray-500 transition-transform",{"rotate-180":c.value}]),viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},g[2]||(g[2]=[e.createElementVNode("path",{d:"M6 9l6 6 6-6",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)]),2))]),c.value?(e.openBlock(),e.createElementBlock("div",oa,[e.createElementVNode("ul",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,x=>(e.openBlock(),e.createElementBlock("li",{key:x,class:"px-3 py-2 cursor-pointer hover:bg-gray-100",onClick:w=>p(x)},e.toDisplayString(E(x)),9,ra))),128))])])):e.createCommentVNode("",!0)],512)):e.createCommentVNode("",!0),e.createElementVNode("div",aa,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":g[1]||(g[1]=x=>d.value=x),placeholder:r.value,type:"text",class:"vs-input transition-all border block w-full border-gray-200 rounded-md focus:border-blue-100 border-solid !pr-8 py-1.5 pl-3 text-sm"},null,8,ia),[[e.vModelText,d.value,void 0,{trim:!0}]]),g[3]||(g[3]=e.createElementVNode("button",{type:"submit",class:"absolute inset-y-0 right-2 flex items-center text-gray-400 hover:text-gray-600","aria-label":"Пошук"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m21 21-4.35-4.35m0 0A7.5 7.5 0 1 0 5 5a7.5 7.5 0 0 0 11.65 11.65Z"})])],-1))])],32)]))}}),[["__scopeId","data-v-3048520a"]]),pa={class:"bg-white/95 p-2 rounded-xl shadow border border-gray-200"},ha={class:"flex gap-2"},ma=["onClick","title"],fa=["src"],ga=e.defineComponent({__name:"map-layers",props:{basemaps:{}},emits:["onLayerChange"],setup(a,{emit:t}){const n=a,s=e.ref(Object.keys(n.basemaps)[0]),l=t;function o(r){l("onLayerChange",r),s.value=r}return(r,i)=>(e.openBlock(),e.createElementBlock("div",pa,[e.createElementVNode("div",ha,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.basemaps,(d,c)=>(e.openBlock(),e.createElementBlock("div",{key:c,class:e.normalizeClass(["cursor-pointer border rounded-lg overflow-hidden hover:shadow-sm",{"ring-2 ring-blue-500 border-blue-300":s.value===c}]),onClick:u=>o(c),title:d.name||c,role:"button",tabindex:"0"},[e.createElementVNode("img",{src:d.preview,alt:"",class:"w-10 h-10 object-cover"},null,8,fa)],10,ma))),128))])]))}}),ka={class:"bg-white/95 p-2 rounded-xl shadow border border-gray-200"},ba={class:"flex items-center gap-2 text-sm text-gray-700 cursor-pointer select-none"},ya=["checked"],xa=e.defineComponent({__name:"map-scroll-wheel-toggle",props:{modelValue:{type:Boolean}},emits:["update:modelValue"],setup(a,{emit:t}){const n=t;function s(l){const o=l.target;n("update:modelValue",o.checked)}return(l,o)=>(e.openBlock(),e.createElementBlock("div",ka,[e.createElementVNode("label",ba,[e.createElementVNode("input",{type:"checkbox",class:"form-checkbox",checked:l.modelValue,onChange:s},null,40,ya),o[0]||(o[0]=e.createElementVNode("span",null,"Зум колесиком мишки",-1))])]))}}),wa={class:"absolute top-4 left-4 z-[1000] w-[calc(100%-20px)] sm:w-[350px]"},_a={class:"form-geom__panel flex gap-1 items-start mt-2"},Ea={class:"flex items-center gap-1"},Va=["disabled"],Ca={class:"absolute top-4 right-4 z-[1000]"},Ba={class:"flex flex-col gap-[2px]"},va=["aria-pressed"],Na=["aria-pressed"],Sa=["aria-pressed"],Ma=["aria-pressed"],$a={class:"absolute bottom-0 left-0 right-0 z-[1000] bg-white/95 border-t border-gray-200 text-xs text-gray-700 flex items-center gap-4 pt-1"},Fa={key:0,class:"form-geom__feature flex items-center text-xs transition-all gap-2 w-full"},Aa={class:"mr-auto"},Da={class:"font-bold"},Ia={class:"flex items-center"},La={class:"text-xs mr-2"},Ta={key:0,class:"text-xs"},Ra={key:1,class:"text-xs"},mt=j(e.defineComponent({__name:"vs-input-map",props:{tools:{},style:{},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{}},emits:["update:modelValue"],setup(a,{emit:t}){const n=e.getCurrentInstance(),s=a,l=t,o=e.ref(null);let r,i,d;const c=e.ref(null),u=e.ref(null),p=e.ref(6),h=e.ref(0),E=e.ref(n?.appContext.config.globalProperties.$settings?.center||[50,30]),F=e.ref(null),$=e.ref(!1),A=ce();let V;const D=e.ref("topo100");function _(b){return b?b.type==="Polygon"?{type:"MultiPolygon",coordinates:[b.coordinates]}:(b.type==="MultiPolygon",b):null}function m(){return new Promise((b,y)=>{window.L&&window.L.Draw&&b(0);const T=W=>{if(Array.from(document.styleSheets).some(ge=>ge?.href?.includes(W)))return;const oe=document.createElement("link");oe.rel="stylesheet",oe.href=W,document.head.appendChild(oe)},K=W=>new Promise((pe,oe)=>{const ge=Array.from(document.scripts).find(be=>be.src===W);if(ge){ge.addEventListener("load",()=>pe()),ge.addEventListener("error",be=>oe(be));return}const ke=document.createElement("script");ke.src=W,ke.async=!0,ke.onload=()=>pe(),ke.onerror=be=>oe(be),document.body.appendChild(ke)});T("https://unpkg.com/leaflet@1.9.4/dist/leaflet.css"),T("https://unpkg.com/leaflet-draw@1.0.4/dist/leaflet.draw.css"),K("https://unpkg.com/leaflet@1.9.4/dist/leaflet.js").then(()=>K("https://unpkg.com/leaflet-draw@1.0.4/dist/leaflet.draw.js")).then(()=>b(0)).catch(y)})}function g(){const b=i.toGeoJSON(),y=[],T=W=>{if(W)switch(W.type){case"Polygon":y.push(W.coordinates);break;case"MultiPolygon":y.push(...W.coordinates);break;case"GeometryCollection":(W.geometries||[]).forEach(T);break}};(b?.features||[]).forEach(W=>T(W.geometry));const K=y.length?{type:"MultiPolygon",coordinates:y}:null;l("update:modelValue",K?_(K):null),h.value=i.getLayers().length}function x(b=30){const y=i.getLayers();if(!y.length)return;const K=L.featureGroup(y).getBounds();K&&K.isValid()&&r.fitBounds(K,{padding:[b,b]})}function w(){c.value?.click()}const z=e.ref("");function Y(b){return b instanceof L.Circle?"Circle":b instanceof L.Rectangle?"Rectangle":b instanceof L.Polygon&&!(b instanceof L.Rectangle)?"Polygon":b instanceof L.Polyline&&!(b instanceof L.Polygon)?"Polyline":b instanceof L.Marker?"Point":"Feature"}function X(b){if(b instanceof L.Circle){const y=b.getRadius();return Math.PI*(y*y)/1e6}if(b instanceof L.Polygon||b instanceof L.Rectangle)try{const y=b.getLatLngs(),T=Array.isArray(y[0])?y[0]:y,K=L.GeometryUtil?.geodesicArea?L.GeometryUtil.geodesicArea(T):0;return K?K/1e6:0}catch{return null}return null}function B(b){return b instanceof L.Circle?b.getLatLng():b.getBounds?b.getBounds().getCenter():b.getLatLng?b.getLatLng():r.getCenter()}function P(){const b=i.getLayers();if(!b.length){F.value=null,h.value=0;return}const y=b[b.length-1],T=Y(y),K=B(y),W=X(y);F.value={type:T,center:K,areaKm2:W,layer:y},h.value=b.length}function q(){const b=F.value?.layer;b&&(b instanceof L.Circle&&b.getBounds?r.fitBounds(b.getBounds(),{padding:[30,30]}):b.getBounds?r.fitBounds(b.getBounds(),{padding:[30,30]}):b.getLatLng&&r.setView(b.getLatLng(),Math.max(p.value,14)))}function G(){const b=F.value?.layer;b&&(i.removeLayer(b),g(),P())}e.onMounted(async()=>{await m(),L.drawLocal=Lr,r=L.map(o.value,{zoomControl:!1,scrollWheelZoom:$.value}).setView(E.value,10),L.control.zoom({position:"bottomright"}).addTo(r),$.value||r.scrollWheelZoom.disable(),D.value=Object.keys(A)[0],V=L.tileLayer(A[D.value].url,{maxZoom:19,minZoom:6}).addTo(r),i=new L.FeatureGroup().addTo(r),r.on(L.Draw.Event.CREATED,T=>{const{layer:K}=T;i.clearLayers(),i.addLayer(K),g(),P(),x(),z.value=""}),r.on(L.Draw.Event.EDITED,()=>{g(),P(),x()}),r.on(L.Draw.Event.DELETED,()=>{g(),P(),x()});let b=!1;r.on("mousemove",T=>{b||(r.invalidateSize(),b=!0),u.value=T.latlng}),r.on("zoomend",()=>{p.value=r.getZoom()});const y=Tr(s.modelValue);if(y){const T=[];L.geoJSON(y).eachLayer(K=>T.push(K)),T.length&&i.addLayer(T[0]),g(),P(),x()}}),e.watch($,b=>{r&&(b?r.scrollWheelZoom.enable():r.scrollWheelZoom.disable())});function M(b){if(r){switch(d&&d.disable(),b){case"marker":d=new L.Draw.Marker(r);break;case"polyline":d=new L.Draw.Polyline(r);break;case"polygon":d=new L.Draw.Polygon(r);break;case"rectangle":d=new L.Draw.Rectangle(r);break;default:d=new L.Draw.Rectangle(r);break}d&&(d.enable(),z.value=b)}}function S(){const b=i.toGeoJSON(),y=new Blob([JSON.stringify(b,null,2)],{type:"application/json"}),T=URL.createObjectURL(y),K=document.createElement("a");K.href=T,K.download="data.geojson",K.click(),URL.revokeObjectURL(T)}function v(b){const y=b.target.files?.[0];if(!y)return;const T=new FileReader;T.onload=()=>{if(typeof T.result=="string")try{const K=JSON.parse(T.result);i.clearLayers(),K&&L.geoJSON({type:"Feature",geometry:K}).eachLayer(W=>{i.addLayer(W)}),g(),P(),x()}finally{b.target.value=""}},T.readAsText(y)}function R(b){r&&(V&&r.removeLayer(V),V=L.tileLayer(A[b].url,{maxZoom:19,minZoom:6}).addTo(r),D.value=b)}function Z(b){const y=L.latLng(b[0],b[1]);r.setView(y,13)}e.watch(()=>s.modelValue,b=>{const y=_(b);if(b&&y!==b){l("update:modelValue",y);return}i.clearLayers(),y&&L.geoJSON({type:"Feature",geometry:y}).eachLayer(T=>{i.addLayer(T),T.dragging?.enable(),T.dragging?.enabled(),T.on("dragend",K=>{const pe=K.target.getLatLng();l("update:modelValue",{type:"Point",coordinates:[pe.lng,pe.lat]})})}),h.value=i.getLayers().length,P(),x()});function ce(){return n?.appContext.config.globalProperties.$settings?.basemaps?n?.appContext.config.globalProperties.$settings?.basemaps.map((b,y)=>Object.assign(b,{key:`b${y}`,preview:b.preview||b.url.replace("{z}/{x}/{y}.png","13/4790/2762.png")})).reduce((b,y)=>({...b,[y.key]:y}),{}):{topo100:{url:"https://data.gki.com.ua/api-user/rtile/voyager/ua/{z}/{x}/{y}.png",preview:"https://data.gki.com.ua/api-user/rtile/voyager/ua/13/4790/2762.png"},orto10:{url:"https://data.gki.com.ua/api-user/rtile/orto10/ua/{z}/{x}/{y}.png",preview:"https://data.gki.com.ua/api-user/rtile/orto10/ua/13/4790/2762.png"},osmb:{url:"https://tile.openstreetmap.org.ua/styles/osm-bright/{z}/{x}/{y}.png",preview:"https://tile.openstreetmap.org.ua/styles/osm-bright/13/4790/2762.png"}}}const ue=e.ref(!1);return e.watch(ue,()=>{setTimeout(()=>{r.invalidateSize()},50)}),(b,y)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["leaflet-map-wrapper relative w-full h-[400px]",{fullscreen:ue.value}])},[e.createElementVNode("div",{ref_key:"mapContainer",ref:o,class:"w-full h-full"},null,512),e.createElementVNode("div",wa,[e.createVNode(ua,{onGoToCoordinates:Z}),e.createElementVNode("div",_a,[e.createElementVNode("div",Ea,[e.createElementVNode("button",{type:"button",class:"vs-btn-row",onClick:w},"Import"),e.createElementVNode("button",{type:"button",class:"vs-btn-row",onClick:S,disabled:h.value===0},"Export ",8,Va)]),e.createElementVNode("input",{ref_key:"importRef",ref:c,type:"file",onChange:v,accept:".json,.geojson",class:"hidden"},null,544)]),e.createVNode(xa,{class:"mt-2",modelValue:$.value,"onUpdate:modelValue":y[0]||(y[0]=T=>$.value=T)},null,8,["modelValue"])]),e.createElementVNode("div",Ca,[e.createElementVNode("div",Ba,[e.createElementVNode("button",{class:e.normalizeClass(["vs-btn",{"vs-active":z.value==="marker"}]),"aria-pressed":z.value==="marker",title:"Point (P)","aria-label":"Draw point",onClick:y[1]||(y[1]=T=>M("marker"))},[e.createVNode(jr)],10,va),e.createElementVNode("button",{class:e.normalizeClass(["vs-btn",{"vs-active":z.value==="polyline"}]),"aria-pressed":z.value==="polyline",title:"Line (L)","aria-label":"Draw polyline",onClick:y[2]||(y[2]=T=>M("polyline"))},[e.createVNode(qr)],10,Na),e.createElementVNode("button",{class:e.normalizeClass(["vs-btn",{"vs-active":z.value==="polygon"}]),"aria-pressed":z.value==="polygon",title:"Polygon (G)","aria-label":"Draw polygon",onClick:y[3]||(y[3]=T=>M("polygon"))},[e.createVNode(Wr)],10,Sa),e.createElementVNode("button",{class:e.normalizeClass(["vs-btn",{"vs-active":z.value==="rectangle"}]),"aria-pressed":z.value==="rectangle",title:"Rectangle (R)","aria-label":"Draw rectangle",onClick:y[4]||(y[4]=T=>M("rectangle"))},[e.createVNode(Qr)],10,Ma),e.createElementVNode("button",{class:"vs-btn mt-5",onClick:y[5]||(y[5]=T=>{ue.value=!ue.value}),title:"Full Screen","aria-label":"Full Screen"},[e.createVNode(sa,{style:{width:"12px",height:"12px"}})])])]),e.createElementVNode("div",{class:e.normalizeClass(["absolute left-4 z-[1000]",F.value?"bottom-8":"bottom-4"])},[e.createVNode(ga,{basemaps:e.unref(A),onOnLayerChange:R},null,8,["basemaps"])],2),e.createElementVNode("div",$a,[F.value?(e.openBlock(),e.createElementBlock("div",Fa,[e.createElementVNode("div",Aa,[y[8]||(y[8]=e.createTextVNode(" Тип: ",-1)),e.createElementVNode("span",Da,e.toDisplayString(F.value.type),1)]),e.createElementVNode("div",Ia,[e.createElementVNode("div",La,[y[9]||(y[9]=e.createTextVNode(" Центр: ",-1)),e.createElementVNode("b",null,e.toDisplayString(F.value.center.lat.toFixed(5))+", "+e.toDisplayString(F.value.center.lng.toFixed(5)),1)]),F.value.areaKm2!==null?(e.openBlock(),e.createElementBlock("div",Ta,[y[10]||(y[10]=e.createTextVNode(" Площа: ",-1)),e.createElementVNode("b",null,e.toDisplayString(F.value.areaKm2.toFixed(1))+"км²",1)])):(e.openBlock(),e.createElementBlock("div",Ra,y[11]||(y[11]=[e.createTextVNode(" Площа: ",-1),e.createElementVNode("b",null,"—",-1)]))),e.createElementVNode("button",{class:"tool bg-gray-100 py-1.5 px-2 rounded-lg text-md mr-1 cursor-pointer hover:bg-blue-500 hover:text-white transition-all",title:"Наблизити",onClick:y[6]||(y[6]=T=>q())},y[12]||(y[12]=[e.createStaticVNode('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="w-3 h-3" data-v-c87e933d><path d="M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0" data-v-c87e933d></path><path d="M7 10l6 0" data-v-c87e933d></path><path d="M10 7l0 6" data-v-c87e933d></path><path d="M21 21l-6 -6" data-v-c87e933d></path></svg>',1)])),e.createElementVNode("button",{class:"tool bg-gray-100 py-1.5 px-2 rounded-lg text-md cursor-pointer hover:bg-blue-500 hover:text-white transition-all",title:"Видалити",onClick:y[7]||(y[7]=T=>G())},[e.createVNode(Fe,{class:"w-3 h-3"})])])])):e.createCommentVNode("",!0)])],2))}}),[["__scopeId","data-v-c87e933d"]]),Oa=["data-focus"],za={class:"flex items-center"},ja={class:"overflow-hidden text-ellipsis whitespace-nowrap rounded-sm text-[#333] text-[85%] px-0.5 py-[3px] pl-1.5 box-border"},Ua=["onClick","aria-label"],Pa={key:0,class:"absolute text-gray-500 truncate pl-2"},Ha={class:"flex-1 min-w-[2px]"},qa=["placeholder"],Ga={class:"flex items-center shrink-0"},Ka=["disabled"],ft=e.defineComponent({__name:"vs-input-tag",props:e.mergeModels({unique:{type:Boolean,default:!0},style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{},name:{},placeholder:{default:"Введіть тег"}},{modelValue:{default:[]},modelModifiers:{}}),emits:e.mergeModels(["update:modelValue"],["update:modelValue"]),setup(a,{emit:t}){const n=a,s=t;se(n.style);const l=e.ref(null),o=e.ref(null),r=e.ref(null),i=e.ref(!1),d=e.ref(""),c=e.useModel(a,"modelValue"),u=e.computed(()=>n.placeholder||"Add tag…"),p=e.computed(()=>c.value?.length===0&&d.value===""),h=e.computed(()=>!n.disabled&&c.value?.length>0),E=e.computed(()=>n.disabled),F=async()=>{E.value||await e.nextTick(()=>r.value?.focus())},$=x=>{const w=x.trim();w!==""&&(!c.value||!Array.isArray(c.value)?c.value=[w]:n.unique?c.value.includes(w)||(c.value=[...c.value,w]):c.value=[...c.value,w],d.value="")},A=()=>{const x=d.value;x.trim()!==""&&$(x),d.value=""},V=x=>{const w=c.value.slice();w.splice(x,1),s("update:modelValue",w)},D=()=>{s("update:modelValue",[])},_=()=>{E.value||(i.value=!0)},m=()=>{i.value=!1},g=x=>{const{key:w}=x;w==="Enter"?(x.preventDefault(),A()):w==="Backspace"&&d.value===""&&c.value.length>0&&V(c.value.length-1)};return(x,w)=>(e.openBlock(),e.createElementBlock("div",{class:"flex gap-1 w-full",ref_key:"root",ref:l,onClick:w[1]||(w[1]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:e.normalizeClass(["relative w-full font-sans",n.customClass]),role:"group","aria-label":"Tag input"},[e.createElementVNode("div",{class:e.normalizeClass(["flex min-h-[38px] items-center justify-between rounded border transition-colors bg-white","border-gray-300 hover:border-gray-400",i.value?"border-blue-500 ring-1 ring-blue-500":"",E.value?"bg-gray-100 text-gray-400 cursor-not-allowed hover:border-gray-300":""]),"data-focus":i.value?"true":"false",onClick:F},[e.createElementVNode("div",{class:"flex flex-1 flex-wrap items-center gap-1 py-0.5 pl-2 pr-0 overflow-hidden",ref_key:"chipsRef",ref:o},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(z,Y)=>(e.openBlock(),e.createElementBlock("div",{key:Y,class:"flex min-w-0 bg-[#e6e6e6] rounded-sm m-0.5 box-border"},[e.createElementVNode("div",za,[e.createElementVNode("div",ja,e.toDisplayString(z),1)]),e.createElementVNode("div",{role:"button",class:"flex items-center rounded-sm px-1 box-border hover:bg-[#ffbdad] hover:text-[#de350b]",onClick:e.withModifiers(X=>V(Y),["stop"]),"aria-label":`Remove ${z}`},w[2]||(w[2]=[e.createElementVNode("svg",{height:"14",width:"14",viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",class:"inline-block fill-current stroke-current leading-none stroke-0"},[e.createElementVNode("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"})],-1)]),8,Ua)]))),128)),p.value?(e.openBlock(),e.createElementBlock("div",Pa,e.toDisplayString(u.value),1)):e.createCommentVNode("",!0),e.createElementVNode("div",Ha,[E.value?e.createCommentVNode("",!0):e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,ref_key:"inputRef",ref:r,class:"pl-2 w-full bg-transparent outline-none border-0 m-0 p-0 text-gray-900",autocapitalize:"none",autocomplete:"off",autocorrect:"off",spellcheck:"false",type:"text",tabindex:"0","aria-label":"Add tag","onUpdate:modelValue":w[0]||(w[0]=z=>d.value=z),onFocus:_,onBlur:m,onKeydown:g,placeholder:c.value&&c.value.length?"":void 0},null,40,qa)),[[e.vModelText,d.value]])])],512),e.createElementVNode("div",Ga,[h.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"px-2 text-gray-400 hover:text-gray-500 transition-colors disabled:opacity-50","aria-label":"Clear all tags",disabled:E.value,onClick:e.withModifiers(D,["stop"])},w[3]||(w[3]=[e.createElementVNode("svg",{height:"20",width:"20",viewBox:"0 0 20 20",class:"fill-current"},[e.createElementVNode("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"})],-1)]),8,Ka)):e.createCommentVNode("",!0)])],10,Oa)],2)],512))}}),Za={class:"relative flex gap-1 bg-white w-full"},Wa=["disabled","placeholder"],gt=j(e.defineComponent({__name:"vs-input-slug",props:e.mergeModels({disabled:{type:Boolean},placeholder:{},parent:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(a){const t=e.inject("values"),n=a,s=e.useModel(a,"modelValue");function l(r){const i={а:"a",б:"b",в:"v",г:"g",д:"d",е:"e",ё:"e",ж:"zh",з:"z",и:"i",й:"y",к:"k",л:"l",м:"m",н:"n",о:"o",п:"p",р:"r",с:"s",т:"t",у:"u",ф:"f",х:"kh",ц:"ts",ч:"ch",ш:"sh",щ:"shch",ы:"y",э:"e",ю:"yu",я:"ya",ь:"",ъ:"",є:"ye",і:"i",ї:"yi",ґ:"g"};return r.toLowerCase().split("").map(d=>i[d]||d).join("").replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"")}const o=()=>{const r=t?.value?.[n.parent||""]?.toString(),i=l(r);s.value=i.toString()};return(r,i)=>(e.openBlock(),e.createElementBlock("div",Za,[e.withDirectives(e.createElementVNode("input",{ref:"vsText",disabled:r.disabled,placeholder:r.placeholder,"onUpdate:modelValue":i[0]||(i[0]=d=>s.value=d),class:"block w-full px-3 py-2 text-sm border border-solid rounded-lg placeholder:text-nowrap border-stone-200 text-stone-800 placeholder:text-stone-400 focus:outline focus:z-10 focus:border-blue-500 focus:ring-blue-500 focus:outline-blue-500"},null,8,Wa),[[e.vModelText,s.value]]),e.createElementVNode("button",{class:"px-2 bg-gray-100 border rounded-lg hover:bg-gray-200",onClick:o}," Gen ")]))}}),[["__scopeId","data-v-b0eba370"]]),Ya={class:"w-full"},Ja={ref:"sortableContainer",class:"flex flex-col gap-1"},Xa=["onDragstart","onDrop"],Qa={class:"w-1/3"},ei={class:"w-2/3"},ti=["onClick"],ni={key:0,class:"text-[14px] text-gray-700"},si={class:"mt-2 w-full flex items-center"},li=["disabled"],kt=j(e.defineComponent({__name:"vs-input-key-value",props:{parent:{},ignore:{},addButtonText:{},modelValue:{}},emits:["update:modelValue"],setup(a,{emit:t}){const n=A=>`${A}-${Math.random().toString(36).substring(2,15)}`,s=e.inject("values"),l=a,o=t,r=l.addButtonText??"Додати",i=l.ignore??[],d=e.ref([]),c=e.ref(null);(()=>{const A=l.parent&&s?.value?.[l.parent]||l.modelValue||{};d.value=Object.entries(A).filter(([V])=>!i.includes(V)).map(([V,D])=>({id:n("key-value-"),key:V,value:D}))})();function p(A){c.value=A}function h(A){if(c.value===null||c.value===A)return;const V=d.value.splice(c.value,1)[0];d.value.splice(A,0,V),c.value=null}const E=e.computed(()=>d.value.some(A=>A.key&&!A.value||!A.key&&A.value)),F=()=>{d.value.push({id:n("key-value-"),key:"",value:""})},$=A=>{d.value=d.value.filter(V=>V.id!==A)};return e.watch(d,A=>{const V={};A.forEach(_=>{_.key&&_.value!==void 0&&(V[_.key]=_.value)});const D={};i.length&&i.forEach(_=>{D[_]=l.parent?s?.value?.[l.parent]?.[_]:void 0}),s?.value&&l.parent&&(s.value[l.parent]={...D,...V}),o("update:modelValue",V)},{deep:!0}),(A,V)=>(e.openBlock(),e.createElementBlock("div",Ya,[e.createElementVNode("div",Ja,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(D,_)=>(e.openBlock(),e.createElementBlock("div",{key:D.id,class:e.normalizeClass(["flex items-center gap-2 w-full",{"opacity-50":c.value===_}]),draggable:"true",onDragstart:m=>p(_),onDragover:V[0]||(V[0]=e.withModifiers(()=>{},["prevent"])),onDrop:m=>h(_)},[V[1]||(V[1]=e.createStaticVNode('<button class="cursor-move" data-v-a0f7fbfc><svg fill="#000000" width="20" height="20" viewBox="0 0 36 36" data-v-a0f7fbfc><circle cx="15" cy="12" r="1.5" data-v-a0f7fbfc></circle><circle cx="15" cy="24" r="1.5" data-v-a0f7fbfc></circle><circle cx="21" cy="12" r="1.5" data-v-a0f7fbfc></circle><circle cx="21" cy="24" r="1.5" data-v-a0f7fbfc></circle><circle cx="21" cy="18" r="1.5" data-v-a0f7fbfc></circle><circle cx="15" cy="18" r="1.5" data-v-a0f7fbfc></circle></svg></button>',1)),e.createElementVNode("div",Qa,[e.createVNode(_e,{modelValue:D.key,"onUpdate:modelValue":m=>D.key=m,placeholder:"Ключ"},null,8,["modelValue","onUpdate:modelValue"])]),e.createElementVNode("div",ei,[e.createVNode(_e,{modelValue:D.value,"onUpdate:modelValue":m=>D.value=m,placeholder:"Значення"},null,8,["modelValue","onUpdate:modelValue"])]),e.createElementVNode("button",{onClick:m=>$(D.id),class:"shrink-0 w-[30px] text-gray-600 h-[30px] rounded-full flex items-center justify-center bg-gray-100 hover:bg-gray-200"},[e.createVNode(e.unref(Un),{height:"16",width:"16"})],8,ti)],42,Xa))),128))],512),d.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",ni," Дані для відображення відсутні ")),e.createElementVNode("div",si,[e.createElementVNode("button",{type:"button",onClick:F,disabled:E.value,class:"py-1.5 px-2 flex items-center gap-x-1 text-xs font-medium rounded-full border border-dashed border-gray-200 bg-white text-gray-800 hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed"},[e.createVNode(Ee,{height:"14",width:"14"}),e.createTextVNode(" "+e.toDisplayString(e.unref(r)),1)],8,li)])]))}}),[["__scopeId","data-v-a0f7fbfc"]]),oi={class:"flex items-center gap-2 w-full"},ri=["disabled"],bt=e.defineComponent({__name:"vs-input-color",props:{style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{},name:{},placeholder:{default:""}},emits:["update:modelValue"],setup(a,{emit:t}){const n=a,{inputClass:s}=se(n.style),l=t,o=e.computed({get:()=>n.modelValue||"#000000",set:r=>l("update:modelValue",r)});return(r,i)=>(e.openBlock(),e.createElementBlock("div",oi,[e.withDirectives(e.createElementVNode("input",{type:"color","onUpdate:modelValue":i[0]||(i[0]=d=>o.value=d),disabled:r.disabled,ref:"color",class:e.normalizeClass(["py-1.5 px-1 block w-full bg-white cursor-pointer max-w-[50px]",[r.modelValue?"":"text-opacity-50",e.unref(s)].join(" ")]),style:{border:"1px solid #CFD9E0"}},null,10,ri),[[e.vModelText,o.value]]),e.withDirectives(e.createElementVNode("input",{class:"text-sm text-gray-600 border border-solid border-stone-200 rounded-md p-2","onUpdate:modelValue":i[1]||(i[1]=d=>o.value=d)},null,512),[[e.vModelText,o.value]])]))}}),ai={class:"flex items-center gap-2 w-full"},ii=["min","max","step","disabled"],yt=e.defineComponent({__name:"vs-input-range",props:{style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{},name:{},placeholder:{default:""},min:{default:0},max:{default:100},step:{default:1}},emits:["update:modelValue"],setup(a,{emit:t}){const n=a,{inputClass:s}=se(n.style),l=t,o=e.computed({get:()=>Number(n.modelValue??n.min),set:r=>l("update:modelValue",Number(r))});return(r,i)=>(e.openBlock(),e.createElementBlock("div",ai,[e.withDirectives(e.createElementVNode("input",{type:"range","onUpdate:modelValue":i[0]||(i[0]=d=>o.value=d),min:r.min,max:r.max,step:r.step,disabled:r.disabled,ref:"range",class:e.normalizeClass(["w-full cursor-pointer accent-blue-500",[r.modelValue?"":"text-opacity-50",e.unref(s)].join(" ")])},null,10,ii),[[e.vModelText,o.value]]),e.withDirectives(e.createElementVNode("input",{class:"text-sm text-gray-600 border border-solid border-stone-200 rounded-md p-2 max-w-[100px]",type:"number","onUpdate:modelValue":i[1]||(i[1]=d=>o.value=d)},null,512),[[e.vModelText,o.value]])]))}}),di=["type","value","onInput","placeholder","disabled"],xt=e.defineComponent({__name:"vs-input-array",props:e.mergeModels({count:{default:1},limit:{default:a=>a.count??1},inputType:{default:"text"},style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{default:""},name:{},placeholder:{default:""}},{modelValue:{default:[]},modelModifiers:{}}),emits:["update:modelValue"],setup(a){const t=a,{inputClass:n}=se(t.style),s=e.useModel(a,"modelValue");e.watchEffect(()=>{const o=s.value?.length??0;o<t.count&&(s.value=[...s.value??[],...Array(t.count-o)])});function l(o,r){const i=o.target.value,d=[...s.value];d[r]=t.inputType==="text"?i:Number(i),s.value=d}return(o,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["grid gap-2",`grid-cols-${o.limit}`])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.count,i=>(e.openBlock(),e.createElementBlock("input",{type:o.inputType,value:s.value?.[i-1]??"",onInput:d=>l(d,i-1),placeholder:o.placeholder,disabled:o.disabled,class:e.normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white",[e.unref(n),{"!border-red-600":o.error}]]),style:{border:"1px solid #CFD9E0"}},null,42,di))),256))],2))}}),wt={VsInputText:_e,VsInputRadio:Pe,"vs-input-text":_e,"vs-input-password":kn,"vs-input-textarea":ut,"vs-input-mask":Qe,"vs-input-number":Je,"vs-input-radio":Pe,"vs-input-select":He,"vs-input-switcher":je,"vs-input-static":Ue,"vs-input-container":ct,"vs-input-date":nt,"vs-input-checkbox":tt,"vs-input-file":at,"vs-input-html":Ue,"vs-input-email":et,"vs-input-datatable":ht,"vs-input-map":mt,"vs-input-file-list":it,"vs-input-tags":ft,"vs-input-slug":gt,"vs-input-key-value":kt,"vs-input-range":yt,"vs-input-color":bt,"vs-input-native-select":He,"vs-input-array":xt},ci=e.defineComponent({__name:"behavior",props:{api:{},set:{},button:{},error:{},value:{}},setup(a){const t=a,n=e.inject("values");async function s(){try{if(!t.api)return;const l=t.api.replace("{{value}}",t.value),o=await fetch(l);if(!o.ok){J.notify({type:"warning",title:"Validation",message:"При спробі завантажити дані виникла помилка."});return}const r=await o.json();if(!t.set||!n)return;for(const[i,d]of Object.entries(t.set))n.value[i]=r.result[d]}catch(l){console.error(t.error,l)}}return(l,o)=>(e.openBlock(),e.createElementBlock("button",{onClick:s,class:"vs-button relative inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border !border-gray-200 hover:text-white bg-white text-blue-500 hover:border-blue-500 hover:bg-blue-500 focus:ring-blue-500 py-1.5 px-5 focus:ring-1 focus:ring-offset-1 ml-0 md:ml-2 mt-2 md:mt-0 py-[8px] md:w-2/4 whitespace-nowrap w-full"},e.toDisplayString(l.button),1))}}),ui={class:"flex flex-col gap-1 w-full"},pi={key:0,class:"text-sm text-gray-500"},_t=e.defineComponent({__name:"vs-compact-form-layout",props:e.mergeModels({item:{default:{}},layout:{default:"default"},style:{default:{}},type:{default:""},error:{type:[String,Boolean]}},{modelValue:{default:null},modelModifiers:{}}),emits:["update:modelValue"],setup(a){const t=a,n=e.useModel(a,"modelValue"),s=e.computed(()=>fn[`${t.layout}`]),l=e.computed(()=>wt?.[`vs-input-${t.item.type}`]),o=e.computed(()=>{const i=e.unref(l);if(!i)return new Set;const d=i.props??i.__vccOpts?.props;if(!d)return new Set;const c=Array.isArray(d)?d:Object.keys(d);return new Set(c)}),r=e.computed(()=>{const i=t.item??{},d=o.value;return d.size?Object.fromEntries(Object.entries(i).filter(([c])=>d.has(c))):{}});return(i,d)=>e.withDirectives((e.openBlock(),e.createBlock(e.resolveDynamicComponent(s.value),{ua:t.item.ua,error:t.error||"",item:i.item,label:t.item.label},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["flex w-full",`${t.item.type}-component`])},[e.createElementVNode("div",ui,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.value),e.mergeProps(r.value,{modelValue:n.value,"onUpdate:modelValue":d[0]||(d[0]=c=>n.value=c)}),null,16,["modelValue"])),i.item.description&&t.layout!=="settings"?(e.openBlock(),e.createElementBlock("p",pi,e.toDisplayString(i.item.description),1)):e.createCommentVNode("",!0)]),i.item.behavior?.api&&i.item.behavior?.button?(e.openBlock(),e.createBlock(ci,e.mergeProps({key:0},i.item.behavior,{value:n.value}),null,16,["value"])):e.createCommentVNode("",!0)],2)]),_:1},8,["ua","error","item","label"])),[[e.vShow,!i.item.hidden]])}}),hi={class:"text-sm text-gray-800 ml-[10px] mb-[4px] font-medium dark:text-neutral-300"},mi=["onClick"],fi=e.defineComponent({__name:"vs-compact-form-navigation",props:{target:{},scrollContainer:{},title:{default:"Навігація по формі"},enabled:{type:Boolean,default:!0},width:{default:400}},setup(a,{expose:t}){const n=a,s=e.ref([]),l=e.ref(""),o=e.ref(""),r=e.computed(()=>!!n.enabled),i=e.computed(()=>["flex flex-col border-l pl-[6px] pt-[8px] pr-[8px]","sticky top-0 self-start shrink-0","max-h-full min-h-0 overflow-y-auto"]),d=e.computed(()=>{const B=n.width;if(B==null)return{};const P=typeof B=="number"?`${B}px`:`${B}`;return{width:P,minWidth:P}});let c=null,u=0,p=0,h=null,E=null,F=null;const $=()=>Y(),A=()=>D();e.watch(()=>n.target,async B=>{if(x(),!B){h=null,s.value=[],l.value="";return}h=B,r.value&&(await e.nextTick(),g(B),D())},{immediate:!0}),e.watch(()=>n.scrollContainer,B=>{if(!r.value){E=B??null;return}V(B??null),e.nextTick(()=>D())},{immediate:!0}),e.onMounted(()=>{n.scrollContainer||V(null),D()}),e.onBeforeUnmount(()=>{x(),V(null,!0),h=null,typeof window<"u"&&(u&&window.cancelAnimationFrame(u),p&&window.cancelAnimationFrame(p))});function V(B,P=!1){if(F&&(F(),F=null),P){E=null;return}if(E=B??null,typeof window>"u")return;const q=B??window,G=window;q.addEventListener("scroll",$,{passive:!0}),G.addEventListener("resize",A),F=()=>{q.removeEventListener("scroll",$),G.removeEventListener("resize",A)}}function D(){if(!r.value||!h)return;u&&typeof window<"u"&&window.cancelAnimationFrame(u);const B=()=>{_(),u=0};typeof window>"u"?B():u=window.requestAnimationFrame(B)}function _(){if(!r.value||!h)return;const B=Array.from(h.querySelectorAll("h1, h2")),P=new Set,q=[];B.forEach((G,M)=>{const S=G.textContent?.trim()??"";if(!S)return;let v=(G.getAttribute("id")??"").trim();v||(v=m(S)||`heading-${M+1}`);let R=v,Z=1;for(;P.has(R);)R=`${v}-${Z++}`;G.id!==R&&(G.id=R),P.add(R),q.push({id:R,text:S,level:G.tagName.toLowerCase()==="h1"?1:2})}),s.value=q,q.length||(l.value=""),z()}function m(B){return B.toLowerCase().replace(/[^a-z0-9\s-]/g,"").trim().replace(/\s+/g,"-")}function g(B){!B||!r.value||typeof MutationObserver>"u"||(x(),c=new MutationObserver(()=>D()),c.observe(B,{childList:!0,subtree:!0}))}function x(){c&&(c.disconnect(),c=null)}function w(B){const P=E;if(!P)return typeof window>"u"?B.offsetTop:B.getBoundingClientRect().top+window.scrollY;const q=B.getBoundingClientRect(),G=P.getBoundingClientRect();return q.top-G.top+P.scrollTop}function z(){if(!r.value||!s.value.length)return;const B=E,P=B?B.scrollTop:typeof window<"u"?window.scrollY:0,q=B?B.clientHeight:typeof window<"u"?window.innerHeight:0,G=P+q;let M=null;for(const v of s.value){const R=document.getElementById(v.id);if(!R)continue;const Z=w(R);Z+R.offsetHeight>P&&Z<G&&(M=v.id)}!M&&o.value&&(M=o.value),M&&(o.value=M);const S=B?B.scrollHeight-B.clientHeight:document.documentElement.scrollHeight-window.innerHeight;P+5>=S&&(M=s.value[s.value.length-1].id),M&&(l.value=M)}function Y(){r.value&&(p&&window.cancelAnimationFrame(p),p=window.requestAnimationFrame(()=>{z(),p=0}))}function X(B){if(!r.value)return;const P=document.getElementById(B);if(!P)return;const q=E,G=Math.max(0,w(P));q?q.scrollTo({top:G,behavior:"smooth"}):typeof window<"u"&&window.scrollTo({top:G,behavior:"smooth"})}return t({refresh:D}),(B,P)=>r.value&&s.value.length?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(i.value),style:e.normalizeStyle(d.value)},[e.createElementVNode("h2",hi,e.toDisplayString(B.title),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,q=>(e.openBlock(),e.createElementBlock("button",{key:q.id,type:"button",onClick:G=>X(q.id),class:e.normalizeClass(["flex gap-x-3 py-[6px] px-3 text-sm relative duration-200 hover:text-gray-800",q.level===2?"ml-[14px]":"ml-0",q.id===l.value?"text-gray-800 after:content-[''] after:absolute after:left-[-7px] after:w-[2px] after:h-[20px] after:bg-blue-600":"text-gray-500"])},[e.createElementVNode("span",null,e.toDisplayString(q.text),1)],10,mi))),128))],6)):e.createCommentVNode("",!0)}}),Et={required:"Це поле є обов’язковим",email:"Неправильний email"},gi=a=>a?!1:Et.required,ki=a=>{const t=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;return a?t.test(a)?!1:Et.email:!1},bi=(a,t)=>{const n=t.pattern??t.regexp;return!(typeof n=="string"?new RegExp(n):n).test(a)&&a?t.message:!1},yi=(a,t)=>!1,xi=(a,t)=>{switch(typeof t=="string"?t:t.type){case"required":return gi(a);case"email":return ki(a);case"regexp":return bi(a,t);case"custom":return yi();default:return!1}},wi={autocomplete:"select",combobox:"select",datepicker:"date",markedtext:"mask",html:"static",geom:"map",filelist:"file-list",datalist:"datatable",file:"file",dropzone:"file"};function Vt(a){const t=a.toLowerCase();return wi[t]||t}function _i(a,t=!1){if(Array.isArray(a)){const s=[];return a.forEach(l=>{const o={...l};o.name=(l.name||l.id||l.key||"").toString(),o.type=Vt(l.type),o.label=l.label||l.ua,o.rules=l.rules||l.validators,o.type==="email"&&!o.rules&&(o.rules=["email"]),l.data&&(o.api=`/api/suggest/${l.data}`),o.disabled=t||o.disabled,s.push(o)}),s}const n=[];return Object.entries(a).forEach(s=>{const l={name:s[0],...s[1],type:Vt(s[1].type),label:s[1].label||s[1].ua,rules:s[1].rules||s[1].validators,disabled:t};l.type==="email"&&!l.rules&&(l.rules=["email"]),s[1].type.includes("list")&&(l.multiple=!0),!l.api&&s[1].data&&(l.api=`/api/suggest/${s[1].data}`),n.push(l)}),n}function Ei(a,t,n=!1){const s=e.computed(()=>_i((Array.isArray(t),t),typeof n=="boolean"?n:n.value)),l=e.ref({});function o(c){const u=c?.conditions;if(!u)return!0;const p=Array.isArray(u)?u[0]:u,h=a?.value?.[p];return dt(h,u)}const r=(c=s.value,u=!0)=>(c.forEach(p=>{if(p.rules){if(!o(p)){delete l.value[p.name];return}let h=!1,E=null;p.rules.forEach(F=>{const $=xi(a.value[p.name],F);$&&(h=!0,!E&&typeof $=="string"&&(E=$))}),h&&E?l.value[p.name]=E:delete l.value[p.name]}p.schema&&r(p.schema,!1)}),u&&Object.values(l.value).some(Boolean)?l.value:null),i=e.computed(()=>s.value?.filter(c=>o(c)));return{errors:l,validate:r,reset:()=>{a.value={},l.value={}},visibleSchema:i}}const Vi={class:"flex w-full h-full min-h-0 gap-6"},Ci={key:0,"data-orientation":"horizontal",role:"none",class:"mt-1 shrink-0 h-[1px] w-full bg-slate-100 dark:bg-slate-600"},fe=e.defineComponent({__name:"vs-compact-form",props:e.mergeModels({schema:{default:()=>[]},style:{default:()=>({})},modelValue:{},layout:{default:()=>"default"},formId:{default:()=>""},disabled:{type:Boolean,default:!1},navEnabled:{type:Boolean,default:!1},navWidth:{default:400}},{form:{default:()=>({})},formModifiers:{},values:{default:()=>({})},valuesModifiers:{}}),emits:e.mergeModels(["handle-submit","update:modelValue"],["update:form","update:values"]),setup(a,{expose:t,emit:n}){const s=n,l=a,o=e.useModel(a,"form"),r=e.useModel(a,"values"),{errors:i,validate:d,reset:c,visibleSchema:u}=Ei(r,l.schema,e.toRef(l,"disabled")),p=e.ref(null),h=e.ref(null),E=e.computed(()=>l.navEnabled),F=e.computed(()=>l.navWidth),$=()=>{s("update:modelValue",r.value),d(),s("handle-submit",r.value)};t({validate:d,reset:c,errors:i}),e.onMounted(()=>{l.modelValue&&(r.value=l.modelValue),o.value={value:r.value,errors:i.value,reset:c,validate:d,formId:l.formId}});function A(V,D){if(V===D)return!0;if(typeof V!="object"||typeof D!="object"||!V||!D)return!1;const _=Object.keys(V),m=Object.keys(D);return _.length!==m.length?!1:_.every(g=>V[g]===D[g])}return e.provide("form",o),e.provide("values",r),(V,D)=>(e.openBlock(),e.createElementBlock("div",Vi,[e.createElementVNode("div",{class:"flex-1 min-h-0 overflow-y-auto",ref_key:"formScrollContainer",ref:h},[e.createElementVNode("form",{ref_key:"formRef",ref:p,onSubmit:e.withModifiers($,["prevent"]),class:e.normalizeClass(["grid grid-cols-12",V.layout==="default"?"gap-6":"gap-4"])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(u),(_,m)=>(e.openBlock(),e.createElementBlock("div",{key:_.name,class:e.normalizeClass(V.layout==="horizontal"?"col-span-12":`col-span-${_.col||12}`)},[e.createVNode(_t,{style:e.normalizeStyle(V.style),item:_,layout:V.layout,"model-value":r.value[_.name],"onUpdate:modelValue":g=>{const x=r.value[_.name];A(x,g)||(r.value[_.name]=g)},error:e.unref(i)[_.name]},null,8,["style","item","layout","model-value","onUpdate:modelValue","error"]),V.layout==="settings"&&m+1!==e.unref(u).length?(e.openBlock(),e.createElementBlock("div",Ci)):e.createCommentVNode("",!0)],2))),128))],34)],512),e.createVNode(fi,{target:p.value,"scroll-container":h.value,enabled:E.value,width:F.value},null,8,["target","scroll-container","enabled","width"])]))}}),Bi={class:"relative"},vi={class:"w-full h-full fixed top-0 start-0 z-[1000] bg-black bg-opacity-50"},Ni={class:"m-[10px] fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 min-h-0 h-fit max-h-[80vh] overflow-hidden opacity-1 flex flex-col bg-white dark:bg-[#1A1A1A] border dark:border-[#454545] pointer-events-auto shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-xl lg:w-7/12 w-11/12"},Si={class:"py-2.5 px-4 flex justify-between items-center border-0 border-b border-solid border-gray-200 dark:border-b-[#454545]"},Mi={class:"font-medium text-gray-800 dark:text-[#ffffff]"},$i={class:"p-4 mim-h-0 h-full overflow-auto"},Ct=e.defineComponent({__name:"modal-edit",props:{schema:{},defaultValue:{},mode:{},token:{},form:{}},emits:["close","save","edit"],setup(a,{emit:t}){const n=a,s=t,l=e.ref(n.schema),o=e.ref(n.defaultValue?JSON.parse(JSON.stringify(n.defaultValue)):{}),r=e.ref({}),i=e.ref(),d=e.ref(n.mode);async function c(){const p=r.value.validate();if(p){J.notify({type:"warning",title:"Помилка валідації",message:Object.entries(p).map(([h,E])=>`${h}: ${E}`).join(`
3
- `)});return}if(i.value)try{const h=await fetch(`/api/table/${i.value}`,{method:d.value==="add"?"POST":"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(o.value)});if(h.ok)await h.json(),J.notify({type:"success",title:"Успішно",message:`Дані успішно ${d.value==="add"?"збережено":"оновлено"}`}),s("save",o.value);else if(h.status===400){const E=await h.json().catch(()=>({}));J.notify({type:"warning",title:"Помилка валідації",message:E.message||"Некоректні дані (400)"})}else h.status===500?J.notify({type:"error",title:"Серверна помилка",message:"Виникла помилка на сервері (500)"}):J.notify({type:"error",title:"Помилка",message:`Статус: ${h.status}`})}catch(h){J.notify({type:"error",title:"Помилка з’єднання",message:h.message||"Не вдалося виконати запит"})}}function u(){s("close")}return e.onMounted(async()=>{try{if(n.form){const p=await fetch(`/api/template/form/${n.form}`);if(!p.ok){J.notify({type:p.status>=400&&p.status<500?"warning":"error",title:"Error",message:`Error code: ${p.status}`});return}const h=await p.json();l.value=h.schema,i.value=h.token}else if(n.token){i.value=n.token;const p=await fetch(`/api/form/${i.value}`);if(!p.ok){J.notify({type:p.status>=400&&p.status<500?"warning":"error",title:"Error",message:`Error code: ${p.status}`});return}const h=await p.json();l.value=h.schema,h.data?o.value=h.data:d.value="add"}}catch(p){J.notify({type:"error",title:"Error",message:p.message||"Unexpected error"}),console.error(p)}}),(p,h)=>(e.openBlock(),e.createElementBlock("div",Bi,[e.createElementVNode("div",vi,[e.createElementVNode("div",Ni,[e.createElementVNode("div",Si,[e.createElementVNode("h3",Mi,e.toDisplayString(d.value==="add"?"Додати":"Змінити"),1),e.createElementVNode("button",{onClick:u,type:"button",class:"size-8 inline-flex justify-center items-center gap-x-2 rounded-full border border-transparent bg-gray-100 text-gray-800 hover:bg-gray-200 focus:outline-none focus:bg-gray-200 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:hover:bg-neutral-600 dark:text-neutral-400 dark:focus:bg-neutral-600"},h[2]||(h[2]=[e.createElementVNode("span",{class:"sr-only"},"Close",-1),e.createElementVNode("svg",{class:"flex-shrink-0 w-4 h-4",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("path",{d:"M18 6 6 18"}),e.createElementVNode("path",{d:"m6 6 12 12"})],-1)]))]),e.createElementVNode("div",$i,[l.value?(e.openBlock(),e.createBlock(fe,{key:0,schema:l.value,values:o.value,"onUpdate:values":h[0]||(h[0]=E=>o.value=E),form:r.value,"onUpdate:form":h[1]||(h[1]=E=>r.value=E)},null,8,["schema","values","form"])):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:"vs-form__head mr-5 mb-5 mt-3 flex items-center justify-end sticky top-0 left-0 z-[60] bg-white"},[e.createElementVNode("button",{type:"button",onClick:u,class:"vs-button inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border !border-gray-200 hover:text-white bg-white text-red-500 hover:border-red-500 hover:bg-red-500 focus:ring-red-500 py-1.5 px-5 focus:ring-1 focus:ring-offset-1 mr-2"}," Скасувати "),e.createElementVNode("button",{onClick:c,type:"button",class:"vs-button inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border-1 border-transparent text-white bg-blue-500 hover:bg-blue-600 focus:ring-blue-500 py-1.5 px-5 focus:ring-1 focus:ring-offset-1"}," Зберегти ")])])])]))}}),Bt=(a={mode:"edit",schema:null})=>new Promise(t=>{const{close:n}=J.modal({title:a.mode==="add"?"Додати":"Редагувати",template:"",visible:!0,size:"medium",closeClickBack:!0,content:Ct,contentProps:{...a,onClose:()=>{t(null),n()},onSave:s=>{t(s),n()}}})});fe.install=function(t){t.component("VForm",fe),Object.assign(t.config.globalProperties,{$form:Bt}),t.provide("form",Bt),window.v3plugin||(window.v3plugin={})};function he(a){return typeof a=="string"||a instanceof String}function vt(a){var t;return typeof a=="object"&&a!=null&&(a==null||(t=a.constructor)==null?void 0:t.name)==="Object"}function Nt(a,t){return Array.isArray(t)?Nt(a,(n,s)=>t.includes(s)):Object.entries(a).reduce((n,s)=>{let[l,o]=s;return t(o,l)&&(n[l]=o),n},{})}const N={NONE:"NONE",LEFT:"LEFT",FORCE_LEFT:"FORCE_LEFT",RIGHT:"RIGHT",FORCE_RIGHT:"FORCE_RIGHT"};function St(a){switch(a){case N.LEFT:return N.FORCE_LEFT;case N.RIGHT:return N.FORCE_RIGHT;default:return a}}function qe(a){return a.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")}function Ie(a,t){if(t===a)return!0;const n=Array.isArray(t),s=Array.isArray(a);let l;if(n&&s){if(t.length!=a.length)return!1;for(l=0;l<t.length;l++)if(!Ie(t[l],a[l]))return!1;return!0}if(n!=s)return!1;if(t&&a&&typeof t=="object"&&typeof a=="object"){const o=t instanceof Date,r=a instanceof Date;if(o&&r)return t.getTime()==a.getTime();if(o!=r)return!1;const i=t instanceof RegExp,d=a instanceof RegExp;if(i&&d)return t.toString()==a.toString();if(i!=d)return!1;const c=Object.keys(t);for(l=0;l<c.length;l++)if(!Object.prototype.hasOwnProperty.call(a,c[l]))return!1;for(l=0;l<c.length;l++)if(!Ie(a[c[l]],t[c[l]]))return!1;return!0}else if(t&&a&&typeof t=="function"&&typeof a=="function")return t.toString()===a.toString();return!1}class Fi{constructor(t){for(Object.assign(this,t);this.value.slice(0,this.startChangePos)!==this.oldValue.slice(0,this.startChangePos);)--this.oldSelection.start;if(this.insertedCount)for(;this.value.slice(this.cursorPos)!==this.oldValue.slice(this.oldSelection.end);)this.value.length-this.cursorPos<this.oldValue.length-this.oldSelection.end?++this.oldSelection.end:++this.cursorPos}get startChangePos(){return Math.min(this.cursorPos,this.oldSelection.start)}get insertedCount(){return this.cursorPos-this.startChangePos}get inserted(){return this.value.substr(this.startChangePos,this.insertedCount)}get removedCount(){return Math.max(this.oldSelection.end-this.startChangePos||this.oldValue.length-this.value.length,0)}get removed(){return this.oldValue.substr(this.startChangePos,this.removedCount)}get head(){return this.value.substring(0,this.startChangePos)}get tail(){return this.value.substring(this.startChangePos+this.insertedCount)}get removeDirection(){return!this.removedCount||this.insertedCount?N.NONE:(this.oldSelection.end===this.cursorPos||this.oldSelection.start===this.cursorPos)&&this.oldSelection.end===this.oldSelection.start?N.RIGHT:N.LEFT}}function I(a,t){return new I.InputMask(a,t)}function Mt(a){if(a==null)throw new Error("mask property should be defined");return a instanceof RegExp?I.MaskedRegExp:he(a)?I.MaskedPattern:a===Date?I.MaskedDate:a===Number?I.MaskedNumber:Array.isArray(a)||a===Array?I.MaskedDynamic:I.Masked&&a.prototype instanceof I.Masked?a:I.Masked&&a instanceof I.Masked?a.constructor:a instanceof Function?I.MaskedFunction:(console.warn("Mask not found for mask",a),I.Masked)}function xe(a){if(!a)throw new Error("Options in not defined");if(I.Masked){if(a.prototype instanceof I.Masked)return{mask:a};const{mask:t=void 0,...n}=a instanceof I.Masked?{mask:a}:vt(a)&&a.mask instanceof I.Masked?a:{};if(t){const s=t.mask;return{...Nt(t,(l,o)=>!o.startsWith("_")),mask:t.constructor,_mask:s,...n}}}return vt(a)?{...a}:{mask:a}}function ae(a){if(I.Masked&&a instanceof I.Masked)return a;const t=xe(a),n=Mt(t.mask);if(!n)throw new Error("Masked class is not found for provided mask "+t.mask+", appropriate module needs to be imported manually before creating mask.");return t.mask===n&&delete t.mask,t._mask&&(t.mask=t._mask,delete t._mask),new n(t)}I.createMask=ae;class Le{get selectionStart(){let t;try{t=this._unsafeSelectionStart}catch{}return t??this.value.length}get selectionEnd(){let t;try{t=this._unsafeSelectionEnd}catch{}return t??this.value.length}select(t,n){if(!(t==null||n==null||t===this.selectionStart&&n===this.selectionEnd))try{this._unsafeSelect(t,n)}catch{}}get isActive(){return!1}}I.MaskElement=Le;const $t=90,Ai=89;class Ce extends Le{constructor(t){super(),this.input=t,this._onKeydown=this._onKeydown.bind(this),this._onInput=this._onInput.bind(this),this._onBeforeinput=this._onBeforeinput.bind(this),this._onCompositionEnd=this._onCompositionEnd.bind(this)}get rootElement(){var t,n,s;return(t=(n=(s=this.input).getRootNode)==null?void 0:n.call(s))!=null?t:document}get isActive(){return this.input===this.rootElement.activeElement}bindEvents(t){this.input.addEventListener("keydown",this._onKeydown),this.input.addEventListener("input",this._onInput),this.input.addEventListener("beforeinput",this._onBeforeinput),this.input.addEventListener("compositionend",this._onCompositionEnd),this.input.addEventListener("drop",t.drop),this.input.addEventListener("click",t.click),this.input.addEventListener("focus",t.focus),this.input.addEventListener("blur",t.commit),this._handlers=t}_onKeydown(t){if(this._handlers.redo&&(t.keyCode===$t&&t.shiftKey&&(t.metaKey||t.ctrlKey)||t.keyCode===Ai&&t.ctrlKey))return t.preventDefault(),this._handlers.redo(t);if(this._handlers.undo&&t.keyCode===$t&&(t.metaKey||t.ctrlKey))return t.preventDefault(),this._handlers.undo(t);t.isComposing||this._handlers.selectionChange(t)}_onBeforeinput(t){if(t.inputType==="historyUndo"&&this._handlers.undo)return t.preventDefault(),this._handlers.undo(t);if(t.inputType==="historyRedo"&&this._handlers.redo)return t.preventDefault(),this._handlers.redo(t)}_onCompositionEnd(t){this._handlers.input(t)}_onInput(t){t.isComposing||this._handlers.input(t)}unbindEvents(){this.input.removeEventListener("keydown",this._onKeydown),this.input.removeEventListener("input",this._onInput),this.input.removeEventListener("beforeinput",this._onBeforeinput),this.input.removeEventListener("compositionend",this._onCompositionEnd),this.input.removeEventListener("drop",this._handlers.drop),this.input.removeEventListener("click",this._handlers.click),this.input.removeEventListener("focus",this._handlers.focus),this.input.removeEventListener("blur",this._handlers.commit),this._handlers={}}}I.HTMLMaskElement=Ce;class Ft extends Ce{constructor(t){super(t),this.input=t}get _unsafeSelectionStart(){return this.input.selectionStart!=null?this.input.selectionStart:this.value.length}get _unsafeSelectionEnd(){return this.input.selectionEnd}_unsafeSelect(t,n){this.input.setSelectionRange(t,n)}get value(){return this.input.value}set value(t){this.input.value=t}}I.HTMLMaskElement=Ce;class Ge extends Ce{get _unsafeSelectionStart(){const t=this.rootElement,n=t.getSelection&&t.getSelection(),s=n&&n.anchorOffset,l=n&&n.focusOffset;return l==null||s==null||s<l?s:l}get _unsafeSelectionEnd(){const t=this.rootElement,n=t.getSelection&&t.getSelection(),s=n&&n.anchorOffset,l=n&&n.focusOffset;return l==null||s==null||s>l?s:l}_unsafeSelect(t,n){if(!this.rootElement.createRange)return;const s=this.rootElement.createRange();s.setStart(this.input.firstChild||this.input,t),s.setEnd(this.input.lastChild||this.input,n);const l=this.rootElement,o=l.getSelection&&l.getSelection();o&&(o.removeAllRanges(),o.addRange(s))}get value(){return this.input.textContent||""}set value(t){this.input.textContent=t}}I.HTMLContenteditableMaskElement=Ge;class Te{constructor(){this.states=[],this.currentIndex=0}get currentState(){return this.states[this.currentIndex]}get isEmpty(){return this.states.length===0}push(t){this.currentIndex<this.states.length-1&&(this.states.length=this.currentIndex+1),this.states.push(t),this.states.length>Te.MAX_LENGTH&&this.states.shift(),this.currentIndex=this.states.length-1}go(t){return this.currentIndex=Math.min(Math.max(this.currentIndex+t,0),this.states.length-1),this.currentState}undo(){return this.go(-1)}redo(){return this.go(1)}clear(){this.states.length=0,this.currentIndex=0}}Te.MAX_LENGTH=100;class At{constructor(t,n){this.el=t instanceof Le?t:t.isContentEditable&&t.tagName!=="INPUT"&&t.tagName!=="TEXTAREA"?new Ge(t):new Ft(t),this.masked=ae(n),this._listeners={},this._value="",this._unmaskedValue="",this._rawInputValue="",this.history=new Te,this._saveSelection=this._saveSelection.bind(this),this._onInput=this._onInput.bind(this),this._onChange=this._onChange.bind(this),this._onDrop=this._onDrop.bind(this),this._onFocus=this._onFocus.bind(this),this._onClick=this._onClick.bind(this),this._onUndo=this._onUndo.bind(this),this._onRedo=this._onRedo.bind(this),this.alignCursor=this.alignCursor.bind(this),this.alignCursorFriendly=this.alignCursorFriendly.bind(this),this._bindEvents(),this.updateValue(),this._onChange()}maskEquals(t){var n;return t==null||((n=this.masked)==null?void 0:n.maskEquals(t))}get mask(){return this.masked.mask}set mask(t){if(this.maskEquals(t))return;if(!(t instanceof I.Masked)&&this.masked.constructor===Mt(t)){this.masked.updateOptions({mask:t});return}const n=t instanceof I.Masked?t:ae({mask:t});n.unmaskedValue=this.masked.unmaskedValue,this.masked=n}get value(){return this._value}set value(t){this.value!==t&&(this.masked.value=t,this.updateControl("auto"))}get unmaskedValue(){return this._unmaskedValue}set unmaskedValue(t){this.unmaskedValue!==t&&(this.masked.unmaskedValue=t,this.updateControl("auto"))}get rawInputValue(){return this._rawInputValue}set rawInputValue(t){this.rawInputValue!==t&&(this.masked.rawInputValue=t,this.updateControl(),this.alignCursor())}get typedValue(){return this.masked.typedValue}set typedValue(t){this.masked.typedValueEquals(t)||(this.masked.typedValue=t,this.updateControl("auto"))}get displayValue(){return this.masked.displayValue}_bindEvents(){this.el.bindEvents({selectionChange:this._saveSelection,input:this._onInput,drop:this._onDrop,click:this._onClick,focus:this._onFocus,commit:this._onChange,undo:this._onUndo,redo:this._onRedo})}_unbindEvents(){this.el&&this.el.unbindEvents()}_fireEvent(t,n){const s=this._listeners[t];s&&s.forEach(l=>l(n))}get selectionStart(){return this._cursorChanging?this._changingCursorPos:this.el.selectionStart}get cursorPos(){return this._cursorChanging?this._changingCursorPos:this.el.selectionEnd}set cursorPos(t){!this.el||!this.el.isActive||(this.el.select(t,t),this._saveSelection())}_saveSelection(){this.displayValue!==this.el.value&&console.warn("Element value was changed outside of mask. Syncronize mask using `mask.updateValue()` to work properly."),this._selection={start:this.selectionStart,end:this.cursorPos}}updateValue(){this.masked.value=this.el.value,this._value=this.masked.value,this._unmaskedValue=this.masked.unmaskedValue,this._rawInputValue=this.masked.rawInputValue}updateControl(t){const n=this.masked.unmaskedValue,s=this.masked.value,l=this.masked.rawInputValue,o=this.displayValue,r=this.unmaskedValue!==n||this.value!==s||this._rawInputValue!==l;this._unmaskedValue=n,this._value=s,this._rawInputValue=l,this.el.value!==o&&(this.el.value=o),t==="auto"?this.alignCursor():t!=null&&(this.cursorPos=t),r&&this._fireChangeEvents(),!this._historyChanging&&(r||this.history.isEmpty)&&this.history.push({unmaskedValue:n,selection:{start:this.selectionStart,end:this.cursorPos}})}updateOptions(t){const{mask:n,...s}=t,l=!this.maskEquals(n),o=this.masked.optionsIsChanged(s);l&&(this.mask=n),o&&this.masked.updateOptions(s),(l||o)&&this.updateControl()}updateCursor(t){t!=null&&(this.cursorPos=t,this._delayUpdateCursor(t))}_delayUpdateCursor(t){this._abortUpdateCursor(),this._changingCursorPos=t,this._cursorChanging=setTimeout(()=>{this.el&&(this.cursorPos=this._changingCursorPos,this._abortUpdateCursor())},10)}_fireChangeEvents(){this._fireEvent("accept",this._inputEvent),this.masked.isComplete&&this._fireEvent("complete",this._inputEvent)}_abortUpdateCursor(){this._cursorChanging&&(clearTimeout(this._cursorChanging),delete this._cursorChanging)}alignCursor(){this.cursorPos=this.masked.nearestInputPos(this.masked.nearestInputPos(this.cursorPos,N.LEFT))}alignCursorFriendly(){this.selectionStart===this.cursorPos&&this.alignCursor()}on(t,n){return this._listeners[t]||(this._listeners[t]=[]),this._listeners[t].push(n),this}off(t,n){if(!this._listeners[t])return this;if(!n)return delete this._listeners[t],this;const s=this._listeners[t].indexOf(n);return s>=0&&this._listeners[t].splice(s,1),this}_onInput(t){this._inputEvent=t,this._abortUpdateCursor();const n=new Fi({value:this.el.value,cursorPos:this.cursorPos,oldValue:this.displayValue,oldSelection:this._selection}),s=this.masked.rawInputValue,l=this.masked.splice(n.startChangePos,n.removed.length,n.inserted,n.removeDirection,{input:!0,raw:!0}).offset,o=s===this.masked.rawInputValue?n.removeDirection:N.NONE;let r=this.masked.nearestInputPos(n.startChangePos+l,o);o!==N.NONE&&(r=this.masked.nearestInputPos(r,N.NONE)),this.updateControl(r),delete this._inputEvent}_onChange(){this.displayValue!==this.el.value&&this.updateValue(),this.masked.doCommit(),this.updateControl(),this._saveSelection()}_onDrop(t){t.preventDefault(),t.stopPropagation()}_onFocus(t){this.alignCursorFriendly()}_onClick(t){this.alignCursorFriendly()}_onUndo(){this._applyHistoryState(this.history.undo())}_onRedo(){this._applyHistoryState(this.history.redo())}_applyHistoryState(t){t&&(this._historyChanging=!0,this.unmaskedValue=t.unmaskedValue,this.el.select(t.selection.start,t.selection.end),this._saveSelection(),this._historyChanging=!1)}destroy(){this._unbindEvents(),this._listeners.length=0,delete this.el}}I.InputMask=At;class O{static normalize(t){return Array.isArray(t)?t:[t,new O]}constructor(t){Object.assign(this,{inserted:"",rawInserted:"",tailShift:0,skip:!1},t)}aggregate(t){return this.inserted+=t.inserted,this.rawInserted+=t.rawInserted,this.tailShift+=t.tailShift,this.skip=this.skip||t.skip,this}get offset(){return this.tailShift+this.inserted.length}get consumed(){return!!this.rawInserted||this.skip}equals(t){return this.inserted===t.inserted&&this.tailShift===t.tailShift&&this.rawInserted===t.rawInserted&&this.skip===t.skip}}I.ChangeDetails=O;class ie{constructor(t,n,s){t===void 0&&(t=""),n===void 0&&(n=0),this.value=t,this.from=n,this.stop=s}toString(){return this.value}extend(t){this.value+=String(t)}appendTo(t){return t.append(this.toString(),{tail:!0}).aggregate(t._appendPlaceholder())}get state(){return{value:this.value,from:this.from,stop:this.stop}}set state(t){Object.assign(this,t)}unshift(t){if(!this.value.length||t!=null&&this.from>=t)return"";const n=this.value[0];return this.value=this.value.slice(1),n}shift(){if(!this.value.length)return"";const t=this.value[this.value.length-1];return this.value=this.value.slice(0,-1),t}}class Q{constructor(t){this._value="",this._update({...Q.DEFAULTS,...t}),this._initialized=!0}updateOptions(t){this.optionsIsChanged(t)&&this.withValueRefresh(this._update.bind(this,t))}_update(t){Object.assign(this,t)}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue}}set state(t){this._value=t._value}reset(){this._value=""}get value(){return this._value}set value(t){this.resolve(t,{input:!0})}resolve(t,n){n===void 0&&(n={input:!0}),this.reset(),this.append(t,n,""),this.doCommit()}get unmaskedValue(){return this.value}set unmaskedValue(t){this.resolve(t,{})}get typedValue(){return this.parse?this.parse(this.value,this):this.unmaskedValue}set typedValue(t){this.format?this.value=this.format(t,this):this.unmaskedValue=String(t)}get rawInputValue(){return this.extractInput(0,this.displayValue.length,{raw:!0})}set rawInputValue(t){this.resolve(t,{raw:!0})}get displayValue(){return this.value}get isComplete(){return!0}get isFilled(){return this.isComplete}nearestInputPos(t,n){return t}totalInputPositions(t,n){return t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length),Math.min(this.displayValue.length,n-t)}extractInput(t,n,s){return t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length),this.displayValue.slice(t,n)}extractTail(t,n){return t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length),new ie(this.extractInput(t,n),t)}appendTail(t){return he(t)&&(t=new ie(String(t))),t.appendTo(this)}_appendCharRaw(t,n){return t?(this._value+=t,new O({inserted:t,rawInserted:t})):new O}_appendChar(t,n,s){n===void 0&&(n={});const l=this.state;let o;if([t,o]=this.doPrepareChar(t,n),t&&(o=o.aggregate(this._appendCharRaw(t,n)),!o.rawInserted&&this.autofix==="pad")){const r=this.state;this.state=l;let i=this.pad(n);const d=this._appendCharRaw(t,n);i=i.aggregate(d),d.rawInserted||i.equals(o)?o=i:this.state=r}if(o.inserted){let r,i=this.doValidate(n)!==!1;if(i&&s!=null){const d=this.state;if(this.overwrite===!0){r=s.state;for(let u=0;u<o.rawInserted.length;++u)s.unshift(this.displayValue.length-o.tailShift)}let c=this.appendTail(s);if(i=c.rawInserted.length===s.toString().length,!(i&&c.inserted)&&this.overwrite==="shift"){this.state=d,r=s.state;for(let u=0;u<o.rawInserted.length;++u)s.shift();c=this.appendTail(s),i=c.rawInserted.length===s.toString().length}i&&c.inserted&&(this.state=d)}i||(o=new O,this.state=l,s&&r&&(s.state=r))}return o}_appendPlaceholder(){return new O}_appendEager(){return new O}append(t,n,s){if(!he(t))throw new Error("value should be string");const l=he(s)?new ie(String(s)):s;n!=null&&n.tail&&(n._beforeTailState=this.state);let o;[t,o]=this.doPrepare(t,n);for(let r=0;r<t.length;++r){const i=this._appendChar(t[r],n,l);if(!i.rawInserted&&!this.doSkipInvalid(t[r],n,l))break;o.aggregate(i)}return(this.eager===!0||this.eager==="append")&&n!=null&&n.input&&t&&o.aggregate(this._appendEager()),l!=null&&(o.tailShift+=this.appendTail(l).tailShift),o}remove(t,n){return t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length),this._value=this.displayValue.slice(0,t)+this.displayValue.slice(n),new O}withValueRefresh(t){if(this._refreshing||!this._initialized)return t();this._refreshing=!0;const n=this.rawInputValue,s=this.value,l=t();return this.rawInputValue=n,this.value&&this.value!==s&&s.indexOf(this.value)===0&&(this.append(s.slice(this.displayValue.length),{},""),this.doCommit()),delete this._refreshing,l}runIsolated(t){if(this._isolated||!this._initialized)return t(this);this._isolated=!0;const n=this.state,s=t(this);return this.state=n,delete this._isolated,s}doSkipInvalid(t,n,s){return!!this.skipInvalid}doPrepare(t,n){return n===void 0&&(n={}),O.normalize(this.prepare?this.prepare(t,this,n):t)}doPrepareChar(t,n){return n===void 0&&(n={}),O.normalize(this.prepareChar?this.prepareChar(t,this,n):t)}doValidate(t){return(!this.validate||this.validate(this.value,this,t))&&(!this.parent||this.parent.doValidate(t))}doCommit(){this.commit&&this.commit(this.value,this)}splice(t,n,s,l,o){s===void 0&&(s=""),l===void 0&&(l=N.NONE),o===void 0&&(o={input:!0});const r=t+n,i=this.extractTail(r),d=this.eager===!0||this.eager==="remove";let c;d&&(l=St(l),c=this.extractInput(0,r,{raw:!0}));let u=t;const p=new O;if(l!==N.NONE&&(u=this.nearestInputPos(t,n>1&&t!==0&&!d?N.NONE:l),p.tailShift=u-t),p.aggregate(this.remove(u)),d&&l!==N.NONE&&c===this.rawInputValue)if(l===N.FORCE_LEFT){let h;for(;c===this.rawInputValue&&(h=this.displayValue.length);)p.aggregate(new O({tailShift:-1})).aggregate(this.remove(h-1))}else l===N.FORCE_RIGHT&&i.unshift();return p.aggregate(this.append(s,o,i))}maskEquals(t){return this.mask===t}optionsIsChanged(t){return!Ie(this,t)}typedValueEquals(t){const n=this.typedValue;return t===n||Q.EMPTY_VALUES.includes(t)&&Q.EMPTY_VALUES.includes(n)||(this.format?this.format(t,this)===this.format(this.typedValue,this):!1)}pad(t){return new O}}Q.DEFAULTS={skipInvalid:!0},Q.EMPTY_VALUES=[void 0,null,""],I.Masked=Q;class me{constructor(t,n){t===void 0&&(t=[]),n===void 0&&(n=0),this.chunks=t,this.from=n}toString(){return this.chunks.map(String).join("")}extend(t){if(!String(t))return;t=he(t)?new ie(String(t)):t;const n=this.chunks[this.chunks.length-1],s=n&&(n.stop===t.stop||t.stop==null)&&t.from===n.from+n.toString().length;if(t instanceof ie)s?n.extend(t.toString()):this.chunks.push(t);else if(t instanceof me){if(t.stop==null){let l;for(;t.chunks.length&&t.chunks[0].stop==null;)l=t.chunks.shift(),l.from+=t.from,this.extend(l)}t.toString()&&(t.stop=t.blockIndex,this.chunks.push(t))}}appendTo(t){if(!(t instanceof I.MaskedPattern))return new ie(this.toString()).appendTo(t);const n=new O;for(let s=0;s<this.chunks.length;++s){const l=this.chunks[s],o=t._mapPosToBlock(t.displayValue.length),r=l.stop;let i;if(r!=null&&(!o||o.index<=r)&&((l instanceof me||t._stops.indexOf(r)>=0)&&n.aggregate(t._appendPlaceholder(r)),i=l instanceof me&&t._blocks[r]),i){const d=i.appendTail(l);n.aggregate(d);const c=l.toString().slice(d.rawInserted.length);c&&n.aggregate(t.append(c,{tail:!0}))}else n.aggregate(t.append(l.toString(),{tail:!0}))}return n}get state(){return{chunks:this.chunks.map(t=>t.state),from:this.from,stop:this.stop,blockIndex:this.blockIndex}}set state(t){const{chunks:n,...s}=t;Object.assign(this,s),this.chunks=n.map(l=>{const o="chunks"in l?new me:new ie;return o.state=l,o})}unshift(t){if(!this.chunks.length||t!=null&&this.from>=t)return"";const n=t!=null?t-this.from:t;let s=0;for(;s<this.chunks.length;){const l=this.chunks[s],o=l.unshift(n);if(l.toString()){if(!o)break;++s}else this.chunks.splice(s,1);if(o)return o}return""}shift(){if(!this.chunks.length)return"";let t=this.chunks.length-1;for(;0<=t;){const n=this.chunks[t],s=n.shift();if(n.toString()){if(!s)break;--t}else this.chunks.splice(t,1);if(s)return s}return""}}class Di{constructor(t,n){this.masked=t,this._log=[];const{offset:s,index:l}=t._mapPosToBlock(n)||(n<0?{index:0,offset:0}:{index:this.masked._blocks.length,offset:0});this.offset=s,this.index=l,this.ok=!1}get block(){return this.masked._blocks[this.index]}get pos(){return this.masked._blockStartPos(this.index)+this.offset}get state(){return{index:this.index,offset:this.offset,ok:this.ok}}set state(t){Object.assign(this,t)}pushState(){this._log.push(this.state)}popState(){const t=this._log.pop();return t&&(this.state=t),t}bindBlock(){this.block||(this.index<0&&(this.index=0,this.offset=0),this.index>=this.masked._blocks.length&&(this.index=this.masked._blocks.length-1,this.offset=this.block.displayValue.length))}_pushLeft(t){for(this.pushState(),this.bindBlock();0<=this.index;--this.index,this.offset=((n=this.block)==null?void 0:n.displayValue.length)||0){var n;if(t())return this.ok=!0}return this.ok=!1}_pushRight(t){for(this.pushState(),this.bindBlock();this.index<this.masked._blocks.length;++this.index,this.offset=0)if(t())return this.ok=!0;return this.ok=!1}pushLeftBeforeFilled(){return this._pushLeft(()=>{if(!(this.block.isFixed||!this.block.value)&&(this.offset=this.block.nearestInputPos(this.offset,N.FORCE_LEFT),this.offset!==0))return!0})}pushLeftBeforeInput(){return this._pushLeft(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,N.LEFT),!0})}pushLeftBeforeRequired(){return this._pushLeft(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,N.LEFT),!0})}pushRightBeforeFilled(){return this._pushRight(()=>{if(!(this.block.isFixed||!this.block.value)&&(this.offset=this.block.nearestInputPos(this.offset,N.FORCE_RIGHT),this.offset!==this.block.value.length))return!0})}pushRightBeforeInput(){return this._pushRight(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,N.NONE),!0})}pushRightBeforeRequired(){return this._pushRight(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,N.NONE),!0})}}class Ke{constructor(t){Object.assign(this,t),this._value="",this.isFixed=!0}get value(){return this._value}get unmaskedValue(){return this.isUnmasking?this.value:""}get rawInputValue(){return this._isRawInput?this.value:""}get displayValue(){return this.value}reset(){this._isRawInput=!1,this._value=""}remove(t,n){return t===void 0&&(t=0),n===void 0&&(n=this._value.length),this._value=this._value.slice(0,t)+this._value.slice(n),this._value||(this._isRawInput=!1),new O}nearestInputPos(t,n){n===void 0&&(n=N.NONE);const s=0,l=this._value.length;switch(n){case N.LEFT:case N.FORCE_LEFT:return s;case N.NONE:case N.RIGHT:case N.FORCE_RIGHT:default:return l}}totalInputPositions(t,n){return t===void 0&&(t=0),n===void 0&&(n=this._value.length),this._isRawInput?n-t:0}extractInput(t,n,s){return t===void 0&&(t=0),n===void 0&&(n=this._value.length),s===void 0&&(s={}),s.raw&&this._isRawInput&&this._value.slice(t,n)||""}get isComplete(){return!0}get isFilled(){return!!this._value}_appendChar(t,n){if(n===void 0&&(n={}),this.isFilled)return new O;const s=this.eager===!0||this.eager==="append",o=this.char===t&&(this.isUnmasking||n.input||n.raw)&&(!n.raw||!s)&&!n.tail,r=new O({inserted:this.char,rawInserted:o?this.char:""});return this._value=this.char,this._isRawInput=o&&(n.raw||n.input),r}_appendEager(){return this._appendChar(this.char,{tail:!0})}_appendPlaceholder(){const t=new O;return this.isFilled||(this._value=t.inserted=this.char),t}extractTail(){return new ie("")}appendTail(t){return he(t)&&(t=new ie(String(t))),t.appendTo(this)}append(t,n,s){const l=this._appendChar(t[0],n);return s!=null&&(l.tailShift+=this.appendTail(s).tailShift),l}doCommit(){}get state(){return{_value:this._value,_rawInputValue:this.rawInputValue}}set state(t){this._value=t._value,this._isRawInput=!!t._rawInputValue}pad(t){return this._appendPlaceholder()}}class Be{constructor(t){const{parent:n,isOptional:s,placeholderChar:l,displayChar:o,lazy:r,eager:i,...d}=t;this.masked=ae(d),Object.assign(this,{parent:n,isOptional:s,placeholderChar:l,displayChar:o,lazy:r,eager:i})}reset(){this.isFilled=!1,this.masked.reset()}remove(t,n){return t===void 0&&(t=0),n===void 0&&(n=this.value.length),t===0&&n>=1?(this.isFilled=!1,this.masked.remove(t,n)):new O}get value(){return this.masked.value||(this.isFilled&&!this.isOptional?this.placeholderChar:"")}get unmaskedValue(){return this.masked.unmaskedValue}get rawInputValue(){return this.masked.rawInputValue}get displayValue(){return this.masked.value&&this.displayChar||this.value}get isComplete(){return!!this.masked.value||this.isOptional}_appendChar(t,n){if(n===void 0&&(n={}),this.isFilled)return new O;const s=this.masked.state;let l=this.masked._appendChar(t,this.currentMaskFlags(n));return l.inserted&&this.doValidate(n)===!1&&(l=new O,this.masked.state=s),!l.inserted&&!this.isOptional&&!this.lazy&&!n.input&&(l.inserted=this.placeholderChar),l.skip=!l.inserted&&!this.isOptional,this.isFilled=!!l.inserted,l}append(t,n,s){return this.masked.append(t,this.currentMaskFlags(n),s)}_appendPlaceholder(){return this.isFilled||this.isOptional?new O:(this.isFilled=!0,new O({inserted:this.placeholderChar}))}_appendEager(){return new O}extractTail(t,n){return this.masked.extractTail(t,n)}appendTail(t){return this.masked.appendTail(t)}extractInput(t,n,s){return t===void 0&&(t=0),n===void 0&&(n=this.value.length),this.masked.extractInput(t,n,s)}nearestInputPos(t,n){n===void 0&&(n=N.NONE);const s=0,l=this.value.length,o=Math.min(Math.max(t,s),l);switch(n){case N.LEFT:case N.FORCE_LEFT:return this.isComplete?o:s;case N.RIGHT:case N.FORCE_RIGHT:return this.isComplete?o:l;case N.NONE:default:return o}}totalInputPositions(t,n){return t===void 0&&(t=0),n===void 0&&(n=this.value.length),this.value.slice(t,n).length}doValidate(t){return this.masked.doValidate(this.currentMaskFlags(t))&&(!this.parent||this.parent.doValidate(this.currentMaskFlags(t)))}doCommit(){this.masked.doCommit()}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue,masked:this.masked.state,isFilled:this.isFilled}}set state(t){this.masked.state=t.masked,this.isFilled=t.isFilled}currentMaskFlags(t){var n;return{...t,_beforeTailState:(t==null||(n=t._beforeTailState)==null?void 0:n.masked)||t?._beforeTailState}}pad(t){return new O}}Be.DEFAULT_DEFINITIONS={0:/\d/,a:/[\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,"*":/./};class Dt extends Q{updateOptions(t){super.updateOptions(t)}_update(t){const n=t.mask;n&&(t.validate=s=>s.search(n)>=0),super._update(t)}}I.MaskedRegExp=Dt;class ee extends Q{constructor(t){super({...ee.DEFAULTS,...t,definitions:Object.assign({},Be.DEFAULT_DEFINITIONS,t?.definitions)})}updateOptions(t){super.updateOptions(t)}_update(t){t.definitions=Object.assign({},this.definitions,t.definitions),super._update(t),this._rebuildMask()}_rebuildMask(){const t=this.definitions;this._blocks=[],this.exposeBlock=void 0,this._stops=[],this._maskedBlocks={};const n=this.mask;if(!n||!t)return;let s=!1,l=!1;for(let o=0;o<n.length;++o){if(this.blocks){const c=n.slice(o),u=Object.keys(this.blocks).filter(h=>c.indexOf(h)===0);u.sort((h,E)=>E.length-h.length);const p=u[0];if(p){const{expose:h,repeat:E,...F}=xe(this.blocks[p]),$={lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,overwrite:this.overwrite,autofix:this.autofix,...F,repeat:E,parent:this},A=E!=null?new I.RepeatBlock($):ae($);A&&(this._blocks.push(A),h&&(this.exposeBlock=A),this._maskedBlocks[p]||(this._maskedBlocks[p]=[]),this._maskedBlocks[p].push(this._blocks.length-1)),o+=p.length-1;continue}}let r=n[o],i=r in t;if(r===ee.STOP_CHAR){this._stops.push(this._blocks.length);continue}if(r==="{"||r==="}"){s=!s;continue}if(r==="["||r==="]"){l=!l;continue}if(r===ee.ESCAPE_CHAR){if(++o,r=n[o],!r)break;i=!1}const d=i?new Be({isOptional:l,lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,...xe(t[r]),parent:this}):new Ke({char:r,eager:this.eager,isUnmasking:s});this._blocks.push(d)}}get state(){return{...super.state,_blocks:this._blocks.map(t=>t.state)}}set state(t){if(!t){this.reset();return}const{_blocks:n,...s}=t;this._blocks.forEach((l,o)=>l.state=n[o]),super.state=s}reset(){super.reset(),this._blocks.forEach(t=>t.reset())}get isComplete(){return this.exposeBlock?this.exposeBlock.isComplete:this._blocks.every(t=>t.isComplete)}get isFilled(){return this._blocks.every(t=>t.isFilled)}get isFixed(){return this._blocks.every(t=>t.isFixed)}get isOptional(){return this._blocks.every(t=>t.isOptional)}doCommit(){this._blocks.forEach(t=>t.doCommit()),super.doCommit()}get unmaskedValue(){return this.exposeBlock?this.exposeBlock.unmaskedValue:this._blocks.reduce((t,n)=>t+=n.unmaskedValue,"")}set unmaskedValue(t){if(this.exposeBlock){const n=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.unmaskedValue=t,this.appendTail(n),this.doCommit()}else super.unmaskedValue=t}get value(){return this.exposeBlock?this.exposeBlock.value:this._blocks.reduce((t,n)=>t+=n.value,"")}set value(t){if(this.exposeBlock){const n=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.value=t,this.appendTail(n),this.doCommit()}else super.value=t}get typedValue(){return this.exposeBlock?this.exposeBlock.typedValue:super.typedValue}set typedValue(t){if(this.exposeBlock){const n=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.typedValue=t,this.appendTail(n),this.doCommit()}else super.typedValue=t}get displayValue(){return this._blocks.reduce((t,n)=>t+=n.displayValue,"")}appendTail(t){return super.appendTail(t).aggregate(this._appendPlaceholder())}_appendEager(){var t;const n=new O;let s=(t=this._mapPosToBlock(this.displayValue.length))==null?void 0:t.index;if(s==null)return n;this._blocks[s].isFilled&&++s;for(let l=s;l<this._blocks.length;++l){const o=this._blocks[l]._appendEager();if(!o.inserted)break;n.aggregate(o)}return n}_appendCharRaw(t,n){n===void 0&&(n={});const s=this._mapPosToBlock(this.displayValue.length),l=new O;if(!s)return l;for(let r=s.index,i;i=this._blocks[r];++r){var o;const d=i._appendChar(t,{...n,_beforeTailState:(o=n._beforeTailState)==null||(o=o._blocks)==null?void 0:o[r]});if(l.aggregate(d),d.consumed)break}return l}extractTail(t,n){t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length);const s=new me;return t===n||this._forEachBlocksInRange(t,n,(l,o,r,i)=>{const d=l.extractTail(r,i);d.stop=this._findStopBefore(o),d.from=this._blockStartPos(o),d instanceof me&&(d.blockIndex=o),s.extend(d)}),s}extractInput(t,n,s){if(t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length),s===void 0&&(s={}),t===n)return"";let l="";return this._forEachBlocksInRange(t,n,(o,r,i,d)=>{l+=o.extractInput(i,d,s)}),l}_findStopBefore(t){let n;for(let s=0;s<this._stops.length;++s){const l=this._stops[s];if(l<=t)n=l;else break}return n}_appendPlaceholder(t){const n=new O;if(this.lazy&&t==null)return n;const s=this._mapPosToBlock(this.displayValue.length);if(!s)return n;const l=s.index,o=t??this._blocks.length;return this._blocks.slice(l,o).forEach(r=>{if(!r.lazy||t!=null){var i;n.aggregate(r._appendPlaceholder((i=r._blocks)==null?void 0:i.length))}}),n}_mapPosToBlock(t){let n="";for(let s=0;s<this._blocks.length;++s){const l=this._blocks[s],o=n.length;if(n+=l.displayValue,t<=n.length)return{index:s,offset:t-o}}}_blockStartPos(t){return this._blocks.slice(0,t).reduce((n,s)=>n+=s.displayValue.length,0)}_forEachBlocksInRange(t,n,s){n===void 0&&(n=this.displayValue.length);const l=this._mapPosToBlock(t);if(l){const o=this._mapPosToBlock(n),r=o&&l.index===o.index,i=l.offset,d=o&&r?o.offset:this._blocks[l.index].displayValue.length;if(s(this._blocks[l.index],l.index,i,d),o&&!r){for(let c=l.index+1;c<o.index;++c)s(this._blocks[c],c,0,this._blocks[c].displayValue.length);s(this._blocks[o.index],o.index,0,o.offset)}}}remove(t,n){t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length);const s=super.remove(t,n);return this._forEachBlocksInRange(t,n,(l,o,r,i)=>{s.aggregate(l.remove(r,i))}),s}nearestInputPos(t,n){if(n===void 0&&(n=N.NONE),!this._blocks.length)return 0;const s=new Di(this,t);if(n===N.NONE)return s.pushRightBeforeInput()||(s.popState(),s.pushLeftBeforeInput())?s.pos:this.displayValue.length;if(n===N.LEFT||n===N.FORCE_LEFT){if(n===N.LEFT){if(s.pushRightBeforeFilled(),s.ok&&s.pos===t)return t;s.popState()}if(s.pushLeftBeforeInput(),s.pushLeftBeforeRequired(),s.pushLeftBeforeFilled(),n===N.LEFT){if(s.pushRightBeforeInput(),s.pushRightBeforeRequired(),s.ok&&s.pos<=t||(s.popState(),s.ok&&s.pos<=t))return s.pos;s.popState()}return s.ok?s.pos:n===N.FORCE_LEFT?0:(s.popState(),s.ok||(s.popState(),s.ok)?s.pos:0)}return n===N.RIGHT||n===N.FORCE_RIGHT?(s.pushRightBeforeInput(),s.pushRightBeforeRequired(),s.pushRightBeforeFilled()?s.pos:n===N.FORCE_RIGHT?this.displayValue.length:(s.popState(),s.ok||(s.popState(),s.ok)?s.pos:this.nearestInputPos(t,N.LEFT))):t}totalInputPositions(t,n){t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length);let s=0;return this._forEachBlocksInRange(t,n,(l,o,r,i)=>{s+=l.totalInputPositions(r,i)}),s}maskedBlock(t){return this.maskedBlocks(t)[0]}maskedBlocks(t){const n=this._maskedBlocks[t];return n?n.map(s=>this._blocks[s]):[]}pad(t){const n=new O;return this._forEachBlocksInRange(0,this.displayValue.length,s=>n.aggregate(s.pad(t))),n}}ee.DEFAULTS={...Q.DEFAULTS,lazy:!0,placeholderChar:"_"},ee.STOP_CHAR="`",ee.ESCAPE_CHAR="\\",ee.InputDefinition=Be,ee.FixedDefinition=Ke,I.MaskedPattern=ee;class ve extends ee{get _matchFrom(){return this.maxLength-String(this.from).length}constructor(t){super(t)}updateOptions(t){super.updateOptions(t)}_update(t){const{to:n=this.to||0,from:s=this.from||0,maxLength:l=this.maxLength||0,autofix:o=this.autofix,...r}=t;this.to=n,this.from=s,this.maxLength=Math.max(String(n).length,l),this.autofix=o;const i=String(this.from).padStart(this.maxLength,"0"),d=String(this.to).padStart(this.maxLength,"0");let c=0;for(;c<d.length&&d[c]===i[c];)++c;r.mask=d.slice(0,c).replace(/0/g,"\\0")+"0".repeat(this.maxLength-c),super._update(r)}get isComplete(){return super.isComplete&&!!this.value}boundaries(t){let n="",s="";const[,l,o]=t.match(/^(\D*)(\d*)(\D*)/)||[];return o&&(n="0".repeat(l.length)+o,s="9".repeat(l.length)+o),n=n.padEnd(this.maxLength,"0"),s=s.padEnd(this.maxLength,"9"),[n,s]}doPrepareChar(t,n){n===void 0&&(n={});let s;return[t,s]=super.doPrepareChar(t.replace(/\D/g,""),n),t||(s.skip=!this.isComplete),[t,s]}_appendCharRaw(t,n){if(n===void 0&&(n={}),!this.autofix||this.value.length+1>this.maxLength)return super._appendCharRaw(t,n);const s=String(this.from).padStart(this.maxLength,"0"),l=String(this.to).padStart(this.maxLength,"0"),[o,r]=this.boundaries(this.value+t);return Number(r)<this.from?super._appendCharRaw(s[this.value.length],n):Number(o)>this.to?!n.tail&&this.autofix==="pad"&&this.value.length+1<this.maxLength?super._appendCharRaw(s[this.value.length],n).aggregate(this._appendCharRaw(t,n)):super._appendCharRaw(l[this.value.length],n):super._appendCharRaw(t,n)}doValidate(t){const n=this.value;if(n.search(/[^0]/)===-1&&n.length<=this._matchFrom)return!0;const[l,o]=this.boundaries(n);return this.from<=Number(o)&&Number(l)<=this.to&&super.doValidate(t)}pad(t){const n=new O;if(this.value.length===this.maxLength)return n;const s=this.value,l=this.maxLength-this.value.length;if(l){this.reset();for(let o=0;o<l;++o)n.aggregate(super._appendCharRaw("0",t));s.split("").forEach(o=>this._appendCharRaw(o))}return n}}I.MaskedRange=ve;const Ii="d{.}`m{.}`Y";class de extends ee{static extractPatternOptions(t){const{mask:n,pattern:s,...l}=t;return{...l,mask:he(n)?n:s}}constructor(t){super(de.extractPatternOptions({...de.DEFAULTS,...t}))}updateOptions(t){super.updateOptions(t)}_update(t){const{mask:n,pattern:s,blocks:l,...o}={...de.DEFAULTS,...t},r=Object.assign({},de.GET_DEFAULT_BLOCKS());t.min&&(r.Y.from=t.min.getFullYear()),t.max&&(r.Y.to=t.max.getFullYear()),t.min&&t.max&&r.Y.from===r.Y.to&&(r.m.from=t.min.getMonth()+1,r.m.to=t.max.getMonth()+1,r.m.from===r.m.to&&(r.d.from=t.min.getDate(),r.d.to=t.max.getDate())),Object.assign(r,this.blocks,l),super._update({...o,mask:he(n)?n:s,blocks:r})}doValidate(t){const n=this.date;return super.doValidate(t)&&(!this.isComplete||this.isDateExist(this.value)&&n!=null&&(this.min==null||this.min<=n)&&(this.max==null||n<=this.max))}isDateExist(t){return this.format(this.parse(t,this),this).indexOf(t)>=0}get date(){return this.typedValue}set date(t){this.typedValue=t}get typedValue(){return this.isComplete?super.typedValue:null}set typedValue(t){super.typedValue=t}maskEquals(t){return t===Date||super.maskEquals(t)}optionsIsChanged(t){return super.optionsIsChanged(de.extractPatternOptions(t))}}de.GET_DEFAULT_BLOCKS=()=>({d:{mask:ve,from:1,to:31,maxLength:2},m:{mask:ve,from:1,to:12,maxLength:2},Y:{mask:ve,from:1900,to:9999}}),de.DEFAULTS={...ee.DEFAULTS,mask:Date,pattern:Ii,format:(a,t)=>{if(!a)return"";const n=String(a.getDate()).padStart(2,"0"),s=String(a.getMonth()+1).padStart(2,"0"),l=a.getFullYear();return[n,s,l].join(".")},parse:(a,t)=>{const[n,s,l]=a.split(".").map(Number);return new Date(l,s-1,n)}},I.MaskedDate=de;class Ne extends Q{constructor(t){super({...Ne.DEFAULTS,...t}),this.currentMask=void 0}updateOptions(t){super.updateOptions(t)}_update(t){super._update(t),"mask"in t&&(this.exposeMask=void 0,this.compiledMasks=Array.isArray(t.mask)?t.mask.map(n=>{const{expose:s,...l}=xe(n),o=ae({overwrite:this._overwrite,eager:this._eager,skipInvalid:this._skipInvalid,...l});return s&&(this.exposeMask=o),o}):[])}_appendCharRaw(t,n){n===void 0&&(n={});const s=this._applyDispatch(t,n);return this.currentMask&&s.aggregate(this.currentMask._appendChar(t,this.currentMaskFlags(n))),s}_applyDispatch(t,n,s){t===void 0&&(t=""),n===void 0&&(n={}),s===void 0&&(s="");const l=n.tail&&n._beforeTailState!=null?n._beforeTailState._value:this.value,o=this.rawInputValue,r=n.tail&&n._beforeTailState!=null?n._beforeTailState._rawInputValue:o,i=o.slice(r.length),d=this.currentMask,c=new O,u=d?.state;return this.currentMask=this.doDispatch(t,{...n},s),this.currentMask&&(this.currentMask!==d?(this.currentMask.reset(),r&&(this.currentMask.append(r,{raw:!0}),c.tailShift=this.currentMask.value.length-l.length),i&&(c.tailShift+=this.currentMask.append(i,{raw:!0,tail:!0}).tailShift)):u&&(this.currentMask.state=u)),c}_appendPlaceholder(){const t=this._applyDispatch();return this.currentMask&&t.aggregate(this.currentMask._appendPlaceholder()),t}_appendEager(){const t=this._applyDispatch();return this.currentMask&&t.aggregate(this.currentMask._appendEager()),t}appendTail(t){const n=new O;return t&&n.aggregate(this._applyDispatch("",{},t)),n.aggregate(this.currentMask?this.currentMask.appendTail(t):super.appendTail(t))}currentMaskFlags(t){var n,s;return{...t,_beforeTailState:((n=t._beforeTailState)==null?void 0:n.currentMaskRef)===this.currentMask&&((s=t._beforeTailState)==null?void 0:s.currentMask)||t._beforeTailState}}doDispatch(t,n,s){return n===void 0&&(n={}),s===void 0&&(s=""),this.dispatch(t,this,n,s)}doValidate(t){return super.doValidate(t)&&(!this.currentMask||this.currentMask.doValidate(this.currentMaskFlags(t)))}doPrepare(t,n){n===void 0&&(n={});let[s,l]=super.doPrepare(t,n);if(this.currentMask){let o;[s,o]=super.doPrepare(s,this.currentMaskFlags(n)),l=l.aggregate(o)}return[s,l]}doPrepareChar(t,n){n===void 0&&(n={});let[s,l]=super.doPrepareChar(t,n);if(this.currentMask){let o;[s,o]=super.doPrepareChar(s,this.currentMaskFlags(n)),l=l.aggregate(o)}return[s,l]}reset(){var t;(t=this.currentMask)==null||t.reset(),this.compiledMasks.forEach(n=>n.reset())}get value(){return this.exposeMask?this.exposeMask.value:this.currentMask?this.currentMask.value:""}set value(t){this.exposeMask?(this.exposeMask.value=t,this.currentMask=this.exposeMask,this._applyDispatch()):super.value=t}get unmaskedValue(){return this.exposeMask?this.exposeMask.unmaskedValue:this.currentMask?this.currentMask.unmaskedValue:""}set unmaskedValue(t){this.exposeMask?(this.exposeMask.unmaskedValue=t,this.currentMask=this.exposeMask,this._applyDispatch()):super.unmaskedValue=t}get typedValue(){return this.exposeMask?this.exposeMask.typedValue:this.currentMask?this.currentMask.typedValue:""}set typedValue(t){if(this.exposeMask){this.exposeMask.typedValue=t,this.currentMask=this.exposeMask,this._applyDispatch();return}let n=String(t);this.currentMask&&(this.currentMask.typedValue=t,n=this.currentMask.unmaskedValue),this.unmaskedValue=n}get displayValue(){return this.currentMask?this.currentMask.displayValue:""}get isComplete(){var t;return!!((t=this.currentMask)!=null&&t.isComplete)}get isFilled(){var t;return!!((t=this.currentMask)!=null&&t.isFilled)}remove(t,n){const s=new O;return this.currentMask&&s.aggregate(this.currentMask.remove(t,n)).aggregate(this._applyDispatch()),s}get state(){var t;return{...super.state,_rawInputValue:this.rawInputValue,compiledMasks:this.compiledMasks.map(n=>n.state),currentMaskRef:this.currentMask,currentMask:(t=this.currentMask)==null?void 0:t.state}}set state(t){const{compiledMasks:n,currentMaskRef:s,currentMask:l,...o}=t;n&&this.compiledMasks.forEach((r,i)=>r.state=n[i]),s!=null&&(this.currentMask=s,this.currentMask.state=l),super.state=o}extractInput(t,n,s){return this.currentMask?this.currentMask.extractInput(t,n,s):""}extractTail(t,n){return this.currentMask?this.currentMask.extractTail(t,n):super.extractTail(t,n)}doCommit(){this.currentMask&&this.currentMask.doCommit(),super.doCommit()}nearestInputPos(t,n){return this.currentMask?this.currentMask.nearestInputPos(t,n):super.nearestInputPos(t,n)}get overwrite(){return this.currentMask?this.currentMask.overwrite:this._overwrite}set overwrite(t){this._overwrite=t}get eager(){return this.currentMask?this.currentMask.eager:this._eager}set eager(t){this._eager=t}get skipInvalid(){return this.currentMask?this.currentMask.skipInvalid:this._skipInvalid}set skipInvalid(t){this._skipInvalid=t}get autofix(){return this.currentMask?this.currentMask.autofix:this._autofix}set autofix(t){this._autofix=t}maskEquals(t){return Array.isArray(t)?this.compiledMasks.every((n,s)=>{if(!t[s])return;const{mask:l,...o}=t[s];return Ie(n,o)&&n.maskEquals(l)}):super.maskEquals(t)}typedValueEquals(t){var n;return!!((n=this.currentMask)!=null&&n.typedValueEquals(t))}}Ne.DEFAULTS={...Q.DEFAULTS,dispatch:(a,t,n,s)=>{if(!t.compiledMasks.length)return;const l=t.rawInputValue,o=t.compiledMasks.map((r,i)=>{const d=t.currentMask===r,c=d?r.displayValue.length:r.nearestInputPos(r.displayValue.length,N.FORCE_LEFT);return r.rawInputValue!==l?(r.reset(),r.append(l,{raw:!0})):d||r.remove(c),r.append(a,t.currentMaskFlags(n)),r.appendTail(s),{index:i,weight:r.rawInputValue.length,totalInputPositions:r.totalInputPositions(0,Math.max(c,r.nearestInputPos(r.displayValue.length,N.FORCE_LEFT)))}});return o.sort((r,i)=>i.weight-r.weight||i.totalInputPositions-r.totalInputPositions),t.compiledMasks[o[0].index]}},I.MaskedDynamic=Ne;class Se extends ee{constructor(t){super({...Se.DEFAULTS,...t})}updateOptions(t){super.updateOptions(t)}_update(t){const{enum:n,...s}=t;if(n){const l=n.map(i=>i.length),o=Math.min(...l),r=Math.max(...l)-o;s.mask="*".repeat(o),r&&(s.mask+="["+"*".repeat(r)+"]"),this.enum=n}super._update(s)}_appendCharRaw(t,n){n===void 0&&(n={});const s=Math.min(this.nearestInputPos(0,N.FORCE_RIGHT),this.value.length),l=this.enum.filter(o=>this.matchValue(o,this.unmaskedValue+t,s));if(l.length){l.length===1&&this._forEachBlocksInRange(0,this.value.length,(r,i)=>{const d=l[0][i];i>=this.value.length||d===r.value||(r.reset(),r._appendChar(d,n))});const o=super._appendCharRaw(l[0][this.value.length],n);return l.length===1&&l[0].slice(this.unmaskedValue.length).split("").forEach(r=>o.aggregate(super._appendCharRaw(r))),o}return new O({skip:!this.isComplete})}extractTail(t,n){return t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length),new ie("",t)}remove(t,n){if(t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length),t===n)return new O;const s=Math.min(super.nearestInputPos(0,N.FORCE_RIGHT),this.value.length);let l;for(l=t;l>=0&&!(this.enum.filter(i=>this.matchValue(i,this.value.slice(s,l),s)).length>1);--l);const o=super.remove(l,n);return o.tailShift+=l-t,o}get isComplete(){return this.enum.indexOf(this.value)>=0}}Se.DEFAULTS={...ee.DEFAULTS,matchValue:(a,t,n)=>a.indexOf(t,n)===n},I.MaskedEnum=Se;class It extends Q{updateOptions(t){super.updateOptions(t)}_update(t){super._update({...t,validate:t.mask})}}I.MaskedFunction=It;var Lt;class ne extends Q{constructor(t){super({...ne.DEFAULTS,...t})}updateOptions(t){super.updateOptions(t)}_update(t){super._update(t),this._updateRegExps()}_updateRegExps(){const t="^"+(this.allowNegative?"[+|\\-]?":""),n="\\d*",s=(this.scale?"("+qe(this.radix)+"\\d{0,"+this.scale+"})?":"")+"$";this._numberRegExp=new RegExp(t+n+s),this._mapToRadixRegExp=new RegExp("["+this.mapToRadix.map(qe).join("")+"]","g"),this._thousandsSeparatorRegExp=new RegExp(qe(this.thousandsSeparator),"g")}_removeThousandsSeparators(t){return t.replace(this._thousandsSeparatorRegExp,"")}_insertThousandsSeparators(t){const n=t.split(this.radix);return n[0]=n[0].replace(/\B(?=(\d{3})+(?!\d))/g,this.thousandsSeparator),n.join(this.radix)}doPrepareChar(t,n){n===void 0&&(n={});const[s,l]=super.doPrepareChar(this._removeThousandsSeparators(this.scale&&this.mapToRadix.length&&(n.input&&n.raw||!n.input&&!n.raw)?t.replace(this._mapToRadixRegExp,this.radix):t),n);return t&&!s&&(l.skip=!0),s&&!this.allowPositive&&!this.value&&s!=="-"&&l.aggregate(this._appendChar("-")),[s,l]}_separatorsCount(t,n){n===void 0&&(n=!1);let s=0;for(let l=0;l<t;++l)this._value.indexOf(this.thousandsSeparator,l)===l&&(++s,n&&(t+=this.thousandsSeparator.length));return s}_separatorsCountFromSlice(t){return t===void 0&&(t=this._value),this._separatorsCount(this._removeThousandsSeparators(t).length,!0)}extractInput(t,n,s){return t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length),[t,n]=this._adjustRangeWithSeparators(t,n),this._removeThousandsSeparators(super.extractInput(t,n,s))}_appendCharRaw(t,n){n===void 0&&(n={});const s=n.tail&&n._beforeTailState?n._beforeTailState._value:this._value,l=this._separatorsCountFromSlice(s);this._value=this._removeThousandsSeparators(this.value);const o=this._value;this._value+=t;const r=this.number;let i=!isNaN(r),d=!1;if(i){let h;this.min!=null&&this.min<0&&this.number<this.min&&(h=this.min),this.max!=null&&this.max>0&&this.number>this.max&&(h=this.max),h!=null&&(this.autofix?(this._value=this.format(h,this).replace(ne.UNMASKED_RADIX,this.radix),d||(d=o===this._value&&!n.tail)):i=!1),i&&(i=!!this._value.match(this._numberRegExp))}let c;i?c=new O({inserted:this._value.slice(o.length),rawInserted:d?"":t,skip:d}):(this._value=o,c=new O),this._value=this._insertThousandsSeparators(this._value);const u=n.tail&&n._beforeTailState?n._beforeTailState._value:this._value,p=this._separatorsCountFromSlice(u);return c.tailShift+=(p-l)*this.thousandsSeparator.length,c}_findSeparatorAround(t){if(this.thousandsSeparator){const n=t-this.thousandsSeparator.length+1,s=this.value.indexOf(this.thousandsSeparator,n);if(s<=t)return s}return-1}_adjustRangeWithSeparators(t,n){const s=this._findSeparatorAround(t);s>=0&&(t=s);const l=this._findSeparatorAround(n);return l>=0&&(n=l+this.thousandsSeparator.length),[t,n]}remove(t,n){t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length),[t,n]=this._adjustRangeWithSeparators(t,n);const s=this.value.slice(0,t),l=this.value.slice(n),o=this._separatorsCount(s.length);this._value=this._insertThousandsSeparators(this._removeThousandsSeparators(s+l));const r=this._separatorsCountFromSlice(s);return new O({tailShift:(r-o)*this.thousandsSeparator.length})}nearestInputPos(t,n){if(!this.thousandsSeparator)return t;switch(n){case N.NONE:case N.LEFT:case N.FORCE_LEFT:{const s=this._findSeparatorAround(t-1);if(s>=0){const l=s+this.thousandsSeparator.length;if(t<l||this.value.length<=l||n===N.FORCE_LEFT)return s}break}case N.RIGHT:case N.FORCE_RIGHT:{const s=this._findSeparatorAround(t);if(s>=0)return s+this.thousandsSeparator.length}}return t}doCommit(){if(this.value){const t=this.number;let n=t;this.min!=null&&(n=Math.max(n,this.min)),this.max!=null&&(n=Math.min(n,this.max)),n!==t&&(this.unmaskedValue=this.format(n,this));let s=this.value;this.normalizeZeros&&(s=this._normalizeZeros(s)),this.padFractionalZeros&&this.scale>0&&(s=this._padFractionalZeros(s)),this._value=s}super.doCommit()}_normalizeZeros(t){const n=this._removeThousandsSeparators(t).split(this.radix);return n[0]=n[0].replace(/^(\D*)(0*)(\d*)/,(s,l,o,r)=>l+r),t.length&&!/\d$/.test(n[0])&&(n[0]=n[0]+"0"),n.length>1&&(n[1]=n[1].replace(/0*$/,""),n[1].length||(n.length=1)),this._insertThousandsSeparators(n.join(this.radix))}_padFractionalZeros(t){if(!t)return t;const n=t.split(this.radix);return n.length<2&&n.push(""),n[1]=n[1].padEnd(this.scale,"0"),n.join(this.radix)}doSkipInvalid(t,n,s){n===void 0&&(n={});const l=this.scale===0&&t!==this.thousandsSeparator&&(t===this.radix||t===ne.UNMASKED_RADIX||this.mapToRadix.includes(t));return super.doSkipInvalid(t,n,s)&&!l}get unmaskedValue(){return this._removeThousandsSeparators(this._normalizeZeros(this.value)).replace(this.radix,ne.UNMASKED_RADIX)}set unmaskedValue(t){super.unmaskedValue=t}get typedValue(){return this.parse(this.unmaskedValue,this)}set typedValue(t){this.rawInputValue=this.format(t,this).replace(ne.UNMASKED_RADIX,this.radix)}get number(){return this.typedValue}set number(t){this.typedValue=t}get allowNegative(){return this.min!=null&&this.min<0||this.max!=null&&this.max<0}get allowPositive(){return this.min!=null&&this.min>0||this.max!=null&&this.max>0}typedValueEquals(t){return(super.typedValueEquals(t)||ne.EMPTY_VALUES.includes(t)&&ne.EMPTY_VALUES.includes(this.typedValue))&&!(t===0&&this.value==="")}}Lt=ne,ne.UNMASKED_RADIX=".",ne.EMPTY_VALUES=[...Q.EMPTY_VALUES,0],ne.DEFAULTS={...Q.DEFAULTS,mask:Number,radix:",",thousandsSeparator:"",mapToRadix:[Lt.UNMASKED_RADIX],min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,scale:2,normalizeZeros:!0,padFractionalZeros:!1,parse:Number,format:a=>a.toLocaleString("en-US",{useGrouping:!1,maximumFractionDigits:20})},I.MaskedNumber=ne;const Re={MASKED:"value",UNMASKED:"unmaskedValue",TYPED:"typedValue"};function Ze(a,t,n){t===void 0&&(t=Re.MASKED),n===void 0&&(n=Re.MASKED);const s=ae(a);return l=>s.runIsolated(o=>(o[t]=l,o[n]))}function Tt(a,t,n,s){return Ze(t,n,s)(a)}I.PIPE_TYPE=Re,I.createPipe=Ze,I.pipe=Tt;class Rt extends ee{get repeatFrom(){var t;return(t=Array.isArray(this.repeat)?this.repeat[0]:this.repeat===1/0?0:this.repeat)!=null?t:0}get repeatTo(){var t;return(t=Array.isArray(this.repeat)?this.repeat[1]:this.repeat)!=null?t:1/0}constructor(t){super(t)}updateOptions(t){super.updateOptions(t)}_update(t){var n,s,l;const{repeat:o,...r}=xe(t);this._blockOpts=Object.assign({},this._blockOpts,r);const i=ae(this._blockOpts);this.repeat=(n=(s=o??i.repeat)!=null?s:this.repeat)!=null?n:1/0,super._update({mask:"m".repeat(Math.max(this.repeatTo===1/0&&((l=this._blocks)==null?void 0:l.length)||0,this.repeatFrom)),blocks:{m:i},eager:i.eager,overwrite:i.overwrite,skipInvalid:i.skipInvalid,lazy:i.lazy,placeholderChar:i.placeholderChar,displayChar:i.displayChar})}_allocateBlock(t){if(t<this._blocks.length)return this._blocks[t];if(this.repeatTo===1/0||this._blocks.length<this.repeatTo)return this._blocks.push(ae(this._blockOpts)),this.mask+="m",this._blocks[this._blocks.length-1]}_appendCharRaw(t,n){n===void 0&&(n={});const s=new O;for(let d=(l=(o=this._mapPosToBlock(this.displayValue.length))==null?void 0:o.index)!=null?l:Math.max(this._blocks.length-1,0),c,u;c=(r=this._blocks[d])!=null?r:u=!u&&this._allocateBlock(d);++d){var l,o,r,i;const p=c._appendChar(t,{...n,_beforeTailState:(i=n._beforeTailState)==null||(i=i._blocks)==null?void 0:i[d]});if(p.skip&&u){this._blocks.pop(),this.mask=this.mask.slice(1);break}if(s.aggregate(p),p.consumed)break}return s}_trimEmptyTail(t,n){var s,l;t===void 0&&(t=0);const o=Math.max(((s=this._mapPosToBlock(t))==null?void 0:s.index)||0,this.repeatFrom,0);let r;n!=null&&(r=(l=this._mapPosToBlock(n))==null?void 0:l.index),r==null&&(r=this._blocks.length-1);let i=0;for(let d=r;o<=d&&!this._blocks[d].unmaskedValue;--d,++i);i&&(this._blocks.splice(r-i+1,i),this.mask=this.mask.slice(i))}reset(){super.reset(),this._trimEmptyTail()}remove(t,n){t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length);const s=super.remove(t,n);return this._trimEmptyTail(t,n),s}totalInputPositions(t,n){return t===void 0&&(t=0),n==null&&this.repeatTo===1/0?1/0:super.totalInputPositions(t,n)}get state(){return super.state}set state(t){this._blocks.length=t._blocks.length,this.mask=this.mask.slice(0,this._blocks.length),super.state=t}}I.RepeatBlock=Rt;try{globalThis.IMask=I}catch{}const Li=Object.freeze(Object.defineProperty({__proto__:null,ChangeDetails:O,ChunksTailDetails:me,DIRECTION:N,HTMLContenteditableMaskElement:Ge,HTMLInputMaskElement:Ft,HTMLMaskElement:Ce,InputMask:At,MaskElement:Le,Masked:Q,MaskedDate:de,MaskedDynamic:Ne,MaskedEnum:Se,MaskedFunction:It,MaskedNumber:ne,MaskedPattern:ee,MaskedRange:ve,MaskedRegExp:Dt,PIPE_TYPE:Re,PatternFixedDefinition:Ke,PatternInputDefinition:Be,RepeatBlock:Rt,createMask:ae,createPipe:Ze,default:I,forceDirection:St,normalizeOpts:xe,pipe:Tt},Symbol.toStringTag,{value:"Module"}));H.ModalEdit=Ct,H.VForm=fe,H.VsInputArray=xt,H.VsInputCheckbox=tt,H.VsInputColor=bt,H.VsInputContainer=ct,H.VsInputDate=nt,H.VsInputEmail=et,H.VsInputFile=at,H.VsInputFileList=it,H.VsInputKeyValue=kt,H.VsInputMask=Qe,H.VsInputNumber=Je,H.VsInputRadio=Pe,H.VsInputRange=yt,H.VsInputSelect=He,H.VsInputSlug=gt,H.VsInputStatic=Ue,H.VsInputSwitcher=je,H.VsInputTag=ft,H.VsInputText=_e,H.VsInputTextarea=ut,H.default=fe,H.inputs=wt,H.vsInputDatatable=ht,H.vsInputMap=mt,Object.defineProperties(H,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
1
+ (function(P,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("@opengis/core")):typeof define=="function"&&define.amd?define(["exports","vue","@opengis/core"],e):(P=typeof globalThis<"u"?globalThis:P||self,e(P.FormBuilder={},P.Vue,P.OpenGISCore))})(this,function(P,e,X){"use strict";const Zt={class:"w-full relative"},Wt={key:0,class:"text-[14px] font-medium text-gray-900 mb-2"},Yt={class:"opacity-100"},Jt={key:0,class:"text-red-500 text-[14px]"},Xt={key:1,class:"text-red-500 text-[10px] absolute bottom-[-14px]"},Qt=e.defineComponent({__name:"vs-layout-default",props:{ua:{default:""},uk:{},en:{},de:{},es:{},fr:{},item:{default:()=>({})},error:{type:[String,Boolean],default:""},label:{default:""}},setup(o){const t=e.ref("uk"),n=s=>{s.detail.key==="locale"&&(t.value=s.detail.newValue)};return e.onMounted(()=>{t.value=localStorage.locale,window.addEventListener("storage",n)}),e.onUnmounted(()=>{window.removeEventListener("resize",n)}),(s,l)=>(e.openBlock(),e.createElementBlock("div",Zt,[s.ua||s.label?(e.openBlock(),e.createElementBlock("div",Wt,[e.createElementVNode("span",Yt,e.toDisplayString(s.item[t.value]||s.ua||s.label),1),s.item?.rules?.includes("required")?(e.openBlock(),e.createElementBlock("span",Jt,"*")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.renderSlot(s.$slots,"default",e.mergeProps(s.$attrs,{class:{"opacity-60":s.item.disabled}})),s.error?(e.openBlock(),e.createElementBlock("span",Xt,e.toDisplayString(s.error),1)):e.createCommentVNode("",!0)]))}}),en={class:"w-full relative flex flex-row items-center gap-2"},tn={key:0,class:"text-sm text-gray-900 font-medium flex shrink-0 w-3/12 max-w-[250px]"},nn={key:0,class:"text-red-500 text-[14px]"},sn={key:1,class:"text-red-500 text-[10px] absolute bottom-[-14px]"},ln=e.defineComponent({__name:"vs-layout-horizontal",props:{ua:{default:""},uk:{},en:{},de:{},es:{},fr:{},item:{default:()=>({})},error:{type:[String,Boolean],default:""},label:{default:""}},setup(o){return(t,n)=>(e.openBlock(),e.createElementBlock("div",en,[t.item?.type!=="html"?(e.openBlock(),e.createElementBlock("span",tn,[e.createTextVNode(e.toDisplayString(t.ua||t.label)+" ",1),t.item?.rules?.includes("required")&&(t.ua||t.label)?(e.openBlock(),e.createElementBlock("span",nn,"*")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.renderSlot(t.$slots,"default",e.normalizeProps(e.guardReactiveProps(t.$attrs))),t.error?(e.openBlock(),e.createElementBlock("span",sn,e.toDisplayString(t.error),1)):e.createCommentVNode("",!0)]))}}),rn={class:"w-full relative"},on={key:0,class:"text-red-500 text-[10px] absolute bottom-[-14px]"},an=e.defineComponent({__name:"vs-layout-inline",props:{ua:{default:""},uk:{},en:{},de:{},es:{},fr:{},item:{default:()=>({})},error:{type:[String,Boolean],default:""},label:{default:""}},setup(o){return(t,n)=>(e.openBlock(),e.createElementBlock("div",rn,[e.renderSlot(t.$slots,"default",e.normalizeProps(e.guardReactiveProps(t.$attrs))),t.error?(e.openBlock(),e.createElementBlock("span",on,e.toDisplayString(t.error),1)):e.createCommentVNode("",!0)]))}}),dn={class:"flex-1 min-w-0"},un={key:0,class:"text-sm font-medium text-slate-700 dark:text-slate-200 flex items-center gap-1"},cn={class:"truncate"},pn={key:0,class:"text-red-500 text-[14px]"},hn={key:1,class:"text-xs text-slate-500 dark:text-slate-400"},fn={class:"w-full md:w-auto"},mn={key:0,class:"mt-1 text-xs text-red-500"},gn={default:Qt,horizontal:ln,inline:an,settings:e.defineComponent({__name:"vs-layout-settings",props:{ua:{default:""},uk:{},en:{},de:{},es:{},fr:{},item:{default:()=>({})},error:{type:[String,Boolean],default:""},label:{default:""}},setup(o){const t=o,n=e.ref("uk");e.computed(()=>(t.item??{})?.[n.value]??t.ua??t.label??"");const s=e.computed(()=>t.item?.description??""),l=e.computed(()=>Array.isArray(t.item?.rules)&&t.item.rules.includes("required")),r=e.computed(()=>(typeof t.error=="string"?t.error:"")??""),a=i=>{i.key==="locale"&&(n.value=i.newValue??"uk")};return e.onMounted(()=>{try{typeof localStorage<"u"&&localStorage.locale&&(n.value=localStorage.locale)}catch{}window.addEventListener("storage",a)}),e.onUnmounted(()=>{window.removeEventListener("storage",a)}),(i,d)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["w-full relative",{"opacity-60":i.item?.disabled}])},[e.createElementVNode("div",{class:e.normalizeClass(["gap-2 md:flex-row md:items-center md:justify-between",[["switcher","native-select"].includes(i.item.type)?"flex flex-col":""]])},[e.createElementVNode("div",dn,[i.ua||i.label?(e.openBlock(),e.createElementBlock("p",un,[e.createElementVNode("span",cn,e.toDisplayString(i.item[n.value]||i.ua||i.label),1),l.value?(e.openBlock(),e.createElementBlock("span",pn,"*")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),s.value?(e.openBlock(),e.createElementBlock("p",hn,e.toDisplayString(s.value),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",fn,[e.renderSlot(i.$slots,"default",e.normalizeProps(e.guardReactiveProps(i.$attrs)))])],2),r.value?(e.openBlock(),e.createElementBlock("p",mn,e.toDisplayString(r.value),1)):e.createCommentVNode("",!0)],2))}})};function le(o){return{inputClass:e.computed(()=>{const n=`disabled:opacity-50 disabled:cursor-not-allowed outline-none focus:ring-2 focus:ring-ring focus:ring-${o?.primaryColor||"blue"}-500 border border-solid border-stone-200 rounded-md text-sm text-stone-800 placeholder:text-stone-400 `;return o?.size==="sm"?`${n}h-[32px]`:`${n}h-[38px]`})}}const kn=["placeholder","disabled"],bn=e.defineComponent({__name:"vs-input-password",props:e.mergeModels({style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{default:""},name:{},placeholder:{default:""}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const t=o,{inputClass:n}=le(t.style),s=e.useModel(o,"modelValue");return(l,r)=>e.withDirectives((e.openBlock(),e.createElementBlock("input",{type:"password","onUpdate:modelValue":r[0]||(r[0]=a=>s.value=a),placeholder:l.placeholder,disabled:l.disabled,class:e.normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white",[e.unref(n),{"!border-red-600":l.error}]]),style:{border:"1px solid #CFD9E0"}},null,10,kn)),[[e.vModelText,s.value]])}}),yn=["placeholder","disabled"],Ee=e.defineComponent({__name:"vs-input-text",props:e.mergeModels({style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{default:""},name:{},placeholder:{default:""}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const t=o,{inputClass:n}=le(t.style),s=e.useModel(o,"modelValue");return(l,r)=>e.withDirectives((e.openBlock(),e.createElementBlock("input",{type:"text","onUpdate:modelValue":r[0]||(r[0]=a=>s.value=a),placeholder:l.placeholder,disabled:l.disabled,class:e.normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white",[e.unref(n),{"!border-red-600":l.error}]]),style:{border:"1px solid #CFD9E0"}},null,10,yn)),[[e.vModelText,s.value]])}}),xn=["placeholder","min","max"],et=e.defineComponent({__name:"vs-input-number",props:e.mergeModels({min:{},max:{},style:{default:()=>({})},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{default:""}},{modelValue:{default:null},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const t=o,{inputClass:n}=le(t.style),s=e.useModel(o,"modelValue");return(l,r)=>e.withDirectives((e.openBlock(),e.createElementBlock("input",{type:"number",step:"any","onUpdate:modelValue":r[0]||(r[0]=a=>s.value=a),placeholder:l.placeholder,class:e.normalizeClass(["py-1.5 px-3 block w-full bg-white",[e.unref(n)]]),style:{border:"1px solid #CFD9E0"},min:l.min,max:l.max},null,10,xn)),[[e.vModelText,s.value]])}}),H=(o,t)=>{const n=o.__vccOpts||o;for(const[s,l]of t)n[s]=l;return n},wn={},_n={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"4","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-check"};function En(o,t){return e.openBlock(),e.createElementBlock("svg",_n,t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M5 12l5 5l10 -10"},null,-1)]))}const Vn=H(wn,[["render",En]]),Cn={class:"flex items-center gap-[4px]"},vn=["value","id","disabled"],Bn=["for"],Sn={class:"text-[14px] text-gray-700 flex items-center gap-x-1 ml-1 dark:text-neutral-400"},Nn=e.defineComponent({__name:"vs-checkbox-default",props:{value:{default:""},label:{default:""},disabled:{type:Boolean,default:!1},id:{},modelValue:{default:""},info:{},error:{}},emits:["update:modelValue"],setup(o,{emit:t}){const n=t,s=o,l=e.computed({get:()=>s.modelValue,set:r=>n("update:modelValue",r)});return(r,a)=>(e.openBlock(),e.createElementBlock("div",Cn,[e.withDirectives(e.createElementVNode("input",{type:"checkbox",value:r.value,"onUpdate:modelValue":a[0]||(a[0]=i=>l.value=i),class:e.normalizeClass(["shrink-0 border border-solid hidden border-gray-700 w-3.5 h-3.5 rounded text-blue-600 focus:ring-offset-0 dark:bg-neutral-800 dark:border-neutral-700 cursor-pointer",{"!cursor-not-allowed":r.disabled}]),id:r.id,disabled:r.disabled},null,10,vn),[[e.vModelCheckbox,l.value]]),e.createElementVNode("label",{for:r.id,class:e.normalizeClass(["flex flex-1 checkbox-label items-center gap-x-2 cursor-pointer text-sm text-gray-800 dark:text-neutral-300",{"!cursor-not-allowed":r.disabled}])},[e.createElementVNode("div",{class:e.normalizeClass(["h-[16px] text-white w-[16px] flex items-center justify-center shrink-0 border rounded",[l.value?"bg-blue-600 border-blue-600":"bg-white border-gray-600",r.error?"border-red-600":""]])},[e.createVNode(Vn,{height:"12",width:"12"})],2),e.createElementVNode("span",Sn,[e.renderSlot(r.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(r.label),1)])])],10,Bn)]))}}),Mn=["name","value","disabled"],Fn={class:"flex items-center gap-[6px] text-[14px]"},An={key:0,class:"text-[16px]"},$n=["src"],Dn=e.defineComponent({__name:"vs-checkbox-buttons",props:{value:{type:[String,Number,Boolean],default:""},label:{default:""},modelValue:{default:""},disabled:{type:Boolean},id:{},icon:{},imgUrl:{},style:{}},emits:["update:modelValue"],setup(o,{emit:t}){const n=o,s=t,l=e.computed({get:()=>n.modelValue,set:i=>{s("update:modelValue",i)}}),r=e.computed(()=>Array.isArray(l.value)?l.value.includes(n.value):l.value===!0||l.value===n.value),a=e.computed(()=>n.style?.size==="xs"?"p-1.5 text-xs":n.style?.size==="lg"?"p-3.5 text-[20px]":"p-2.5 text-xs");return(i,d)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(["group relative flex justify-center items-center gap-x-3 text-center bg-white text-gray-800 ring-ring ring-2 cursor-pointer rounded-lg",[a.value,r.value?"ring-blue-500":"border border-gray-200 ring-transparent"]])},[e.withDirectives(e.createElementVNode("input",{type:"checkbox",class:"hidden",name:i.id,value:i.value,"onUpdate:modelValue":d[0]||(d[0]=u=>l.value=u),disabled:i.disabled},null,8,Mn),[[e.vModelCheckbox,l.value]]),e.createElementVNode("span",Fn,[i.icon||i.imgUrl?(e.openBlock(),e.createElementBlock("span",An,[i.icon?(e.openBlock(),e.createElementBlock("i",{key:0,class:e.normalizeClass(i.icon)},null,2)):e.createCommentVNode("",!0),i.imgUrl?(e.openBlock(),e.createElementBlock("img",{key:1,src:i.imgUrl,width:"16",height:"16",alt:"icon"},null,8,$n)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.renderSlot(i.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(i.label),1)])])],2))}}),In={class:"flex items-center"},tt=e.defineComponent({__name:"vs-input-checkbox-item",props:{value:{default:""},label:{default:""},disabled:{type:Boolean,default:!1},view:{default:"default"},modelValue:{type:[Boolean,Array],default:!1},icon:{},imgUrl:{},slots:{},option:{},style:{},error:{default:""}},emits:["update:modelValue"],setup(o,{emit:t}){const n=o,s=t,l=`radio-${Math.floor(Math.random()*1e4)}`,r=e.computed({get:()=>Array.isArray(n.modelValue)?Array.isArray(n.modelValue)&&n.modelValue.includes(n.value):n.modelValue,set:i=>{if(Array.isArray(n.modelValue)){let d=[...n.modelValue];i?d.includes(n.value)||d.push(n.value):d=d.filter(u=>u!==n.value),s("update:modelValue",d)}else s("update:modelValue",i)}}),a=e.ref(`vs-checkbox-${n.view||"default"}`);return(i,d)=>(e.openBlock(),e.createElementBlock("div",In,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(a.value==="vs-checkbox-buttons"?e.unref(Dn):e.unref(Nn)),{value:i.value,label:i.label,info:i.option?.info,disabled:i.disabled,modelValue:r.value,"onUpdate:modelValue":d[0]||(d[0]=u=>r.value=u),id:l,icon:i.icon,imgUrl:i.imgUrl,style:e.normalizeStyle(i.style),error:i.error},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.label),1)]),_:1},8,["value","label","info","disabled","modelValue","icon","imgUrl","style","error"]))]))}}),Tn={},Ln={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-chevron-down"};function Rn(o,t){return e.openBlock(),e.createElementBlock("svg",Ln,t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M6 9l6 6l6 -6"},null,-1)]))}const On=H(Tn,[["render",Rn]]),zn={},jn={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-x"};function Un(o,t){return e.openBlock(),e.createElementBlock("svg",jn,t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M18 6l-12 12"},null,-1),e.createElementVNode("path",{d:"M6 6l12 12"},null,-1)]))}const Pn=H(zn,[["render",Un]]),Hn={},qn={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function Gn(o,t){return e.openBlock(),e.createElementBlock("svg",qn,t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M12 9h.01"},null,-1),e.createElementVNode("path",{d:"M11 12h1v4h1"},null,-1),e.createElementVNode("path",{d:"M12 3c7.2 0 9 1.8 9 9s-1.8 9 -9 9s-9 -1.8 -9 -9s1.8 -9 9 -9z"},null,-1)]))}const Kn=H(Hn,[["render",Gn]]),Zn={key:0,class:"flex items-start gap-x-1"},Wn={key:0,class:"text-red-500 text-[14px]"},Yn=["title"],Jn=["disabled"],Ue=e.defineComponent({__name:"vs-input-switcher",props:e.mergeModels({rules:{default:()=>[]},view:{default:"checkbox"},label:{default:""},i:{default:""},text:{default:""},style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{default:""},name:{},placeholder:{}},{modelValue:{type:Boolean,default:!1},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const t=o,n=e.useModel(o,"modelValue");return(s,l)=>t.view==="checkbox"?(e.openBlock(),e.createElementBlock("div",Zn,[e.createVNode(tt,{modelValue:n.value,"onUpdate:modelValue":l[0]||(l[0]=r=>n.value=r),label:s.text,error:s.error||""},null,8,["modelValue","label","error"]),s.rules?.includes("required")?(e.openBlock(),e.createElementBlock("span",Wn,"*")):e.createCommentVNode("",!0),s.i?(e.openBlock(),e.createElementBlock("button",{key:1,class:"cursor-pointer",title:s.i,onClick:l[1]||(l[1]=e.withModifiers(()=>{},["prevent"]))},[e.createVNode(e.unref(Kn),{class:"text-gray-500 w-[14px] h-[14px]"})],8,Yn)):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:e.normalizeClass(["inline-flex h-5 w-9 shrink-0 px-[2px] cursor-pointer items-center rounded-full shadow-sm disabled:cursor-not-allowed disabled:opacity-50",[n.value?`bg-${s.style?.primaryColor||"blue"}-500`:"bg-stone-200",s.customClass]]),disabled:s.disabled,onClick:l[2]||(l[2]=r=>n.value=!n.value)},[e.createElementVNode("span",{"data-state":"checked",class:e.normalizeClass(["pointer-events-none block h-4 w-4 rounded-full bg-white shadow-lg ring-0 transition-transform",[n.value?"translate-x-4":"translate-x-0"]])},null,2)],10,Jn))}}),Xn=["id","innerHTML"],Pe=e.defineComponent({__name:"vs-input-static",props:{text:{default:""},html:{default:""},style:{},customClass:{default:""},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{}},setup(o){return(t,n)=>(e.openBlock(),e.createElementBlock("div",{id:t.name,class:e.normalizeClass(["text-gray-900",t.customClass]),innerHTML:t.html?t.html:t.text},null,10,Xn))}}),Qn=["placeholder","disabled","name"],nt=e.defineComponent({__name:"vs-input-mask",props:e.mergeModels({name:{},mask:{default:""},unmask:{type:Boolean,default:!1},placeholder:{default:"_"},style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const t=o,{inputClass:n}=le(t.style),s=e.useModel(o,"modelValue"),l=e.ref(null);let r=null;return e.onMounted(async()=>{if(l.value){const{default:a}=await Promise.resolve().then(()=>ai);r=a(l.value,{mask:t.mask||"",definitions:{9:/[0-9]/,A:/[a-zA-Z]/,"*":/[a-zA-Z0-9]/},lazy:!1}),r.on("accept",()=>{s.value=t.unmask?r.unmaskedValue:r.value}),r.on("complete",()=>{s.value=t.unmask?r.unmaskedValue:r.value}),r.value=s.value??""}}),e.onBeforeUnmount(()=>{r?.destroy()}),e.watch(()=>t.mask,a=>{r&&r.updateOptions({mask:a,definitions:{9:/[0-9]/,A:/[a-zA-Z]/,"*":/[a-zA-Z0-9]/}})}),e.watch(s,a=>{r&&r.unmaskedValue!==a&&(r.value=a||"")}),(a,i)=>(e.openBlock(),e.createElementBlock("input",{type:"text",ref_key:"inputEl",ref:l,placeholder:a.placeholder,disabled:a.disabled,name:a.name,class:e.normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white",[e.unref(n)]]),style:{border:"1px solid #CFD9E0"}},null,10,Qn))}}),es={class:"relative w-full bg-white rounded-lg"},ts=["placeholder","disabled"],st=e.defineComponent({__name:"vs-input-email",props:e.mergeModels({style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{default:null},name:{},placeholder:{default:""}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const t=o,{inputClass:n}=le(t.style),s=e.useModel(o,"modelValue");return(l,r)=>(e.openBlock(),e.createElementBlock("div",es,[r[1]||(r[1]=e.createStaticVNode('<div class="absolute bottom-2/4 translate-y-2/4 left-[10px] cursor-pointer"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="stroke-gray-500 transition-all"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M3 7a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v10a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-10z"></path><path d="M3 7l9 6l9 -6"></path></svg></div>',1)),e.withDirectives(e.createElementVNode("input",{type:"email","onUpdate:modelValue":r[0]||(r[0]=a=>s.value=a),placeholder:l.placeholder,disabled:l.disabled,class:e.normalizeClass(["!pl-8 py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white",[e.unref(n),{"!border-red-600":l.error}]]),style:{border:"1px solid #CFD9E0"}},null,10,ts),[[e.vModelText,s.value]])]))}}),ns=["value","disabled"],ss={class:"text-[13px] text-gray-700"},ls=e.defineComponent({__name:"vs-input-radio-default",props:e.mergeModels({style:{},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{},name:{},placeholder:{},value:{},text:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const t=e.useModel(o,"modelValue");return(n,s)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(["flex items-center gap-0",[n.customClass]])},[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":s[0]||(s[0]=l=>t.value=l),type:"radio",value:n.value,disabled:n.disabled,class:"hidden"},null,8,ns),[[e.vModelRadio,t.value]]),e.createElementVNode("span",{class:e.normalizeClass(["w-[16px] shrink-0 h-[16px] border rounded-full flex items-center justify-center mr-[10px]",[`border-${n.style?.primaryColor||"blue"}-500`,n.disabled?"opacity-50 cursor-not-allowed":""]])},[t.value==n.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["w-[12px] h-[12px] shrink-0 rounded-full",[`bg-${n.style?.primaryColor||"blue"}-500`]])},null,2)):e.createCommentVNode("",!0)],2),e.createElementVNode("span",ss,e.toDisplayString(n.text),1)],2))}}),rs=["value","disabled"],os={class:"text-[13px] text-gray-700"},as={"vs-input-radio-default":ls,"vs-input-radio-buttons":e.defineComponent({__name:"vs-input-radio-buttons",props:e.mergeModels({style:{},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{},name:{},placeholder:{},value:{},text:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const t=e.useModel(o,"modelValue");return(n,s)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(["flex items-center border rounded-lg px-2 py-1",[t.value==n.value?`ring-2 ring-ring ring-${n.style?.primaryColor||"blue"}-500`:"",n.customClass]])},[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":s[0]||(s[0]=l=>t.value=l),type:"radio",value:n.value,disabled:n.disabled,class:"hidden"},null,8,rs),[[e.vModelRadio,t.value]]),e.createElementVNode("span",os,e.toDisplayString(n.text),1)],2))}})},He=e.defineComponent({__name:"vs-input-radio",props:e.mergeModels({options:{},position:{default:"vertical"},view:{default:"default"},style:{},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const t=o,n=e.useModel(o,"modelValue"),s=e.computed(()=>as[`vs-input-radio-${t.view}`]);return(l,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([l.position==="horizontal"?"flex items-center flex-wrap gap-2":""])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.options,a=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(s.value),e.mergeProps({key:a?.id,text:a.text,value:a.id.toString(),checked:n.value===a.id,modelValue:n.value,"onUpdate:modelValue":r[0]||(r[0]=i=>n.value=i)},{ref_for:!0},l.$attrs),null,16,["text","value","checked","modelValue"]))),128))],2))}}),lt=H(e.defineComponent({__name:"vs-input-checkbox",props:{options:{default:()=>[]},position:{default:"vertical"},slots:{default:null},colSpan:{default:0},data:{},view:{},style:{},customClass:{},disabled:{type:Boolean},modelValue:{default:!1},error:{},name:{},placeholder:{}},emits:["update:modelValue"],setup(o,{emit:t}){const n=o,s=t,l=e.ref([]),r=e.reactive({}),a=c=>c?.value||c?.id||c?.text||c,i=c=>c.text||String(c),d=c=>`lg:col-span-${c||12}`,u=async()=>{try{const c=await fetch(`/api/suggest/${n.data}`).then(p=>p.json());l.value=c?.data||c}catch(c){console.error(c)}};return e.watch(()=>n.modelValue,c=>{if(typeof c=="boolean"&&l.value.length===1){const p=a(l.value[0]);r[p]=c}else if(Array.isArray(c)){const p=new Set(c);l.value.forEach(h=>{if(!h.disabled){const _=a(h);r[_]=p.has(_)}})}},{immediate:!0}),e.watch(r,()=>{if(!l.value.length){s("update:modelValue",null);return}const c=Object.entries(r).filter(([,p])=>p).map(([p])=>p);s("update:modelValue",c.length===0?[]:c)},{deep:!0}),e.onMounted(()=>{if(n.data)u().then(()=>{if(typeof n.modelValue=="boolean"&&l.value.length===1){const c=a(l.value[0]);r[c]=n.modelValue}else if(Array.isArray(n.modelValue)){const c=new Set(n.modelValue);l.value.forEach(p=>{if(!p.disabled){const h=a(p);r[h]=c.has(h)}})}});else if(l.value=n.options,typeof n.modelValue=="boolean"&&l.value.length===1){const c=a(l.value[0]);r[c]=n.modelValue}else if(Array.isArray(n.modelValue)){const c=new Set(n.modelValue);l.value.forEach(p=>{if(!p.disabled){const h=a(p);r[h]=c.has(h)}})}}),(c,p)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["p-0 w-full gap-[6px]",[c.position==="vertical"?"flex-col":"",c.colSpan?"grid":"flex justify-start"]])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,h=>(e.openBlock(),e.createBlock(tt,{modelValue:r[a(h)],"onUpdate:modelValue":_=>r[a(h)]=_,value:a(h),class:e.normalizeClass(d(c.colSpan)),disabled:h.disabled,label:i(h),key:a(h),icon:h?.icon,imgUrl:h?.imgUrl,option:h,view:c.view},null,8,["modelValue","onUpdate:modelValue","value","class","disabled","label","icon","imgUrl","option","view"]))),128))],2))}}),[["__scopeId","data-v-91f3584a"]]),is=["type","placeholder","disabled"],rt=e.defineComponent({__name:"vs-input-date1",props:{style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{},name:{},placeholder:{default:""},mode:{default:"date"}},emits:["update:modelValue"],setup(o,{emit:t}){const n=o;function s(d){return d?n.mode==="datetime"?(d.includes("T")?d:null)||d+(d.includes(" ")?"":"T00:00"):d?.split(" ")[0]:null}const{inputClass:l}=le(n.style),r=t,a=e.computed({get:()=>s(n.modelValue),set:d=>r("update:modelValue",d)}),i=e.computed(()=>n.mode==="datetime"?"datetime-local":n.mode);return(d,u)=>e.withDirectives((e.openBlock(),e.createElementBlock("input",{type:i.value,"onUpdate:modelValue":u[0]||(u[0]=c=>a.value=c),placeholder:d.placeholder,disabled:d.disabled,ref:"date",class:e.normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white",[d.modelValue?"":"text-opacity-50",e.unref(l)].join(" ")]),style:{border:"1px solid #CFD9E0"}},null,10,is)),[[e.vModelDynamic,a.value]])}}),ot=async(o,t,n,s)=>{try{const l=new FormData;return l.append("unique","true"),l.append("file",o),(await fetch(`/file/upload/uploads?id=${t||""}&form=${n||""}&table=${s||""}`,{method:"POST",body:l}).then(a=>a.json()))?.result}catch(l){return X.notify({type:"error",title:"Помилка!",message:"Сталась помилка під час завантаження файлу",position:"right-bottom"}),console.error("Сталась помилка завантаження файлу",l),null}},ds=async o=>{try{return await fetch(`file/delete${o}`),!0}catch(t){return console.error(t),!1}},at=async o=>{try{const t=await fetch(`file/download/files/uploads${o}`),n=await t.arrayBuffer(),s=t.headers["content-type"],l=new TextDecoder("utf-8").decode(n),r=new Blob([l],{type:s}),a=document.createElement("a");a.setAttribute("download",o),a.href=window.URL.createObjectURL(r),a.click()}catch(t){console.error(t.message)}},us={},cs={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function ps(o,t){return e.openBlock(),e.createElementBlock("svg",cs,t[0]||(t[0]=[e.createElementVNode("path",{d:"M5 12h14"},null,-1),e.createElementVNode("path",{d:"M12 5v14"},null,-1)]))}const Ve=H(us,[["render",ps]]),hs={},fs={xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-file-text",width:"44",height:"44",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"};function ms(o,t,n,s,l,r){return e.openBlock(),e.createElementBlock("svg",fs,t[0]||(t[0]=[e.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"></path><line x1="9" y1="9" x2="10" y2="9"></line><line x1="9" y1="13" x2="15" y2="13"></line><line x1="9" y1="17" x2="15" y2="17"></line>',6)]))}const gs=H(hs,[["render",ms]]),ks={},bs={xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-table",width:"44",height:"44",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"};function ys(o,t,n,s,l,r){return e.openBlock(),e.createElementBlock("svg",bs,t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("rect",{x:"4",y:"4",width:"16",height:"16",rx:"2"},null,-1),e.createElementVNode("line",{x1:"4",y1:"10",x2:"20",y2:"10"},null,-1),e.createElementVNode("line",{x1:"10",y1:"4",x2:"10",y2:"20"},null,-1)]))}const xs=H(ks,[["render",ys]]),ws={},_s={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function Es(o,t){return e.openBlock(),e.createElementBlock("svg",_s,t[0]||(t[0]=[e.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"></path><path d="M9 9l1 0"></path><path d="M9 13l6 0"></path><path d="M9 17l6 0"></path>',6)]))}const it=H(ws,[["render",Es]]),Vs={},Cs={xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-file-zip",width:"44",height:"44",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"};function vs(o,t,n,s,l,r){return e.openBlock(),e.createElementBlock("svg",Cs,t[0]||(t[0]=[e.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M6 20.735a2 2 0 0 1 -1 -1.735v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2h-1"></path><path d="M11 17a2 2 0 0 1 2 2v2a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1v-2a2 2 0 0 1 2 -2z"></path><line x1="11" y1="5" x2="10" y2="5"></line><line x1="13" y1="7" x2="12" y2="7"></line><line x1="11" y1="9" x2="10" y2="9"></line><line x1="13" y1="11" x2="12" y2="11"></line><line x1="11" y1="13" x2="10" y2="13"></line><line x1="13" y1="15" x2="12" y2="15"></line>',9)]))}const Bs=H(Vs,[["render",vs]]),Ss={},Ns={xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-file-code",width:"44",height:"44",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"};function Ms(o,t,n,s,l,r){return e.openBlock(),e.createElementBlock("svg",Ns,t[0]||(t[0]=[e.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"></path><path d="M10 13l-1 2l1 2"></path><path d="M14 13l1 2l-1 2"></path>',5)]))}const Fs=H(Ss,[["render",Ms]]),As=o=>{if(!o)return"";const t=o?.split(".");return t[t.length-1]},$s=o=>{const t=As(o),n={imageFormat:["tiff","jpg","jpeg","png","svg","ico","webp"],sheetsFormat:["xls","csv","xlsx"],archivesFormat:["zip","rar"],textsFormat:["json","geojson","txt","yml","yaml","shp"],documentsFormat:["pdf"]};return n.imageFormat.includes(t)?"img":n.sheetsFormat.includes(t)?xs:n.textsFormat.includes(t)?Fs:n.documentsFormat.includes(t)?gs:n.archivesFormat.includes(t)?Bs:it},Ds={},Is={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-trash"};function Ts(o,t){return e.openBlock(),e.createElementBlock("svg",Is,t[0]||(t[0]=[e.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M4 7l16 0"></path><path d="M10 11l0 6"></path><path d="M14 11l0 6"></path><path d="M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12"></path><path d="M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3"></path>',6)]))}const $e=H(Ds,[["render",Ts]]),Ls={},Rs={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-download"};function Os(o,t){return e.openBlock(),e.createElementBlock("svg",Rs,t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"},null,-1),e.createElementVNode("path",{d:"M7 11l5 5l5 -5"},null,-1),e.createElementVNode("path",{d:"M12 4l0 12"},null,-1)]))}const dt=H(Ls,[["render",Os]]),zs={class:"h-[120px] w-[120px] border text-gray-300 border-dashed border-[#CFD9E0] rounded-lg overflow-hidden relative item-file"},js={class:"absolute hidden top-0 right-0 flex items-center gap-x-2 w-full h-full justify-center"},ut=H(e.defineComponent({__name:"vs-input-file-list-item",props:e.mergeModels({format:{},multiple:{type:Boolean},style:{},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{}},{value:{},valueModifiers:{},item:{},itemModifiers:{}}),emits:["update:value","update:item"],setup(o){const t=e.useModel(o,"value"),n=e.useModel(o,"item"),s=o;return(l,r)=>(e.openBlock(),e.createElementBlock("div",zs,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref($s)(n.value)),{src:n.value,alt:"file",class:"w-full h-full object-cover cursor-pointer",onClick:r[0]||(r[0]=a=>e.unref(at)(n.value))},null,8,["src"])),e.createElementVNode("div",js,[e.createElementVNode("button",{type:"button",onClick:r[1]||(r[1]=a=>{e.unref(ds)(n.value),t.value=s.multiple?t.value?.filter(i=>i!==n.value):""}),class:"w-6 h-6 flex items-center justify-center text-gray-500 bg-gray-200 rounded-lg hover:text-red-500"},[e.createVNode($e,{class:"w-4 h-4"})]),e.createElementVNode("button",{type:"button",onClick:r[2]||(r[2]=a=>e.unref(at)(n.value)),class:"w-6 h-6 flex items-center justify-center text-gray-500 bg-gray-200 rounded-lg hover:text-blue-500"},[e.createVNode(dt,{class:"w-4 h-4"})])])]))}}),[["__scopeId","data-v-0ca886b3"]]),Us={class:"flex items-center gap-x-2"},Ps=["multiple"],Hs={key:1,class:"flex items-center flex-wrap gap-2"},ct=e.defineComponent({__name:"vs-input-file",props:e.mergeModels({format:{},multiple:{type:Boolean},style:{},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const t=o,n=e.useModel(o,"modelValue"),s=e.ref(null),l=a=>Array.isArray(n.value)&&n.value[a]||"",r=async a=>{const{files:i}=a.target;if(!(!i||i.length===0))if(t.multiple){const d=Array.from(i).map(async h=>t.format&&!h.name.endsWith(t.format)?null:await ot(h,"1","form","table")),p=(await Promise.all(d)).filter(h=>h!==null).map(h=>h?.file_path).filter(Boolean);n.value=[...n.value||[],...p]}else{const d=i[0];if(t.format&&!d.name.endsWith(t.format))return;const u=await ot(d,"1","form","table");n.value=u?.file_path}};return(a,i)=>(e.openBlock(),e.createElementBlock("div",Us,[e.createElementVNode("input",{class:"hidden",ref_key:"fileInput",ref:s,type:"file",multiple:a.multiple,onChange:r},null,40,Ps),!a.multiple&&n.value?(e.openBlock(),e.createBlock(ut,{key:0,item:n.value,"onUpdate:item":i[0]||(i[0]=d=>n.value=d),value:n.value,"onUpdate:value":i[1]||(i[1]=d=>n.value=d)},null,8,["item","value"])):a.multiple?(e.openBlock(),e.createElementBlock("div",Hs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,(d,u)=>(e.openBlock(),e.createBlock(ut,{multiple:a.multiple,key:u,value:n.value,"onUpdate:value":i[2]||(i[2]=c=>n.value=c),item:l(u)},null,8,["multiple","value","item"]))),128)),e.createElementVNode("div",{onClick:i[3]||(i[3]=d=>!a.disabled&&s.value?.click()),class:e.normalizeClass(["h-[120px] w-[120px] border text-gray-300 hover:text-blue-500 border-dashed border-[#CFD9E0] rounded-lg flex items-center justify-center transition-all duration-300",a.disabled?"opacity-50 cursor-not-allowed":"cursor-pointer hover:border-blue-500 hover:bg-blue-50"])},[e.createVNode(Ve,{class:"w-6 h-6"})],2)])):e.createCommentVNode("",!0),a.multiple?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:2,onClick:i[4]||(i[4]=d=>s.value?.click()),class:e.normalizeClass([a.disabled?"opacity-50 cursor-not-allowed":"cursor-pointer hover:border-blue-500","h-[120px] w-[120px] border text-gray-300 hover:text-blue-500 border-dashed border-gray-300 rounded-lg flex items-center justify-center cursor-pointer hover:border-blue-500 transition-all duration-300 hover:bg-blue-50"])},[e.createVNode(Ve,{class:"w-6 h-6"})],2))]))}}),qs={class:"max-w-[55vw]"},Gs={class:"text-sm font-semibold text-gray-800 truncate dark:text-neutral-200"},Ks={class:"flex items-center text-xs text-gray-500 truncate dark:text-neutral-500"},Zs={class:"px-[5px]"},Ws={class:""},De=e.defineComponent({__name:"vs-widget-file-info",props:{item:{default:null}},setup(o){const t=o,n=e.computed(()=>{try{return new Date(t.item.cdate).toLocaleDateString("uk-UA",{day:"2-digit",month:"long",year:"numeric"})}catch{return""}});function s(l){if(l<1024)return`${l} B`;const r=l/1024;return r<1024?`${r.toFixed(2)} KB`:`${(r/1024).toFixed(2)} MB`}return(l,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[r[1]||(r[1]=e.createStaticVNode('<div class="flex items-center justify-center h-[30px] w-[30px]"><svg xmlns="http://www.w3.org/2000/svg" height="24" width="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-file"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"></path></svg></div>',1)),e.createElementVNode("div",qs,[e.createElementVNode("p",Gs,e.toDisplayString(l.item?.uploaded_name),1),e.createElementVNode("p",Ks,[e.createElementVNode("span",null,e.toDisplayString(l.item?.username),1),e.withDirectives(e.createElementVNode("span",Zs,"|",512),[[e.vShow,l.item?.username]]),e.createElementVNode("span",null,e.toDisplayString(n.value),1),r[0]||(r[0]=e.createElementVNode("span",{class:"px-[5px]"},"|",-1)),e.createElementVNode("span",Ws,e.toDisplayString(s(l.item?.size)),1)])])],64))}}),Ys={class:"p-3 relative group flex items-center gap-x-3 border border-gray-200 bg-white rounded-md w-full"},Js={key:0,class:"flex w-full gap-x-3 items-center"},Xs={key:1,class:"flex gap-x-3 w-full items-center"},Qs={key:2,class:"flex gap-x-3 w-full items-center"},el=["href"],tl={key:3,class:"flex gap-x-3 w-full items-center"},nl={class:"lg:absolute lg:top-3 lg:end-1 opacity-100"},sl={class:"p-0.5 sm:p-1 inline-flex items-center gap-0.5 bg-white rounded-lg dark:bg-neutral-800 dark:border-neutral-700"},ll={class:"inline-block"},rl={class:"inline-block"},ol=e.defineComponent({__name:"vs-widget-file-item",props:{item:{default:null},index:{default:0},prefix:{default:"/api"}},emits:["update","openModal","openLightbox"],setup(o,{emit:t}){const n=o,s=t;function l(c){return["pdf","json"].includes(c.ext)}function r(c){return["ppt","pptx","doc","docx","xls","xlsx"].includes(c.ext)}function a(c){const p=document.createElement("a");p.setAttribute("download",c?.uploaded_name),p.href=c?.file_path,p.click()}async function i(){try{await fetch(`${n.prefix}/widget/file/${n.item.entity_id}/${n.item.file_id}`),s("update")}catch(c){console.error(c)}}function d(){s("openModal",{title:"Ви впевнені?",message:"Ви впевнені, що хочете видалити цей файл?",confirmButtonText:"Так, я впевнена/ий",cancelButtonText:"Скасувати",confirm:i,updateListOnConfirm:!0})}function u(c){(n.item.ext==="jpg"||n.item.ext==="png")&&s("openLightbox",{item:n.item,index:c})}return(c,p)=>(e.openBlock(),e.createElementBlock("div",Ys,[c.item.ext==="jpg"||c.item.ext==="png"?(e.openBlock(),e.createElementBlock("div",Js,[e.createElementVNode("div",{class:"max-w-[55vw] cursor-pointer flex gap-x-3 w-full items-center",onClick:p[0]||(p[0]=h=>u(c.index))},[e.createVNode(De,{item:c.item},null,8,["item"])])])):l(c.item)?(e.openBlock(),e.createElementBlock("div",Xs,[e.createVNode(De,{item:c.item},null,8,["item"])])):r(c.item)?(e.openBlock(),e.createElementBlock("div",Qs,[e.createElementVNode("a",{href:`/api/file-preview?id=${c.item.file_id}`,target:"_blank",class:"flex gap-x-3 w-full items-center"},[e.createVNode(De,{item:c.item},null,8,["item"])],8,el)])):(e.openBlock(),e.createElementBlock("div",tl,[e.createVNode(De,{item:c.item},null,8,["item"])])),e.createElementVNode("div",nl,[e.createElementVNode("div",sl,[e.createElementVNode("div",ll,[e.createElementVNode("button",{class:"inline-flex p-[6px] justify-center items-center gap-x-2 rounded-lg border border-transparent text-gray-500 hover:bg-gray-100 disabled:opacity-50 disabled:pointer-events-none dark:text-neutral-400 focus:outline-none focus:bg-gray-100 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700",onClick:p[1]||(p[1]=h=>a(c.item))},[e.createVNode(dt,{height:"14",width:"14"})])]),p[3]||(p[3]=e.createElementVNode("div",{class:"w-px h-5 mx-1 bg-gray-200 dark:bg-neutral-700"},null,-1)),e.createElementVNode("div",rl,[e.createElementVNode("button",{type:"button",class:"size-[30px] inline-flex justify-center items-center gap-x-2 rounded-lg border border-transparent text-red-600 hover:bg-red-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-red-100 dark:text-red-500 dark:hover:bg-red-500/20 dark:focus:bg-red-500/20",onClick:p[2]||(p[2]=h=>d())},[e.createVNode($e,{height:"14",width:"14"})])])])])]))}}),al={},il={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-download"};function dl(o,t){return e.openBlock(),e.createElementBlock("svg",il,t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"},null,-1),e.createElementVNode("path",{d:"M7 11l5 5l5 -5"},null,-1),e.createElementVNode("path",{d:"M12 4l0 12"},null,-1)]))}const ul=H(al,[["render",dl]]),cl={class:"flex flex-col widget-file xl:bg-white xl:rounded-xl dark:xl:bg-neutral-800 dark:xl:border-neutral-700 w-full"},pl={class:"flex w-full mb-[12px] items-center gap-x-2"},hl={class:"font-semibold text-gray-800 dark:text-neutral-200 text-[14px]"},fl={class1:"ml-auto"},ml={class:"py-1.5 px-4 inline-flex items-center gap-x-2 text-sm font-medium rounded-lg bg-gray-100 cursor-pointer hover:bg-gray-200 text-gray-800 shadow-2xs hover:bg-gray-50 focus:outline-hidden focus:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-800 dark:border-neutral-700 dark:text-white dark:hover:bg-neutral-700 dark:focus:bg-neutral-700"},gl={key:0,class:"py-4 mb-4 space-y-4 border-gray-200 border-y dark:border-neutral-700"},kl={class:"relative"},bl={key:1,class:"space-y-3 max-h-[300px] overflow-y-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"},yl={key:0},pt=e.defineComponent({__name:"vs-input-file-list",props:{id:{default:""},prefix:{default:"/api"},style:{},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{}},emits:["update"],setup(o,{emit:t}){const n=o,s=e.inject("form"),l=e.computed(()=>s.value.formId),r=e.ref(!1),a=e.ref(0),i=t,d=e.ref(!1),u=e.ref({}),c=e.ref([]),p=e.ref(""),h=e.computed(()=>Array.isArray(c.value)?c.value.filter(y=>y.ext==="jpg"||y.ext==="png").map(y=>y?.file_path):[]),_=e.computed(()=>p.value===""?c.value:c.value.filter(y=>y?.uploaded_name?.includes(p.value))),j=y=>{const f=h.value.findIndex(b=>b===y.item.file_path);f!==-1&&(r.value=!0,a.value=f)},A=async()=>{try{const y=await fetch(`${n.prefix}/widget/file/${l.value}`).then(f=>f.json());c.value=y?.rows}catch(y){console.error(y)}},D=async y=>{await Promise.all(Array.from(y.target.files).map(async f=>{const b=new FormData;b.append("file",f);try{const E=`${n.prefix}/widget/file/${l.value}`,w=await fetch(E,{method:"POST",body:b});return w.ok?(i("update","file-list"),f):(X.notify({type:w.status>=400&&w.status<500?"warning":"error",title:"Error",message:`Error code: ${w.status}`}),null)}catch(E){return X.notify({type:"error",title:"Error",message:E.message||"Unknown error"}),console.error(E),null}})),await A()},V=y=>{const f={...y};return y.cancel||(f.cancel=()=>{d.value=!1}),y.updateListOnConfirm&&(f.confirm=async()=>{await y.confirm(),d.value=!1,A()}),f},I=y=>{u.value=V(y),d.value=!0};return e.watch(l,y=>{y&&A()}),e.onMounted(()=>{l.value&&A()}),(y,f)=>{const b=e.resolveComponent("Lightbox"),E=e.resolveComponent("MessageBox");return e.openBlock(),e.createElementBlock("div",cl,[e.createElementVNode("div",pl,[e.createElementVNode("h2",hl," Файлів: "+e.toDisplayString(c.value?.length),1),e.createElementVNode("div",fl,[e.createElementVNode("label",null,[e.createElementVNode("input",{type:"file",class:"hidden",onChange:f[0]||(f[0]=w=>D(w))},null,32),e.createElementVNode("div",ml,[e.createVNode(ul,{height:"16",width:"16"})])])])]),c.value?.length>4?(e.openBlock(),e.createElementBlock("div",gl,[e.createElementVNode("div",null,[e.createElementVNode("div",kl,[f[8]||(f[8]=e.createElementVNode("div",{class:"absolute inset-y-0 start-0 flex items-center pointer-events-none z-[1] ps-3.5"},[e.createElementVNode("svg",{class:"flex-shrink-0 text-gray-500 size-4 dark:text-neutral-400",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("circle",{cx:"11",cy:"11",r:"8"}),e.createElementVNode("path",{d:"m21 21-4.3-4.3"})])],-1)),e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":f[1]||(f[1]=w=>p.value=w),class:"py-2 px-3 ps-10 pe-16 block w-full bg-gray-200 xl:bg-gray-100 rounded-lg text-sm focus:border-blue-500 h-[40px] focus:border-2 focus:outline-none disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:border-transparent dark:text-neutral-400 dark:placeholder:text-neutral-400 dark:focus:ring-neutral-600",placeholder:"Введіть назву файлу"},null,512),[[e.vModelText,p.value,void 0,{trim:!0}]])])])])):e.createCommentVNode("",!0),c.value?.length?(e.openBlock(),e.createElementBlock("div",bl,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.value,(w,Z)=>(e.openBlock(),e.createBlock(ol,{key:Z,prefix:y.prefix,item:w,index:Z,onUpdate:f[2]||(f[2]=Y=>y.$emit("update","file-list")),onOpenModal:f[3]||(f[3]=Y=>I(Y)),onOpenLightbox:f[4]||(f[4]=Y=>j(Y))},null,8,["prefix","item","index"]))),128)),_.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",yl,f[9]||(f[9]=[e.createElementVNode("p",{class:"text-sm text-gray-600 font-sm"}," Файлів з такою назвою не існує, введіть інше пошукове слово ",-1)])))])):e.createCommentVNode("",!0),e.createVNode(b,{modelValue:r.value,"onUpdate:modelValue":f[5]||(f[5]=w=>r.value=w),startIndex:a.value,"onUpdate:index":f[6]||(f[6]=w=>a.value=w),images:h.value},null,8,["modelValue","startIndex","images"]),e.createVNode(E,e.mergeProps({modelValue:d.value,"onUpdate:modelValue":f[7]||(f[7]=w=>d.value=w),onConfirm:u.value.confirm},u.value),null,16,["modelValue","onConfirm"])])}}}),xl={class:"flex items-center justify-between"},wl={class:"text-[16px] text-gray-900 font-medium"},_l={class:"grid gap-3"},El=H(e.defineComponent({__name:"vs-container-switcher",props:{title:{type:String,default:""},style:{type:Object,default:()=>({})},isOpen:{type:Boolean,default:!1}},setup(o){const t=o,n=e.ref(t.isOpen);return e.watch(()=>t.isOpen,s=>{n.value=s}),(s,l)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",xl,[e.createElementVNode("p",wl,e.toDisplayString(o.title),1),e.createVNode(Ue,{modelValue:n.value,"onUpdate:modelValue":l[0]||(l[0]=r=>n.value=r),style:e.normalizeStyle(o.style)},null,8,["modelValue","style"])]),e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",_l,[e.renderSlot(s.$slots,"default",{},void 0,!0)],512),[[e.vShow,n.value]])]),_:3})]))}}),[["__scopeId","data-v-90320b87"]]),Vl={class:"text-[16px] text-gray-900 font-medium"},Cl={class:"grid gap-3"},vl=H(e.defineComponent({__name:"vs-container-accordion",props:{title:{type:String,default:""},style:{type:Object,default:()=>({})},isOpen:{type:Boolean,default:!1}},setup(o){const t=o,n=e.ref(t.isOpen);return e.watch(()=>t.isOpen,s=>{n.value=s}),(s,l)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("button",{type:"button",onClick:l[0]||(l[0]=r=>n.value=!n.value),class:"flex items-center gap-2"},[e.createVNode(e.unref(On),{class:e.normalizeClass(["h-4 w-4 duration-300",[n.value?"-rotate-180":""]])},null,8,["class"]),e.createElementVNode("span",Vl,e.toDisplayString(o.title),1)]),e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",Cl,[e.renderSlot(s.$slots,"default",{},void 0,!0)],512),[[e.vShow,n.value]])]),_:3})]))}}),[["__scopeId","data-v-590eff11"]]),Bl={class:"flex items-center justify-between"},Sl={switcher:El,accordion:vl,default:e.defineComponent({__name:"vs-container-default",props:{title:{type:String,default:""},style:{type:Object,default:()=>({})}},setup(o){return(t,n)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",Bl,[e.createElementVNode("p",null,e.toDisplayString(o.title),1)]),e.renderSlot(t.$slots,"default")]))}})},re={Equal:"==",Inequal:"!=",Higer:">",HigerOrEqual:">=",Lower:"<",LowerOrEqual:"<=",Between:"between",StartWith:"^",EndWith:"$",Contain:"*",In:"in",NotIn:"not_in"},Nl=(o,t)=>String(o)===String(t),Ml=(o,t)=>String(o)!==String(t),Fl=(o,t)=>o>t,Al=(o,t)=>o>=t,$l=(o,t)=>o<t,Dl=(o,t)=>o<=t,Il=(o,t)=>Array.isArray(t)&&t.length===2?o>=t[0]&&o<=t[1]:!1,Tl=(o,t)=>String(o).startsWith(String(t)),Ll=(o,t)=>String(o).endsWith(String(t)),Rl=(o,t)=>String(o).includes(String(t)),Ol=(o,t)=>Array.isArray(t)?t.includes(o):!1,zl=(o,t)=>Array.isArray(t)?!t.includes(o):!0,ht=(o,t)=>{if(!t)return!0;switch(t?.[1]){case re.Equal:return Nl(o,t?.[2]);case re.Inequal:return Ml(o,t?.[2]);case re.Higer:return Fl(o,t?.[2]);case re.HigerOrEqual:return Al(o,t?.[2]);case re.Lower:return $l(o,t?.[2]);case re.LowerOrEqual:return Dl(o,t?.[2]);case re.Between:return Il(o,t?.[2]);case re.StartWith:return Tl(o,t?.[2]);case re.EndWith:return Ll(o,t?.[2]);case re.Contain:return Rl(o,t?.[2]);case re.In:return Ol(o,t?.[2]);case re.NotIn:return zl(o,t?.[2]);default:return!0}},ft=e.defineComponent({__name:"vs-input-container",props:{style:{type:Object,default:()=>({})},title:{type:String,default:""},view:{type:String,default:"default"},schema:{type:Array,default:()=>[]}},setup(o){const t=o,n=e.inject("formValues",{default:{}}),s=e.inject("form"),l=e.computed(()=>t.schema?.filter(a=>{const i=a?.conditions;if(!i)return!0;const d=Array.isArray(i)?i[0]:i,u=n?.value?.[d];return ht(u,i)})),r=e.computed(()=>Sl[t.view]);return(a,i)=>o.schema?.length?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.value),{key:0,title:o.title,style:e.normalizeStyle(o.style)},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,d=>(e.openBlock(),e.createBlock(vt,e.mergeProps({key:d.name},{ref_for:!0},d,{item:d,modelValue:e.unref(n)[d.name],"onUpdate:modelValue":u=>e.unref(n)[d.name]=u,style:o.style,error:e.unref(s)?.errors?.[d.name]}),null,16,["item","modelValue","onUpdate:modelValue","style","error"]))),128))]),_:1},8,["title","style"])):e.createCommentVNode("",!0)}}),jl=["aria-expanded","data-focus"],Ul={class:"flex items-center"},Pl=["title"],Hl=["onClick"],ql=["title"],Gl={key:2,class:"text-gray-500 truncate"},Kl={class:"flex-1 min-w-[2px]"},Zl=["placeholder"],Wl={class:"flex items-center shrink-0"},Yl=["disabled"],Jl=["disabled","title"],Xl=["aria-disabled","onClick"],Ql={key:1,class:"px-3 py-2 text-center text-gray-500"},er=["disabled"],qe=e.defineComponent({__name:"vs-input-select",props:{multiple:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},mode:{},defaultValue:{},search:{type:Boolean,default:!0},placeholder:{default:"Оберіть значення"},prefix:{default:"api"},host:{default:""},data:{default:""},options:{default:()=>[]},api:{default:null},maxHeight:{default:400},parent:{},add:{},teleport:{default:"body"},style:{default:()=>({})},customClass:{default:""},modelValue:{},error:{default:null},name:{}},emits:["change","update:modelValue"],setup(o,{emit:t}){const n=o,s=t,l=e.computed(()=>n.multiple),r=e.computed(()=>n.disabled);le(n.style);const a=e.computed({get:()=>n.modelValue,set:k=>s("update:modelValue",k)});!a.value&&n.defaultValue&&(a.value=n.defaultValue);const i=e.ref(null),d=e.ref(null),u=e.ref(null),c=e.ref(null),p=e.ref(!1),h=e.ref(!1),_=e.ref(null),j=e.ref([]),A=e.ref(-1),D=e.ref([]),V=e.ref(""),I=e.ref(null),y=e.ref("bottom"),f=e.ref({}),b=e.ref([]),E=e.computed(()=>{if(!b.value.length)return[];const k=new Map(j.value.map(g=>[g.id?.toString(),g]));return b.value.map(g=>k.get(g?.toString())).filter(g=>!!g)}),w=e.computed(()=>n.placeholder||"Select..."),Z=e.computed(()=>l.value?!b.value.length&&V.value==="":!_.value?.text&&V.value===""),Y=e.computed(()=>r.value?!1:l.value?b.value.length>0:!!a.value),J=k=>l.value?b.value.some(g=>g?.toString()===k?.toString()):a.value?.toString()===k?.toString(),B=e.computed(()=>{let k=j.value??[];if(!n.data&&V.value.trim()!==""){const g=V.value.toLowerCase();k=k.filter(v=>v.text?.toLowerCase?.().includes(g))}if(l.value&&b.value.length){const g=new Set(b.value.map(v=>v?.toString()));k=k.filter(v=>!g.has(v.id?.toString()))}return k}),z=e.inject("values"),q=e.computed(()=>n.parent?z?.value?.[n.parent]??null:null),G=async k=>{if(!n.data){let g=n.options??[];if(k?.trim()){const v=k.toLowerCase();g=g.filter(U=>U.text?.toLowerCase?.().includes(v))}return g}try{const g=n.host??"",v=n.prefix??"api",U=n.api??`/${v}/suggest/${n.data}`,te=`${g}${U}`,oe=new URLSearchParams;return oe.set("json","1"),k&&oe.set("key",k),q.value!==void 0&&q.value!==null&&q.value!==""&&oe.set("parent",String(q.value)),(await fetch(`${te}?${oe.toString()}`).then(_e=>_e.json()))?.data??[]}catch{return[]}},M=async()=>{n.data?j.value=await G(V.value):j.value=n.options?[...n.options]:[]},C=async k=>{if(k==null)return null;const g=j.value?.find(U=>U?.id?.toString()===String(k));return g||((await G(String(k)))?.[0]??null)},S=async k=>{const g=new Set(j.value.map(U=>U.id?.toString())),v=k.filter(U=>!g.has(U?.toString()));v.length&&await v.reduce(async(U,te)=>{await U;const oe=await C(te);oe&&j.value.push(oe)},Promise.resolve())},T=async()=>{r.value||(p.value=!0,await M(),await e.nextTick(()=>{O(),I.value?.focus(),B.value.length?A.value=0:A.value=-1}))},K=()=>{p.value=!1,A.value=-1},ue=async k=>{if(r.value)return;!p.value?await T():K()},xe=async()=>{p.value?I.value?.focus():await T()},Ye=()=>{l.value?(b.value=[],a.value=[],s("change",[])):(_.value=null,a.value=null,s("change",null)),V.value="",e.nextTick(()=>I.value?.focus())},Je=k=>{l.value&&(b.value=b.value.filter(g=>g?.toString()!==k?.toString()),a.value=[...b.value],s("change",a.value),e.nextTick(()=>I.value?.focus()))},Oe=k=>{l.value?(J(k.id)||(b.value=[...b.value,k.id],a.value=[...b.value],s("change",a.value)),V.value="",e.nextTick(()=>{I.value?.focus(),A.value=Math.min(A.value,B.value.length-1)})):(_.value=k,a.value=k.id,s("change",a.value),V.value="",K())},we=k=>{J(k.id)||Oe(k)},m=(k,g)=>{if(!k||!g)return;const v=k.offsetTop,U=v+k.offsetHeight,te=g.scrollTop,oe=te+g.clientHeight;let be=g.scrollTop;v<te?be=v-80:U>oe&&(be=U-g.clientHeight+4);const _e=g;_e.scrollTop=be},x=k=>{let g=k.parentElement;for(;g;){if(g.classList.contains("ui-dialog__content"))return g;const v=window.getComputedStyle(g),U=v.overflow+v.overflowY+v.overflowX;if(U.includes("auto")||U.includes("scroll")||g===document.body||g===document.documentElement)return g;g=g.parentElement}return document.body},O=()=>{if(!d.value)return;const k=d.value.getBoundingClientRect(),g=window.innerHeight||document.documentElement.clientHeight,v=window.innerWidth||document.documentElement.clientWidth,U=8,te=8,oe=n.maxHeight||300,be=g-k.bottom-te-U,_e=k.top-te-U,je=be>=_e,Qe=Math.max(v-U*2,0);let{width:Fe}=k;Qe>0&&Fe>Qe&&(Fe=Qe);let{left:Ae}=k;Ae+Fe+U>v&&(Ae=v-Fe-U),Ae=Math.max(Ae,U);const pi=Math.min(oe,Math.max(je?be:_e,50));y.value=je?"bottom":"top",f.value={position:"fixed",left:`${Ae}px`,width:`${Fe}px`,minWidth:"300px",maxHeight:`${pi}px`,transform:je?"none":"translateY(-100%)",top:je?`${k.bottom+te}px`:`${k.top-te}px`}},F=async k=>{r.value||!p.value&&(k.key==="ArrowDown"||k.key==="ArrowUp")&&(k.preventDefault(),await T())},W=k=>{if(!p.value)return;const{key:g}=k;if(g==="ArrowDown")k.preventDefault(),A.value+1<B.value.length&&(A.value+=1,m(D.value[A.value],u.value));else if(g==="ArrowUp")k.preventDefault(),A.value>0&&(A.value-=1,m(D.value[A.value],u.value));else if(g==="Enter"){k.preventDefault();const v=B.value[A.value];v&&Oe(v),I.value?.blur()}else g==="Escape"?(k.preventDefault(),K()):g==="Backspace"?l.value&&V.value===""&&b.value.length&&(b.value=b.value.slice(0,-1),a.value=[...b.value],s("change",a.value)):g==="Home"?(A.value=0,m(D.value[0],u.value)):g==="End"?(A.value=B.value.length-1,m(D.value[A.value],u.value)):g==="Tab"&&K()},se=()=>{r.value||(h.value=!0)},he=()=>{h.value=!1,V.value=""},fe=k=>{k.key==="Escape"&&p.value&&K()},me=k=>{const g=k.target;i.value?.contains(g)||c.value?.contains(g)||K()},ge=k=>{p.value&&u.value&&!u.value.contains(k.target)&&O()},Pt=()=>{p.value&&O()},Ht=()=>{p.value&&O()};e.watch(()=>n.options,k=>{k?.length&&(j.value=[...k])},{immediate:!0});const qt=async()=>{if(l.value)Array.isArray(a.value)?b.value=[...a.value]:(b.value=a.value==null?[]:[a.value],a.value=[...b.value]),!n.options?.length&&n.data&&await S(b.value);else{if(Array.isArray(a.value)){const k=a.value[0]??null;a.value=k??null}_.value=await C(a.value)}};e.watch(a,()=>{qt()}),e.onMounted(async()=>{addEventListener("keydown",fe),addEventListener("scroll",ge,!0),addEventListener("resize",Pt),document.addEventListener("click",me,!0),d.value&&x(d.value).addEventListener("scroll",Ht,!0),n.options?.length?j.value=[...n.options]:n.data&&(j.value=await G("")),await qt()}),e.onUnmounted(()=>{removeEventListener("keydown",fe),removeEventListener("scroll",ge,!0),removeEventListener("resize",Pt),document.removeEventListener("click",me,!0),d.value&&x(d.value).removeEventListener("scroll",Ht,!0)});const ze=e.ref(!1),Xe=e.ref({}),Gt=e.ref([]),Kt=e.ref(null);async function ii(){if(!n.add?.token||Kt?.value.validate())return;const g=n.add.api??`/api/table/${n.add.token}`,{id:v}=await fetch(g,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Xe.value)}).then(U=>U.json());if(!n.options?.length&&n.data){const{data:U}=await fetch(`${n.api??`/api/suggest/${n.data}`}?val=${v}`).then(te=>te.json());_.value=U[0],j.value.push(U[0]),a.value=v}ze.value=!1,X.notify({title:"Success!",message:"Object created."})}async function di(){if(!n.add)return null;const k=await fetch(`/api/template/form/${n.add.form}`).then(g=>g.json());return Gt.value=k.schema,ze.value=!0,null}function ui(k,g=200){let v;return(...U)=>{v&&clearTimeout(v),v=window.setTimeout(()=>k(...U),g)}}const ci=ui(async k=>{j.value=await G(k)},200);return e.watch(V,k=>{n.data&&ci(k.trim())}),e.watch(()=>n.options,k=>{!n.data&&k?.length&&(j.value=[...k])},{immediate:!0}),e.watch(()=>n.parent??n.parentValue,()=>{n.data&&M()}),e.watch(q,async()=>{n.data&&(l.value?(b.value=[],a.value=[],s("change",[])):(_.value=null,a.value=null,s("change",null)))}),(k,g)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(e.unref(X.VsModal),{visible:ze.value,"onUpdate:visible":g[1]||(g[1]=v=>ze.value=v),title:"Додати",buttonText:"Додати",onDone:ii,teleport:k.teleport},{default:e.withCtx(()=>[e.createVNode(ke,{schema:Gt.value,modelValue:Xe.value,"onUpdate:modelValue":g[0]||(g[0]=v=>Xe.value=v),ref_key:"addForm",ref:Kt},null,8,["schema","modelValue"])]),_:1},8,["visible","teleport"]),e.createElementVNode("div",{class:"flex gap-1 w-full",ref_key:"selectRoot",ref:i,onClick:g[4]||(g[4]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:e.normalizeClass(["relative w-full font-sans",n.customClass])},[g[9]||(g[9]=e.createElementVNode("span",{id:"react-select-live-region",class:"sr-only"},null,-1)),g[10]||(g[10]=e.createElementVNode("span",{"aria-live":"polite","aria-atomic":"false","aria-relevant":"additions text",role:"log",class:"sr-only"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["flex min-h-[38px] items-center justify-between rounded border transition-colors bg-white","border-gray-300 hover:border-gray-400",p.value||h.value?"border-blue-500 ring-1 ring-blue-500":"",r.value?"bg-gray-100 text-gray-400 cursor-not-allowed hover:border-gray-300":""]),role:"combobox","aria-expanded":p.value,"aria-haspopup":"listbox",onKeydown:F,onClick:xe,"data-focus":p.value||h.value?"true":"false"},[e.createElementVNode("div",{class:"flex flex-1 items-center gap-1 py-0.5 pl-2 pr-0 overflow-hidden",ref_key:"triggerRef",ref:d},[l.value&&b.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(E.value,v=>(e.openBlock(),e.createElementBlock("div",{class:"flex min-w-0 bg-[#e6e6e6] rounded-sm m-0.5 box-border",key:v.id},[e.createElementVNode("div",Ul,[v?.color?(e.openBlock(),e.createElementBlock("span",{key:0,class:"w-[16px] h-[16px] rounded-md block ml-1.5",style:e.normalizeStyle({backgroundColor:v?.color})},null,4)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"truncate text-gray-900 overflow-hidden",title:v.text},e.toDisplayString(v.text),9,Pl)]),e.createElementVNode("div",{role:"button",class:"flex items-center rounded-sm px-1 box-border hover:bg-[#ffbdad] hover:text-[#de350b]",onClick:e.withModifiers(U=>Je(v.id),["stop"])},g[5]||(g[5]=[e.createElementVNode("svg",{height:"14",width:"14",viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",class:"inline-block fill-current stroke-current leading-none stroke-0"},[e.createElementVNode("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"})],-1)]),8,Hl)]))),128)):!l.value&&!h.value&&_.value?.text&&V.value===""?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["truncate text-gray-900"]),title:_.value.text},[_.value?.color?(e.openBlock(),e.createElementBlock("span",{key:0,class:"w-[14px] h-[14px] rounded-md block mr-1 mt-1 absolute",style:e.normalizeStyle({backgroundColor:_.value?.color})},null,4)):e.createCommentVNode("",!0),e.createElementVNode("span",{class:e.normalizeClass({"pl-5":_.value?.color})},e.toDisplayString(_.value.text),3)],8,ql)):e.createCommentVNode("",!0),Z.value?(e.openBlock(),e.createElementBlock("div",Gl,e.toDisplayString(w.value),1)):e.createCommentVNode("",!0),e.createElementVNode("div",Kl,[!r.value&&k.search?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,ref_key:"inputRef",ref:I,class:"w-full bg-transparent outline-none border-0 m-0 p-0 text-gray-900",autocapitalize:"none",autocomplete:"off",autocorrect:"off",spellcheck:"false",type:"text",tabindex:"0","aria-autocomplete":"list",placeholder:(l.value&&b.value.length?" ":null)||(h.value&&!V.value?.length?_.value?.text:" "),"onUpdate:modelValue":g[2]||(g[2]=v=>V.value=v),onFocus:se,onBlur:he,onKeydown:W},null,40,Zl)),[[e.vModelText,V.value]]):e.createCommentVNode("",!0)])],512),e.createElementVNode("div",Wl,[Y.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"px-2 text-gray-400 hover:text-gray-500 transition-colors disabled:opacity-50","aria-hidden":"true",disabled:r.value,onClick:e.withModifiers(Ye,["stop"])},g[6]||(g[6]=[e.createElementVNode("svg",{height:"20",width:"20",viewBox:"0 0 20 20",class:"fill-current"},[e.createElementVNode("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"})],-1)]),8,Yl)):e.createCommentVNode("",!0),g[8]||(g[8]=e.createElementVNode("div",{class:"self-stretch w-px bg-[#ccc] my-[1px]"},null,-1)),e.createElementVNode("button",{type:"button",class:"px-2 text-gray-400 hover:text-gray-500 transition-colors disabled:opacity-50","aria-hidden":"true",disabled:r.value,onClick:g[3]||(g[3]=e.withModifiers(v=>ue(),["stop"])),title:p.value?"Закрити список":"Відкрити список"},g[7]||(g[7]=[e.createElementVNode("svg",{height:"20",width:"20",viewBox:"0 0 20 20",class:"fill-current"},[e.createElementVNode("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"})],-1)]),8,Jl)])],42,jl),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[p.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"dropdownRef",ref:c,class:e.normalizeClass(["fixed z-[3000] rounded bg-white shadow-[0_0_0_1px_rgba(0,0,0,0.1),0_4px_11px_rgba(0,0,0,0.1)]"]),style:e.normalizeStyle(f.value),role:"listbox"},[e.createElementVNode("div",{class:"overflow-y-auto py-1",style:e.normalizeStyle({maxHeight:f.value.maxHeight||"300px"}),ref_key:"listRef",ref:u},[B.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(B.value,(v,U)=>(e.openBlock(),e.createElementBlock("div",{key:v.id,ref_for:!0,ref:te=>D.value[U]=te,class:e.normalizeClass(["flex px-3 py-2 cursor-default select-none text-gray-900 ",J(v.id)?"bg-blue-500 text-white":"bg-white hover:bg-blue-100",A.value===U&&!J(v.id)?"bg-blue-100":""]),"aria-disabled":J(v.id)?"true":"false",role:"option",tabindex:"-1",onClick:te=>we(v)},[v?.color?(e.openBlock(),e.createElementBlock("span",{key:0,class:"w-[11px] h-[11px] rounded-full block mr-1 mt-1.5",style:e.normalizeStyle({backgroundColor:v?.color})},null,4)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["leading-[19px]",A.value===v.id?"text-white":"",(A.value===U,"")])},e.toDisplayString(v.text),3)],10,Xl))),128)):(e.openBlock(),e.createElementBlock("div",Ql," No options "))],4)],4)):e.createCommentVNode("",!0)]))],2),n.add?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:di,class:"bg-white hover:bg-gray-100 text-sm text-gray-900 py-[10px] px-3 border border-stone-200 rounded-md h-[38px] flex items-center gap-2",disabled:r.value,type:"button"},[e.createVNode(Ve,{width:"16",height:"16"}),g[11]||(g[11]=e.createElementVNode("span",null,"Додати",-1))],8,er)):e.createCommentVNode("",!0)],512)],64))}}),tr=["placeholder","disabled"],mt=e.defineComponent({__name:"vs-input-textarea",props:e.mergeModels({style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{},name:{},placeholder:{default:""}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const t=o,{inputClass:n}=le(t.style),s=e.useModel(o,"modelValue");return(l,r)=>e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{"onUpdate:modelValue":r[0]||(r[0]=a=>s.value=a),placeholder:l.placeholder,disabled:l.disabled,row:"2",class:e.normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f] h-auto bg-white",[e.unref(n)]]),style:{border:"1px solid #CFD9E0"}},null,10,tr)),[[e.vModelText,s.value]])}}),nr={},sr={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-search stroke-gray-500 transition-all"};function lr(o,t){return e.openBlock(),e.createElementBlock("svg",sr,t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0"},null,-1),e.createElementVNode("path",{d:"M21 21l-6 -6"},null,-1)]))}const rr=H(nr,[["render",lr]]),or={},ar={class:"flex-shrink-0 mt-0.5 size-3.5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function ir(o,t){return e.openBlock(),e.createElementBlock("svg",ar,t[0]||(t[0]=[e.createElementVNode("path",{d:"m3 16 4 4 4-4"},null,-1),e.createElementVNode("path",{d:"M7 20V4"},null,-1),e.createElementVNode("path",{d:"m21 8-4-4-4 4"},null,-1),e.createElementVNode("path",{d:"M17 4v16"},null,-1)]))}const dr=H(or,[["render",ir]]),ur={},cr={xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function pr(o,t){return e.openBlock(),e.createElementBlock("svg",cr,t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"},null,-1),e.createElementVNode("path",{d:"M7 9l5 -5l5 5"},null,-1),e.createElementVNode("path",{d:"M12 4l0 12"},null,-1)]))}const hr=H(ur,[["render",pr]]),fr={},mr={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function gr(o,t){return e.openBlock(),e.createElementBlock("svg",mr,t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"},null,-1),e.createElementVNode("path",{d:"M7 11l5 5l5 -5"},null,-1),e.createElementVNode("path",{d:"M12 4l0 12"},null,-1)]))}const kr=H(fr,[["render",gr]]),br={},yr={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function xr(o,t){return e.openBlock(),e.createElementBlock("svg",yr,t[0]||(t[0]=[e.createStaticVNode('<circle cx="9" cy="12" r="1"></circle><circle cx="9" cy="5" r="1"></circle><circle cx="9" cy="19" r="1"></circle><circle cx="15" cy="12" r="1"></circle><circle cx="15" cy="5" r="1"></circle><circle cx="15" cy="19" r="1"></circle>',6)]))}const gt=H(br,[["render",xr]]),wr={},_r={viewBox:"0 0 178 90",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function Er(o,t){return e.openBlock(),e.createElementBlock("svg",_r,t[0]||(t[0]=[e.createStaticVNode('<rect x="27" y="50.5" width="124" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="27" y="50.5" width="124" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-50 dark:stroke-neutral-700/10"></rect><rect x="34.5" y="58" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="61" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="73" width="77" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/30"></rect><rect x="27" y="36" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="39" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="51" width="92" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><g filter="url(#filter1)"><rect x="12" y="6" width="154" height="40" rx="8" fill="currentColor" class="fill-white dark:fill-neutral-800" shape-rendering="crispEdges"></rect><rect x="12.5" y="6.5" width="153" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/60" shape-rendering="crispEdges"></rect><rect x="20" y="14" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="17" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="29" width="106" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect></g><defs><filter id="filter1" x="0" y="0" width="178" height="64" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"></feColorMatrix><feOffset dy="6"></feOffset><feGaussianBlur stdDeviation="6"></feGaussianBlur><feComposite in2="hardAlpha" operator="out"></feComposite><feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.03 0"></feColorMatrix><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1187_14810"></feBlend><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1187_14810" result="shape"></feBlend></filter></defs>',12)]))}const Vr=H(wr,[["render",Er]]),Cr={},vr={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function Br(o,t){return e.openBlock(),e.createElementBlock("svg",vr,t[0]||(t[0]=[e.createElementVNode("path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z"},null,-1)]))}const Sr=H(Cr,[["render",Br]]),Nr={class:"vs-datatable border rounded-xl w-full flex-grow"},Mr={class:"flex items-center npm gap-[16px] justify-between p-[20px] pb-[16px]"},Fr={class:"relative w-full"},Ar={class:"table-wrapper flex gap-2"},$r={class:"vs-popover inline-block text-slate-700"},Dr={class:"text-center"},Ir={class:""},Tr={class:"py-1 px-0 w-full text-sm text-stone-800 bg-white shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-lg focus:outline-none focus:bg-stone-100 dark:bg-neutral-900 dark:text-neutral-200 dark:focus:bg-neutral-800 after:h-4 after:absolute after:-bottom-4 after:start-0 after:w-full before:h-4 before:absolute before:-top-4 before:start-0 before:w-full"},Lr={class:"flex flex-col p-[1px] gap-[2px] w-[140px]"},Rr={class:"text-sm items-center text-gray-800 flex gap-1"},Or={class:"w-full overflow-x-auto"},zr={class:"w-full table-auto caption-bottom text-sm"},jr={class:"[&_tr]:border-b"},Ur={class:"border-b data-[state=selected]:bg-muted bg-slate-50/50 dark:bg-slate-700/50 hover:bg-slate-50/80 dark:hover:bg-slate-700/80 transition-colors"},Pr={class:"h-10 px-2 align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] w-12 text-center"},Hr={key:0,colspan:"100%",class:"text-center"},qr={class:"w-full"},Gr={class:"p-5 min-h-[200px] flex flex-col justify-center items-center text-center"},Kr=["onDragstart","onDragover","onDrop"],Zr={class:"p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] text-center"},Wr={class:"flex items-center justify-center"},Yr={key:0,class:"inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 border-transparent bg-slate-100 dark:bg-slate-700 text-slate-700 dark:text-slate-300 hover:bg-slate-200 dark:hover:bg-slate-600 transition-colors"},Jr={key:0},Xr=["src"],Qr={key:1,class:"rounded-md max-w-[45px] w-[45px] max-h-[45px] h-[45px] bg-gray-200 flex items-center justify-center"},eo=["innerHTML"],to={key:2,class:"inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 border-transparent bg-slate-100 dark:bg-slate-700 text-slate-700 dark:text-slate-300 hover:bg-slate-200 dark:hover:bg-slate-600 transition-colors"},no={class:"p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]"},so={class:"flex items-center justify-center gap-2"},lo=["onClick"],ro=["onClick"],oo={class:"vs-form__head mr-5 mt-3 flex items-center justify-end sticky top-0 left-0 z-[60] bg-white"},kt=e.defineComponent({__name:"vs-input-datatable",props:e.mergeModels({colModel:{},style:{},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{}},{modelValue:{default:[]},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const t=o,n=e.useModel(o,"modelValue"),s=e.ref({}),l=e.ref(""),r=e.computed(()=>{if(!l.value)return n.value??[];const M=l.value.toLowerCase();return n.value.filter(C=>t.colModel?.some(S=>{const T=C[S.key];return T?Array.isArray(T)?T.join(", ").toLowerCase().includes(M):String(T).toLowerCase().includes(M):!1}))}),a=e.ref(null),i=e.ref(null),d=e.ref(!1),u=e.ref(null),c=e.ref({top:0,left:0}),p=M=>{a.value=M},h=M=>{i.value=M},_=M=>{if(a.value===null||a.value===M){a.value=null,i.value=null;return}const C=[...n.value],[S]=C.splice(a.value,1);C.splice(M,0,S),n.value=C,a.value=null,i.value=null},j=M=>{const S=M.currentTarget.getBoundingClientRect();c.value={top:S.bottom+window.scrollY,left:S.left+window.scrollX},d.value=!d.value},A=()=>{u.value&&u.value.click()},D=M=>{const C=[".jpg",".jpeg",".png",".gif",".bmp",".webp",".svg",".ico",".tiff",".tif"],S=M.toLowerCase();return C.some(T=>S.endsWith(T))},V=M=>{const S=M.target.files?.[0];if(!S)return;const T=new FileReader;T.onload=K=>{try{const ue=K.target?.result;if(typeof ue=="string"){const xe=JSON.parse(ue);Array.isArray(xe)&&n.value.push(...xe)}}catch(ue){console.error("Error parsing file:",ue)}},T.readAsText(S)},I=()=>{const M=JSON.stringify(n.value,null,2),C=new Blob([M],{type:"application/json"}),S=URL.createObjectURL(C),T=document.createElement("a");T.href=S,T.download="data.json",T.click(),URL.revokeObjectURL(S)};e.onMounted(async()=>{const M=t.colModel?.filter(C=>C.data);M?.length&&Promise.all(M.map(async C=>{const T=await(await fetch(`/api/suggest/${C.data}`)).json();s.value[C.key]=T.data}))});const y=e.ref(""),f=e.ref(!1);let b="edit",E=0;const w=e.ref({}),Z=e.ref({});async function Y(){y.value="Додати",f.value=!0,b="add",w.value={}}function J(M,C){const S=C.key||C.name;return s.value[S]&&M[S]?s.value[S].find(T=>T.id.toString()===M[S].toString())?.text??M[S]:M[S]||"-"}async function B(M,C){y.value="Редагувати",f.value=!0,b="edit",E=C,w.value={...M}}function z(){const M=Z.value.validate();if(M){X.notify({type:"warning",title:"Помилка валідації",message:Object.entries(M).map(([C,S])=>`${C}: ${S}`).join(`
2
+ `)});return}b==="add"?Array.isArray(n.value)?n.value=[...n.value,w.value]:n.value=[w.value]:n.value=n.value.map((C,S)=>S===E?w.value:C),f.value=!1}function q(M){n.value=n.value.filter((C,S)=>S!==M)}function G(){f.value=!1}return(M,C)=>(e.openBlock(),e.createElementBlock("div",Nr,[e.createElementVNode("div",Mr,[e.createElementVNode("div",Fr,[e.createVNode(rr,{width:"14",height:"14",class:"absolute left-3 top-1/2 transform -translate-y-1/2 text-stone-500"}),e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":C[0]||(C[0]=S=>l.value=S),placeholder:"Пошук",class:"py-2 px-3 pl-10 w-full bg-gray-100 h-[36px] rounded-[8px] text-[15px] leading-[18px] focus:border-1 text-stone-800 placeholder:text-[#6B7280] focus:outline-blue-500 focus:outline-2"},null,512),[[e.vModelText,l.value]])]),e.createElementVNode("div",Ar,[e.createElementVNode("input",{ref_key:"fileInput",ref:u,onChange:V,class:"hidden",accept:".json",type:"file"},null,544),e.createElementVNode("div",$r,[e.createElementVNode("div",Dr,[e.createElementVNode("div",Ir,[e.createElementVNode("button",{onClick:j,class:"bg-white hover:bg-gray-100 font-semibold text-[15px] leadig-[18.5px] py-[10px] px-[12px] border border-[#E5E7EB] rounded-[8px] h-[38px] max-h-[38px] gap-[8px] flex items-center"},[e.createVNode(dr,{height:"16",width:"16"})])])])])]),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[d.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"text-slate-700 vsTailwind vs-popover__content bottom",style:e.normalizeStyle([{width:"fit-content","z-index":"10002",position:"fixed"},{position:"absolute",top:c.value.top+"px",left:c.value.left+"px"}])},[e.createElementVNode("div",Tr,[e.createElementVNode("div",Lr,[e.createElementVNode("button",{onClick:A,class:"text-slate-700 flex items-center gap-1 px-3 py-2 rounded-md cursor-pointer group hover:bg-gray-100"},[e.createVNode(hr,{class:"text-black",width:"14",height:"14"}),C[4]||(C[4]=e.createTextVNode(" Імпортувати ",-1))]),e.createElementVNode("button",{onClick:I,class:"text-slate-700 flex items-center px-3 py-2 rounded-md cursor-pointer group hover:bg-gray-100"},[e.createElementVNode("span",Rr,[e.createVNode(kr,{class:"text-black",width:"14",height:"14"}),C[5]||(C[5]=e.createTextVNode(" Експортувати ",-1))])])])])],4)):e.createCommentVNode("",!0)])),e.createElementVNode("button",{onClick:Y,class:"text-slate-700 bg-white hover:bg-gray-100 font-semibold text-[15px] leadig-[18.5px] py-[10px] px-[12px] border border-[#E5E7EB] rounded-[8px] h-[38px] max-h-[38px] gap-[8px] flex items-center"},[e.createVNode(Ve),C[6]||(C[6]=e.createTextVNode(" Додати ",-1))])]),e.createElementVNode("div",Or,[e.createElementVNode("table",zr,[e.createElementVNode("thead",jr,[e.createElementVNode("tr",Ur,[e.createElementVNode("th",Pr,[e.createVNode(gt,{width:"24",height:"24",class:"w-4 h-4 mx-auto text-slate-400 dark:text-slate-500"})]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(M.colModel,S=>(e.openBlock(),e.createElementBlock("th",{key:S.key,class:"h-10 px-2 text-left align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] font-semibold text-slate-700 dark:text-slate-300 min-w-[150px]"},e.toDisplayString(S.ua||S.label),1))),128)),C[7]||(C[7]=e.createElementVNode("th",{class:"h-10 px-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] font-semibold text-slate-700 dark:text-slate-300 text-center"}," Дії ",-1))])]),e.createElementVNode("tbody",{class:e.normalizeClass({"[&_tr:last-child]:border-0":!i.value})},[r.value.length===0?(e.openBlock(),e.createElementBlock("td",Hr,[e.createElementVNode("div",qr,[e.createElementVNode("div",Gr,[e.createVNode(Vr,{class:"w-48 mx-auto"}),C[8]||(C[8]=e.createElementVNode("div",{class:"max-w-sm mx-auto mt-6"},[e.createElementVNode("p",{class:"font-medium text-gray-800 dark:text-neutral-200"},"Нічого не знайдено"),e.createElementVNode("p",{class:"mt-2 text-sm text-gray-500 dark:text-neutral-500"})],-1))])])])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,(S,T)=>(e.openBlock(),e.createElementBlock("tr",{key:S.id,class:e.normalizeClass(["border-b data-[state=selected]:bg-muted transition-all duration-200 hover:bg-slate-50/60 dark:hover:bg-slate-700/60 cursor-move",{"opacity-50":a.value===T,"border-t-2 border-b-2 border-blue-500 bg-blue-50 dark:bg-blue-900/20":i.value===T}]),draggable:"true",onDragstart:K=>p(T),onDragover:e.withModifiers(K=>h(T),["prevent"]),onDrop:K=>_(T)},[e.createElementVNode("td",Zr,[e.createElementVNode("div",Wr,[e.createVNode(gt,{width:"24",height:"24",class:"w-4 h-4 mx-auto text-slate-400 dark:text-slate-500"})])]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(M.colModel,K=>(e.openBlock(),e.createElementBlock("td",{key:K.key,class:"p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]"},[K.type==="file"?(e.openBlock(),e.createElementBlock("div",Yr,[D(J(S,K))?(e.openBlock(),e.createElementBlock("div",Jr,[e.createElementVNode("img",{src:J(S,K),alt:"alt",width:"45",class:"rounded-md max-w-[45px] h-[45px] object-cover"},null,8,Xr)])):(e.openBlock(),e.createElementBlock("div",Qr,[e.createVNode(it,{class:"w-[25px] min-w-[25px] h-[25px]"})]))])):K.type==="tiptap-editor"?(e.openBlock(),e.createElementBlock("div",{key:1,class:"inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 border-transparent bg-slate-100 dark:bg-slate-700 text-slate-700 dark:text-slate-300 hover:bg-slate-200 dark:hover:bg-slate-600 transition-colors",innerHTML:J(S,K)},null,8,eo)):(e.openBlock(),e.createElementBlock("div",to,e.toDisplayString(J(S,K)),1))]))),128)),e.createElementVNode("td",no,[e.createElementVNode("div",so,[e.createElementVNode("button",{onClick:K=>B(S,T),class:"text-slate-700 inline-flex items-center justify-center whitespace-nowrap font-medium focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 border rounded-md text-xs h-7 w-7 p-0 border-slate-300 dark:border-slate-600 bg-white dark:bg-slate-700 hover:bg-blue-50 dark:hover:bg-slate-600 hover:border-blue-300 dark:hover:border-slate-500 hover:text-blue-600 dark:hover:text-slate-200 transition-all duration-200 shadow-sm"},[e.createVNode(Sr,{width:"24",height:"24",class:"w-3 h-3"})],8,lo),e.createElementVNode("button",{onClick:K=>q(T),class:"text-slate-700 inline-flex items-center justify-center whitespace-nowrap font-medium focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 border rounded-md text-xs h-7 w-7 p-0 border-slate-300 dark:border-slate-600 bg-white dark:bg-slate-700 hover:bg-red-50 dark:hover:bg-slate-600 hover:border-red-300 dark:hover:border-slate-500 hover:text-red-600 dark:hover:text-slate-200 transition-all duration-200 shadow-sm"},[e.createVNode($e,{width:"24",height:"24",class:"w-3 h-3"})],8,ro)])])],42,Kr))),128))],2)])]),e.createVNode(e.unref(X.VsModal),{visible:f.value,title:y.value,size:"lg",onClose:G},{default:e.withCtx(()=>[e.createVNode(ke,{schema:t.colModel,values:w.value,"onUpdate:values":C[1]||(C[1]=S=>w.value=S),form:Z.value,"onUpdate:form":C[2]||(C[2]=S=>Z.value=S)},null,8,["schema","values","form"]),e.createElementVNode("div",oo,[e.createElementVNode("button",{type:"button",onClick:C[3]||(C[3]=S=>f.value=!1),class:"vs-button inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border !border-gray-200 hover:text-white bg-white text-red-500 hover:border-red-500 hover:bg-red-500 focus:ring-red-500 py-1.5 px-5 focus:ring-1 focus:ring-offset-1 mr-2"}," Скасувати "),e.createElementVNode("button",{onClick:z,type:"button",class:"vs-button inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border-1 border-transparent text-white bg-blue-500 hover:bg-blue-600 focus:ring-blue-500 py-1.5 px-5 focus:ring-1 focus:ring-offset-1"}," Зберегти ")])]),_:1},8,["visible","title"])]))}}),ao={draw:{toolbar:{actions:{title:"Скасувати малювання",text:"Скасувати"},finish:{title:"Завершити малювання",text:"Завершити"},undo:{title:"Видалити останню точку",text:"Видалити останню"},buttons:{polyline:"Намалювати лінію",polygon:"Намалювати полігон",rectangle:"Намалювати прямокутник",circle:"Намалювати коло",marker:"Додати точку",circlemarker:"Додати маркер-коло"}},handlers:{circle:{tooltip:{start:"Клацніть і тягніть, щоб намалювати коло",end:"Відпустіть кнопку миші, щоб завершити"},radius:"Радіус"},circlemarker:{tooltip:{start:"Клацніть на карту, щоб додати маркер-коло"}},marker:{tooltip:{start:"Клацніть на карту, щоб додати точку"}},polygon:{tooltip:{start:"Клацніть, щоб почати малювати полігон",cont:"Клацайте, щоб продовжити малювати полігон",end:"Клацніть першу точку, щоб завершити полігон"}},polyline:{error:"<strong>Помилка:</strong> лінія не може перетинатися сама з собою",tooltip:{start:"Клацніть, щоб почати малювати лінію",cont:"Клацайте, щоб продовжити малювати лінію",end:"Клацніть останню точку, щоб завершити лінію"}},rectangle:{tooltip:{start:"Клацніть і тягніть, щоб намалювати прямокутник",end:"Відпустіть кнопку миші, щоб завершити"}},simpleshape:{tooltip:{end:"Відпустіть кнопку миші, щоб завершити"}}}},edit:{toolbar:{actions:{save:{title:"Зберегти зміни",text:"Зберегти"},cancel:{title:"Скасувати редагування",text:"Скасувати"},clearAll:{title:"Очистити всі шари",text:"Очистити все"}},buttons:{edit:"Редагувати шари",editDisabled:"Немає шарів для редагування",remove:"Видалити шари",removeDisabled:"Немає шарів для видалення"}},handlers:{edit:{tooltip:{text:"Перетягніть маркери, щоб редагувати шари",subtext:"Натисніть 'Скасувати', щоб повернутися"}},remove:{tooltip:{text:"Клацніть на шари, щоб видалити їх"}}}}};function Ce(o){return o?o.type==="Polygon"?{type:"MultiPolygon",coordinates:[o.coordinates]}:o.type==="Feature"?{...o,geometry:Ce(o.geometry)}:o.type==="FeatureCollection"?{...o,features:(o.features||[]).map(t=>Ce(t)).filter(Boolean)}:o:null}function io(o){return o?o.type==="FeatureCollection"||o.type==="Feature"?Ce(o):o.geom?{type:"Feature",geometry:Ce({type:o.geom.type,coordinates:o.geom.coordinates}),properties:{}}:o.type&&o.coordinates?{type:"Feature",geometry:Ce(o),properties:{}}:null:null}const uo={},co={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",stroke:"currentColor",fill:"none","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-map-pin"};function po(o,t){return e.openBlock(),e.createElementBlock("svg",co,t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M9 11a3 3 0 1 0 6 0a3 3 0 0 0 -6 0"},null,-1),e.createElementVNode("path",{d:"M17.657 16.657l-4.243 4.243a2 2 0 0 1 -2.827 0l-4.244 -4.243a8 8 0 1 1 11.314 0z"},null,-1)]))}const ho=H(uo,[["render",po]]),fo={},mo={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none","stroke-width":"2",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-line"};function go(o,t){return e.openBlock(),e.createElementBlock("svg",mo,t[0]||(t[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M6 18m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"},null,-1),e.createElementVNode("path",{d:"M18 6m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"},null,-1),e.createElementVNode("path",{d:"M7.5 16.5l9 -9"},null,-1)]))}const ko=H(fo,[["render",go]]),bo={},yo={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-polygon"};function xo(o,t){return e.openBlock(),e.createElementBlock("svg",yo,t[0]||(t[0]=[e.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M12 5m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path><path d="M19 8m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path><path d="M5 11m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path><path d="M15 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path><path d="M6.5 9.5l3.5 -3"></path><path d="M14 5.5l3 1.5"></path><path d="M18.5 10l-2.5 7"></path><path d="M13.5 17.5l-7 -5"></path>',9)]))}const wo=H(bo,[["render",xo]]),_o={},Eo={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-topology-ring-3"};function Vo(o,t){return e.openBlock(),e.createElementBlock("svg",Eo,t[0]||(t[0]=[e.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M8 18a2 2 0 1 0 -4 0a2 2 0 0 0 4 0z"></path><path d="M20 18a2 2 0 1 0 -4 0a2 2 0 0 0 4 0z"></path><path d="M20 6a2 2 0 1 0 -4 0a2 2 0 0 0 4 0z"></path><path d="M8 6a2 2 0 1 0 -4 0a2 2 0 0 0 4 0z"></path><path d="M6 8v8"></path><path d="M18 16v-8"></path><path d="M8 6h8"></path><path d="M16 18h-8"></path>',9)]))}const Co=H(_o,[["render",Vo]]),vo={},Bo={version:"1.1",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg","xmlns:sketch":"http://www.bohemiancoding.com/sketch/ns","xmlns:xlink":"http://www.w3.org/1999/xlink",class:"fullscreen-icon"};function So(o,t){return e.openBlock(),e.createElementBlock("svg",Bo,t[0]||(t[0]=[e.createElementVNode("title",null,null,-1),e.createElementVNode("desc",null,null,-1),e.createElementVNode("defs",null,null,-1),e.createElementVNode("g",{fill:"none","fill-rule":"evenodd",id:"Page-1",stroke:"none","stroke-width":"1"},[e.createElementVNode("g",{fill:"#000000",id:"Core",transform:"translate(-215.000000, -257.000000)"},[e.createElementVNode("g",{id:"fullscreen",transform:"translate(215.000000, 257.000000)"},[e.createElementVNode("path",{d:"M2,9 L0,9 L0,14 L5,14 L5,12 L2,12 L2,9 L2,9 Z M0,5 L2,5 L2,2 L5,2 L5,0 L0,0 L0,5 L0,5 Z M12,12 L9,12 L9,14 L14,14 L14,9 L12,9 L12,12 L12,12 Z M9,0 L9,2 L12,2 L12,5 L14,5 L14,0 L9,0 L9,0 Z",id:"Shape"})])])],-1)]))}const No=H(vo,[["render",So]]),Mo={class:"map-search-widget flex flex-col gap-2 rounded-xl widget min-w-[200px]"},Fo={key:0,class:"vs-select__options absolute z-50 mt-1 w-full bg-white border border-gray-300 shadow-lg rounded-lg text-sm"},Ao=["onClick"],$o={class:"relative flex-1 min-w-[140px]"},Do=["placeholder"],Io="https://data.softpro.ua/api-user/gis-url-proxy",To="https://geo.rv.ua/api-user/dzk.api",Lo=H(e.defineComponent({__name:"map-search",props:{config:{}},emits:["goToCoordinates"],setup(o,{emit:t}){const n=o,s=t,l=["here","xy","parcel"],r=e.computed(()=>{const f=n.config?.tools?.filter(b=>l.includes(b));return f&&f.length?f:l}),a=e.computed(()=>n.config?.placeholder?.trim()||"Пошук…"),i=e.ref(r.value[0]??l[0]);e.watch(r,f=>{f.includes(i.value)||(i.value=f[0])});const d=e.ref(""),u=e.ref(!1),c=e.ref(null);e.watch(i,()=>{d.value="",u.value=!1});function p(f){i.value=f}function h(f){if(!u.value)return;const b=c.value;b&&!b.contains(f.target)&&(u.value=!1)}e.onMounted(()=>{window.addEventListener("click",h,!0)}),e.onBeforeUnmount(()=>{window.removeEventListener("click",h,!0)});function _(f){return f==="xy"?"Координати":f==="parcel"?"Кадастр":"Адреси"}function j(f){const b=f.replace(/[,]+/g," ").trim();if(!b)return null;const E=b.split(/\s+/).filter(Boolean);if(E.length<2)return null;const w=E.slice(0,2).map(Number);if(!w.every(G=>Number.isFinite(G)))return null;let[Z,Y]=w,J=Z,B=Y;const z=G=>Math.abs(G)<=90,q=G=>Math.abs(G)<=180;if(!z(J)||!q(B))if(z(B)&&q(J))J=Y,B=Z;else return null;return{lat:J,lng:B}}function A(f){return(f?.items||[]).map((E,w)=>({id:String(E?.id??w),title:E?.title||E?.address?.label||"Знайдений обʼєкт",lat:Number(E?.position?.lat),lng:Number(E?.position?.lng)})).filter(E=>Number.isFinite(E.lat)&&Number.isFinite(E.lng))}function D(f){const b=f?.result||f?.data||f;if(!b)return[];const E=b.geom_centroid;if(!E||!Array.isArray(E.coordinates))return[];const[w,Z]=E.coordinates;return!Number.isFinite(Z)||!Number.isFinite(w)?[]:[{id:"parcel",title:b.cadnum||b.cad_num||"Земельна ділянка",lat:Z,lng:w}]}function V(f){const E=f.replace(/\s+/g,"").split(":");if(E.length!==4)return!1;const w=[10,2,3,4];return E.every((Z,Y)=>Z.length===w[Y]&&/^\d+$/.test(Z))}function I(f){s("goToCoordinates",[f.lat,f.lng])}async function y(){const f=d.value.trim();if(f){if(i.value==="xy"){const b=j(f);if(!b){X.notify({type:"warning",title:"Пошук координат",message:"Не знайдено або невірний формат координат"});return}I(b),d.value="";return}try{const b=new URL(i.value==="here"?Io:To);if(i.value==="here")b.searchParams.set("searchtext",f);else{if(!V(f)){X.notify({type:"warning",title:"Пошук кадастру",message:"Кадастровий номер має формат ХХХХХХХХХХ:ХХ:ХХХ:ХХХХ"});return}b.searchParams.set("cad_num",f)}const E=await fetch(b.toString());if(!E.ok)throw new Error(`HTTP ${E.status}`);const w=await E.json(),Z=i.value==="here"?A(w):D(w);if(!Z.length)X.notify({type:"warning",title:"Пошук",message:"Не знайдено результатів"});else{const Y=Z[0];I(Y),d.value=""}}catch(b){const E=b?.message||"Помилка пошуку";X.notify({type:"error",title:"Пошук",message:E})}}}return(f,b)=>(e.openBlock(),e.createElementBlock("div",Mo,[e.createElementVNode("form",{class:"flex gap-2",onSubmit:e.withModifiers(y,["prevent"])},[r.value.length>1?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"dropdownRef",ref:c,class:"relative search-type w-[140px]"},[e.createElementVNode("button",{type:"button",class:"vstSelect-input transition-all text-left bg-white border border-gray-200 text-gray-900 rounded-lg focus:ring-blue-500 focus:border-blue-100 block w-full py-1.5 px-3 text-sm cursor-pointer flex items-center justify-between gap-2",onClick:b[0]||(b[0]=E=>u.value=!u.value)},[e.createElementVNode("span",null,e.toDisplayString(_(i.value)),1),(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["w-4 h-4 text-gray-500 transition-transform",{"rotate-180":u.value}]),viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},b[2]||(b[2]=[e.createElementVNode("path",{d:"M6 9l6 6 6-6",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)]),2))]),u.value?(e.openBlock(),e.createElementBlock("div",Fo,[e.createElementVNode("ul",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,E=>(e.openBlock(),e.createElementBlock("li",{key:E,class:"px-3 py-2 cursor-pointer hover:bg-gray-100",onClick:w=>p(E)},e.toDisplayString(_(E)),9,Ao))),128))])])):e.createCommentVNode("",!0)],512)):e.createCommentVNode("",!0),e.createElementVNode("div",$o,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":b[1]||(b[1]=E=>d.value=E),placeholder:a.value,type:"text",class:"vs-input transition-all border block w-full border-gray-200 rounded-md focus:border-blue-100 border-solid !pr-8 py-1.5 pl-3 text-sm"},null,8,Do),[[e.vModelText,d.value,void 0,{trim:!0}]]),b[3]||(b[3]=e.createElementVNode("button",{type:"submit",class:"absolute inset-y-0 right-2 flex items-center text-gray-400 hover:text-gray-600","aria-label":"Пошук"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m21 21-4.35-4.35m0 0A7.5 7.5 0 1 0 5 5a7.5 7.5 0 0 0 11.65 11.65Z"})])],-1))])],32)]))}}),[["__scopeId","data-v-3048520a"]]),Ro={class:"bg-white/95 p-2 rounded-xl shadow border border-gray-200"},Oo={class:"flex gap-2"},zo=["onClick","title"],jo=["src"],Uo=e.defineComponent({__name:"map-layers",props:{basemaps:{}},emits:["onLayerChange"],setup(o,{emit:t}){const n=o,s=e.ref(Object.keys(n.basemaps)[0]),l=t;function r(a){l("onLayerChange",a),s.value=a}return(a,i)=>(e.openBlock(),e.createElementBlock("div",Ro,[e.createElementVNode("div",Oo,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.basemaps,(d,u)=>(e.openBlock(),e.createElementBlock("div",{key:u,class:e.normalizeClass(["cursor-pointer border rounded-lg overflow-hidden hover:shadow-sm",{"ring-2 ring-blue-500 border-blue-300":s.value===u}]),onClick:c=>r(u),title:d.name||u,role:"button",tabindex:"0"},[e.createElementVNode("img",{src:d.preview,alt:"",class:"w-10 h-10 object-cover"},null,8,jo)],10,zo))),128))])]))}}),Po={key:0,class:"absolute inset-0 z-[2000] flex items-center justify-center pointer-events-none bg-black/20"},Ho={class:"bg-black/70 text-white px-6 py-4 rounded-lg text-center max-w-sm mx-4 backdrop-blur-sm"},qo={class:"text-sm font-medium"},Go={class:"absolute top-4 left-4 z-[1000] w-[calc(100%-20px)] sm:w-[350px]"},Ko={class:"form-geom__panel flex gap-1 items-start mt-2"},Zo={class:"flex items-center gap-1"},Wo=["disabled"],Yo={class:"absolute top-4 right-4 z-[1000]"},Jo={class:"flex flex-col gap-[2px]"},Xo=["aria-pressed"],Qo=["aria-pressed"],ea=["aria-pressed"],ta=["aria-pressed"],na={class:"absolute bottom-0 left-0 right-0 z-[1000] bg-white/95 border-t border-gray-200 text-xs text-gray-700 flex items-center gap-4 pt-1"},sa={key:0,class:"form-geom__feature flex items-center text-xs transition-all gap-2 w-full"},la={class:"mr-auto"},ra={class:"font-bold"},oa={class:"flex items-center"},aa={class:"text-xs mr-2"},ia={key:0,class:"text-xs"},da={key:1,class:"text-xs"},bt=H(e.defineComponent({__name:"vs-input-map",props:{tools:{},handleZoom:{type:Boolean},style:{},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{}},emits:["update:modelValue"],setup(o,{emit:t}){const n=e.getCurrentInstance(),s=o,l=t,r=e.ref(!1),a=e.ref("");function i(){const m=navigator.platform.toUpperCase().indexOf("MAC")>=0;return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)?"Використовуйте два пальці для зуму карти.":"Використовуйте Shift + прокрутка для зуму карти."}const d=e.ref(null);let u,c,p,h=null;const _=e.ref(null);function j(){if(!s.handleZoom)return null;let m;const x=F=>{const W=F.ctrlKey||F.metaKey,se=F.shiftKey;if(!W&&!se){F.preventDefault(),F.stopPropagation(),r.value=!0,a.value=i(),clearTimeout(m),m=window.setTimeout(()=>{r.value=!1},1e3);return}r.value=!1,u.scrollWheelZoom.enable(),setTimeout(()=>{u.scrollWheelZoom.disable()},100)},O=F=>{if(F.touches.length===1){r.value=!0,a.value=i(),clearTimeout(m),m=window.setTimeout(()=>{r.value=!1},3e3);return}r.value=!1};return d.value&&(d.value.addEventListener("wheel",x,{passive:!1}),d.value.addEventListener("touchstart",O,{passive:!0})),u&&u.on("wheel",F=>{const W=F.originalEvent.ctrlKey||F.originalEvent.metaKey,se=F.originalEvent.shiftKey;!W&&!se&&(F.originalEvent.preventDefault(),F.originalEvent.stopPropagation())}),()=>{d.value&&(d.value.removeEventListener("wheel",x),d.value.removeEventListener("touchstart",O)),u&&u.off("wheel"),clearTimeout(m)}}const A=e.ref(null),D=e.ref(6),V=e.ref(0),I=e.ref(n?.appContext.config.globalProperties.$settings?.center||[50,30]),y=e.ref(null),f=Oe();let b;const E=e.ref("topo100");function w(m){return m?m.type==="Polygon"?{type:"MultiPolygon",coordinates:[m.coordinates]}:(m.type==="MultiPolygon",m):null}function Z(){return new Promise((m,x)=>{window.L&&window.L.Draw&&m(0);const O=W=>{if(Array.from(document.styleSheets).some(fe=>fe?.href?.includes(W)))return;const he=document.createElement("link");he.rel="stylesheet",he.href=W,document.head.appendChild(he)},F=W=>new Promise((se,he)=>{const fe=Array.from(document.scripts).find(ge=>ge.src===W);if(fe){fe.addEventListener("load",()=>se()),fe.addEventListener("error",ge=>he(ge));return}const me=document.createElement("script");me.src=W,me.async=!0,me.onload=()=>se(),me.onerror=ge=>he(ge),document.body.appendChild(me)});O("https://unpkg.com/leaflet@1.9.4/dist/leaflet.css"),O("https://unpkg.com/leaflet-draw@1.0.4/dist/leaflet.draw.css"),F("https://unpkg.com/leaflet@1.9.4/dist/leaflet.js").then(()=>F("https://unpkg.com/leaflet-draw@1.0.4/dist/leaflet.draw.js")).then(()=>m(0)).catch(x)})}function Y(){const m=c.toGeoJSON(),x=[],O=W=>{if(W)switch(W.type){case"Polygon":x.push(W.coordinates);break;case"MultiPolygon":x.push(...W.coordinates);break;case"GeometryCollection":(W.geometries||[]).forEach(O);break}};(m?.features||[]).forEach(W=>O(W.geometry));const F=x.length?{type:"MultiPolygon",coordinates:x}:null;l("update:modelValue",F?w(F):null),V.value=c.getLayers().length}function J(m=30){const x=c.getLayers();if(!x.length)return;const F=L.featureGroup(x).getBounds();F&&F.isValid()&&u.fitBounds(F,{padding:[m,m]})}function B(){_.value?.click()}const z=e.ref("");function q(m){return m instanceof L.Circle?"Circle":m instanceof L.Rectangle?"Rectangle":m instanceof L.Polygon&&!(m instanceof L.Rectangle)?"Polygon":m instanceof L.Polyline&&!(m instanceof L.Polygon)?"Polyline":m instanceof L.Marker?"Point":"Feature"}function G(m){if(m instanceof L.Circle){const x=m.getRadius();return Math.PI*(x*x)/1e6}if(m instanceof L.Polygon||m instanceof L.Rectangle)try{const x=m.getLatLngs(),O=Array.isArray(x[0])?x[0]:x,F=L.GeometryUtil?.geodesicArea?L.GeometryUtil.geodesicArea(O):0;return F?F/1e6:0}catch{return null}return null}function M(m){return m instanceof L.Circle?m.getLatLng():m.getBounds?m.getBounds().getCenter():m.getLatLng?m.getLatLng():u.getCenter()}function C(){const m=c.getLayers();if(!m.length){y.value=null,V.value=0;return}const x=m[m.length-1],O=q(x),F=M(x),W=G(x);y.value={type:O,center:F,areaKm2:W,layer:x},V.value=m.length}function S(){const m=y.value?.layer;m&&(m instanceof L.Circle&&m.getBounds?u.fitBounds(m.getBounds(),{padding:[30,30]}):m.getBounds?u.fitBounds(m.getBounds(),{padding:[30,30]}):m.getLatLng&&u.setView(m.getLatLng(),Math.max(D.value,14)))}function T(){const m=y.value?.layer;m&&(c.removeLayer(m),Y(),C())}e.onMounted(async()=>{await Z(),L.drawLocal=ao;const m=s.handleZoom;u=L.map(d.value,{zoomControl:!1,scrollWheelZoom:!m}).setView(I.value,10),setTimeout(()=>{h=j()},100),L.control.zoom({position:"bottomright"}).addTo(u),E.value=Object.keys(f)[0],b=L.tileLayer(f[E.value].url,{maxZoom:19,minZoom:6}).addTo(u),c=new L.FeatureGroup().addTo(u),u.on(L.Draw.Event.CREATED,F=>{const{layer:W}=F;c.clearLayers(),c.addLayer(W),Y(),C(),J(),z.value=""}),u.on(L.Draw.Event.EDITED,()=>{Y(),C(),J()}),u.on(L.Draw.Event.DELETED,()=>{Y(),C(),J()});let x=!1;u.on("mousemove",F=>{x||(u.invalidateSize(),x=!0),A.value=F.latlng}),u.on("zoomend",()=>{D.value=u.getZoom()});const O=io(s.modelValue);if(O){const F=[];L.geoJSON(O).eachLayer(W=>F.push(W)),F.length&&c.addLayer(F[0]),Y(),C(),J()}}),e.onUnmounted(()=>{h&&h()});function K(m){if(u){switch(p&&p.disable(),m){case"marker":p=new L.Draw.Marker(u);break;case"polyline":p=new L.Draw.Polyline(u);break;case"polygon":p=new L.Draw.Polygon(u);break;case"rectangle":p=new L.Draw.Rectangle(u);break;default:p=new L.Draw.Rectangle(u);break}p&&(p.enable(),z.value=m)}}function ue(){const m=c.toGeoJSON(),x=new Blob([JSON.stringify(m,null,2)],{type:"application/json"}),O=URL.createObjectURL(x),F=document.createElement("a");F.href=O,F.download="data.geojson",F.click(),URL.revokeObjectURL(O)}function xe(m){const x=m.target,O=x.files?.[0];if(!O)return;const F=new FileReader;F.onload=()=>{if(typeof F.result=="string")try{const W=JSON.parse(F.result);c.clearLayers(),W&&L.geoJSON({type:"Feature",geometry:W}).eachLayer(se=>{c.addLayer(se)}),Y(),C(),J()}finally{x.value=""}},F.readAsText(O)}function Ye(m){u&&(b&&u.removeLayer(b),b=L.tileLayer(f[m].url,{maxZoom:19,minZoom:6}).addTo(u),E.value=m)}function Je(m){const x=L.latLng(m[0],m[1]);u.setView(x,13)}e.watch(()=>s.modelValue,m=>{const x=w(m);if(m&&x!==m){l("update:modelValue",x);return}c.clearLayers(),x&&L.geoJSON({type:"Feature",geometry:x}).eachLayer(O=>{c.addLayer(O),O.dragging?.enable(),O.dragging?.enabled(),O.on("dragend",F=>{const se=F.target.getLatLng();l("update:modelValue",{type:"Point",coordinates:[se.lng,se.lat]})})}),V.value=c.getLayers().length,C(),J()});function Oe(){return n?.appContext.config.globalProperties.$settings?.basemaps?n?.appContext.config.globalProperties.$settings?.basemaps.map((m,x)=>Object.assign(m,{key:`b${x}`,preview:m.preview||m.url.replace("{z}/{x}/{y}.png","13/4790/2762.png")})).reduce((m,x)=>({...m,[x.key]:x}),{}):{topo100:{url:"https://data.gki.com.ua/api-user/rtile/voyager/ua/{z}/{x}/{y}.png",preview:"https://data.gki.com.ua/api-user/rtile/voyager/ua/13/4790/2762.png"},orto10:{url:"https://data.gki.com.ua/api-user/rtile/orto10/ua/{z}/{x}/{y}.png",preview:"https://data.gki.com.ua/api-user/rtile/orto10/ua/13/4790/2762.png"},osmb:{url:"https://tile.openstreetmap.org.ua/styles/osm-bright/{z}/{x}/{y}.png",preview:"https://tile.openstreetmap.org.ua/styles/osm-bright/13/4790/2762.png"}}}const we=e.ref(!1);return e.watch(we,()=>{setTimeout(()=>{u.invalidateSize()},50)}),(m,x)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["leaflet-map-wrapper relative w-full h-[400px]",{fullscreen:we.value}])},[e.createElementVNode("div",{ref_key:"mapContainer",ref:d,class:"w-full h-full"},null,512),e.createVNode(e.Transition,{name:"zoom-instructions","enter-active-class":"transition-all duration-200 ease-out","leave-active-class":"transition-all duration-500 ease-in","enter-from-class":"opacity-0","enter-to-class":"opacity-100","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:e.withCtx(()=>[r.value&&s.handleZoom?(e.openBlock(),e.createElementBlock("div",Po,[e.createElementVNode("div",Ho,[e.createElementVNode("p",qo,e.toDisplayString(a.value),1)])])):e.createCommentVNode("",!0)]),_:1}),e.createElementVNode("div",Go,[e.createVNode(Lo,{onGoToCoordinates:Je}),e.createElementVNode("div",Ko,[e.createElementVNode("div",Zo,[e.createElementVNode("button",{type:"button",class:"inline-flex items-center gap-2 text-sm font-medium border rounded-md px-3 py-2 bg-white text-blue-600 border-stone-200 hover:bg-blue-500 hover:text-white hover:border-blue-500 focus:outline-none focus:ring-1 focus:ring-blue-500 focus:ring-offset-1 transition",onClick:B},"Import"),e.createElementVNode("button",{type:"button",class:"inline-flex items-center gap-2 text-sm font-medium border rounded-md px-3 py-2 bg-white text-blue-600 border-stone-200 hover:bg-blue-500 hover:text-white hover:border-blue-500 focus:outline-none focus:ring-1 focus:ring-blue-500 focus:ring-offset-1 transition disabled:opacity-50 disabled:cursor-not-allowed disabled:bg-gray-100 disabled:text-gray-400 disabled:border-gray-200 disabled:hover:bg-gray-100 disabled:hover:text-gray-400",onClick:ue,disabled:V.value===0},"Export",8,Wo)]),e.createElementVNode("input",{ref_key:"importRef",ref:_,type:"file",onChange:xe,accept:".json,.geojson",class:"hidden"},null,544)])]),e.createElementVNode("div",Yo,[e.createElementVNode("div",Jo,[e.createElementVNode("button",{class:e.normalizeClass(["vs-btn",{"vs-active":z.value==="marker"}]),"aria-pressed":z.value==="marker",title:"Point (P)","aria-label":"Draw point",onClick:x[0]||(x[0]=O=>K("marker"))},[e.createVNode(ho)],10,Xo),e.createElementVNode("button",{class:e.normalizeClass(["vs-btn",{"vs-active":z.value==="polyline"}]),"aria-pressed":z.value==="polyline",title:"Line (L)","aria-label":"Draw polyline",onClick:x[1]||(x[1]=O=>K("polyline"))},[e.createVNode(ko)],10,Qo),e.createElementVNode("button",{class:e.normalizeClass(["vs-btn",{"vs-active":z.value==="polygon"}]),"aria-pressed":z.value==="polygon",title:"Polygon (G)","aria-label":"Draw polygon",onClick:x[2]||(x[2]=O=>K("polygon"))},[e.createVNode(wo)],10,ea),e.createElementVNode("button",{class:e.normalizeClass(["vs-btn",{"vs-active":z.value==="rectangle"}]),"aria-pressed":z.value==="rectangle",title:"Rectangle (R)","aria-label":"Draw rectangle",onClick:x[3]||(x[3]=O=>K("rectangle"))},[e.createVNode(Co)],10,ta),e.createElementVNode("button",{class:"vs-btn mt-5",onClick:x[4]||(x[4]=O=>{we.value=!we.value}),title:"Full Screen","aria-label":"Full Screen"},[e.createVNode(No,{style:{width:"12px",height:"12px"}})])])]),e.createElementVNode("div",{class:e.normalizeClass(["absolute left-4 z-[1000]",y.value?"bottom-8":"bottom-4"])},[e.createVNode(Uo,{basemaps:e.unref(f),onOnLayerChange:Ye},null,8,["basemaps"])],2),e.createElementVNode("div",na,[y.value?(e.openBlock(),e.createElementBlock("div",sa,[e.createElementVNode("div",la,[x[7]||(x[7]=e.createTextVNode(" Тип: ",-1)),e.createElementVNode("span",ra,e.toDisplayString(y.value.type),1)]),e.createElementVNode("div",oa,[e.createElementVNode("div",aa,[x[8]||(x[8]=e.createTextVNode(" Центр: ",-1)),e.createElementVNode("b",null,e.toDisplayString(y.value.center.lat.toFixed(5))+", "+e.toDisplayString(y.value.center.lng.toFixed(5)),1)]),y.value.areaKm2!==null?(e.openBlock(),e.createElementBlock("div",ia,[x[9]||(x[9]=e.createTextVNode(" Площа: ",-1)),e.createElementVNode("b",null,e.toDisplayString(y.value.areaKm2.toFixed(1))+"км²",1)])):(e.openBlock(),e.createElementBlock("div",da,x[10]||(x[10]=[e.createTextVNode(" Площа: ",-1),e.createElementVNode("b",null,"—",-1)]))),e.createElementVNode("button",{class:"tool bg-gray-100 py-1.5 px-2 rounded-lg text-md mr-1 cursor-pointer hover:bg-blue-500 hover:text-white transition-all",title:"Наблизити",onClick:x[5]||(x[5]=O=>S())},x[11]||(x[11]=[e.createStaticVNode('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="w-3 h-3" data-v-a761be7c><path d="M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0" data-v-a761be7c></path><path d="M7 10l6 0" data-v-a761be7c></path><path d="M10 7l0 6" data-v-a761be7c></path><path d="M21 21l-6 -6" data-v-a761be7c></path></svg>',1)])),e.createElementVNode("button",{class:"tool bg-gray-100 py-1.5 px-2 rounded-lg text-md cursor-pointer hover:bg-blue-500 hover:text-white transition-all",title:"Видалити",onClick:x[6]||(x[6]=O=>T())},[e.createVNode($e,{class:"w-3 h-3"})])])])):e.createCommentVNode("",!0)])],2))}}),[["__scopeId","data-v-a761be7c"]]),ua=["data-focus"],ca={class:"flex items-center"},pa={class:"overflow-hidden text-ellipsis whitespace-nowrap rounded-sm text-[#333] text-[85%] px-0.5 py-[3px] pl-1.5 box-border"},ha=["onClick","aria-label"],fa={key:0,class:"absolute text-gray-500 truncate pl-2"},ma={class:"flex-1 min-w-[2px]"},ga=["placeholder"],ka={class:"flex items-center shrink-0"},ba=["disabled"],yt=e.defineComponent({__name:"vs-input-tag",props:e.mergeModels({unique:{type:Boolean,default:!0},style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{},name:{},placeholder:{default:"Введіть тег"}},{modelValue:{default:[]},modelModifiers:{}}),emits:e.mergeModels(["update:modelValue"],["update:modelValue"]),setup(o,{emit:t}){const n=o,s=t;le(n.style);const l=e.ref(null),r=e.ref(null),a=e.ref(null),i=e.ref(!1),d=e.ref(""),u=e.useModel(o,"modelValue"),c=e.computed(()=>n.placeholder||"Add tag…"),p=e.computed(()=>u.value?.length===0&&d.value===""),h=e.computed(()=>!n.disabled&&u.value?.length>0),_=e.computed(()=>n.disabled),j=async()=>{_.value||await e.nextTick(()=>a.value?.focus())},A=E=>{const w=E.trim();w!==""&&(!u.value||!Array.isArray(u.value)?u.value=[w]:n.unique?u.value.includes(w)||(u.value=[...u.value,w]):u.value=[...u.value,w],d.value="")},D=()=>{const E=d.value;E.trim()!==""&&A(E),d.value=""},V=E=>{const w=u.value.slice();w.splice(E,1),s("update:modelValue",w)},I=()=>{s("update:modelValue",[])},y=()=>{_.value||(i.value=!0)},f=()=>{i.value=!1},b=E=>{const{key:w}=E;w==="Enter"?(E.preventDefault(),D()):w==="Backspace"&&d.value===""&&u.value.length>0&&V(u.value.length-1)};return(E,w)=>(e.openBlock(),e.createElementBlock("div",{class:"flex gap-1 w-full",ref_key:"root",ref:l,onClick:w[1]||(w[1]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:e.normalizeClass(["relative w-full font-sans",n.customClass]),role:"group","aria-label":"Tag input"},[e.createElementVNode("div",{class:e.normalizeClass(["flex min-h-[38px] items-center justify-between rounded border transition-colors bg-white","border-gray-300 hover:border-gray-400",i.value?"border-blue-500 ring-1 ring-blue-500":"",_.value?"bg-gray-100 text-gray-400 cursor-not-allowed hover:border-gray-300":""]),"data-focus":i.value?"true":"false",onClick:j},[e.createElementVNode("div",{class:"flex flex-1 flex-wrap items-center gap-1 py-0.5 pl-2 pr-0 overflow-hidden",ref_key:"chipsRef",ref:r},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(Z,Y)=>(e.openBlock(),e.createElementBlock("div",{key:Y,class:"flex min-w-0 bg-[#e6e6e6] rounded-sm m-0.5 box-border"},[e.createElementVNode("div",ca,[e.createElementVNode("div",pa,e.toDisplayString(Z),1)]),e.createElementVNode("div",{role:"button",class:"flex items-center rounded-sm px-1 box-border hover:bg-[#ffbdad] hover:text-[#de350b]",onClick:e.withModifiers(J=>V(Y),["stop"]),"aria-label":`Remove ${Z}`},w[2]||(w[2]=[e.createElementVNode("svg",{height:"14",width:"14",viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",class:"inline-block fill-current stroke-current leading-none stroke-0"},[e.createElementVNode("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"})],-1)]),8,ha)]))),128)),p.value?(e.openBlock(),e.createElementBlock("div",fa,e.toDisplayString(c.value),1)):e.createCommentVNode("",!0),e.createElementVNode("div",ma,[_.value?e.createCommentVNode("",!0):e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,ref_key:"inputRef",ref:a,class:"pl-2 w-full bg-transparent outline-none border-0 m-0 p-0 text-gray-900",autocapitalize:"none",autocomplete:"off",autocorrect:"off",spellcheck:"false",type:"text",tabindex:"0","aria-label":"Add tag","onUpdate:modelValue":w[0]||(w[0]=Z=>d.value=Z),onFocus:y,onBlur:f,onKeydown:b,placeholder:u.value&&u.value.length?"":void 0},null,40,ga)),[[e.vModelText,d.value]])])],512),e.createElementVNode("div",ka,[h.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"px-2 text-gray-400 hover:text-gray-500 transition-colors disabled:opacity-50","aria-label":"Clear all tags",disabled:_.value,onClick:e.withModifiers(I,["stop"])},w[3]||(w[3]=[e.createElementVNode("svg",{height:"20",width:"20",viewBox:"0 0 20 20",class:"fill-current"},[e.createElementVNode("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"})],-1)]),8,ba)):e.createCommentVNode("",!0)])],10,ua)],2)],512))}}),ya={class:"relative flex gap-1 bg-white w-full"},xa=["disabled","placeholder"],xt=H(e.defineComponent({__name:"vs-input-slug",props:e.mergeModels({disabled:{type:Boolean},placeholder:{},parent:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const t=e.inject("values"),n=o,s=e.useModel(o,"modelValue");function l(a){const i={а:"a",б:"b",в:"v",г:"g",д:"d",е:"e",ё:"e",ж:"zh",з:"z",и:"i",й:"y",к:"k",л:"l",м:"m",н:"n",о:"o",п:"p",р:"r",с:"s",т:"t",у:"u",ф:"f",х:"kh",ц:"ts",ч:"ch",ш:"sh",щ:"shch",ы:"y",э:"e",ю:"yu",я:"ya",ь:"",ъ:"",є:"ye",і:"i",ї:"yi",ґ:"g"};return a.toLowerCase().split("").map(d=>i[d]||d).join("").replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"")}const r=()=>{const a=t?.value?.[n.parent||""]?.toString(),i=l(a);s.value=i.toString()};return(a,i)=>(e.openBlock(),e.createElementBlock("div",ya,[e.withDirectives(e.createElementVNode("input",{ref:"vsText",disabled:a.disabled,placeholder:a.placeholder,"onUpdate:modelValue":i[0]||(i[0]=d=>s.value=d),class:"block w-full px-3 py-2 text-sm border border-solid rounded-lg placeholder:text-nowrap border-stone-200 text-stone-800 placeholder:text-stone-400 focus:outline focus:z-10 focus:border-blue-500 focus:ring-blue-500 focus:outline-blue-500"},null,8,xa),[[e.vModelText,s.value]]),e.createElementVNode("button",{class:"px-2 bg-gray-100 border rounded-lg hover:bg-gray-200",onClick:r}," Gen ")]))}}),[["__scopeId","data-v-b0eba370"]]),wa={class:"w-full"},_a={ref:"sortableContainer",class:"flex flex-col gap-1"},Ea=["onDragstart","onDrop"],Va={class:"w-1/3"},Ca={class:"w-2/3"},va=["onClick"],Ba={key:0,class:"text-[14px] text-gray-700"},Sa={class:"mt-2 w-full flex items-center"},Na=["disabled"],wt=H(e.defineComponent({__name:"vs-input-key-value",props:{parent:{},ignore:{},addButtonText:{},modelValue:{}},emits:["update:modelValue"],setup(o,{emit:t}){const n=D=>`${D}-${Math.random().toString(36).substring(2,15)}`,s=e.inject("values"),l=o,r=t,a=l.addButtonText??"Додати",i=l.ignore??[],d=e.ref([]),u=e.ref(null);(()=>{const D=l.parent&&s?.value?.[l.parent]||l.modelValue||{};d.value=Object.entries(D).filter(([V])=>!i.includes(V)).map(([V,I])=>({id:n("key-value-"),key:V,value:I}))})();function p(D){u.value=D}function h(D){if(u.value===null||u.value===D)return;const V=d.value.splice(u.value,1)[0];d.value.splice(D,0,V),u.value=null}const _=e.computed(()=>d.value.some(D=>D.key&&!D.value||!D.key&&D.value)),j=()=>{d.value.push({id:n("key-value-"),key:"",value:""})},A=D=>{d.value=d.value.filter(V=>V.id!==D)};return e.watch(d,D=>{const V={};D.forEach(y=>{y.key&&y.value!==void 0&&(V[y.key]=y.value)});const I={};i.length&&i.forEach(y=>{I[y]=l.parent?s?.value?.[l.parent]?.[y]:void 0}),s?.value&&l.parent&&(s.value[l.parent]={...I,...V}),r("update:modelValue",V)},{deep:!0}),(D,V)=>(e.openBlock(),e.createElementBlock("div",wa,[e.createElementVNode("div",_a,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(I,y)=>(e.openBlock(),e.createElementBlock("div",{key:I.id,class:e.normalizeClass(["flex items-center gap-2 w-full",{"opacity-50":u.value===y}]),draggable:"true",onDragstart:f=>p(y),onDragover:V[0]||(V[0]=e.withModifiers(()=>{},["prevent"])),onDrop:f=>h(y)},[V[1]||(V[1]=e.createStaticVNode('<button class="cursor-move" data-v-a0f7fbfc><svg fill="#000000" width="20" height="20" viewBox="0 0 36 36" data-v-a0f7fbfc><circle cx="15" cy="12" r="1.5" data-v-a0f7fbfc></circle><circle cx="15" cy="24" r="1.5" data-v-a0f7fbfc></circle><circle cx="21" cy="12" r="1.5" data-v-a0f7fbfc></circle><circle cx="21" cy="24" r="1.5" data-v-a0f7fbfc></circle><circle cx="21" cy="18" r="1.5" data-v-a0f7fbfc></circle><circle cx="15" cy="18" r="1.5" data-v-a0f7fbfc></circle></svg></button>',1)),e.createElementVNode("div",Va,[e.createVNode(Ee,{modelValue:I.key,"onUpdate:modelValue":f=>I.key=f,placeholder:"Ключ"},null,8,["modelValue","onUpdate:modelValue"])]),e.createElementVNode("div",Ca,[e.createVNode(Ee,{modelValue:I.value,"onUpdate:modelValue":f=>I.value=f,placeholder:"Значення"},null,8,["modelValue","onUpdate:modelValue"])]),e.createElementVNode("button",{onClick:f=>A(I.id),class:"shrink-0 w-[30px] text-gray-600 h-[30px] rounded-full flex items-center justify-center bg-gray-100 hover:bg-gray-200"},[e.createVNode(e.unref(Pn),{height:"16",width:"16"})],8,va)],42,Ea))),128))],512),d.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",Ba," Дані для відображення відсутні ")),e.createElementVNode("div",Sa,[e.createElementVNode("button",{type:"button",onClick:j,disabled:_.value,class:"py-1.5 px-2 flex items-center gap-x-1 text-xs font-medium rounded-full border border-dashed border-gray-200 bg-white text-gray-800 hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed"},[e.createVNode(Ve,{height:"14",width:"14"}),e.createTextVNode(" "+e.toDisplayString(e.unref(a)),1)],8,Na)])]))}}),[["__scopeId","data-v-a0f7fbfc"]]),Ma={class:"flex items-center gap-2 w-full"},Fa=["disabled"],_t=e.defineComponent({__name:"vs-input-color",props:{style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{},name:{},placeholder:{default:""}},emits:["update:modelValue"],setup(o,{emit:t}){const n=o,{inputClass:s}=le(n.style),l=t,r=e.computed({get:()=>n.modelValue||"#000000",set:a=>l("update:modelValue",a)});return(a,i)=>(e.openBlock(),e.createElementBlock("div",Ma,[e.withDirectives(e.createElementVNode("input",{type:"color","onUpdate:modelValue":i[0]||(i[0]=d=>r.value=d),disabled:a.disabled,ref:"color",class:e.normalizeClass(["py-1.5 px-1 block w-full bg-white cursor-pointer max-w-[50px]",[a.modelValue?"":"text-opacity-50",e.unref(s)].join(" ")]),style:{border:"1px solid #CFD9E0"}},null,10,Fa),[[e.vModelText,r.value]]),e.withDirectives(e.createElementVNode("input",{class:"text-sm text-gray-600 border border-solid border-stone-200 rounded-md p-2","onUpdate:modelValue":i[1]||(i[1]=d=>r.value=d)},null,512),[[e.vModelText,r.value]])]))}}),Aa={class:"flex items-center gap-2 w-full"},$a=["min","max","step","disabled"],Et=e.defineComponent({__name:"vs-input-range",props:{style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{},name:{},placeholder:{default:""},min:{default:0},max:{default:100},step:{default:1}},emits:["update:modelValue"],setup(o,{emit:t}){const n=o,{inputClass:s}=le(n.style),l=t,r=e.computed({get:()=>Number(n.modelValue??n.min),set:a=>l("update:modelValue",Number(a))});return(a,i)=>(e.openBlock(),e.createElementBlock("div",Aa,[e.withDirectives(e.createElementVNode("input",{type:"range","onUpdate:modelValue":i[0]||(i[0]=d=>r.value=d),min:a.min,max:a.max,step:a.step,disabled:a.disabled,ref:"range",class:e.normalizeClass(["w-full cursor-pointer accent-blue-500",[a.modelValue?"":"text-opacity-50",e.unref(s)].join(" ")])},null,10,$a),[[e.vModelText,r.value]]),e.withDirectives(e.createElementVNode("input",{class:"text-sm text-gray-600 border border-solid border-stone-200 rounded-md p-2 max-w-[100px]",type:"number","onUpdate:modelValue":i[1]||(i[1]=d=>r.value=d)},null,512),[[e.vModelText,r.value]])]))}}),Da=["type","value","onInput","placeholder","disabled"],Vt=e.defineComponent({__name:"vs-input-array",props:e.mergeModels({count:{default:1},limit:{default:o=>o.count??1},inputType:{default:"text"},style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{default:""},name:{},placeholder:{default:""}},{modelValue:{default:[]},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const t=o,{inputClass:n}=le(t.style),s=e.useModel(o,"modelValue");e.watchEffect(()=>{const r=s.value?.length??0;r<t.count&&(s.value=[...s.value??[],...Array(t.count-r)])});function l(r,a){const i=r.target.value,d=[...s.value];d[a]=t.inputType==="text"?i:Number(i),s.value=d}return(r,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["grid gap-2",`grid-cols-${r.limit}`])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.count,i=>(e.openBlock(),e.createElementBlock("input",{type:r.inputType,value:s.value?.[i-1]??"",onInput:d=>l(d,i-1),placeholder:r.placeholder,disabled:r.disabled,class:e.normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white",[e.unref(n),{"!border-red-600":r.error}]]),style:{border:"1px solid #CFD9E0"}},null,42,Da))),256))],2))}}),Ct={VsInputText:Ee,VsInputRadio:He,"vs-input-text":Ee,"vs-input-password":bn,"vs-input-textarea":mt,"vs-input-mask":nt,"vs-input-number":et,"vs-input-radio":He,"vs-input-select":qe,"vs-input-switcher":Ue,"vs-input-static":Pe,"vs-input-container":ft,"vs-input-date":rt,"vs-input-checkbox":lt,"vs-input-file":ct,"vs-input-html":Pe,"vs-input-email":st,"vs-input-datatable":kt,"vs-input-map":bt,"vs-input-file-list":pt,"vs-input-tags":yt,"vs-input-slug":xt,"vs-input-key-value":wt,"vs-input-range":Et,"vs-input-color":_t,"vs-input-native-select":qe,"vs-input-array":Vt},Ia=e.defineComponent({__name:"behavior",props:{api:{},set:{},button:{},error:{},value:{}},setup(o){const t=o,n=e.inject("values");async function s(){try{if(!t.api)return;const l=t.api.replace("{{value}}",t.value),r=await fetch(l);if(!r.ok){X.notify({type:"warning",title:"Validation",message:"При спробі завантажити дані виникла помилка."});return}const a=await r.json();if(!t.set||!n)return;for(const[i,d]of Object.entries(t.set))n.value[i]=a.result[d]}catch(l){console.error(t.error,l)}}return(l,r)=>(e.openBlock(),e.createElementBlock("button",{onClick:s,class:"vs-button relative inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border !border-gray-200 hover:text-white bg-white text-blue-500 hover:border-blue-500 hover:bg-blue-500 focus:ring-blue-500 py-1.5 px-5 focus:ring-1 focus:ring-offset-1 ml-0 md:ml-2 mt-2 md:mt-0 py-[8px] md:w-2/4 whitespace-nowrap w-full"},e.toDisplayString(l.button),1))}}),Ta={class:"flex flex-col gap-1 w-full"},La={key:0,class:"text-sm text-gray-500"},vt=e.defineComponent({__name:"vs-compact-form-layout",props:e.mergeModels({item:{default:{}},layout:{default:"default"},style:{default:{}},type:{default:""},error:{type:[String,Boolean]}},{modelValue:{default:null},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const t=o,n=e.useModel(o,"modelValue"),s=e.computed(()=>gn[`${t.layout}`]),l=e.computed(()=>Ct?.[`vs-input-${t.item.type}`]),r=e.computed(()=>{const i=e.unref(l);if(!i)return new Set;const d=i.props??i.__vccOpts?.props;if(!d)return new Set;const u=Array.isArray(d)?d:Object.keys(d);return new Set(u)}),a=e.computed(()=>{const i=t.item??{},d=r.value;return d.size?Object.fromEntries(Object.entries(i).filter(([u])=>d.has(u))):{}});return(i,d)=>e.withDirectives((e.openBlock(),e.createBlock(e.resolveDynamicComponent(s.value),{ua:t.item.ua,error:t.error||"",item:i.item,label:t.item.label},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["flex w-full",`${t.item.type}-component`])},[e.createElementVNode("div",Ta,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.value),e.mergeProps(a.value,{modelValue:n.value,"onUpdate:modelValue":d[0]||(d[0]=u=>n.value=u)}),null,16,["modelValue"])),i.item.description&&t.layout!=="settings"?(e.openBlock(),e.createElementBlock("p",La,e.toDisplayString(i.item.description),1)):e.createCommentVNode("",!0)]),i.item.behavior?.api&&i.item.behavior?.button?(e.openBlock(),e.createBlock(Ia,e.mergeProps({key:0},i.item.behavior,{value:n.value}),null,16,["value"])):e.createCommentVNode("",!0)],2)]),_:1},8,["ua","error","item","label"])),[[e.vShow,!i.item.hidden]])}}),Ra={class:"text-sm text-gray-800 ml-[10px] mb-[4px] font-medium dark:text-neutral-300"},Oa=["onClick"],za=e.defineComponent({__name:"vs-compact-form-navigation",props:{target:{},scrollContainer:{},title:{default:"Навігація по формі"},enabled:{type:Boolean,default:!0},width:{default:400}},setup(o,{expose:t}){const n=o,s=e.ref([]),l=e.ref(""),r=e.ref(""),a=e.computed(()=>!!n.enabled),i=e.computed(()=>["flex flex-col border-l pl-[6px] pt-[8px] pr-[8px]","sticky top-0 self-start shrink-0","max-h-full min-h-0 overflow-y-auto"]),d=e.computed(()=>{const B=n.width;if(B==null)return{};const z=typeof B=="number"?`${B}px`:`${B}`;return{width:z,minWidth:z}});let u=null,c=0,p=0,h=null,_=null,j=null;const A=()=>Y(),D=()=>I();e.watch(()=>n.target,async B=>{if(E(),!B){h=null,s.value=[],l.value="";return}h=B,a.value&&(await e.nextTick(),b(B),I())},{immediate:!0}),e.watch(()=>n.scrollContainer,B=>{if(!a.value){_=B??null;return}V(B??null),e.nextTick(()=>I())},{immediate:!0}),e.onMounted(()=>{n.scrollContainer||V(null),I()}),e.onBeforeUnmount(()=>{E(),V(null,!0),h=null,typeof window<"u"&&(c&&window.cancelAnimationFrame(c),p&&window.cancelAnimationFrame(p))});function V(B,z=!1){if(j&&(j(),j=null),z){_=null;return}if(_=B??null,typeof window>"u")return;const q=B??window,G=window;q.addEventListener("scroll",A,{passive:!0}),G.addEventListener("resize",D),j=()=>{q.removeEventListener("scroll",A),G.removeEventListener("resize",D)}}function I(){if(!a.value||!h)return;c&&typeof window<"u"&&window.cancelAnimationFrame(c);const B=()=>{y(),c=0};typeof window>"u"?B():c=window.requestAnimationFrame(B)}function y(){if(!a.value||!h)return;const B=Array.from(h.querySelectorAll("h1, h2")),z=new Set,q=[];B.forEach((G,M)=>{const C=G.textContent?.trim()??"";if(!C)return;let S=(G.getAttribute("id")??"").trim();S||(S=f(C)||`heading-${M+1}`);let T=S,K=1;for(;z.has(T);)T=`${S}-${K++}`;G.id!==T&&(G.id=T),z.add(T),q.push({id:T,text:C,level:G.tagName.toLowerCase()==="h1"?1:2})}),s.value=q,q.length||(l.value=""),Z()}function f(B){return B.toLowerCase().replace(/[^a-z0-9\s-]/g,"").trim().replace(/\s+/g,"-")}function b(B){!B||!a.value||typeof MutationObserver>"u"||(E(),u=new MutationObserver(()=>I()),u.observe(B,{childList:!0,subtree:!0}))}function E(){u&&(u.disconnect(),u=null)}function w(B){const z=_;if(!z)return typeof window>"u"?B.offsetTop:B.getBoundingClientRect().top+window.scrollY;const q=B.getBoundingClientRect(),G=z.getBoundingClientRect();return q.top-G.top+z.scrollTop}function Z(){if(!a.value||!s.value.length)return;const B=_,z=B?B.scrollTop:typeof window<"u"?window.scrollY:0,q=B?B.clientHeight:typeof window<"u"?window.innerHeight:0,G=z+q;let M=null;for(const S of s.value){const T=document.getElementById(S.id);if(!T)continue;const K=w(T);K+T.offsetHeight>z&&K<G&&(M=S.id)}!M&&r.value&&(M=r.value),M&&(r.value=M);const C=B?B.scrollHeight-B.clientHeight:document.documentElement.scrollHeight-window.innerHeight;z+5>=C&&(M=s.value[s.value.length-1].id),M&&(l.value=M)}function Y(){a.value&&(p&&window.cancelAnimationFrame(p),p=window.requestAnimationFrame(()=>{Z(),p=0}))}function J(B){if(!a.value)return;const z=document.getElementById(B);if(!z)return;const q=_,G=Math.max(0,w(z));q?q.scrollTo({top:G,behavior:"smooth"}):typeof window<"u"&&window.scrollTo({top:G,behavior:"smooth"})}return t({refresh:I}),(B,z)=>a.value&&s.value.length?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(i.value),style:e.normalizeStyle(d.value)},[e.createElementVNode("h2",Ra,e.toDisplayString(B.title),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,q=>(e.openBlock(),e.createElementBlock("button",{key:q.id,type:"button",onClick:G=>J(q.id),class:e.normalizeClass(["flex gap-x-3 py-[6px] px-3 text-sm relative duration-200 hover:text-gray-800",q.level===2?"ml-[14px]":"ml-0",q.id===l.value?"text-gray-800 after:content-[''] after:absolute after:left-[-7px] after:w-[2px] after:h-[20px] after:bg-blue-600":"text-gray-500"])},[e.createElementVNode("span",null,e.toDisplayString(q.text),1)],10,Oa))),128))],6)):e.createCommentVNode("",!0)}}),Bt={required:"Це поле є обов’язковим",email:"Неправильний email"},ja=o=>o?!1:Bt.required,Ua=o=>{const t=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;return o?t.test(o)?!1:Bt.email:!1},Pa=(o,t)=>{const n=t.pattern??t.regexp;return!(typeof n=="string"?new RegExp(n):n).test(o)&&o?t.message:!1},Ha=(o,t)=>!1,qa=(o,t)=>{switch(typeof t=="string"?t:t.type){case"required":return ja(o);case"email":return Ua(o);case"regexp":return Pa(o,t);case"custom":return Ha();default:return!1}},Ga={autocomplete:"select",combobox:"select",datepicker:"date",markedtext:"mask",html:"static",geom:"map",filelist:"file-list",datalist:"datatable",file:"file",dropzone:"file"};function St(o){const t=o.toLowerCase();return Ga[t]||t}function Ka(o,t=!1){if(Array.isArray(o)){const s=[];return o.forEach(l=>{const r={...l};r.name=(l.name||l.id||l.key||"").toString(),r.type=St(l.type),r.label=l.label||l.ua,r.rules=l.rules||l.validators,r.type==="email"&&!r.rules&&(r.rules=["email"]),l.data&&(r.api=`/api/suggest/${l.data}`),r.disabled=t||r.disabled,s.push(r)}),s}const n=[];return Object.entries(o).forEach(s=>{const l={name:s[0],...s[1],type:St(s[1].type),label:s[1].label||s[1].ua,rules:s[1].rules||s[1].validators,disabled:t};l.type==="email"&&!l.rules&&(l.rules=["email"]),s[1].type.includes("list")&&(l.multiple=!0),!l.api&&s[1].data&&(l.api=`/api/suggest/${s[1].data}`),n.push(l)}),n}function Za(o,t,n=!1){const s=e.computed(()=>Ka((Array.isArray(t),t),typeof n=="boolean"?n:n.value)),l=e.ref({});function r(u){const c=u?.conditions;if(!c)return!0;const p=Array.isArray(c)?c[0]:c,h=o?.value?.[p];return ht(h,c)}const a=(u=s.value,c=!0)=>(u.forEach(p=>{if(p.rules){if(!r(p)){delete l.value[p.name];return}let h=!1,_=null;p.rules.forEach(j=>{const A=qa(o.value[p.name],j);A&&(h=!0,!_&&typeof A=="string"&&(_=A))}),h&&_?l.value[p.name]=_:delete l.value[p.name]}p.schema&&a(p.schema,!1)}),c&&Object.values(l.value).some(Boolean)?l.value:null),i=e.computed(()=>s.value?.filter(u=>r(u)));return{errors:l,validate:a,reset:()=>{o.value={},l.value={}},visibleSchema:i}}const Wa={class:"flex w-full h-full min-h-0 gap-6"},Ya={key:0,"data-orientation":"horizontal",role:"none",class:"mt-1 shrink-0 h-[1px] w-full bg-slate-100 dark:bg-slate-600"},ke=e.defineComponent({__name:"vs-compact-form",props:e.mergeModels({schema:{default:()=>[]},style:{default:()=>({})},modelValue:{},layout:{default:()=>"default"},formId:{default:()=>""},disabled:{type:Boolean,default:!1},navEnabled:{type:Boolean,default:!1},navWidth:{default:400}},{form:{default:()=>({})},formModifiers:{},values:{default:()=>({})},valuesModifiers:{}}),emits:e.mergeModels(["handle-submit","update:modelValue"],["update:form","update:values"]),setup(o,{expose:t,emit:n}){const s=n,l=o,r=e.useModel(o,"form"),a=e.useModel(o,"values"),{errors:i,validate:d,reset:u,visibleSchema:c}=Za(a,l.schema,e.toRef(l,"disabled")),p=e.ref(null),h=e.ref(null),_=e.computed(()=>l.navEnabled),j=e.computed(()=>l.navWidth),A=()=>{s("update:modelValue",a.value),d(),s("handle-submit",a.value)};t({validate:d,reset:u,errors:i}),e.onMounted(()=>{l.modelValue&&(a.value=l.modelValue),r.value={value:a.value,errors:i.value,reset:u,validate:d,formId:l.formId}});function D(V,I){if(V===I)return!0;if(typeof V!="object"||typeof I!="object"||!V||!I)return!1;const y=Object.keys(V),f=Object.keys(I);return y.length!==f.length?!1:y.every(b=>V[b]===I[b])}return e.provide("form",r),e.provide("values",a),(V,I)=>(e.openBlock(),e.createElementBlock("div",Wa,[e.createElementVNode("div",{class:"flex-1 min-h-0 overflow-y-auto",ref_key:"formScrollContainer",ref:h},[e.createElementVNode("form",{ref_key:"formRef",ref:p,onSubmit:e.withModifiers(A,["prevent"]),class:e.normalizeClass(["grid grid-cols-12",V.layout==="default"?"gap-6":"gap-4"])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(c),(y,f)=>(e.openBlock(),e.createElementBlock("div",{key:y.name,class:e.normalizeClass(V.layout==="horizontal"?"col-span-12":`col-span-${y.col||12}`)},[e.createVNode(vt,{style:e.normalizeStyle(V.style),item:y,layout:V.layout,"model-value":a.value[y.name],"onUpdate:modelValue":b=>{const E=a.value[y.name];D(E,b)||(a.value[y.name]=b)},error:e.unref(i)[y.name]},null,8,["style","item","layout","model-value","onUpdate:modelValue","error"]),V.layout==="settings"&&f+1!==e.unref(c).length?(e.openBlock(),e.createElementBlock("div",Ya)):e.createCommentVNode("",!0)],2))),128))],34)],512),e.createVNode(za,{target:p.value,"scroll-container":h.value,enabled:_.value,width:j.value},null,8,["target","scroll-container","enabled","width"])]))}}),Ja={class:"relative"},Xa={class:"w-full h-full fixed top-0 start-0 z-[1000] bg-black bg-opacity-50"},Qa={class:"m-[10px] fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 min-h-0 h-fit max-h-[80vh] overflow-hidden opacity-1 flex flex-col bg-white dark:bg-[#1A1A1A] border dark:border-[#454545] pointer-events-auto shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-xl lg:w-7/12 w-11/12"},ei={class:"py-2.5 px-4 flex justify-between items-center border-0 border-b border-solid border-gray-200 dark:border-b-[#454545]"},ti={class:"font-medium text-gray-800 dark:text-[#ffffff]"},ni={class:"p-4 mim-h-0 h-full overflow-auto"},Nt=e.defineComponent({__name:"modal-edit",props:{schema:{},defaultValue:{},mode:{},token:{},form:{}},emits:["close","save","edit"],setup(o,{emit:t}){const n=o,s=t,l=e.ref(n.schema),r=e.ref(n.defaultValue?JSON.parse(JSON.stringify(n.defaultValue)):{}),a=e.ref({}),i=e.ref(),d=e.ref(n.mode);async function u(){const p=a.value.validate();if(p){X.notify({type:"warning",title:"Помилка валідації",message:Object.entries(p).map(([h,_])=>`${h}: ${_}`).join(`
3
+ `)});return}if(i.value)try{const h=await fetch(`/api/table/${i.value}`,{method:d.value==="add"?"POST":"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(r.value)});if(h.ok)await h.json(),X.notify({type:"success",title:"Успішно",message:`Дані успішно ${d.value==="add"?"збережено":"оновлено"}`}),s("save",r.value);else if(h.status===400){const _=await h.json().catch(()=>({}));X.notify({type:"warning",title:"Помилка валідації",message:_.message||"Некоректні дані (400)"})}else h.status===500?X.notify({type:"error",title:"Серверна помилка",message:"Виникла помилка на сервері (500)"}):X.notify({type:"error",title:"Помилка",message:`Статус: ${h.status}`})}catch(h){X.notify({type:"error",title:"Помилка з’єднання",message:h.message||"Не вдалося виконати запит"})}}function c(){s("close")}return e.onMounted(async()=>{try{if(n.form){const p=await fetch(`/api/template/form/${n.form}`);if(!p.ok){X.notify({type:p.status>=400&&p.status<500?"warning":"error",title:"Error",message:`Error code: ${p.status}`});return}const h=await p.json();l.value=h.schema,i.value=h.token}else if(n.token){i.value=n.token;const p=await fetch(`/api/form/${i.value}`);if(!p.ok){X.notify({type:p.status>=400&&p.status<500?"warning":"error",title:"Error",message:`Error code: ${p.status}`});return}const h=await p.json();l.value=h.schema,h.data?r.value=h.data:d.value="add"}}catch(p){X.notify({type:"error",title:"Error",message:p.message||"Unexpected error"}),console.error(p)}}),(p,h)=>(e.openBlock(),e.createElementBlock("div",Ja,[e.createElementVNode("div",Xa,[e.createElementVNode("div",Qa,[e.createElementVNode("div",ei,[e.createElementVNode("h3",ti,e.toDisplayString(d.value==="add"?"Додати":"Змінити"),1),e.createElementVNode("button",{onClick:c,type:"button",class:"size-8 inline-flex justify-center items-center gap-x-2 rounded-full border border-transparent bg-gray-100 text-gray-800 hover:bg-gray-200 focus:outline-none focus:bg-gray-200 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:hover:bg-neutral-600 dark:text-neutral-400 dark:focus:bg-neutral-600"},h[2]||(h[2]=[e.createElementVNode("span",{class:"sr-only"},"Close",-1),e.createElementVNode("svg",{class:"flex-shrink-0 w-4 h-4",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("path",{d:"M18 6 6 18"}),e.createElementVNode("path",{d:"m6 6 12 12"})],-1)]))]),e.createElementVNode("div",ni,[l.value?(e.openBlock(),e.createBlock(ke,{key:0,schema:l.value,values:r.value,"onUpdate:values":h[0]||(h[0]=_=>r.value=_),form:a.value,"onUpdate:form":h[1]||(h[1]=_=>a.value=_)},null,8,["schema","values","form"])):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:"vs-form__head mr-5 mb-5 mt-3 flex items-center justify-end sticky top-0 left-0 z-[60] bg-white"},[e.createElementVNode("button",{type:"button",onClick:c,class:"vs-button inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border !border-gray-200 hover:text-white bg-white text-red-500 hover:border-red-500 hover:bg-red-500 focus:ring-red-500 py-1.5 px-5 focus:ring-1 focus:ring-offset-1 mr-2"}," Скасувати "),e.createElementVNode("button",{onClick:u,type:"button",class:"vs-button inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border-1 border-transparent text-white bg-blue-500 hover:bg-blue-600 focus:ring-blue-500 py-1.5 px-5 focus:ring-1 focus:ring-offset-1"}," Зберегти ")])])])]))}}),Mt=(o={mode:"edit",schema:null})=>new Promise(t=>{const{close:n}=X.modal({title:o.mode==="add"?"Додати":"Редагувати",template:"",visible:!0,size:"medium",closeClickBack:!0,content:Nt,contentProps:{...o,onClose:()=>{t(null),n()},onSave:s=>{t(s),n()}}})});ke.install=function(t){t.component("VForm",ke),Object.assign(t.config.globalProperties,{$form:Mt}),t.provide("form",Mt),window.v3plugin||(window.v3plugin={})};function ce(o){return typeof o=="string"||o instanceof String}function Ft(o){var t;return typeof o=="object"&&o!=null&&(o==null||(t=o.constructor)==null?void 0:t.name)==="Object"}function At(o,t){return Array.isArray(t)?At(o,(n,s)=>t.includes(s)):Object.entries(o).reduce((n,s)=>{let[l,r]=s;return t(r,l)&&(n[l]=r),n},{})}const N={NONE:"NONE",LEFT:"LEFT",FORCE_LEFT:"FORCE_LEFT",RIGHT:"RIGHT",FORCE_RIGHT:"FORCE_RIGHT"};function $t(o){switch(o){case N.LEFT:return N.FORCE_LEFT;case N.RIGHT:return N.FORCE_RIGHT;default:return o}}function Ge(o){return o.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")}function Ie(o,t){if(t===o)return!0;const n=Array.isArray(t),s=Array.isArray(o);let l;if(n&&s){if(t.length!=o.length)return!1;for(l=0;l<t.length;l++)if(!Ie(t[l],o[l]))return!1;return!0}if(n!=s)return!1;if(t&&o&&typeof t=="object"&&typeof o=="object"){const r=t instanceof Date,a=o instanceof Date;if(r&&a)return t.getTime()==o.getTime();if(r!=a)return!1;const i=t instanceof RegExp,d=o instanceof RegExp;if(i&&d)return t.toString()==o.toString();if(i!=d)return!1;const u=Object.keys(t);for(l=0;l<u.length;l++)if(!Object.prototype.hasOwnProperty.call(o,u[l]))return!1;for(l=0;l<u.length;l++)if(!Ie(o[u[l]],t[u[l]]))return!1;return!0}else if(t&&o&&typeof t=="function"&&typeof o=="function")return t.toString()===o.toString();return!1}class si{constructor(t){for(Object.assign(this,t);this.value.slice(0,this.startChangePos)!==this.oldValue.slice(0,this.startChangePos);)--this.oldSelection.start;if(this.insertedCount)for(;this.value.slice(this.cursorPos)!==this.oldValue.slice(this.oldSelection.end);)this.value.length-this.cursorPos<this.oldValue.length-this.oldSelection.end?++this.oldSelection.end:++this.cursorPos}get startChangePos(){return Math.min(this.cursorPos,this.oldSelection.start)}get insertedCount(){return this.cursorPos-this.startChangePos}get inserted(){return this.value.substr(this.startChangePos,this.insertedCount)}get removedCount(){return Math.max(this.oldSelection.end-this.startChangePos||this.oldValue.length-this.value.length,0)}get removed(){return this.oldValue.substr(this.startChangePos,this.removedCount)}get head(){return this.value.substring(0,this.startChangePos)}get tail(){return this.value.substring(this.startChangePos+this.insertedCount)}get removeDirection(){return!this.removedCount||this.insertedCount?N.NONE:(this.oldSelection.end===this.cursorPos||this.oldSelection.start===this.cursorPos)&&this.oldSelection.end===this.oldSelection.start?N.RIGHT:N.LEFT}}function $(o,t){return new $.InputMask(o,t)}function Dt(o){if(o==null)throw new Error("mask property should be defined");return o instanceof RegExp?$.MaskedRegExp:ce(o)?$.MaskedPattern:o===Date?$.MaskedDate:o===Number?$.MaskedNumber:Array.isArray(o)||o===Array?$.MaskedDynamic:$.Masked&&o.prototype instanceof $.Masked?o:$.Masked&&o instanceof $.Masked?o.constructor:o instanceof Function?$.MaskedFunction:(console.warn("Mask not found for mask",o),$.Masked)}function ye(o){if(!o)throw new Error("Options in not defined");if($.Masked){if(o.prototype instanceof $.Masked)return{mask:o};const{mask:t=void 0,...n}=o instanceof $.Masked?{mask:o}:Ft(o)&&o.mask instanceof $.Masked?o:{};if(t){const s=t.mask;return{...At(t,(l,r)=>!r.startsWith("_")),mask:t.constructor,_mask:s,...n}}}return Ft(o)?{...o}:{mask:o}}function ae(o){if($.Masked&&o instanceof $.Masked)return o;const t=ye(o),n=Dt(t.mask);if(!n)throw new Error("Masked class is not found for provided mask "+t.mask+", appropriate module needs to be imported manually before creating mask.");return t.mask===n&&delete t.mask,t._mask&&(t.mask=t._mask,delete t._mask),new n(t)}$.createMask=ae;class Te{get selectionStart(){let t;try{t=this._unsafeSelectionStart}catch{}return t??this.value.length}get selectionEnd(){let t;try{t=this._unsafeSelectionEnd}catch{}return t??this.value.length}select(t,n){if(!(t==null||n==null||t===this.selectionStart&&n===this.selectionEnd))try{this._unsafeSelect(t,n)}catch{}}get isActive(){return!1}}$.MaskElement=Te;const It=90,li=89;class ve extends Te{constructor(t){super(),this.input=t,this._onKeydown=this._onKeydown.bind(this),this._onInput=this._onInput.bind(this),this._onBeforeinput=this._onBeforeinput.bind(this),this._onCompositionEnd=this._onCompositionEnd.bind(this)}get rootElement(){var t,n,s;return(t=(n=(s=this.input).getRootNode)==null?void 0:n.call(s))!=null?t:document}get isActive(){return this.input===this.rootElement.activeElement}bindEvents(t){this.input.addEventListener("keydown",this._onKeydown),this.input.addEventListener("input",this._onInput),this.input.addEventListener("beforeinput",this._onBeforeinput),this.input.addEventListener("compositionend",this._onCompositionEnd),this.input.addEventListener("drop",t.drop),this.input.addEventListener("click",t.click),this.input.addEventListener("focus",t.focus),this.input.addEventListener("blur",t.commit),this._handlers=t}_onKeydown(t){if(this._handlers.redo&&(t.keyCode===It&&t.shiftKey&&(t.metaKey||t.ctrlKey)||t.keyCode===li&&t.ctrlKey))return t.preventDefault(),this._handlers.redo(t);if(this._handlers.undo&&t.keyCode===It&&(t.metaKey||t.ctrlKey))return t.preventDefault(),this._handlers.undo(t);t.isComposing||this._handlers.selectionChange(t)}_onBeforeinput(t){if(t.inputType==="historyUndo"&&this._handlers.undo)return t.preventDefault(),this._handlers.undo(t);if(t.inputType==="historyRedo"&&this._handlers.redo)return t.preventDefault(),this._handlers.redo(t)}_onCompositionEnd(t){this._handlers.input(t)}_onInput(t){t.isComposing||this._handlers.input(t)}unbindEvents(){this.input.removeEventListener("keydown",this._onKeydown),this.input.removeEventListener("input",this._onInput),this.input.removeEventListener("beforeinput",this._onBeforeinput),this.input.removeEventListener("compositionend",this._onCompositionEnd),this.input.removeEventListener("drop",this._handlers.drop),this.input.removeEventListener("click",this._handlers.click),this.input.removeEventListener("focus",this._handlers.focus),this.input.removeEventListener("blur",this._handlers.commit),this._handlers={}}}$.HTMLMaskElement=ve;class Tt extends ve{constructor(t){super(t),this.input=t}get _unsafeSelectionStart(){return this.input.selectionStart!=null?this.input.selectionStart:this.value.length}get _unsafeSelectionEnd(){return this.input.selectionEnd}_unsafeSelect(t,n){this.input.setSelectionRange(t,n)}get value(){return this.input.value}set value(t){this.input.value=t}}$.HTMLMaskElement=ve;class Ke extends ve{get _unsafeSelectionStart(){const t=this.rootElement,n=t.getSelection&&t.getSelection(),s=n&&n.anchorOffset,l=n&&n.focusOffset;return l==null||s==null||s<l?s:l}get _unsafeSelectionEnd(){const t=this.rootElement,n=t.getSelection&&t.getSelection(),s=n&&n.anchorOffset,l=n&&n.focusOffset;return l==null||s==null||s>l?s:l}_unsafeSelect(t,n){if(!this.rootElement.createRange)return;const s=this.rootElement.createRange();s.setStart(this.input.firstChild||this.input,t),s.setEnd(this.input.lastChild||this.input,n);const l=this.rootElement,r=l.getSelection&&l.getSelection();r&&(r.removeAllRanges(),r.addRange(s))}get value(){return this.input.textContent||""}set value(t){this.input.textContent=t}}$.HTMLContenteditableMaskElement=Ke;class Le{constructor(){this.states=[],this.currentIndex=0}get currentState(){return this.states[this.currentIndex]}get isEmpty(){return this.states.length===0}push(t){this.currentIndex<this.states.length-1&&(this.states.length=this.currentIndex+1),this.states.push(t),this.states.length>Le.MAX_LENGTH&&this.states.shift(),this.currentIndex=this.states.length-1}go(t){return this.currentIndex=Math.min(Math.max(this.currentIndex+t,0),this.states.length-1),this.currentState}undo(){return this.go(-1)}redo(){return this.go(1)}clear(){this.states.length=0,this.currentIndex=0}}Le.MAX_LENGTH=100;class Lt{constructor(t,n){this.el=t instanceof Te?t:t.isContentEditable&&t.tagName!=="INPUT"&&t.tagName!=="TEXTAREA"?new Ke(t):new Tt(t),this.masked=ae(n),this._listeners={},this._value="",this._unmaskedValue="",this._rawInputValue="",this.history=new Le,this._saveSelection=this._saveSelection.bind(this),this._onInput=this._onInput.bind(this),this._onChange=this._onChange.bind(this),this._onDrop=this._onDrop.bind(this),this._onFocus=this._onFocus.bind(this),this._onClick=this._onClick.bind(this),this._onUndo=this._onUndo.bind(this),this._onRedo=this._onRedo.bind(this),this.alignCursor=this.alignCursor.bind(this),this.alignCursorFriendly=this.alignCursorFriendly.bind(this),this._bindEvents(),this.updateValue(),this._onChange()}maskEquals(t){var n;return t==null||((n=this.masked)==null?void 0:n.maskEquals(t))}get mask(){return this.masked.mask}set mask(t){if(this.maskEquals(t))return;if(!(t instanceof $.Masked)&&this.masked.constructor===Dt(t)){this.masked.updateOptions({mask:t});return}const n=t instanceof $.Masked?t:ae({mask:t});n.unmaskedValue=this.masked.unmaskedValue,this.masked=n}get value(){return this._value}set value(t){this.value!==t&&(this.masked.value=t,this.updateControl("auto"))}get unmaskedValue(){return this._unmaskedValue}set unmaskedValue(t){this.unmaskedValue!==t&&(this.masked.unmaskedValue=t,this.updateControl("auto"))}get rawInputValue(){return this._rawInputValue}set rawInputValue(t){this.rawInputValue!==t&&(this.masked.rawInputValue=t,this.updateControl(),this.alignCursor())}get typedValue(){return this.masked.typedValue}set typedValue(t){this.masked.typedValueEquals(t)||(this.masked.typedValue=t,this.updateControl("auto"))}get displayValue(){return this.masked.displayValue}_bindEvents(){this.el.bindEvents({selectionChange:this._saveSelection,input:this._onInput,drop:this._onDrop,click:this._onClick,focus:this._onFocus,commit:this._onChange,undo:this._onUndo,redo:this._onRedo})}_unbindEvents(){this.el&&this.el.unbindEvents()}_fireEvent(t,n){const s=this._listeners[t];s&&s.forEach(l=>l(n))}get selectionStart(){return this._cursorChanging?this._changingCursorPos:this.el.selectionStart}get cursorPos(){return this._cursorChanging?this._changingCursorPos:this.el.selectionEnd}set cursorPos(t){!this.el||!this.el.isActive||(this.el.select(t,t),this._saveSelection())}_saveSelection(){this.displayValue!==this.el.value&&console.warn("Element value was changed outside of mask. Syncronize mask using `mask.updateValue()` to work properly."),this._selection={start:this.selectionStart,end:this.cursorPos}}updateValue(){this.masked.value=this.el.value,this._value=this.masked.value,this._unmaskedValue=this.masked.unmaskedValue,this._rawInputValue=this.masked.rawInputValue}updateControl(t){const n=this.masked.unmaskedValue,s=this.masked.value,l=this.masked.rawInputValue,r=this.displayValue,a=this.unmaskedValue!==n||this.value!==s||this._rawInputValue!==l;this._unmaskedValue=n,this._value=s,this._rawInputValue=l,this.el.value!==r&&(this.el.value=r),t==="auto"?this.alignCursor():t!=null&&(this.cursorPos=t),a&&this._fireChangeEvents(),!this._historyChanging&&(a||this.history.isEmpty)&&this.history.push({unmaskedValue:n,selection:{start:this.selectionStart,end:this.cursorPos}})}updateOptions(t){const{mask:n,...s}=t,l=!this.maskEquals(n),r=this.masked.optionsIsChanged(s);l&&(this.mask=n),r&&this.masked.updateOptions(s),(l||r)&&this.updateControl()}updateCursor(t){t!=null&&(this.cursorPos=t,this._delayUpdateCursor(t))}_delayUpdateCursor(t){this._abortUpdateCursor(),this._changingCursorPos=t,this._cursorChanging=setTimeout(()=>{this.el&&(this.cursorPos=this._changingCursorPos,this._abortUpdateCursor())},10)}_fireChangeEvents(){this._fireEvent("accept",this._inputEvent),this.masked.isComplete&&this._fireEvent("complete",this._inputEvent)}_abortUpdateCursor(){this._cursorChanging&&(clearTimeout(this._cursorChanging),delete this._cursorChanging)}alignCursor(){this.cursorPos=this.masked.nearestInputPos(this.masked.nearestInputPos(this.cursorPos,N.LEFT))}alignCursorFriendly(){this.selectionStart===this.cursorPos&&this.alignCursor()}on(t,n){return this._listeners[t]||(this._listeners[t]=[]),this._listeners[t].push(n),this}off(t,n){if(!this._listeners[t])return this;if(!n)return delete this._listeners[t],this;const s=this._listeners[t].indexOf(n);return s>=0&&this._listeners[t].splice(s,1),this}_onInput(t){this._inputEvent=t,this._abortUpdateCursor();const n=new si({value:this.el.value,cursorPos:this.cursorPos,oldValue:this.displayValue,oldSelection:this._selection}),s=this.masked.rawInputValue,l=this.masked.splice(n.startChangePos,n.removed.length,n.inserted,n.removeDirection,{input:!0,raw:!0}).offset,r=s===this.masked.rawInputValue?n.removeDirection:N.NONE;let a=this.masked.nearestInputPos(n.startChangePos+l,r);r!==N.NONE&&(a=this.masked.nearestInputPos(a,N.NONE)),this.updateControl(a),delete this._inputEvent}_onChange(){this.displayValue!==this.el.value&&this.updateValue(),this.masked.doCommit(),this.updateControl(),this._saveSelection()}_onDrop(t){t.preventDefault(),t.stopPropagation()}_onFocus(t){this.alignCursorFriendly()}_onClick(t){this.alignCursorFriendly()}_onUndo(){this._applyHistoryState(this.history.undo())}_onRedo(){this._applyHistoryState(this.history.redo())}_applyHistoryState(t){t&&(this._historyChanging=!0,this.unmaskedValue=t.unmaskedValue,this.el.select(t.selection.start,t.selection.end),this._saveSelection(),this._historyChanging=!1)}destroy(){this._unbindEvents(),this._listeners.length=0,delete this.el}}$.InputMask=Lt;class R{static normalize(t){return Array.isArray(t)?t:[t,new R]}constructor(t){Object.assign(this,{inserted:"",rawInserted:"",tailShift:0,skip:!1},t)}aggregate(t){return this.inserted+=t.inserted,this.rawInserted+=t.rawInserted,this.tailShift+=t.tailShift,this.skip=this.skip||t.skip,this}get offset(){return this.tailShift+this.inserted.length}get consumed(){return!!this.rawInserted||this.skip}equals(t){return this.inserted===t.inserted&&this.tailShift===t.tailShift&&this.rawInserted===t.rawInserted&&this.skip===t.skip}}$.ChangeDetails=R;class ie{constructor(t,n,s){t===void 0&&(t=""),n===void 0&&(n=0),this.value=t,this.from=n,this.stop=s}toString(){return this.value}extend(t){this.value+=String(t)}appendTo(t){return t.append(this.toString(),{tail:!0}).aggregate(t._appendPlaceholder())}get state(){return{value:this.value,from:this.from,stop:this.stop}}set state(t){Object.assign(this,t)}unshift(t){if(!this.value.length||t!=null&&this.from>=t)return"";const n=this.value[0];return this.value=this.value.slice(1),n}shift(){if(!this.value.length)return"";const t=this.value[this.value.length-1];return this.value=this.value.slice(0,-1),t}}class Q{constructor(t){this._value="",this._update({...Q.DEFAULTS,...t}),this._initialized=!0}updateOptions(t){this.optionsIsChanged(t)&&this.withValueRefresh(this._update.bind(this,t))}_update(t){Object.assign(this,t)}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue}}set state(t){this._value=t._value}reset(){this._value=""}get value(){return this._value}set value(t){this.resolve(t,{input:!0})}resolve(t,n){n===void 0&&(n={input:!0}),this.reset(),this.append(t,n,""),this.doCommit()}get unmaskedValue(){return this.value}set unmaskedValue(t){this.resolve(t,{})}get typedValue(){return this.parse?this.parse(this.value,this):this.unmaskedValue}set typedValue(t){this.format?this.value=this.format(t,this):this.unmaskedValue=String(t)}get rawInputValue(){return this.extractInput(0,this.displayValue.length,{raw:!0})}set rawInputValue(t){this.resolve(t,{raw:!0})}get displayValue(){return this.value}get isComplete(){return!0}get isFilled(){return this.isComplete}nearestInputPos(t,n){return t}totalInputPositions(t,n){return t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length),Math.min(this.displayValue.length,n-t)}extractInput(t,n,s){return t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length),this.displayValue.slice(t,n)}extractTail(t,n){return t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length),new ie(this.extractInput(t,n),t)}appendTail(t){return ce(t)&&(t=new ie(String(t))),t.appendTo(this)}_appendCharRaw(t,n){return t?(this._value+=t,new R({inserted:t,rawInserted:t})):new R}_appendChar(t,n,s){n===void 0&&(n={});const l=this.state;let r;if([t,r]=this.doPrepareChar(t,n),t&&(r=r.aggregate(this._appendCharRaw(t,n)),!r.rawInserted&&this.autofix==="pad")){const a=this.state;this.state=l;let i=this.pad(n);const d=this._appendCharRaw(t,n);i=i.aggregate(d),d.rawInserted||i.equals(r)?r=i:this.state=a}if(r.inserted){let a,i=this.doValidate(n)!==!1;if(i&&s!=null){const d=this.state;if(this.overwrite===!0){a=s.state;for(let c=0;c<r.rawInserted.length;++c)s.unshift(this.displayValue.length-r.tailShift)}let u=this.appendTail(s);if(i=u.rawInserted.length===s.toString().length,!(i&&u.inserted)&&this.overwrite==="shift"){this.state=d,a=s.state;for(let c=0;c<r.rawInserted.length;++c)s.shift();u=this.appendTail(s),i=u.rawInserted.length===s.toString().length}i&&u.inserted&&(this.state=d)}i||(r=new R,this.state=l,s&&a&&(s.state=a))}return r}_appendPlaceholder(){return new R}_appendEager(){return new R}append(t,n,s){if(!ce(t))throw new Error("value should be string");const l=ce(s)?new ie(String(s)):s;n!=null&&n.tail&&(n._beforeTailState=this.state);let r;[t,r]=this.doPrepare(t,n);for(let a=0;a<t.length;++a){const i=this._appendChar(t[a],n,l);if(!i.rawInserted&&!this.doSkipInvalid(t[a],n,l))break;r.aggregate(i)}return(this.eager===!0||this.eager==="append")&&n!=null&&n.input&&t&&r.aggregate(this._appendEager()),l!=null&&(r.tailShift+=this.appendTail(l).tailShift),r}remove(t,n){return t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length),this._value=this.displayValue.slice(0,t)+this.displayValue.slice(n),new R}withValueRefresh(t){if(this._refreshing||!this._initialized)return t();this._refreshing=!0;const n=this.rawInputValue,s=this.value,l=t();return this.rawInputValue=n,this.value&&this.value!==s&&s.indexOf(this.value)===0&&(this.append(s.slice(this.displayValue.length),{},""),this.doCommit()),delete this._refreshing,l}runIsolated(t){if(this._isolated||!this._initialized)return t(this);this._isolated=!0;const n=this.state,s=t(this);return this.state=n,delete this._isolated,s}doSkipInvalid(t,n,s){return!!this.skipInvalid}doPrepare(t,n){return n===void 0&&(n={}),R.normalize(this.prepare?this.prepare(t,this,n):t)}doPrepareChar(t,n){return n===void 0&&(n={}),R.normalize(this.prepareChar?this.prepareChar(t,this,n):t)}doValidate(t){return(!this.validate||this.validate(this.value,this,t))&&(!this.parent||this.parent.doValidate(t))}doCommit(){this.commit&&this.commit(this.value,this)}splice(t,n,s,l,r){s===void 0&&(s=""),l===void 0&&(l=N.NONE),r===void 0&&(r={input:!0});const a=t+n,i=this.extractTail(a),d=this.eager===!0||this.eager==="remove";let u;d&&(l=$t(l),u=this.extractInput(0,a,{raw:!0}));let c=t;const p=new R;if(l!==N.NONE&&(c=this.nearestInputPos(t,n>1&&t!==0&&!d?N.NONE:l),p.tailShift=c-t),p.aggregate(this.remove(c)),d&&l!==N.NONE&&u===this.rawInputValue)if(l===N.FORCE_LEFT){let h;for(;u===this.rawInputValue&&(h=this.displayValue.length);)p.aggregate(new R({tailShift:-1})).aggregate(this.remove(h-1))}else l===N.FORCE_RIGHT&&i.unshift();return p.aggregate(this.append(s,r,i))}maskEquals(t){return this.mask===t}optionsIsChanged(t){return!Ie(this,t)}typedValueEquals(t){const n=this.typedValue;return t===n||Q.EMPTY_VALUES.includes(t)&&Q.EMPTY_VALUES.includes(n)||(this.format?this.format(t,this)===this.format(this.typedValue,this):!1)}pad(t){return new R}}Q.DEFAULTS={skipInvalid:!0},Q.EMPTY_VALUES=[void 0,null,""],$.Masked=Q;class pe{constructor(t,n){t===void 0&&(t=[]),n===void 0&&(n=0),this.chunks=t,this.from=n}toString(){return this.chunks.map(String).join("")}extend(t){if(!String(t))return;t=ce(t)?new ie(String(t)):t;const n=this.chunks[this.chunks.length-1],s=n&&(n.stop===t.stop||t.stop==null)&&t.from===n.from+n.toString().length;if(t instanceof ie)s?n.extend(t.toString()):this.chunks.push(t);else if(t instanceof pe){if(t.stop==null){let l;for(;t.chunks.length&&t.chunks[0].stop==null;)l=t.chunks.shift(),l.from+=t.from,this.extend(l)}t.toString()&&(t.stop=t.blockIndex,this.chunks.push(t))}}appendTo(t){if(!(t instanceof $.MaskedPattern))return new ie(this.toString()).appendTo(t);const n=new R;for(let s=0;s<this.chunks.length;++s){const l=this.chunks[s],r=t._mapPosToBlock(t.displayValue.length),a=l.stop;let i;if(a!=null&&(!r||r.index<=a)&&((l instanceof pe||t._stops.indexOf(a)>=0)&&n.aggregate(t._appendPlaceholder(a)),i=l instanceof pe&&t._blocks[a]),i){const d=i.appendTail(l);n.aggregate(d);const u=l.toString().slice(d.rawInserted.length);u&&n.aggregate(t.append(u,{tail:!0}))}else n.aggregate(t.append(l.toString(),{tail:!0}))}return n}get state(){return{chunks:this.chunks.map(t=>t.state),from:this.from,stop:this.stop,blockIndex:this.blockIndex}}set state(t){const{chunks:n,...s}=t;Object.assign(this,s),this.chunks=n.map(l=>{const r="chunks"in l?new pe:new ie;return r.state=l,r})}unshift(t){if(!this.chunks.length||t!=null&&this.from>=t)return"";const n=t!=null?t-this.from:t;let s=0;for(;s<this.chunks.length;){const l=this.chunks[s],r=l.unshift(n);if(l.toString()){if(!r)break;++s}else this.chunks.splice(s,1);if(r)return r}return""}shift(){if(!this.chunks.length)return"";let t=this.chunks.length-1;for(;0<=t;){const n=this.chunks[t],s=n.shift();if(n.toString()){if(!s)break;--t}else this.chunks.splice(t,1);if(s)return s}return""}}class ri{constructor(t,n){this.masked=t,this._log=[];const{offset:s,index:l}=t._mapPosToBlock(n)||(n<0?{index:0,offset:0}:{index:this.masked._blocks.length,offset:0});this.offset=s,this.index=l,this.ok=!1}get block(){return this.masked._blocks[this.index]}get pos(){return this.masked._blockStartPos(this.index)+this.offset}get state(){return{index:this.index,offset:this.offset,ok:this.ok}}set state(t){Object.assign(this,t)}pushState(){this._log.push(this.state)}popState(){const t=this._log.pop();return t&&(this.state=t),t}bindBlock(){this.block||(this.index<0&&(this.index=0,this.offset=0),this.index>=this.masked._blocks.length&&(this.index=this.masked._blocks.length-1,this.offset=this.block.displayValue.length))}_pushLeft(t){for(this.pushState(),this.bindBlock();0<=this.index;--this.index,this.offset=((n=this.block)==null?void 0:n.displayValue.length)||0){var n;if(t())return this.ok=!0}return this.ok=!1}_pushRight(t){for(this.pushState(),this.bindBlock();this.index<this.masked._blocks.length;++this.index,this.offset=0)if(t())return this.ok=!0;return this.ok=!1}pushLeftBeforeFilled(){return this._pushLeft(()=>{if(!(this.block.isFixed||!this.block.value)&&(this.offset=this.block.nearestInputPos(this.offset,N.FORCE_LEFT),this.offset!==0))return!0})}pushLeftBeforeInput(){return this._pushLeft(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,N.LEFT),!0})}pushLeftBeforeRequired(){return this._pushLeft(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,N.LEFT),!0})}pushRightBeforeFilled(){return this._pushRight(()=>{if(!(this.block.isFixed||!this.block.value)&&(this.offset=this.block.nearestInputPos(this.offset,N.FORCE_RIGHT),this.offset!==this.block.value.length))return!0})}pushRightBeforeInput(){return this._pushRight(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,N.NONE),!0})}pushRightBeforeRequired(){return this._pushRight(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,N.NONE),!0})}}class Ze{constructor(t){Object.assign(this,t),this._value="",this.isFixed=!0}get value(){return this._value}get unmaskedValue(){return this.isUnmasking?this.value:""}get rawInputValue(){return this._isRawInput?this.value:""}get displayValue(){return this.value}reset(){this._isRawInput=!1,this._value=""}remove(t,n){return t===void 0&&(t=0),n===void 0&&(n=this._value.length),this._value=this._value.slice(0,t)+this._value.slice(n),this._value||(this._isRawInput=!1),new R}nearestInputPos(t,n){n===void 0&&(n=N.NONE);const s=0,l=this._value.length;switch(n){case N.LEFT:case N.FORCE_LEFT:return s;case N.NONE:case N.RIGHT:case N.FORCE_RIGHT:default:return l}}totalInputPositions(t,n){return t===void 0&&(t=0),n===void 0&&(n=this._value.length),this._isRawInput?n-t:0}extractInput(t,n,s){return t===void 0&&(t=0),n===void 0&&(n=this._value.length),s===void 0&&(s={}),s.raw&&this._isRawInput&&this._value.slice(t,n)||""}get isComplete(){return!0}get isFilled(){return!!this._value}_appendChar(t,n){if(n===void 0&&(n={}),this.isFilled)return new R;const s=this.eager===!0||this.eager==="append",r=this.char===t&&(this.isUnmasking||n.input||n.raw)&&(!n.raw||!s)&&!n.tail,a=new R({inserted:this.char,rawInserted:r?this.char:""});return this._value=this.char,this._isRawInput=r&&(n.raw||n.input),a}_appendEager(){return this._appendChar(this.char,{tail:!0})}_appendPlaceholder(){const t=new R;return this.isFilled||(this._value=t.inserted=this.char),t}extractTail(){return new ie("")}appendTail(t){return ce(t)&&(t=new ie(String(t))),t.appendTo(this)}append(t,n,s){const l=this._appendChar(t[0],n);return s!=null&&(l.tailShift+=this.appendTail(s).tailShift),l}doCommit(){}get state(){return{_value:this._value,_rawInputValue:this.rawInputValue}}set state(t){this._value=t._value,this._isRawInput=!!t._rawInputValue}pad(t){return this._appendPlaceholder()}}class Be{constructor(t){const{parent:n,isOptional:s,placeholderChar:l,displayChar:r,lazy:a,eager:i,...d}=t;this.masked=ae(d),Object.assign(this,{parent:n,isOptional:s,placeholderChar:l,displayChar:r,lazy:a,eager:i})}reset(){this.isFilled=!1,this.masked.reset()}remove(t,n){return t===void 0&&(t=0),n===void 0&&(n=this.value.length),t===0&&n>=1?(this.isFilled=!1,this.masked.remove(t,n)):new R}get value(){return this.masked.value||(this.isFilled&&!this.isOptional?this.placeholderChar:"")}get unmaskedValue(){return this.masked.unmaskedValue}get rawInputValue(){return this.masked.rawInputValue}get displayValue(){return this.masked.value&&this.displayChar||this.value}get isComplete(){return!!this.masked.value||this.isOptional}_appendChar(t,n){if(n===void 0&&(n={}),this.isFilled)return new R;const s=this.masked.state;let l=this.masked._appendChar(t,this.currentMaskFlags(n));return l.inserted&&this.doValidate(n)===!1&&(l=new R,this.masked.state=s),!l.inserted&&!this.isOptional&&!this.lazy&&!n.input&&(l.inserted=this.placeholderChar),l.skip=!l.inserted&&!this.isOptional,this.isFilled=!!l.inserted,l}append(t,n,s){return this.masked.append(t,this.currentMaskFlags(n),s)}_appendPlaceholder(){return this.isFilled||this.isOptional?new R:(this.isFilled=!0,new R({inserted:this.placeholderChar}))}_appendEager(){return new R}extractTail(t,n){return this.masked.extractTail(t,n)}appendTail(t){return this.masked.appendTail(t)}extractInput(t,n,s){return t===void 0&&(t=0),n===void 0&&(n=this.value.length),this.masked.extractInput(t,n,s)}nearestInputPos(t,n){n===void 0&&(n=N.NONE);const s=0,l=this.value.length,r=Math.min(Math.max(t,s),l);switch(n){case N.LEFT:case N.FORCE_LEFT:return this.isComplete?r:s;case N.RIGHT:case N.FORCE_RIGHT:return this.isComplete?r:l;case N.NONE:default:return r}}totalInputPositions(t,n){return t===void 0&&(t=0),n===void 0&&(n=this.value.length),this.value.slice(t,n).length}doValidate(t){return this.masked.doValidate(this.currentMaskFlags(t))&&(!this.parent||this.parent.doValidate(this.currentMaskFlags(t)))}doCommit(){this.masked.doCommit()}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue,masked:this.masked.state,isFilled:this.isFilled}}set state(t){this.masked.state=t.masked,this.isFilled=t.isFilled}currentMaskFlags(t){var n;return{...t,_beforeTailState:(t==null||(n=t._beforeTailState)==null?void 0:n.masked)||t?._beforeTailState}}pad(t){return new R}}Be.DEFAULT_DEFINITIONS={0:/\d/,a:/[\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,"*":/./};class Rt extends Q{updateOptions(t){super.updateOptions(t)}_update(t){const n=t.mask;n&&(t.validate=s=>s.search(n)>=0),super._update(t)}}$.MaskedRegExp=Rt;class ee extends Q{constructor(t){super({...ee.DEFAULTS,...t,definitions:Object.assign({},Be.DEFAULT_DEFINITIONS,t?.definitions)})}updateOptions(t){super.updateOptions(t)}_update(t){t.definitions=Object.assign({},this.definitions,t.definitions),super._update(t),this._rebuildMask()}_rebuildMask(){const t=this.definitions;this._blocks=[],this.exposeBlock=void 0,this._stops=[],this._maskedBlocks={};const n=this.mask;if(!n||!t)return;let s=!1,l=!1;for(let r=0;r<n.length;++r){if(this.blocks){const u=n.slice(r),c=Object.keys(this.blocks).filter(h=>u.indexOf(h)===0);c.sort((h,_)=>_.length-h.length);const p=c[0];if(p){const{expose:h,repeat:_,...j}=ye(this.blocks[p]),A={lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,overwrite:this.overwrite,autofix:this.autofix,...j,repeat:_,parent:this},D=_!=null?new $.RepeatBlock(A):ae(A);D&&(this._blocks.push(D),h&&(this.exposeBlock=D),this._maskedBlocks[p]||(this._maskedBlocks[p]=[]),this._maskedBlocks[p].push(this._blocks.length-1)),r+=p.length-1;continue}}let a=n[r],i=a in t;if(a===ee.STOP_CHAR){this._stops.push(this._blocks.length);continue}if(a==="{"||a==="}"){s=!s;continue}if(a==="["||a==="]"){l=!l;continue}if(a===ee.ESCAPE_CHAR){if(++r,a=n[r],!a)break;i=!1}const d=i?new Be({isOptional:l,lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,...ye(t[a]),parent:this}):new Ze({char:a,eager:this.eager,isUnmasking:s});this._blocks.push(d)}}get state(){return{...super.state,_blocks:this._blocks.map(t=>t.state)}}set state(t){if(!t){this.reset();return}const{_blocks:n,...s}=t;this._blocks.forEach((l,r)=>l.state=n[r]),super.state=s}reset(){super.reset(),this._blocks.forEach(t=>t.reset())}get isComplete(){return this.exposeBlock?this.exposeBlock.isComplete:this._blocks.every(t=>t.isComplete)}get isFilled(){return this._blocks.every(t=>t.isFilled)}get isFixed(){return this._blocks.every(t=>t.isFixed)}get isOptional(){return this._blocks.every(t=>t.isOptional)}doCommit(){this._blocks.forEach(t=>t.doCommit()),super.doCommit()}get unmaskedValue(){return this.exposeBlock?this.exposeBlock.unmaskedValue:this._blocks.reduce((t,n)=>t+=n.unmaskedValue,"")}set unmaskedValue(t){if(this.exposeBlock){const n=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.unmaskedValue=t,this.appendTail(n),this.doCommit()}else super.unmaskedValue=t}get value(){return this.exposeBlock?this.exposeBlock.value:this._blocks.reduce((t,n)=>t+=n.value,"")}set value(t){if(this.exposeBlock){const n=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.value=t,this.appendTail(n),this.doCommit()}else super.value=t}get typedValue(){return this.exposeBlock?this.exposeBlock.typedValue:super.typedValue}set typedValue(t){if(this.exposeBlock){const n=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.typedValue=t,this.appendTail(n),this.doCommit()}else super.typedValue=t}get displayValue(){return this._blocks.reduce((t,n)=>t+=n.displayValue,"")}appendTail(t){return super.appendTail(t).aggregate(this._appendPlaceholder())}_appendEager(){var t;const n=new R;let s=(t=this._mapPosToBlock(this.displayValue.length))==null?void 0:t.index;if(s==null)return n;this._blocks[s].isFilled&&++s;for(let l=s;l<this._blocks.length;++l){const r=this._blocks[l]._appendEager();if(!r.inserted)break;n.aggregate(r)}return n}_appendCharRaw(t,n){n===void 0&&(n={});const s=this._mapPosToBlock(this.displayValue.length),l=new R;if(!s)return l;for(let a=s.index,i;i=this._blocks[a];++a){var r;const d=i._appendChar(t,{...n,_beforeTailState:(r=n._beforeTailState)==null||(r=r._blocks)==null?void 0:r[a]});if(l.aggregate(d),d.consumed)break}return l}extractTail(t,n){t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length);const s=new pe;return t===n||this._forEachBlocksInRange(t,n,(l,r,a,i)=>{const d=l.extractTail(a,i);d.stop=this._findStopBefore(r),d.from=this._blockStartPos(r),d instanceof pe&&(d.blockIndex=r),s.extend(d)}),s}extractInput(t,n,s){if(t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length),s===void 0&&(s={}),t===n)return"";let l="";return this._forEachBlocksInRange(t,n,(r,a,i,d)=>{l+=r.extractInput(i,d,s)}),l}_findStopBefore(t){let n;for(let s=0;s<this._stops.length;++s){const l=this._stops[s];if(l<=t)n=l;else break}return n}_appendPlaceholder(t){const n=new R;if(this.lazy&&t==null)return n;const s=this._mapPosToBlock(this.displayValue.length);if(!s)return n;const l=s.index,r=t??this._blocks.length;return this._blocks.slice(l,r).forEach(a=>{if(!a.lazy||t!=null){var i;n.aggregate(a._appendPlaceholder((i=a._blocks)==null?void 0:i.length))}}),n}_mapPosToBlock(t){let n="";for(let s=0;s<this._blocks.length;++s){const l=this._blocks[s],r=n.length;if(n+=l.displayValue,t<=n.length)return{index:s,offset:t-r}}}_blockStartPos(t){return this._blocks.slice(0,t).reduce((n,s)=>n+=s.displayValue.length,0)}_forEachBlocksInRange(t,n,s){n===void 0&&(n=this.displayValue.length);const l=this._mapPosToBlock(t);if(l){const r=this._mapPosToBlock(n),a=r&&l.index===r.index,i=l.offset,d=r&&a?r.offset:this._blocks[l.index].displayValue.length;if(s(this._blocks[l.index],l.index,i,d),r&&!a){for(let u=l.index+1;u<r.index;++u)s(this._blocks[u],u,0,this._blocks[u].displayValue.length);s(this._blocks[r.index],r.index,0,r.offset)}}}remove(t,n){t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length);const s=super.remove(t,n);return this._forEachBlocksInRange(t,n,(l,r,a,i)=>{s.aggregate(l.remove(a,i))}),s}nearestInputPos(t,n){if(n===void 0&&(n=N.NONE),!this._blocks.length)return 0;const s=new ri(this,t);if(n===N.NONE)return s.pushRightBeforeInput()||(s.popState(),s.pushLeftBeforeInput())?s.pos:this.displayValue.length;if(n===N.LEFT||n===N.FORCE_LEFT){if(n===N.LEFT){if(s.pushRightBeforeFilled(),s.ok&&s.pos===t)return t;s.popState()}if(s.pushLeftBeforeInput(),s.pushLeftBeforeRequired(),s.pushLeftBeforeFilled(),n===N.LEFT){if(s.pushRightBeforeInput(),s.pushRightBeforeRequired(),s.ok&&s.pos<=t||(s.popState(),s.ok&&s.pos<=t))return s.pos;s.popState()}return s.ok?s.pos:n===N.FORCE_LEFT?0:(s.popState(),s.ok||(s.popState(),s.ok)?s.pos:0)}return n===N.RIGHT||n===N.FORCE_RIGHT?(s.pushRightBeforeInput(),s.pushRightBeforeRequired(),s.pushRightBeforeFilled()?s.pos:n===N.FORCE_RIGHT?this.displayValue.length:(s.popState(),s.ok||(s.popState(),s.ok)?s.pos:this.nearestInputPos(t,N.LEFT))):t}totalInputPositions(t,n){t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length);let s=0;return this._forEachBlocksInRange(t,n,(l,r,a,i)=>{s+=l.totalInputPositions(a,i)}),s}maskedBlock(t){return this.maskedBlocks(t)[0]}maskedBlocks(t){const n=this._maskedBlocks[t];return n?n.map(s=>this._blocks[s]):[]}pad(t){const n=new R;return this._forEachBlocksInRange(0,this.displayValue.length,s=>n.aggregate(s.pad(t))),n}}ee.DEFAULTS={...Q.DEFAULTS,lazy:!0,placeholderChar:"_"},ee.STOP_CHAR="`",ee.ESCAPE_CHAR="\\",ee.InputDefinition=Be,ee.FixedDefinition=Ze,$.MaskedPattern=ee;class Se extends ee{get _matchFrom(){return this.maxLength-String(this.from).length}constructor(t){super(t)}updateOptions(t){super.updateOptions(t)}_update(t){const{to:n=this.to||0,from:s=this.from||0,maxLength:l=this.maxLength||0,autofix:r=this.autofix,...a}=t;this.to=n,this.from=s,this.maxLength=Math.max(String(n).length,l),this.autofix=r;const i=String(this.from).padStart(this.maxLength,"0"),d=String(this.to).padStart(this.maxLength,"0");let u=0;for(;u<d.length&&d[u]===i[u];)++u;a.mask=d.slice(0,u).replace(/0/g,"\\0")+"0".repeat(this.maxLength-u),super._update(a)}get isComplete(){return super.isComplete&&!!this.value}boundaries(t){let n="",s="";const[,l,r]=t.match(/^(\D*)(\d*)(\D*)/)||[];return r&&(n="0".repeat(l.length)+r,s="9".repeat(l.length)+r),n=n.padEnd(this.maxLength,"0"),s=s.padEnd(this.maxLength,"9"),[n,s]}doPrepareChar(t,n){n===void 0&&(n={});let s;return[t,s]=super.doPrepareChar(t.replace(/\D/g,""),n),t||(s.skip=!this.isComplete),[t,s]}_appendCharRaw(t,n){if(n===void 0&&(n={}),!this.autofix||this.value.length+1>this.maxLength)return super._appendCharRaw(t,n);const s=String(this.from).padStart(this.maxLength,"0"),l=String(this.to).padStart(this.maxLength,"0"),[r,a]=this.boundaries(this.value+t);return Number(a)<this.from?super._appendCharRaw(s[this.value.length],n):Number(r)>this.to?!n.tail&&this.autofix==="pad"&&this.value.length+1<this.maxLength?super._appendCharRaw(s[this.value.length],n).aggregate(this._appendCharRaw(t,n)):super._appendCharRaw(l[this.value.length],n):super._appendCharRaw(t,n)}doValidate(t){const n=this.value;if(n.search(/[^0]/)===-1&&n.length<=this._matchFrom)return!0;const[l,r]=this.boundaries(n);return this.from<=Number(r)&&Number(l)<=this.to&&super.doValidate(t)}pad(t){const n=new R;if(this.value.length===this.maxLength)return n;const s=this.value,l=this.maxLength-this.value.length;if(l){this.reset();for(let r=0;r<l;++r)n.aggregate(super._appendCharRaw("0",t));s.split("").forEach(r=>this._appendCharRaw(r))}return n}}$.MaskedRange=Se;const oi="d{.}`m{.}`Y";class de extends ee{static extractPatternOptions(t){const{mask:n,pattern:s,...l}=t;return{...l,mask:ce(n)?n:s}}constructor(t){super(de.extractPatternOptions({...de.DEFAULTS,...t}))}updateOptions(t){super.updateOptions(t)}_update(t){const{mask:n,pattern:s,blocks:l,...r}={...de.DEFAULTS,...t},a=Object.assign({},de.GET_DEFAULT_BLOCKS());t.min&&(a.Y.from=t.min.getFullYear()),t.max&&(a.Y.to=t.max.getFullYear()),t.min&&t.max&&a.Y.from===a.Y.to&&(a.m.from=t.min.getMonth()+1,a.m.to=t.max.getMonth()+1,a.m.from===a.m.to&&(a.d.from=t.min.getDate(),a.d.to=t.max.getDate())),Object.assign(a,this.blocks,l),super._update({...r,mask:ce(n)?n:s,blocks:a})}doValidate(t){const n=this.date;return super.doValidate(t)&&(!this.isComplete||this.isDateExist(this.value)&&n!=null&&(this.min==null||this.min<=n)&&(this.max==null||n<=this.max))}isDateExist(t){return this.format(this.parse(t,this),this).indexOf(t)>=0}get date(){return this.typedValue}set date(t){this.typedValue=t}get typedValue(){return this.isComplete?super.typedValue:null}set typedValue(t){super.typedValue=t}maskEquals(t){return t===Date||super.maskEquals(t)}optionsIsChanged(t){return super.optionsIsChanged(de.extractPatternOptions(t))}}de.GET_DEFAULT_BLOCKS=()=>({d:{mask:Se,from:1,to:31,maxLength:2},m:{mask:Se,from:1,to:12,maxLength:2},Y:{mask:Se,from:1900,to:9999}}),de.DEFAULTS={...ee.DEFAULTS,mask:Date,pattern:oi,format:(o,t)=>{if(!o)return"";const n=String(o.getDate()).padStart(2,"0"),s=String(o.getMonth()+1).padStart(2,"0"),l=o.getFullYear();return[n,s,l].join(".")},parse:(o,t)=>{const[n,s,l]=o.split(".").map(Number);return new Date(l,s-1,n)}},$.MaskedDate=de;class Ne extends Q{constructor(t){super({...Ne.DEFAULTS,...t}),this.currentMask=void 0}updateOptions(t){super.updateOptions(t)}_update(t){super._update(t),"mask"in t&&(this.exposeMask=void 0,this.compiledMasks=Array.isArray(t.mask)?t.mask.map(n=>{const{expose:s,...l}=ye(n),r=ae({overwrite:this._overwrite,eager:this._eager,skipInvalid:this._skipInvalid,...l});return s&&(this.exposeMask=r),r}):[])}_appendCharRaw(t,n){n===void 0&&(n={});const s=this._applyDispatch(t,n);return this.currentMask&&s.aggregate(this.currentMask._appendChar(t,this.currentMaskFlags(n))),s}_applyDispatch(t,n,s){t===void 0&&(t=""),n===void 0&&(n={}),s===void 0&&(s="");const l=n.tail&&n._beforeTailState!=null?n._beforeTailState._value:this.value,r=this.rawInputValue,a=n.tail&&n._beforeTailState!=null?n._beforeTailState._rawInputValue:r,i=r.slice(a.length),d=this.currentMask,u=new R,c=d?.state;return this.currentMask=this.doDispatch(t,{...n},s),this.currentMask&&(this.currentMask!==d?(this.currentMask.reset(),a&&(this.currentMask.append(a,{raw:!0}),u.tailShift=this.currentMask.value.length-l.length),i&&(u.tailShift+=this.currentMask.append(i,{raw:!0,tail:!0}).tailShift)):c&&(this.currentMask.state=c)),u}_appendPlaceholder(){const t=this._applyDispatch();return this.currentMask&&t.aggregate(this.currentMask._appendPlaceholder()),t}_appendEager(){const t=this._applyDispatch();return this.currentMask&&t.aggregate(this.currentMask._appendEager()),t}appendTail(t){const n=new R;return t&&n.aggregate(this._applyDispatch("",{},t)),n.aggregate(this.currentMask?this.currentMask.appendTail(t):super.appendTail(t))}currentMaskFlags(t){var n,s;return{...t,_beforeTailState:((n=t._beforeTailState)==null?void 0:n.currentMaskRef)===this.currentMask&&((s=t._beforeTailState)==null?void 0:s.currentMask)||t._beforeTailState}}doDispatch(t,n,s){return n===void 0&&(n={}),s===void 0&&(s=""),this.dispatch(t,this,n,s)}doValidate(t){return super.doValidate(t)&&(!this.currentMask||this.currentMask.doValidate(this.currentMaskFlags(t)))}doPrepare(t,n){n===void 0&&(n={});let[s,l]=super.doPrepare(t,n);if(this.currentMask){let r;[s,r]=super.doPrepare(s,this.currentMaskFlags(n)),l=l.aggregate(r)}return[s,l]}doPrepareChar(t,n){n===void 0&&(n={});let[s,l]=super.doPrepareChar(t,n);if(this.currentMask){let r;[s,r]=super.doPrepareChar(s,this.currentMaskFlags(n)),l=l.aggregate(r)}return[s,l]}reset(){var t;(t=this.currentMask)==null||t.reset(),this.compiledMasks.forEach(n=>n.reset())}get value(){return this.exposeMask?this.exposeMask.value:this.currentMask?this.currentMask.value:""}set value(t){this.exposeMask?(this.exposeMask.value=t,this.currentMask=this.exposeMask,this._applyDispatch()):super.value=t}get unmaskedValue(){return this.exposeMask?this.exposeMask.unmaskedValue:this.currentMask?this.currentMask.unmaskedValue:""}set unmaskedValue(t){this.exposeMask?(this.exposeMask.unmaskedValue=t,this.currentMask=this.exposeMask,this._applyDispatch()):super.unmaskedValue=t}get typedValue(){return this.exposeMask?this.exposeMask.typedValue:this.currentMask?this.currentMask.typedValue:""}set typedValue(t){if(this.exposeMask){this.exposeMask.typedValue=t,this.currentMask=this.exposeMask,this._applyDispatch();return}let n=String(t);this.currentMask&&(this.currentMask.typedValue=t,n=this.currentMask.unmaskedValue),this.unmaskedValue=n}get displayValue(){return this.currentMask?this.currentMask.displayValue:""}get isComplete(){var t;return!!((t=this.currentMask)!=null&&t.isComplete)}get isFilled(){var t;return!!((t=this.currentMask)!=null&&t.isFilled)}remove(t,n){const s=new R;return this.currentMask&&s.aggregate(this.currentMask.remove(t,n)).aggregate(this._applyDispatch()),s}get state(){var t;return{...super.state,_rawInputValue:this.rawInputValue,compiledMasks:this.compiledMasks.map(n=>n.state),currentMaskRef:this.currentMask,currentMask:(t=this.currentMask)==null?void 0:t.state}}set state(t){const{compiledMasks:n,currentMaskRef:s,currentMask:l,...r}=t;n&&this.compiledMasks.forEach((a,i)=>a.state=n[i]),s!=null&&(this.currentMask=s,this.currentMask.state=l),super.state=r}extractInput(t,n,s){return this.currentMask?this.currentMask.extractInput(t,n,s):""}extractTail(t,n){return this.currentMask?this.currentMask.extractTail(t,n):super.extractTail(t,n)}doCommit(){this.currentMask&&this.currentMask.doCommit(),super.doCommit()}nearestInputPos(t,n){return this.currentMask?this.currentMask.nearestInputPos(t,n):super.nearestInputPos(t,n)}get overwrite(){return this.currentMask?this.currentMask.overwrite:this._overwrite}set overwrite(t){this._overwrite=t}get eager(){return this.currentMask?this.currentMask.eager:this._eager}set eager(t){this._eager=t}get skipInvalid(){return this.currentMask?this.currentMask.skipInvalid:this._skipInvalid}set skipInvalid(t){this._skipInvalid=t}get autofix(){return this.currentMask?this.currentMask.autofix:this._autofix}set autofix(t){this._autofix=t}maskEquals(t){return Array.isArray(t)?this.compiledMasks.every((n,s)=>{if(!t[s])return;const{mask:l,...r}=t[s];return Ie(n,r)&&n.maskEquals(l)}):super.maskEquals(t)}typedValueEquals(t){var n;return!!((n=this.currentMask)!=null&&n.typedValueEquals(t))}}Ne.DEFAULTS={...Q.DEFAULTS,dispatch:(o,t,n,s)=>{if(!t.compiledMasks.length)return;const l=t.rawInputValue,r=t.compiledMasks.map((a,i)=>{const d=t.currentMask===a,u=d?a.displayValue.length:a.nearestInputPos(a.displayValue.length,N.FORCE_LEFT);return a.rawInputValue!==l?(a.reset(),a.append(l,{raw:!0})):d||a.remove(u),a.append(o,t.currentMaskFlags(n)),a.appendTail(s),{index:i,weight:a.rawInputValue.length,totalInputPositions:a.totalInputPositions(0,Math.max(u,a.nearestInputPos(a.displayValue.length,N.FORCE_LEFT)))}});return r.sort((a,i)=>i.weight-a.weight||i.totalInputPositions-a.totalInputPositions),t.compiledMasks[r[0].index]}},$.MaskedDynamic=Ne;class Me extends ee{constructor(t){super({...Me.DEFAULTS,...t})}updateOptions(t){super.updateOptions(t)}_update(t){const{enum:n,...s}=t;if(n){const l=n.map(i=>i.length),r=Math.min(...l),a=Math.max(...l)-r;s.mask="*".repeat(r),a&&(s.mask+="["+"*".repeat(a)+"]"),this.enum=n}super._update(s)}_appendCharRaw(t,n){n===void 0&&(n={});const s=Math.min(this.nearestInputPos(0,N.FORCE_RIGHT),this.value.length),l=this.enum.filter(r=>this.matchValue(r,this.unmaskedValue+t,s));if(l.length){l.length===1&&this._forEachBlocksInRange(0,this.value.length,(a,i)=>{const d=l[0][i];i>=this.value.length||d===a.value||(a.reset(),a._appendChar(d,n))});const r=super._appendCharRaw(l[0][this.value.length],n);return l.length===1&&l[0].slice(this.unmaskedValue.length).split("").forEach(a=>r.aggregate(super._appendCharRaw(a))),r}return new R({skip:!this.isComplete})}extractTail(t,n){return t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length),new ie("",t)}remove(t,n){if(t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length),t===n)return new R;const s=Math.min(super.nearestInputPos(0,N.FORCE_RIGHT),this.value.length);let l;for(l=t;l>=0&&!(this.enum.filter(i=>this.matchValue(i,this.value.slice(s,l),s)).length>1);--l);const r=super.remove(l,n);return r.tailShift+=l-t,r}get isComplete(){return this.enum.indexOf(this.value)>=0}}Me.DEFAULTS={...ee.DEFAULTS,matchValue:(o,t,n)=>o.indexOf(t,n)===n},$.MaskedEnum=Me;class Ot extends Q{updateOptions(t){super.updateOptions(t)}_update(t){super._update({...t,validate:t.mask})}}$.MaskedFunction=Ot;var zt;class ne extends Q{constructor(t){super({...ne.DEFAULTS,...t})}updateOptions(t){super.updateOptions(t)}_update(t){super._update(t),this._updateRegExps()}_updateRegExps(){const t="^"+(this.allowNegative?"[+|\\-]?":""),n="\\d*",s=(this.scale?"("+Ge(this.radix)+"\\d{0,"+this.scale+"})?":"")+"$";this._numberRegExp=new RegExp(t+n+s),this._mapToRadixRegExp=new RegExp("["+this.mapToRadix.map(Ge).join("")+"]","g"),this._thousandsSeparatorRegExp=new RegExp(Ge(this.thousandsSeparator),"g")}_removeThousandsSeparators(t){return t.replace(this._thousandsSeparatorRegExp,"")}_insertThousandsSeparators(t){const n=t.split(this.radix);return n[0]=n[0].replace(/\B(?=(\d{3})+(?!\d))/g,this.thousandsSeparator),n.join(this.radix)}doPrepareChar(t,n){n===void 0&&(n={});const[s,l]=super.doPrepareChar(this._removeThousandsSeparators(this.scale&&this.mapToRadix.length&&(n.input&&n.raw||!n.input&&!n.raw)?t.replace(this._mapToRadixRegExp,this.radix):t),n);return t&&!s&&(l.skip=!0),s&&!this.allowPositive&&!this.value&&s!=="-"&&l.aggregate(this._appendChar("-")),[s,l]}_separatorsCount(t,n){n===void 0&&(n=!1);let s=0;for(let l=0;l<t;++l)this._value.indexOf(this.thousandsSeparator,l)===l&&(++s,n&&(t+=this.thousandsSeparator.length));return s}_separatorsCountFromSlice(t){return t===void 0&&(t=this._value),this._separatorsCount(this._removeThousandsSeparators(t).length,!0)}extractInput(t,n,s){return t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length),[t,n]=this._adjustRangeWithSeparators(t,n),this._removeThousandsSeparators(super.extractInput(t,n,s))}_appendCharRaw(t,n){n===void 0&&(n={});const s=n.tail&&n._beforeTailState?n._beforeTailState._value:this._value,l=this._separatorsCountFromSlice(s);this._value=this._removeThousandsSeparators(this.value);const r=this._value;this._value+=t;const a=this.number;let i=!isNaN(a),d=!1;if(i){let h;this.min!=null&&this.min<0&&this.number<this.min&&(h=this.min),this.max!=null&&this.max>0&&this.number>this.max&&(h=this.max),h!=null&&(this.autofix?(this._value=this.format(h,this).replace(ne.UNMASKED_RADIX,this.radix),d||(d=r===this._value&&!n.tail)):i=!1),i&&(i=!!this._value.match(this._numberRegExp))}let u;i?u=new R({inserted:this._value.slice(r.length),rawInserted:d?"":t,skip:d}):(this._value=r,u=new R),this._value=this._insertThousandsSeparators(this._value);const c=n.tail&&n._beforeTailState?n._beforeTailState._value:this._value,p=this._separatorsCountFromSlice(c);return u.tailShift+=(p-l)*this.thousandsSeparator.length,u}_findSeparatorAround(t){if(this.thousandsSeparator){const n=t-this.thousandsSeparator.length+1,s=this.value.indexOf(this.thousandsSeparator,n);if(s<=t)return s}return-1}_adjustRangeWithSeparators(t,n){const s=this._findSeparatorAround(t);s>=0&&(t=s);const l=this._findSeparatorAround(n);return l>=0&&(n=l+this.thousandsSeparator.length),[t,n]}remove(t,n){t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length),[t,n]=this._adjustRangeWithSeparators(t,n);const s=this.value.slice(0,t),l=this.value.slice(n),r=this._separatorsCount(s.length);this._value=this._insertThousandsSeparators(this._removeThousandsSeparators(s+l));const a=this._separatorsCountFromSlice(s);return new R({tailShift:(a-r)*this.thousandsSeparator.length})}nearestInputPos(t,n){if(!this.thousandsSeparator)return t;switch(n){case N.NONE:case N.LEFT:case N.FORCE_LEFT:{const s=this._findSeparatorAround(t-1);if(s>=0){const l=s+this.thousandsSeparator.length;if(t<l||this.value.length<=l||n===N.FORCE_LEFT)return s}break}case N.RIGHT:case N.FORCE_RIGHT:{const s=this._findSeparatorAround(t);if(s>=0)return s+this.thousandsSeparator.length}}return t}doCommit(){if(this.value){const t=this.number;let n=t;this.min!=null&&(n=Math.max(n,this.min)),this.max!=null&&(n=Math.min(n,this.max)),n!==t&&(this.unmaskedValue=this.format(n,this));let s=this.value;this.normalizeZeros&&(s=this._normalizeZeros(s)),this.padFractionalZeros&&this.scale>0&&(s=this._padFractionalZeros(s)),this._value=s}super.doCommit()}_normalizeZeros(t){const n=this._removeThousandsSeparators(t).split(this.radix);return n[0]=n[0].replace(/^(\D*)(0*)(\d*)/,(s,l,r,a)=>l+a),t.length&&!/\d$/.test(n[0])&&(n[0]=n[0]+"0"),n.length>1&&(n[1]=n[1].replace(/0*$/,""),n[1].length||(n.length=1)),this._insertThousandsSeparators(n.join(this.radix))}_padFractionalZeros(t){if(!t)return t;const n=t.split(this.radix);return n.length<2&&n.push(""),n[1]=n[1].padEnd(this.scale,"0"),n.join(this.radix)}doSkipInvalid(t,n,s){n===void 0&&(n={});const l=this.scale===0&&t!==this.thousandsSeparator&&(t===this.radix||t===ne.UNMASKED_RADIX||this.mapToRadix.includes(t));return super.doSkipInvalid(t,n,s)&&!l}get unmaskedValue(){return this._removeThousandsSeparators(this._normalizeZeros(this.value)).replace(this.radix,ne.UNMASKED_RADIX)}set unmaskedValue(t){super.unmaskedValue=t}get typedValue(){return this.parse(this.unmaskedValue,this)}set typedValue(t){this.rawInputValue=this.format(t,this).replace(ne.UNMASKED_RADIX,this.radix)}get number(){return this.typedValue}set number(t){this.typedValue=t}get allowNegative(){return this.min!=null&&this.min<0||this.max!=null&&this.max<0}get allowPositive(){return this.min!=null&&this.min>0||this.max!=null&&this.max>0}typedValueEquals(t){return(super.typedValueEquals(t)||ne.EMPTY_VALUES.includes(t)&&ne.EMPTY_VALUES.includes(this.typedValue))&&!(t===0&&this.value==="")}}zt=ne,ne.UNMASKED_RADIX=".",ne.EMPTY_VALUES=[...Q.EMPTY_VALUES,0],ne.DEFAULTS={...Q.DEFAULTS,mask:Number,radix:",",thousandsSeparator:"",mapToRadix:[zt.UNMASKED_RADIX],min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,scale:2,normalizeZeros:!0,padFractionalZeros:!1,parse:Number,format:o=>o.toLocaleString("en-US",{useGrouping:!1,maximumFractionDigits:20})},$.MaskedNumber=ne;const Re={MASKED:"value",UNMASKED:"unmaskedValue",TYPED:"typedValue"};function We(o,t,n){t===void 0&&(t=Re.MASKED),n===void 0&&(n=Re.MASKED);const s=ae(o);return l=>s.runIsolated(r=>(r[t]=l,r[n]))}function jt(o,t,n,s){return We(t,n,s)(o)}$.PIPE_TYPE=Re,$.createPipe=We,$.pipe=jt;class Ut extends ee{get repeatFrom(){var t;return(t=Array.isArray(this.repeat)?this.repeat[0]:this.repeat===1/0?0:this.repeat)!=null?t:0}get repeatTo(){var t;return(t=Array.isArray(this.repeat)?this.repeat[1]:this.repeat)!=null?t:1/0}constructor(t){super(t)}updateOptions(t){super.updateOptions(t)}_update(t){var n,s,l;const{repeat:r,...a}=ye(t);this._blockOpts=Object.assign({},this._blockOpts,a);const i=ae(this._blockOpts);this.repeat=(n=(s=r??i.repeat)!=null?s:this.repeat)!=null?n:1/0,super._update({mask:"m".repeat(Math.max(this.repeatTo===1/0&&((l=this._blocks)==null?void 0:l.length)||0,this.repeatFrom)),blocks:{m:i},eager:i.eager,overwrite:i.overwrite,skipInvalid:i.skipInvalid,lazy:i.lazy,placeholderChar:i.placeholderChar,displayChar:i.displayChar})}_allocateBlock(t){if(t<this._blocks.length)return this._blocks[t];if(this.repeatTo===1/0||this._blocks.length<this.repeatTo)return this._blocks.push(ae(this._blockOpts)),this.mask+="m",this._blocks[this._blocks.length-1]}_appendCharRaw(t,n){n===void 0&&(n={});const s=new R;for(let d=(l=(r=this._mapPosToBlock(this.displayValue.length))==null?void 0:r.index)!=null?l:Math.max(this._blocks.length-1,0),u,c;u=(a=this._blocks[d])!=null?a:c=!c&&this._allocateBlock(d);++d){var l,r,a,i;const p=u._appendChar(t,{...n,_beforeTailState:(i=n._beforeTailState)==null||(i=i._blocks)==null?void 0:i[d]});if(p.skip&&c){this._blocks.pop(),this.mask=this.mask.slice(1);break}if(s.aggregate(p),p.consumed)break}return s}_trimEmptyTail(t,n){var s,l;t===void 0&&(t=0);const r=Math.max(((s=this._mapPosToBlock(t))==null?void 0:s.index)||0,this.repeatFrom,0);let a;n!=null&&(a=(l=this._mapPosToBlock(n))==null?void 0:l.index),a==null&&(a=this._blocks.length-1);let i=0;for(let d=a;r<=d&&!this._blocks[d].unmaskedValue;--d,++i);i&&(this._blocks.splice(a-i+1,i),this.mask=this.mask.slice(i))}reset(){super.reset(),this._trimEmptyTail()}remove(t,n){t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length);const s=super.remove(t,n);return this._trimEmptyTail(t,n),s}totalInputPositions(t,n){return t===void 0&&(t=0),n==null&&this.repeatTo===1/0?1/0:super.totalInputPositions(t,n)}get state(){return super.state}set state(t){this._blocks.length=t._blocks.length,this.mask=this.mask.slice(0,this._blocks.length),super.state=t}}$.RepeatBlock=Ut;try{globalThis.IMask=$}catch{}const ai=Object.freeze(Object.defineProperty({__proto__:null,ChangeDetails:R,ChunksTailDetails:pe,DIRECTION:N,HTMLContenteditableMaskElement:Ke,HTMLInputMaskElement:Tt,HTMLMaskElement:ve,InputMask:Lt,MaskElement:Te,Masked:Q,MaskedDate:de,MaskedDynamic:Ne,MaskedEnum:Me,MaskedFunction:Ot,MaskedNumber:ne,MaskedPattern:ee,MaskedRange:Se,MaskedRegExp:Rt,PIPE_TYPE:Re,PatternFixedDefinition:Ze,PatternInputDefinition:Be,RepeatBlock:Ut,createMask:ae,createPipe:We,default:$,forceDirection:$t,normalizeOpts:ye,pipe:jt},Symbol.toStringTag,{value:"Module"}));P.ModalEdit=Nt,P.VForm=ke,P.VsInputArray=Vt,P.VsInputCheckbox=lt,P.VsInputColor=_t,P.VsInputContainer=ft,P.VsInputDate=rt,P.VsInputEmail=st,P.VsInputFile=ct,P.VsInputFileList=pt,P.VsInputKeyValue=wt,P.VsInputMask=nt,P.VsInputNumber=et,P.VsInputRadio=He,P.VsInputRange=Et,P.VsInputSelect=qe,P.VsInputSlug=xt,P.VsInputStatic=Pe,P.VsInputSwitcher=Ue,P.VsInputTag=yt,P.VsInputText=Ee,P.VsInputTextarea=mt,P.default=ke,P.inputs=Ct,P.vsInputDatatable=kt,P.vsInputMap=bt,Object.defineProperties(P,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});